diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 00000000..ea010778 --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,54 @@ +os: + - Visual Studio 2017 + +shallow_clone: true + +platform: + - Win32 + - x64 + +configuration: + - Release + +environment: + matrix: + - SETARCH: i686 + - SETARCH: x86_64 + +matrix: + exclude: + - platform: Win32 + SETARCH: x86_64 + - platform: x64 + SETARCH: i686 + +before_build: + # Setup environment: + - ps: $env:TOP = $env:APPVEYOR_BUILD_FOLDER + - ps: $env:TOP + - echo %TOP% + # Get the OpenCL Headers: + - git clone --depth=1 https://github.com/KhronosGroup/OpenCL-Headers OpenCL-Headers + # Get and build the OpenCL ICD Loader: + - git clone --depth=1 https://github.com/KhronosGroup/OpenCL-ICD-Loader.git + - ps: cd OpenCL-ICD-Loader + - ps: mkdir build + - ps: cd build + - cmake -A%PLATFORM% -DENABLE_OPENCL30_PROVISIONAL=1 -DOPENCL_ICD_LOADER_HEADERS_DIR=%TOP%/OpenCL-Headers/ .. + - cmake --build . --config %CONFIGURATION% + - ps: cd $env:TOP + # Get the libclcxx standard library: + - git clone --depth=1 https://github.com/KhronosGroup/libclcxx.git libclcxx + # Generate the CTS solution file: + - cmake -DCL_INCLUDE_DIR=%TOP%/OpenCL-Headers + -DCL_LIB_DIR=%TOP%/OpenCL-ICD-Loader/build + -DCL_LIBCLCXX_DIR=%TOP%/libclcxx + -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=./bin + -DOPENCL_LIBRARIES="OpenCL" + -H. -Bbuild_win -A%PLATFORM% + -DD3D10_IS_SUPPORTED=ON -DD3D11_IS_SUPPORTED=ON -DARCH=%SETARCH% + +build: + project: build_win\CLConform.sln + parallel: true + verbosity: normal diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..e6e5a7cb --- /dev/null +++ b/.clang-format @@ -0,0 +1,124 @@ +--- +Language: Cpp +AccessModifierOffset: -4 +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignEscapedNewlines: Right +AlignOperands: false +AlignTrailingComments: false +AllowAllArgumentsOnNextLine: true +AllowAllConstructorInitializersOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: true +AllowShortFunctionsOnASingleLine: All +AllowShortLambdasOnASingleLine: All +AllowShortIfStatementsOnASingleLine: WithoutElse +AllowShortLoopsOnASingleLine: true +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: MultiLine +BinPackArguments: true +BinPackParameters: true +BraceWrapping: + AfterCaseLabel: false + AfterClass: false + AfterControlStatement: true + AfterEnum: true + AfterFunction: true + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: true + AfterUnion: false + AfterExternBlock: false + BeforeCatch: false + BeforeElse: true + IndentBraces: false + SplitEmptyFunction: false + SplitEmptyRecord: true + SplitEmptyNamespace: true +BreakBeforeBinaryOperators: NonAssignment +BreakBeforeBraces: Custom +BreakBeforeInheritanceComma: false +BreakInheritanceList: BeforeColon +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: false +BreakConstructorInitializers: BeforeColon +BreakAfterJavaFieldAnnotations: false +BreakStringLiterals: true +ColumnLimit: 80 +CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: false +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: false +DerivePointerAlignment: true +DisableFormat: false +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: false +ForEachMacros: + - foreach + - Q_FOREACH + - BOOST_FOREACH +IncludeBlocks: Preserve +IncludeCategories: + - Regex: '^"(llvm|llvm-c|clang|clang-c)/' + Priority: 2 + - Regex: '^(<|"(gtest|gmock|isl|json)/)' + Priority: 3 + - Regex: '.*' + Priority: 1 +IncludeIsMainRegex: '(Test)?$' +IndentCaseLabels: true +IndentPPDirectives: None +IndentWidth: 4 +IndentWrappedFunctionNames: false +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: true +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 2 +NamespaceIndentation: Inner +ObjCBinPackProtocolList: Auto +ObjCBlockIndentWidth: 4 +ObjCSpaceAfterProperty: true +ObjCSpaceBeforeProtocolList: true +PenaltyBreakAssignment: 2 +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyBreakTemplateDeclaration: 10 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 60 +PointerAlignment: Left +ReflowComments: true +SortIncludes: false +SortUsingDeclarations: true +SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: false +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: ControlStatements +SpaceBeforeRangeBasedForLoopColon: true +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: false +SpacesInContainerLiterals: true +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +Standard: Cpp11 +StatementMacros: + - Q_UNUSED + - QT_REQUIRE_VERSION +TabWidth: 4 +UseTab: Never +... diff --git a/.travis.yml b/.travis.yml index d850c324..98984d8c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,28 +4,19 @@ os: - linux - osx +jobs: + include: + - os: linux + dist: bionic + env: JOB_CHECK_FORMAT=1 + addons: + apt: + packages: + - clang-format-9 + - os: linux + env: JOB_ARCHITECTURE=arm + - os: linux + env: JOB_ARCHITECTURE=aarch64 + script: - - export TOP=$(pwd) - - git clone https://github.com/KhronosGroup/OpenCL-Headers.git - - cd OpenCL-Headers - - ln -s CL OpenCL # For OSX builds - - cd .. - - git clone https://github.com/KhronosGroup/OpenCL-ICD-Loader.git - - cd ${TOP}/OpenCL-ICD-Loader - - mkdir build - - cd build - - cmake -DOPENCL_ICD_LOADER_HEADERS_DIR=${TOP}/OpenCL-Headers/ .. - - make - - cd ${TOP} - - git clone https://github.com/KhronosGroup/libclcxx.git - - ls -l - - mkdir build - - cd build - - cmake -DCL_INCLUDE_DIR=${TOP}/OpenCL-Headers - -DCL_LIB_DIR=${TOP}/OpenCL-ICD-Loader/build - -DCL_LIBCLCXX_DIR=${TOP}/libclcxx - -DCL_OFFLINE_COMPILER=/dummy/path/to/compiler - -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=./bin - -DOPENCL_LIBRARIES="-lOpenCL -lpthread" - .. - - make -j2 + - ./travis.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 139e0b0a..d8206637 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,28 +5,29 @@ set(CLConform_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) project(CLConform${CONFORMANCE_SUFFIX}) +set(CMAKE_C_STANDARD 99) +set(CMAKE_C_STANDARD_REQUIRED ON) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + if(CMAKE_BUILD_TYPE STREQUAL "release") set (BUILD_FLAVOR "release") else(CMAKE_BUILD_TYPE STREQUAL "release") set (BUILD_FLAVOR "debug") endif(CMAKE_BUILD_TYPE STREQUAL "release") -set(CLConform_VERSION_MAJOR "2") -set(CLConform_VERSION_MINOR "2") -set(CLConform_VERSION_MICRO "0") -set(CLConform_VERSION_EXTRA "") -set(CLConform_VERSION "${CLConform_VERSION_MAJOR}.${CLConform_VERSION_MINOR}") -set(CLConform_VERSION_FULL - "${CLConform_VERSION}.${CLConform_VERSION_MICRO}${CLConform_VERSION_EXTRA}") - -add_definitions(-DCL_TARGET_OPENCL_VERSION=220) - +add_definitions(-DCL_TARGET_OPENCL_VERSION=300) +add_definitions(-DCL_USE_DEPRECATED_OPENCL_2_2_APIS=1) add_definitions(-DCL_USE_DEPRECATED_OPENCL_2_1_APIS=1) add_definitions(-DCL_USE_DEPRECATED_OPENCL_2_0_APIS=1) add_definitions(-DCL_USE_DEPRECATED_OPENCL_1_2_APIS=1) add_definitions(-DCL_USE_DEPRECATED_OPENCL_1_1_APIS=1) add_definitions(-DCL_USE_DEPRECATED_OPENCL_1_0_APIS=1) +option(USE_CL_EXPERIMENTAL "Use Experimental definitions" OFF) +if(USE_CL_EXPERIMENTAL) + add_definitions(-DCL_EXPERIMENTAL) +endif(USE_CL_EXPERIMENTAL) # Support both VS2008 and VS2012. set(BUILD_DIR "$ENV{ADRENO_DRIVER}/build") @@ -92,24 +93,23 @@ endif(CLPP_DEVELOPMENT_OPTIONS) # Path to offline OpenCL C/C++ compiler provided by Khronos. # See https://github.com/KhronosGroup/SPIR/ (spirv-1.1 branch or newer SPIR-V-ready # branch should be used). -if(CL_OFFLINE_COMPILER) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DCL_OFFLINE_COMPILER=${CL_OFFLINE_COMPILER}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCL_OFFLINE_COMPILER=${CL_OFFLINE_COMPILER}") +if(KHRONOS_OFFLINE_COMPILER) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DKHRONOS_OFFLINE_COMPILER=${KHRONOS_OFFLINE_COMPILER}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DKHRONOS_OFFLINE_COMPILER=${KHRONOS_OFFLINE_COMPILER}") # Additional OpenCL C/C++ compiler option. - if(CL_OFFLINE_COMPILER_OPTIONS) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DCL_OFFLINE_COMPILER_OPTIONS=${CL_OFFLINE_COMPILER_OPTIONS}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCL_OFFLINE_COMPILER_OPTIONS=${CL_OFFLINE_COMPILER_OPTIONS}") - endif(CL_OFFLINE_COMPILER_OPTIONS) -else(CL_OFFLINE_COMPILER) - message(STATUS "OpenCL C/C++ compiler hasn't been found!") - message(FATAL_ERROR "Pass path to OpenCL C/C++ compiler in CL_OFFLINE_COMPILER") -endif(CL_OFFLINE_COMPILER) + if(KHRONOS_OFFLINE_COMPILER_OPTIONS) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DKHRONOS_OFFLINE_COMPILER_OPTIONS=${KHRONOS_OFFLINE_COMPILER_OPTIONS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DKHRONOS_OFFLINE_COMPILER_OPTIONS=${KHRONOS_OFFLINE_COMPILER_OPTIONS}") + endif(KHRONOS_OFFLINE_COMPILER_OPTIONS) +else(KHRONOS_OFFLINE_COMPILER) + message(WARNING "KHRONOS_OFFLINE_COMPILER is not defined!") + message(WARNING "Running CL C++ tests will not be possible.") +endif(KHRONOS_OFFLINE_COMPILER) # CL_LIBCLCXX_DIR - path to dir with OpenCL C++ STL (libclcxx) # CL_INCLUDE_DIR - path to dir with OpenCL headers # CL_LIBCLCXX_DIR - path to dir with OpenCL library if(CL_INCLUDE_DIR AND CL_LIB_DIR AND CL_LIBCLCXX_DIR) - set(OPENCL_INCLUDE_DIR ${CL_INCLUDE_DIR}) link_directories(${CL_LIB_DIR}) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DCL_LIBCLCXX_DIR=${CL_LIBCLCXX_DIR}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCL_LIBCLCXX_DIR=${CL_LIBCLCXX_DIR}") @@ -118,26 +118,68 @@ else(CL_INCLUDE_DIR AND CL_LIB_DIR AND CL_LIBCLCXX_DIR) message(FATAL_ERROR "Either install OpenCL or pass -DCL_INCLUDE_DIR, -DCL_LIB_DIR and -DCL_LIBCLCXX_DIR") endif(CL_INCLUDE_DIR AND CL_LIB_DIR AND CL_LIBCLCXX_DIR) +# CLConform_GL_LIBRARIES_DIR - path to OpenGL libraries +if(GL_IS_SUPPORTED AND CLConform_GL_LIBRARIES_DIR) + link_directories(${CLConform_GL_LIBRARIES_DIR}) +endif (GL_IS_SUPPORTED AND CLConform_GL_LIBRARIES_DIR) + include(CheckFunctionExists) include(CheckIncludeFiles) +include(CheckCXXCompilerFlag) + +if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm.*|ARM.*)") + set(CLConform_TARGET_ARCH ARM) +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*|arm64.*|ARM64.*)") + set(CLConform_TARGET_ARCH ARM64) +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*") + set(CLConform_TARGET_ARCH x86_64) +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*") + set(CLConform_TARGET_ARCH x86) +endif() + +if(NOT DEFINED CLConform_TARGET_ARCH) + message (FATAL_ERROR "Target architecture not recognised. Exiting.") +endif() + +macro(add_cxx_flag_if_supported flag) + string(REGEX REPLACE "[-=+]" "" FLAG_NO_SIGNS ${flag}) + check_cxx_compiler_flag(${flag} COMPILER_SUPPORTS_${FLAG_NO_SIGNS}) + if(COMPILER_SUPPORTS_${FLAG_NO_SIGNS}) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") + endif() +endmacro(add_cxx_flag_if_supported) if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?Clang") + add_cxx_flag_if_supported(-Wno-narrowing) + add_cxx_flag_if_supported(-Wno-format) + add_cxx_flag_if_supported(-Werror) + add_cxx_flag_if_supported(-Wno-error=cpp) # Allow #warning directive + add_cxx_flag_if_supported(-Wno-error=absolute-value) # Issue 783 + add_cxx_flag_if_supported(-Wno-error=unknown-pragmas) # Issue #785 + add_cxx_flag_if_supported(-Wno-error=asm-operand-widths) # Issue #784 + add_cxx_flag_if_supported(-Wno-error=overflow) # Fixed by #699 + # -msse -mfpmath=sse to force gcc to use sse for float math, # avoiding excess precision problems that cause tests like int2float # to falsely fail. -ffloat-store also works, but WG suggested # that sse would be better. - if(CMAKE_ARM_COMPILER OR ANDROID) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -std=gnu99 -Wno-narrowing") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=gnu++11 -Wno-narrowing") - else(CMAKE_ARM_COMPILER OR ANDROID) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -std=gnu99 -msse -mfpmath=sse -Wno-narrowing") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -msse -mfpmath=sse -std=gnu++11 -Wno-narrowing") - endif(CMAKE_ARM_COMPILER OR ANDROID) + if(${CLConform_TARGET_ARCH} STREQUAL "x86_64" OR ${CLConform_TARGET_ARCH} + STREQUAL "x86") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse -msse2 -mfpmath=sse") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse -msse2 -mfpmath=sse") + + add_cxx_flag_if_supported(-frounding-math) + endif() else() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D__SSE__") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D__SSE__") endif() +if( WIN32 AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel" ) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qlong-double -Qpc80 /DWIN32 /D_WINDOWS /W3 /GR /EHsc -nologo -Od -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -EHsc -Wall -Qdiag-disable:68,111,177,186,161,869,1028,2259,2553,181,239,265,1188 -fp:strict -fp:source") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qlong-double -Qpc80 /DWIN32 /D_WINDOWS /W3 /GR /EHsc -nologo -Od -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -EHsc -Wall -Qdiag-disable:68,111,177,186,161,869,1028,2259,2553,181,239,265,1188 -fp:strict -fp:source") +endif() + list(APPEND CLConform_LIBRARIES ${OPENCL_LIBRARIES}) if(ANDROID) list(APPEND CLConform_LIBRARIES m) @@ -152,11 +194,11 @@ if(APPLE) list(APPEND CLConform_LIBRARIES ${iokit}) endif(APPLE) -include_directories(SYSTEM ${OPENCL_INCLUDE_DIR}) +include_directories(SYSTEM ${CL_INCLUDE_DIR}) include_directories(${CLConform_SOURCE_DIR}/test_common/harness ${CLConform_SOURCE_DIR}/test_common/gles ${CLConform_SOURCE_DIR}/test_common/gl - ${CMAKE_CURRENT_SOURCE_DIR}/test_common/harness) + ${CLConform_SOURCE_DIR}/test_common) if(CMAKE_BUILD_TYPE STREQUAL "release") set (BUILD_FLAVOR "release") @@ -165,10 +207,10 @@ elseif (CMAKE_BUILD_TYPE STREQUAL "debug") endif(CMAKE_BUILD_TYPE STREQUAL "release") +add_subdirectory(test_common) add_subdirectory(test_conformance) +add_subdirectory(test_extensions) -set (PY_PATH "${CLConform_SOURCE_DIR}/test_conformance/*.py") -set (CSV_PATH "${CLConform_SOURCE_DIR}/test_conformance/*.csv") # Support both VS2008 and VS2012. set (DLL_FILES "${VS_BUILD_DIR}/Debug/*.dll") set (DST_DIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug/") @@ -187,25 +229,10 @@ set_property(TARGET COPY_DLL${CONFORMANCE_SUFFIX} PROPERTY FOLDER "CONFORMANCE${ if(WIN32) add_custom_target( COPY_FILES${CONFORMANCE_SUFFIX} ALL - COMMAND ${COPY} ${PY_PATH} ${DST_DIR} - COMMAND ${COPY} ${CSV_PATH} ${DST_DIR} COMMAND ${COPY} ${DLL_FILES} ${DST_DIR} COMMENT "Copying other files to output folder..." ) else(WIN32) add_custom_target( COPY_FILES${CONFORMANCE_SUFFIX} ) endif(WIN32) -# Copy required CL include directories into the build directory -# as required for the compiler testing. - -# ... For running the compiler test on the command line. -file(COPY "${CLConform_SOURCE_DIR}/test_conformance/compiler/includeTestDirectory" DESTINATION ${DST_DIR}) -file(COPY "${CLConform_SOURCE_DIR}/test_conformance/compiler/secondIncludeTestDirectory" DESTINATION ${DST_DIR}) - -# ... For running the compiler test with VisualStudio. -if(MSVC) - file(COPY "${CLConform_SOURCE_DIR}/test_conformance/compiler/includeTestDirectory" DESTINATION "${CLConform_SOURCE_DIR}/build/test_conformance/compiler") - file(COPY "${CLConform_SOURCE_DIR}/test_conformance/compiler/secondIncludeTestDirectory" DESTINATION "${CLConform_SOURCE_DIR}/build/test_conformance/compiler") -endif(MSVC) - set_property(TARGET COPY_FILES${CONFORMANCE_SUFFIX} PROPERTY FOLDER "CONFORMANCE${CONFORMANCE_SUFFIX}") diff --git a/build_android.py b/build_android.py index 2bd7f5c8..e1b8c1e9 100755 --- a/build_android.py +++ b/build_android.py @@ -108,7 +108,9 @@ def install_android_cmake(): print "input: " if get_input(): print("installing android-cmake") - subprocess.call(['git', 'clone', 'https://github.com/taka-no-me/android-cmake']) + #subprocess.call(['git', 'clone', 'https://github.com/taka-no-me/android-cmake']) + # Use a newer fork of android-cmake which has been updated to support Clang. GCC is deprecated in newer NDKs and C11 atomics conformance doesn't build with NDK > 10. + subprocess.call(['git', 'clone', 'https://github.com/daewoong-jang/android-cmake']) args.android_cmake = os.path.join(args.src_dir,"android-cmake") else: exit() diff --git a/build_lnx.sh b/build_lnx.sh index c9bde6e1..be0da149 100755 --- a/build_lnx.sh +++ b/build_lnx.sh @@ -2,5 +2,11 @@ mkdir -p build_lnx cd build_lnx -cmake -g "Unix Makefiles" ../ -DCL_OFFLINE_COMPILER= -DCL_LIBCLCXX_DIR= -DCL_INCLUDE_DIR= -DCL_LIB_DIR= -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=. -DOPENCL_LIBRARIES=OpenCL +cmake -G "Unix Makefiles" ../ \ + -DKHRONOS_OFFLINE_COMPILER= \ + -DCL_LIBCLCXX_DIR= \ + -DCL_INCLUDE_DIR= \ + -DCL_LIB_DIR= \ + -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=. \ + -DOPENCL_LIBRARIES=OpenCL make --jobs 8 diff --git a/build_win.bat b/build_win.bat index 0e715656..6ae31827 100644 --- a/build_win.bat +++ b/build_win.bat @@ -20,7 +20,7 @@ mkdir build_win pushd build_win IF NOT EXIST CLConform.sln ( echo "Solution file not found, running Cmake" - cmake -G "Visual Studio 14 2015 Win64" ..\. -DCL_OFFLINE_COMPILER= -DCL_LIBCLCXX_DIR= -DCL_INCLUDE_DIR= -DCL_LIB_DIR= -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=. -DOPENCL_LIBRARIES=OpenCL + cmake -G "Visual Studio 14 2015 Win64" ..\. -DKHRONOS_OFFLINE_COMPILER= -DCL_LIBCLCXX_DIR= -DCL_INCLUDE_DIR= -DCL_LIB_DIR= -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=. -DOPENCL_LIBRARIES=OpenCL ) else ( echo "Solution file found CLConform.sln " ) diff --git a/check-format.sh b/check-format.sh new file mode 100755 index 00000000..7eae2fdc --- /dev/null +++ b/check-format.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +# Arg used to specify non-'origin/master' comparison branch +ORIGIN_BRANCH=${1:-"origin/master"} + +# Run git-clang-format to check for violations +if [ "$TRAVIS" == "true" ]; then + EXTRA_OPTS="--binary `which clang-format-9`" +fi +CLANG_FORMAT_OUTPUT=$(git-clang-format --diff $ORIGIN_BRANCH --extensions c,cpp,h,hpp $EXTRA_OPTS) + +# Check for no-ops +grep '^no modified files to format$' <<<"$CLANG_FORMAT_OUTPUT" && exit 0 +grep '^clang-format did not modify any files$' <<<"$CLANG_FORMAT_OUTPUT" && exit 0 + +# Dump formatting diff and signal failure +echo -e "\n==== FORMATTING VIOLATIONS DETECTED ====\n" +echo "$CLANG_FORMAT_OUTPUT" +exit 1 diff --git a/clean_tests.py b/clean_tests.py deleted file mode 100755 index 4ee0294f..00000000 --- a/clean_tests.py +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/python - -import sys, os, re -from subprocess import Popen, PIPE -from optparse import OptionParser - -# trail_spaces: This method removes the trailing whitespaces and trailing tabs -def trail_spaces(line): - newline=line - carreturn = 0 - if re.search("\r\n",line): - carreturn = 1 - status = re.search("\s+$",line) - if status: - if carreturn: - newline = re.sub("\s+$","\r\n",line) - else: - newline = re.sub("\s+$","\n",line) - - status = re.search("\t+$",newline) - if status: - newline = re.sub("\t+$","",newline) - return newline - -#convert_tabs: This methos converts tabs to 4 spaces -def convert_tabs(line): - newline=line - status = re.search("\t",line) - if status: - newline = re.sub("\t"," ",line) - return newline - -#convert_lineends: This method converts lineendings from DOS to Unix -def convert_lineends(line): - newline=line - status = re.search("\r\n",line) - if status: - newline = re.sub("\r\n","\n",line) - return newline - -#processfile: This method processes each file passed to it depending -# on the flags passed - -def processfile(file,tabs, lineends,trails,verbose): - processed_data = [] - if verbose: - print "processing file: "+file - - with open(file,'r') as fr: - data = fr.readlines() - for line in data: - if tabs: - line = convert_tabs(line) - if lineends: - line = convert_lineends(line) - if trails: - line = trail_spaces(line) - processed_data.append(line) - - with open(file,'w') as fw: - fw.writelines(processed_data) - -#findfiles: This method finds all the code files present in current -# directory and subdirectories. - -def findfiles(tabs,lineends,trails,verbose): - testfiles = [] - for root, dirs, files in os.walk("./"): - for file in files: - for extn in ('.c','.cpp','.h','.hpp'): - if file.endswith(extn): - testfiles.append(os.path.join(root, file)) - for file in testfiles: - processfile(file,tabs,lineends,trails,verbose) - -# Main function - -def main(): - - parser = OptionParser() - parser.add_option("--notabs", dest="tabs", action="store_false", default=True, help="Disable converting tabs to 4 spaces.") - parser.add_option("--notrails", dest="trails", action="store_false", default=True, help="Disable removing trailing whitespaces and trailing tabs.") - parser.add_option("--nolineends", dest="lineends", action="store_false", default=True, help=" Disable converting line endings to Unix from DOS.") - parser.add_option("--verbose", dest="verbose", action="store_true", default=False, help="Prints out the files being processed.") - parser.add_option("--git", dest="SHA1", default="", help="Processes only the files present in the particular commit.") - parser.add_option('-o', action="store", default=True, help="Default: All the code files (.c,.cpp,.h,.hpp) in the current directory and subdirectories will be processed") - - (options, args) = parser.parse_args() - - if options.SHA1: - pl = Popen(["git","show", "--pretty=format:", "--name-only",options.SHA1], stdout=PIPE) - cmdout = pl.communicate()[0] - gitout=cmdout.split("\n") - for file in gitout: - print file - if file: - processfile(file,options.tabs,options.lineends,options.trails,options.verbose) - - - if not options.SHA1: - findfiles(options.tabs,options.lineends,options.trails,options.verbose) - -# start the process by calling main -main() diff --git a/readme-spir-v-binaries.txt b/readme-spir-v-binaries.txt index 258a0dc7..ee09cd50 100644 --- a/readme-spir-v-binaries.txt +++ b/readme-spir-v-binaries.txt @@ -1,7 +1,6 @@ -To run the 2.2 conformance tests test suite for the C++ features you need -SPIR-V binaries. +To run the conformance tests you need SPIR-V binaries. -If you are using a conformance package then the binaries are included in the +If you are using a conformance package then the binaries are included in the package. If you are using conformance tests from gitlab repositories then the binaries need to be picked up from Khronos SVN URL mentioned below: @@ -39,4 +38,4 @@ Branch: opencl22 5. OpenCL ICD (with 2.2 support) OpenCL ICD Repository: https://gitlab.khronos.org/opencl/icd -Branch: dev_cl22 \ No newline at end of file +Branch: dev_cl22 diff --git a/test_common/CMakeLists.txt b/test_common/CMakeLists.txt new file mode 100644 index 00000000..1dffd379 --- /dev/null +++ b/test_common/CMakeLists.txt @@ -0,0 +1,24 @@ + +set(HARNESS_SOURCES + harness/threadTesting.cpp + harness/typeWrappers.cpp + harness/mt19937.cpp + harness/conversions.cpp + harness/rounding_mode.cpp + harness/msvc9.c + harness/crc32.cpp + harness/errorHelpers.cpp + harness/genericThread.cpp + harness/imageHelpers.cpp + harness/kernelHelpers.cpp + harness/deviceInfo.cpp + harness/os_helpers.cpp + harness/parseParameters.cpp + harness/propertyHelpers.cpp + harness/testHarness.cpp + harness/ThreadPool.cpp + miniz/miniz.c +) + +add_library(harness STATIC ${HARNESS_SOURCES}) + diff --git a/test_common/autotest/test_suite.hpp b/test_common/autotest/test_suite.hpp index ea9eb9b8..3616bee4 100644 --- a/test_common/autotest/test_suite.hpp +++ b/test_common/autotest/test_suite.hpp @@ -51,7 +51,7 @@ struct test_case_registration { test_case_registration(const std::string& name, const basefn ptr) { - ::autotest::test_suite::global_test_suite().add(test_definition({ptr, name.c_str()})); + ::autotest::test_suite::global_test_suite().add(test_definition({ptr, strdup(name.c_str())})); } }; diff --git a/test_common/gl/gl_headers.h b/test_common/gl/gl_headers.h index 61fbe63c..2ec618bd 100644 --- a/test_common/gl/gl_headers.h +++ b/test_common/gl/gl_headers.h @@ -37,9 +37,8 @@ #include #include #else - #include + #include #include - #include #endif #ifdef _WIN32 #include diff --git a/test_common/gl/helpers.cpp b/test_common/gl/helpers.cpp index c02a4b12..0d5cba75 100644 --- a/test_common/gl/helpers.cpp +++ b/test_common/gl/helpers.cpp @@ -14,11 +14,7 @@ // limitations under the License. // #include "helpers.h" -#include "../harness/imageHelpers.h" - -// convert_float_to_half and convert_half_to_float may be found in test_conformance/images/image_helpers.cpp -cl_ushort convert_float_to_half( cl_float f ); -cl_float convert_half_to_float( cl_ushort h ); +#include "harness/imageHelpers.h" #if defined( __APPLE__ ) #include diff --git a/test_common/gl/helpers.h b/test_common/gl/helpers.h index ace1d16a..084c434a 100644 --- a/test_common/gl/helpers.h +++ b/test_common/gl/helpers.h @@ -32,12 +32,12 @@ #include "gl_headers.h" #endif -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/threadTesting.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/mt19937.h" +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" +#include "harness/threadTesting.h" +#include "harness/typeWrappers.h" +#include "harness/conversions.h" +#include "harness/mt19937.h" typedef cl_mem (CL_API_CALL *clCreateFromGLBuffer_fn)(cl_context context, diff --git a/test_common/gl/setup_osx.cpp b/test_common/gl/setup_osx.cpp index 01641be0..084703a7 100644 --- a/test_common/gl/setup_osx.cpp +++ b/test_common/gl/setup_osx.cpp @@ -14,7 +14,7 @@ // limitations under the License. // #include "setup.h" -#include "../../test_common/harness/errorHelpers.h" +#include "harness/errorHelpers.h" #include class OSXGLEnvironment : public GLEnvironment @@ -92,16 +92,9 @@ class OSXGLEnvironment : public GLEnvironment return NULL; } - char extensions[8192]; for (int i=0; i<(int)(size_out/sizeof(cl_device_id)); i++) { - error = clGetDeviceInfo(devices[i], CL_DEVICE_EXTENSIONS, sizeof(extensions), extensions, NULL); - if (error) { - print_error(error, "clGetDeviceInfo failed"); - return NULL; - } - - if (strstr(extensions, "cl_APPLE_gl_sharing") == NULL) { - log_error("Device %d does not supporte required extension cl_APPLE_gl_sharing.\n", i); + if (!is_extension_available(devices[i], "cl_APPLE_gl_sharing")) { + log_error("Device %d does not support required extension cl_APPLE_gl_sharing.\n", i); return NULL; } } @@ -120,15 +113,8 @@ class OSXGLEnvironment : public GLEnvironment return -1; } - char extensions[8192]; for (int i=0; i<(int)num_of_devices; i++) { - error = clGetDeviceInfo(devices[i], CL_DEVICE_EXTENSIONS, sizeof(extensions), extensions, NULL); - if (error) { - print_error(error, "clGetDeviceInfo failed"); - return -1; - } - - if (strstr(extensions, "cl_APPLE_gl_sharing") == NULL) { + if (!is_extension_available(devices[i], "cl_APPLE_gl_sharing")) { log_info("Device %d of %d does not support required extension cl_APPLE_gl_sharing.\n", i, num_of_devices); } else { log_info("Device %d of %d does support required extension cl_APPLE_gl_sharing.\n", i, num_of_devices); diff --git a/test_common/gl/setup_win32.cpp b/test_common/gl/setup_win32.cpp index 1c7b4b2f..b120a36d 100644 --- a/test_common/gl/setup_win32.cpp +++ b/test_common/gl/setup_win32.cpp @@ -17,12 +17,10 @@ #include "setup.h" #include "testBase.h" -#include "../../test_common/harness/errorHelpers.h" +#include "harness/errorHelpers.h" #include #include -#include -#include #include typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGLContextInfoKHR_fn)( @@ -177,15 +175,8 @@ public: } // Check all devices, search for one that supports cl_khr_gl_sharing - char extensions[8192]; for (int i=0; i<(int)num_of_devices; i++) { - error = clGetDeviceInfo(devices[i], CL_DEVICE_EXTENSIONS, sizeof(extensions), extensions, NULL); - if (error) { - print_error(error, "clGetDeviceInfo failed"); - return -1; - } - - if (strstr(extensions, "cl_khr_gl_sharing") == NULL) { + if (!is_extension_available(devices[i], "cl_khr_gl_sharing")) { log_info("Device %d of %d does not support required extension cl_khr_gl_sharing.\n", i+1, num_of_devices); } else { log_info("Device %d of %d supports required extension cl_khr_gl_sharing.\n", i+1, num_of_devices); diff --git a/test_common/gl/setup_x11.cpp b/test_common/gl/setup_x11.cpp index 22bc7eed..c54ecdec 100644 --- a/test_common/gl/setup_x11.cpp +++ b/test_common/gl/setup_x11.cpp @@ -17,7 +17,7 @@ #include "setup.h" #include "testBase.h" -#include "../../test_common/harness/errorHelpers.h" +#include "harness/errorHelpers.h" #include #include @@ -89,15 +89,8 @@ public: return -1; } - char extensions[8192]; for (int i=0; i<(int)num_of_devices; i++) { - error = clGetDeviceInfo(devices[i], CL_DEVICE_EXTENSIONS, sizeof(extensions), extensions, NULL); - if (error) { - print_error(error, "clGetDeviceInfo failed"); - return -1; - } - - if (strstr(extensions, "cl_khr_gl_sharing ") == NULL) { + if (!is_extension_available(devices[i], "cl_khr_gl_sharing ")) { log_info("Device %d of %d does not support required extension cl_khr_gl_sharing.\n", i+1, num_of_devices); } else { log_info("Device %d of %d supports required extension cl_khr_gl_sharing.\n", i+1, num_of_devices); diff --git a/test_common/gles/helpers.cpp b/test_common/gles/helpers.cpp index 188f9039..579c841b 100644 --- a/test_common/gles/helpers.cpp +++ b/test_common/gles/helpers.cpp @@ -961,49 +961,6 @@ const char *GetGLFormatName( GLenum format ) } } -cl_ushort float2half_rte( float f ) -{ - union{ float f; cl_uint u; } u = {f}; - cl_uint sign = (u.u >> 16) & 0x8000; - float x = fabsf(f); - - //Nan - if( x != x ) - { - u.u >>= (24-11); - u.u &= 0x7fff; - u.u |= 0x0200; //silence the NaN - return u.u | sign; - } - - // overflow - if( x >= MAKE_HEX_FLOAT(0x1.ffep15f, 0x1ffeL, 3) ) - return 0x7c00 | sign; - - // underflow - if( x <= MAKE_HEX_FLOAT(0x1.0p-25f, 0x1L, -25) ) - return sign; // The halfway case can return 0x0001 or 0. 0 is even. - - // very small - if( x < MAKE_HEX_FLOAT(0x1.8p-24f, 0x18L, -28) ) - return sign | 1; - - // half denormal - if( x < MAKE_HEX_FLOAT(0x1.0p-14f, 0x1L, -14) ) - { - u.f = x * MAKE_HEX_FLOAT(0x1.0p-125f, 0x1L, -125); - return sign | u.u; - } - - u.f *= MAKE_HEX_FLOAT(0x1.0p13f, 0x1L, 13); - u.u &= 0x7f800000; - x += u.f; - u.f = x - u.f; - u.f *= MAKE_HEX_FLOAT(0x1.0p-112f, 0x1L, -112); - - return (u.u >> (24-11)) | sign; -} - void* CreateRandomData( ExplicitType type, size_t count, MTdata d ) { switch(type) @@ -1100,7 +1057,8 @@ void* CreateRandomData( ExplicitType type, size_t count, MTdata d ) for( size_t i = 0; i < count; i++ ) { - p[ i ] = float2half_rte(get_random_float( 0.f, 1.f, d )); + p[i] = cl_half_from_float(get_random_float(0.f, 1.f, d), + CL_HALF_RTE); } return (void*)p; diff --git a/test_common/gles/helpers.h b/test_common/gles/helpers.h index 95faae12..5bd0fdf1 100644 --- a/test_common/gles/helpers.h +++ b/test_common/gles/helpers.h @@ -36,12 +36,12 @@ #include "gl_headers.h" #endif -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/threadTesting.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/mt19937.h" +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" +#include "harness/threadTesting.h" +#include "harness/typeWrappers.h" +#include "harness/conversions.h" +#include "harness/mt19937.h" typedef cl_mem (CL_API_CALL *clCreateFromGLBuffer_fn)(cl_context context, diff --git a/test_common/harness/ThreadPool.c b/test_common/harness/ThreadPool.cpp similarity index 99% rename from test_common/harness/ThreadPool.c rename to test_common/harness/ThreadPool.cpp index 16f31e74..6d64681a 100644 --- a/test_common/harness/ThreadPool.c +++ b/test_common/harness/ThreadPool.cpp @@ -371,8 +371,7 @@ void *ThreadPool_WorkerFunc( void *p ) { #if (__MINGW32__) EnterCriticalSection(&gAtomicLock); - if( jobError == CL_SUCCESS ); - jobError = err; + if (jobError == CL_SUCCESS) jobError = err; gRunCount = 0; LeaveCriticalSection(&gAtomicLock); #elif defined( __GNUC__ ) @@ -393,8 +392,7 @@ void *ThreadPool_WorkerFunc( void *p ) #else if( pthread_mutex_lock(&gAtomicLock) ) log_error( "Atomic operation failed. pthread_mutex_lock(&gAtomicLock) returned an error\n"); - if( jobError == CL_SUCCESS ); - jobError = err; + if (jobError == CL_SUCCESS) jobError = err; gRunCount = 0; if( pthread_mutex_unlock(&gAtomicLock) ) log_error( "Failed to release gAtomicLock. Further atomic operations may deadlock\n"); @@ -446,6 +444,7 @@ void ThreadPool_Init(void) // Check for manual override of multithreading code. We add this for better debuggability. if( getenv( "CL_TEST_SINGLE_THREADED" ) ) { + log_error("ERROR: CL_TEST_SINGLE_THREADED is set in the environment. Running single threaded.\n*** TEST IS INVALID! ***\n"); gThreadCount = 1; return; } diff --git a/test_common/harness/ThreadPool.h b/test_common/harness/ThreadPool.h index 7c392306..2fa9c7b5 100644 --- a/test_common/harness/ThreadPool.h +++ b/test_common/harness/ThreadPool.h @@ -22,10 +22,6 @@ #include #endif -#if defined(__cplusplus) - extern "C" { -#endif - // // An atomic add operator cl_int ThreadPool_AtomicAdd( volatile cl_int *a, cl_int b ); // returns old value @@ -68,9 +64,5 @@ cl_uint GetThreadCount( void ); // otherwise the behavior is indefined. It may not be called from a TPFuncPtr. void SetThreadCount( int count ); -#ifdef __cplusplus - } /* extern "C" */ -#endif - #endif /* THREAD_POOL_H */ diff --git a/test_common/harness/alloc.h b/test_common/harness/alloc.h new file mode 100644 index 00000000..33e6bd81 --- /dev/null +++ b/test_common/harness/alloc.h @@ -0,0 +1,71 @@ +// +// Copyright (c) 2020 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#ifndef HARNESS_ALLOC_H_ +#define HARNESS_ALLOC_H_ + +#if defined(__linux__) || defined (linux) || defined(__APPLE__) +#if defined(__ANDROID__) +#include +#else +#include +#endif +#endif + +#if defined(__MINGW32__) +#include "mingw_compat.h" +#endif + +static void * align_malloc(size_t size, size_t alignment) +{ +#if defined(_WIN32) && defined(_MSC_VER) + return _aligned_malloc(size, alignment); +#elif defined(__linux__) || defined (linux) || defined(__APPLE__) + void * ptr = NULL; +#if defined(__ANDROID__) + ptr = memalign(alignment, size); + if ( ptr ) + return ptr; +#else + if (alignment < sizeof(void*)) { + alignment = sizeof(void*); + } + if (0 == posix_memalign(&ptr, alignment, size)) + return ptr; +#endif + return NULL; +#elif defined(__MINGW32__) + return __mingw_aligned_malloc(size, alignment); +#else + #error "Please add support OS for aligned malloc" +#endif +} + +static void align_free(void * ptr) +{ +#if defined(_WIN32) && defined(_MSC_VER) + _aligned_free(ptr); +#elif defined(__linux__) || defined (linux) || defined(__APPLE__) + return free(ptr); +#elif defined(__MINGW32__) + return __mingw_aligned_free(ptr); +#else + #error "Please add support OS for aligned free" +#endif +} + +#endif // #ifndef HARNESS_ALLOC_H_ + diff --git a/test_common/harness/clImageHelper.h b/test_common/harness/clImageHelper.h index b09b7bd4..83f7b277 100644 --- a/test_common/harness/clImageHelper.h +++ b/test_common/harness/clImageHelper.h @@ -25,10 +25,6 @@ #include #include "errorHelpers.h" -#ifdef __cplusplus -extern "C" { -#endif - // helper function to replace clCreateImage2D , to make the existing code use // the functions of version 1.2 and veriosn 1.1 respectively @@ -46,7 +42,7 @@ extern "C" { #ifdef CL_VERSION_1_2 cl_image_desc image_desc_dest; - image_desc_dest.image_type = CL_MEM_OBJECT_IMAGE2D;; + image_desc_dest.image_type = CL_MEM_OBJECT_IMAGE2D; image_desc_dest.image_width = image_width; image_desc_dest.image_height = image_height; image_desc_dest.image_depth= 0;// not usedfor 2d @@ -90,7 +86,7 @@ extern "C" { cl_mem mImage = NULL; cl_image_desc image_desc_dest; - image_desc_dest.image_type = CL_MEM_OBJECT_IMAGE2D;; + image_desc_dest.image_type = CL_MEM_OBJECT_IMAGE2D; image_desc_dest.image_width = image_width; image_desc_dest.image_height = image_height; image_desc_dest.image_depth= 0;// not usedfor 2d @@ -283,8 +279,4 @@ extern "C" { } -#ifdef __cplusplus -} -#endif - #endif diff --git a/test_common/harness/cl_offline_compiler-interface.txt b/test_common/harness/cl_offline_compiler-interface.txt new file mode 100644 index 00000000..fd6997de --- /dev/null +++ b/test_common/harness/cl_offline_compiler-interface.txt @@ -0,0 +1,27 @@ +The cl_offline_compiler program used for offline compilation must +implement the following interface. + + usage: cl_offline_compiler --source FILE --output FILE + --cl-device-info FILE --mode MODE + -- [BUILD_OPTIONS [BUILD_OPTIONS ...]] + + positional arguments: + BUILD_OPTIONS additional options to pass to the compiler + + optional arguments: + --source FILE OpenCL C source file to compile + --output FILE SPIR-V or binary file to create + --cl-device-info FILE OpenCL device info file + --mode compilation mode (spir-v or binary) + +The --cl-device-info file is a list of KEY=VALUE pairs containing device +information relevant to the mode of offline compilation in question. +It is of the following form: + + # OpenCL device info affecting offline compilation: + CL_DEVICE_ADDRESS_BITS=<32|64> + CL_DEVICE_EXTENSIONS="" + CL_DEVICE_IL_VERSION="" + CL_DEVICE_VERSION="OpenCL " + CL_DEVICE_IMAGE_SUPPORT=<0|1> + CL_DEVICE_NAME="device name" diff --git a/test_common/harness/compat.h b/test_common/harness/compat.h index 23445c8e..3858a7ce 100644 --- a/test_common/harness/compat.h +++ b/test_common/harness/compat.h @@ -117,112 +117,117 @@ typedef long long int64_t; #include #endif +#ifndef M_PI + #define M_PI 3.14159265358979323846264338327950288 +#endif + #if defined( _MSC_VER ) #ifdef __cplusplus extern "C" { #endif -#ifndef M_PI - #define M_PI 3.14159265358979323846264338327950288 -#endif + #ifndef NAN + #define NAN (INFINITY - INFINITY) + #endif - #if ! defined( __INTEL_COMPILER ) + #ifndef HUGE_VALF + #define HUGE_VALF (float)HUGE_VAL + #endif - #ifndef NAN - #define NAN (INFINITY - INFINITY) - #endif - #ifndef HUGE_VALF - #define HUGE_VALF (float)HUGE_VAL - #endif - #ifndef INFINITY - #define INFINITY (FLT_MAX + FLT_MAX) - #endif - #ifndef isfinite - #define isfinite(x) _finite(x) - #endif - #ifndef isnan -#define isnan( x ) ((x) != (x)) - #endif - #ifndef isinf -#define isinf( _x) ((_x) == INFINITY || (_x) == -INFINITY) - #endif + #ifndef INFINITY + #define INFINITY (FLT_MAX + FLT_MAX) + #endif -double rint( double x); -float rintf( float x); -long double rintl( long double x); + #ifndef isfinite + #define isfinite(x) _finite(x) + #endif -float cbrtf( float ); -double cbrt( double ); + #ifndef isnan + #define isnan( x ) ((x) != (x)) + #endif -int ilogb( double x); -int ilogbf (float x); -int ilogbl(long double x); + #ifndef isinf + #define isinf( _x) ((_x) == INFINITY || (_x) == -INFINITY) + #endif + + #if _MSC_VER < 1900 && ! defined( __INTEL_COMPILER ) -double fmax(double x, double y); -double fmin(double x, double y); -float fmaxf( float x, float y ); -float fminf(float x, float y); + double rint( double x); + float rintf( float x); + long double rintl( long double x); -double log2(double x); -long double log2l(long double x); + float cbrtf( float ); + double cbrt( double ); -double exp2(double x); -long double exp2l(long double x); + int ilogb( double x); + int ilogbf (float x); + int ilogbl(long double x); -double fdim(double x, double y); -float fdimf(float x, float y); -long double fdiml(long double x, long double y); + double fmax(double x, double y); + double fmin(double x, double y); + float fmaxf( float x, float y ); + float fminf(float x, float y); -double remquo( double x, double y, int *quo); -float remquof( float x, float y, int *quo); -long double remquol( long double x, long double y, int *quo); + double log2(double x); + long double log2l(long double x); -long double scalblnl(long double x, long n); + double exp2(double x); + long double exp2l(long double x); -float hypotf(float x, float y); -long double hypotl(long double x, long double y) ; -double lgamma(double x); -float lgammaf(float x); + double fdim(double x, double y); + float fdimf(float x, float y); + long double fdiml(long double x, long double y); -double trunc(double x); -float truncf(float x); + double remquo( double x, double y, int *quo); + float remquof( float x, float y, int *quo); + long double remquol( long double x, long double y, int *quo); -double log1p(double x); -float log1pf(float x); -long double log1pl(long double x); + long double scalblnl(long double x, long n); -double copysign(double x, double y); -float copysignf(float x, float y); -long double copysignl(long double x, long double y); + float hypotf(float x, float y); + long double hypotl(long double x, long double y) ; + double lgamma(double x); + float lgammaf(float x); -long lround(double x); -long lroundf(float x); -//long lroundl(long double x) + double trunc(double x); + float truncf(float x); -double round(double x); -float roundf(float x); -long double roundl(long double x); + double log1p(double x); + float log1pf(float x); + long double log1pl(long double x); + + double copysign(double x, double y); + float copysignf(float x, float y); + long double copysignl(long double x, long double y); + + long lround(double x); + long lroundf(float x); + //long lroundl(long double x) + + double round(double x); + float roundf(float x); + long double roundl(long double x); int cf_signbit(double x); int cf_signbitf(float x); -// Added in _MSC_VER == 1800 (Visual Studio 2013) -#if _MSC_VER < 1800 - static int signbit(double x) { return cf_signbit(x); } -#endif + // Added in _MSC_VER == 1800 (Visual Studio 2013) + #if _MSC_VER < 1800 + static int signbit(double x) { return cf_signbit(x); } + #endif static int signbitf(float x) { return cf_signbitf(x); } -long int lrint (double flt); -long int lrintf (float flt); + long int lrint (double flt); + long int lrintf (float flt); -float int2float (int32_t ix); -int32_t float2int (float fx); + float int2float (int32_t ix); + int32_t float2int (float fx); - #endif + #endif // _MSC_VER < 1900 && ! defined( __INTEL_COMPILER ) - #if ! defined( __INTEL_COMPILER ) || __INTEL_COMPILER < 1300 - // These functions appeared in Intel C v13. + #if _MSC_VER < 1900 && ( ! defined( __INTEL_COMPILER ) || __INTEL_COMPILER < 1300 ) + // These functions appeared in Intel C v13 and Visual Studio 2015 float nanf( const char* str); double nan( const char* str); long double nanl( const char* str); @@ -253,6 +258,16 @@ int32_t float2int (float fx); +// +// string.h +// + +#if defined(_MSC_VER) + #define strtok_r strtok_s +#endif + + + // // unistd.h // diff --git a/test_common/harness/conversions.c b/test_common/harness/conversions.cpp similarity index 100% rename from test_common/harness/conversions.c rename to test_common/harness/conversions.cpp diff --git a/test_common/harness/conversions.h b/test_common/harness/conversions.h index aa3cb6b4..8e5346d4 100644 --- a/test_common/harness/conversions.h +++ b/test_common/harness/conversions.h @@ -25,10 +25,6 @@ #include #include -#if defined(__cplusplus) -extern "C" { -#endif - /* Note: the next three all have to match in size and order!! */ enum ExplicitTypes @@ -117,9 +113,11 @@ static inline int IsDoubleSubnormal( double x ) #endif } -#if defined(__cplusplus) +static inline int IsHalfSubnormal( cl_half x ) +{ + // this relies on interger overflow to exclude 0 as a subnormal + return ( ( x & 0x7fffU ) - 1U ) < 0x03ffU; } -#endif #endif // _conversions_h diff --git a/test_common/harness/crc32.c b/test_common/harness/crc32.c deleted file mode 100644 index a34be300..00000000 --- a/test_common/harness/crc32.c +++ /dev/null @@ -1,104 +0,0 @@ -/*- - * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or - * code or tables extracted from it, as desired without restriction. - * - * First, the polynomial itself and its table of feedback terms. The - * polynomial is - * X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 - * - * Note that we take it "backwards" and put the highest-order term in - * the lowest-order bit. The X^32 term is "implied"; the LSB is the - * X^31 term, etc. The X^0 term (usually shown as "+1") results in - * the MSB being 1 - * - * Note that the usual hardware shift register implementation, which - * is what we're using (we're merely optimizing it by doing eight-bit - * chunks at a time) shifts bits into the lowest-order term. In our - * implementation, that means shifting towards the right. Why do we - * do it this way? Because the calculated CRC must be transmitted in - * order from highest-order term to lowest-order term. UARTs transmit - * characters in order from LSB to MSB. By storing the CRC this way - * we hand it to the UART in the order low-byte to high-byte; the UART - * sends each low-bit to hight-bit; and the result is transmission bit - * by bit from highest- to lowest-order term without requiring any bit - * shuffling on our part. Reception works similarly - * - * The feedback terms table consists of 256, 32-bit entries. Notes - * - * The table can be generated at runtime if desired; code to do so - * is shown later. It might not be obvious, but the feedback - * terms simply represent the results of eight shift/xor opera - * tions for all combinations of data and CRC register values - * - * The values must be right-shifted by eight bits by the "updcrc - * logic; the shift must be unsigned (bring in zeroes). On some - * hardware you could probably optimize the shift in assembler by - * using byte-swap instructions - * polynomial $edb88320 - * - * - * CRC32 code derived from work by Gary S. Brown. - */ - -#include "crc32.h" - -static uint32_t crc32_tab[] = { - 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, - 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, - 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, - 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, - 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, - 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, - 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, - 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, - 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, - 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, - 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, - 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, - 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, - 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, - 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, - 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, - 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, - 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, - 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, - 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, - 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, - 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, - 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, - 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, - 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, - 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, - 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, - 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, - 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, - 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, - 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, - 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, - 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, - 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, - 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, - 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, - 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, - 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, - 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, - 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, - 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, - 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, - 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d -}; - -uint32_t -crc32(const void *buf, size_t size) -{ - const uint8_t *p; - - p = (const uint8_t*)buf; - uint32_t crc = ~0U; - - while (size--) - crc = crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8); - - return crc ^ ~0U; -} - diff --git a/test_common/harness/crc32.cpp b/test_common/harness/crc32.cpp new file mode 100644 index 00000000..e2d1bc27 --- /dev/null +++ b/test_common/harness/crc32.cpp @@ -0,0 +1,101 @@ +/*- + * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or + * code or tables extracted from it, as desired without restriction. + * + * First, the polynomial itself and its table of feedback terms. The + * polynomial is + * X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 + * + * Note that we take it "backwards" and put the highest-order term in + * the lowest-order bit. The X^32 term is "implied"; the LSB is the + * X^31 term, etc. The X^0 term (usually shown as "+1") results in + * the MSB being 1 + * + * Note that the usual hardware shift register implementation, which + * is what we're using (we're merely optimizing it by doing eight-bit + * chunks at a time) shifts bits into the lowest-order term. In our + * implementation, that means shifting towards the right. Why do we + * do it this way? Because the calculated CRC must be transmitted in + * order from highest-order term to lowest-order term. UARTs transmit + * characters in order from LSB to MSB. By storing the CRC this way + * we hand it to the UART in the order low-byte to high-byte; the UART + * sends each low-bit to hight-bit; and the result is transmission bit + * by bit from highest- to lowest-order term without requiring any bit + * shuffling on our part. Reception works similarly + * + * The feedback terms table consists of 256, 32-bit entries. Notes + * + * The table can be generated at runtime if desired; code to do so + * is shown later. It might not be obvious, but the feedback + * terms simply represent the results of eight shift/xor opera + * tions for all combinations of data and CRC register values + * + * The values must be right-shifted by eight bits by the "updcrc + * logic; the shift must be unsigned (bring in zeroes). On some + * hardware you could probably optimize the shift in assembler by + * using byte-swap instructions + * polynomial $edb88320 + * + * + * CRC32 code derived from work by Gary S. Brown. + */ + +#include "crc32.h" + +static uint32_t crc32_tab[] = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, + 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, + 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, + 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, + 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, + 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, + 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, + 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, + 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, + 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, + 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, + 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, + 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, + 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, + 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, + 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, + 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, + 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d +}; + +uint32_t crc32(const void *buf, size_t size) +{ + const uint8_t *p; + + p = (const uint8_t *)buf; + uint32_t crc = ~0U; + + while (size--) crc = crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8); + + return crc ^ ~0U; +} diff --git a/test_common/harness/crc32.h b/test_common/harness/crc32.h index 745ba90e..1913063e 100644 --- a/test_common/harness/crc32.h +++ b/test_common/harness/crc32.h @@ -21,14 +21,6 @@ executed between Khronos and the recipient. #include #include -#ifdef __cplusplus -extern "C" { -#endif - uint32_t crc32(const void *buf, size_t size); -#ifdef __cplusplus -} -#endif - #endif diff --git a/test_common/harness/deviceInfo.cpp b/test_common/harness/deviceInfo.cpp new file mode 100644 index 00000000..96a04f9a --- /dev/null +++ b/test_common/harness/deviceInfo.cpp @@ -0,0 +1,88 @@ +// +// Copyright (c) 2017-2019 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#include +#include +#include + +#include "deviceInfo.h" +#include "errorHelpers.h" +#include "typeWrappers.h" + +/* Helper to return a string containing device information for the specified + * device info parameter. */ +static std::string get_device_info_string(cl_device_id device, + cl_device_info param_name) +{ + size_t size = 0; + int err; + + if ((err = clGetDeviceInfo(device, param_name, 0, NULL, &size)) + != CL_SUCCESS + || size == 0) + { + throw std::runtime_error("clGetDeviceInfo failed\n"); + } + + std::vector info(size); + + if ((err = clGetDeviceInfo(device, param_name, size, info.data(), NULL)) + != CL_SUCCESS) + { + throw std::runtime_error("clGetDeviceInfo failed\n"); + } + + /* The returned string does not include the null terminator. */ + return std::string(info.data(), size - 1); +} + +/* Determines if an extension is supported by a device. */ +int is_extension_available(cl_device_id device, const char *extensionName) +{ + std::string extString = get_device_extensions_string(device); + std::istringstream ss(extString); + while (ss) + { + std::string found; + ss >> found; + if (found == extensionName) return true; + } + return false; +} + +/* Returns a string containing the supported extensions list for a device. */ +std::string get_device_extensions_string(cl_device_id device) +{ + return get_device_info_string(device, CL_DEVICE_EXTENSIONS); +} + +/* Returns a string containing the supported IL version(s) for a device. */ +std::string get_device_il_version_string(cl_device_id device) +{ + return get_device_info_string(device, CL_DEVICE_IL_VERSION); +} + +/* Returns a string containing the supported OpenCL version for a device. */ +std::string get_device_version_string(cl_device_id device) +{ + return get_device_info_string(device, CL_DEVICE_VERSION); +} + +/* Returns a string containing the device name. */ +std::string get_device_name(cl_device_id device) +{ + return get_device_info_string(device, CL_DEVICE_NAME); +} diff --git a/test_common/harness/deviceInfo.h b/test_common/harness/deviceInfo.h new file mode 100644 index 00000000..87afdc60 --- /dev/null +++ b/test_common/harness/deviceInfo.h @@ -0,0 +1,40 @@ +// +// Copyright (c) 2017-2019 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#ifndef _deviceInfo_h +#define _deviceInfo_h + +// Configuration +#include "../config.hpp" + +#include + +#include + +/* Determines if an extension is supported by a device. */ +int is_extension_available(cl_device_id device, const char *extensionName); + +/* Returns a string containing the supported extensions list for a device. */ +std::string get_device_extensions_string(cl_device_id device); + +/* Returns a string containing the supported IL version(s) for a device. */ +std::string get_device_il_version_string(cl_device_id device); + +/* Returns a string containing the supported OpenCL version for a device. */ +std::string get_device_version_string(cl_device_id device); + +/* Returns a string containing the device name. */ +std::string get_device_name(cl_device_id device); +#endif // _deviceInfo_h diff --git a/test_common/harness/errorHelpers.c b/test_common/harness/errorHelpers.cpp similarity index 84% rename from test_common/harness/errorHelpers.c rename to test_common/harness/errorHelpers.cpp index 71bdf5fd..b2586f90 100644 --- a/test_common/harness/errorHelpers.c +++ b/test_common/harness/errorHelpers.cpp @@ -20,7 +20,9 @@ #include "errorHelpers.h" -extern bool gOfflineCompiler; +#include "parseParameters.h" + +#include const char *IGetErrorString( int clErrorCode ) { @@ -83,7 +85,13 @@ const char *IGetErrorString( int clErrorCode ) case CL_INVALID_IMAGE_DESCRIPTOR: return "CL_INVALID_IMAGE_DESCRIPTOR"; case CL_INVALID_COMPILER_OPTIONS: return "CL_INVALID_COMPILER_OPTIONS"; case CL_INVALID_LINKER_OPTIONS: return "CL_INVALID_LINKER_OPTIONS"; - case CL_INVALID_DEVICE_PARTITION_COUNT: return "CL_INVALID_DEVICE_PARTITION_COUNT"; + case CL_INVALID_DEVICE_PARTITION_COUNT: + return "CL_INVALID_DEVICE_PARTITION_COUNT"; + case CL_INVALID_PIPE_SIZE: return "CL_INVALID_PIPE_SIZE"; + case CL_INVALID_DEVICE_QUEUE: return "CL_INVALID_DEVICE_QUEUE"; + case CL_INVALID_SPEC_ID: return "CL_INVALID_SPEC_ID"; + case CL_MAX_SIZE_RESTRICTION_EXCEEDED: + return "CL_MAX_SIZE_RESTRICTION_EXCEEDED"; default: return "(unknown)"; } } @@ -276,6 +284,19 @@ const char *GetDataVectorString( void *dataBuffer, size_t typeSize, size_t vecSi return buffer; } +const char *GetQueuePropertyName(cl_command_queue_properties property) +{ + switch (property) + { + case CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE: + return "CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE"; + case CL_QUEUE_PROFILING_ENABLE: return "CL_QUEUE_PROFILING_ENABLE"; + case CL_QUEUE_ON_DEVICE: return "CL_QUEUE_ON_DEVICE"; + case CL_QUEUE_ON_DEVICE_DEFAULT: return "CL_QUEUE_ON_DEVICE_DEFAULT"; + default: return "(unknown)"; + } +} + #ifndef MAX #define MAX( _a, _b ) ((_a) > (_b) ? (_a) : (_b)) #endif @@ -287,7 +308,6 @@ const char *GetDataVectorString( void *dataBuffer, size_t typeSize, size_t vecSi #endif static float Ulp_Error_Half_Float( float test, double reference ); -static inline float half2float( cl_ushort half ); // taken from math tests #define HALF_MIN_EXP -13 @@ -334,49 +354,9 @@ static float Ulp_Error_Half_Float( float test, double reference ) return (float) scalbn( testVal - reference, ulp_exp ); } -// Taken from vLoadHalf test -static inline float half2float( cl_ushort us ) -{ - uint32_t u = us; - uint32_t sign = (u << 16) & 0x80000000; - int32_t exponent = (u & 0x7c00) >> 10; - uint32_t mantissa = (u & 0x03ff) << 13; - union{ unsigned int u; float f;}uu; - - if( exponent == 0 ) - { - if( mantissa == 0 ) - return sign ? -0.0f : 0.0f; - - int shift = __builtin_clz( mantissa ) - 8; - exponent -= shift-1; - mantissa <<= shift; - mantissa &= 0x007fffff; - } - else - if( exponent == 31) - { - uu.u = mantissa | sign; - if( mantissa ) - uu.u |= 0x7fc00000; - else - uu.u |= 0x7f800000; - - return uu.f; - } - - exponent += 127 - 15; - exponent <<= 23; - - exponent |= mantissa; - uu.u = exponent | sign; - - return uu.f; -} - float Ulp_Error_Half( cl_ushort test, float reference ) { - return Ulp_Error_Half_Float( half2float(test), reference ); + return Ulp_Error_Half_Float(cl_half_to_float(test), reference); } @@ -707,100 +687,69 @@ const char * subtests_requiring_opencl_1_2[] = { "popcount" }; -const char * subtests_to_skip_with_offline_compiler[] = { - "get_kernel_arg_info", - "binary_create", - "load_program_source", - "load_multistring_source", - "load_two_kernel_source", - "load_null_terminated_source", - "load_null_terminated_multi_line_source", - "load_null_terminated_partial_multi_line_source", - "load_discreet_length_source", - "get_program_source", - "get_program_build_info", - "options_build_optimizations", - "options_build_macro", - "options_build_macro_existence", - "options_include_directory", - "options_denorm_cache", - "preprocessor_define_udef", - "preprocessor_include", - "preprocessor_line_error", - "preprocessor_pragma", - "compiler_defines_for_extensions", - "image_macro", - "simple_extern_compile_only", - "simple_embedded_header_compile", - "two_file_regular_variable_access", - "two_file_regular_struct_access", - "two_file_regular_function_access", - "simple_embedded_header_link", - "execute_after_simple_compile_and_link_with_defines", - "execute_after_simple_compile_and_link_with_callbacks", - "execute_after_embedded_header_link", - "execute_after_included_header_link", - "multi_file_libraries", - "multiple_files", - "multiple_libraries", - "multiple_files_multiple_libraries", - "multiple_embedded_headers", - "program_binary_type", - "compile_and_link_status_options_log", - "kernel_preprocessor_macros", +const char *subtests_to_skip_with_offline_compiler[] = { + "get_kernel_arg_info", + "get_kernel_arg_info_compatibility", + "binary_create", + "load_program_source", + "load_multistring_source", + "load_two_kernel_source", + "load_null_terminated_source", + "load_null_terminated_multi_line_source", + "load_null_terminated_partial_multi_line_source", + "load_discreet_length_source", + "get_program_source", + "get_program_build_info", + "options_build_optimizations", + "options_build_macro", + "options_build_macro_existence", + "options_include_directory", + "options_denorm_cache", + "preprocessor_define_udef", + "preprocessor_include", + "preprocessor_line_error", + "preprocessor_pragma", + "compiler_defines_for_extensions", + "image_macro", + "simple_extern_compile_only", + "simple_embedded_header_compile", + "two_file_regular_variable_access", + "two_file_regular_struct_access", + "two_file_regular_function_access", + "simple_embedded_header_link", + "execute_after_simple_compile_and_link_with_defines", + "execute_after_simple_compile_and_link_with_callbacks", + "execute_after_embedded_header_link", + "execute_after_included_header_link", + "multi_file_libraries", + "multiple_files", + "multiple_libraries", + "multiple_files_multiple_libraries", + "multiple_embedded_headers", + "program_binary_type", + "compile_and_link_status_options_log", + "kernel_preprocessor_macros", + "execute_after_serialize_reload_library", + "execute_after_serialize_reload_object", + "execute_after_simple_compile_and_link", + "execute_after_simple_compile_and_link_no_device_info", + "execute_after_simple_library_with_link", + "execute_after_two_file_link", + "simple_compile_only", + "simple_compile_with_callback", + "simple_library_only", + "simple_library_with_callback", + "simple_library_with_link", + "simple_link_only", + "simple_link_with_callback", + "simple_static_compile_only", + "two_file_link", + "async_build", }; -int check_opencl_version_with_testname(const char *subtestname, cl_device_id device) -{ - int nRequiring12 = sizeof(subtests_requiring_opencl_1_2)/sizeof(char *); - size_t i; - for(i=0; i < nRequiring12; ++i) { - if(!strcmp(subtestname, subtests_requiring_opencl_1_2[i])) { - return check_opencl_version(device, 1, 2); - } - } - return 0; -} - -int check_opencl_version(cl_device_id device, cl_uint requestedMajorVersion, cl_uint requestedMinorVersion) { - int error; - char device_version[1024]; - cl_uint majorVersion = 0, minorVersion = 0; - const char * required_version_ocl_12="OpenCL 1.2 "; - - memset( device_version, 0, sizeof( device_version ) ); - error = clGetDeviceInfo( device, CL_DEVICE_VERSION, sizeof(device_version), device_version, NULL ); - test_error(error, "unable to get CL_DEVICE_VERSION"); - - if ( strncmp( device_version, "OpenCL 1.2", 10 ) == 0 && ( device_version[ 10 ] == 0 || device_version[ 10 ] == ' ' ) ) { - majorVersion = 1; - minorVersion = 2; - } else if ( strncmp( device_version, "OpenCL 1.1", 10 ) == 0 && ( device_version[ 10 ] == 0 || device_version[ 10 ] == ' ' ) ) { - majorVersion = 1; - minorVersion = 1; - } else if ( strncmp( device_version, "OpenCL 2.0", 10 ) == 0 && ( device_version[ 10 ] == 0 || device_version[ 10 ] == ' ' ) ) { - majorVersion = 2; - minorVersion = 0; - } else if ( strncmp( device_version, "OpenCL 2.1", 10 ) == 0 && ( device_version[ 10 ] == 0 || device_version[ 10 ] == ' ' ) ) { - majorVersion = 2; - minorVersion = 1; - } else { - log_error( "ERROR: Unexpected version string: `%s'.\n", device_version ); - return 1; - }; - - if (majorVersion >= requestedMajorVersion) - return 0; - - if (minorVersion >= requestedMinorVersion) - return 0; - - return 1; -} - int check_functions_for_offline_compiler(const char *subtestname, cl_device_id device) { - if(gOfflineCompiler) + if (gCompilationMode != kOnline) { int nNotRequiredWithOfflineCompiler = sizeof(subtests_to_skip_with_offline_compiler)/sizeof(char *); size_t i; diff --git a/test_common/harness/errorHelpers.h b/test_common/harness/errorHelpers.h index 3612c8c7..3238a956 100644 --- a/test_common/harness/errorHelpers.h +++ b/test_common/harness/errorHelpers.h @@ -16,66 +16,51 @@ #ifndef _errorHelpers_h #define _errorHelpers_h +#include + #ifdef __APPLE__ #include #else #include #endif #include -#ifdef __cplusplus -extern "C" { -#endif - #define LOWER_IS_BETTER 0 #define HIGHER_IS_BETTER 1 -// If USE_ATF is defined, all log_error and log_info calls can be routed to test library -// functions as described below. This is helpful for integration into an automated testing -// system. -#if USE_ATF -// export BUILD_WITH_ATF=1 - #include - #define test_start() ATFTestStart() - #define log_info ATFLogInfo - #define log_error ATFLogError - #define log_missing_feature ATFLogMissingFeature - #define log_perf(_number, _higherBetter, _numType, _format, ...) ATFLogPerformanceNumber(_number, _higherBetter, _numType, _format, ##__VA_ARGS__) - #define test_finish() ATFTestFinish() - #define vlog_perf(_number, _higherBetter, _numType, _format, ...) ATFLogPerformanceNumber(_number, _higherBetter, _numType, _format,##__VA_ARGS__) - #define vlog ATFLogInfo - #define vlog_error ATFLogError -#else - #include - #define test_start() - #define log_info printf - #define log_error printf - #define log_missing_feature printf - #define log_perf(_number, _higherBetter, _numType, _format, ...) printf("Performance Number " _format " (in %s, %s): %g\n",##__VA_ARGS__, _numType, \ - _higherBetter?"higher is better":"lower is better", _number ) - #define test_finish() - #define vlog_perf(_number, _higherBetter, _numType, _format, ...) printf("Performance Number " _format " (in %s, %s): %g\n",##__VA_ARGS__, _numType, \ - _higherBetter?"higher is better":"lower is better" , _number) - #ifdef _WIN32 - #ifdef __MINGW32__ - // Use __mingw_printf since it supports "%a" format specifier - #define vlog __mingw_printf - #define vlog_error __mingw_printf - #else - // Use home-baked function that treats "%a" as "%f" - static int vlog_win32(const char *format, ...); - #define vlog vlog_win32 - #define vlog_error vlog_win32 - #endif +#include +#define test_start() +#define log_info printf +#define log_error printf +#define log_missing_feature printf +#define log_perf(_number, _higherBetter, _numType, _format, ...) printf("Performance Number " _format " (in %s, %s): %g\n",##__VA_ARGS__, _numType, \ + _higherBetter?"higher is better":"lower is better", _number ) +#define vlog_perf(_number, _higherBetter, _numType, _format, ...) printf("Performance Number " _format " (in %s, %s): %g\n",##__VA_ARGS__, _numType, \ + _higherBetter?"higher is better":"lower is better" , _number) +#ifdef _WIN32 + #ifdef __MINGW32__ + // Use __mingw_printf since it supports "%a" format specifier + #define vlog __mingw_printf + #define vlog_error __mingw_printf #else - #define vlog_error printf - #define vlog printf + // Use home-baked function that treats "%a" as "%f" + static int vlog_win32(const char *format, ...); + #define vlog vlog_win32 + #define vlog_error vlog_win32 #endif +#else + #define vlog_error printf + #define vlog printf #endif #define ct_assert(b) ct_assert_i(b, __LINE__) #define ct_assert_i(b, line) ct_assert_ii(b, line) #define ct_assert_ii(b, line) int _compile_time_assertion_on_line_##line[b ? 1 : -1]; +#define test_fail(msg, ...) \ + { \ + log_error(msg, ##__VA_ARGS__); \ + return TEST_FAIL; \ + } #define test_error(errCode,msg) test_error_ret(errCode,msg,errCode) #define test_error_ret(errCode,msg,retValue) { if( errCode != CL_SUCCESS ) { print_error( errCode, msg ); return retValue ; } } #define print_error(errCode,msg) log_error( "ERROR: %s! (%s from %s:%d)\n", msg, IGetErrorString( errCode ), __FILE__, __LINE__ ); @@ -87,7 +72,7 @@ extern "C" { #define test_missing_support_offline_cmpiler(errCode, msg) test_missing_support_offline_cmpiler_ret(errCode, msg, errCode) // this macro should always return CL_SUCCESS, but print the skip message on test not supported with offline compiler -#define test_missing_support_offline_cmpiler_ret(errCode,msg,retValue) { if( errCode != CL_SUCCESS ) { log_info( "INFO: Subtest %s tests is not supported in offline compiler execution path! (from %s:%d)\n", msg, __FILE__, __LINE__ ); return CL_SUCCESS ; } } +#define test_missing_support_offline_cmpiler_ret(errCode,msg,retValue) { if( errCode != CL_SUCCESS ) { log_info( "INFO: Subtest %s tests is not supported in offline compiler execution path! (from %s:%d)\n", msg, __FILE__, __LINE__ ); return TEST_SKIP ; } } // expected error code vs. what we got #define test_failure_error(errCode, expectedErrCode, msg) test_failure_error_ret(errCode, expectedErrCode, msg, errCode != expectedErrCode) @@ -97,6 +82,34 @@ extern "C" { #define test_failure_warning_ret(errCode, expectedErrCode, msg, retValue) { if( errCode != expectedErrCode ) { print_failure_warning( errCode, expectedErrCode, msg ); warnings++ ; } } #define print_failure_warning(errCode, expectedErrCode, msg) log_error( "WARNING: %s! (Got %s, expected %s from %s:%d)\n", msg, IGetErrorString( errCode ), IGetErrorString( expectedErrCode ), __FILE__, __LINE__ ); +// generate an error when an assertion is false (not error code related) +#define test_assert_error(condition, msg) \ + test_assert_error_ret(condition, msg, TEST_FAIL) +#define test_assert_error_ret(condition, msg, retValue) \ + { \ + if (!(condition)) \ + { \ + print_assertion_error(condition, msg); \ + return retValue; \ + } \ + } +#define print_assertion_error(condition, msg) \ + log_error("ERROR: %s! (!(%s) from %s:%d)\n", msg, #condition, __FILE__, \ + __LINE__); + +#define ASSERT_SUCCESS(expr, msg) \ + do \ + { \ + cl_int _temp_retval = (expr); \ + if (_temp_retval != CL_SUCCESS) \ + { \ + std::stringstream ss; \ + ss << "ERROR: " << msg << "=" << IGetErrorString(_temp_retval) \ + << " at " << __FILE__ << ":" << __LINE__ << "\n"; \ + throw std::runtime_error(ss.str()); \ + } \ + } while (0) + extern const char *IGetErrorString( int clErrorCode ); extern float Ulp_Error_Half( cl_ushort test, float reference ); @@ -108,10 +121,9 @@ extern int IsChannelTypeSupported( cl_channel_type type ); extern const char *GetChannelOrderName( cl_channel_order order ); extern int IsChannelOrderSupported( cl_channel_order order ); extern const char *GetAddressModeName( cl_addressing_mode mode ); +extern const char *GetQueuePropertyName(cl_command_queue_properties properties); extern const char *GetDeviceTypeName( cl_device_type type ); -int check_opencl_version_with_testname(const char *subtestname, cl_device_id device); -int check_opencl_version(cl_device_id device, cl_uint requestedMajorVersion, cl_uint requestedMinorVersion); int check_functions_for_offline_compiler(const char *subtestname, cl_device_id device); // NON-REENTRANT UNLESS YOU PROVIDE A BUFFER PTR (pass null to use static storage, but it's not reentrant then!) @@ -155,10 +167,6 @@ static int vlog_win32(const char *format, ...) #endif -#ifdef __cplusplus -} -#endif - #endif // _errorHelpers_h diff --git a/test_common/harness/imageHelpers.cpp b/test_common/harness/imageHelpers.cpp index be1d68d0..807f4338 100644 --- a/test_common/harness/imageHelpers.cpp +++ b/test_common/harness/imageHelpers.cpp @@ -15,27 +15,30 @@ // #include "imageHelpers.h" #include +#include #if defined( __APPLE__ ) #include #endif #if !defined (_WIN32) && !defined(__APPLE__) #include #endif +#include +#include +#if !defined (_WIN32) +#include +#endif -int gTestCount = 0; -int gTestFailure = 0; RoundingMode gFloatToHalfRoundingMode = kDefaultRoundingMode; -static cl_ushort float2half_rte( float f ); -static cl_ushort float2half_rtz( float f ); - +cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT; +bool gTestRounding = false; double sRGBmap(float fc) { double c = (double)fc; #if !defined (_WIN32) - if (isnan(c)) + if (std::isnan(c)) c = 0.0; #else if (_isnan(c)) @@ -69,12 +72,12 @@ sRGBunmap(float fc) } -size_t get_format_type_size( const cl_image_format *format ) +uint32_t get_format_type_size(const cl_image_format *format) { return get_channel_data_type_size( format->image_channel_data_type ); } -size_t get_channel_data_type_size( cl_channel_type channelType ) +uint32_t get_channel_data_type_size(cl_channel_type channelType) { switch( channelType ) { @@ -126,12 +129,12 @@ size_t get_channel_data_type_size( cl_channel_type channelType ) } } -size_t get_format_channel_count( const cl_image_format *format ) +uint32_t get_format_channel_count(const cl_image_format *format) { return get_channel_order_channel_count( format->image_channel_order ); } -size_t get_channel_order_channel_count( cl_channel_order order ) +uint32_t get_channel_order_channel_count(cl_channel_order order) { switch( order ) { @@ -278,7 +281,7 @@ int is_format_signed( const cl_image_format *format ) } } -size_t get_pixel_size( cl_image_format *format ) +uint32_t get_pixel_size(cl_image_format *format) { switch( format->image_channel_data_type ) { @@ -330,6 +333,23 @@ size_t get_pixel_size( cl_image_format *format ) } } +uint32_t next_power_of_two(uint32_t v) +{ + v--; + v |= v >> 1; + v |= v >> 2; + v |= v >> 4; + v |= v >> 8; + v |= v >> 16; + v++; + return v; +} + +uint32_t get_pixel_alignment(cl_image_format *format) +{ + return next_power_of_two(get_pixel_size(format)); +} + int get_8_bit_image_format( cl_context context, cl_mem_object_type objType, cl_mem_flags flags, size_t channelCount, cl_image_format *outFormat ) { cl_image_format formatList[ 128 ]; @@ -682,6 +702,16 @@ void get_max_sizes(size_t *numberOfSizes, const int maxNumberOfSizes, if(x0_dim == 0 && x0 < 16) x0 = 16; double x1 = fmin(fmin(A/M/x0,maximum_sizes[x1_dim]),other_sizes[(other_size++)%num_other_sizes]); + + // Valid image sizes cannot be below 1. Due to the workaround for the xo_dim where x0 is overidden to 16 + // there might not be enough space left for x1 dimension. This could be a fractional 0.x size that when cast to + // integer would result in a value 0. In these cases we clamp the size to a minimum of 1. + if ( x1 < 1 ) + x1 = 1; + + // M and x0 cannot be '0' as they derive from clDeviceInfo calls + assert(x0 > 0 && M > 0); + // Store the size sizes[(*numberOfSizes)][fixed_dim] = (size_t)M; sizes[(*numberOfSizes)][x0_dim] = (size_t)x0; @@ -775,7 +805,6 @@ float get_max_relative_error( cl_image_format *format, image_sampler_data *sampl { if( sampler->filter_mode != CL_FILTER_NEAREST ) { - extern cl_device_type gDeviceType; // The maximum if( gDeviceType == CL_DEVICE_TYPE_GPU ) maxError += MAKE_HEX_FLOAT(0x1.0p-4f, 0x1L, -4); // Some GPUs ain't so accurate @@ -884,8 +913,7 @@ int get_format_min_int( cl_image_format *format ) case CL_UNORM_INT_101010: return 0; - case CL_HALF_FLOAT: - return -1<<10; + case CL_HALF_FLOAT: return -(1 << 10); #ifdef CL_SFIXED14_APPLE case CL_SFIXED14_APPLE: @@ -897,72 +925,12 @@ int get_format_min_int( cl_image_format *format ) } } -float convert_half_to_float( unsigned short halfValue ) -{ - // We have to take care of a few special cases, but in general, we just extract - // the same components from the half that exist in the float and re-stuff them - // For a description of the actual half format, see http://en.wikipedia.org/wiki/Half_precision - // Note: we store these in 32-bit ints to make the bit manipulations easier later - int sign = ( halfValue >> 15 ) & 0x0001; - int exponent = ( halfValue >> 10 ) & 0x001f; - int mantissa = ( halfValue ) & 0x03ff; - - // Note: we use a union here to be able to access the bits of a float directly - union - { - unsigned int bits; - float floatValue; - } outFloat; - - // Special cases first - if( exponent == 0 ) - { - if( mantissa == 0 ) - { - // If both exponent and mantissa are 0, the number is +/- 0 - outFloat.bits = sign << 31; - return outFloat.floatValue; // Already done! - } - - // If exponent is 0, it's a denormalized number, so we renormalize it - // Note: this is not terribly efficient, but oh well - while( ( mantissa & 0x00000400 ) == 0 ) - { - mantissa <<= 1; - exponent--; - } - - // The first bit is implicit, so we take it off and inc the exponent accordingly - exponent++; - mantissa &= ~(0x00000400); - } - else if( exponent == 31 ) // Special-case "numbers" - { - // If the exponent is 31, it's a special case number (+/- infinity or NAN). - // If the mantissa is 0, it's infinity, else it's NAN, but in either case, the packing - // method is the same - outFloat.bits = ( sign << 31 ) | 0x7f800000 | ( mantissa << 13 ); - return outFloat.floatValue; - } - - // Plain ol' normalized number, so adjust to the ranges a 32-bit float expects and repack - exponent += ( 127 - 15 ); - mantissa <<= 13; - - outFloat.bits = ( sign << 31 ) | ( exponent << 23 ) | mantissa; - return outFloat.floatValue; -} - - - cl_ushort convert_float_to_half( float f ) { switch( gFloatToHalfRoundingMode ) { - case kRoundToNearestEven: - return float2half_rte( f ); - case kRoundTowardZero: - return float2half_rtz( f ); + case kRoundToNearestEven: return cl_half_from_float(f, CL_HALF_RTE); + case kRoundTowardZero: return cl_half_from_float(f, CL_HALF_RTZ); default: log_error( "ERROR: Test internal error -- unhandled or unknown float->half rounding mode.\n" ); exit(-1); @@ -971,173 +939,6 @@ cl_ushort convert_float_to_half( float f ) } -cl_ushort float2half_rte( float f ) - { - union{ float f; cl_uint u; } u = {f}; - cl_uint sign = (u.u >> 16) & 0x8000; - float x = fabsf(f); - - //Nan - if( x != x ) - { - u.u >>= (24-11); - u.u &= 0x7fff; - u.u |= 0x0200; //silence the NaN - return u.u | sign; - } - - // overflow - if( x >= MAKE_HEX_FLOAT(0x1.ffep15f, 0x1ffeL, 3) ) - return 0x7c00 | sign; - - // underflow - if( x <= MAKE_HEX_FLOAT(0x1.0p-25f, 0x1L, -25) ) - return sign; // The halfway case can return 0x0001 or 0. 0 is even. - - // very small - if( x < MAKE_HEX_FLOAT(0x1.8p-24f, 0x18L, -28) ) - return sign | 1; - - // half denormal - if( x < MAKE_HEX_FLOAT(0x1.0p-14f, 0x1L, -14) ) - { - u.f = x * MAKE_HEX_FLOAT(0x1.0p-125f, 0x1L, -125); - return sign | u.u; - } - - u.f *= MAKE_HEX_FLOAT(0x1.0p13f, 0x1L, 13); - u.u &= 0x7f800000; - x += u.f; - u.f = x - u.f; - u.f *= MAKE_HEX_FLOAT(0x1.0p-112f, 0x1L, -112); - - return (u.u >> (24-11)) | sign; - } - -cl_ushort float2half_rtz( float f ) - { - union{ float f; cl_uint u; } u = {f}; - cl_uint sign = (u.u >> 16) & 0x8000; - float x = fabsf(f); - - //Nan - if( x != x ) - { - u.u >>= (24-11); - u.u &= 0x7fff; - u.u |= 0x0200; //silence the NaN - return u.u | sign; - } - - // overflow - if( x >= MAKE_HEX_FLOAT(0x1.0p16f, 0x1L, 16) ) - { - if( x == INFINITY ) - return 0x7c00 | sign; - - return 0x7bff | sign; - } - - // underflow - if( x < MAKE_HEX_FLOAT(0x1.0p-24f, 0x1L, -24) ) - return sign; // The halfway case can return 0x0001 or 0. 0 is even. - - // half denormal - if( x < MAKE_HEX_FLOAT(0x1.0p-14f, 0x1L, -14) ) - { - x *= MAKE_HEX_FLOAT(0x1.0p24f, 0x1L, 24); - return (cl_ushort)((int) x | sign); - } - - u.u &= 0xFFFFE000U; - u.u -= 0x38000000U; - - return (u.u >> (24-11)) | sign; -} - -class TEST -{ -public: - TEST(); -}; - -static TEST t; -void __vstore_half_rte(float f, size_t index, uint16_t *p) -{ - union{ unsigned int u; float f;} u; - - u.f = f; - unsigned short r = (u.u >> 16) & 0x8000; - u.u &= 0x7fffffff; - if( u.u >= 0x33000000U ) - { - if( u.u >= 0x47800000 ) - { - if( u.u <= 0x7f800000 ) - r |= 0x7c00; - else - { - r |= 0x7e00 | ( (u.u >> 13) & 0x3ff ); - } - } - else - { - float x = u.f; - if( u.u < 0x38800000 ) - u.u = 0x3f000000; - else - u.u += 0x06800000; - u.u &= 0x7f800000U; - x += u.f; - x -= u.f; - u.f = x * MAKE_HEX_FLOAT(0x1.0p-112f, 0x1L, -112); - u.u >>= 13; - r |= (unsigned short) u.u; - } - } - - ((unsigned short*)p)[index] = r; -} - -TEST::TEST() -{ - return; - union - { - float f; - uint32_t i; - } test; - uint16_t control, myval; - - log_info(" &&&&&&&&&&&&&&&&&&&&&&&&&&&& TESTING HALFS &&&&&&&&&&&&&&&&&&&&\n" ); - test.i = 0; - do - { - if( ( test.i & 0xffffff ) == 0 ) - { - if( ( test.i & 0xfffffff ) == 0 ) - log_info( "*" ); - else - log_info( "." ); - fflush(stdout); - } - __vstore_half_rte( test.f, 0, &control ); - myval = convert_float_to_half( test.f ); - if( myval != control ) - { - log_info( "\n******** ERROR: MyVal %04x control %04x source %12.24f\n", myval, control, test.f ); - log_info( " source bits: %08x %a\n", test.i, test.f ); - float t, c; - c = convert_half_to_float( control ); - t = convert_half_to_float( myval ); - log_info( " converted control: %12.24f myval: %12.24f\n", c, t ); - } - test.i++; - } while( test.i != 0 ); - log_info("\n &&&&&&&&&&&&&&&&&&&&&&&&&&&& TESTING HALFS &&&&&&&&&&&&&&&&&&&&\n" ); - -} - cl_ulong get_image_size( image_descriptor const *imageInfo ) { cl_ulong imageSize; @@ -1187,7 +988,6 @@ cl_ulong get_image_size_mb( image_descriptor const *imageInfo ) } -extern bool gTestRounding; uint64_t gRoundingStartValue = 0; @@ -1236,13 +1036,8 @@ char * generate_random_image_data( image_descriptor *imageInfo, BufferOwningPtr< } #else P.reset( NULL ); // Free already allocated memory first, then try to allocate new block. -#if defined (_WIN32) && defined(_MSC_VER) - char *data = (char *)_aligned_malloc(allocSize, get_pixel_size(imageInfo->format)); -#elif defined(__MINGW32__) - char *data = (char *)__mingw_aligned_malloc(allocSize, get_pixel_size(imageInfo->format)); -#else - char *data = (char *)memalign(get_pixel_size(imageInfo->format), allocSize); -#endif + char *data = + (char *)align_malloc(allocSize, get_pixel_alignment(imageInfo->format)); P.reset(data,NULL,0,allocSize, true); #endif @@ -1490,7 +1285,7 @@ void read_image_pixel_float( void *imageData, image_descriptor *imageInfo, { cl_ushort *dPtr = (cl_ushort *)ptr; for( i = 0; i < channelCount; i++ ) - tempData[ i ] = convert_half_to_float( dPtr[ i ] ); + tempData[i] = cl_half_to_float(dPtr[i]); break; } @@ -1810,7 +1605,7 @@ static inline void check_for_denorms(float a[4], int *containsDenorms ) { for( int i = 0; i < 4; i++ ) { - if( fabsf(a[i]) < FLT_MIN ) + if( IsFloatSubnormal( a[i] ) ) a[i] = copysignf( 0.0f, a[i] ); } } @@ -1818,7 +1613,7 @@ static inline void check_for_denorms(float a[4], int *containsDenorms ) { for( int i = 0; i < 4; i++ ) { - if( fabs(a[i]) < FLT_MIN ) + if( IsFloatSubnormal( a[i] ) ) { *containsDenorms = 1; break; @@ -2610,11 +2405,11 @@ void pack_image_pixel( float *srcVector, const cl_image_format *imageFormat, voi { case kRoundToNearestEven: for( unsigned int i = 0; i < channelCount; i++ ) - ptr[ i ] = float2half_rte( srcVector[ i ] ); + ptr[i] = cl_half_from_float(srcVector[i], CL_HALF_RTE); break; case kRoundTowardZero: for( unsigned int i = 0; i < channelCount; i++ ) - ptr[ i ] = float2half_rtz( srcVector[ i ] ); + ptr[i] = cl_half_from_float(srcVector[i], CL_HALF_RTZ); break; default: log_error( "ERROR: Test internal error -- unhandled or unknown float->half rounding mode.\n" ); @@ -3063,8 +2858,8 @@ int DetectFloatToHalfRoundingMode( cl_command_queue q ) // Returns CL_SUCCESS cl_ushort rtz_ref[count*4]; for( size_t i = 0; i < 4 * count; i++ ) { - rte_ref[i] = float2half_rte( inp[i] ); - rtz_ref[i] = float2half_rtz( inp[i] ); + rte_ref[i] = cl_half_from_float(inp[i], CL_HALF_RTE); + rtz_ref[i] = cl_half_from_float(inp[i], CL_HALF_RTZ); } // Verify that we got something in either rtz or rte mode @@ -3165,15 +2960,9 @@ char *create_random_image_data( ExplicitType dataType, image_descriptor *imageIn P.reset(data); } #else -#if defined (_WIN32) && defined(_MSC_VER) - char *data = (char *)_aligned_malloc(allocSize, get_pixel_size(imageInfo->format)); -#elif defined(__MINGW32__) - char *data = (char *)__mingw_aligned_malloc(allocSize, get_pixel_size(imageInfo->format)); -#else - char *data = (char *)memalign(get_pixel_size(imageInfo->format), allocSize); -#endif - - P.reset(data,NULL,0,allocSize,true); + char *data = + (char *)align_malloc(allocSize, get_pixel_alignment(imageInfo->format)); + P.reset(data, NULL, 0, allocSize, true); #endif if (data == NULL) { @@ -3289,6 +3078,7 @@ char *create_random_image_data( ExplicitType dataType, image_descriptor *imageIn } break; } + break; } case kInt: @@ -3672,59 +3462,170 @@ bool find_format( cl_image_format *formatList, unsigned int numFormats, cl_image return false; } -bool check_minimum_supported( cl_image_format *formatList, unsigned int numFormats, cl_mem_flags flags ) +void build_required_image_formats(cl_mem_flags flags, + cl_mem_object_type image_type, + cl_device_id device, + std::vector& formatsToSupport) { - cl_image_format readFormatsToSupport[] = { { CL_RGBA, CL_UNORM_INT8 }, - { CL_RGBA, CL_UNORM_INT16 }, - { CL_RGBA, CL_SIGNED_INT8 }, - { CL_RGBA, CL_SIGNED_INT16 }, - { CL_RGBA, CL_SIGNED_INT32 }, - { CL_RGBA, CL_UNSIGNED_INT8 }, - { CL_RGBA, CL_UNSIGNED_INT16 }, - { CL_RGBA, CL_UNSIGNED_INT32 }, - { CL_RGBA, CL_HALF_FLOAT }, - { CL_RGBA, CL_FLOAT }, - { CL_BGRA, CL_UNORM_INT8} }; + Version version = get_device_cl_version(device); - cl_image_format writeFormatsToSupport[] = { { CL_RGBA, CL_UNORM_INT8 }, - { CL_RGBA, CL_UNORM_INT16 }, - { CL_RGBA, CL_SIGNED_INT8 }, - { CL_RGBA, CL_SIGNED_INT16 }, - { CL_RGBA, CL_SIGNED_INT32 }, - { CL_RGBA, CL_UNSIGNED_INT8 }, - { CL_RGBA, CL_UNSIGNED_INT16 }, - { CL_RGBA, CL_UNSIGNED_INT32 }, - { CL_RGBA, CL_HALF_FLOAT }, - { CL_RGBA, CL_FLOAT }, - { CL_BGRA, CL_UNORM_INT8} }; + formatsToSupport.clear(); - cl_image_format *formatsToTest; - unsigned int testCount; - bool passed = true; + // Required embedded formats. + static std::vector embeddedProfReadOrWriteFormats + { + { CL_RGBA, CL_UNORM_INT8 }, + { CL_RGBA, CL_UNORM_INT16 }, + { CL_RGBA, CL_SIGNED_INT8 }, + { CL_RGBA, CL_SIGNED_INT16 }, + { CL_RGBA, CL_SIGNED_INT32 }, + { CL_RGBA, CL_UNSIGNED_INT8 }, + { CL_RGBA, CL_UNSIGNED_INT16 }, + { CL_RGBA, CL_UNSIGNED_INT32 }, + { CL_RGBA, CL_HALF_FLOAT }, + { CL_RGBA, CL_FLOAT }, + }; - if( flags == CL_MEM_READ_ONLY ) - { - formatsToTest = readFormatsToSupport; - testCount = sizeof( readFormatsToSupport ) / sizeof( readFormatsToSupport[ 0 ] ); - } - else - { - formatsToTest = writeFormatsToSupport; - testCount = sizeof( writeFormatsToSupport ) / sizeof( writeFormatsToSupport[ 0 ] ); - } + /* + Required full profile formats. + This array does not contain any full profile + formats that have restrictions on when they + are required. + */ + static std::vector fullProfReadOrWriteFormats + { + { CL_RGBA, CL_UNORM_INT8 }, + { CL_RGBA, CL_UNORM_INT16 }, + { CL_RGBA, CL_SIGNED_INT8 }, + { CL_RGBA, CL_SIGNED_INT16 }, + { CL_RGBA, CL_SIGNED_INT32 }, + { CL_RGBA, CL_UNSIGNED_INT8 }, + { CL_RGBA, CL_UNSIGNED_INT16 }, + { CL_RGBA, CL_UNSIGNED_INT32 }, + { CL_RGBA, CL_HALF_FLOAT }, + { CL_RGBA, CL_FLOAT }, + { CL_BGRA, CL_UNORM_INT8 }, + }; - for( unsigned int i = 0; i < testCount; i++ ) - { - if( !find_format( formatList, numFormats, &formatsToTest[ i ] ) ) - { - log_error( "ERROR: Format required by OpenCL 1.0 is not supported: " ); - print_header( &formatsToTest[ i ], true ); - gTestCount++; - gTestFailure++; - passed = false; - } - } - return passed; + /* + Required full profile formats specifically for 2.x. + This array does not contain any full profile + formats that have restrictions on when they + are required. + */ + static std::vector fullProf2XReadOrWriteFormats + { + { CL_R, CL_UNORM_INT8 }, + { CL_R, CL_UNORM_INT16 }, + { CL_R, CL_SNORM_INT8 }, + { CL_R, CL_SNORM_INT16 }, + { CL_R, CL_SIGNED_INT8 }, + { CL_R, CL_SIGNED_INT16 }, + { CL_R, CL_SIGNED_INT32 }, + { CL_R, CL_UNSIGNED_INT8 }, + { CL_R, CL_UNSIGNED_INT16 }, + { CL_R, CL_UNSIGNED_INT32 }, + { CL_R, CL_HALF_FLOAT }, + { CL_R, CL_FLOAT }, + { CL_RG, CL_UNORM_INT8 }, + { CL_RG, CL_UNORM_INT16 }, + { CL_RG, CL_SNORM_INT8 }, + { CL_RG, CL_SNORM_INT16 }, + { CL_RG, CL_SIGNED_INT8 }, + { CL_RG, CL_SIGNED_INT16 }, + { CL_RG, CL_SIGNED_INT32 }, + { CL_RG, CL_UNSIGNED_INT8 }, + { CL_RG, CL_UNSIGNED_INT16 }, + { CL_RG, CL_UNSIGNED_INT32 }, + { CL_RG, CL_HALF_FLOAT }, + { CL_RG, CL_FLOAT }, + { CL_RGBA, CL_SNORM_INT8 }, + { CL_RGBA, CL_SNORM_INT16 }, + }; + + /* + Required full profile formats for CL_DEPTH + (specifically 2.x). + There are cases whereby the format isn't required. + */ + static std::vector fullProf2XReadOrWriteDepthFormats + { + { CL_DEPTH, CL_UNORM_INT16 }, + { CL_DEPTH, CL_FLOAT }, + }; + + /* + Required full profile formats for CL_sRGB + (specifically 2.x). + There are cases whereby the format isn't required. + */ + static std::vector fullProf2XSRGBFormats + { + { CL_sRGBA, CL_UNORM_INT8 }, + }; + + // Embedded profile + if (gIsEmbedded) + { + copy(embeddedProfReadOrWriteFormats.begin(), + embeddedProfReadOrWriteFormats.end(), + back_inserter(formatsToSupport)); + } + // Full profile + else + { + copy(fullProfReadOrWriteFormats.begin(), + fullProfReadOrWriteFormats.end(), + back_inserter(formatsToSupport)); + } + + // Full profile, OpenCL 2.0, 2.1, 2.2 + if (!gIsEmbedded && version >= Version(2, 0) && version <= Version(2, 2)) + { + copy(fullProf2XReadOrWriteFormats.begin(), + fullProf2XReadOrWriteFormats.end(), + back_inserter(formatsToSupport)); + + // Depth images are only required for 2DArray and 2D images + if (image_type == CL_MEM_OBJECT_IMAGE2D_ARRAY || image_type == CL_MEM_OBJECT_IMAGE2D) + { + copy(fullProf2XReadOrWriteDepthFormats.begin(), + fullProf2XReadOrWriteDepthFormats.end(), + back_inserter(formatsToSupport)); + } + + // sRGB is not required for 1DImage Buffers + if (image_type != CL_MEM_OBJECT_IMAGE1D_BUFFER) + { + // sRGB is only required for reading + if (flags == CL_MEM_READ_ONLY) + { + copy(fullProf2XSRGBFormats.begin(), + fullProf2XSRGBFormats.end(), + back_inserter(formatsToSupport)); + } + } + } +} + +bool is_image_format_required(cl_image_format format, + cl_mem_flags flags, + cl_mem_object_type image_type, + cl_device_id device) +{ + std::vector formatsToSupport; + build_required_image_formats(flags, image_type, device, formatsToSupport); + + for (auto &formatItr: formatsToSupport) + { + if (formatItr.image_channel_order == format.image_channel_order && + formatItr.image_channel_data_type == format.image_channel_data_type) + { + return true; + } + } + + return false; } cl_uint compute_max_mip_levels( size_t width, size_t height, size_t depth) diff --git a/test_common/harness/imageHelpers.h b/test_common/harness/imageHelpers.h index ba80ea77..a3feb72b 100644 --- a/test_common/harness/imageHelpers.h +++ b/test_common/harness/imageHelpers.h @@ -23,6 +23,7 @@ #include #include #include +#include #if !defined(_WIN32) #include @@ -40,9 +41,10 @@ #include "rounding_mode.h" #include "clImageHelper.h" -extern int gTestCount; -extern int gTestFailure; +#include + extern cl_device_type gDeviceType; +extern bool gTestRounding; // Number of iterations per image format to test if not testing max images, rounding, or small images #define NUM_IMAGE_ITERATIONS 3 @@ -72,16 +74,23 @@ extern void print_read_header( cl_image_format *format, image_sampler_data *samp extern void print_write_header( cl_image_format *format, bool err); extern void print_header( cl_image_format *format, bool err ); extern bool find_format( cl_image_format *formatList, unsigned int numFormats, cl_image_format *formatToFind ); -extern bool check_minimum_supported( cl_image_format *formatList, unsigned int numFormats, cl_mem_flags flags ); +extern bool is_image_format_required(cl_image_format format, + cl_mem_flags flags, + cl_mem_object_type image_type, + cl_device_id device); +extern void build_required_image_formats(cl_mem_flags flags, + cl_mem_object_type image_type, + cl_device_id device, + std::vector& formatsToSupport); -extern size_t get_format_type_size( const cl_image_format *format ); -extern size_t get_channel_data_type_size( cl_channel_type channelType ); -extern size_t get_format_channel_count( const cl_image_format *format ); -extern size_t get_channel_order_channel_count( cl_channel_order order ); +extern uint32_t get_format_type_size(const cl_image_format *format); +extern uint32_t get_channel_data_type_size(cl_channel_type channelType); +extern uint32_t get_format_channel_count(const cl_image_format *format); +extern uint32_t get_channel_order_channel_count(cl_channel_order order); cl_channel_type get_channel_type_from_name( const char *name ); cl_channel_order get_channel_order_from_name( const char *name ); extern int is_format_signed( const cl_image_format *format ); -extern size_t get_pixel_size( cl_image_format *format ); +extern uint32_t get_pixel_size(cl_image_format *format); /* Helper to get any ol image format as long as it is 8-bits-per-channel */ extern int get_8_bit_image_format( cl_context context, cl_mem_object_type objType, cl_mem_flags flags, size_t channelCount, cl_image_format *outFormat ); @@ -147,7 +156,6 @@ size_t compute_mip_level_offset( image_descriptor * imageInfo , size_t lod); template void read_image_pixel( void *imageData, image_descriptor *imageInfo, int x, int y, int z, T *outData, int lod ) { - float convert_half_to_float( unsigned short halfValue ); size_t width_lod = imageInfo->width, height_lod = imageInfo->height, depth_lod = imageInfo->depth, slice_pitch_lod = 0/*imageInfo->slicePitch*/ , row_pitch_lod = 0/*imageInfo->rowPitch*/; width_lod = ( imageInfo->width >> lod) ?( imageInfo->width >> lod):1; @@ -271,7 +279,7 @@ template void read_image_pixel( void *imageData, image_descriptor *ima { cl_ushort *dPtr = (cl_ushort *)ptr; for( i = 0; i < get_format_channel_count( format ); i++ ) - tempData[ i ] = (T)convert_half_to_float( dPtr[ i ] ); + tempData[i] = (T)cl_half_to_float(dPtr[i]); break; } @@ -631,12 +639,17 @@ protected: size_t mVecSize; }; +extern cl_ushort convert_float_to_half(float f); extern int DetectFloatToHalfRoundingMode( cl_command_queue ); // Returns CL_SUCCESS on success -int inline is_half_nan( cl_ushort half ){ return (half & 0x7fff) > 0x7c00; } +// sign bit: don't care, exponent: maximum value, significand: non-zero +static int inline is_half_nan( cl_ushort half ){ return ( half & 0x7fff ) > 0x7c00; } -cl_ushort convert_float_to_half( cl_float f ); -cl_float convert_half_to_float( cl_ushort h ); +// sign bit: don't care, exponent: zero, significand: non-zero +static int inline is_half_denorm( cl_ushort half ){ return IsHalfSubnormal( half ); } + +// sign bit: don't care, exponent: zero, significand: zero +static int inline is_half_zero( cl_ushort half ){ return ( half & 0x7fff ) == 0; } extern double sRGBmap(float fc); diff --git a/test_common/harness/kernelHelpers.c b/test_common/harness/kernelHelpers.c deleted file mode 100644 index c4eb9b33..00000000 --- a/test_common/harness/kernelHelpers.c +++ /dev/null @@ -1,1282 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "crc32.h" -#include "kernelHelpers.h" -#include "errorHelpers.h" -#include "imageHelpers.h" -#include "typeWrappers.h" -#include "testHarness.h" -#include "parseParameters.h" - -#include -#include -#include -#include -#include - -#if defined(__MINGW32__) -#include "mingw_compat.h" -#endif - -#if defined(_WIN32) -std::string slash = "\\"; -#else -std::string slash = "/"; -#endif - -std::string get_file_name(const std::string &baseName, int index, const std::string &extension) -{ - std::ostringstream fileName; - fileName << baseName << "." << index << extension; - return fileName.str(); -} - -long get_file_size(const std::string &fileName) -{ - std::ifstream ifs(fileName.c_str(), std::ios::binary); - if (!ifs.good()) - return 0; - // get length of file: - ifs.seekg(0, std::ios::end); - std::ios::pos_type length = ifs.tellg(); - return static_cast(length); -} - -std::vector get_file_content(const std::string &fileName) -{ - std::ifstream ifs(fileName.c_str(), std::ios::binary); - if (!ifs.good()) - return std::vector(0); - // get length of file: - ifs.seekg(0, std::ios::end); - std::ios::pos_type length = ifs.tellg(); - ifs.seekg(0, std::ios::beg); - - // allocate memory: - std::vector content(static_cast(length)); - - // read data as a block: - ifs.read(&content[0], length); - return content; -} - -std::string get_kernel_name(const std::string &source) -{ - // Count CRC - cl_uint crc = crc32(source.data(), source.size()); - - // Create list of kernel names - std::string kernelsList; - size_t kPos = source.find("kernel"); - while (kPos != std::string::npos) - { - // check for '__kernel' - size_t pos = kPos; - if (pos >= 2 && source[pos - 1] == '_' && source[pos - 2] == '_') - pos -= 2; - - //check character before 'kernel' (white space expected) - size_t wsPos = source.find_last_of(" \t\r\n", pos); - if (wsPos == std::string::npos || wsPos + 1 == pos) - { - //check character after 'kernel' (white space expected) - size_t akPos = kPos + sizeof("kernel") - 1; - wsPos = source.find_first_of(" \t\r\n", akPos); - if (!(wsPos == akPos)) - { - kPos = source.find("kernel", kPos + 1); - continue; - } - - bool attributeFound; - do - { - attributeFound = false; - // find '(' after kernel name name - size_t pPos = source.find("(", akPos); - if (!(pPos != std::string::npos)) - continue; - - // check for not empty kernel name before '(' - pos = source.find_last_not_of(" \t\r\n", pPos - 1); - if (!(pos != std::string::npos && pos > akPos)) - continue; - - //find character before kernel name - wsPos = source.find_last_of(" \t\r\n", pos); - if (!(wsPos != std::string::npos && wsPos >= akPos)) - continue; - - std::string name = source.substr(wsPos + 1, pos + 1 - (wsPos + 1)); - //check for kernel attribute - if (name == "__attribute__") - { - attributeFound = true; - int pCount = 1; - akPos = pPos + 1; - while (pCount > 0 && akPos != std::string::npos) - { - akPos = source.find_first_of("()", akPos + 1); - if (akPos != std::string::npos) - { - if (source[akPos] == '(') - pCount++; - else - pCount--; - } - } - } - else - { - kernelsList += name + "."; - } - } while (attributeFound); - } - kPos = source.find("kernel", kPos + 1); - } - std::ostringstream oss; - if (MAX_LEN_FOR_KERNEL_LIST > 0) - { - if (kernelsList.size() > MAX_LEN_FOR_KERNEL_LIST + 1) - { - kernelsList = kernelsList.substr(0, MAX_LEN_FOR_KERNEL_LIST + 1); - kernelsList[kernelsList.size() - 1] = '.'; - kernelsList[kernelsList.size() - 1] = '.'; - } - oss << kernelsList; - } - oss << std::hex << std::setfill('0') << std::setw(8) << crc; - return oss.str(); -} - -std::string add_build_options(const std::string &baseName, const char *options) -{ - if (options == 0 || options[0] == 0) - return get_file_name(baseName, 0, ""); - - bool equal = false; - int i = 0; - - do - { - i++; - std::string fileName = gSpirVPath + slash + get_file_name(baseName, i, ".options"); - long fileSize = get_file_size(fileName); - if (fileSize == 0) - break; - //if(fileSize == strlen(options)) - { - std::vector options2 = get_file_content(fileName); - options2.push_back(0); //terminate string - equal = strcmp(options, &options2[0]) == 0; - } - } while (!equal); - if (equal) - return get_file_name(baseName, i, ""); - - std::string fileName = gSpirVPath + slash + get_file_name(baseName, i, ".options"); - std::ofstream ofs(fileName.c_str(), std::ios::binary); - if (!ofs.good()) - { - log_info("OfflineCompiler: can't create options: %s\n", fileName.c_str()); - return ""; - } - // write data as a block: - ofs.write(options, strlen(options)); - log_info("OfflineCompiler: options added: %s\n", fileName.c_str()); - return get_file_name(baseName, i, ""); -} - -int create_single_kernel_helper_create_program(cl_context context, - cl_program *outProgram, - unsigned int numKernelLines, - const char **kernelProgram, - const char *buildOptions, - const bool openclCXX) -{ - int error = CL_SUCCESS; - std::string modifiedKernelStr; - const char* modifiedKernelCode; - - if (gOfflineCompiler) - { - #ifndef CL_OFFLINE_COMPILER - log_error("Offline compilation is not possible: CL_OFFLINE_COMPILER was not defined.\n"); - return -1; - #endif // !CL_OFFLINE_COMPILER - - std::string kernel; - for (size_t i = 0; i < numKernelLines; ++i) - { - std::string chunk(kernelProgram[i], 0, std::string::npos); - kernel += chunk; - } - - std::string kernelName = get_kernel_name(kernel); - - // set build options - std::string bOptions; - bOptions += buildOptions ? std::string(buildOptions) : ""; - - kernelName = add_build_options(kernelName, buildOptions); - - std::string gOfflineCompilerInput = gSpirVPath + slash + kernelName + ".cl"; - std::string gOfflineCompilerOutput = gSpirVPath + slash + kernelName; - - // Get device CL_DEVICE_ADDRESS_BITS - cl_uint device_address_space_size = 0; - if (gOfflineCompilerOutputType == kSpir_v) - { - cl_device_id device; - cl_uint numDevices = 0; - cl_int error = clGetContextInfo(context, CL_CONTEXT_NUM_DEVICES, sizeof(cl_uint), &numDevices, 0); - if (error != CL_SUCCESS) - { - print_error(error, "clGetContextInfo failed"); - return error; - } - - std::vector devices(numDevices, 0); - error = clGetContextInfo(context, CL_CONTEXT_DEVICES, numDevices*sizeof(cl_device_id), &devices[0], 0); - if (error != CL_SUCCESS) - { - print_error(error, "clGetContextInfo failed"); - return error; - } - - error = clGetContextInfo(context, CL_CONTEXT_DEVICES, numDevices*sizeof(cl_device_id), &devices[0], NULL); - if (error != CL_SUCCESS) - { - print_error(error, "clGetContextInfo failed"); - return error; - } - - if ((0 == device_address_space_size) && ((error = clGetDeviceInfo(devices[0], CL_DEVICE_ADDRESS_BITS, sizeof(cl_uint), &device_address_space_size, NULL)))) - { - print_error(error, "Unable to obtain device address bits"); - return -1; - } - - if (device_address_space_size == 32) - { - gOfflineCompilerOutput += ".spv32"; - } - else if (device_address_space_size == 64) - { - gOfflineCompilerOutput += ".spv64"; - } - } - - // try to read cached output file when test is run with gForceSpirVGenerate = false - std::ifstream ifs(gOfflineCompilerOutput.c_str(), std::ios::binary); - if (!ifs.good() || gForceSpirVGenerate) - { - if (gForceSpirVCache) - { - log_info("OfflineCompiler: can't open cached SpirV file: %s\n", gOfflineCompilerOutput.c_str()); - return -1; - } - - ifs.close(); - - if (!gForceSpirVGenerate) - log_info("OfflineCompiler: can't find cached SpirV file: %s\n", gOfflineCompilerOutput.c_str()); - - std::ofstream ofs(gOfflineCompilerInput.c_str(), std::ios::binary); - if (!ofs.good()) - { - log_info("OfflineCompiler: can't create source file: %s\n", gOfflineCompilerInput.c_str()); - return -1; - } - - // write source to input file - ofs.write(kernel.c_str(), kernel.size()); - ofs.close(); - - // Set compiler options - // Emit SPIR-V - std::string compilerOptions = " -cc1 -emit-spirv"; - // : for 32 bit SPIR-V use spir-unknown-unknown, for 64 bit SPIR-V use spir64-unknown-unknown. - if(device_address_space_size == 32) - { - compilerOptions += " -triple=spir-unknown-unknown"; - } - else - { - compilerOptions += " -triple=spir64-unknown-unknown"; - } - // Set OpenCL C++ flag required by SPIR-V-ready clang (compiler provided by Khronos) - if(openclCXX) - { - compilerOptions = compilerOptions + " -cl-std=c++"; - } - // Set correct includes - if(openclCXX) - { - compilerOptions += " -I "; - compilerOptions += STRINGIFY_VALUE(CL_LIBCLCXX_DIR); - } - else - { - compilerOptions += " -include opencl.h"; - } - - #ifdef CL_OFFLINE_COMPILER_OPTIONS - compilerOptions += STRINGIFY_VALUE(CL_OFFLINE_COMPILER_OPTIONS); - #endif - - // Add build options passed to this function - compilerOptions += " " + bOptions; - compilerOptions += - " " + gOfflineCompilerInput + - " -o " + gOfflineCompilerOutput; - std::string runString = STRINGIFY_VALUE(CL_OFFLINE_COMPILER) + compilerOptions; - - // execute script - log_info("Executing command: %s\n", runString.c_str()); - fflush(stdout); - int returnCode = system(runString.c_str()); - if (returnCode != 0) - { - log_error("ERROR: Command finished with error: 0x%x\n", returnCode); - return CL_COMPILE_PROGRAM_FAILURE; - } - // read output file - ifs.open(gOfflineCompilerOutput.c_str(), std::ios::binary); - if (!ifs.good()) - { - log_info("OfflineCompiler: can't read output file: %s\n", gOfflineCompilerOutput.c_str()); - return -1; - } - } - - // ----------------------------------------------------------------------------------- - // ------------- ONLY FOR OPENCL 22 CONFORMANCE TEST 22 DEVELOPMENT ------------------ - // ----------------------------------------------------------------------------------- - // Only OpenCL C++ to SPIR-V compilation - #if defined(DEVELOPMENT) && defined(ONLY_SPIRV_COMPILATION) - if(openclCXX) - { - return CL_SUCCESS; - } - #endif - - ifs.seekg(0, ifs.end); - int length = ifs.tellg(); - ifs.seekg(0, ifs.beg); - - //treat modifiedProgram as input for clCreateProgramWithSource - if (gOfflineCompilerOutputType == kSource) - { - // read source from file: - std::vector modifiedKernelBuf(length); - - ifs.read(&modifiedKernelBuf[0], length); - ifs.close(); - - for (int i = 0; i < length; i++) - modifiedKernelStr.push_back(modifiedKernelBuf[i]); - - modifiedKernelCode = &modifiedKernelStr[0]; - - /* Create the program object from source - to be removed in the future as we will use offline compiler here */ - *outProgram = clCreateProgramWithSource(context, numKernelLines, &modifiedKernelCode, NULL, &error); - if (*outProgram == NULL || error != CL_SUCCESS) - { - print_error(error, "clCreateProgramWithSource failed"); - return error; - } - } - //treat modifiedProgram as input for clCreateProgramWithBinary - else if (gOfflineCompilerOutputType == kBinary) - { - // read binary from file: - std::vector modifiedKernelBuf(length); - - ifs.read((char *)&modifiedKernelBuf[0], length); - ifs.close(); - - cl_uint numDevices = 0; - cl_int error = clGetContextInfo(context, CL_CONTEXT_NUM_DEVICES, sizeof(cl_uint), &numDevices, 0); - test_error(error, "clGetContextInfo failed"); - - std::vector devices(numDevices, 0); - error = clGetContextInfo(context, CL_CONTEXT_DEVICES, numDevices*sizeof(cl_device_id), &devices[0], 0); - test_error(error, "clGetContextInfo failed"); - - size_t lengths = modifiedKernelBuf.size(); - const unsigned char *binaries = { &modifiedKernelBuf[0] }; - log_info("offlineCompiler: clCreateProgramWithSource replaced with clCreateProgramWithBinary\n"); - *outProgram = clCreateProgramWithBinary(context, 1, &devices[0], &lengths, &binaries, NULL, &error); - if (*outProgram == NULL || error != CL_SUCCESS) - { - print_error(error, "clCreateProgramWithBinary failed"); - return error; - } - } - //treat modifiedProgram as input for clCreateProgramWithIL - else if (gOfflineCompilerOutputType == kSpir_v) - { - // read spir-v from file: - std::vector modifiedKernelBuf(length); - - ifs.read((char *)&modifiedKernelBuf[0], length); - ifs.close(); - - size_t length = modifiedKernelBuf.size(); - log_info("offlineCompiler: clCreateProgramWithSource replaced with clCreateProgramWithIL\n"); - - *outProgram = clCreateProgramWithIL(context, &modifiedKernelBuf[0], length, &error); - if (*outProgram == NULL || error != CL_SUCCESS) - { - print_error(error, "clCreateProgramWithIL failed"); - return error; - } - } - } - else // gOfflineCompiler == false - { - /* Create the program object from source */ - *outProgram = clCreateProgramWithSource(context, numKernelLines, kernelProgram, NULL, &error); - if (*outProgram == NULL || error != CL_SUCCESS) - { - print_error(error, "clCreateProgramWithSource failed"); - return error; - } - } - return 0; -} - -int create_single_kernel_helper_with_build_options(cl_context context, - cl_program *outProgram, - cl_kernel *outKernel, - unsigned int numKernelLines, - const char **kernelProgram, - const char *kernelName, - const char *buildOptions, - const bool openclCXX) -{ - return create_single_kernel_helper(context, outProgram, outKernel, numKernelLines, kernelProgram, kernelName, buildOptions, openclCXX); -} - -// Creates and builds OpenCL C/C++ program, and creates a kernel -int create_single_kernel_helper(cl_context context, - cl_program *outProgram, - cl_kernel *outKernel, - unsigned int numKernelLines, - const char **kernelProgram, - const char *kernelName, - const char *buildOptions, - const bool openclCXX) -{ - int error; - // Create OpenCL C++ program - if(openclCXX) - { - // ----------------------------------------------------------------------------------- - // ------------- ONLY FOR OPENCL 22 CONFORMANCE TEST 22 DEVELOPMENT ------------------ - // ----------------------------------------------------------------------------------- - // Only OpenCL C++ to SPIR-V compilation - #if defined(DEVELOPMENT) && defined(ONLY_SPIRV_COMPILATION) - // Save global variable - bool tempgForceSpirVGenerate = gForceSpirVGenerate; - // Force OpenCL C++ -> SPIR-V compilation on every run - gForceSpirVGenerate = true; - #endif - error = create_openclcpp_program( - context, outProgram, numKernelLines, kernelProgram, buildOptions - ); - if (error != CL_SUCCESS) - { - log_error("Create program failed: %d, line: %d\n", error, __LINE__); - return error; - } - // ----------------------------------------------------------------------------------- - // ------------- ONLY FOR OPENCL 22 CONFORMANCE TEST 22 DEVELOPMENT ------------------ - // ----------------------------------------------------------------------------------- - #if defined(DEVELOPMENT) && defined(ONLY_SPIRV_COMPILATION) - // Restore global variables - gForceSpirVGenerate = tempgForceSpirVGenerate; - log_info("WARNING: KERNEL %s WAS ONLY COMPILED TO SPIR-V\n", kernelName); - return error; - #endif - } - // Create OpenCL C program - else - { - error = create_single_kernel_helper_create_program( - context, outProgram, numKernelLines, kernelProgram, buildOptions - ); - if (error != CL_SUCCESS) - { - log_error("Create program failed: %d, line: %d\n", error, __LINE__); - return error; - } - } - // Remove offline-compiler-only build options - std::string newBuildOptions; - if (buildOptions != NULL) - { - newBuildOptions = buildOptions; - std::string offlineCompierOptions[] = { - "-cl-fp16-enable", - "-cl-fp64-enable", - "-cl-zero-init-local-mem-vars" - }; - for(auto& s : offlineCompierOptions) - { - std::string::size_type i = newBuildOptions.find(s); - if (i != std::string::npos) - newBuildOptions.erase(i, s.length()); - } - } - // Build program and create kernel - return build_program_create_kernel_helper( - context, outProgram, outKernel, numKernelLines, kernelProgram, kernelName, newBuildOptions.c_str() - ); -} - -// Creates OpenCL C++ program -int create_openclcpp_program(cl_context context, - cl_program *outProgram, - unsigned int numKernelLines, - const char **kernelProgram, - const char *buildOptions) -{ - // Save global variables - bool tempgOfflineCompiler = gOfflineCompiler; - OfflineCompilerOutputType tempgOfflineCompilerOutputType = gOfflineCompilerOutputType; - // Force offline compilation to SPIR-V - gOfflineCompiler = true; - gOfflineCompilerOutputType = OfflineCompilerOutputType::kSpir_v; - // Create program - int error = create_single_kernel_helper_create_program( - context, outProgram, numKernelLines, kernelProgram, buildOptions, true - ); - // Restore global variable - gOfflineCompiler = tempgOfflineCompiler; - gOfflineCompilerOutputType = tempgOfflineCompilerOutputType; - // Return result - return error; -} - -// Builds OpenCL C/C++ program and creates -int build_program_create_kernel_helper(cl_context context, - cl_program *outProgram, - cl_kernel *outKernel, - unsigned int numKernelLines, - const char **kernelProgram, - const char *kernelName, - const char *buildOptions) -{ - int error; - /* Compile the program */ - int buildProgramFailed = 0; - int printedSource = 0; - error = clBuildProgram(*outProgram, 0, NULL, buildOptions, NULL, NULL); - if (error != CL_SUCCESS) - { - unsigned int i; - print_error(error, "clBuildProgram failed"); - buildProgramFailed = 1; - printedSource = 1; - log_error("Build options: %s\n", buildOptions); - log_error("Original source is: ------------\n"); - for (i = 0; i < numKernelLines; i++) - log_error("%s", kernelProgram[i]); - } - - // Verify the build status on all devices - cl_uint deviceCount = 0; - error = clGetProgramInfo(*outProgram, CL_PROGRAM_NUM_DEVICES, sizeof(deviceCount), &deviceCount, NULL); - if (error != CL_SUCCESS) - { - print_error(error, "clGetProgramInfo CL_PROGRAM_NUM_DEVICES failed"); - return error; - } - - if (deviceCount == 0) - { - log_error("No devices found for program.\n"); - return -1; - } - - cl_device_id *devices = (cl_device_id *)malloc(deviceCount * sizeof(cl_device_id)); - if (NULL == devices) - return -1; - BufferOwningPtr devicesBuf(devices); - - memset(devices, 0, deviceCount * sizeof(cl_device_id)); - error = clGetProgramInfo(*outProgram, CL_PROGRAM_DEVICES, sizeof(cl_device_id) * deviceCount, devices, NULL); - if (error != CL_SUCCESS) - { - print_error(error, "clGetProgramInfo CL_PROGRAM_DEVICES failed"); - return error; - } - - cl_uint z; - bool buildFailed = false; - for (z = 0; z < deviceCount; z++) - { - char deviceName[4096] = ""; - error = clGetDeviceInfo(devices[z], CL_DEVICE_NAME, sizeof(deviceName), deviceName, NULL); - if (error != CL_SUCCESS || deviceName[0] == '\0') - { - log_error("Device \"%d\" failed to return a name\n", z); - print_error(error, "clGetDeviceInfo CL_DEVICE_NAME failed"); - } - - cl_build_status buildStatus; - error = clGetProgramBuildInfo(*outProgram, devices[z], CL_PROGRAM_BUILD_STATUS, sizeof(buildStatus), &buildStatus, NULL); - if (error != CL_SUCCESS) - { - print_error(error, "clGetProgramBuildInfo CL_PROGRAM_BUILD_STATUS failed"); - return error; - } - - if (buildStatus == CL_BUILD_SUCCESS && buildProgramFailed && deviceCount == 1) - { - buildFailed = true; - log_error("clBuildProgram returned an error, but buildStatus is marked as CL_BUILD_SUCCESS.\n"); - } - - if (buildStatus != CL_BUILD_SUCCESS) - { - - char statusString[64] = ""; - if (buildStatus == (cl_build_status)CL_BUILD_SUCCESS) - sprintf(statusString, "CL_BUILD_SUCCESS"); - else if (buildStatus == (cl_build_status)CL_BUILD_NONE) - sprintf(statusString, "CL_BUILD_NONE"); - else if (buildStatus == (cl_build_status)CL_BUILD_ERROR) - sprintf(statusString, "CL_BUILD_ERROR"); - else if (buildStatus == (cl_build_status)CL_BUILD_IN_PROGRESS) - sprintf(statusString, "CL_BUILD_IN_PROGRESS"); - else - sprintf(statusString, "UNKNOWN (%d)", buildStatus); - - if (buildStatus != CL_BUILD_SUCCESS) - log_error("Build not successful for device \"%s\", status: %s\n", deviceName, statusString); - size_t paramSize = 0; - error = clGetProgramBuildInfo(*outProgram, devices[z], CL_PROGRAM_BUILD_LOG, 0, NULL, ¶mSize); - if (error != CL_SUCCESS) - { - - print_error(error, "clGetProgramBuildInfo CL_PROGRAM_BUILD_LOG failed"); - return error; - } - - std::string log; - log.resize(paramSize / sizeof(char)); - error = clGetProgramBuildInfo(*outProgram, devices[z], CL_PROGRAM_BUILD_LOG, paramSize, &log[0], NULL); - if (error != CL_SUCCESS || log[0] == '\0') - { - log_error("Device %d (%s) failed to return a build log\n", z, deviceName); - if (error) - { - print_error(error, "clGetProgramBuildInfo CL_PROGRAM_BUILD_LOG failed"); - return error; - } - else - { - log_error("clGetProgramBuildInfo returned an empty log.\n"); - return -1; - } - } - // In this case we've already printed out the code above. - if (!printedSource) - { - unsigned int i; - log_error("Original source is: ------------\n"); - for (i = 0; i < numKernelLines; i++) - log_error("%s", kernelProgram[i]); - printedSource = 1; - } - log_error("Build log for device \"%s\" is: ------------\n", deviceName); - log_error("%s\n", log.c_str()); - log_error("\n----------\n"); - return -1; - } - } - - if (buildFailed) - { - return -1; - } - - /* And create a kernel from it */ - if (kernelName != NULL) - { - *outKernel = clCreateKernel(*outProgram, kernelName, &error); - if (*outKernel == NULL || error != CL_SUCCESS) - { - print_error(error, "Unable to create kernel"); - return error; - } - } - - return 0; -} - -int get_device_version( cl_device_id id, size_t* major, size_t* minor) -{ - cl_char buffer[ 4098 ]; - size_t length; - - // Device version should fit the regex "OpenCL [0-9]+\.[0-9]+ *.*" - cl_int error = clGetDeviceInfo( id, CL_DEVICE_VERSION, sizeof( buffer ), buffer, &length ); - test_error( error, "Unable to get device version string" ); - - char *p1 = (char *)buffer + strlen( "OpenCL " ); - char *p2; - while( *p1 == ' ' ) - p1++; - *major = strtol( p1, &p2, 10 ); - error = *p2 != '.'; - test_error(error, "ERROR: Version number must contain a decimal point!"); - *minor = strtol( ++p2, NULL, 10 ); - return error; -} - -int get_max_allowed_work_group_size( cl_context context, cl_kernel kernel, size_t *outMaxSize, size_t *outLimits ) -{ - cl_device_id *devices; - size_t size, maxCommonSize = 0; - int numDevices, i, j, error; - cl_uint numDims; - size_t outSize; - size_t sizeLimit[]={1,1,1}; - - - /* Assume fewer than 16 devices will be returned */ - error = clGetContextInfo( context, CL_CONTEXT_DEVICES, 0, NULL, &outSize ); - test_error( error, "Unable to obtain list of devices size for context" ); - devices = (cl_device_id *)malloc(outSize); - BufferOwningPtr devicesBuf(devices); - - error = clGetContextInfo( context, CL_CONTEXT_DEVICES, outSize, devices, NULL ); - test_error( error, "Unable to obtain list of devices for context" ); - - numDevices = (int)( outSize / sizeof( cl_device_id ) ); - - for( i = 0; i < numDevices; i++ ) - { - error = clGetDeviceInfo( devices[i], CL_DEVICE_MAX_WORK_GROUP_SIZE, sizeof( size ), &size, NULL ); - test_error( error, "Unable to obtain max work group size for device" ); - if( size < maxCommonSize || maxCommonSize == 0) - maxCommonSize = size; - - error = clGetKernelWorkGroupInfo( kernel, devices[i], CL_KERNEL_WORK_GROUP_SIZE, sizeof( size ), &size, NULL ); - test_error( error, "Unable to obtain max work group size for device and kernel combo" ); - if( size < maxCommonSize || maxCommonSize == 0) - maxCommonSize = size; - - error= clGetDeviceInfo( devices[i], CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, sizeof( numDims ), &numDims, NULL); - test_error( error, "clGetDeviceInfo failed for CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS"); - sizeLimit[0] = 1; - error= clGetDeviceInfo( devices[i], CL_DEVICE_MAX_WORK_ITEM_SIZES, numDims*sizeof(size_t), sizeLimit, NULL); - test_error( error, "clGetDeviceInfo failed for CL_DEVICE_MAX_WORK_ITEM_SIZES"); - - if (outLimits != NULL) - { - if (i == 0) { - for (j=0; j<3; j++) - outLimits[j] = sizeLimit[j]; - } else { - for (j=0; j<(int)numDims; j++) { - if (sizeLimit[j] < outLimits[j]) - outLimits[j] = sizeLimit[j]; - } - } - } - } - - *outMaxSize = (unsigned int)maxCommonSize; - return 0; -} - - -int get_max_common_work_group_size( cl_context context, cl_kernel kernel, - size_t globalThreadSize, size_t *outMaxSize ) -{ - size_t sizeLimit[3]; - int error = get_max_allowed_work_group_size( context, kernel, outMaxSize, sizeLimit ); - if( error != 0 ) - return error; - - /* Now find the largest factor of globalThreadSize that is <= maxCommonSize */ - /* Note for speed, we don't need to check the range of maxCommonSize, b/c once it gets to 1, - the modulo test will succeed and break the loop anyway */ - for( ; ( globalThreadSize % *outMaxSize ) != 0 || (*outMaxSize > sizeLimit[0]); (*outMaxSize)-- ) - ; - return 0; -} - -int get_max_common_2D_work_group_size( cl_context context, cl_kernel kernel, - size_t *globalThreadSizes, size_t *outMaxSizes ) -{ - size_t sizeLimit[3]; - size_t maxSize; - int error = get_max_allowed_work_group_size( context, kernel, &maxSize, sizeLimit ); - if( error != 0 ) - return error; - - /* Now find a set of factors, multiplied together less than maxSize, but each a factor of the global - sizes */ - - /* Simple case */ - if( globalThreadSizes[ 0 ] * globalThreadSizes[ 1 ] <= maxSize ) - { - if (globalThreadSizes[ 0 ] <= sizeLimit[0] && globalThreadSizes[ 1 ] <= sizeLimit[1]) { - outMaxSizes[ 0 ] = globalThreadSizes[ 0 ]; - outMaxSizes[ 1 ] = globalThreadSizes[ 1 ]; - return 0; - } - } - - size_t remainingSize, sizeForThisOne; - remainingSize = maxSize; - int i, j; - for (i=0 ; i<2; i++) { - if (globalThreadSizes[i] > remainingSize) - sizeForThisOne = remainingSize; - else - sizeForThisOne = globalThreadSizes[i]; - for (; (globalThreadSizes[i] % sizeForThisOne) != 0 || (sizeForThisOne > sizeLimit[i]); sizeForThisOne--) ; - outMaxSizes[i] = sizeForThisOne; - remainingSize = maxSize; - for (j=0; j<=i; j++) - remainingSize /=outMaxSizes[j]; - } - - return 0; -} - -int get_max_common_3D_work_group_size( cl_context context, cl_kernel kernel, - size_t *globalThreadSizes, size_t *outMaxSizes ) -{ - size_t sizeLimit[3]; - size_t maxSize; - int error = get_max_allowed_work_group_size( context, kernel, &maxSize, sizeLimit ); - if( error != 0 ) - return error; - /* Now find a set of factors, multiplied together less than maxSize, but each a factor of the global - sizes */ - - /* Simple case */ - if( globalThreadSizes[ 0 ] * globalThreadSizes[ 1 ] * globalThreadSizes[ 2 ] <= maxSize ) - { - if (globalThreadSizes[ 0 ] <= sizeLimit[0] && globalThreadSizes[ 1 ] <= sizeLimit[1] && globalThreadSizes[ 2 ] <= sizeLimit[2]) { - outMaxSizes[ 0 ] = globalThreadSizes[ 0 ]; - outMaxSizes[ 1 ] = globalThreadSizes[ 1 ]; - outMaxSizes[ 2 ] = globalThreadSizes[ 2 ]; - return 0; - } - } - - size_t remainingSize, sizeForThisOne; - remainingSize = maxSize; - int i, j; - for (i=0 ; i<3; i++) { - if (globalThreadSizes[i] > remainingSize) - sizeForThisOne = remainingSize; - else - sizeForThisOne = globalThreadSizes[i]; - for (; (globalThreadSizes[i] % sizeForThisOne) != 0 || (sizeForThisOne > sizeLimit[i]); sizeForThisOne--) ; - outMaxSizes[i] = sizeForThisOne; - remainingSize = maxSize; - for (j=0; j<=i; j++) - remainingSize /=outMaxSizes[j]; - } - - return 0; -} - -/* Helper to determine if an extension is supported by a device */ -int is_extension_available( cl_device_id device, const char *extensionName ) -{ - char *extString; - size_t size = 0; - int err; - int result = 0; - - if(( err = clGetDeviceInfo(device, CL_DEVICE_EXTENSIONS, 0, NULL, &size) )) - { - log_error( "Error: failed to determine size of device extensions string at %s:%d (err = %d)\n", __FILE__, __LINE__, err ); - return 0; - } - - if( 0 == size ) - return 0; - - extString = (char*) malloc( size ); - - if( NULL == extString ) - { - log_error( "Error: unable to allocate %ld byte buffer for extension string at %s:%d (err = %d)\n", size, __FILE__, __LINE__, err ); - return 0; - } - BufferOwningPtr extStringBuf(extString); - - if(( err = clGetDeviceInfo(device, CL_DEVICE_EXTENSIONS, size, extString, NULL) )) - { - log_error( "Error: failed to obtain device extensions string at %s:%d (err = %d)\n", __FILE__, __LINE__, err ); - return 0; - } - - if( strstr( extString, extensionName ) ) - result = 1; - - return result; -} - -/* Helper to determine if a device supports an image format */ -int is_image_format_supported( cl_context context, cl_mem_flags flags, cl_mem_object_type image_type, const cl_image_format *fmt ) -{ - cl_image_format *list; - cl_uint count = 0; - cl_int err = clGetSupportedImageFormats( context, flags, image_type, 128, NULL, &count ); - if( count == 0 ) - return 0; - - list = (cl_image_format*) malloc( count * sizeof( cl_image_format ) ); - if( NULL == list ) - { - log_error( "Error: unable to allocate %ld byte buffer for image format list at %s:%d (err = %d)\n", count * sizeof( cl_image_format ), __FILE__, __LINE__, err ); - return 0; - } - BufferOwningPtr listBuf(list); - - - cl_int error = clGetSupportedImageFormats( context, flags, image_type, count, list, NULL ); - if( error ) - { - log_error( "Error: failed to obtain supported image type list at %s:%d (err = %d)\n", __FILE__, __LINE__, err ); - return 0; - } - - // iterate looking for a match. - cl_uint i; - for( i = 0; i < count; i++ ) - { - if( fmt->image_channel_data_type == list[ i ].image_channel_data_type && - fmt->image_channel_order == list[ i ].image_channel_order ) - break; - } - - return ( i < count ) ? 1 : 0; -} - -size_t get_pixel_bytes( const cl_image_format *fmt ); -size_t get_pixel_bytes( const cl_image_format *fmt ) -{ - size_t chanCount; - switch( fmt->image_channel_order ) - { - case CL_R: - case CL_A: - case CL_Rx: - case CL_INTENSITY: - case CL_LUMINANCE: - case CL_DEPTH: - chanCount = 1; - break; - case CL_RG: - case CL_RA: - case CL_RGx: - chanCount = 2; - break; - case CL_RGB: - case CL_RGBx: - case CL_sRGB: - case CL_sRGBx: - chanCount = 3; - break; - case CL_RGBA: - case CL_ARGB: - case CL_BGRA: - case CL_sBGRA: - case CL_sRGBA: -#ifdef CL_1RGB_APPLE - case CL_1RGB_APPLE: -#endif -#ifdef CL_BGR1_APPLE - case CL_BGR1_APPLE: -#endif - chanCount = 4; - break; - default: - log_error("Unknown channel order at %s:%d!\n", __FILE__, __LINE__ ); - abort(); - break; - } - - switch( fmt->image_channel_data_type ) - { - case CL_UNORM_SHORT_565: - case CL_UNORM_SHORT_555: - return 2; - - case CL_UNORM_INT_101010: - return 4; - - case CL_SNORM_INT8: - case CL_UNORM_INT8: - case CL_SIGNED_INT8: - case CL_UNSIGNED_INT8: - return chanCount; - - case CL_SNORM_INT16: - case CL_UNORM_INT16: - case CL_HALF_FLOAT: - case CL_SIGNED_INT16: - case CL_UNSIGNED_INT16: -#ifdef CL_SFIXED14_APPLE - case CL_SFIXED14_APPLE: -#endif - return chanCount * 2; - - case CL_SIGNED_INT32: - case CL_UNSIGNED_INT32: - case CL_FLOAT: - return chanCount * 4; - - default: - log_error("Unknown channel data type at %s:%d!\n", __FILE__, __LINE__ ); - abort(); - } - - return 0; -} - -test_status verifyImageSupport( cl_device_id device ) -{ - if( checkForImageSupport( device ) ) - { - log_error( "ERROR: Device does not supported images as required by this test!\n" ); - return TEST_FAIL; - } - return TEST_PASS; -} - -int checkForImageSupport( cl_device_id device ) -{ - cl_uint i; - int error; - - - /* Check the device props to see if images are supported at all first */ - error = clGetDeviceInfo( device, CL_DEVICE_IMAGE_SUPPORT, sizeof( i ), &i, NULL ); - test_error( error, "Unable to query device for image support" ); - if( i == 0 ) - { - return CL_IMAGE_FORMAT_NOT_SUPPORTED; - } - - /* So our support is good */ - return 0; -} - -int checkFor3DImageSupport( cl_device_id device ) -{ - cl_uint i; - int error; - - /* Check the device props to see if images are supported at all first */ - error = clGetDeviceInfo( device, CL_DEVICE_IMAGE_SUPPORT, sizeof( i ), &i, NULL ); - test_error( error, "Unable to query device for image support" ); - if( i == 0 ) - { - return CL_IMAGE_FORMAT_NOT_SUPPORTED; - } - - char profile[128]; - error = clGetDeviceInfo( device, CL_DEVICE_PROFILE, sizeof(profile ), profile, NULL ); - test_error( error, "Unable to query device for CL_DEVICE_PROFILE" ); - if( 0 == strcmp( profile, "EMBEDDED_PROFILE" ) ) - { - size_t width = -1L; - size_t height = -1L; - size_t depth = -1L; - error = clGetDeviceInfo( device, CL_DEVICE_IMAGE3D_MAX_WIDTH, sizeof(width), &width, NULL ); - test_error( error, "Unable to get CL_DEVICE_IMAGE3D_MAX_WIDTH" ); - error = clGetDeviceInfo( device, CL_DEVICE_IMAGE3D_MAX_HEIGHT, sizeof(height), &height, NULL ); - test_error( error, "Unable to get CL_DEVICE_IMAGE3D_MAX_HEIGHT" ); - error = clGetDeviceInfo( device, CL_DEVICE_IMAGE3D_MAX_DEPTH, sizeof(depth), &depth, NULL ); - test_error( error, "Unable to get CL_DEVICE_IMAGE3D_MAX_DEPTH" ); - - if( 0 == (height | width | depth )) - return CL_IMAGE_FORMAT_NOT_SUPPORTED; - } - - /* So our support is good */ - return 0; -} - -void * align_malloc(size_t size, size_t alignment) -{ -#if defined(_WIN32) && defined(_MSC_VER) - return _aligned_malloc(size, alignment); -#elif defined(__linux__) || defined (linux) || defined(__APPLE__) - void * ptr = NULL; - // alignemnt must be a power of two and multiple of sizeof(void *). - if ( alignment < sizeof( void * ) ) - { - alignment = sizeof( void * ); - } -#if defined(__ANDROID__) - ptr = memalign(alignment, size); - if ( ptr ) - return ptr; -#else - if (0 == posix_memalign(&ptr, alignment, size)) - return ptr; -#endif - return NULL; -#elif defined(__MINGW32__) - return __mingw_aligned_malloc(size, alignment); -#else - #error "Please add support OS for aligned malloc" -#endif -} - -void align_free(void * ptr) -{ -#if defined(_WIN32) && defined(_MSC_VER) - _aligned_free(ptr); -#elif defined(__linux__) || defined (linux) || defined(__APPLE__) - return free(ptr); -#elif defined(__MINGW32__) - return __mingw_aligned_free(ptr); -#else - #error "Please add support OS for aligned free" -#endif -} - -size_t get_min_alignment(cl_context context) -{ - static cl_uint align_size = 0; - - if( 0 == align_size ) - { - cl_device_id * devices; - size_t devices_size = 0; - cl_uint result = 0; - cl_int error; - int i; - - error = clGetContextInfo (context, - CL_CONTEXT_DEVICES, - 0, - NULL, - &devices_size); - test_error_ret(error, "clGetContextInfo failed", 0); - - devices = (cl_device_id*)malloc(devices_size); - if (devices == NULL) { - print_error( error, "malloc failed" ); - return 0; - } - - error = clGetContextInfo (context, - CL_CONTEXT_DEVICES, - devices_size, - (void*)devices, - NULL); - test_error_ret(error, "clGetContextInfo failed", 0); - - for (i = 0; i < (int)(devices_size/sizeof(cl_device_id)); i++) - { - cl_uint alignment = 0; - - error = clGetDeviceInfo (devices[i], - CL_DEVICE_MEM_BASE_ADDR_ALIGN, - sizeof(cl_uint), - (void*)&alignment, - NULL); - - if (error == CL_SUCCESS) - { - alignment >>= 3; // convert bits to bytes - result = (alignment > result) ? alignment : result; - } - else - print_error( error, "clGetDeviceInfo failed" ); - } - - align_size = result; - free(devices); - } - - return align_size; -} - -cl_device_fp_config get_default_rounding_mode( cl_device_id device ) -{ - char profileStr[128] = ""; - cl_device_fp_config single = 0; - int error = clGetDeviceInfo( device, CL_DEVICE_SINGLE_FP_CONFIG, sizeof( single ), &single, NULL ); - if( error ) - test_error_ret( error, "Unable to get device CL_DEVICE_SINGLE_FP_CONFIG", 0 ); - - if( single & CL_FP_ROUND_TO_NEAREST ) - return CL_FP_ROUND_TO_NEAREST; - - if( 0 == (single & CL_FP_ROUND_TO_ZERO) ) - test_error_ret( -1, "FAILURE: device must support either CL_DEVICE_SINGLE_FP_CONFIG or CL_FP_ROUND_TO_NEAREST", 0 ); - - // Make sure we are an embedded device before allowing a pass - if( (error = clGetDeviceInfo( device, CL_DEVICE_PROFILE, sizeof( profileStr ), &profileStr, NULL ) )) - test_error_ret( error, "FAILURE: Unable to get CL_DEVICE_PROFILE", 0 ); - - if( strcmp( profileStr, "EMBEDDED_PROFILE" ) ) - test_error_ret( error, "FAILURE: non-EMBEDDED_PROFILE devices must support CL_FP_ROUND_TO_NEAREST", 0 ); - - return CL_FP_ROUND_TO_ZERO; -} - -int checkDeviceForQueueSupport( cl_device_id device, cl_command_queue_properties prop ) -{ - cl_command_queue_properties realProps; - cl_int error = clGetDeviceInfo( device, CL_DEVICE_QUEUE_ON_HOST_PROPERTIES, sizeof( realProps ), &realProps, NULL ); - test_error_ret( error, "FAILURE: Unable to get device queue properties", 0 ); - - return ( realProps & prop ) ? 1 : 0; -} - -int printDeviceHeader( cl_device_id device ) -{ - char deviceName[ 512 ], deviceVendor[ 512 ], deviceVersion[ 512 ], cLangVersion[ 512 ]; - int error; - - error = clGetDeviceInfo( device, CL_DEVICE_NAME, sizeof( deviceName ), deviceName, NULL ); - test_error( error, "Unable to get CL_DEVICE_NAME for device" ); - - error = clGetDeviceInfo( device, CL_DEVICE_VENDOR, sizeof( deviceVendor ), deviceVendor, NULL ); - test_error( error, "Unable to get CL_DEVICE_VENDOR for device" ); - - error = clGetDeviceInfo( device, CL_DEVICE_VERSION, sizeof( deviceVersion ), deviceVersion, NULL ); - test_error( error, "Unable to get CL_DEVICE_VERSION for device" ); - - error = clGetDeviceInfo( device, CL_DEVICE_OPENCL_C_VERSION, sizeof( cLangVersion ), cLangVersion, NULL ); - test_error( error, "Unable to get CL_DEVICE_OPENCL_C_VERSION for device" ); - - log_info("Compute Device Name = %s, Compute Device Vendor = %s, Compute Device Version = %s%s%s\n", - deviceName, deviceVendor, deviceVersion, ( error == CL_SUCCESS ) ? ", CL C Version = " : "", - ( error == CL_SUCCESS ) ? cLangVersion : "" ); - - return CL_SUCCESS; -} diff --git a/test_common/harness/kernelHelpers.cpp b/test_common/harness/kernelHelpers.cpp new file mode 100644 index 00000000..bca058c8 --- /dev/null +++ b/test_common/harness/kernelHelpers.cpp @@ -0,0 +1,1715 @@ +// +// Copyright (c) 2017 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "crc32.h" +#include "kernelHelpers.h" +#include "deviceInfo.h" +#include "errorHelpers.h" +#include "imageHelpers.h" +#include "typeWrappers.h" +#include "testHarness.h" +#include "parseParameters.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +std::string slash = "\\"; +#else +std::string slash = "/"; +#endif + +static std::mutex gCompilerMutex; + +static cl_int get_first_device_id(const cl_context context, cl_device_id &device); + +long get_file_size(const std::string &fileName) +{ + std::ifstream ifs(fileName.c_str(), std::ios::binary); + if (!ifs.good()) + return 0; + // get length of file: + ifs.seekg(0, std::ios::end); + std::ios::pos_type length = ifs.tellg(); + return static_cast(length); +} + +static std::string get_kernel_content(unsigned int numKernelLines, const char *const *kernelProgram) +{ + std::string kernel; + for (size_t i = 0; i < numKernelLines; ++i) + { + std::string chunk(kernelProgram[i], 0, std::string::npos); + kernel += chunk; + } + + return kernel; +} + +std::string get_kernel_name(const std::string &source) +{ + // Create list of kernel names + std::string kernelsList; + size_t kPos = source.find("kernel"); + while (kPos != std::string::npos) + { + // check for '__kernel' + size_t pos = kPos; + if (pos >= 2 && source[pos - 1] == '_' && source[pos - 2] == '_') + pos -= 2; + + //check character before 'kernel' (white space expected) + size_t wsPos = source.find_last_of(" \t\r\n", pos); + if (wsPos == std::string::npos || wsPos + 1 == pos) + { + //check character after 'kernel' (white space expected) + size_t akPos = kPos + sizeof("kernel") - 1; + wsPos = source.find_first_of(" \t\r\n", akPos); + if (!(wsPos == akPos)) + { + kPos = source.find("kernel", kPos + 1); + continue; + } + + bool attributeFound; + do + { + attributeFound = false; + // find '(' after kernel name name + size_t pPos = source.find("(", akPos); + if (!(pPos != std::string::npos)) + continue; + + // check for not empty kernel name before '(' + pos = source.find_last_not_of(" \t\r\n", pPos - 1); + if (!(pos != std::string::npos && pos > akPos)) + continue; + + //find character before kernel name + wsPos = source.find_last_of(" \t\r\n", pos); + if (!(wsPos != std::string::npos && wsPos >= akPos)) + continue; + + std::string name = source.substr(wsPos + 1, pos + 1 - (wsPos + 1)); + //check for kernel attribute + if (name == "__attribute__") + { + attributeFound = true; + int pCount = 1; + akPos = pPos + 1; + while (pCount > 0 && akPos != std::string::npos) + { + akPos = source.find_first_of("()", akPos + 1); + if (akPos != std::string::npos) + { + if (source[akPos] == '(') + pCount++; + else + pCount--; + } + } + } + else + { + kernelsList += name + "."; + } + } while (attributeFound); + } + kPos = source.find("kernel", kPos + 1); + } + std::ostringstream oss; + if (MAX_LEN_FOR_KERNEL_LIST > 0) + { + if (kernelsList.size() > MAX_LEN_FOR_KERNEL_LIST + 1) + { + kernelsList = kernelsList.substr(0, MAX_LEN_FOR_KERNEL_LIST + 1); + kernelsList[kernelsList.size() - 1] = '.'; + kernelsList[kernelsList.size() - 1] = '.'; + } + oss << kernelsList; + } + return oss.str(); +} + +static std::string get_offline_compilation_file_type_str(const CompilationMode compilationMode) +{ + switch (compilationMode) + { + default: + assert(0 && "Invalid compilation mode"); + abort(); + case kOnline: + assert(0 && "Invalid compilation mode for offline compilation"); + abort(); + case kBinary: + return "binary"; + case kSpir_v: + return "SPIR-V"; + } +} + +static std::string get_unique_filename_prefix(unsigned int numKernelLines, + const char *const *kernelProgram, + const char *buildOptions) +{ + std::string kernel = get_kernel_content(numKernelLines, kernelProgram); + std::string kernelName = get_kernel_name(kernel); + cl_uint kernelCrc = crc32(kernel.data(), kernel.size()); + std::ostringstream oss; + oss << kernelName << std::hex << std::setfill('0') << std::setw(8) << kernelCrc; + if(buildOptions) { + cl_uint bOptionsCrc = crc32(buildOptions, strlen(buildOptions)); + oss << '.' << std::hex << std::setfill('0') << std::setw(8) << bOptionsCrc; + } + return oss.str(); +} + + +static std::string +get_cl_build_options_filename_with_path(const std::string& filePath, + const std::string& fileNamePrefix) { + return filePath + slash + fileNamePrefix + ".options"; +} + +static std::string +get_cl_source_filename_with_path(const std::string& filePath, + const std::string& fileNamePrefix) { + return filePath + slash + fileNamePrefix + ".cl"; +} + +static std::string +get_binary_filename_with_path(CompilationMode mode, + cl_uint deviceAddrSpaceSize, + const std::string& filePath, + const std::string& fileNamePrefix) { + std::string binaryFilename = filePath + slash + fileNamePrefix; + if(kSpir_v == mode) { + std::ostringstream extension; + extension << ".spv" << deviceAddrSpaceSize; + binaryFilename += extension.str(); + } + return binaryFilename; +} + +static bool file_exist_on_disk(const std::string& filePath, + const std::string& fileName) { + std::string fileNameWithPath = filePath + slash + fileName; + bool exist = false; + std::ifstream ifs; + + ifs.open(fileNameWithPath.c_str(), std::ios::binary); + if(ifs.good()) + exist = true; + ifs.close(); + return exist; +} + +static bool should_save_kernel_source_to_disk(CompilationMode mode, + CompilationCacheMode cacheMode, + const std::string& binaryPath, + const std::string& binaryName) +{ + bool saveToDisk = false; + if(cacheMode == kCacheModeDumpCl || + (cacheMode == kCacheModeOverwrite && mode != kOnline)) { + saveToDisk = true; + } + if(cacheMode == kCacheModeCompileIfAbsent && mode != kOnline) { + saveToDisk = !file_exist_on_disk(binaryPath, binaryName); + } + return saveToDisk; +} + +static int save_kernel_build_options_to_disk(const std::string& path, + const std::string& prefix, + const char *buildOptions) { + std::string filename = get_cl_build_options_filename_with_path(path, prefix); + std::ofstream ofs(filename.c_str(), std::ios::binary); + if (!ofs.good()) + { + log_info("Can't save kernel build options: %s\n", filename.c_str()); + return -1; + } + ofs.write(buildOptions, strlen(buildOptions)); + ofs.close(); + log_info("Saved kernel build options to file: %s\n", filename.c_str()); + return CL_SUCCESS; +} + +static int save_kernel_source_to_disk(const std::string& path, + const std::string& prefix, + const std::string& source) { + std::string filename = get_cl_source_filename_with_path(path, prefix); + std::ofstream ofs(filename.c_str(), std::ios::binary); + if (!ofs.good()) + { + log_info("Can't save kernel source: %s\n", filename.c_str()); + return -1; + } + ofs.write(source.c_str(), source.size()); + ofs.close(); + log_info("Saved kernel source to file: %s\n", filename.c_str()); + return CL_SUCCESS; +} + +static int save_kernel_source_and_options_to_disk(unsigned int numKernelLines, + const char *const *kernelProgram, + const char *buildOptions) +{ + int error; + + std::string kernel = get_kernel_content(numKernelLines, kernelProgram); + std::string kernelNamePrefix = get_unique_filename_prefix(numKernelLines, + kernelProgram, + buildOptions); + + // save kernel source to disk + error = save_kernel_source_to_disk(gCompilationCachePath, kernelNamePrefix, kernel); + + // save kernel build options to disk if exists + if (buildOptions != NULL) + error |= save_kernel_build_options_to_disk(gCompilationCachePath, kernelNamePrefix, buildOptions); + + return error; +} + +static std::string get_compilation_mode_str(const CompilationMode compilationMode) +{ + switch (compilationMode) + { + default: + assert(0 && "Invalid compilation mode"); + abort(); + case kOnline: + return "online"; + case kBinary: + return "binary"; + case kSpir_v: + return "spir-v"; + } +} + +#ifdef KHRONOS_OFFLINE_COMPILER +static std::string get_khronos_compiler_command(const cl_uint device_address_space_size, + const bool openclCXX, + const std::string &bOptions, + const std::string &sourceFilename, + const std::string &outputFilename) +{ + // Set compiler options + // Emit SPIR-V + std::string compilerOptions = " -cc1 -emit-spirv"; + // : for 32 bit SPIR-V use spir-unknown-unknown, for 64 bit SPIR-V use spir64-unknown-unknown. + if(device_address_space_size == 32) + { + compilerOptions += " -triple=spir-unknown-unknown"; + } + else + { + compilerOptions += " -triple=spir64-unknown-unknown"; + } + // Set OpenCL C++ flag required by SPIR-V-ready clang (compiler provided by Khronos) + if(openclCXX) + { + compilerOptions = compilerOptions + " -cl-std=c++"; + } + // Set correct includes + if(openclCXX) + { + compilerOptions += " -I "; + compilerOptions += STRINGIFY_VALUE(CL_LIBCLCXX_DIR); + } + else + { + compilerOptions += " -include opencl.h"; + } + +#ifdef KHRONOS_OFFLINE_COMPILER_OPTIONS + compilerOptions += STRINGIFY_VALUE(KHRONOS_OFFLINE_COMPILER_OPTIONS); +#endif + + // Add build options passed to this function + compilerOptions += " " + bOptions; + compilerOptions += + " " + sourceFilename + + " -o " + outputFilename; + std::string runString = STRINGIFY_VALUE(KHRONOS_OFFLINE_COMPILER) + compilerOptions; + + return runString; +} +#endif // KHRONOS_OFFLINE_COMPILER + +static cl_int get_cl_device_info_str(const cl_device_id device, const cl_uint device_address_space_size, + const CompilationMode compilationMode, std::string &clDeviceInfo) +{ + std::string extensionsString = get_device_extensions_string(device); + std::string versionString = get_device_version_string(device); + + std::ostringstream clDeviceInfoStream; + std::string file_type = get_offline_compilation_file_type_str(compilationMode); + clDeviceInfoStream << "# OpenCL device info affecting " << file_type << " offline compilation:" << std::endl + << "CL_DEVICE_ADDRESS_BITS=" << device_address_space_size << std::endl + << "CL_DEVICE_EXTENSIONS=\"" << extensionsString << "\"" << std::endl; + /* We only need the device's supported IL version(s) when compiling IL + * that will be loaded with clCreateProgramWithIL() */ + if (compilationMode == kSpir_v) + { + std::string ilVersionString = get_device_il_version_string(device); + clDeviceInfoStream << "CL_DEVICE_IL_VERSION=\"" << ilVersionString << "\"" << std::endl; + } + clDeviceInfoStream << "CL_DEVICE_VERSION=\"" << versionString << "\"" << std::endl; + clDeviceInfoStream << "CL_DEVICE_IMAGE_SUPPORT=" + << (0 == checkForImageSupport(device)) << std::endl; + clDeviceInfoStream << "CL_DEVICE_NAME=\"" << get_device_name(device).c_str() + << "\"" << std::endl; + + clDeviceInfo = clDeviceInfoStream.str(); + + return CL_SUCCESS; +} + +static int write_cl_device_info(const cl_device_id device, const cl_uint device_address_space_size, + const CompilationMode compilationMode, std::string &clDeviceInfoFilename) +{ + std::string clDeviceInfo; + int error = get_cl_device_info_str(device, device_address_space_size, compilationMode, clDeviceInfo); + if (error != CL_SUCCESS) + { + return error; + } + + cl_uint crc = crc32(clDeviceInfo.data(), clDeviceInfo.size()); + + /* Get the filename for the clDeviceInfo file. + * Note: the file includes the hash on its content, so it is usually unnecessary to delete it. */ + std::ostringstream clDeviceInfoFilenameStream; + clDeviceInfoFilenameStream << gCompilationCachePath << slash << "clDeviceInfo-"; + clDeviceInfoFilenameStream << std::hex << std::setfill('0') << std::setw(8) << crc << ".txt"; + + clDeviceInfoFilename = clDeviceInfoFilenameStream.str(); + + if ((size_t) get_file_size(clDeviceInfoFilename) == clDeviceInfo.size()) + { + /* The CL device info file has already been created. + * Nothing to do. */ + return 0; + } + + /* The file does not exist or its length is not as expected. Create/overwrite it. */ + std::ofstream ofs(clDeviceInfoFilename); + if (!ofs.good()) + { + log_info("OfflineCompiler: can't create CL device info file: %s\n", clDeviceInfoFilename.c_str()); + return -1; + } + ofs << clDeviceInfo; + ofs.close(); + + return CL_SUCCESS; +} + +static std::string get_offline_compilation_command(const cl_uint device_address_space_size, + const CompilationMode compilationMode, + const std::string &bOptions, + const std::string &sourceFilename, + const std::string &outputFilename, + const std::string &clDeviceInfoFilename) +{ + std::ostringstream wrapperOptions; + + wrapperOptions << gCompilationProgram + << " --mode=" << get_compilation_mode_str(compilationMode) + << " --source=" << sourceFilename + << " --output=" << outputFilename + << " --cl-device-info=" << clDeviceInfoFilename; + + if (bOptions != "") + { + // Add build options passed to this function + wrapperOptions << " -- " << bOptions; + } + + return wrapperOptions.str(); +} + +static int invoke_offline_compiler(const cl_device_id device, + const cl_uint device_address_space_size, + const CompilationMode compilationMode, + const std::string &bOptions, + const std::string &sourceFilename, + const std::string &outputFilename, + const bool openclCXX) +{ + std::string runString; + if (openclCXX) + { +#ifndef KHRONOS_OFFLINE_COMPILER + log_error("CL C++ compilation is not possible: KHRONOS_OFFLINE_COMPILER was not defined.\n"); + return CL_INVALID_OPERATION; +#else + if (compilationMode != kSpir_v) + { + log_error("Compilation mode must be SPIR-V for Khronos compiler"); + return -1; + } + runString = get_khronos_compiler_command(device_address_space_size, openclCXX, bOptions, + sourceFilename, outputFilename); +#endif + } + else + { + std::string clDeviceInfoFilename; + + // See cl_offline_compiler-interface.txt for a description of the + // format of the CL device information file generated below, and + // the internal command line interface for invoking the offline + // compiler. + + cl_int err = write_cl_device_info(device, device_address_space_size, compilationMode, + clDeviceInfoFilename); + if (err != CL_SUCCESS) + { + log_error("Failed writing CL device info file\n"); + return err; + } + + runString = get_offline_compilation_command(device_address_space_size, compilationMode, bOptions, + sourceFilename, outputFilename, clDeviceInfoFilename); + } + + // execute script + log_info("Executing command: %s\n", runString.c_str()); + fflush(stdout); + int returnCode = system(runString.c_str()); + if (returnCode != 0) + { + log_error("ERROR: Command finished with error: 0x%x\n", returnCode); + return CL_COMPILE_PROGRAM_FAILURE; + } + + return CL_SUCCESS; +} + +static cl_int get_first_device_id(const cl_context context, cl_device_id &device) +{ + cl_uint numDevices = 0; + cl_int error = clGetContextInfo(context, CL_CONTEXT_NUM_DEVICES, sizeof(cl_uint), &numDevices, NULL); + test_error(error, "clGetContextInfo failed getting CL_CONTEXT_NUM_DEVICES"); + + if (numDevices == 0) + { + log_error("ERROR: No CL devices found\n"); + return -1; + } + + std::vector devices(numDevices, 0); + error = clGetContextInfo(context, CL_CONTEXT_DEVICES, numDevices*sizeof(cl_device_id), &devices[0], NULL); + test_error(error, "clGetContextInfo failed getting CL_CONTEXT_DEVICES"); + + device = devices[0]; + return CL_SUCCESS; +} + +static cl_int get_device_address_bits(const cl_device_id device, cl_uint &device_address_space_size) +{ + cl_int error = clGetDeviceInfo(device, CL_DEVICE_ADDRESS_BITS, sizeof(cl_uint), &device_address_space_size, NULL); + test_error(error, "Unable to obtain device address bits"); + + if (device_address_space_size != 32 && device_address_space_size != 64) + { + log_error("ERROR: Unexpected number of device address bits: %u\n", device_address_space_size); + return -1; + } + + return CL_SUCCESS; +} + +static int get_offline_compiler_output(std::ifstream &ifs, + const cl_device_id device, + cl_uint deviceAddrSpaceSize, + const bool openclCXX, + const CompilationMode compilationMode, + const std::string &bOptions, + const std::string &kernelPath, + const std::string &kernelNamePrefix) +{ + std::string sourceFilename = get_cl_source_filename_with_path(kernelPath, kernelNamePrefix); + std::string outputFilename = get_binary_filename_with_path(compilationMode, + deviceAddrSpaceSize, + kernelPath, + kernelNamePrefix); + + ifs.open(outputFilename.c_str(), std::ios::binary); + if(!ifs.good()) { + std::string file_type = get_offline_compilation_file_type_str(compilationMode); + if (gCompilationCacheMode == kCacheModeForceRead) { + log_info("OfflineCompiler: can't open cached %s file: %s\n", + file_type.c_str(), outputFilename.c_str()); + return -1; + } + else { + int error = invoke_offline_compiler(device, deviceAddrSpaceSize, compilationMode, + bOptions, sourceFilename, outputFilename, openclCXX); + if (error != CL_SUCCESS) + return error; + + // read output file + ifs.open(outputFilename.c_str(), std::ios::binary); + if (!ifs.good()) + { + log_info("OfflineCompiler: can't read generated %s file: %s\n", + file_type.c_str(), outputFilename.c_str()); + return -1; + } + } + } + return CL_SUCCESS; +} + +static int create_single_kernel_helper_create_program_offline(cl_context context, + cl_device_id device, + cl_program *outProgram, + unsigned int numKernelLines, + const char *const *kernelProgram, + const char *buildOptions, + const bool openclCXX, + CompilationMode compilationMode) +{ + if(kCacheModeDumpCl == gCompilationCacheMode) { + return -1; + } + + // Get device CL_DEVICE_ADDRESS_BITS + int error; + cl_uint device_address_space_size = 0; + if (device == NULL) + { + error = get_first_device_id(context, device); + test_error(error, "Failed to get device ID for first device"); + } + error = get_device_address_bits(device, device_address_space_size); + if (error != CL_SUCCESS) + return error; + + // set build options + std::string bOptions; + bOptions += buildOptions ? std::string(buildOptions) : ""; + + std::string kernelName = get_unique_filename_prefix(numKernelLines, + kernelProgram, + buildOptions); + + + + std::ifstream ifs; + error = get_offline_compiler_output(ifs, device, device_address_space_size, openclCXX, compilationMode, bOptions, gCompilationCachePath, kernelName); + if (error != CL_SUCCESS) + return error; + + // ----------------------------------------------------------------------------------- + // ------------- ONLY FOR OPENCL 22 CONFORMANCE TEST 22 DEVELOPMENT ------------------ + // ----------------------------------------------------------------------------------- + // Only OpenCL C++ to SPIR-V compilation + #if defined(DEVELOPMENT) && defined(ONLY_SPIRV_COMPILATION) + if(openclCXX) + { + return CL_SUCCESS; + } + #endif + + ifs.seekg(0, ifs.end); + int length = ifs.tellg(); + ifs.seekg(0, ifs.beg); + + //treat modifiedProgram as input for clCreateProgramWithBinary + if (compilationMode == kBinary) + { + // read binary from file: + std::vector modifiedKernelBuf(length); + + ifs.read((char *)&modifiedKernelBuf[0], length); + ifs.close(); + + size_t lengths = modifiedKernelBuf.size(); + const unsigned char *binaries = { &modifiedKernelBuf[0] }; + log_info("offlineCompiler: clCreateProgramWithSource replaced with clCreateProgramWithBinary\n"); + *outProgram = clCreateProgramWithBinary(context, 1, &device, &lengths, &binaries, NULL, &error); + if (*outProgram == NULL || error != CL_SUCCESS) + { + print_error(error, "clCreateProgramWithBinary failed"); + return error; + } + } + //treat modifiedProgram as input for clCreateProgramWithIL + else if (compilationMode == kSpir_v) + { + // read spir-v from file: + std::vector modifiedKernelBuf(length); + + ifs.read((char *)&modifiedKernelBuf[0], length); + ifs.close(); + + size_t length = modifiedKernelBuf.size(); + log_info("offlineCompiler: clCreateProgramWithSource replaced with clCreateProgramWithIL\n"); + if (gCoreILProgram) + { + *outProgram = clCreateProgramWithIL(context, &modifiedKernelBuf[0], + length, &error); + } + else + { + cl_platform_id platform; + error = clGetDeviceInfo(device, CL_DEVICE_PLATFORM, + sizeof(cl_platform_id), &platform, NULL); + test_error(error, "clGetDeviceInfo for CL_DEVICE_PLATFORM failed"); + + clCreateProgramWithILKHR_fn clCreateProgramWithILKHR = NULL; + clCreateProgramWithILKHR = (clCreateProgramWithILKHR_fn) + clGetExtensionFunctionAddressForPlatform( + platform, "clCreateProgramWithILKHR"); + if (clCreateProgramWithILKHR == NULL) + { + log_error( + "ERROR: clGetExtensionFunctionAddressForPlatform failed\n"); + return -1; + } + *outProgram = clCreateProgramWithILKHR( + context, &modifiedKernelBuf[0], length, &error); + } + + if (*outProgram == NULL || error != CL_SUCCESS) + { + if (gCoreILProgram) + { + print_error(error, "clCreateProgramWithIL failed"); + } + else + { + print_error(error, "clCreateProgramWithILKHR failed"); + } + return error; + } + } + + return CL_SUCCESS; +} + +static int create_single_kernel_helper_create_program(cl_context context, + cl_device_id device, + cl_program *outProgram, + unsigned int numKernelLines, + const char **kernelProgram, + const char *buildOptions, + const bool openclCXX, + CompilationMode compilationMode) +{ + std::lock_guard compiler_lock(gCompilerMutex); + + std::string filePrefix = get_unique_filename_prefix(numKernelLines, + kernelProgram, + buildOptions); + bool shouldSaveToDisk = should_save_kernel_source_to_disk(compilationMode, + gCompilationCacheMode, + gCompilationCachePath, + filePrefix); + + if(shouldSaveToDisk) + { + if(CL_SUCCESS != save_kernel_source_and_options_to_disk(numKernelLines, kernelProgram, buildOptions)) + { + log_error("Unable to dump kernel source to disk"); + return -1; + } + } + if (compilationMode == kOnline) + { + int error = CL_SUCCESS; + + /* Create the program object from source */ + *outProgram = clCreateProgramWithSource(context, numKernelLines, kernelProgram, NULL, &error); + if (*outProgram == NULL || error != CL_SUCCESS) + { + print_error(error, "clCreateProgramWithSource failed"); + return error; + } + return CL_SUCCESS; + } + else + { + return create_single_kernel_helper_create_program_offline(context, device, outProgram, + numKernelLines, kernelProgram, + buildOptions, openclCXX, + compilationMode); + } +} + +int create_single_kernel_helper_create_program(cl_context context, + cl_program *outProgram, + unsigned int numKernelLines, + const char **kernelProgram, + const char *buildOptions, + const bool openclCXX) +{ + return create_single_kernel_helper_create_program(context, NULL, outProgram, + numKernelLines, kernelProgram, + buildOptions, openclCXX, + gCompilationMode); +} + +int create_single_kernel_helper_create_program_for_device(cl_context context, + cl_device_id device, + cl_program *outProgram, + unsigned int numKernelLines, + const char **kernelProgram, + const char *buildOptions, + const bool openclCXX) +{ + return create_single_kernel_helper_create_program(context, device, outProgram, + numKernelLines, kernelProgram, + buildOptions, openclCXX, + gCompilationMode); +} + +int create_single_kernel_helper_with_build_options(cl_context context, + cl_program *outProgram, + cl_kernel *outKernel, + unsigned int numKernelLines, + const char **kernelProgram, + const char *kernelName, + const char *buildOptions, + const bool openclCXX) +{ + return create_single_kernel_helper(context, outProgram, outKernel, numKernelLines, kernelProgram, kernelName, buildOptions, openclCXX); +} + +// Creates and builds OpenCL C/C++ program, and creates a kernel +int create_single_kernel_helper(cl_context context, + cl_program *outProgram, + cl_kernel *outKernel, + unsigned int numKernelLines, + const char **kernelProgram, + const char *kernelName, + const char *buildOptions, + const bool openclCXX) +{ + // For the logic that automatically adds -cl-std it is much cleaner if the + // build options have RAII. This buffer will store the potentially updated + // build options, in which case buildOptions will point at the string owned + // by this buffer. + std::string build_options_internal{ buildOptions ? buildOptions : "" }; + + // Check the build options for the -cl-std option. + if (!buildOptions || !strstr(buildOptions, "-cl-std")) + { + // If the build option isn't present add it using the latest OpenCL-C + // version supported by the device. This allows calling code to force a + // particular CL C version if it is required, but also means that + // callers need not specify a version if they want to assume the most + // recent CL C. + + auto version = get_max_OpenCL_C_for_context(context); + + std::string cl_std{}; + if (version >= Version(3, 0)) + { + cl_std = "-cl-std=CL3.0"; + } + else if (version >= Version(2, 0) && version < Version(3, 0)) + { + cl_std = "-cl-std=CL2.0"; + } + else + { + // If the -cl-std build option is not specified, the highest OpenCL + // C 1.x language version supported by each device is used when + // compiling the program for each device. + cl_std = ""; + } + build_options_internal += ' '; + build_options_internal += cl_std; + buildOptions = build_options_internal.c_str(); + } + int error; + // Create OpenCL C++ program + if(openclCXX) + { + // ----------------------------------------------------------------------------------- + // ------------- ONLY FOR OPENCL 22 CONFORMANCE TEST 22 DEVELOPMENT ------------------ + // ----------------------------------------------------------------------------------- + // Only OpenCL C++ to SPIR-V compilation + #if defined(DEVELOPMENT) && defined(ONLY_SPIRV_COMPILATION) + // Save global variable + bool tempgCompilationCacheMode = gCompilationCacheMode; + // Force OpenCL C++ -> SPIR-V compilation on every run + gCompilationCacheMode = kCacheModeOverwrite; + #endif + error = create_openclcpp_program( + context, outProgram, numKernelLines, kernelProgram, buildOptions + ); + if (error != CL_SUCCESS) + { + log_error("Create program failed: %d, line: %d\n", error, __LINE__); + return error; + } + // ----------------------------------------------------------------------------------- + // ------------- ONLY FOR OPENCL 22 CONFORMANCE TEST 22 DEVELOPMENT ------------------ + // ----------------------------------------------------------------------------------- + #if defined(DEVELOPMENT) && defined(ONLY_SPIRV_COMPILATION) + // Restore global variables + gCompilationCacheMode = tempgCompilationCacheMode; + log_info("WARNING: KERNEL %s WAS ONLY COMPILED TO SPIR-V\n", kernelName); + return error; + #endif + } + // Create OpenCL C program + else + { + error = create_single_kernel_helper_create_program( + context, outProgram, numKernelLines, kernelProgram, buildOptions + ); + if (error != CL_SUCCESS) + { + log_error("Create program failed: %d, line: %d\n", error, __LINE__); + return error; + } + } + // Remove offline-compiler-only build options + std::string newBuildOptions; + if (buildOptions != NULL) + { + newBuildOptions = buildOptions; + std::string offlineCompierOptions[] = { + "-cl-fp16-enable", + "-cl-fp64-enable", + "-cl-zero-init-local-mem-vars" + }; + for(auto& s : offlineCompierOptions) + { + std::string::size_type i = newBuildOptions.find(s); + if (i != std::string::npos) + newBuildOptions.erase(i, s.length()); + } + } + // Build program and create kernel + return build_program_create_kernel_helper( + context, outProgram, outKernel, numKernelLines, kernelProgram, kernelName, newBuildOptions.c_str() + ); +} + +// Creates OpenCL C++ program +int create_openclcpp_program(cl_context context, + cl_program *outProgram, + unsigned int numKernelLines, + const char **kernelProgram, + const char *buildOptions) +{ + // Create program + return create_single_kernel_helper_create_program( + context, NULL, outProgram, numKernelLines, kernelProgram, buildOptions, true, kSpir_v + ); +} + +// Builds OpenCL C/C++ program and creates +int build_program_create_kernel_helper(cl_context context, + cl_program *outProgram, + cl_kernel *outKernel, + unsigned int numKernelLines, + const char **kernelProgram, + const char *kernelName, + const char *buildOptions) +{ + int error; + /* Compile the program */ + int buildProgramFailed = 0; + int printedSource = 0; + error = clBuildProgram(*outProgram, 0, NULL, buildOptions, NULL, NULL); + if (error != CL_SUCCESS) + { + unsigned int i; + print_error(error, "clBuildProgram failed"); + buildProgramFailed = 1; + printedSource = 1; + log_error("Build options: %s\n", buildOptions); + log_error("Original source is: ------------\n"); + for (i = 0; i < numKernelLines; i++) + log_error("%s", kernelProgram[i]); + } + + // Verify the build status on all devices + cl_uint deviceCount = 0; + error = clGetProgramInfo(*outProgram, CL_PROGRAM_NUM_DEVICES, sizeof(deviceCount), &deviceCount, NULL); + if (error != CL_SUCCESS) + { + print_error(error, "clGetProgramInfo CL_PROGRAM_NUM_DEVICES failed"); + return error; + } + + if (deviceCount == 0) + { + log_error("No devices found for program.\n"); + return -1; + } + + cl_device_id *devices = (cl_device_id *)malloc(deviceCount * sizeof(cl_device_id)); + if (NULL == devices) + return -1; + BufferOwningPtr devicesBuf(devices); + + memset(devices, 0, deviceCount * sizeof(cl_device_id)); + error = clGetProgramInfo(*outProgram, CL_PROGRAM_DEVICES, sizeof(cl_device_id) * deviceCount, devices, NULL); + if (error != CL_SUCCESS) + { + print_error(error, "clGetProgramInfo CL_PROGRAM_DEVICES failed"); + return error; + } + + cl_uint z; + bool buildFailed = false; + for (z = 0; z < deviceCount; z++) + { + char deviceName[4096] = ""; + error = clGetDeviceInfo(devices[z], CL_DEVICE_NAME, sizeof(deviceName), deviceName, NULL); + if (error != CL_SUCCESS || deviceName[0] == '\0') + { + log_error("Device \"%d\" failed to return a name\n", z); + print_error(error, "clGetDeviceInfo CL_DEVICE_NAME failed"); + } + + cl_build_status buildStatus; + error = clGetProgramBuildInfo(*outProgram, devices[z], CL_PROGRAM_BUILD_STATUS, sizeof(buildStatus), &buildStatus, NULL); + if (error != CL_SUCCESS) + { + print_error(error, "clGetProgramBuildInfo CL_PROGRAM_BUILD_STATUS failed"); + return error; + } + + if (buildStatus == CL_BUILD_SUCCESS && buildProgramFailed && deviceCount == 1) + { + buildFailed = true; + log_error("clBuildProgram returned an error, but buildStatus is marked as CL_BUILD_SUCCESS.\n"); + } + + if (buildStatus != CL_BUILD_SUCCESS) + { + + char statusString[64] = ""; + if (buildStatus == (cl_build_status)CL_BUILD_SUCCESS) + sprintf(statusString, "CL_BUILD_SUCCESS"); + else if (buildStatus == (cl_build_status)CL_BUILD_NONE) + sprintf(statusString, "CL_BUILD_NONE"); + else if (buildStatus == (cl_build_status)CL_BUILD_ERROR) + sprintf(statusString, "CL_BUILD_ERROR"); + else if (buildStatus == (cl_build_status)CL_BUILD_IN_PROGRESS) + sprintf(statusString, "CL_BUILD_IN_PROGRESS"); + else + sprintf(statusString, "UNKNOWN (%d)", buildStatus); + + if (buildStatus != CL_BUILD_SUCCESS) + log_error("Build not successful for device \"%s\", status: %s\n", deviceName, statusString); + size_t paramSize = 0; + error = clGetProgramBuildInfo(*outProgram, devices[z], CL_PROGRAM_BUILD_LOG, 0, NULL, ¶mSize); + if (error != CL_SUCCESS) + { + + print_error(error, "clGetProgramBuildInfo CL_PROGRAM_BUILD_LOG failed"); + return error; + } + + std::string log; + log.resize(paramSize / sizeof(char)); + error = clGetProgramBuildInfo(*outProgram, devices[z], CL_PROGRAM_BUILD_LOG, paramSize, &log[0], NULL); + if (error != CL_SUCCESS || log[0] == '\0') + { + log_error("Device %d (%s) failed to return a build log\n", z, deviceName); + if (error) + { + print_error(error, "clGetProgramBuildInfo CL_PROGRAM_BUILD_LOG failed"); + return error; + } + else + { + log_error("clGetProgramBuildInfo returned an empty log.\n"); + return -1; + } + } + // In this case we've already printed out the code above. + if (!printedSource) + { + unsigned int i; + log_error("Original source is: ------------\n"); + for (i = 0; i < numKernelLines; i++) + log_error("%s", kernelProgram[i]); + printedSource = 1; + } + log_error("Build log for device \"%s\" is: ------------\n", deviceName); + log_error("%s\n", log.c_str()); + log_error("\n----------\n"); + return -1; + } + } + + if (buildFailed) + { + return -1; + } + + /* And create a kernel from it */ + if (kernelName != NULL) + { + *outKernel = clCreateKernel(*outProgram, kernelName, &error); + if (*outKernel == NULL || error != CL_SUCCESS) + { + print_error(error, "Unable to create kernel"); + return error; + } + } + + return 0; +} + +int get_max_allowed_work_group_size( cl_context context, cl_kernel kernel, size_t *outMaxSize, size_t *outLimits ) +{ + cl_device_id *devices; + size_t size, maxCommonSize = 0; + int numDevices, i, j, error; + cl_uint numDims; + size_t outSize; + size_t sizeLimit[]={1,1,1}; + + + /* Assume fewer than 16 devices will be returned */ + error = clGetContextInfo( context, CL_CONTEXT_DEVICES, 0, NULL, &outSize ); + test_error( error, "Unable to obtain list of devices size for context" ); + devices = (cl_device_id *)malloc(outSize); + BufferOwningPtr devicesBuf(devices); + + error = clGetContextInfo( context, CL_CONTEXT_DEVICES, outSize, devices, NULL ); + test_error( error, "Unable to obtain list of devices for context" ); + + numDevices = (int)( outSize / sizeof( cl_device_id ) ); + + for( i = 0; i < numDevices; i++ ) + { + error = clGetDeviceInfo( devices[i], CL_DEVICE_MAX_WORK_GROUP_SIZE, sizeof( size ), &size, NULL ); + test_error( error, "Unable to obtain max work group size for device" ); + if( size < maxCommonSize || maxCommonSize == 0) + maxCommonSize = size; + + error = clGetKernelWorkGroupInfo( kernel, devices[i], CL_KERNEL_WORK_GROUP_SIZE, sizeof( size ), &size, NULL ); + test_error( error, "Unable to obtain max work group size for device and kernel combo" ); + if( size < maxCommonSize || maxCommonSize == 0) + maxCommonSize = size; + + error= clGetDeviceInfo( devices[i], CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, sizeof( numDims ), &numDims, NULL); + test_error( error, "clGetDeviceInfo failed for CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS"); + sizeLimit[0] = 1; + error= clGetDeviceInfo( devices[i], CL_DEVICE_MAX_WORK_ITEM_SIZES, numDims*sizeof(size_t), sizeLimit, NULL); + test_error( error, "clGetDeviceInfo failed for CL_DEVICE_MAX_WORK_ITEM_SIZES"); + + if (outLimits != NULL) + { + if (i == 0) { + for (j=0; j<3; j++) + outLimits[j] = sizeLimit[j]; + } else { + for (j=0; j<(int)numDims; j++) { + if (sizeLimit[j] < outLimits[j]) + outLimits[j] = sizeLimit[j]; + } + } + } + } + + *outMaxSize = (unsigned int)maxCommonSize; + return 0; +} + + +extern int get_max_allowed_1d_work_group_size_on_device( cl_device_id device, cl_kernel kernel, size_t *outSize ) +{ + cl_uint maxDim; + size_t maxWgSize; + size_t *maxWgSizePerDim; + int error; + + error = clGetKernelWorkGroupInfo( kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof( size_t ), &maxWgSize, NULL ); + test_error( error, "clGetKernelWorkGroupInfo CL_KERNEL_WORK_GROUP_SIZE failed" ); + + error = clGetDeviceInfo( device, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, sizeof( cl_uint ), &maxDim, NULL ); + test_error( error, "clGetDeviceInfo CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS failed" ); + maxWgSizePerDim = (size_t*)malloc( maxDim * sizeof( size_t ) ); + if( !maxWgSizePerDim ) + { + log_error( "Unable to allocate maxWgSizePerDim\n" ); + return -1; + } + + error = clGetDeviceInfo( device, CL_DEVICE_MAX_WORK_ITEM_SIZES, maxDim * sizeof( size_t ), maxWgSizePerDim, NULL ); + if( error != CL_SUCCESS) + { + log_error( "clGetDeviceInfo CL_DEVICE_MAX_WORK_ITEM_SIZES failed\n" ); + free( maxWgSizePerDim ); + return error; + } + + // "maxWgSize" is limited to that of the first dimension. + if( maxWgSize > maxWgSizePerDim[0] ) + { + maxWgSize = maxWgSizePerDim[0]; + } + + free( maxWgSizePerDim ); + + *outSize = maxWgSize; + return 0; +} + + +int get_max_common_work_group_size( cl_context context, cl_kernel kernel, + size_t globalThreadSize, size_t *outMaxSize ) +{ + size_t sizeLimit[3]; + int error = get_max_allowed_work_group_size( context, kernel, outMaxSize, sizeLimit ); + if( error != 0 ) + return error; + + /* Now find the largest factor of globalThreadSize that is <= maxCommonSize */ + /* Note for speed, we don't need to check the range of maxCommonSize, b/c once it gets to 1, + the modulo test will succeed and break the loop anyway */ + for( ; ( globalThreadSize % *outMaxSize ) != 0 || (*outMaxSize > sizeLimit[0]); (*outMaxSize)-- ) + ; + return 0; +} + +int get_max_common_2D_work_group_size( cl_context context, cl_kernel kernel, + size_t *globalThreadSizes, size_t *outMaxSizes ) +{ + size_t sizeLimit[3]; + size_t maxSize; + int error = get_max_allowed_work_group_size( context, kernel, &maxSize, sizeLimit ); + if( error != 0 ) + return error; + + /* Now find a set of factors, multiplied together less than maxSize, but each a factor of the global + sizes */ + + /* Simple case */ + if( globalThreadSizes[ 0 ] * globalThreadSizes[ 1 ] <= maxSize ) + { + if (globalThreadSizes[ 0 ] <= sizeLimit[0] && globalThreadSizes[ 1 ] <= sizeLimit[1]) { + outMaxSizes[ 0 ] = globalThreadSizes[ 0 ]; + outMaxSizes[ 1 ] = globalThreadSizes[ 1 ]; + return 0; + } + } + + size_t remainingSize, sizeForThisOne; + remainingSize = maxSize; + int i, j; + for (i=0 ; i<2; i++) { + if (globalThreadSizes[i] > remainingSize) + sizeForThisOne = remainingSize; + else + sizeForThisOne = globalThreadSizes[i]; + for (; (globalThreadSizes[i] % sizeForThisOne) != 0 || (sizeForThisOne > sizeLimit[i]); sizeForThisOne--) ; + outMaxSizes[i] = sizeForThisOne; + remainingSize = maxSize; + for (j=0; j<=i; j++) + remainingSize /=outMaxSizes[j]; + } + + return 0; +} + +int get_max_common_3D_work_group_size( cl_context context, cl_kernel kernel, + size_t *globalThreadSizes, size_t *outMaxSizes ) +{ + size_t sizeLimit[3]; + size_t maxSize; + int error = get_max_allowed_work_group_size( context, kernel, &maxSize, sizeLimit ); + if( error != 0 ) + return error; + /* Now find a set of factors, multiplied together less than maxSize, but each a factor of the global + sizes */ + + /* Simple case */ + if( globalThreadSizes[ 0 ] * globalThreadSizes[ 1 ] * globalThreadSizes[ 2 ] <= maxSize ) + { + if (globalThreadSizes[ 0 ] <= sizeLimit[0] && globalThreadSizes[ 1 ] <= sizeLimit[1] && globalThreadSizes[ 2 ] <= sizeLimit[2]) { + outMaxSizes[ 0 ] = globalThreadSizes[ 0 ]; + outMaxSizes[ 1 ] = globalThreadSizes[ 1 ]; + outMaxSizes[ 2 ] = globalThreadSizes[ 2 ]; + return 0; + } + } + + size_t remainingSize, sizeForThisOne; + remainingSize = maxSize; + int i, j; + for (i=0 ; i<3; i++) { + if (globalThreadSizes[i] > remainingSize) + sizeForThisOne = remainingSize; + else + sizeForThisOne = globalThreadSizes[i]; + for (; (globalThreadSizes[i] % sizeForThisOne) != 0 || (sizeForThisOne > sizeLimit[i]); sizeForThisOne--) ; + outMaxSizes[i] = sizeForThisOne; + remainingSize = maxSize; + for (j=0; j<=i; j++) + remainingSize /=outMaxSizes[j]; + } + + return 0; +} + +/* Helper to determine if a device supports an image format */ +int is_image_format_supported( cl_context context, cl_mem_flags flags, cl_mem_object_type image_type, const cl_image_format *fmt ) +{ + cl_image_format *list; + cl_uint count = 0; + cl_int err = clGetSupportedImageFormats( context, flags, image_type, 128, NULL, &count ); + if( count == 0 ) + return 0; + + list = (cl_image_format*) malloc( count * sizeof( cl_image_format ) ); + if( NULL == list ) + { + log_error( "Error: unable to allocate %ld byte buffer for image format list at %s:%d (err = %d)\n", count * sizeof( cl_image_format ), __FILE__, __LINE__, err ); + return 0; + } + BufferOwningPtr listBuf(list); + + + cl_int error = clGetSupportedImageFormats( context, flags, image_type, count, list, NULL ); + if( error ) + { + log_error( "Error: failed to obtain supported image type list at %s:%d (err = %d)\n", __FILE__, __LINE__, err ); + return 0; + } + + // iterate looking for a match. + cl_uint i; + for( i = 0; i < count; i++ ) + { + if( fmt->image_channel_data_type == list[ i ].image_channel_data_type && + fmt->image_channel_order == list[ i ].image_channel_order ) + break; + } + + return ( i < count ) ? 1 : 0; +} + +size_t get_pixel_bytes( const cl_image_format *fmt ); +size_t get_pixel_bytes( const cl_image_format *fmt ) +{ + size_t chanCount; + switch( fmt->image_channel_order ) + { + case CL_R: + case CL_A: + case CL_Rx: + case CL_INTENSITY: + case CL_LUMINANCE: + case CL_DEPTH: + chanCount = 1; + break; + case CL_RG: + case CL_RA: + case CL_RGx: + chanCount = 2; + break; + case CL_RGB: + case CL_RGBx: + case CL_sRGB: + case CL_sRGBx: + chanCount = 3; + break; + case CL_RGBA: + case CL_ARGB: + case CL_BGRA: + case CL_sBGRA: + case CL_sRGBA: +#ifdef CL_1RGB_APPLE + case CL_1RGB_APPLE: +#endif +#ifdef CL_BGR1_APPLE + case CL_BGR1_APPLE: +#endif + chanCount = 4; + break; + default: + log_error("Unknown channel order at %s:%d!\n", __FILE__, __LINE__ ); + abort(); + break; + } + + switch( fmt->image_channel_data_type ) + { + case CL_UNORM_SHORT_565: + case CL_UNORM_SHORT_555: + return 2; + + case CL_UNORM_INT_101010: + return 4; + + case CL_SNORM_INT8: + case CL_UNORM_INT8: + case CL_SIGNED_INT8: + case CL_UNSIGNED_INT8: + return chanCount; + + case CL_SNORM_INT16: + case CL_UNORM_INT16: + case CL_HALF_FLOAT: + case CL_SIGNED_INT16: + case CL_UNSIGNED_INT16: +#ifdef CL_SFIXED14_APPLE + case CL_SFIXED14_APPLE: +#endif + return chanCount * 2; + + case CL_SIGNED_INT32: + case CL_UNSIGNED_INT32: + case CL_FLOAT: + return chanCount * 4; + + default: + log_error("Unknown channel data type at %s:%d!\n", __FILE__, __LINE__ ); + abort(); + } + + return 0; +} + +test_status verifyImageSupport( cl_device_id device ) +{ + int result = checkForImageSupport( device ); + if( result == 0 ) + { + return TEST_PASS; + } + if( result == CL_IMAGE_FORMAT_NOT_SUPPORTED ) + { + log_error( "SKIPPED: Device does not supported images as required by this test!\n" ); + return TEST_SKIP; + } + return TEST_FAIL; +} + +int checkForImageSupport( cl_device_id device ) +{ + cl_uint i; + int error; + + + /* Check the device props to see if images are supported at all first */ + error = clGetDeviceInfo( device, CL_DEVICE_IMAGE_SUPPORT, sizeof( i ), &i, NULL ); + test_error( error, "Unable to query device for image support" ); + if( i == 0 ) + { + return CL_IMAGE_FORMAT_NOT_SUPPORTED; + } + + /* So our support is good */ + return 0; +} + +int checkFor3DImageSupport( cl_device_id device ) +{ + cl_uint i; + int error; + + /* Check the device props to see if images are supported at all first */ + error = clGetDeviceInfo( device, CL_DEVICE_IMAGE_SUPPORT, sizeof( i ), &i, NULL ); + test_error( error, "Unable to query device for image support" ); + if( i == 0 ) + { + return CL_IMAGE_FORMAT_NOT_SUPPORTED; + } + + char profile[128]; + error = clGetDeviceInfo( device, CL_DEVICE_PROFILE, sizeof(profile ), profile, NULL ); + test_error( error, "Unable to query device for CL_DEVICE_PROFILE" ); + if( 0 == strcmp( profile, "EMBEDDED_PROFILE" ) ) + { + size_t width = -1L; + size_t height = -1L; + size_t depth = -1L; + error = clGetDeviceInfo( device, CL_DEVICE_IMAGE3D_MAX_WIDTH, sizeof(width), &width, NULL ); + test_error( error, "Unable to get CL_DEVICE_IMAGE3D_MAX_WIDTH" ); + error = clGetDeviceInfo( device, CL_DEVICE_IMAGE3D_MAX_HEIGHT, sizeof(height), &height, NULL ); + test_error( error, "Unable to get CL_DEVICE_IMAGE3D_MAX_HEIGHT" ); + error = clGetDeviceInfo( device, CL_DEVICE_IMAGE3D_MAX_DEPTH, sizeof(depth), &depth, NULL ); + test_error( error, "Unable to get CL_DEVICE_IMAGE3D_MAX_DEPTH" ); + + if( 0 == (height | width | depth )) + return CL_IMAGE_FORMAT_NOT_SUPPORTED; + } + + /* So our support is good */ + return 0; +} + +size_t get_min_alignment(cl_context context) +{ + static cl_uint align_size = 0; + + if( 0 == align_size ) + { + cl_device_id * devices; + size_t devices_size = 0; + cl_uint result = 0; + cl_int error; + int i; + + error = clGetContextInfo (context, + CL_CONTEXT_DEVICES, + 0, + NULL, + &devices_size); + test_error_ret(error, "clGetContextInfo failed", 0); + + devices = (cl_device_id*)malloc(devices_size); + if (devices == NULL) { + print_error( error, "malloc failed" ); + return 0; + } + + error = clGetContextInfo (context, + CL_CONTEXT_DEVICES, + devices_size, + (void*)devices, + NULL); + test_error_ret(error, "clGetContextInfo failed", 0); + + for (i = 0; i < (int)(devices_size/sizeof(cl_device_id)); i++) + { + cl_uint alignment = 0; + + error = clGetDeviceInfo (devices[i], + CL_DEVICE_MEM_BASE_ADDR_ALIGN, + sizeof(cl_uint), + (void*)&alignment, + NULL); + + if (error == CL_SUCCESS) + { + alignment >>= 3; // convert bits to bytes + result = (alignment > result) ? alignment : result; + } + else + print_error( error, "clGetDeviceInfo failed" ); + } + + align_size = result; + free(devices); + } + + return align_size; +} + +cl_device_fp_config get_default_rounding_mode( cl_device_id device ) +{ + char profileStr[128] = ""; + cl_device_fp_config single = 0; + int error = clGetDeviceInfo( device, CL_DEVICE_SINGLE_FP_CONFIG, sizeof( single ), &single, NULL ); + if( error ) + test_error_ret( error, "Unable to get device CL_DEVICE_SINGLE_FP_CONFIG", 0 ); + + if( single & CL_FP_ROUND_TO_NEAREST ) + return CL_FP_ROUND_TO_NEAREST; + + if( 0 == (single & CL_FP_ROUND_TO_ZERO) ) + test_error_ret( -1, "FAILURE: device must support either CL_DEVICE_SINGLE_FP_CONFIG or CL_FP_ROUND_TO_NEAREST", 0 ); + + // Make sure we are an embedded device before allowing a pass + if( (error = clGetDeviceInfo( device, CL_DEVICE_PROFILE, sizeof( profileStr ), &profileStr, NULL ) )) + test_error_ret( error, "FAILURE: Unable to get CL_DEVICE_PROFILE", 0 ); + + if( strcmp( profileStr, "EMBEDDED_PROFILE" ) ) + test_error_ret( error, "FAILURE: non-EMBEDDED_PROFILE devices must support CL_FP_ROUND_TO_NEAREST", 0 ); + + return CL_FP_ROUND_TO_ZERO; +} + +int checkDeviceForQueueSupport( cl_device_id device, cl_command_queue_properties prop ) +{ + cl_command_queue_properties realProps; + cl_int error = clGetDeviceInfo( device, CL_DEVICE_QUEUE_ON_HOST_PROPERTIES, sizeof( realProps ), &realProps, NULL ); + test_error_ret( error, "FAILURE: Unable to get device queue properties", 0 ); + + return ( realProps & prop ) ? 1 : 0; +} + +int printDeviceHeader( cl_device_id device ) +{ + char deviceName[ 512 ], deviceVendor[ 512 ], deviceVersion[ 512 ], cLangVersion[ 512 ]; + int error; + + error = clGetDeviceInfo( device, CL_DEVICE_NAME, sizeof( deviceName ), deviceName, NULL ); + test_error( error, "Unable to get CL_DEVICE_NAME for device" ); + + error = clGetDeviceInfo( device, CL_DEVICE_VENDOR, sizeof( deviceVendor ), deviceVendor, NULL ); + test_error( error, "Unable to get CL_DEVICE_VENDOR for device" ); + + error = clGetDeviceInfo( device, CL_DEVICE_VERSION, sizeof( deviceVersion ), deviceVersion, NULL ); + test_error( error, "Unable to get CL_DEVICE_VERSION for device" ); + + error = clGetDeviceInfo( device, CL_DEVICE_OPENCL_C_VERSION, sizeof( cLangVersion ), cLangVersion, NULL ); + test_error( error, "Unable to get CL_DEVICE_OPENCL_C_VERSION for device" ); + + log_info("Compute Device Name = %s, Compute Device Vendor = %s, Compute Device Version = %s%s%s\n", + deviceName, deviceVendor, deviceVersion, ( error == CL_SUCCESS ) ? ", CL C Version = " : "", + ( error == CL_SUCCESS ) ? cLangVersion : "" ); + + return CL_SUCCESS; +} + +Version get_device_cl_c_version(cl_device_id device) +{ + // Get the device OpenCL version. + auto device_cl_version = get_device_cl_version(device); + + // If the device version >= 3.0 it must support the + // CL_DEVICE_OPENCL_C_ALL_VERSIONS query from which we can extract the most + // recent CL C version supported by the device. + if (device_cl_version >= Version{ 3, 0 }) + { + size_t opencl_c_all_versions_size_in_bytes{}; + auto error = + clGetDeviceInfo(device, CL_DEVICE_OPENCL_C_ALL_VERSIONS, 0, nullptr, + &opencl_c_all_versions_size_in_bytes); + test_error_ret( + error, "clGetDeviceInfo failed for CL_DEVICE_OPENCL_C_ALL_VERSIONS", + (Version{ -1, 0 })); + std::vector name_versions( + opencl_c_all_versions_size_in_bytes / sizeof(cl_name_version)); + error = clGetDeviceInfo(device, CL_DEVICE_OPENCL_C_ALL_VERSIONS, + opencl_c_all_versions_size_in_bytes, + name_versions.data(), nullptr); + test_error_ret( + error, "clGetDeviceInfo failed for CL_DEVICE_OPENCL_C_ALL_VERSIONS", + (Version{ -1, 0 })); + + Version max_supported_cl_c_version{}; + for (const auto &name_version : name_versions) + { + Version current_version{ CL_VERSION_MAJOR(name_version.version), + CL_VERSION_MINOR(name_version.version) }; + max_supported_cl_c_version = + (current_version > max_supported_cl_c_version) + ? current_version + : max_supported_cl_c_version; + } + return max_supported_cl_c_version; + } + + // The second special case is OpenCL-1.0 where CL_DEVICE_OPENCL_C_VERSION + // did not exist, but since this is just the first version we can + // return 1.0. + if (device_cl_version == Version{ 1, 0 }) + { + return Version{ 1, 0 }; + } + + // Otherwise we know we have a 1.1 <= device_version <= 2.0 where all CL C + // versions are backwards compatible, hence querying with the + // CL_DEVICE_OPENCL_C_VERSION query must return the most recent supported + // OpenCL C version. + size_t opencl_c_version_size_in_bytes{}; + auto error = clGetDeviceInfo(device, CL_DEVICE_OPENCL_C_VERSION, 0, nullptr, + &opencl_c_version_size_in_bytes); + test_error_ret(error, + "clGetDeviceInfo failed for CL_DEVICE_OPENCL_C_VERSION\n", + (Version{ -1, 0 })); + + std::string opencl_c_version(opencl_c_version_size_in_bytes, '\0'); + error = + clGetDeviceInfo(device, CL_DEVICE_OPENCL_C_VERSION, + opencl_c_version.size(), &opencl_c_version[0], nullptr); + + test_error_ret(error, + "clGetDeviceInfo failed for CL_DEVICE_OPENCL_C_VERSION\n", + (Version{ -1, 0 })); + + // Scrape out the major, minor pair from the string. + auto major = opencl_c_version[opencl_c_version.find('.') - 1]; + auto minor = opencl_c_version[opencl_c_version.find('.') + 1]; + + return Version{ major - '0', minor - '0' }; +} + +Version get_max_OpenCL_C_for_context(cl_context context) +{ + // Get all the devices in the context and find the maximum + // universally supported OpenCL C version. + size_t devices_size_in_bytes{}; + auto error = clGetContextInfo(context, CL_CONTEXT_DEVICES, 0, nullptr, + &devices_size_in_bytes); + test_error_ret(error, "clGetDeviceInfo failed for CL_CONTEXT_DEVICES", + (Version{ -1, 0 })); + std::vector devices(devices_size_in_bytes + / sizeof(cl_device_id)); + error = clGetContextInfo(context, CL_CONTEXT_DEVICES, devices_size_in_bytes, + devices.data(), nullptr); + auto current_version = get_device_cl_c_version(devices[0]); + std::for_each(std::next(devices.begin()), devices.end(), + [¤t_version](cl_device_id device) { + auto device_version = get_device_cl_c_version(device); + // OpenCL 3.0 is not backwards compatible with 2.0. + // If we have 3.0 and 2.0 in the same driver we + // use 1.2. + if (((device_version >= Version(2, 0) + && device_version < Version(3, 0)) + && current_version >= Version(3, 0)) + || (device_version >= Version(3, 0) + && (current_version >= Version(2, 0) + && current_version < Version(3, 0)))) + { + current_version = Version(1, 2); + } + else + { + current_version = + (std::min)(device_version, current_version); + } + }); + return current_version; +} + +bool poll_until(unsigned timeout_ms, unsigned interval_ms, + std::function fn) +{ + unsigned time_spent_ms = 0; + bool ret = false; + + while (time_spent_ms < timeout_ms) + { + ret = fn(); + if (ret) + { + break; + } + usleep(interval_ms * 1000); + time_spent_ms += interval_ms; + } + + return ret; +} diff --git a/test_common/harness/kernelHelpers.h b/test_common/harness/kernelHelpers.h index 5f4729c4..7f972070 100644 --- a/test_common/harness/kernelHelpers.h +++ b/test_common/harness/kernelHelpers.h @@ -37,9 +37,10 @@ #include #endif -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus +#include "deviceInfo.h" +#include "harness/alloc.h" + +#include /* * The below code is intended to be used at the top of kernels that appear inline in files to set line and file info for the kernel: @@ -89,6 +90,14 @@ extern int create_single_kernel_helper_create_program(cl_context context, const char *buildOptions = NULL, const bool openclCXX = false); +extern int create_single_kernel_helper_create_program_for_device(cl_context context, + cl_device_id device, + cl_program *outProgram, + unsigned int numKernelLines, + const char **kernelProgram, + const char *buildOptions = NULL, + const bool openclCXX = false); + /* Creates OpenCL C++ program. This one must be used for creating OpenCL C++ program. */ extern int create_openclcpp_program(cl_context context, cl_program *outProgram, @@ -114,14 +123,11 @@ extern int get_max_common_2D_work_group_size( cl_context context, cl_kernel kern /* Helper to obtain the biggest fit work group size for all the devices in a given group and for the given global thread size */ extern int get_max_common_3D_work_group_size( cl_context context, cl_kernel kernel, size_t *globalThreadSize, size_t *outSizes ); -/* Helper to get major/minor number for a device */ -extern int get_device_version( cl_device_id id, size_t* major, size_t* minor); - /* Helper to obtain the biggest allowed work group size for all the devices in a given group */ extern int get_max_allowed_work_group_size( cl_context context, cl_kernel kernel, size_t *outSize, size_t *outLimits ); -/* Helper to determine if an extension is supported by a device */ -extern int is_extension_available( cl_device_id device, const char *extensionName ); +/* Helper to obtain the biggest allowed 1D work group size on a given device */ +extern int get_max_allowed_1d_work_group_size_on_device( cl_device_id device, cl_kernel kernel, size_t *outSize ); /* Helper to determine if a device supports an image format */ extern int is_image_format_supported( cl_context context, cl_mem_flags flags, cl_mem_object_type image_type, const cl_image_format *fmt ); @@ -139,10 +145,6 @@ extern int checkFor3DImageSupport( cl_device_id device ); /* Checks that a given queue property is supported on the specified device. Returns 1 if supported, 0 if not or an error. */ extern int checkDeviceForQueueSupport( cl_device_id device, cl_command_queue_properties prop ); -/* Helper for aligned memory allocation */ -void * align_malloc(size_t size, size_t alignment); -void align_free(void *); - /* Helper to obtain the min alignment for a given context, i.e the max of all min alignments for devices attached to the context*/ size_t get_min_alignment(cl_context context); @@ -163,11 +165,26 @@ cl_device_fp_config get_default_rounding_mode( cl_device_id device ); return 0; \ } +#define PASSIVE_REQUIRE_FP16_SUPPORT(device) \ + if (!is_extension_available(device, "cl_khr_fp16")) \ + { \ + log_info("\n\tNote: device does not support fp16. Skipping test...\n"); \ + return 0; \ + } + /* Prints out the standard device header for all tests given the device to print for */ extern int printDeviceHeader( cl_device_id device ); -#ifdef __cplusplus -} -#endif // __cplusplus +// Gets the latest (potentially non-backward compatible) OpenCL C version +// supported by the device. +Version get_device_cl_c_version(cl_device_id device); + +// Gets the maximum universally supported OpenCL C version in a context, i.e. +// the OpenCL C version supported by all devices in a context. +Version get_max_OpenCL_C_for_context(cl_context context); + +// Poll fn every interval_ms until timeout_ms or it returns true +bool poll_until(unsigned timeout_ms, unsigned interval_ms, + std::function fn); #endif // _kernelHelpers_h diff --git a/test_common/harness/msvc9.c b/test_common/harness/msvc9.c index ca0e45a0..1c0cf2b9 100644 --- a/test_common/harness/msvc9.c +++ b/test_common/harness/msvc9.c @@ -24,7 +24,7 @@ #include -#if ! defined( __INTEL_COMPILER ) +#if _MSC_VER < 1900 && ! defined( __INTEL_COMPILER ) /////////////////////////////////////////////////////////////////// // @@ -276,6 +276,8 @@ int SIGNBIT_DP64(double x ) } #endif +#if _MSC_VER < 1900 + /* fmax(x, y) returns the larger (more positive) of x and y. NaNs are treated as missing values: if one argument is NaN, the other argument is returned. If both arguments are NaN, @@ -560,6 +562,7 @@ long int lrintf (float x) return (long int) x; } +#endif // _MSC_VER < 1900 /////////////////////////////////////////////////////////////////// // @@ -589,20 +592,7 @@ int feclearexcept(int excepts) #endif // __INTEL_COMPILER -#if ! defined( __INTEL_COMPILER ) || __INTEL_COMPILER < 1300 - -float make_nan() -{ -/* This is the IEEE 754 single-precision format: - unsigned int mantissa: 22; - unsigned int quiet_nan: 1; - unsigned int exponent: 8; - unsigned int negative: 1; -*/ - //const static unsigned - static const int32_t _nan = 0x7fc00000; - return *(const float*)(&_nan); -} +#if _MSC_VER < 1900 && ( ! defined( __INTEL_COMPILER ) || __INTEL_COMPILER < 1300 ) float nanf( const char* str) { diff --git a/test_common/harness/mt19937.c b/test_common/harness/mt19937.c deleted file mode 100644 index baa19fb8..00000000 --- a/test_common/harness/mt19937.c +++ /dev/null @@ -1,280 +0,0 @@ -/* - A C-program for MT19937, with initialization improved 2002/1/26. - Coded by Takuji Nishimura and Makoto Matsumoto. - - Before using, initialize the state by using init_genrand(seed) - or init_by_array(init_key, key_length). - - Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. 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. - - 3. The names of its contributors may not 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. - - - Any feedback is very welcome. - http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html - email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space) - - Modifications for use in OpenCL by Ian Ollmann, Apple Inc. - -*/ - -#include -#include -#include "mt19937.h" -#include "mingw_compat.h" - -#ifdef __SSE2__ - #include -#endif - -static void * align_malloc(size_t size, size_t alignment) -{ -#if defined(_WIN32) && defined(_MSC_VER) - return _aligned_malloc(size, alignment); -#elif defined(__linux__) || defined (linux) || defined(__APPLE__) - void * ptr = NULL; -#if defined(__ANDROID__) - ptr = memalign(alignment, size); - if ( ptr ) - return ptr; -#else - if (0 == posix_memalign(&ptr, alignment, size)) - return ptr; -#endif - return NULL; -#elif defined(__MINGW32__) - return __mingw_aligned_malloc(size, alignment); -#else - #error "Please add support OS for aligned malloc" -#endif -} - -static void align_free(void * ptr) -{ -#if defined(_WIN32) && defined(_MSC_VER) - _aligned_free(ptr); -#elif defined(__linux__) || defined (linux) || defined(__APPLE__) - return free(ptr); -#elif defined(__MINGW32__) - return __mingw_aligned_free(ptr); -#else - #error "Please add support OS for aligned free" -#endif -} - - -/* Period parameters */ -#define N 624 /* vector code requires multiple of 4 here */ -#define M 397 -#define MATRIX_A (cl_uint) 0x9908b0dfUL /* constant vector a */ -#define UPPER_MASK (cl_uint) 0x80000000UL /* most significant w-r bits */ -#define LOWER_MASK (cl_uint) 0x7fffffffUL /* least significant r bits */ - -typedef struct _MTdata -{ - cl_uint mt[N]; -#ifdef __SSE2__ - cl_uint cache[N]; -#endif - cl_int mti; -}_MTdata; - -/* initializes mt[N] with a seed */ -MTdata init_genrand(cl_uint s) -{ - MTdata r = (MTdata) align_malloc( sizeof( _MTdata ), 16 ); - if( NULL != r ) - { - cl_uint *mt = r->mt; - int mti = 0; - mt[0]= s; // & 0xffffffffUL; - for (mti=1; mti> 30)) + mti); - /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */ - /* In the previous versions, MSBs of the seed affect */ - /* only MSBs of the array mt[]. */ - /* 2002/01/09 modified by Makoto Matsumoto */ - // mt[mti] &= 0xffffffffUL; - /* for >32 bit machines */ - } - r->mti = mti; - } - - return r; -} - -void free_mtdata( MTdata d ) -{ - if(d) - align_free(d); -} - -/* generates a random number on [0,0xffffffff]-interval */ -cl_uint genrand_int32( MTdata d) -{ - /* mag01[x] = x * MATRIX_A for x=0,1 */ - static const cl_uint mag01[2]={0x0UL, MATRIX_A}; -#ifdef __SSE2__ - static volatile int init = 0; - static union{ __m128i v; cl_uint s[4]; } upper_mask, lower_mask, one, matrix_a, c0, c1; -#endif - - - cl_uint *mt = d->mt; - cl_uint y; - - if (d->mti == N) - { /* generate N words at one time */ - int kk; - -#ifdef __SSE2__ - if( 0 == init ) - { - upper_mask.s[0] = upper_mask.s[1] = upper_mask.s[2] = upper_mask.s[3] = UPPER_MASK; - lower_mask.s[0] = lower_mask.s[1] = lower_mask.s[2] = lower_mask.s[3] = LOWER_MASK; - one.s[0] = one.s[1] = one.s[2] = one.s[3] = 1; - matrix_a.s[0] = matrix_a.s[1] = matrix_a.s[2] = matrix_a.s[3] = MATRIX_A; - c0.s[0] = c0.s[1] = c0.s[2] = c0.s[3] = (cl_uint) 0x9d2c5680UL; - c1.s[0] = c1.s[1] = c1.s[2] = c1.s[3] = (cl_uint) 0xefc60000UL; - init = 1; - } -#endif - - kk = 0; -#ifdef __SSE2__ - // vector loop - for( ; kk + 4 <= N-M; kk += 4 ) - { - __m128i vy = _mm_or_si128( _mm_and_si128( _mm_load_si128( (__m128i*)(mt + kk) ), upper_mask.v ), - _mm_and_si128( _mm_loadu_si128( (__m128i*)(mt + kk + 1) ), lower_mask.v )); // ((mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK)) - - __m128i mask = _mm_cmpeq_epi32( _mm_and_si128( vy, one.v), one.v ); // y & 1 ? -1 : 0 - __m128i vmag01 = _mm_and_si128( mask, matrix_a.v ); // y & 1 ? MATRIX_A, 0 = mag01[y & (cl_uint) 0x1UL] - __m128i vr = _mm_xor_si128( _mm_loadu_si128( (__m128i*)(mt + kk + M)), (__m128i) _mm_srli_epi32( vy, 1 ) ); // mt[kk+M] ^ (y >> 1) - vr = _mm_xor_si128( vr, vmag01 ); // mt[kk+M] ^ (y >> 1) ^ mag01[y & (cl_uint) 0x1UL] - _mm_store_si128( (__m128i*) (mt + kk ), vr ); - } -#endif - for ( ;kk> 1) ^ mag01[y & (cl_uint) 0x1UL]; - } - -#ifdef __SSE2__ - // advance to next aligned location - for (;kk> 1) ^ mag01[y & (cl_uint) 0x1UL]; - } - - // vector loop - for( ; kk + 4 <= N-1; kk += 4 ) - { - __m128i vy = _mm_or_si128( _mm_and_si128( _mm_load_si128( (__m128i*)(mt + kk) ), upper_mask.v ), - _mm_and_si128( _mm_loadu_si128( (__m128i*)(mt + kk + 1) ), lower_mask.v )); // ((mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK)) - - __m128i mask = _mm_cmpeq_epi32( _mm_and_si128( vy, one.v), one.v ); // y & 1 ? -1 : 0 - __m128i vmag01 = _mm_and_si128( mask, matrix_a.v ); // y & 1 ? MATRIX_A, 0 = mag01[y & (cl_uint) 0x1UL] - __m128i vr = _mm_xor_si128( _mm_loadu_si128( (__m128i*)(mt + kk + M - N)), _mm_srli_epi32( vy, 1 ) ); // mt[kk+M-N] ^ (y >> 1) - vr = _mm_xor_si128( vr, vmag01 ); // mt[kk+M] ^ (y >> 1) ^ mag01[y & (cl_uint) 0x1UL] - _mm_store_si128( (__m128i*) (mt + kk ), vr ); - } -#endif - - for (;kk> 1) ^ mag01[y & (cl_uint) 0x1UL]; - } - y = (cl_uint)((mt[N-1]&UPPER_MASK)|(mt[0]&LOWER_MASK)); - mt[N-1] = mt[M-1] ^ (y >> 1) ^ mag01[y & (cl_uint) 0x1UL]; - -#ifdef __SSE2__ - // Do the tempering ahead of time in vector code - for( kk = 0; kk + 4 <= N; kk += 4 ) - { - __m128i vy = _mm_load_si128( (__m128i*)(mt + kk ) ); // y = mt[k]; - vy = _mm_xor_si128( vy, _mm_srli_epi32( vy, 11 ) ); // y ^= (y >> 11); - vy = _mm_xor_si128( vy, _mm_and_si128( _mm_slli_epi32( vy, 7 ), c0.v) ); // y ^= (y << 7) & (cl_uint) 0x9d2c5680UL; - vy = _mm_xor_si128( vy, _mm_and_si128( _mm_slli_epi32( vy, 15 ), c1.v) ); // y ^= (y << 15) & (cl_uint) 0xefc60000UL; - vy = _mm_xor_si128( vy, _mm_srli_epi32( vy, 18 ) ); // y ^= (y >> 18); - _mm_store_si128( (__m128i*)(d->cache+kk), vy ); - } -#endif - - d->mti = 0; - } -#ifdef __SSE2__ - y = d->cache[d->mti++]; -#else - y = mt[d->mti++]; - - /* Tempering */ - y ^= (y >> 11); - y ^= (y << 7) & (cl_uint) 0x9d2c5680UL; - y ^= (y << 15) & (cl_uint) 0xefc60000UL; - y ^= (y >> 18); -#endif - - - return y; -} - -cl_ulong genrand_int64( MTdata d) -{ - return ((cl_ulong) genrand_int32(d) << 32) | (cl_uint) genrand_int32(d); -} - -/* generates a random number on [0,1]-real-interval */ -double genrand_real1(MTdata d) -{ - return genrand_int32(d)*(1.0/4294967295.0); - /* divided by 2^32-1 */ -} - -/* generates a random number on [0,1)-real-interval */ -double genrand_real2(MTdata d) -{ - return genrand_int32(d)*(1.0/4294967296.0); - /* divided by 2^32 */ -} - -/* generates a random number on (0,1)-real-interval */ -double genrand_real3(MTdata d) -{ - return (((double)genrand_int32(d)) + 0.5)*(1.0/4294967296.0); - /* divided by 2^32 */ -} - -/* generates a random number on [0,1) with 53-bit resolution*/ -double genrand_res53(MTdata d) -{ - unsigned long a=genrand_int32(d)>>5, b=genrand_int32(d)>>6; - return(a*67108864.0+b)*(1.0/9007199254740992.0); -} diff --git a/test_conformance/compatibility/test_common/harness/mt19937.c b/test_common/harness/mt19937.cpp similarity index 92% rename from test_conformance/compatibility/test_common/harness/mt19937.c rename to test_common/harness/mt19937.cpp index 75b76a74..a4fbf591 100644 --- a/test_conformance/compatibility/test_common/harness/mt19937.c +++ b/test_common/harness/mt19937.cpp @@ -48,41 +48,12 @@ #include #include "mt19937.h" #include "mingw_compat.h" +#include "harness/alloc.h" #ifdef __SSE2__ #include #endif -static void * align_malloc(size_t size, size_t alignment) -{ -#if defined(_WIN32) && defined(_MSC_VER) - return _aligned_malloc(size, alignment); -#elif defined(__linux__) || defined (linux) || defined(__APPLE__) - void * ptr = NULL; - if (0 == posix_memalign(&ptr, alignment, size)) - return ptr; - return NULL; -#elif defined(__MINGW32__) - return __mingw_aligned_malloc(size, alignment); -#else - #error "Please add support OS for aligned malloc" -#endif -} - -static void align_free(void * ptr) -{ -#if defined(_WIN32) && defined(_MSC_VER) - _aligned_free(ptr); -#elif defined(__linux__) || defined (linux) || defined(__APPLE__) - return free(ptr); -#elif defined(__MINGW32__) - return __mingw_aligned_free(ptr); -#else - #error "Please add support OS for aligned free" -#endif -} - - /* Period parameters */ #define N 624 /* vector code requires multiple of 4 here */ #define M 397 diff --git a/test_common/harness/mt19937.h b/test_common/harness/mt19937.h index d05beed1..85786e7b 100644 --- a/test_common/harness/mt19937.h +++ b/test_common/harness/mt19937.h @@ -55,10 +55,6 @@ #include #endif -#ifdef __cplusplus - extern "C" { -#endif - /* * Interfaces here have been modified from original sources so that they * are safe to call reentrantly, so long as a different MTdata is used @@ -93,7 +89,29 @@ double genrand_res53( MTdata /*data*/ ); #ifdef __cplusplus + +#include + +struct MTdataHolder { + MTdataHolder(cl_uint seed) { + m_mtdata = init_genrand(seed); + assert(m_mtdata != nullptr); } -#endif + + MTdataHolder(MTdata mtdata) : m_mtdata(mtdata) {} + + ~MTdataHolder() { + free_mtdata(m_mtdata); + } + + operator MTdata () const { + return m_mtdata; + } + +private: + MTdata m_mtdata; +}; + +#endif // #ifdef __cplusplus #endif /* MT19937_H */ diff --git a/test_common/harness/os_helpers.cpp b/test_common/harness/os_helpers.cpp index ecc55a22..00e7a6b1 100644 --- a/test_common/harness/os_helpers.cpp +++ b/test_common/harness/os_helpers.cpp @@ -28,6 +28,10 @@ #include +#if defined(__ANDROID__) +#include +#endif + #define CHECK_PTR( ptr ) \ if ( (ptr) == NULL ) { \ abort(); \ @@ -187,7 +191,7 @@ int const _count = 8; // How many times we will try to double buff */ - #if defined(__ANDROID__) || ( ( _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 ) && ! _GNU_SOURCE ) + #if (defined(__ANDROID__) && __ANDROID_API__ < 23) || ( ( _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 ) && ! _GNU_SOURCE ) // XSI version of strerror_r. #warning Not tested! diff --git a/test_common/harness/os_helpers.h b/test_common/harness/os_helpers.h index 21625841..7c4463f9 100644 --- a/test_common/harness/os_helpers.h +++ b/test_common/harness/os_helpers.h @@ -37,17 +37,9 @@ // C interface. // ------------------------------------------------------------------------------------------------- -#ifdef __cplusplus - extern "C" { -#endif // __cplusplus - char * get_err_msg( int err ); // Returns system error message. Subject to free. char * get_dir_sep(); // Returns dir separator. Subject to free. char * get_exe_path(); // Returns path of current executable. Subject to free. char * get_exe_dir(); // Returns dir of current executable. Subject to free. -#ifdef __cplusplus - } // extern "C" -#endif // __cplusplus - #endif // __os_helpers_h__ diff --git a/test_common/harness/parseParameters.cpp b/test_common/harness/parseParameters.cpp index 02ef94bd..1706730a 100644 --- a/test_common/harness/parseParameters.cpp +++ b/test_common/harness/parseParameters.cpp @@ -27,105 +27,177 @@ using namespace std; -bool gOfflineCompiler = false; -bool gForceSpirVCache = false; -bool gForceSpirVGenerate = false; -std::string gSpirVPath = "."; -OfflineCompilerOutputType gOfflineCompilerOutputType; +#define DEFAULT_COMPILATION_PROGRAM "cl_offline_compiler" + +CompilationMode gCompilationMode = kOnline; +CompilationCacheMode gCompilationCacheMode = kCacheModeCompileIfAbsent; +std::string gCompilationCachePath = "."; +std::string gCompilationProgram = DEFAULT_COMPILATION_PROGRAM; void helpInfo () { - log_info(" '-offlineCompiler ': use offline compiler\n"); - log_info(" ' output_type binary - \"../build_script_binary.py\" is invoked\n"); - log_info(" ' output_type source - \"../build_script_source.py\" is invoked\n"); - log_info(" ' output_type spir_v - \"../cl_build_script_spir_v.py\" is invoked, optional modes: generate, cache\n"); - log_info(" ' mode generate - force binary generation\n"); - log_info(" ' mode cache - force reading binary files from cache\n"); - log_info("\n"); + log_info("Common options:\n" + " -h, --help This help\n" + " --compilation-mode Specify a compilation mode. Mode can be:\n" + " online Use online compilation (default)\n" + " binary Use binary offline compilation\n" + " spir-v Use SPIR-V offline compilation\n" + "\n" + " For offline compilation (binary and spir-v modes) only:\n" + " --compilation-cache-mode Specify a compilation caching mode:\n" + " compile-if-absent Read from cache if already populated, or\n" + " else perform offline compilation (default)\n" + " force-read Force reading from the cache\n" + " overwrite Disable reading from the cache\n" + " dump-cl-files Dumps the .cl and build .options files used by the test suite\n" + " --compilation-cache-path Path for offline compiler output and CL source\n" + " --compilation-program Program to use for offline compilation,\n" + " defaults to " DEFAULT_COMPILATION_PROGRAM "\n" + "\n"); } int parseCustomParam (int argc, const char *argv[], const char *ignore) { - int delArg = 0; + int delArg = 0; - for (int i=1; i\n"); return -1; } } - else + else if (!strcmp(argv[i], "--compilation-cache-mode")) { - log_error(" Offline Compiler parameters are incorrect. Usage:\n"); - log_error(" -offlineCompiler \n"); - return -1; + delArg++; + if ((i + 1) < argc) + { + delArg++; + const char *mode = argv[i + 1]; + + if (!strcmp(mode, "compile-if-absent")) + { + gCompilationCacheMode = kCacheModeCompileIfAbsent; + } + else if (!strcmp(mode, "force-read")) + { + gCompilationCacheMode = kCacheModeForceRead; + } + else if (!strcmp(mode, "overwrite")) + { + gCompilationCacheMode = kCacheModeOverwrite; + } + else if (!strcmp(mode, "dump-cl-files")) + { + gCompilationCacheMode = kCacheModeDumpCl; + } + else + { + log_error("Compilation cache mode not recognized: %s\n", mode); + return -1; + } + log_info("Compilation cache mode specified: %s\n", mode); + } + else + { + log_error("Compilation cache mode parameters are incorrect. Usage:\n" + " --compilation-cache-mode \n"); + return -1; + } } + else if (!strcmp(argv[i], "--compilation-cache-path")) + { + delArg++; + if ((i + 1) < argc) + { + delArg++; + gCompilationCachePath = argv[i + 1]; + } + else + { + log_error("Path argument for --compilation-cache-path was not specified.\n"); + return -1; + } + } + else if (!strcmp(argv[i], "--compilation-program")) + { + delArg++; + if ((i + 1) < argc) + { + delArg++; + gCompilationProgram = argv[i + 1]; + } + else + { + log_error("Program argument for --compilation-program was not specified.\n"); + return -1; + } + } + + //cleaning parameters from argv tab + for (int j = i; j < argc - delArg; j++) + argv[j] = argv[j + delArg]; + argc -= delArg; + i -= delArg; } - //cleaning parameters from argv tab - for (int j=i; j -extern bool gOfflineCompiler; -extern bool gForceSpirVCache; -extern bool gForceSpirVGenerate; -extern std::string gSpirVPath; - -enum OfflineCompilerOutputType +enum CompilationMode { - kBinary = 0, - kSource, + kOnline = 0, + kBinary, kSpir_v }; -extern OfflineCompilerOutputType gOfflineCompilerOutputType; +enum CompilationCacheMode +{ + kCacheModeCompileIfAbsent = 0, + kCacheModeForceRead, + kCacheModeOverwrite, + kCacheModeDumpCl +}; + +extern CompilationMode gCompilationMode; +extern CompilationCacheMode gCompilationCacheMode; +extern std::string gCompilationCachePath; +extern std::string gCompilationProgram; extern int parseCustomParam (int argc, const char *argv[], const char *ignore = 0 ); diff --git a/test_common/harness/propertyHelpers.cpp b/test_common/harness/propertyHelpers.cpp new file mode 100644 index 00000000..3157ca80 --- /dev/null +++ b/test_common/harness/propertyHelpers.cpp @@ -0,0 +1,126 @@ +// +// Copyright (c) 2020 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "propertyHelpers.h" +#include "errorHelpers.h" + +#include + +#include +#include + +static bool findProperty(const std::vector& props, + cl_properties prop, cl_properties& value) +{ + // This function assumes properties are valid: + assert(props.size() == 0 || props.back() == 0); + assert(props.size() == 0 || props.size() % 2 == 1); + + for (cl_uint i = 0; i < props.size(); i = i + 2) + { + cl_properties check_prop = props[i]; + + if (check_prop == 0) + { + break; + } + + if (check_prop == prop) + { + value = props[i + 1]; + return true; + } + } + + return false; +} + +int compareProperties(const std::vector& queried, + const std::vector& check) +{ + if (queried.size() != 0) + { + if (queried.back() != 0) + { + log_error("ERROR: queried properties do not end with 0!\n"); + return TEST_FAIL; + } + if (queried.size() % 2 != 1) + { + log_error("ERROR: queried properties does not consist of " + "property-value pairs!\n"); + return TEST_FAIL; + } + } + if (check.size() != 0) + { + if (check.back() != 0) + { + log_error("ERROR: check properties do not end with 0!\n"); + return TEST_FAIL; + } + if (check.size() % 2 != 1) + { + log_error("ERROR: check properties does not consist of " + "property-value pairs!\n"); + return TEST_FAIL; + } + } + + if (queried != check) + { + for (cl_uint i = 0; i < check.size(); i = i + 2) + { + cl_properties check_prop = check[i]; + + if (check_prop == 0) + { + break; + } + + cl_properties check_value = check[i + 1]; + cl_properties queried_value = 0; + + bool found = findProperty(queried, check_prop, queried_value); + + if (!found) + { + log_error("ERROR: expected property 0x%x not found!\n", + check_prop); + return TEST_FAIL; + } + else if (check_value != queried_value) + { + log_error("ERROR: mis-matched value for property 0x%x: wanted " + "0x%x, got 0x%x\n", + check_prop, check_value, queried_value); + return TEST_FAIL; + } + } + + if (queried.size() > check.size()) + { + log_error("ERROR: all properties found but there are extra " + "properties: expected %d, got %d.\n", + check.size(), queried.size()); + return TEST_FAIL; + } + + log_error("ERROR: properties were returned in the wrong order.\n"); + return TEST_FAIL; + } + + return TEST_PASS; +} diff --git a/test_conformance/compatibility/test_conformance/api/testBase.h b/test_common/harness/propertyHelpers.h similarity index 63% rename from test_conformance/compatibility/test_conformance/api/testBase.h rename to test_common/harness/propertyHelpers.h index 5073b21f..68d16f6d 100644 --- a/test_conformance/compatibility/test_conformance/api/testBase.h +++ b/test_common/harness/propertyHelpers.h @@ -1,6 +1,6 @@ // -// Copyright (c) 2017 The Khronos Group Inc. -// +// Copyright (c) 2020 The Khronos Group Inc. +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -13,19 +13,15 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#ifndef _testBase_h -#define _testBase_h +#ifndef _propertyHelpers_h +#define _propertyHelpers_h -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - -#include "procs.h" - -#endif // _testBase_h +#include "compat.h" +#include "testHarness.h" +#include +int compareProperties(const std::vector& queried, + const std::vector& check); +#endif // _propertyHelpers_h diff --git a/test_common/harness/rounding_mode.c b/test_common/harness/rounding_mode.cpp similarity index 100% rename from test_common/harness/rounding_mode.c rename to test_common/harness/rounding_mode.cpp diff --git a/test_common/harness/rounding_mode.h b/test_common/harness/rounding_mode.h index b7eb9758..abbb5afe 100644 --- a/test_common/harness/rounding_mode.h +++ b/test_common/harness/rounding_mode.h @@ -16,6 +16,8 @@ #ifndef __ROUNDING_MODE_H__ #define __ROUNDING_MODE_H__ +#pragma STDC FENV_ACCESS ON + #include "compat.h" #if (defined(_WIN32) && defined (_MSC_VER)) @@ -51,19 +53,11 @@ typedef enum kTypeCount }Type; -#ifdef __cplusplus -extern "C" { -#endif - extern RoundingMode set_round( RoundingMode r, Type outType ); extern RoundingMode get_round( void ); extern void *FlushToZero( void ); extern void UnFlushToZero( void *p); -#ifdef __cplusplus -} -#endif - #endif /* __ROUNDING_MODE_H__ */ diff --git a/test_common/harness/testHarness.c b/test_common/harness/testHarness.cpp similarity index 61% rename from test_common/harness/testHarness.c rename to test_common/harness/testHarness.cpp index 8537f254..718983a7 100644 --- a/test_common/harness/testHarness.c +++ b/test_common/harness/testHarness.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017-2019 The Khronos Group Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,18 +16,28 @@ #include "testHarness.h" #include "compat.h" #include +#include #include +#include +#include +#include #include "threadTesting.h" #include "errorHelpers.h" #include "kernelHelpers.h" #include "fpcontrol.h" #include "typeWrappers.h" +#include "imageHelpers.h" #include "parseParameters.h" #if !defined(_WIN32) +#include #include #endif +#if defined(__APPLE__) +#include +#endif + #include #if !defined (__APPLE__) @@ -36,6 +46,8 @@ int gTestsPassed = 0; int gTestsFailed = 0; +int gFailCount; +int gTestCount; cl_uint gRandomSeed = 0; cl_uint gReSeed = 0; @@ -45,18 +57,38 @@ int gIsEmbedded = 0; int gIsOpenCL_C_1_0_Device = 0; int gIsOpenCL_1_0_Device = 0; int gHasLong = 1; +bool gCoreILProgram = true; #define DEFAULT_NUM_ELEMENTS 0x4000 int runTestHarness( int argc, const char *argv[], int testNum, test_definition testList[], int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps ) { - return runTestHarnessWithCheck( argc, argv, testNum, testList, imageSupportRequired, forceNoContextCreation, queueProps, + return runTestHarnessWithCheck( argc, argv, testNum, testList, forceNoContextCreation, queueProps, ( imageSupportRequired ) ? verifyImageSupport : NULL ); } +int skip_init_info(int count) { + log_info("Test skipped while initialization\n"); + log_info("SKIPPED %d of %d tests.\n", count, count); + return EXIT_SUCCESS; +} + +int fail_init_info(int count) { + log_info("Test failed while initialization\n"); + log_info("FAILED %d of %d tests.\n", count, count); + return EXIT_FAILURE; +} +void version_expected_info(const char *test_name, const char *api_name, + const char *expected_version, + const char *device_version) +{ + log_info("%s skipped (requires at least %s version %s, but the device " + "reports %s version %s)\n", + test_name, api_name, expected_version, api_name, device_version); +} int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_definition testList[], - int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps, + int forceNoContextCreation, cl_command_queue_properties queueProps, DeviceCheckFn deviceCheckFn ) { test_start(); @@ -127,8 +159,7 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def argc = parseCustomParam(argc, argv); if (argc == -1) { - test_finish(); - return 0; + return EXIT_FAILURE; } /* Special case: just list the tests */ @@ -152,8 +183,7 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def { log_info( "\t%s\n", testList[i].name ); } - test_finish(); - return 0; + return EXIT_SUCCESS; } /* How are we supposed to seed the random # generators? */ @@ -228,16 +258,18 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def } } - switch( device_type ) - { - case CL_DEVICE_TYPE_GPU: log_info( "Requesting GPU device " ); break; - case CL_DEVICE_TYPE_CPU: log_info( "Requesting CPU device " ); break; - case CL_DEVICE_TYPE_ACCELERATOR: log_info( "Requesting Accelerator device " ); break; - case CL_DEVICE_TYPE_DEFAULT: log_info( "Requesting Default device " ); break; - default: log_error( "Requesting unknown device "); return -1; - } - log_info( based_on_env_var ? "based on environment variable " : "based on command line " ); - log_info( "for platform index %d and device index %d\n", choosen_platform_index, choosen_device_index); + + + switch (device_type) + { + case CL_DEVICE_TYPE_GPU: log_info("Requesting GPU device "); break; + case CL_DEVICE_TYPE_CPU: log_info("Requesting CPU device "); break; + case CL_DEVICE_TYPE_ACCELERATOR: log_info("Requesting Accelerator device "); break; + case CL_DEVICE_TYPE_DEFAULT: log_info("Requesting Default device "); break; + default: log_error("Requesting unknown device "); return EXIT_FAILURE; + } + log_info(based_on_env_var ? "based on environment variable " : "based on command line "); + log_info("for platform index %d and device index %d\n", choosen_platform_index, choosen_device_index); #if defined( __APPLE__ ) #if defined( __i386__ ) || defined( __x86_64__ ) @@ -263,7 +295,7 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def else { log_error( "Error: Unknown CL_MAX_SSE setting: %s\n", env ); - return -2; + return EXIT_FAILURE; } log_info( "*** Environment: CL_MAX_SSE = %s ***\n", env ); @@ -277,38 +309,33 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def err = clGetPlatformIDs(0, NULL, &num_platforms); if (err) { print_error(err, "clGetPlatformIDs failed"); - test_finish(); - return -1; + return EXIT_FAILURE; } platforms = (cl_platform_id *) malloc( num_platforms * sizeof( cl_platform_id ) ); if (!platforms || choosen_platform_index >= num_platforms) { log_error( "platform index out of range -- choosen_platform_index (%d) >= num_platforms (%d)\n", choosen_platform_index, num_platforms ); - test_finish(); - return -1; + return EXIT_FAILURE; } BufferOwningPtr platformsBuf(platforms); err = clGetPlatformIDs(num_platforms, platforms, NULL); if (err) { print_error(err, "clGetPlatformIDs failed"); - test_finish(); - return -1; + return EXIT_FAILURE; } /* Get the number of requested devices */ err = clGetDeviceIDs(platforms[choosen_platform_index], device_type, 0, NULL, &num_devices ); if (err) { print_error(err, "clGetDeviceIDs failed"); - test_finish(); - return -1; + return EXIT_FAILURE; } devices = (cl_device_id *) malloc( num_devices * sizeof( cl_device_id ) ); if (!devices || choosen_device_index >= num_devices) { log_error( "device index out of range -- choosen_device_index (%d) >= num_devices (%d)\n", choosen_device_index, num_devices ); - test_finish(); - return -1; + return EXIT_FAILURE; } BufferOwningPtr devicesBuf(devices); @@ -317,24 +344,28 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def err = clGetDeviceIDs(platforms[choosen_platform_index], device_type, num_devices, devices, NULL ); if (err) { print_error(err, "clGetDeviceIDs failed"); - test_finish(); - return -1; + return EXIT_FAILURE; } device = devices[choosen_device_index]; + err = clGetDeviceInfo( device, CL_DEVICE_TYPE, sizeof(gDeviceType), &gDeviceType, NULL ); + if( err ) + { + print_error( err, "Unable to get device type" ); + return TEST_FAIL; + } + if( printDeviceHeader( device ) != CL_SUCCESS ) { - test_finish(); - return -1; + return EXIT_FAILURE; } cl_device_fp_config fpconfig = 0; err = clGetDeviceInfo( device, CL_DEVICE_SINGLE_FP_CONFIG, sizeof( fpconfig ), &fpconfig, NULL ); if (err) { print_error(err, "clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed"); - test_finish(); - return -1; + return EXIT_FAILURE; } gFlushDenormsToZero = ( 0 == (fpconfig & CL_FP_DENORM)); @@ -347,8 +378,7 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def if (err) { print_error(err, "clGetDeviceInfo for CL_DEVICE_PROFILE failed\n" ); - test_finish(); - return -1; + return EXIT_FAILURE; } gIsEmbedded = NULL != strstr(profile, "EMBEDDED_PROFILE"); @@ -358,8 +388,7 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def if (err) { print_error(err, "clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed\n"); - test_finish(); - return -1; + return EXIT_FAILURE; } // Check for problems that only embedded will have @@ -370,37 +399,7 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def gInfNanSupport = 0; // check the extensions list to see if ulong and long are supported - size_t extensionsStringSize = 0; - if( (err = clGetDeviceInfo( device, CL_DEVICE_EXTENSIONS, 0, NULL, &extensionsStringSize ) )) - { - print_error( err, "Unable to get extensions string size for embedded device" ); - test_finish(); - return -1; - } - char *extensions_string = (char*) malloc(extensionsStringSize); - if( NULL == extensions_string ) - { - print_error( CL_OUT_OF_HOST_MEMORY, "Unable to allocate storage for extensions string for embedded device" ); - test_finish(); - return -1; - } - BufferOwningPtr extensions_stringBuf(extensions_string); - - if( (err = clGetDeviceInfo( device, CL_DEVICE_EXTENSIONS, extensionsStringSize, extensions_string, NULL ) )) - { - print_error( err, "Unable to get extensions string for embedded device" ); - test_finish(); - return -1; - } - - if( extensions_string[extensionsStringSize-1] != '\0' ) - { - log_error( "FAILURE: extensions string for embedded device is not NUL terminated" ); - test_finish(); - return -1; - } - - if( NULL == strstr( extensions_string, "cles_khr_int64" )) + if( !is_extension_available(device, "cles_khr_int64" )) gHasLong = 0; } @@ -413,8 +412,7 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def if( (err = clGetDeviceInfo( device, CL_DEVICE_OPENCL_C_VERSION, sizeof(c_version), c_version, NULL )) ) { log_error( "FAILURE: unable to get CL_DEVICE_OPENCL_C_VERSION on 1.0 device. (%d)\n", err ); - test_finish(); - return -1; + return EXIT_FAILURE; } if( 0 == strncmp( c_version, "OpenCL C 1.0 ", strlen( "OpenCL C 1.0 " ) ) ) @@ -430,18 +428,28 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def if( (err = clGetDeviceInfo( device, CL_DEVICE_ADDRESS_BITS, sizeof( device_address_bits ), &device_address_bits, NULL ) )) { print_error( err, "Unable to obtain device address bits" ); - test_finish(); - return -1; + return EXIT_FAILURE; } if( device_address_bits ) log_info( "sizeof( void*) = %d (device)\n", device_address_bits/8 ); else { log_error("Invalid device address bit size returned by device.\n"); - test_finish(); - return -1; + return EXIT_FAILURE; + } + if (gCompilationMode == kSpir_v) + { + test_status spirv_readiness = check_spirv_compilation_readiness(device); + if (spirv_readiness != TEST_PASS) + { + switch (spirv_readiness) + { + case TEST_PASS: break; + case TEST_FAIL: return fail_init_info(testNum); + case TEST_SKIP: return skip_init_info(testNum); + } + } } - /* If we have a device checking function, run it */ if( ( deviceCheckFn != NULL ) ) @@ -452,9 +460,9 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def case TEST_PASS: break; case TEST_FAIL: - return 1; + return fail_init_info(testNum); case TEST_SKIP: - return 0; + return skip_init_info(testNum); } } @@ -480,7 +488,7 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def RestoreFPState( &oldMode ); #endif - return error; + return (error == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } static int find_matching_tests( test_definition testList[], unsigned char selectedTestList[], int testNum, @@ -526,7 +534,7 @@ static int find_matching_tests( test_definition testList[], unsigned char select } static int saveResultsToJson( const char *fileName, const char *suiteName, test_definition testList[], - unsigned char selectedTestList[], int resultTestList[], int testNum ) + unsigned char selectedTestList[], test_status resultTestList[], int testNum ) { FILE *file = fopen( fileName, "w" ); if( NULL == file ) @@ -536,7 +544,7 @@ static int saveResultsToJson( const char *fileName, const char *suiteName, test_ } const char *save_map[] = { "success", "failure" }; - const char *result_map[] = { "pass", "fail" }; + const char *result_map[] = { "pass", "fail", "skip" }; const char *linebreak[] = { "", ",\n" }; int add_linebreak = 0; @@ -548,7 +556,7 @@ static int saveResultsToJson( const char *fileName, const char *suiteName, test_ { if( selectedTestList[i] ) { - fprintf( file, "%s\t\t\"%s\": \"%s\"", linebreak[add_linebreak], testList[i].name, result_map[(bool)resultTestList[i]] ); + fprintf( file, "%s\t\t\"%s\": \"%s\"", linebreak[add_linebreak], testList[i].name, result_map[(int)resultTestList[i]] ); add_linebreak = 1; } } @@ -564,6 +572,37 @@ static int saveResultsToJson( const char *fileName, const char *suiteName, test_ return ret; } +static void print_results( int failed, int count, const char* name ) +{ + if( count < failed ) + { + count = failed; + } + + if( failed == 0 ) + { + if( count > 1 ) + { + log_info( "PASSED %d of %d %ss.\n", count, count, name ); + } + else + { + log_info( "PASSED %s.\n", name ); + } + } + else if( failed > 0 ) + { + if( count > 1 ) + { + log_error( "FAILED %d of %d %ss.\n", failed, count, name ); + } + else + { + log_error( "FAILED %s.\n", name ); + } + } +} + int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id device, int testNum, test_definition testList[], int forceNoContextCreation, cl_command_queue_properties queueProps, int num_elements ) @@ -571,7 +610,7 @@ int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id dev int ret = EXIT_SUCCESS; unsigned char *selectedTestList = ( unsigned char* ) calloc( testNum, 1 ); - int *resultTestList = NULL; + test_status *resultTestList = NULL; if( argc == 1 ) { @@ -608,74 +647,39 @@ int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id dev if( ret == EXIT_SUCCESS ) { - resultTestList = ( int* ) calloc( testNum, sizeof(int) ); + resultTestList = ( test_status* ) calloc( testNum, sizeof(*resultTestList) ); - ret = callTestFunctions( testList, selectedTestList, resultTestList, testNum, device, forceNoContextCreation, num_elements, queueProps ); + callTestFunctions( testList, selectedTestList, resultTestList, testNum, device, + forceNoContextCreation, num_elements, queueProps ); - if( gTestsFailed == 0 ) - { - if( gTestsPassed > 1 ) - { - log_info("PASSED %d of %d tests.\n", gTestsPassed, gTestsPassed); - } - else if( gTestsPassed > 0 ) - { - log_info("PASSED test.\n"); - } - } - else if( gTestsFailed > 0 ) - { - if( gTestsFailed+gTestsPassed > 1 ) - { - log_error("FAILED %d of %d tests.\n", gTestsFailed, gTestsFailed+gTestsPassed); - } - else - { - log_error("FAILED test.\n"); - } - } + print_results( gFailCount, gTestCount, "sub-test" ); + print_results( gTestsFailed, gTestsFailed + gTestsPassed, "test" ); char *filename = getenv( "CL_CONFORMANCE_RESULTS_FILENAME" ); if( filename != NULL ) { - ret += saveResultsToJson( filename, argv[0], testList, selectedTestList, resultTestList, testNum ); + ret = saveResultsToJson( filename, argv[0], testList, selectedTestList, resultTestList, testNum ); } } - test_finish(); - free( selectedTestList ); free( resultTestList ); return ret; } -int callTestFunctions( test_definition testList[], unsigned char selectedTestList[], int resultTestList[], - int testNum, cl_device_id deviceToUse, int forceNoContextCreation, int numElementsToUse, - cl_command_queue_properties queueProps ) +void callTestFunctions( test_definition testList[], unsigned char selectedTestList[], test_status resultTestList[], + int testNum, cl_device_id deviceToUse, int forceNoContextCreation, int numElementsToUse, + cl_command_queue_properties queueProps ) { - int totalErrors = 0; - for( int i = 0; i < testNum; ++i ) { if( selectedTestList[i] ) { - // Skip unimplemented test (can happen when you select all of the tests) - if( testList[i].func != NULL ) - { - int errors = callSingleTestFunction( testList[i], deviceToUse, forceNoContextCreation, - numElementsToUse, queueProps ); - resultTestList[i] = errors; - totalErrors += errors; - } - else - { - log_info( "Skipping %s. Test currently not implemented.\n", testList[i].name ); - } + resultTestList[i] = callSingleTestFunction( testList[i], deviceToUse, forceNoContextCreation, + numElementsToUse, queueProps ); } } - - return totalErrors; } void CL_CALLBACK notify_callback(const char *errinfo, const void *private_info, size_t cb, void *user_data) @@ -684,15 +688,25 @@ void CL_CALLBACK notify_callback(const char *errinfo, const void *private_info, } // Actual function execution -int callSingleTestFunction( test_definition test, cl_device_id deviceToUse, int forceNoContextCreation, - int numElementsToUse, const cl_queue_properties queueProps ) +test_status callSingleTestFunction( test_definition test, cl_device_id deviceToUse, int forceNoContextCreation, + int numElementsToUse, const cl_queue_properties queueProps ) { - int numErrors = 0, ret; + test_status status; cl_int error; cl_context context = NULL; cl_command_queue queue = NULL; - const cl_command_queue_properties cmd_queueProps = (queueProps)?CL_QUEUE_PROPERTIES:0; - cl_command_queue_properties queueCreateProps[] = {cmd_queueProps, queueProps, 0}; + + log_info( "%s...\n", test.name ); + fflush( stdout ); + + const Version device_version = get_device_cl_version(deviceToUse); + if (test.min_version > device_version) + { + version_expected_info(test.name, "OpenCL", + test.min_version.to_string().c_str(), + device_version.to_string().c_str()); + return TEST_SKIP; + } /* Create a context to work with, unless we're told not to */ if( !forceNoContextCreation ) @@ -701,45 +715,63 @@ int callSingleTestFunction( test_definition test, cl_device_id deviceToUse, int if (!context) { print_error( error, "Unable to create testing context" ); - return 1; + return TEST_FAIL; + } + + if (device_version < Version(2, 0)) { + queue = clCreateCommandQueue(context, deviceToUse, queueProps, &error); + } else { + const cl_command_queue_properties cmd_queueProps = (queueProps)?CL_QUEUE_PROPERTIES:0; + cl_command_queue_properties queueCreateProps[] = {cmd_queueProps, queueProps, 0}; + queue = clCreateCommandQueueWithProperties( context, deviceToUse, &queueCreateProps[0], &error ); } - queue = clCreateCommandQueueWithProperties( context, deviceToUse, &queueCreateProps[0], &error ); if( queue == NULL ) { print_error( error, "Unable to create testing command queue" ); - return 1; + return TEST_FAIL; } } /* Run the test and print the result */ - log_info( "%s...\n", test.name ); - fflush( stdout ); - - error = check_opencl_version_with_testname(test.name, deviceToUse); - test_missing_feature(error, test.name); - error = check_functions_for_offline_compiler(test.name, deviceToUse); test_missing_support_offline_cmpiler(error, test.name); - ret = test.func(deviceToUse, context, queue, numElementsToUse); //test_threaded_function( ptr_basefn_list[i], group, context, num_elements); - if( ret == TEST_NOT_IMPLEMENTED ) + if( test.func == NULL ) { - /* Tests can also let us know they're not implemented yet */ - log_info("%s test currently not implemented\n\n", test.name); + // Skip unimplemented test, can happen when all of the tests are selected + log_info("%s test currently not implemented\n", test.name); + status = TEST_SKIP; } else { - /* Print result */ - if( ret == 0 ) { - log_info( "%s passed\n", test.name ); - gTestsPassed++; + int ret = test.func(deviceToUse, context, queue, numElementsToUse); //test_threaded_function( ptr_basefn_list[i], group, context, num_elements); + if( ret == TEST_NOT_IMPLEMENTED ) + { + /* Tests can also let us know they're not implemented yet */ + log_info("%s test currently not implemented\n", test.name); + status = TEST_SKIP; + } + else if (ret == TEST_SKIPPED_ITSELF) + { + /* Tests can also let us know they're not supported by the implementation */ + log_info("%s test not supported\n", test.name); + status = TEST_SKIP; } else { - numErrors++; - log_error( "%s FAILED\n", test.name ); - gTestsFailed++; + /* Print result */ + if( ret == 0 ) { + log_info( "%s passed\n", test.name ); + gTestsPassed++; + status = TEST_PASS; + } + else + { + log_error( "%s FAILED\n", test.name ); + gTestsFailed++; + status = TEST_FAIL; + } } } @@ -749,55 +781,13 @@ int callSingleTestFunction( test_definition test, cl_device_id deviceToUse, int int error = clFinish(queue); if (error) { log_error("clFinish failed: %d", error); - numErrors++; + status = TEST_FAIL; } clReleaseCommandQueue( queue ); clReleaseContext( context ); } - return numErrors; -} - -void checkDeviceTypeOverride( cl_device_type *inOutType ) -{ - /* Check if we are forced to CPU mode */ - char *force_cpu = getenv( "CL_DEVICE_TYPE" ); - if( force_cpu != NULL ) - { - if( strcmp( force_cpu, "gpu" ) == 0 || strcmp( force_cpu, "CL_DEVICE_TYPE_GPU" ) == 0 ) - *inOutType = CL_DEVICE_TYPE_GPU; - else if( strcmp( force_cpu, "cpu" ) == 0 || strcmp( force_cpu, "CL_DEVICE_TYPE_CPU" ) == 0 ) - *inOutType = CL_DEVICE_TYPE_CPU; - else if( strcmp( force_cpu, "accelerator" ) == 0 || strcmp( force_cpu, "CL_DEVICE_TYPE_ACCELERATOR" ) == 0 ) - *inOutType = CL_DEVICE_TYPE_ACCELERATOR; - else if( strcmp( force_cpu, "CL_DEVICE_TYPE_DEFAULT" ) == 0 ) - *inOutType = CL_DEVICE_TYPE_DEFAULT; - } - - switch( *inOutType ) - { - case CL_DEVICE_TYPE_GPU: log_info( "Requesting GPU device " ); break; - case CL_DEVICE_TYPE_CPU: log_info( "Requesting CPU device " ); break; - case CL_DEVICE_TYPE_ACCELERATOR: log_info( "Requesting Accelerator device " ); break; - case CL_DEVICE_TYPE_DEFAULT: log_info( "Requesting Default device " ); break; - default: break; - } - log_info( force_cpu != NULL ? "based on environment variable\n" : "based on command line\n" ); - -#if defined( __APPLE__ ) - { - // report on any unusual library search path indirection - char *libSearchPath = getenv( "DYLD_LIBRARY_PATH"); - if( libSearchPath ) - log_info( "*** DYLD_LIBRARY_PATH = \"%s\"\n", libSearchPath ); - - // report on any unusual framework search path indirection - char *frameworkSearchPath = getenv( "DYLD_FRAMEWORK_PATH"); - if( libSearchPath ) - log_info( "*** DYLD_FRAMEWORK_PATH = \"%s\"\n", frameworkSearchPath ); - } -#endif - + return status; } #if ! defined( __APPLE__ ) @@ -891,3 +881,244 @@ cl_device_id GetOpposingDevice( cl_device_id device ) // Should never get here return NULL; } + +Version get_device_cl_version(cl_device_id device) +{ + size_t str_size; + cl_int err = clGetDeviceInfo(device, CL_DEVICE_VERSION, 0, NULL, &str_size); + ASSERT_SUCCESS(err, "clGetDeviceInfo"); + + std::vector str(str_size); + err = clGetDeviceInfo(device, CL_DEVICE_VERSION, str_size, str.data(), NULL); + ASSERT_SUCCESS(err, "clGetDeviceInfo"); + + if (strstr(str.data(), "OpenCL 1.0") != NULL) + return Version(1, 0); + else if (strstr(str.data(), "OpenCL 1.1") != NULL) + return Version(1, 1); + else if (strstr(str.data(), "OpenCL 1.2") != NULL) + return Version(1, 2); + else if (strstr(str.data(), "OpenCL 2.0") != NULL) + return Version(2, 0); + else if (strstr(str.data(), "OpenCL 2.1") != NULL) + return Version(2, 1); + else if (strstr(str.data(), "OpenCL 2.2") != NULL) + return Version(2, 2); + else if (strstr(str.data(), "OpenCL 3.0") != NULL) + return Version(3, 0); + + throw std::runtime_error(std::string("Unknown OpenCL version: ") + str.data()); +} + +bool check_device_spirv_version_reported(cl_device_id device) +{ + size_t str_size; + cl_int err; + std::vector str; + if (gCoreILProgram) + { + err = clGetDeviceInfo(device, CL_DEVICE_IL_VERSION, 0, NULL, &str_size); + if (err != CL_SUCCESS) + { + log_error( + "clGetDeviceInfo: cannot read CL_DEVICE_IL_VERSION size;"); + return false; + } + + str.resize(str_size); + err = clGetDeviceInfo(device, CL_DEVICE_IL_VERSION, str_size, + str.data(), NULL); + if (err != CL_SUCCESS) + { + log_error( + "clGetDeviceInfo: cannot read CL_DEVICE_IL_VERSION value;"); + return false; + } + } + else + { + cl_int err = clGetDeviceInfo(device, CL_DEVICE_IL_VERSION_KHR, 0, NULL, + &str_size); + if (err != CL_SUCCESS) + { + log_error( + "clGetDeviceInfo: cannot read CL_DEVICE_IL_VERSION_KHR size;"); + return false; + } + + str.resize(str_size); + err = clGetDeviceInfo(device, CL_DEVICE_IL_VERSION_KHR, str_size, + str.data(), NULL); + if (err != CL_SUCCESS) + { + log_error( + "clGetDeviceInfo: cannot read CL_DEVICE_IL_VERSION_KHR value;"); + return false; + } + } + + if (strstr(str.data(), "SPIR-V") == NULL) + { + log_info("This device does not support SPIR-V offline compilation.\n"); + return false; + } + else + { + Version spirv_version = get_device_spirv_il_version(device); + log_info("This device supports SPIR-V offline compilation. SPIR-V " + "version is %s\n", + spirv_version.to_string().c_str()); + } + return true; +} + +Version get_device_spirv_il_version(cl_device_id device) +{ + size_t str_size; + cl_int err; + std::vector str; + if (gCoreILProgram) + { + err = clGetDeviceInfo(device, CL_DEVICE_IL_VERSION, 0, NULL, &str_size); + ASSERT_SUCCESS(err, "clGetDeviceInfo"); + + str.resize(str_size); + err = clGetDeviceInfo(device, CL_DEVICE_IL_VERSION, str_size, + str.data(), NULL); + ASSERT_SUCCESS(err, "clGetDeviceInfo"); + } + else + { + err = clGetDeviceInfo(device, CL_DEVICE_IL_VERSION_KHR, 0, NULL, + &str_size); + ASSERT_SUCCESS(err, "clGetDeviceInfo"); + + str.resize(str_size); + err = clGetDeviceInfo(device, CL_DEVICE_IL_VERSION_KHR, str_size, + str.data(), NULL); + ASSERT_SUCCESS(err, "clGetDeviceInfo"); + } + + if (strstr(str.data(), "SPIR-V_1.0") != NULL) + return Version(1, 0); + else if (strstr(str.data(), "SPIR-V_1.1") != NULL) + return Version(1, 1); + else if (strstr(str.data(), "SPIR-V_1.2") != NULL) + return Version(1, 2); + else if (strstr(str.data(), "SPIR-V_1.3") != NULL) + return Version(1, 3); + else if (strstr(str.data(), "SPIR-V_1.4") != NULL) + return Version(1, 4); + else if (strstr(str.data(), "SPIR-V_1.5") != NULL) + return Version(1, 5); + + throw std::runtime_error(std::string("Unknown SPIR-V version: ") + + str.data()); +} + +test_status check_spirv_compilation_readiness(cl_device_id device) +{ + auto ocl_version = get_device_cl_version(device); + auto ocl_expected_min_version = Version(2, 1); + + if (ocl_version < ocl_expected_min_version) + { + if (is_extension_available(device, "cl_khr_il_program")) + { + gCoreILProgram = false; + bool spirv_supported = check_device_spirv_version_reported(device); + if (spirv_supported == false) + { + log_error("SPIR-V intermediate language not supported !!! " + "OpenCL %s requires support.\n", + ocl_version.to_string().c_str()); + return TEST_FAIL; + } + else + { + return TEST_PASS; + } + } + else + { + log_error("SPIR-V intermediate language support on OpenCL version " + "%s requires cl_khr_il_program extension.\n", + ocl_version.to_string().c_str()); + return TEST_SKIP; + } + } + + bool spirv_supported = check_device_spirv_version_reported(device); + if (ocl_version >= ocl_expected_min_version && ocl_version <= Version(2, 2)) + { + if (spirv_supported == false) + { + log_error("SPIR-V intermediate language not supported !!! OpenCL " + "%s requires support.\n", + ocl_version.to_string().c_str()); + return TEST_FAIL; + } + } + + if (ocl_version > Version(2, 2)) + { + if (spirv_supported == false) + { + log_info("SPIR-V intermediate language not supported in OpenCL %s. " + "Test skipped.\n", + ocl_version.to_string().c_str()); + return TEST_SKIP; + } + } + return TEST_PASS; +} + +void PrintArch( void ) +{ + vlog( "sizeof( void*) = %ld\n", sizeof( void *) ); +#if defined( __ppc__ ) + vlog( "ARCH:\tppc\n" ); +#elif defined( __ppc64__ ) + vlog( "ARCH:\tppc64\n" ); +#elif defined( __PPC__ ) + vlog( "ARCH:\tppc\n" ); +#elif defined( __i386__ ) + vlog( "ARCH:\ti386\n" ); +#elif defined( __x86_64__ ) + vlog( "ARCH:\tx86_64\n" ); +#elif defined( __arm__ ) + vlog( "ARCH:\tarm\n" ); +#elif defined(__aarch64__) + vlog( "ARCH:\taarch64\n" ); +#elif defined (_WIN32) + vlog( "ARCH:\tWindows\n" ); +#else +#error unknown arch +#endif + +#if defined( __APPLE__ ) + + int type = 0; + size_t typeSize = sizeof( type ); + sysctlbyname( "hw.cputype", &type, &typeSize, NULL, 0 ); + vlog( "cpu type:\t%d\n", type ); + typeSize = sizeof( type ); + sysctlbyname( "hw.cpusubtype", &type, &typeSize, NULL, 0 ); + vlog( "cpu subtype:\t%d\n", type ); + +#elif defined( __linux__ ) + struct utsname buffer; + + if (uname(&buffer) != 0) { + vlog("uname error"); + } + else { + vlog("system name = %s\n", buffer.sysname); + vlog("node name = %s\n", buffer.nodename); + vlog("release = %s\n", buffer.release); + vlog("version = %s\n", buffer.version); + vlog("machine = %s\n", buffer.machine); + } +#endif +} + diff --git a/test_common/harness/testHarness.h b/test_common/harness/testHarness.h index 6609f064..d01c81ba 100644 --- a/test_common/harness/testHarness.h +++ b/test_common/harness/testHarness.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 The Khronos Group Inc. +// Copyright (c) 2017-2019 The Khronos Group Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,15 +18,48 @@ #include "threadTesting.h" #include "clImageHelper.h" +#include +#include #include -#ifdef __cplusplus -extern "C" { -#endif +class Version +{ +public: + Version() : m_major(0), m_minor(0) {} + Version(int major, int minor) : m_major(major), m_minor(minor) {} + bool operator>(const Version& rhs) const { return to_int() > rhs.to_int(); } + bool operator<(const Version& rhs) const { return to_int() < rhs.to_int(); } + bool operator<=(const Version& rhs) const { return to_int() <= rhs.to_int(); } + bool operator>=(const Version& rhs) const { return to_int() >= rhs.to_int(); } + bool operator==(const Version& rhs) const { return to_int() == rhs.to_int(); } + int to_int() const { return m_major * 10 + m_minor; } + std::string to_string() const + { + std::stringstream ss; + ss << m_major << "." << m_minor; + return ss.str(); + } -#define ADD_TEST(fn) {test_##fn, #fn} -#define NOT_IMPLEMENTED_TEST(fn) {NULL, #fn} +private: + int m_major; + int m_minor; +}; + +Version get_device_cl_version(cl_device_id device); + +#define ADD_TEST(fn) \ + { \ + test_##fn, #fn, Version(1, 0) \ + } +#define ADD_TEST_VERSION(fn, ver) \ + { \ + test_##fn, #fn, ver \ + } +#define NOT_IMPLEMENTED_TEST(fn) \ + { \ + NULL, #fn, Version(0, 0) \ + } #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) @@ -34,6 +67,7 @@ typedef struct test_definition { basefn func; const char* name; + Version min_version; } test_definition; @@ -44,11 +78,15 @@ typedef enum test_status TEST_SKIP = 2, } test_status; +extern int gFailCount; +extern int gTestCount; extern cl_uint gReSeed; extern cl_uint gRandomSeed; // Supply a list of functions to test here. This will allocate a CL device, create a context, all that // setup work, and then call each function in turn as dictatated by the passed arguments. +// Returns EXIT_SUCCESS iff all tests succeeded or the tests were listed, +// otherwise return EXIT_FAILURE. extern int runTestHarness( int argc, const char *argv[], int testNum, test_definition testList[], int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps ); @@ -56,9 +94,11 @@ extern int runTestHarness( int argc, const char *argv[], int testNum, test_defin typedef test_status (*DeviceCheckFn)( cl_device_id device ); // Same as runTestHarness, but also supplies a function that checks the created device for required functionality. +// Returns EXIT_SUCCESS iff all tests succeeded or the tests were listed, +// otherwise return EXIT_FAILURE. extern int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_definition testList[], - int imageSupportRequired, int forceNoContextCreation, - cl_command_queue_properties queueProps, DeviceCheckFn deviceCheckFn ); + int forceNoContextCreation, cl_command_queue_properties queueProps, + DeviceCheckFn deviceCheckFn ); // The command line parser used by runTestHarness to break up parameters into calls to callTestFunctions extern int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id device, int testNum, @@ -70,24 +110,20 @@ extern int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device // testList is the data structure that contains test functions and its names // selectedTestList is an array of integers (treated as bools) which tell which function is to be called, // each element at index i, corresponds to the element in testList at index i -// resultTestList is an array of integers which contains the result of each selected test +// resultTestList is an array of statuses which contain the result of each selected test // testNum is the number of tests in testList, selectedTestList and resultTestList // contextProps are used to create a testing context for each test // deviceToUse and numElementsToUse are all just passed to each test function -extern int callTestFunctions( test_definition testList[], unsigned char selectedTestList[], int resultTestList[], - int testNum, cl_device_id deviceToUse, int forceNoContextCreation, int numElementsToUse, - cl_command_queue_properties queueProps ); +extern void callTestFunctions( test_definition testList[], unsigned char selectedTestList[], test_status resultTestList[], + int testNum, cl_device_id deviceToUse, int forceNoContextCreation, int numElementsToUse, + cl_command_queue_properties queueProps ); // This function is called by callTestFunctions, once per function, to do setup, call, logging and cleanup -extern int callSingleTestFunction( test_definition test, cl_device_id deviceToUse, int forceNoContextCreation, - int numElementsToUse, cl_command_queue_properties queueProps ); +extern test_status callSingleTestFunction( test_definition test, cl_device_id deviceToUse, int forceNoContextCreation, + int numElementsToUse, cl_command_queue_properties queueProps ); ///// Miscellaneous steps -// Given a pre-existing device type choice, check the environment for an override, then print what -// choice was made and how (and return the overridden choice, if there is one) -extern void checkDeviceTypeOverride( cl_device_type *inOutType ); - // standard callback function for context pfn_notify extern void CL_CALLBACK notify_callback(const char *errinfo, const void *private_info, size_t cb, void *user_data); @@ -99,20 +135,27 @@ extern cl_device_type GetDeviceType( cl_device_id ); // is the only device available, the SAME device is returned, so check! extern cl_device_id GetOpposingDevice( cl_device_id device ); +Version get_device_spirv_il_version(cl_device_id device); +bool check_device_spirv_il_support(cl_device_id device); +void version_expected_info(const char *test_name, const char *api_name, + const char *expected_version, + const char *device_version); +test_status check_spirv_compilation_readiness(cl_device_id device); + extern int gFlushDenormsToZero; // This is set to 1 if the device does not support denorms (CL_FP_DENORM) extern int gInfNanSupport; // This is set to 1 if the device supports infinities and NaNs extern int gIsEmbedded; // This is set to 1 if the device is an embedded device extern int gHasLong; // This is set to 1 if the device suppots long and ulong types in OpenCL C. extern int gIsOpenCL_C_1_0_Device; // This is set to 1 if the device supports only OpenCL C 1.0. +extern bool gCoreILProgram; #if ! defined( __APPLE__ ) void memset_pattern4(void *, const void *, size_t); #endif -#ifdef __cplusplus -} -#endif +extern void PrintArch(void); + #endif // _testHarness_h diff --git a/test_common/harness/threadTesting.c b/test_common/harness/threadTesting.cpp similarity index 100% rename from test_common/harness/threadTesting.c rename to test_common/harness/threadTesting.cpp diff --git a/test_common/harness/threadTesting.h b/test_common/harness/threadTesting.h index 81a5757b..71d57973 100644 --- a/test_common/harness/threadTesting.h +++ b/test_common/harness/threadTesting.h @@ -23,6 +23,7 @@ #endif #define TEST_NOT_IMPLEMENTED -99 +#define TEST_SKIPPED_ITSELF -100 typedef int (*basefn)(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_threaded_function( basefn fnToTest, cl_device_id device, cl_context context, cl_command_queue queue, int numElements ); diff --git a/test_common/harness/typeWrappers.cpp b/test_common/harness/typeWrappers.cpp index d4e08fb9..c2fa5f64 100644 --- a/test_common/harness/typeWrappers.cpp +++ b/test_common/harness/typeWrappers.cpp @@ -390,7 +390,8 @@ cl_int clProtectedImage::Create( cl_context context, cl_mem_object_type imageTyp image = create_image_2d( context, mem_flags, fmt, width, height, 0, NULL, &error ); break; case CL_MEM_OBJECT_IMAGE3D: - image = create_image_3d( context, mem_flags, fmt, width, height, depth, 0, 0, NULL, &error );; + image = create_image_3d(context, mem_flags, fmt, width, height, + depth, 0, 0, NULL, &error); break; case CL_MEM_OBJECT_IMAGE1D_ARRAY: image = create_image_1d_array( context, mem_flags, fmt, width, arraySize, 0, 0, NULL, &error ); @@ -413,7 +414,8 @@ cl_int clProtectedImage::Create( cl_context context, cl_mem_object_type imageTyp image = create_image_2d( context, mem_flags, fmt, width, height, 0, NULL, &error ); break; case CL_MEM_OBJECT_IMAGE3D: - image = create_image_3d( context, mem_flags, fmt, width, height, depth, 0, 0, NULL, &error );; + image = create_image_3d(context, mem_flags, fmt, width, height, + depth, 0, 0, NULL, &error); break; case CL_MEM_OBJECT_IMAGE1D_ARRAY: image = create_image_1d_array( context, mem_flags, fmt, width, arraySize, 0, 0, NULL, &error ); diff --git a/test_common/harness/typeWrappers.h b/test_common/harness/typeWrappers.h index d767a99d..384493ff 100644 --- a/test_common/harness/typeWrappers.h +++ b/test_common/harness/typeWrappers.h @@ -29,9 +29,6 @@ #include "errorHelpers.h" #include "kernelHelpers.h" -extern "C" cl_uint gReSeed; -extern "C" cl_uint gRandomSeed; - /* cl_context wrapper */ class clContextWrapper diff --git a/test_conformance/CMakeCommon.txt b/test_conformance/CMakeCommon.txt index 62c339d7..0beaedc2 100644 --- a/test_conformance/CMakeCommon.txt +++ b/test_conformance/CMakeCommon.txt @@ -1,13 +1,9 @@ -set_source_files_properties(COMPILE_FLAGS -msse2) - string(TOLOWER ${MODULE_NAME} MODULE_NAME_LOWER) set(${MODULE_NAME}_OUT ${CONFORMANCE_PREFIX}${MODULE_NAME_LOWER}${CONFORMANCE_SUFFIX}) add_executable(${${MODULE_NAME}_OUT} ${${MODULE_NAME}_SOURCES}) -set_source_files_properties(${${MODULE_NAME}_SOURCES} PROPERTIES LANGUAGE CXX) - set_property(TARGET ${${MODULE_NAME}_OUT} PROPERTY FOLDER "CONFORMANCE${CONFORMANCE_SUFFIX}") -TARGET_LINK_LIBRARIES(${${MODULE_NAME}_OUT} ${CLConform_LIBRARIES}) +TARGET_LINK_LIBRARIES(${${MODULE_NAME}_OUT} ${HARNESS_LIB} ${CLConform_LIBRARIES}) diff --git a/test_conformance/CMakeLists.txt b/test_conformance/CMakeLists.txt index deb9d2ff..83d18ea1 100644 --- a/test_conformance/CMakeLists.txt +++ b/test_conformance/CMakeLists.txt @@ -1,13 +1,14 @@ # Remember current source directory (`test_conformance'). set( CLConf_Install_Base_Dir "${CMAKE_CURRENT_SOURCE_DIR}" ) +set(HARNESS_LIB harness) + add_subdirectory( allocations ) add_subdirectory( api ) add_subdirectory( atomics ) add_subdirectory( basic ) add_subdirectory( buffers ) add_subdirectory( commonfns ) -add_subdirectory( compatibility ) add_subdirectory( compiler ) add_subdirectory( computeinfo ) add_subdirectory( contractions ) @@ -28,7 +29,6 @@ if(GLES_IS_SUPPORTED) add_subdirectory(gles) endif(GLES_IS_SUPPORTED) add_subdirectory( half ) -add_subdirectory( headers ) add_subdirectory( images ) add_subdirectory( integer_ops ) add_subdirectory( math_brute_force ) @@ -39,8 +39,7 @@ add_subdirectory( profiling ) add_subdirectory( relationals ) add_subdirectory( select ) add_subdirectory( thread_dimensions ) -add_subdirectory( vec_align ) -add_subdirectory( vec_step ) +add_subdirectory( vectors ) add_subdirectory( c11_atomics ) add_subdirectory( device_execution ) add_subdirectory( non_uniform_work_group ) @@ -51,26 +50,17 @@ add_subdirectory( workgroups ) add_subdirectory( pipes ) add_subdirectory( device_timer ) add_subdirectory( clcpp ) +add_subdirectory( spirv_new ) +add_subdirectory( spir ) -set(CSV_FILES - opencl_conformance_tests_21_full_spirv.csv - opencl_conformance_tests_21_legacy_wimpy.csv - opencl_conformance_tests_22.csv - opencl_conformance_tests_generate_spirv.csv - opencl_conformance_tests_conversions.csv - opencl_conformance_tests_d3d.csv - opencl_conformance_tests_full.csv - opencl_conformance_tests_full_no_math_or_conversions.csv - opencl_conformance_tests_math.csv - opencl_conformance_tests_quick.csv -) -set(PY_FILES - run_conformance.py -) +file(GLOB CSV_FILES "opencl_conformance_tests_*.csv") + +set(PY_FILES run_conformance.py) # Copy .csv files foreach(FILE ${CSV_FILES}) - configure_file(${FILE} ${FILE} COPYONLY) + get_filename_component(strippedName ${FILE} NAME) + configure_file(${strippedName} ${strippedName} COPYONLY) endforeach() # Copy test run script @@ -89,4 +79,4 @@ foreach(FILE ${PY_FILES}) endforeach() foreach(FILE test_conformance/${PY_FILES}) -endforeach() \ No newline at end of file +endforeach() diff --git a/test_conformance/SVM/CMakeLists.txt b/test_conformance/SVM/CMakeLists.txt index 4077c417..c56cc57a 100644 --- a/test_conformance/SVM/CMakeLists.txt +++ b/test_conformance/SVM/CMakeLists.txt @@ -16,13 +16,6 @@ set(${MODULE_NAME}_SOURCES test_shared_address_space_fine_grain_buffers.cpp test_shared_sub_buffers.cpp test_migrate.cpp - ../../test_common/harness/testHarness.c - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/mt19937.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c ) include(../CMakeCommon.txt) diff --git a/test_conformance/SVM/common.h b/test_conformance/SVM/common.h index 868f9c57..ab99b7ec 100644 --- a/test_conformance/SVM/common.h +++ b/test_conformance/SVM/common.h @@ -16,11 +16,13 @@ #ifndef __COMMON_H__ #define __COMMON_H__ -#include "../../test_common/harness/compat.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/compat.h" +#include "harness/testHarness.h" +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" +#include "harness/typeWrappers.h" +#include +#include #if (defined(_WIN32) || defined(_WIN64)) && defined(_MSC_VER) #include @@ -44,7 +46,8 @@ bool AtomicCompareExchangeStrongExplicit(volatile T *a, T *expected, T desired, { T tmp; #if defined( _MSC_VER ) || (defined( __INTEL_COMPILER ) && defined(WIN32)) - tmp = (T)InterlockedCompareExchange((volatile LONG *)a, (LONG)desired, *(LONG *)expected); + tmp = (sizeof(void*) == 8) ? (T)InterlockedCompareExchange64((volatile LONG64 *)a, (LONG64)desired, *(LONG64 *)expected) : + (T)InterlockedCompareExchange((volatile LONG*)a, (LONG)desired, *(LONG*)expected); #elif defined(__GNUC__) tmp = (T)__sync_val_compare_and_swap((volatile intptr_t*)a, (intptr_t)(*expected), (intptr_t)desired); #else @@ -93,7 +96,7 @@ extern int test_svm_shared_sub_buffers(cl_device_id deviceID, cl_context cont extern int test_svm_enqueue_api(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_svm_migrate(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern cl_int create_cl_objects(cl_device_id device_from_harness, const char** ppCodeString, cl_context* context, cl_program *program, cl_command_queue *queues, cl_uint *num_devices, cl_device_svm_capabilities required_svm_caps); +extern cl_int create_cl_objects(cl_device_id device_from_harness, const char** ppCodeString, cl_context* context, cl_program *program, cl_command_queue *queues, cl_uint *num_devices, cl_device_svm_capabilities required_svm_caps, std::vector extensions_list = std::vector()); extern const char *linked_list_create_and_verify_kernels[]; diff --git a/test_conformance/SVM/main.cpp b/test_conformance/SVM/main.cpp index 7858bf49..0a052f05 100644 --- a/test_conformance/SVM/main.cpp +++ b/test_conformance/SVM/main.cpp @@ -13,13 +13,13 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include #include -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/kernelHelpers.h" +#include "harness/testHarness.h" +#include "harness/kernelHelpers.h" #include "common.h" @@ -168,7 +168,7 @@ cl_int verify_linked_lists(Node* pNodes, size_t num_lists, int list_length) // Note that we don't use the context provided by the test harness since it doesn't support multiple devices, // so we create are own context here that has all devices, we use the same platform that the harness used. -cl_int create_cl_objects(cl_device_id device_from_harness, const char** ppCodeString, cl_context* context, cl_program *program, cl_command_queue *queues, cl_uint *num_devices, cl_device_svm_capabilities required_svm_caps) +cl_int create_cl_objects(cl_device_id device_from_harness, const char** ppCodeString, cl_context* context, cl_program *program, cl_command_queue *queues, cl_uint *num_devices, cl_device_svm_capabilities required_svm_caps, std::vector extensions_list) { cl_int error; @@ -198,30 +198,9 @@ cl_int create_cl_objects(cl_device_id device_from_harness, const char** ppCodeSt cl_uint num_capable_devices = 0; for(cl_uint i = 0; i < *num_devices; i++) { - size_t ret_len = 0; - error = clGetDeviceInfo(devices[i], CL_DEVICE_VERSION, 0, 0, &ret_len); - if (error != CL_SUCCESS) - { - log_error("clGetDeviceInfo failed %s\n", IGetErrorString(error)); - return -1; - } + Version version = get_device_cl_version(devices[i]); - std::vector oclVersion(ret_len + 1); - error = clGetDeviceInfo(devices[i], CL_DEVICE_VERSION, sizeof(char) * oclVersion.size(), &oclVersion[0], 0); - if (error != CL_SUCCESS) - { - log_error("clGetDeviceInfo failed %s\n", IGetErrorString(error)); - return -1; - } - - std::string versionStr(&oclVersion[7]); - std::stringstream stream; - stream << versionStr; - - double version = 0.0; - stream >> version; - - if(device_from_harness != devices[i] && version < 2.0) + if(device_from_harness != devices[i] && version < Version(2,0)) { continue; } @@ -233,7 +212,17 @@ cl_int create_cl_objects(cl_device_id device_from_harness, const char** ppCodeSt log_error("clGetDeviceInfo returned an invalid cl_device_svm_capabilities value"); return -1; } - if((caps & required_svm_caps) == required_svm_caps) + bool extensions_supported = true; + for (auto extension : extensions_list) + { + if (!is_extension_available(devices[i], extension.c_str())) + { + log_error("Required extension not found - device id %d - %s\n", i, extension.c_str()); + extensions_supported = false; + break; + } + } + if((caps & required_svm_caps) == required_svm_caps && extensions_supported) { capable_devices.push_back(devices[i]); ++num_capable_devices; @@ -244,11 +233,11 @@ cl_int create_cl_objects(cl_device_id device_from_harness, const char** ppCodeSt if(num_capable_devices == 0) // if(svm_level > CL_DEVICE_COARSE_SVM && 0 == num_capable_devices) { - log_info("Requested SVM level not supported by any device on this platform, test not executed.\n"); + log_info("Requested SVM level or required extensions not supported by any device on this platform, test not executed.\n"); return 1; // 1 indicates do not execute, but counts as passing. } - cl_context_properties context_properties[3] = {CL_CONTEXT_PLATFORM, (cl_context_properties)platform_id, NULL }; + cl_context_properties context_properties[3] = {CL_CONTEXT_PLATFORM, (cl_context_properties)platform_id, 0 }; *context = clCreateContext(context_properties, *num_devices, &devices[0], NULL, NULL, &error); test_error(error, "Unable to create context" ); @@ -270,7 +259,7 @@ cl_int create_cl_objects(cl_device_id device_from_harness, const char** ppCodeSt } test_definition test_list[] = { - ADD_TEST( svm_byte_granularity ), + ADD_TEST( svm_byte_granularity), ADD_TEST( svm_set_kernel_exec_info_svm_ptrs ), ADD_TEST( svm_fine_grain_memory_consistency ), ADD_TEST( svm_fine_grain_sync_buffers ), @@ -283,13 +272,41 @@ test_definition test_list[] = { ADD_TEST( svm_cross_buffer_pointers_coarse_grain ), ADD_TEST( svm_pointer_passing ), ADD_TEST( svm_enqueue_api ), - ADD_TEST( svm_migrate ), + ADD_TEST_VERSION( svm_migrate, Version(2, 1)), }; const int test_num = ARRAY_SIZE( test_list ); -int main(int argc, const char *argv[]) -{ - return runTestHarness( argc, argv, test_num, test_list, false, true, 0 ); +test_status InitCL(cl_device_id device) { + auto version = get_device_cl_version(device); + auto expected_min_version = Version(2, 0); + if (version < expected_min_version) + { + version_expected_info("Test", "OpenCL", + expected_min_version.to_string().c_str(), + version.to_string().c_str()); + return TEST_SKIP; + } + + int error; + cl_device_svm_capabilities svm_caps; + error = clGetDeviceInfo(device, CL_DEVICE_SVM_CAPABILITIES, + sizeof(svm_caps), &svm_caps, NULL); + if (error != CL_SUCCESS) { + print_error(error, "Unable to get svm capabilities"); + return TEST_FAIL; + } + + if ((svm_caps == 0) && (version >= Version(3, 0))) + { + return TEST_SKIP; + } + + return TEST_PASS; +} + +int main(int argc, const char *argv[]) +{ + return runTestHarnessWithCheck(argc, argv, test_num, test_list, true, 0, InitCL); } diff --git a/test_conformance/SVM/test_enqueue_api.cpp b/test_conformance/SVM/test_enqueue_api.cpp index 0f778cdc..2b39f9e8 100644 --- a/test_conformance/SVM/test_enqueue_api.cpp +++ b/test_conformance/SVM/test_enqueue_api.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -14,14 +14,14 @@ // limitations under the License. // #include "common.h" -#include "../../test_common/harness/mt19937.h" +#include "harness/mt19937.h" #include #include #if !defined(_WIN32) #include -#endif +#endif typedef struct { @@ -81,7 +81,7 @@ int test_svm_enqueue_api(cl_device_id deviceID, cl_context c, cl_command_queue q RandomSeed seed(0); error = create_cl_objects(deviceID, NULL, &context, NULL, &queues[0], &num_devices, CL_DEVICE_SVM_COARSE_GRAIN_BUFFER); - if(error) return -1; + if(error) return TEST_FAIL; queue = queues[0]; @@ -113,115 +113,163 @@ int test_svm_enqueue_api(cl_device_id deviceID, cl_context c, cl_command_queue q sizeof(cl_ulong16), }; - for (size_t i = 0; i < ( sizeof(typeSizes) / sizeof(typeSizes[0]) ); ++i) + enum allocationTypes { + host, + svm + }; + + struct TestType { + allocationTypes srcAlloc; + allocationTypes dstAlloc; + TestType(allocationTypes type1, allocationTypes type2): srcAlloc(type1), dstAlloc(type2){} + }; + + std::vector testTypes; + + testTypes.push_back(TestType(host, host)); + testTypes.push_back(TestType(host, svm)); + testTypes.push_back(TestType(svm, host)); + testTypes.push_back(TestType(svm, svm)); + + for (const auto test_case : testTypes) { - //generate initial data - std::vector fillData0(typeSizes[i]), fillData1(typeSizes[i], 0), fillData2(typeSizes[i]); - generate_data(fillData0, typeSizes[i], seed); - generate_data(fillData2, typeSizes[i], seed); - - cl_uchar *srcBuffer = (cl_uchar *)clSVMAlloc(context, CL_MEM_READ_WRITE, elementNum * typeSizes[i], 0); - cl_uchar *dstBuffer = (cl_uchar *)clSVMAlloc(context, CL_MEM_READ_WRITE, elementNum * typeSizes[i], 0); - - clEventWrapper userEvent = clCreateUserEvent(context, &error); - test_error(error, "clCreateUserEvent failed"); - - clEventWrapper eventMemFill; - error = clEnqueueSVMMemFill(queue, srcBuffer, &fillData0[0], typeSizes[i], elementNum * typeSizes[i], 1, &userEvent, &eventMemFill); - test_error(error, "clEnqueueSVMMemFill failed"); - - clEventWrapper eventMemcpy; - error = clEnqueueSVMMemcpy(queue, CL_FALSE, dstBuffer, srcBuffer, elementNum * typeSizes[i], 1, &eventMemFill, &eventMemcpy); - test_error(error, "clEnqueueSVMMemcpy failed"); - - error = clSetUserEventStatus(userEvent, CL_COMPLETE); - test_error(error, "clSetUserEventStatus failed"); - - clEventWrapper eventMap; - error = clEnqueueSVMMap(queue, CL_FALSE, CL_MAP_READ | CL_MAP_WRITE, dstBuffer, elementNum * typeSizes[i], 1, &eventMemcpy, &eventMap); - test_error(error, "clEnqueueSVMMap failed"); - - error = clWaitForEvents(1, &eventMap); - test_error(error, "clWaitForEvents failed"); - - //data verification - for (size_t j = 0; j < elementNum * typeSizes[i]; ++j) + log_info("clEnqueueSVMMemcpy case: src_alloc = %s, dst_alloc = %s\n", test_case.srcAlloc == svm ? "svm" : "host", test_case.dstAlloc == svm ? "svm" : "host"); + for (size_t i = 0; i < ARRAY_SIZE(typeSizes); ++i) { - if (dstBuffer[j] != fillData0[j % typeSizes[i]]) + //generate initial data + std::vector fillData0(typeSizes[i]), fillData1(typeSizes[i]); + generate_data(fillData0, typeSizes[i], seed); + generate_data(fillData1, typeSizes[i], seed); + size_t data_size = elementNum * typeSizes[i]; + std::vector srcHostData(data_size, 0); + std::vector dstHostData(data_size, 0); + generate_data(srcHostData, srcHostData.size(), seed); + generate_data(dstHostData, dstHostData.size(), seed); + + cl_uchar *srcBuffer = (cl_uchar *)clSVMAlloc(context, CL_MEM_READ_WRITE, data_size, 0); + cl_uchar *dstBuffer = (cl_uchar *)clSVMAlloc(context, CL_MEM_READ_WRITE, data_size, 0); + + clEventWrapper userEvent = clCreateUserEvent(context, &error); + test_error(error, "clCreateUserEvent failed"); + clEventWrapper eventMemFillList[2]; + + error = clEnqueueSVMMemFill(queue, srcBuffer, &fillData0[0], typeSizes[i], data_size, 1, &userEvent, &eventMemFillList[0]); + test_error(error, "clEnqueueSVMMemFill failed"); + error = clEnqueueSVMMemFill(queue, dstBuffer, &fillData1[0], typeSizes[i], data_size, 1, &userEvent, &eventMemFillList[1]); + test_error(error, "clEnqueueSVMMemFill failed"); + + error = clSetUserEventStatus(userEvent, CL_COMPLETE); + test_error(error, "clSetUserEventStatus failed"); + + cl_uchar * src_ptr; + cl_uchar * dst_ptr; + if (test_case.srcAlloc == host) { + src_ptr = srcHostData.data(); + } else if (test_case.srcAlloc == svm) { + src_ptr = srcBuffer; + } + if (test_case.dstAlloc == host) { + dst_ptr = dstHostData.data(); + } else if (test_case.dstAlloc == svm) { + dst_ptr = dstBuffer; + } + clEventWrapper eventMemcpy; + error = clEnqueueSVMMemcpy(queue, CL_FALSE, dst_ptr, src_ptr, data_size, 2, &eventMemFillList[0], &eventMemcpy); + test_error(error, "clEnqueueSVMMemcpy failed"); + + //coarse grain only supported. Synchronization required using map + clEventWrapper eventMap[2]; + + error = clEnqueueSVMMap(queue, CL_FALSE, CL_MAP_READ, srcBuffer, data_size, 1, &eventMemcpy, &eventMap[0]); + test_error(error, "clEnqueueSVMMap srcBuffer failed"); + + error = clEnqueueSVMMap(queue, CL_FALSE, CL_MAP_READ, dstBuffer, data_size, 1, &eventMemcpy, &eventMap[1]); + test_error(error, "clEnqueueSVMMap dstBuffer failed"); + + error = clWaitForEvents(2, &eventMap[0]); + test_error(error, "clWaitForEvents failed"); + + //data verification + for (size_t j = 0; j < data_size; ++j) { - log_error("Invalid data at index %ld, expected %d, got %d\n", j, fillData0[j % typeSizes[i]], dstBuffer[j]); - return -1; + if (dst_ptr[j] != src_ptr[j]) { + log_error("Invalid data at index %ld, dst_ptr %d, src_ptr %d\n", j, dst_ptr[j], src_ptr[j]); + return TEST_FAIL; + } + } + clEventWrapper eventUnmap[2]; + error = clEnqueueSVMUnmap(queue, srcBuffer, 0, nullptr, &eventUnmap[0]); + test_error(error, "clEnqueueSVMUnmap srcBuffer failed"); + + error = clEnqueueSVMUnmap(queue, dstBuffer, 0, nullptr, &eventUnmap[1]); + test_error(error, "clEnqueueSVMUnmap dstBuffer failed"); + + error = clEnqueueSVMMemFill(queue, srcBuffer, &fillData1[0], typeSizes[i], data_size / 2, 0, 0, 0); + test_error(error, "clEnqueueSVMMemFill failed"); + + error = clEnqueueSVMMemFill(queue, dstBuffer + data_size / 2, &fillData1[0], typeSizes[i], data_size / 2, 0, 0, 0); + test_error(error, "clEnqueueSVMMemFill failed"); + + error = clEnqueueSVMMemcpy(queue, CL_FALSE, dstBuffer, srcBuffer, data_size / 2, 0, 0, 0); + test_error(error, "clEnqueueSVMMemcpy failed"); + + error = clEnqueueSVMMemcpy(queue, CL_TRUE, dstBuffer + data_size / 2, srcBuffer + data_size / 2, data_size / 2, 0, 0, 0); + test_error(error, "clEnqueueSVMMemcpy failed"); + + void *ptrs[] = { (void *)srcBuffer, (void *)dstBuffer }; + + clEventWrapper eventFree; + error = clEnqueueSVMFree(queue, 2, ptrs, 0, 0, 0, 0, &eventFree); + test_error(error, "clEnqueueSVMFree failed"); + + error = clWaitForEvents(1, &eventFree); + test_error(error, "clWaitForEvents failed"); + + //event info verification for new SVM commands + cl_command_type commandType; + for (auto &check_event : eventMemFillList) { + error = clGetEventInfo(check_event, CL_EVENT_COMMAND_TYPE, sizeof(cl_command_type), &commandType, NULL); + test_error(error, "clGetEventInfo failed"); + if (commandType != CL_COMMAND_SVM_MEMFILL) + { + log_error("Invalid command type returned for clEnqueueSVMMemFill\n"); + return TEST_FAIL; + } + } + + error = clGetEventInfo(eventMemcpy, CL_EVENT_COMMAND_TYPE, sizeof(cl_command_type), &commandType, NULL); + test_error(error, "clGetEventInfo failed"); + if (commandType != CL_COMMAND_SVM_MEMCPY) + { + log_error("Invalid command type returned for clEnqueueSVMMemcpy\n"); + return TEST_FAIL; + } + for (size_t map_id = 0; map_id < ARRAY_SIZE(eventMap); map_id++) { + error = clGetEventInfo(eventMap[map_id], CL_EVENT_COMMAND_TYPE, sizeof(cl_command_type), &commandType, NULL); + test_error(error, "clGetEventInfo failed"); + if (commandType != CL_COMMAND_SVM_MAP) + { + log_error("Invalid command type returned for clEnqueueSVMMap\n"); + return TEST_FAIL; + } + + error = clGetEventInfo(eventUnmap[map_id], CL_EVENT_COMMAND_TYPE, sizeof(cl_command_type), &commandType, NULL); + test_error(error, "clGetEventInfo failed"); + if (commandType != CL_COMMAND_SVM_UNMAP) + { + log_error("Invalid command type returned for clEnqueueSVMUnmap\n"); + return TEST_FAIL; + } + } + error = clGetEventInfo(eventFree, CL_EVENT_COMMAND_TYPE, sizeof(cl_command_type), &commandType, NULL); + test_error(error, "clGetEventInfo failed"); + if (commandType != CL_COMMAND_SVM_FREE) + { + log_error("Invalid command type returned for clEnqueueSVMFree\n"); + return TEST_FAIL; } } - - clEventWrapper eventUnmap; - error = clEnqueueSVMUnmap(queue, dstBuffer, 0, 0, &eventUnmap); - test_error(error, "clEnqueueSVMUnmap failed"); - - error = clEnqueueSVMMemFill(queue, srcBuffer, &fillData2[0], typeSizes[i], elementNum * typeSizes[i] / 2, 0, 0, 0); - test_error(error, "clEnqueueSVMMemFill failed"); - - error = clEnqueueSVMMemFill(queue, dstBuffer + elementNum * typeSizes[i] / 2, &fillData2[0], typeSizes[i], elementNum * typeSizes[i] / 2, 0, 0, 0); - test_error(error, "clEnqueueSVMMemFill failed"); - - error = clEnqueueSVMMemcpy(queue, CL_FALSE, dstBuffer, srcBuffer, elementNum * typeSizes[i] / 2, 0, 0, 0); - test_error(error, "clEnqueueSVMMemcpy failed"); - - error = clEnqueueSVMMemcpy(queue, CL_TRUE, dstBuffer + elementNum * typeSizes[i] / 2, srcBuffer + elementNum * typeSizes[i] / 2, elementNum * typeSizes[i] / 2, 0, 0, 0); - test_error(error, "clEnqueueSVMMemcpy failed"); - - void *ptrs[] = {(void *)srcBuffer, (void *)dstBuffer}; - - clEventWrapper eventFree; - error = clEnqueueSVMFree(queue, 2, ptrs, 0, 0, 0, 0, &eventFree); - test_error(error, "clEnqueueSVMFree failed"); - - error = clWaitForEvents(1, &eventFree); - test_error(error, "clWaitForEvents failed"); - - //event info verification for new SVM commands - cl_command_type commandType; - error = clGetEventInfo(eventMemFill, CL_EVENT_COMMAND_TYPE, sizeof(cl_command_type), &commandType, NULL); - test_error(error, "clGetEventInfo failed"); - if (commandType != CL_COMMAND_SVM_MEMFILL) - { - log_error("Invalid command type returned for clEnqueueSVMMemFill\n"); - return -1; - } - - error = clGetEventInfo(eventMemcpy, CL_EVENT_COMMAND_TYPE, sizeof(cl_command_type), &commandType, NULL); - test_error(error, "clGetEventInfo failed"); - if (commandType != CL_COMMAND_SVM_MEMCPY) - { - log_error("Invalid command type returned for clEnqueueSVMMemcpy\n"); - return -1; - } - - error = clGetEventInfo(eventMap, CL_EVENT_COMMAND_TYPE, sizeof(cl_command_type), &commandType, NULL); - test_error(error, "clGetEventInfo failed"); - if (commandType != CL_COMMAND_SVM_MAP) - { - log_error("Invalid command type returned for clEnqueueSVMMap\n"); - return -1; - } - - error = clGetEventInfo(eventUnmap, CL_EVENT_COMMAND_TYPE, sizeof(cl_command_type), &commandType, NULL); - test_error(error, "clGetEventInfo failed"); - if (commandType != CL_COMMAND_SVM_UNMAP) - { - log_error("Invalid command type returned for clEnqueueSVMUnmap\n"); - return -1; - } - - error = clGetEventInfo(eventFree, CL_EVENT_COMMAND_TYPE, sizeof(cl_command_type), &commandType, NULL); - test_error(error, "clGetEventInfo failed"); - if (commandType != CL_COMMAND_SVM_FREE) - { - log_error("Invalid command type returned for clEnqueueSVMFree\n"); - return -1; - } } - std::vector buffers(numSVMBuffers, 0); for(size_t i = 0; i < numSVMBuffers; ++i) buffers[i] = clSVMAlloc(context, CL_MEM_READ_WRITE, elementNum, 0); @@ -236,7 +284,7 @@ int test_svm_enqueue_api(cl_device_id deviceID, cl_context c, cl_command_queue q test_error(error, "clFinish failed"); //wait for the callback - while(data.status.load(std::memory_order_acquire) == 0) { + while(data.status.load(std::memory_order_acquire) == 0) { usleep(1); } @@ -244,7 +292,7 @@ int test_svm_enqueue_api(cl_device_id deviceID, cl_context c, cl_command_queue q if (data.num_svm_pointers != buffers.size()) { log_error("Invalid number of SVM pointers returned in the callback, expected: %ld, got: %d\n", buffers.size(), data.num_svm_pointers); - return -1; + return TEST_FAIL; } //check if pointers returned in callback are correct @@ -253,9 +301,9 @@ int test_svm_enqueue_api(cl_device_id deviceID, cl_context c, cl_command_queue q if (data.svm_pointers[i] != buffers[i]) { log_error("Invalid SVM pointer returned in the callback, idx: %ld\n", i); - return -1; + return TEST_FAIL; } } return 0; -} \ No newline at end of file +} diff --git a/test_conformance/SVM/test_fine_grain_memory_consistency.cpp b/test_conformance/SVM/test_fine_grain_memory_consistency.cpp index 1f2a1d9c..42ea0bd2 100644 --- a/test_conformance/SVM/test_fine_grain_memory_consistency.cpp +++ b/test_conformance/SVM/test_fine_grain_memory_consistency.cpp @@ -15,7 +15,11 @@ // #include "common.h" -const char *hash_table_kernel[] = { +static char hash_table_kernel[] = + "#if 0\n" + "#pragma OPENCL EXTENSION cl_khr_int64_base_atomics : enable\n" + "#pragma OPENCL EXTENSION cl_khr_int64_extended_atomics : enable\n" + "#endif\n" "typedef struct BinNode {\n" " int value;\n" " atomic_uintptr_t pNext;\n" @@ -32,8 +36,7 @@ const char *hash_table_kernel[] = { " {\n" " atomic_store_explicit(&(pNew->pNext), next, memory_order_seq_cst, memory_scope_all_svm_devices);\n" // always inserting at head of list " } while(!atomic_compare_exchange_strong_explicit(&(pNodes[b].pNext), &next, (uintptr_t)pNew, memory_order_seq_cst, memory_order_relaxed, memory_scope_all_svm_devices));\n" - "}\n" -}; + "}\n"; typedef struct BinNode{ cl_uint value; @@ -110,6 +113,7 @@ int launch_kernels_and_verify(clContextWrapper &context, clCommandQueueWrapper* } } + clReleaseEvent(done); clSVMFree(context, pInputImage); clSVMFree(context, pNodes); clSVMFree(context, pNumNodes); @@ -136,14 +140,16 @@ int test_svm_fine_grain_memory_consistency(cl_device_id deviceID, cl_context c, cl_uint num_devices = 0; cl_int err = CL_SUCCESS; + std::vector required_extensions; + required_extensions.push_back("cl_khr_int64_base_atomics"); + required_extensions.push_back("cl_khr_int64_extended_atomics"); - if (sizeof(void *) == 8 && (!is_extension_available(deviceID, "cl_khr_int64_base_atomics") || !is_extension_available(deviceID, "cl_khr_int64_extended_atomics"))) - { - log_info("WARNING: test skipped. 'cl_khr_int64_base_atomics' and 'cl_khr_int64_extended_atomics' extensions are not supported\n"); - return 0; - } + // Make pragmas visible for 64-bit addresses + hash_table_kernel[4] = sizeof(void *) == 8 ? '1' : '0'; - err = create_cl_objects(deviceID, &hash_table_kernel[0], &context, &program, &queues[0], &num_devices, CL_DEVICE_SVM_FINE_GRAIN_BUFFER | CL_DEVICE_SVM_ATOMICS); + char *source[] = { hash_table_kernel }; + + err = create_cl_objects(deviceID, (const char**)source, &context, &program, &queues[0], &num_devices, CL_DEVICE_SVM_FINE_GRAIN_BUFFER | CL_DEVICE_SVM_ATOMICS, required_extensions); if(err == 1) return 0; // no devices capable of requested SVM level, so don't execute but count test as passing. if(err < 0) return -1; // fail test. diff --git a/test_conformance/SVM/test_fine_grain_sync_buffers.cpp b/test_conformance/SVM/test_fine_grain_sync_buffers.cpp index af0c0119..4cc34952 100644 --- a/test_conformance/SVM/test_fine_grain_sync_buffers.cpp +++ b/test_conformance/SVM/test_fine_grain_sync_buffers.cpp @@ -96,6 +96,7 @@ int test_svm_fine_grain_sync_buffers(cl_device_id deviceID, cl_context c, cl_com } } while (status != CL_COMPLETE || AtomicLoadExplicit(&pTargetLocations[i], memory_order_relaxed) != -1); + clReleaseEvent(done); clSVMFree(context, pInputImage); clSVMFree(context, pNumTargetsFound); clSVMFree(context, pTargetLocations); diff --git a/test_conformance/SVM/test_migrate.cpp b/test_conformance/SVM/test_migrate.cpp index 60ed9f6e..2a1ce051 100644 --- a/test_conformance/SVM/test_migrate.cpp +++ b/test_conformance/SVM/test_migrate.cpp @@ -14,7 +14,7 @@ // limitations under the License. // #include "common.h" -#include "../../test_common/harness/mt19937.h" +#include "harness/mt19937.h" #define GLOBAL_SIZE 65536 @@ -199,6 +199,24 @@ int test_svm_migrate(cl_device_id deviceID, cl_context c, cl_command_queue queue error = clFlush(queues[1]); test_error(error, "clFlush failed"); + // Check the event command type for clEnqueueSVMMigrateMem (OpenCL 3.0 and + // newer) + Version version = get_device_cl_version(deviceID); + if (version >= Version(3, 0)) + { + cl_command_type commandType; + error = clGetEventInfo(evs[3], CL_EVENT_COMMAND_TYPE, + sizeof(commandType), &commandType, NULL); + test_error(error, "clGetEventInfo failed"); + if (commandType != CL_COMMAND_SVM_MIGRATE_MEM) + { + log_error("Invalid command type returned for " + "clEnqueueSVMMigrateMem: %X\n", + commandType); + return TEST_FAIL; + } + } + error = wait_and_release("first batch", evs, 8); if (error) return -1; diff --git a/test_conformance/SVM/test_pointer_passing.cpp b/test_conformance/SVM/test_pointer_passing.cpp index 6ef074d3..42baa76a 100644 --- a/test_conformance/SVM/test_pointer_passing.cpp +++ b/test_conformance/SVM/test_pointer_passing.cpp @@ -50,13 +50,13 @@ int test_svm_pointer_passing(cl_device_id deviceID, cl_context context2, cl_comm test_error(error,"clCreateKernel failed"); size_t bufSize = 256; - char *pbuf = (char*) clSVMAlloc(context, CL_MEM_READ_WRITE, sizeof(cl_uchar)*bufSize, 0); + cl_uchar *pbuf_svm_alloc = (cl_uchar*) clSVMAlloc(context, CL_MEM_READ_WRITE, sizeof(cl_uchar)*bufSize, 0); cl_int *pNumCorrect = NULL; pNumCorrect = (cl_int*) clSVMAlloc(context, CL_MEM_READ_WRITE, sizeof(cl_int), 0); { - clMemWrapper buf = clCreateBuffer(context, CL_MEM_USE_HOST_PTR, sizeof(cl_uchar)*bufSize, pbuf, &error); + clMemWrapper buf = clCreateBuffer(context, CL_MEM_USE_HOST_PTR, sizeof(cl_uchar)*bufSize, pbuf_svm_alloc, &error); test_error(error, "clCreateBuffer failed."); clMemWrapper num_correct = clCreateBuffer(context, CL_MEM_USE_HOST_PTR, sizeof(cl_int), pNumCorrect, &error); @@ -67,13 +67,13 @@ int test_svm_pointer_passing(cl_device_id deviceID, cl_context context2, cl_comm // put values into buf so that we can expect to see these values in the kernel when we pass a pointer to them. cl_command_queue cmdq = queues[0]; - cl_uchar* pBuf = (cl_uchar*) clEnqueueMapBuffer(cmdq, buf, CL_TRUE, CL_MAP_READ | CL_MAP_WRITE, 0, sizeof(cl_uchar)*bufSize, 0, NULL,NULL, &error); - test_error2(error, pBuf, "clEnqueueMapBuffer failed"); + cl_uchar* pbuf_map_buffer = (cl_uchar*) clEnqueueMapBuffer(cmdq, buf, CL_TRUE, CL_MAP_READ | CL_MAP_WRITE, 0, sizeof(cl_uchar)*bufSize, 0, NULL,NULL, &error); + test_error2(error, pbuf_map_buffer, "clEnqueueMapBuffer failed"); for(int i = 0; i<(int)bufSize; i++) { - pBuf[i]= (cl_uchar)i; + pbuf_map_buffer[i]= (cl_uchar)i; } - error = clEnqueueUnmapMemObject(cmdq, buf, pBuf, 0,NULL,NULL); + error = clEnqueueUnmapMemObject(cmdq, buf, pbuf_map_buffer, 0,NULL,NULL); test_error(error, "clEnqueueUnmapMemObject failed."); for (cl_uint ii = 0; ii max_size) - max_size = (cl_uint)(size/sizeof(cl_uint)); + max_size = size/sizeof(cl_uint); + } + if (support64) { + buffer_sizes = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, sizeof(cl_ulong)*number_of_mems_used, ulSizes, &error); + } + else { + buffer_sizes = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, sizeof(cl_uint)*number_of_mems_used, uiSizes, &error); } - buffer_sizes = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, sizeof(cl_uint)*number_of_mems_used, sizes, &error); test_error_abort(error, "clCreateBuffer failed"); error = clSetKernelArg(kernel, number_of_mems_used+1, sizeof(cl_mem), &buffer_sizes); test_error(error, "clSetKernelArg failed"); @@ -239,7 +274,12 @@ int execute_kernel(cl_context context, cl_command_queue *queue, cl_device_id dev per_item_uint = (cl_uint)per_item; error = clSetKernelArg(kernel, number_of_mems_used+2, sizeof(per_item_uint), &per_item_uint); test_error(error, "clSetKernelArg failed"); - free(sizes); + } + if (ulSizes) { + free(ulSizes); + } + if (uiSizes) { + free(uiSizes); } size_t local_dims[3] = {1,1,1}; diff --git a/test_conformance/allocations/allocation_fill.cpp b/test_conformance/allocations/allocation_fill.cpp index 92d813c3..a7558942 100644 --- a/test_conformance/allocations/allocation_fill.cpp +++ b/test_conformance/allocations/allocation_fill.cpp @@ -18,7 +18,7 @@ #define BUFFER_CHUNK_SIZE 8*1024*1024 #define IMAGE_LINES 8 -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" int fill_buffer_with_data(cl_context context, cl_device_id device_id, cl_command_queue *queue, cl_mem mem, size_t size, MTdata d, cl_bool blocking_write) { size_t i, j; diff --git a/test_conformance/allocations/allocation_functions.cpp b/test_conformance/allocations/allocation_functions.cpp index 7a309cd6..7182c727 100644 --- a/test_conformance/allocations/allocation_functions.cpp +++ b/test_conformance/allocations/allocation_functions.cpp @@ -48,7 +48,10 @@ int find_good_image_size(cl_device_id device_id, size_t size_to_allocate, size_t num_pixels = size_to_allocate / (sizeof(cl_uint)*4); - if (num_pixels > (max_width*max_height)) { + // Use a 64-bit variable to avoid overflow in 32-bit architectures + long long unsigned max_pixels = (long long unsigned)max_width * max_height; + + if (num_pixels > max_pixels) { if(NULL != max_size) { *max_size = max_width * max_height * sizeof(cl_uint) * 4; } @@ -272,7 +275,6 @@ int allocate_size(cl_context context, cl_command_queue *queue, cl_device_id devi // Otherwise we succeeded if (result != SUCCEEDED) { log_error("Test logic error."); - test_finish(); exit(-1); } amount_allocated += allocation_this_time; diff --git a/test_conformance/allocations/allocation_utils.cpp b/test_conformance/allocations/allocation_utils.cpp index 6877c86a..7d6520b0 100644 --- a/test_conformance/allocations/allocation_utils.cpp +++ b/test_conformance/allocations/allocation_utils.cpp @@ -19,7 +19,7 @@ cl_command_queue reset_queue(cl_context context, cl_device_id device_id, cl_comm { log_info("Invalid command queue. Releasing and recreating the command queue.\n"); clReleaseCommandQueue(*queue); - *queue = clCreateCommandQueueWithProperties(context, device_id, 0, error); + *queue = clCreateCommandQueue(context, device_id, 0, error); return *queue; } diff --git a/test_conformance/allocations/main.cpp b/test_conformance/allocations/main.cpp index 1d842f19..0dec4c6d 100644 --- a/test_conformance/allocations/main.cpp +++ b/test_conformance/allocations/main.cpp @@ -18,8 +18,8 @@ #include "allocation_functions.h" #include "allocation_fill.h" #include "allocation_execute.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/parseParameters.h" +#include "harness/testHarness.h" +#include "harness/parseParameters.h" #include typedef long long unsigned llu; @@ -277,7 +277,6 @@ int main(int argc, const char *argv[]) argc = parseCustomParam(argc, argv); if (argc == -1) { - test_finish(); return 1; } @@ -335,7 +334,7 @@ int main(int argc, const char *argv[]) } } - int ret = runTestHarnessWithCheck( argCount, argList, test_num, test_list, false, false, 0, init_cl ); + int ret = runTestHarnessWithCheck( argCount, argList, test_num, test_list, false, 0, init_cl ); free(argList); return ret; diff --git a/test_conformance/allocations/testBase.h b/test_conformance/allocations/testBase.h index 6a6e07ee..b48efe51 100644 --- a/test_conformance/allocations/testBase.h +++ b/test_conformance/allocations/testBase.h @@ -16,7 +16,7 @@ #ifndef _testBase_h #define _testBase_h -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include #include @@ -28,10 +28,10 @@ #include #endif -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" +#include "harness/typeWrappers.h" +#include "harness/testHarness.h" #define MAX_NUMBER_TO_ALLOCATE 100 diff --git a/test_conformance/api/CMakeLists.txt b/test_conformance/api/CMakeLists.txt index 69f94cab..20d69830 100644 --- a/test_conformance/api/CMakeLists.txt +++ b/test_conformance/api/CMakeLists.txt @@ -1,14 +1,16 @@ set(MODULE_NAME API) set(${MODULE_NAME}_SOURCES - main.c - test_bool.c + main.cpp + test_api_consistency.cpp + test_bool.cpp test_retain.cpp - test_retain_program.c + test_retain_program.cpp test_queries.cpp - test_create_kernels.c - test_kernels.c - test_api_min_max.c + test_queries_compatibility.cpp + test_create_kernels.cpp + test_kernels.cpp + test_api_min_max.cpp test_kernel_arg_changes.cpp test_kernel_arg_multi_setup.cpp test_binary.cpp @@ -17,24 +19,19 @@ set(${MODULE_NAME}_SOURCES test_create_context_from_type.cpp test_device_min_data_type_align_size_alignment.cpp test_platform.cpp - test_kernel_arg_info.c - test_null_buffer_arg.c + test_kernel_arg_info.cpp + test_kernel_arg_info_compatibility.cpp + test_null_buffer_arg.cpp test_mem_object_info.cpp + test_queue.cpp test_queue_hint.cpp + test_queue_properties.cpp test_sub_group_dispatch.cpp test_clone_kernel.cpp test_zero_sized_enqueue.cpp - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/threadTesting.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/typeWrappers.cpp - ../../test_common/harness/conversions.c - ../../test_common/harness/mt19937.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/imageHelpers.cpp - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c + test_context_destructor_callback.cpp + test_mem_object_properties_queries.cpp + test_queue_properties_queries.cpp ) include(../CMakeCommon.txt) diff --git a/test_conformance/api/main.c b/test_conformance/api/main.c deleted file mode 100644 index 8fbd5dac..00000000 --- a/test_conformance/api/main.c +++ /dev/null @@ -1,129 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" -#include -#include - -#include -#include "procs.h" -#include "../../test_common/harness/testHarness.h" - -#if !defined(_WIN32) -#include -#endif - -// FIXME: To use certain functions in ../../test_common/harness/imageHelpers.h -// (for example, generate_random_image_data()), the tests are required to declare -// the following variables (): -cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT; -bool gTestRounding = false; - -test_definition test_list[] = { - ADD_TEST( get_platform_info ), - ADD_TEST( get_sampler_info ), - ADD_TEST( get_command_queue_info ), - ADD_TEST( get_context_info ), - ADD_TEST( get_device_info ), - ADD_TEST( enqueue_task ), - ADD_TEST( binary_get ), - ADD_TEST( binary_create ), - ADD_TEST( kernel_required_group_size ), - - ADD_TEST( release_kernel_order ), - ADD_TEST( release_during_execute ), - - ADD_TEST( load_single_kernel ), - ADD_TEST( load_two_kernels ), - ADD_TEST( load_two_kernels_in_one ), - ADD_TEST( load_two_kernels_manually ), - ADD_TEST( get_program_info_kernel_names ), - ADD_TEST( get_kernel_arg_info ), - ADD_TEST( create_kernels_in_program ), - ADD_TEST( get_kernel_info ), - ADD_TEST( execute_kernel_local_sizes ), - ADD_TEST( set_kernel_arg_by_index ), - ADD_TEST( set_kernel_arg_constant ), - ADD_TEST( set_kernel_arg_struct_array ), - ADD_TEST( kernel_global_constant ), - - ADD_TEST( min_max_thread_dimensions ), - ADD_TEST( min_max_work_items_sizes ), - ADD_TEST( min_max_work_group_size ), - ADD_TEST( min_max_read_image_args ), - ADD_TEST( min_max_write_image_args ), - ADD_TEST( min_max_mem_alloc_size ), - ADD_TEST( min_max_image_2d_width ), - ADD_TEST( min_max_image_2d_height ), - ADD_TEST( min_max_image_3d_width ), - ADD_TEST( min_max_image_3d_height ), - ADD_TEST( min_max_image_3d_depth ), - ADD_TEST( min_max_image_array_size ), - ADD_TEST( min_max_image_buffer_size ), - ADD_TEST( min_max_parameter_size ), - ADD_TEST( min_max_samplers ), - ADD_TEST( min_max_constant_buffer_size ), - ADD_TEST( min_max_constant_args ), - ADD_TEST( min_max_compute_units ), - ADD_TEST( min_max_address_bits ), - ADD_TEST( min_max_single_fp_config ), - ADD_TEST( min_max_double_fp_config ), - ADD_TEST( min_max_local_mem_size ), - ADD_TEST( min_max_kernel_preferred_work_group_size_multiple ), - ADD_TEST( min_max_execution_capabilities ), - ADD_TEST( min_max_queue_properties ), - ADD_TEST( min_max_device_version ), - ADD_TEST( min_max_language_version ), - - ADD_TEST( kernel_arg_changes ), - ADD_TEST( kernel_arg_multi_setup_random ), - - ADD_TEST( native_kernel ), - - ADD_TEST( create_context_from_type ), - - ADD_TEST( platform_extensions ), - ADD_TEST( get_platform_ids ), - ADD_TEST( bool_type ), - - ADD_TEST( repeated_setup_cleanup ), - - ADD_TEST( retain_queue_single ), - ADD_TEST( retain_queue_multiple ), - ADD_TEST( retain_mem_object_single ), - ADD_TEST( retain_mem_object_multiple ), - ADD_TEST( min_data_type_align_size_alignment ), - - ADD_TEST( mem_object_destructor_callback ), - ADD_TEST( null_buffer_arg ), - ADD_TEST( get_buffer_info ), - ADD_TEST( get_image2d_info ), - ADD_TEST( get_image3d_info ), - ADD_TEST( get_image1d_info ), - ADD_TEST( get_image1d_array_info ), - ADD_TEST( get_image2d_array_info ), - ADD_TEST( queue_hint ), - ADD_TEST( sub_group_dispatch ), - ADD_TEST( clone_kernel ), - ADD_TEST( zero_sized_enqueue ), -}; - -const int test_num = ARRAY_SIZE( test_list ); - -int main(int argc, const char *argv[]) -{ - return runTestHarness( argc, argv, test_num, test_list, false, false, 0 ); -} - diff --git a/test_conformance/api/main.cpp b/test_conformance/api/main.cpp new file mode 100644 index 00000000..8d8d20ad --- /dev/null +++ b/test_conformance/api/main.cpp @@ -0,0 +1,152 @@ +// +// Copyright (c) 2017 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "harness/compat.h" +#include +#include + +#include +#include "procs.h" +#include "harness/testHarness.h" + +#if !defined(_WIN32) +#include +#endif + +// FIXME: To use certain functions in harness/imageHelpers.h +// (for example, generate_random_image_data()), the tests are required to +// declare the following variables (): + +test_definition test_list[] = { + ADD_TEST(get_platform_info), + ADD_TEST_VERSION(get_sampler_info, Version(2, 0)), + ADD_TEST(get_sampler_info_compatibility), + ADD_TEST_VERSION(get_command_queue_info, Version(2, 0)), + ADD_TEST(get_command_queue_info_compatibility), + ADD_TEST(get_context_info), + ADD_TEST(get_device_info), + ADD_TEST(enqueue_task), + ADD_TEST(binary_get), + ADD_TEST(binary_create), + ADD_TEST(kernel_required_group_size), + + ADD_TEST(release_kernel_order), + ADD_TEST(release_during_execute), + + ADD_TEST(load_single_kernel), + ADD_TEST(load_two_kernels), + ADD_TEST(load_two_kernels_in_one), + ADD_TEST(load_two_kernels_manually), + ADD_TEST(get_program_info_kernel_names), + ADD_TEST(get_kernel_arg_info), + ADD_TEST(get_kernel_arg_info_compatibility), + ADD_TEST(create_kernels_in_program), + ADD_TEST(get_kernel_info), + ADD_TEST(execute_kernel_local_sizes), + ADD_TEST(set_kernel_arg_by_index), + ADD_TEST(set_kernel_arg_constant), + ADD_TEST(set_kernel_arg_struct_array), + ADD_TEST(kernel_global_constant), + + ADD_TEST(min_max_thread_dimensions), + ADD_TEST(min_max_work_items_sizes), + ADD_TEST(min_max_work_group_size), + ADD_TEST(min_max_read_image_args), + ADD_TEST(min_max_write_image_args), + ADD_TEST(min_max_mem_alloc_size), + ADD_TEST(min_max_image_2d_width), + ADD_TEST(min_max_image_2d_height), + ADD_TEST(min_max_image_3d_width), + ADD_TEST(min_max_image_3d_height), + ADD_TEST(min_max_image_3d_depth), + ADD_TEST(min_max_image_array_size), + ADD_TEST(min_max_image_buffer_size), + ADD_TEST(min_max_parameter_size), + ADD_TEST(min_max_samplers), + ADD_TEST(min_max_constant_buffer_size), + ADD_TEST(min_max_constant_args), + ADD_TEST(min_max_compute_units), + ADD_TEST(min_max_address_bits), + ADD_TEST(min_max_single_fp_config), + ADD_TEST(min_max_double_fp_config), + ADD_TEST(min_max_local_mem_size), + ADD_TEST(min_max_kernel_preferred_work_group_size_multiple), + ADD_TEST(min_max_execution_capabilities), + ADD_TEST(min_max_queue_properties), + ADD_TEST(min_max_device_version), + ADD_TEST(min_max_language_version), + + ADD_TEST(kernel_arg_changes), + ADD_TEST(kernel_arg_multi_setup_random), + + ADD_TEST(native_kernel), + + ADD_TEST(create_context_from_type), + + ADD_TEST(platform_extensions), + ADD_TEST(get_platform_ids), + ADD_TEST(bool_type), + + ADD_TEST(repeated_setup_cleanup), + + ADD_TEST(retain_queue_single), + ADD_TEST(retain_queue_multiple), + ADD_TEST(retain_mem_object_single), + ADD_TEST(retain_mem_object_multiple), + ADD_TEST(retain_mem_object_set_kernel_arg), + ADD_TEST(min_data_type_align_size_alignment), + + ADD_TEST_VERSION(context_destructor_callback, Version(3, 0)), + ADD_TEST(mem_object_destructor_callback), + ADD_TEST(null_buffer_arg), + ADD_TEST(get_buffer_info), + ADD_TEST(get_image2d_info), + ADD_TEST(get_image3d_info), + ADD_TEST(get_image1d_info), + ADD_TEST(get_image1d_array_info), + ADD_TEST(get_image2d_array_info), + ADD_TEST(queue_flush_on_release), + ADD_TEST(queue_hint), + ADD_TEST(queue_properties), + ADD_TEST_VERSION(sub_group_dispatch, Version(2, 1)), + ADD_TEST_VERSION(clone_kernel, Version(2, 1)), + ADD_TEST_VERSION(zero_sized_enqueue, Version(2, 1)), + + ADD_TEST_VERSION(buffer_properties_queries, Version(3, 0)), + ADD_TEST_VERSION(image_properties_queries, Version(3, 0)), + ADD_TEST_VERSION(queue_properties_queries, Version(3, 0)), + + ADD_TEST_VERSION(consistency_svm, Version(3, 0)), + ADD_TEST_VERSION(consistency_memory_model, Version(3, 0)), + ADD_TEST_VERSION(consistency_device_enqueue, Version(3, 0)), + ADD_TEST_VERSION(consistency_pipes, Version(3, 0)), + ADD_TEST_VERSION(consistency_progvar, Version(3, 0)), + ADD_TEST_VERSION(consistency_non_uniform_work_group, Version(3, 0)), + ADD_TEST_VERSION(consistency_read_write_images, Version(3, 0)), + ADD_TEST_VERSION(consistency_2d_image_from_buffer, Version(3, 0)), + ADD_TEST_VERSION(consistency_depth_images, Version(3, 0)), + ADD_TEST_VERSION(consistency_device_and_host_timer, Version(3, 0)), + ADD_TEST_VERSION(consistency_il_programs, Version(3, 0)), + ADD_TEST_VERSION(consistency_subgroups, Version(3, 0)), + ADD_TEST_VERSION(consistency_prog_ctor_dtor, Version(3, 0)), + ADD_TEST_VERSION(consistency_3d_image_writes, Version(3, 0)), +}; + +const int test_num = ARRAY_SIZE(test_list); + +int main(int argc, const char *argv[]) +{ + return runTestHarness(argc, argv, test_num, test_list, false, false, 0); +} diff --git a/test_conformance/api/procs.h b/test_conformance/api/procs.h index 4dd398dd..21dca3f2 100644 --- a/test_conformance/api/procs.h +++ b/test_conformance/api/procs.h @@ -13,11 +13,11 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/clImageHelper.h" -#include "../../test_common/harness/imageHelpers.h" +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" +#include "harness/typeWrappers.h" +#include "harness/clImageHelper.h" +#include "harness/imageHelpers.h" extern float calculate_ulperror(float a, float b); extern int test_load_single_kernel(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); @@ -33,7 +33,9 @@ extern int test_bool_type(cl_device_id deviceID, cl_context context, cl_c extern int test_platform_extensions(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_get_platform_info(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_get_sampler_info(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); +extern int test_get_sampler_info_compatibility(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_get_command_queue_info(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); +extern int test_get_command_queue_info_compatibility(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_get_context_info(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_get_device_info(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_kernel_required_group_size(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); @@ -93,9 +95,17 @@ extern int test_retain_queue_single(cl_device_id deviceID, cl_context con extern int test_retain_queue_multiple(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_retain_mem_object_single(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_retain_mem_object_multiple(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); +extern int test_retain_mem_object_set_kernel_arg(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_min_data_type_align_size_alignment(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems ); -extern int test_mem_object_destructor_callback(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); +extern int test_context_destructor_callback(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_mem_object_destructor_callback(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); extern int test_null_buffer_arg( cl_device_id device_id, cl_context context, cl_command_queue queue, int num_elements ); extern int test_get_buffer_info( cl_device_id deviceID, cl_context context, cl_command_queue ignoreQueue, int num_elements ); @@ -105,7 +115,74 @@ extern int test_get_image1d_info( cl_device_id deviceID, cl_context context extern int test_get_image1d_array_info( cl_device_id deviceID, cl_context context, cl_command_queue ignoreQueue, int num_elements ); extern int test_get_image2d_array_info( cl_device_id deviceID, cl_context context, cl_command_queue ignoreQueue, int num_elements ); extern int test_get_kernel_arg_info( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); +extern int test_get_kernel_arg_info_compatibility( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); extern int test_queue_hint(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_sub_group_dispatch(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_clone_kernel(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_zero_sized_enqueue(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); +extern int test_queue_properties( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); +extern int test_queue_flush_on_release(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_buffer_properties_queries(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_image_properties_queries(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_queue_properties_queries(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); + +extern int test_consistency_svm(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_consistency_memory_model(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_consistency_device_enqueue(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_consistency_pipes(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_consistency_progvar(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_consistency_non_uniform_work_group(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_consistency_read_write_images(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_consistency_2d_image_from_buffer(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_consistency_depth_images(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_consistency_device_and_host_timer(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_consistency_il_programs(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_consistency_subgroups(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_consistency_prog_ctor_dtor(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_consistency_3d_image_writes(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); diff --git a/test_conformance/api/testBase.h b/test_conformance/api/testBase.h index 8d58eeb6..ba67d140 100644 --- a/test_conformance/api/testBase.h +++ b/test_conformance/api/testBase.h @@ -16,7 +16,7 @@ #ifndef _testBase_h #define _testBase_h -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include #include diff --git a/test_conformance/api/test_api_consistency.cpp b/test_conformance/api/test_api_consistency.cpp new file mode 100644 index 00000000..4b0a4504 --- /dev/null +++ b/test_conformance/api/test_api_consistency.cpp @@ -0,0 +1,1143 @@ +// +// Copyright (c) 2020 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "testBase.h" +#include "harness/testHarness.h" +#include "harness/deviceInfo.h" + +static const char* test_kernel = R"CLC( +__kernel void test(__global int* dst) { + dst[0] = 0; +} +)CLC"; + +int test_consistency_svm(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements) +{ + // clGetDeviceInfo, passing CL_DEVICE_SVM_CAPABILITIES: + // May return 0, indicating that device does not support Shared Virtual + // Memory. + cl_int error; + + const size_t allocSize = 16; + clMemWrapper mem; + clProgramWrapper program; + clKernelWrapper kernel; + + cl_device_svm_capabilities svmCaps = 0; + error = clGetDeviceInfo(deviceID, CL_DEVICE_SVM_CAPABILITIES, + sizeof(svmCaps), &svmCaps, NULL); + test_error(error, "Unable to query CL_DEVICE_SVM_CAPABILITIES"); + + if (svmCaps == 0) + { + // Test setup: + + mem = + clCreateBuffer(context, CL_MEM_READ_WRITE, allocSize, NULL, &error); + test_error(error, "Unable to create test buffer"); + + error = create_single_kernel_helper(context, &program, &kernel, 1, + &test_kernel, "test"); + test_error(error, "Unable to create test kernel"); + + // clGetMemObjectInfo, passing CL_MEM_USES_SVM_POINTER + // Returns CL_FALSE if no devices in the context associated with + // memobj support Shared Virtual Memory. + cl_bool usesSVMPointer; + error = + clGetMemObjectInfo(mem, CL_MEM_USES_SVM_POINTER, + sizeof(usesSVMPointer), &usesSVMPointer, NULL); + test_error(error, "Unable to query CL_MEM_USES_SVM_POINTER"); + test_assert_error(usesSVMPointer == CL_FALSE, + "CL_DEVICE_SVM_CAPABILITIES returned 0 but " + "CL_MEM_USES_SVM_POINTER did not return CL_FALSE"); + + // Check that the SVM APIs can be called. + + // Returns NULL if no devices in context support Shared Virtual Memory. + void* ptr0 = clSVMAlloc(context, CL_MEM_READ_WRITE, allocSize, 0); + void* ptr1 = clSVMAlloc(context, CL_MEM_READ_WRITE, allocSize, 0); + test_assert_error(ptr0 == NULL && ptr1 == NULL, + "CL_DEVICE_SVM_CAPABILITIES returned 0 but " + "clSVMAlloc returned a non-NULL value"); + + // clEnqueueSVMFree, clEnqueueSVMMemcpy, clEnqueueSVMMemFill, + // clEnqueueSVMMap, clEnqueueSVMUnmap, clEnqueueSVMMigrateMem Returns + // CL_INVALID_OPERATION if the device associated with command_queue does + // not support Shared Virtual Memory. + + cl_uint pattern = 0xAAAAAAAA; + error = clEnqueueSVMMemFill(queue, ptr0, &pattern, sizeof(pattern), + allocSize, 0, NULL, NULL); + test_failure_error( + error, CL_INVALID_OPERATION, + "CL_DEVICE_SVM_CAPABILITIES returned 0 but clEnqueueSVMMemFill did " + "not return CL_INVALID_OPERATION"); + + error = clEnqueueSVMMemcpy(queue, CL_TRUE, ptr1, ptr0, allocSize, 0, + NULL, NULL); + test_failure_error( + error, CL_INVALID_OPERATION, + "CL_DEVICE_SVM_CAPABILITIES returned 0 but " + "clEnqueueSVMMemcpy did not return CL_INVALID_OPERATION"); + + error = clEnqueueSVMMap(queue, CL_TRUE, CL_MAP_READ, ptr1, allocSize, 0, + NULL, NULL); + test_failure_error( + error, CL_INVALID_OPERATION, + "CL_DEVICE_SVM_CAPABILITIES returned 0 but " + "clEnqueueSVMMap did not return CL_INVALID_OPERATION"); + + error = clEnqueueSVMUnmap(queue, ptr1, 0, NULL, NULL); + test_failure_error( + error, CL_INVALID_OPERATION, + "CL_DEVICE_SVM_CAPABILITIES returned 0 but " + "clEnqueueSVMUnmap did not return CL_INVALID_OPERATION"); + + // If the enqueue calls above did not return errors, a clFinish would be + // needed here to ensure the SVM operations are complete before freeing + // the SVM pointers. + + // These calls to free SVM purposefully passes a bogus pointer to the + // free function to better test that it they are a NOP when SVM is not + // supported. + void* bogus = (void*)0xDEADBEEF; + clSVMFree(context, bogus); + error = clEnqueueSVMFree(queue, 1, &bogus, NULL, NULL, 0, NULL, NULL); + test_failure_error( + error, CL_INVALID_OPERATION, + "CL_DEVICE_SVM_CAPABILITIES returned 0 but " + "clEnqueueSVMFree did not return CL_INVALID_OPERATION"); + + // If the enqueue calls above did not return errors, a clFinish should + // be included here to ensure the enqueued SVM free is complete. + + // clSetKernelArgSVMPointer, clSetKernelExecInfo + // Returns CL_INVALID_OPERATION if no devices in the context associated + // with kernel support Shared Virtual Memory. + + error = clSetKernelArgSVMPointer(kernel, 0, NULL); + test_failure_error( + error, CL_INVALID_OPERATION, + "CL_DEVICE_SVM_CAPABILITIES returned 0 but " + "clSetKernelArgSVMPointer did not return CL_INVALID_OPERATION"); + + error = + clSetKernelExecInfo(kernel, CL_KERNEL_EXEC_INFO_SVM_PTRS, 0, NULL); + test_failure_error( + error, CL_INVALID_OPERATION, + "CL_DEVICE_SVM_CAPABILITIES returned 0 but " + "clSetKernelExecInfo did not return CL_INVALID_OPERATION"); + } + + return TEST_PASS; +} + +static int check_atomic_capabilities(cl_device_atomic_capabilities atomicCaps, + cl_device_atomic_capabilities requiredCaps) +{ + if ((atomicCaps & requiredCaps) != requiredCaps) + { + log_error("Atomic capabilities %llx is missing support for at least " + "one required capability %llx!\n", + atomicCaps, requiredCaps); + return TEST_FAIL; + } + + if ((atomicCaps & CL_DEVICE_ATOMIC_SCOPE_ALL_DEVICES) != 0 + && (atomicCaps & CL_DEVICE_ATOMIC_SCOPE_DEVICE) == 0) + { + log_error("Support for CL_DEVICE_ATOMIC_SCOPE_ALL_DEVICES requires " + "support for CL_DEVICE_ATOMIC_SCOPE_DEVICE!\n"); + return TEST_FAIL; + } + + if ((atomicCaps & CL_DEVICE_ATOMIC_SCOPE_DEVICE) != 0 + && (atomicCaps & CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP) == 0) + { + log_error("Support for CL_DEVICE_ATOMIC_SCOPE_DEVICE requires " + "support for CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP!\n"); + return TEST_FAIL; + } + + if ((atomicCaps & CL_DEVICE_ATOMIC_ORDER_SEQ_CST) != 0 + && (atomicCaps & CL_DEVICE_ATOMIC_ORDER_ACQ_REL) == 0) + { + log_error("Support for CL_DEVICE_ATOMIC_ORDER_SEQ_CST requires " + "support for CL_DEVICE_ATOMIC_ORDER_ACQ_REL!\n"); + return TEST_FAIL; + } + + if ((atomicCaps & CL_DEVICE_ATOMIC_ORDER_ACQ_REL) != 0 + && (atomicCaps & CL_DEVICE_ATOMIC_ORDER_RELAXED) == 0) + { + log_error("Support for CL_DEVICE_ATOMIC_ORDER_ACQ_REL requires " + "support for CL_DEVICE_ATOMIC_ORDER_RELAXED!\n"); + return TEST_FAIL; + } + + return TEST_PASS; +} + +int test_consistency_memory_model(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements) +{ + cl_int error; + cl_device_atomic_capabilities atomicCaps = 0; + + error = clGetDeviceInfo(deviceID, CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES, + sizeof(atomicCaps), &atomicCaps, NULL); + test_error(error, "Unable to query CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES"); + + error = check_atomic_capabilities(atomicCaps, + CL_DEVICE_ATOMIC_ORDER_RELAXED + | CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP); + if (error == TEST_FAIL) + { + log_error("Checks failed for CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES\n"); + return error; + } + + error = clGetDeviceInfo(deviceID, CL_DEVICE_ATOMIC_FENCE_CAPABILITIES, + sizeof(atomicCaps), &atomicCaps, NULL); + test_error(error, "Unable to query CL_DEVICE_ATOMIC_FENCE_CAPABILITIES"); + + error = check_atomic_capabilities(atomicCaps, + CL_DEVICE_ATOMIC_ORDER_RELAXED + | CL_DEVICE_ATOMIC_ORDER_ACQ_REL + | CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP); + if (error == TEST_FAIL) + { + log_error("Checks failed for CL_DEVICE_ATOMIC_FENCE_CAPABILITIES\n"); + return error; + } + + return TEST_PASS; +} + +int test_consistency_device_enqueue(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements) +{ + // clGetDeviceInfo, passing CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES + // May return 0, indicating that device does not support Device-Side Enqueue + // and On-Device Queues. + cl_int error; + + cl_device_device_enqueue_capabilities dseCaps = 0; + error = clGetDeviceInfo(deviceID, CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES, + sizeof(dseCaps), &dseCaps, NULL); + test_error(error, "Unable to query CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES"); + + if (dseCaps == 0) + { + // clGetDeviceInfo, passing CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES + // Returns 0 if device does not support Device-Side Enqueue and + // On-Device Queues. + + cl_command_queue_properties devQueueProps = 0; + error = clGetDeviceInfo(deviceID, CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES, + sizeof(devQueueProps), &devQueueProps, NULL); + test_error(error, + "Unable to query CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES"); + test_assert_error( + devQueueProps == 0, + "CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES returned 0 but " + "CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES returned a non-zero value"); + + // clGetDeviceInfo, passing + // CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE, + // CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE, + // CL_DEVICE_MAX_ON_DEVICE_QUEUES, or + // CL_DEVICE_MAX_ON_DEVICE_EVENTS + // Returns 0 if device does not support Device-Side Enqueue and + // On-Device Queues. + + cl_uint u = 0; + + error = + clGetDeviceInfo(deviceID, CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE, + sizeof(u), &u, NULL); + test_error(error, + "Unable to query CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE"); + test_assert_error(u == 0, + "CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES returned 0 " + "but CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE " + "returned a non-zero value"); + + error = clGetDeviceInfo(deviceID, CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE, + sizeof(u), &u, NULL); + test_error(error, "Unable to query CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE"); + test_assert_error( + u == 0, + "CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES returned 0 but " + "CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE returned a non-zero value"); + + error = clGetDeviceInfo(deviceID, CL_DEVICE_MAX_ON_DEVICE_QUEUES, + sizeof(u), &u, NULL); + test_error(error, "Unable to query CL_DEVICE_MAX_ON_DEVICE_QUEUES"); + test_assert_error( + u == 0, + "CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES returned 0 but " + "CL_DEVICE_MAX_ON_DEVICE_QUEUES returned a non-zero value"); + + error = clGetDeviceInfo(deviceID, CL_DEVICE_MAX_ON_DEVICE_EVENTS, + sizeof(u), &u, NULL); + test_error(error, "Unable to query CL_DEVICE_MAX_ON_DEVICE_EVENTS"); + test_assert_error( + u == 0, + "CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES returned 0 but " + "CL_DEVICE_MAX_ON_DEVICE_EVENTS returned a non-zero value"); + + // clGetCommandQueueInfo, passing CL_QUEUE_SIZE + // Returns CL_INVALID_COMMAND_QUEUE since command_queue cannot be a + // valid device command-queue. + + error = + clGetCommandQueueInfo(queue, CL_QUEUE_SIZE, sizeof(u), &u, NULL); + test_failure_error( + error, CL_INVALID_COMMAND_QUEUE, + "CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES returned 0 but " + "CL_QUEUE_SIZE did not return CL_INVALID_COMMAND_QUEUE"); + + cl_command_queue q = NULL; + error = clGetCommandQueueInfo(queue, CL_QUEUE_DEVICE_DEFAULT, sizeof(q), + &q, NULL); + test_error(error, "Unable to query CL_QUEUE_DEVICE_DEFAULT"); + test_assert_error( + q == NULL, + "CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES returned 0 but " + "CL_QUEUE_DEVICE_DEFAULT returned a non-NULL value"); + + // clSetDefaultDeviceCommandQueue + // Returns CL_INVALID_OPERATION if device does not support On-Device + // Queues. + error = clSetDefaultDeviceCommandQueue(context, deviceID, NULL); + test_failure_error(error, CL_INVALID_OPERATION, + "CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES returned 0 " + "but clSetDefaultDeviceCommandQueue did not return " + "CL_INVALID_OPERATION"); + } + else + { + if ((dseCaps & CL_DEVICE_QUEUE_REPLACEABLE_DEFAULT) == 0) + { + // clSetDefaultDeviceCommandQueue + // Returns CL_INVALID_OPERATION if device does not support a + // replaceable default On-Device Queue. + error = clSetDefaultDeviceCommandQueue(context, deviceID, NULL); + test_failure_error( + error, CL_INVALID_OPERATION, + "CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES did not " + "include CL_DEVICE_QUEUE_REPLACEABLE_DEFAULT but " + "clSetDefaultDeviceCommandQueue did not return " + "CL_INVALID_OPERATION"); + } + + // If CL_DEVICE_QUEUE_REPLACEABLE_DEFAULT is set, + // CL_DEVICE_QUEUE_SUPPORTED must also be set. + if ((dseCaps & CL_DEVICE_QUEUE_REPLACEABLE_DEFAULT) != 0 + && (dseCaps & CL_DEVICE_QUEUE_SUPPORTED) == 0) + { + log_error("DEVICE_QUEUE_REPLACEABLE_DEFAULT is set but " + "DEVICE_QUEUE_SUPPORTED is not set\n"); + return TEST_FAIL; + } + + // Devices that set CL_DEVICE_QUEUE_SUPPORTED must also return CL_TRUE + // for CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT. + if ((dseCaps & CL_DEVICE_QUEUE_SUPPORTED) != 0) + { + cl_bool b; + error = clGetDeviceInfo(deviceID, + CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT, + sizeof(b), &b, NULL); + test_error( + error, + "Unable to query CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT"); + test_assert_error( + b == CL_TRUE, + "DEVICE_QUEUE_SUPPORTED is set but " + "CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT returned CL_FALSE"); + } + } + + return TEST_PASS; +} + +int test_consistency_pipes(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements) +{ + // clGetDeviceInfo, passing CL_DEVICE_PIPE_SUPPORT + // May return CL_FALSE, indicating that device does not support Pipes. + cl_int error; + + cl_bool pipeSupport = CL_FALSE; + error = clGetDeviceInfo(deviceID, CL_DEVICE_PIPE_SUPPORT, + sizeof(pipeSupport), &pipeSupport, NULL); + test_error(error, "Unable to query CL_DEVICE_PIPE_SUPPORT"); + + if (pipeSupport == CL_FALSE) + { + // clGetDeviceInfo, passing + // CL_DEVICE_MAX_PIPE_ARGS, + // CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS, or + // CL_DEVICE_PIPE_MAX_PACKET_SIZE + // Returns 0 if device does not support Pipes. + + cl_uint u = 0; + + error = clGetDeviceInfo(deviceID, CL_DEVICE_MAX_PIPE_ARGS, sizeof(u), + &u, NULL); + test_error(error, "Unable to query CL_DEVICE_MAX_PIPE_ARGS"); + test_assert_error(u == 0, + "CL_DEVICE_PIPE_SUPPORT returned CL_FALSE, but " + "CL_DEVICE_MAX_PIPE_ARGS returned a non-zero value"); + + error = + clGetDeviceInfo(deviceID, CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS, + sizeof(u), &u, NULL); + test_error(error, + "Unable to query CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS"); + test_assert_error(u == 0, + "CL_DEVICE_PIPE_SUPPORT returned CL_FALSE, but " + "CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS returned " + "a non-zero value"); + + error = clGetDeviceInfo(deviceID, CL_DEVICE_PIPE_MAX_PACKET_SIZE, + sizeof(u), &u, NULL); + test_error(error, "Unable to query CL_DEVICE_PIPE_MAX_PACKET_SIZE"); + test_assert_error( + u == 0, + "CL_DEVICE_PIPE_SUPPORT returned CL_FALSE, but " + "CL_DEVICE_PIPE_MAX_PACKET_SIZE returned a non-zero value"); + + // clCreatePipe + // Returns CL_INVALID_OPERATION if no devices in context support Pipes. + clMemWrapper mem = + clCreatePipe(context, CL_MEM_HOST_NO_ACCESS, 4, 4, NULL, &error); + test_failure_error(error, CL_INVALID_OPERATION, + "CL_DEVICE_PIPE_SUPPORT returned CL_FALSE but " + "clCreatePipe did not return CL_INVALID_OPERATION"); + + // clGetPipeInfo + // Returns CL_INVALID_MEM_OBJECT since pipe cannot be a valid pipe + // object. + clMemWrapper not_a_pipe = + clCreateBuffer(context, CL_MEM_READ_WRITE, 4, NULL, &error); + test_error(error, "Unable to create non-pipe buffer"); + + error = + clGetPipeInfo(not_a_pipe, CL_PIPE_PACKET_SIZE, sizeof(u), &u, NULL); + test_failure_error( + error, CL_INVALID_MEM_OBJECT, + "CL_DEVICE_PIPE_SUPPORT returned CL_FALSE but clGetPipeInfo did " + "not return CL_INVALID_MEM_OBJECT"); + } + else + { + // Devices that support pipes must also return CL_TRUE + // for CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT. + cl_bool b; + error = + clGetDeviceInfo(deviceID, CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT, + sizeof(b), &b, NULL); + test_error(error, + "Unable to query CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT"); + test_assert_error( + b == CL_TRUE, + "CL_DEVICE_PIPE_SUPPORT returned CL_TRUE but " + "CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT returned CL_FALSE"); + } + + return TEST_PASS; +} + +int test_consistency_progvar(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements) +{ + // clGetDeviceInfo, passing CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE + // May return 0, indicating that device does not support Program Scope + // Global Variables. + cl_int error; + + clProgramWrapper program; + clKernelWrapper kernel; + + size_t maxGlobalVariableSize = 0; + error = clGetDeviceInfo(deviceID, CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE, + sizeof(maxGlobalVariableSize), + &maxGlobalVariableSize, NULL); + test_error(error, "Unable to query CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE"); + + if (maxGlobalVariableSize == 0) + { + // Test setup: + + error = create_single_kernel_helper(context, &program, &kernel, 1, + &test_kernel, "test"); + test_error(error, "Unable to create test kernel"); + + size_t sz = SIZE_MAX; + + // clGetDeviceInfo, passing + // CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE + // Returns 0 if device does not support Program Scope Global Variables. + + error = clGetDeviceInfo(deviceID, + CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE, + sizeof(sz), &sz, NULL); + test_error( + error, + "Unable to query CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE"); + test_assert_error( + sz == 0, + "CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE returned 0 but " + "CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE returned a " + "non-zero value"); + + // clGetProgramBuildInfo, passing + // CL_PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE + // Returns 0 if device does not support Program Scope Global Variables. + + error = clGetProgramBuildInfo( + program, deviceID, CL_PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE, + sizeof(sz), &sz, NULL); + test_error( + error, + "Unable to query CL_PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE"); + test_assert_error(sz == 0, + "CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE returned 0 " + "but CL_PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE " + "returned a non-zero value"); + } + + return TEST_PASS; +} + +int test_consistency_non_uniform_work_group(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements) +{ + // clGetDeviceInfo, passing CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT: + // May return CL_FALSE, indicating that device does not support Non-Uniform + // Work Groups. + cl_int error; + + const size_t allocSize = 16; + clMemWrapper mem; + clProgramWrapper program; + clKernelWrapper kernel; + + cl_bool nonUniformWorkGroupSupport = CL_FALSE; + error = clGetDeviceInfo(deviceID, CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT, + sizeof(nonUniformWorkGroupSupport), + &nonUniformWorkGroupSupport, NULL); + test_error(error, + "Unable to query CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT"); + + if (nonUniformWorkGroupSupport == CL_FALSE) + { + // Test setup: + + mem = + clCreateBuffer(context, CL_MEM_READ_WRITE, allocSize, NULL, &error); + test_error(error, "Unable to create test buffer"); + + error = create_single_kernel_helper(context, &program, &kernel, 1, + &test_kernel, "test"); + test_error(error, "Unable to create test kernel"); + + error = clSetKernelArg(kernel, 0, sizeof(mem), &mem); + + // clEnqueueNDRangeKernel + // Behaves as though Non-Uniform Work Groups were not enabled for + // kernel, if the device associated with command_queue does not support + // Non-Uniform Work Groups. + + size_t global_work_size[] = { 3, 3, 3 }; + size_t local_work_size[] = { 2, 2, 2 }; + + // First, check that a NULL local work size succeeds. + error = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, global_work_size, + NULL, 0, NULL, NULL); + test_error(error, + "Unable to enqueue kernel with a NULL local work size"); + + error = clFinish(queue); + test_error(error, "Error calling clFinish after NULL local work size"); + + // 1D non-uniform work group: + error = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, global_work_size, + local_work_size, 0, NULL, NULL); + test_failure_error( + error, CL_INVALID_WORK_GROUP_SIZE, + "CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT returned CL_FALSE but 1D " + "clEnqueueNDRangeKernel did not return CL_INVALID_WORK_GROUP_SIZE"); + + // 2D non-uniform work group: + global_work_size[0] = local_work_size[0]; + error = clEnqueueNDRangeKernel(queue, kernel, 2, NULL, global_work_size, + local_work_size, 0, NULL, NULL); + test_failure_error( + error, CL_INVALID_WORK_GROUP_SIZE, + "CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT returned CL_FALSE but 2D " + "clEnqueueNDRangeKernel did not return CL_INVALID_WORK_GROUP_SIZE"); + + // 3D non-uniform work group: + global_work_size[1] = local_work_size[1]; + error = clEnqueueNDRangeKernel(queue, kernel, 3, NULL, global_work_size, + local_work_size, 0, NULL, NULL); + test_failure_error( + error, CL_INVALID_WORK_GROUP_SIZE, + "CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT returned CL_FALSE but 3D " + "clEnqueueNDRangeKernel did not return CL_INVALID_WORK_GROUP_SIZE"); + } + + return TEST_PASS; +} + +int test_consistency_read_write_images(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, int num_elements) +{ + // clGetDeviceInfo, passing + // CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS May return 0, + // indicating that device does not support Read-Write Images. + cl_int error; + + cl_uint maxReadWriteImageArgs = 0; + error = clGetDeviceInfo(deviceID, CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS, + sizeof(maxReadWriteImageArgs), + &maxReadWriteImageArgs, NULL); + test_error(error, + "Unable to query " + "CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS"); + + // clGetSupportedImageFormats, passing + // CL_MEM_KERNEL_READ_AND_WRITE + // Returns an empty set (such as num_image_formats equal to 0), indicating + // that no image formats are supported for reading and writing in the same + // kernel, if no devices in context support Read-Write Images. + + cl_uint totalReadWriteImageFormats = 0; + + const cl_mem_object_type image_types[] = { + CL_MEM_OBJECT_IMAGE1D, CL_MEM_OBJECT_IMAGE1D_BUFFER, + CL_MEM_OBJECT_IMAGE2D, CL_MEM_OBJECT_IMAGE3D, + CL_MEM_OBJECT_IMAGE1D_ARRAY, CL_MEM_OBJECT_IMAGE2D_ARRAY, + }; + for (int i = 0; i < ARRAY_SIZE(image_types); i++) + { + cl_uint numImageFormats = 0; + error = clGetSupportedImageFormats( + context, CL_MEM_KERNEL_READ_AND_WRITE, image_types[i], 0, NULL, + &numImageFormats); + test_error(error, + "Unable to query number of CL_MEM_KERNEL_READ_AND_WRITE " + "image formats"); + + totalReadWriteImageFormats += numImageFormats; + } + + if (maxReadWriteImageArgs == 0) + { + test_assert_error( + totalReadWriteImageFormats == 0, + "CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS returned 0 " + "but clGetSupportedImageFormats(CL_MEM_KERNEL_READ_AND_WRITE) " + "returned a non-empty set"); + } + else + { + test_assert_error( + totalReadWriteImageFormats != 0, + "CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS is non-zero " + "but clGetSupportedImageFormats(CL_MEM_KERNEL_READ_AND_WRITE) " + "returned an empty set"); + } + + return TEST_PASS; +} + +int test_consistency_2d_image_from_buffer(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements) +{ + // clGetDeviceInfo, passing CL_DEVICE_IMAGE_PITCH_ALIGNMENT or + // CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT + // May return 0, indicating that device does not support Creating a 2D Image + // from a Buffer. + cl_int error; + + const cl_image_format imageFormat = { CL_RGBA, CL_UNORM_INT8 }; + const size_t imageDim = 2; + const size_t elementSize = 4; + const size_t bufferSize = imageDim * imageDim * elementSize; + + clMemWrapper buffer; + clMemWrapper image; + + cl_uint imagePitchAlignment = 0; + error = clGetDeviceInfo(deviceID, CL_DEVICE_IMAGE_PITCH_ALIGNMENT, + sizeof(imagePitchAlignment), &imagePitchAlignment, + NULL); + test_error(error, + "Unable to query " + "CL_DEVICE_IMAGE_PITCH_ALIGNMENT"); + + cl_uint imageBaseAddressAlignment = 0; + error = clGetDeviceInfo(deviceID, CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT, + sizeof(imageBaseAddressAlignment), + &imageBaseAddressAlignment, NULL); + test_error(error, + "Unable to query " + "CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT"); + + bool supports_cl_khr_image2d_from_buffer = + is_extension_available(deviceID, "cl_khr_image2d_from_buffer"); + + if (imagePitchAlignment == 0 || imageBaseAddressAlignment == 0) + { + // This probably means that Creating a 2D Image from a Buffer is not + // supported. + + // Test setup: + buffer = + clCreateBuffer(context, CL_MEM_READ_ONLY, bufferSize, NULL, &error); + test_error(error, "Unable to create test buffer"); + + // Check that both queries return zero: + test_assert_error( + imagePitchAlignment == 0, + "CL_DEVICE_IMAGE_PITCH_ALIGNMENT returned a non-zero value but " + "CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT returned 0"); + test_assert_error( + imageBaseAddressAlignment == 0, + "CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT returned a non-zero value " + "but CL_DEVICE_IMAGE_PITCH_ALIGNMENT returned 0"); + + // clGetDeviceInfo, passing CL_DEVICE_EXTENSIONS + // Will not describe support for the cl_khr_image2d_from_buffer + // extension if device does not support Creating a 2D Image from a + // Buffer. + test_assert_error(supports_cl_khr_image2d_from_buffer == false, + "Device does not support Creating a 2D Image from a " + "Buffer but does support cl_khr_image2d_from_buffer"); + + // clCreateImage or clCreateImageWithProperties, passing image_type + // equal to CL_MEM_OBJECT_IMAGE2D and mem_object not equal to + // NULL + // Returns CL_INVALID_OPERATION if no devices in context support + // Creating a 2D Image from a Buffer. + + cl_image_desc imageDesc = { 0 }; + imageDesc.image_type = CL_MEM_OBJECT_IMAGE2D; + imageDesc.image_width = imageDim; + imageDesc.image_height = imageDim; + imageDesc.mem_object = buffer; + + image = clCreateImage(context, CL_MEM_READ_ONLY, &imageFormat, + &imageDesc, NULL, &error); + test_failure_error( + error, CL_INVALID_OPERATION, + "Device does not support Creating a 2D Image from a " + "Buffer but clCreateImage did not return CL_INVALID_OPERATION"); + + image = + clCreateImageWithProperties(context, NULL, CL_MEM_READ_ONLY, + &imageFormat, &imageDesc, NULL, &error); + test_failure_error(error, CL_INVALID_OPERATION, + "Device does not support Creating a 2D Image from a " + "Buffer but clCreateImageWithProperties did not " + "return CL_INVALID_OPERATION"); + } + else + { + test_assert_error(supports_cl_khr_image2d_from_buffer, + "Device supports Creating a 2D Image from a Buffer " + "but does not support cl_khr_image2d_from_buffer"); + } + + return TEST_PASS; +} + +// Nothing needed for sRGB Images: +// All of the sRGB Image Channel Orders (such as CL_​sRGBA) are optional for +// devices supporting OpenCL 3.0. + +int test_consistency_depth_images(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements) +{ + // The CL_DEPTH Image Channel Order is optional for devices supporting + // OpenCL 3.0. + cl_int error; + + cl_uint totalDepthImageFormats = 0; + + const cl_mem_flags mem_flags[] = { + CL_MEM_WRITE_ONLY, + CL_MEM_READ_WRITE, + CL_MEM_KERNEL_READ_AND_WRITE, + }; + for (int i = 0; i < ARRAY_SIZE(mem_flags); i++) + { + cl_uint numImageFormats = 0; + error = clGetSupportedImageFormats(context, mem_flags[i], + CL_MEM_OBJECT_IMAGE2D, 0, NULL, + &numImageFormats); + test_error( + error, + "Unable to query number of CL_MEM_OBJECT_IMAGE2D image formats"); + + std::vector imageFormats(numImageFormats); + error = clGetSupportedImageFormats( + context, mem_flags[i], CL_MEM_OBJECT_IMAGE2D, imageFormats.size(), + imageFormats.data(), NULL); + test_error(error, + "Unable to query CL_MEM_OBJECT_IMAGE2D image formats"); + for (auto& imageFormat : imageFormats) + { + if (imageFormat.image_channel_order == CL_DEPTH) + { + totalDepthImageFormats++; + } + } + } + + bool supports_cl_khr_depth_images = + is_extension_available(deviceID, "cl_khr_depth_images"); + + if (totalDepthImageFormats == 0) + { + test_assert_error(supports_cl_khr_depth_images == false, + "Device does not support Depth Images but does " + "support cl_khr_depth_images"); + } + else + { + test_assert_error(supports_cl_khr_depth_images, + "Device supports Depth Images but does not support " + "cl_khr_depth_images"); + } + + return TEST_PASS; +} + +int test_consistency_device_and_host_timer(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements) +{ + // clGetPlatformInfo, passing CL_PLATFORM_HOST_TIMER_RESOLUTION + // May return 0, indicating that platform does not support Device and Host + // Timer Synchronization. + cl_int error; + + cl_platform_id platform = NULL; + error = clGetDeviceInfo(deviceID, CL_DEVICE_PLATFORM, sizeof(platform), + &platform, NULL); + test_error(error, "Unable to query CL_DEVICE_PLATFORM"); + + cl_ulong hostTimerResolution = 0; + error = clGetPlatformInfo(platform, CL_PLATFORM_HOST_TIMER_RESOLUTION, + sizeof(hostTimerResolution), &hostTimerResolution, + NULL); + test_error(error, "Unable to query CL_PLATFORM_HOST_TIMER_RESOLUTION"); + + if (hostTimerResolution == 0) + { + // clGetDeviceAndHostTimer, clGetHostTimer + // Returns CL_INVALID_OPERATION if the platform associated with device + // does not support Device and Host Timer Synchronization. + + cl_ulong dt = 0; + cl_ulong ht = 0; + + error = clGetDeviceAndHostTimer(deviceID, &dt, &ht); + test_failure_error( + error, CL_INVALID_OPERATION, + "CL_PLATFORM_HOST_TIMER_RESOLUTION returned 0 but " + "clGetDeviceAndHostTimer did not return CL_INVALID_OPERATION"); + + error = clGetHostTimer(deviceID, &ht); + test_failure_error( + error, CL_INVALID_OPERATION, + "CL_PLATFORM_HOST_TIMER_RESOLUTION returned 0 but " + "clGetHostTimer did not return CL_INVALID_OPERATION"); + } + + return TEST_PASS; +} + +int test_consistency_il_programs(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements) +{ + // clGetDeviceInfo, passing CL_DEVICE_IL_VERSION or + // CL_DEVICE_ILS_WITH_VERSION + // May return an empty string and empty array, indicating that device does + // not support Intermediate Language Programs. + cl_int error; + + clProgramWrapper program; + clKernelWrapper kernel; + + // Even if the device does not support Intermediate Language Programs the + // size of the string query should not be zero. + size_t sz = SIZE_MAX; + error = clGetDeviceInfo(deviceID, CL_DEVICE_IL_VERSION, 0, NULL, &sz); + test_error(error, "Unable to query CL_DEVICE_IL_VERSION"); + test_assert_error(sz != 0, + "CL_DEVICE_IL_VERSION should return a non-zero size"); + + std::string ilVersion = get_device_il_version_string(deviceID); + + error = clGetDeviceInfo(deviceID, CL_DEVICE_ILS_WITH_VERSION, 0, NULL, &sz); + test_error(error, "Unable to query CL_DEVICE_ILS_WITH_VERSION"); + + if (ilVersion == "" || sz == 0) + { + // This probably means that Intermediate Language Programs are not + // supported. + + // Check that both queries are consistent: + test_assert_error( + ilVersion == "", + "CL_DEVICE_IL_VERSION returned a non-empty string but " + "CL_DEVICE_ILS_WITH_VERSION returned no supported ILs"); + + test_assert_error(sz == 0, + "CL_DEVICE_ILS_WITH_VERSION returned supported ILs " + "but CL_DEVICE_IL_VERSION returned an empty string"); + + bool supports_cl_khr_il_program = + is_extension_available(deviceID, "cl_khr_il_program"); + test_assert_error(supports_cl_khr_il_program == false, + "Device does not support IL Programs but does " + "support cl_khr_il_program"); + + // Test setup: + + error = create_single_kernel_helper(context, &program, &kernel, 1, + &test_kernel, "test"); + test_error(error, "Unable to create test kernel"); + + // clGetProgramInfo, passing CL_PROGRAM_IL + // Returns an empty buffer (such as param_value_size_ret equal to 0) if + // no devices in the context associated with program support + // Intermediate Language Programs. + + error = clGetProgramInfo(program, CL_PROGRAM_IL, 0, NULL, &sz); + test_error(error, "Unable to query CL_PROGRAM_IL"); + test_assert_error(sz == 0, + "Device does not support IL Programs but " + "CL_PROGRAM_IL returned a non-zero size"); + + // clCreateProgramWithIL + // Returns CL_INVALID_OPERATION if no devices in context support + // Intermediate Language Programs. + + cl_uint bogus = 0xDEADBEEF; + clProgramWrapper ilProgram = + clCreateProgramWithIL(context, &bogus, sizeof(bogus), &error); + test_failure_error( + error, CL_INVALID_OPERATION, + "Device does not support IL Programs but clCreateProgramWithIL did " + "not return CL_INVALID_OPERATION"); + + // clSetProgramSpecializationConstant + // Returns CL_INVALID_OPERATION if no devices associated with program + // support Intermediate Language Programs. + + cl_uint specConst = 42; + error = clSetProgramSpecializationConstant( + program, 0, sizeof(specConst), &specConst); + test_failure_error(error, CL_INVALID_OPERATION, + "Device does not support IL Programs but " + "clSetProgramSpecializationConstant did not return " + "CL_INVALID_OPERATION"); + } + + return TEST_PASS; +} + +int test_consistency_subgroups(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements) +{ + // clGetDeviceInfo, passing CL_DEVICE_MAX_NUM_SUB_GROUPS + // May return 0, indicating that device does not support Subgroups. + cl_int error; + + clProgramWrapper program; + clKernelWrapper kernel; + + cl_uint maxNumSubGroups = 0; + error = clGetDeviceInfo(deviceID, CL_DEVICE_MAX_NUM_SUB_GROUPS, + sizeof(maxNumSubGroups), &maxNumSubGroups, NULL); + test_error(error, "Unable to query CL_DEVICE_MAX_NUM_SUB_GROUPS"); + + if (maxNumSubGroups == 0) + { + // Test setup: + + error = create_single_kernel_helper(context, &program, &kernel, 1, + &test_kernel, "test"); + test_error(error, "Unable to create test kernel"); + + // clGetDeviceInfo, passing + // CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS + // Returns CL_FALSE if device does not support Subgroups. + + cl_bool ifp = CL_FALSE; + error = clGetDeviceInfo( + deviceID, CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS, + sizeof(ifp), &ifp, NULL); + test_error( + error, + "Unable to query CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS"); + test_assert_error(ifp == CL_FALSE, + "Device does not support Subgroups but " + "CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS " + "did not return CL_FALSE"); + + // clGetDeviceInfo, passing CL_DEVICE_EXTENSIONS + // Will not describe support for the cl_khr_subgroups extension if + // device does not support Subgroups. + + bool supports_cl_khr_subgroups = + is_extension_available(deviceID, "cl_khr_subgroups"); + test_assert_error(supports_cl_khr_subgroups == false, + "Device does not support Subgroups but does " + "support cl_khr_subgroups"); + + // clGetKernelSubGroupInfo + // Returns CL_INVALID_OPERATION if device does not support Subgroups. + + size_t sz = SIZE_MAX; + error = clGetKernelSubGroupInfo(kernel, deviceID, + CL_KERNEL_MAX_NUM_SUB_GROUPS, 0, NULL, + sizeof(sz), &sz, NULL); + test_failure_error( + error, CL_INVALID_OPERATION, + "Device does not support Subgroups but clGetKernelSubGroupInfo did " + "not return CL_INVALID_OPERATION"); + } + + return TEST_PASS; +} + +static void CL_CALLBACK program_callback(cl_program, void*) {} + +int test_consistency_prog_ctor_dtor(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements) +{ + cl_int error; + + clProgramWrapper program; + clKernelWrapper kernel; + + // Test setup: + + error = create_single_kernel_helper(context, &program, &kernel, 1, + &test_kernel, "test"); + test_error(error, "Unable to create test kernel"); + + // clGetProgramInfo, passing CL_PROGRAM_SCOPE_GLOBAL_CTORS_PRESENT or + // CL_PROGRAM_SCOPE_GLOBAL_DTORS_PRESENT + // Returns CL_FALSE if no devices in the context associated with program + // support Program Initialization and Clean-Up Kernels. + + cl_bool b = CL_FALSE; + + error = clGetProgramInfo(program, CL_PROGRAM_SCOPE_GLOBAL_CTORS_PRESENT, + sizeof(b), &b, NULL); + test_error(error, "Unable to query CL_PROGRAM_SCOPE_GLOBAL_CTORS_PRESENT"); + test_assert_error( + b == CL_FALSE, + "CL_PROGRAM_SCOPE_GLOBAL_CTORS_PRESENT did not return CL_FALSE"); + + error = clGetProgramInfo(program, CL_PROGRAM_SCOPE_GLOBAL_DTORS_PRESENT, + sizeof(b), &b, NULL); + test_error(error, "Unable to query CL_PROGRAM_SCOPE_GLOBAL_DTORS_PRESENT"); + test_assert_error( + b == CL_FALSE, + "CL_PROGRAM_SCOPE_GLOBAL_DTORS_PRESENT did not return CL_FALSE"); + + // clSetProgramReleaseCallback + // Returns CL_INVALID_OPERATION if no devices in the context associated with + // program support Program Initialization and Clean-Up Kernels. + + error = clSetProgramReleaseCallback(program, program_callback, NULL); + test_failure_error( + error, CL_INVALID_OPERATION, + "clSetProgramReleaseCallback did not return CL_INVALID_OPERATION"); + + return TEST_PASS; +} + +int test_consistency_3d_image_writes(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements) +{ + // clGetSupportedImageFormats, passing CL_MEM_OBJECT_IMAGE3D and one of + // CL_MEM_WRITE_ONLY, CL_MEM_READ_WRITE, or CL_MEM_KERNEL_READ_AND_WRITE + // Returns an empty set (such as num_image_formats equal to 0), + // indicating that no image formats are supported for writing to 3D + // image objects, if no devices in context support Writing to 3D Image + // Objects. + cl_int error; + + cl_uint total3DImageWriteFormats = 0; + + const cl_mem_flags mem_flags[] = { + CL_MEM_WRITE_ONLY, + CL_MEM_READ_WRITE, + CL_MEM_KERNEL_READ_AND_WRITE, + }; + for (int i = 0; i < ARRAY_SIZE(mem_flags); i++) + { + cl_uint numImageFormats = 0; + error = clGetSupportedImageFormats(context, mem_flags[i], + CL_MEM_OBJECT_IMAGE3D, 0, NULL, + &numImageFormats); + test_error( + error, + "Unable to query number of CL_MEM_OBJECT_IMAGE3D image formats"); + + total3DImageWriteFormats += numImageFormats; + } + + bool supports_cl_khr_3d_image_writes = + is_extension_available(deviceID, "cl_khr_3d_image_writes"); + + if (total3DImageWriteFormats == 0) + { + // clGetDeviceInfo, passing CL_DEVICE_EXTENSIONS + // Will not describe support for the cl_khr_3d_image_writes extension if + // device does not support Writing to 3D Image Objects. + test_assert_error(supports_cl_khr_3d_image_writes == false, + "Device does not support Writing to 3D Image Objects " + "but does support cl_khr_3d_image_writes"); + } + else + { + test_assert_error(supports_cl_khr_3d_image_writes, + "Device supports Writing to 3D Image Objects but " + "does not support cl_khr_3d_image_writes"); + } + + return TEST_PASS; +} diff --git a/test_conformance/api/test_api_min_max.c b/test_conformance/api/test_api_min_max.c deleted file mode 100644 index fafa58f5..00000000 --- a/test_conformance/api/test_api_min_max.c +++ /dev/null @@ -1,2123 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "testBase.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/testHarness.h" -#include -#include - -extern cl_uint gRandomSeed; - -const char *sample_single_param_kernel[] = { - "__kernel void sample_test(__global int *src)\n" - "{\n" - " int tid = get_global_id(0);\n" - "\n" - "}\n" }; - -const char *sample_single_param_write_kernel[] = { - "__kernel void sample_test(__global int *src)\n" - "{\n" - " int tid = get_global_id(0);\n" - " src[tid] = tid;\n" - "\n" - "}\n" }; - -const char *sample_read_image_kernel_pattern[] = { - "__kernel void sample_test( __global float *result, ", " )\n" - "{\n" - " sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP | CLK_FILTER_NEAREST;\n" - " int tid = get_global_id(0);\n" - " result[0] = 0.0f;\n", - "\n" - "}\n" }; - -const char *sample_write_image_kernel_pattern[] = { - "__kernel void sample_test( ", " )\n" - "{\n" - " int tid = get_global_id(0);\n", - "\n" - "}\n" }; - - -const char *sample_large_parmam_kernel_pattern[] = { - "__kernel void sample_test(%s, __global long *result)\n" - "{\n" - "result[0] = 0;\n" - "%s" - "\n" - "}\n" }; - -const char *sample_large_int_parmam_kernel_pattern[] = { - "__kernel void sample_test(%s, __global int *result)\n" - "{\n" - "result[0] = 0;\n" - "%s" - "\n" - "}\n" }; - -const char *sample_sampler_kernel_pattern[] = { - "__kernel void sample_test( read_only image2d_t src, __global int4 *dst", ", sampler_t sampler%d", ")\n" - "{\n" - " int tid = get_global_id(0);\n", - " dst[ 0 ] = read_imagei( src, sampler%d, (int2)( 0, 0 ) );\n", - "\n" - "}\n" }; - -const char *sample_const_arg_kernel[] = { - "__kernel void sample_test(__constant int *src1, __global int *dst)\n" - "{\n" - " int tid = get_global_id(0);\n" - "\n" - " dst[tid] = src1[tid];\n" - "\n" - "}\n" }; - -const char *sample_local_arg_kernel[] = { - "__kernel void sample_test(__local int *src1, __global int *global_src, __global int *dst)\n" - "{\n" - " int tid = get_global_id(0);\n" - "\n" - " src1[tid] = global_src[tid];\n" - " barrier(CLK_GLOBAL_MEM_FENCE);\n" - " dst[tid] = src1[tid];\n" - "\n" - "}\n" }; - -const char *sample_const_max_arg_kernel_pattern = -"__kernel void sample_test(__constant int *src1 %s, __global int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = src1[tid];\n" -"%s" -"\n" -"}\n"; - -int test_min_max_thread_dimensions(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error, retVal; - unsigned int maxThreadDim, threadDim, i; - clProgramWrapper program; - clKernelWrapper kernel; - clMemWrapper streams[1]; - size_t *threads, *localThreads; - cl_event event; - cl_int event_status; - - - /* Get the max thread dimensions */ - error = clGetDeviceInfo( deviceID, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, sizeof( maxThreadDim ), &maxThreadDim, NULL ); - test_error( error, "Unable to get max work item dimensions from device" ); - - if( maxThreadDim < 3 ) - { - log_error( "ERROR: Reported max work item dimensions is less than required! (%d)\n", maxThreadDim ); - return -1; - } - - log_info("Reported max thread dimensions of %d.\n", maxThreadDim); - - /* Create a kernel to test with */ - if( create_single_kernel_helper( context, &program, &kernel, 1, sample_single_param_kernel, "sample_test" ) != 0 ) - { - return -1; - } - - /* Create some I/O streams */ - streams[0] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int) * 100, NULL, &error ); - if( streams[0] == NULL ) - { - log_error("ERROR: Creating test array failed!\n"); - return -1; - } - - /* Set the arguments */ - error = clSetKernelArg( kernel, 0, sizeof( streams[0] ), &streams[0] ); - test_error( error, "Unable to set kernel arguments" ); - - retVal = 0; - - /* Now try running the kernel with up to that many threads */ - for (threadDim=1; threadDim <= maxThreadDim; threadDim++) - { - threads = (size_t *)malloc( sizeof( size_t ) * maxThreadDim ); - localThreads = (size_t *)malloc( sizeof( size_t ) * maxThreadDim ); - for( i = 0; i < maxThreadDim; i++ ) - { - threads[ i ] = 1; - localThreads[i] = 1; - } - - error = clEnqueueNDRangeKernel( queue, kernel, maxThreadDim, NULL, threads, localThreads, 0, NULL, &event ); - test_error( error, "Failed clEnqueueNDRangeKernel"); - - // Verify that the event does not return an error from the execution - error = clWaitForEvents(1, &event); - test_error( error, "clWaitForEvent failed"); - error = clGetEventInfo(event, CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(event_status), &event_status, NULL); - test_error( error, "clGetEventInfo for CL_EVENT_COMMAND_EXECUTION_STATUS failed"); - clReleaseEvent(event); - if (event_status < 0) - test_error(error, "Kernel execution event returned error"); - - /* All done */ - free( threads ); - free( localThreads ); - } - - return retVal; -} - - -int test_min_max_work_items_sizes(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - size_t *deviceMaxWorkItemSize; - unsigned int maxWorkItemDim; - - /* Get the max work item dimensions */ - error = clGetDeviceInfo( deviceID, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, sizeof( maxWorkItemDim ), &maxWorkItemDim, NULL ); - test_error( error, "Unable to get max work item dimensions from device" ); - - log_info("CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS returned %d\n", maxWorkItemDim); - deviceMaxWorkItemSize = (size_t*)malloc(sizeof(size_t)*maxWorkItemDim); - error = clGetDeviceInfo( deviceID, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(size_t)*maxWorkItemDim, deviceMaxWorkItemSize, NULL ); - test_error( error, "clDeviceInfo for CL_DEVICE_MAX_WORK_ITEM_SIZES failed" ); - - unsigned int i; - int errors = 0; - for(i=0; i= 128 && maxParameterSize == 1024) - { - error = clGetDeviceInfo( deviceID, CL_DEVICE_TYPE, sizeof( deviceType ), &deviceType, NULL ); - test_error( error, "Unable to get device type from device" ); - - if(deviceType != CL_DEVICE_TYPE_CUSTOM) - { - maxReadImages = 127; - } - } - // Subtract the size of the result - maxParameterSize -= deviceAddressSize; - - // Calculate the number we can use - if (maxParameterSize/deviceAddressSize < maxReadImages) { - log_info("WARNING: Max parameter size of %d bytes limits test to %d max image arguments.\n", (int)maxParameterSize, (int)(maxParameterSize/deviceAddressSize)); - maxReadImages = (unsigned int)(maxParameterSize/deviceAddressSize); - } - - /* Create a program with that many read args */ - programSrc = (char *)malloc( strlen( sample_read_image_kernel_pattern[ 0 ] ) + ( strlen( readArgPattern ) + 6 ) * ( maxReadImages ) + - strlen( sample_read_image_kernel_pattern[ 1 ] ) + 1 + 40240); - - strcpy( programSrc, sample_read_image_kernel_pattern[ 0 ] ); - strcat( programSrc, "read_only image2d_t srcimg0" ); - for( i = 0; i < maxReadImages-1; i++ ) - { - sprintf( readArgLine, readArgPattern, i+1 ); - strcat( programSrc, readArgLine ); - } - strcat( programSrc, sample_read_image_kernel_pattern[ 1 ] ); - for ( i = 0; i < maxReadImages; i++) { - sprintf( readArgLine, "\tresult[0] += read_imagef( srcimg%d, sampler, (int2)(0,0)).x;\n", i); - strcat( programSrc, readArgLine ); - } - strcat( programSrc, sample_read_image_kernel_pattern[ 2 ] ); - - error = create_single_kernel_helper(context, &program, &kernel, 1, (const char **)&programSrc, "sample_test"); - test_error( error, "Failed to create the program and kernel."); - free( programSrc ); - - result = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_float), NULL, &error); - test_error( error, "clCreateBufer failed"); - - /* Create some I/O streams */ - streams = new clMemWrapper[maxReadImages + 1]; - for( i = 0; i < maxReadImages; i++ ) - { - image_data[0]=i; - image_result+= image_data[0]; - streams[i] = create_image_2d( context, CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR, &image_format_desc, 4, 4, 0, image_data, &error ); - test_error( error, "Unable to allocate test image" ); - } - - error = clSetKernelArg( kernel, 0, sizeof( result ), &result ); - test_error( error, "Unable to set kernel arguments" ); - - /* Set the arguments */ - for( i = 1; i < maxReadImages+1; i++ ) - { - error = clSetKernelArg( kernel, i, sizeof( streams[i-1] ), &streams[i-1] ); - test_error( error, "Unable to set kernel arguments" ); - } - - /* Now try running the kernel */ - threads[0] = threads[1] = 1; - error = clEnqueueNDRangeKernel( queue, kernel, 2, NULL, threads, NULL, 0, NULL, &event ); - test_error( error, "clEnqueueNDRangeKernel failed"); - - // Verify that the event does not return an error from the execution - error = clWaitForEvents(1, &event); - test_error( error, "clWaitForEvent failed"); - error = clGetEventInfo(event, CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(event_status), &event_status, NULL); - test_error( error, "clGetEventInfo for CL_EVENT_COMMAND_EXECUTION_STATUS failed"); - clReleaseEvent(event); - if (event_status < 0) - test_error(error, "Kernel execution event returned error"); - - error = clEnqueueReadBuffer(queue, result, CL_TRUE, 0, sizeof(cl_float), &actual_image_result, 0, NULL, NULL); - test_error(error, "clEnqueueReadBuffer failed"); - - delete[] streams; - - if (actual_image_result != image_result) { - log_error("Result failed to verify. Got %g, expected %g.\n", actual_image_result, image_result); - return 1; - } - - return 0; -} - -int test_min_max_write_image_args(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - unsigned int maxWriteImages, i; - clProgramWrapper program; - char writeArgLine[128], *programSrc; - const char *writeArgPattern = ", write_only image2d_t dstimg%d"; - clKernelWrapper kernel; - clMemWrapper *streams; - size_t threads[2]; - cl_image_format image_format_desc; - size_t maxParameterSize; - cl_event event; - cl_int event_status; - cl_uint minRequiredWriteImages = gIsEmbedded ? 1 : 8; - - - PASSIVE_REQUIRE_IMAGE_SUPPORT( deviceID ) - image_format_desc.image_channel_order = CL_RGBA; - image_format_desc.image_channel_data_type = CL_UNORM_INT8; - - /* Get the max read image arg count */ - error = clGetDeviceInfo( deviceID, CL_DEVICE_MAX_WRITE_IMAGE_ARGS, sizeof( maxWriteImages ), &maxWriteImages, NULL ); - test_error( error, "Unable to get max write image arg count from device" ); - - if( maxWriteImages == 0 ) - { - log_info( "WARNING: Device reports 0 for a max write image arg count (write image arguments unsupported). Skipping test (implicitly passes). This is only valid if the number of image formats is also 0.\n" ); - return 0; - } - - if( maxWriteImages < minRequiredWriteImages ) - { - log_error( "ERROR: Reported max write image arg count is less than required! (%d)\n", maxWriteImages ); - return -1; - } - - log_info("Reported %d max write image args.\n", maxWriteImages); - - error = clGetDeviceInfo( deviceID, CL_DEVICE_MAX_PARAMETER_SIZE, sizeof( maxParameterSize ), &maxParameterSize, NULL ); - test_error( error, "Unable to get max parameter size from device" ); - - // Calculate the number we can use - if (maxParameterSize/sizeof(cl_mem) < maxWriteImages) { - log_info("WARNING: Max parameter size of %d bytes limits test to %d max image arguments.\n", (int)maxParameterSize, (int)(maxParameterSize/sizeof(cl_mem))); - maxWriteImages = (unsigned int)(maxParameterSize/sizeof(cl_mem)); - } - - /* Create a program with that many write args + 1 */ - programSrc = (char *)malloc( strlen( sample_write_image_kernel_pattern[ 0 ] ) + ( strlen( writeArgPattern ) + 6 ) * ( maxWriteImages + 1 ) + - strlen( sample_write_image_kernel_pattern[ 1 ] ) + 1 + 40240 ); - - strcpy( programSrc, sample_write_image_kernel_pattern[ 0 ] ); - strcat( programSrc, "write_only image2d_t dstimg0" ); - for( i = 1; i < maxWriteImages; i++ ) - { - sprintf( writeArgLine, writeArgPattern, i ); - strcat( programSrc, writeArgLine ); - } - strcat( programSrc, sample_write_image_kernel_pattern[ 1 ] ); - for ( i = 0; i < maxWriteImages; i++) { - sprintf( writeArgLine, "\twrite_imagef( dstimg%d, (int2)(0,0), (float4)(0,0,0,0));\n", i); - strcat( programSrc, writeArgLine ); - } - strcat( programSrc, sample_write_image_kernel_pattern[ 2 ] ); - - error = create_single_kernel_helper(context, &program, &kernel, 1, (const char **)&programSrc, "sample_test"); - test_error( error, "Failed to create the program and kernel."); - free( programSrc ); - - - /* Create some I/O streams */ - streams = new clMemWrapper[maxWriteImages + 1]; - for( i = 0; i < maxWriteImages; i++ ) - { - streams[i] = create_image_2d( context, CL_MEM_READ_WRITE, &image_format_desc, 16, 16, 0, NULL, &error ); - test_error( error, "Unable to allocate test image" ); - } - - /* Set the arguments */ - for( i = 0; i < maxWriteImages; i++ ) - { - error = clSetKernelArg( kernel, i, sizeof( streams[i] ), &streams[i] ); - test_error( error, "Unable to set kernel arguments" ); - } - - /* Now try running the kernel */ - threads[0] = threads[1] = 16; - error = clEnqueueNDRangeKernel( queue, kernel, 2, NULL, threads, NULL, 0, NULL, &event ); - test_error( error, "clEnqueueNDRangeKernel failed."); - - // Verify that the event does not return an error from the execution - error = clWaitForEvents(1, &event); - test_error( error, "clWaitForEvent failed"); - error = clGetEventInfo(event, CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(event_status), &event_status, NULL); - test_error( error, "clGetEventInfo for CL_EVENT_COMMAND_EXECUTION_STATUS failed"); - clReleaseEvent(event); - if (event_status < 0) - test_error(error, "Kernel execution event returned error"); - - /* All done */ - delete[] streams; - return 0; -} - -int test_min_max_mem_alloc_size(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - cl_ulong maxAllocSize, memSize, minSizeToTry; - clMemWrapper memHdl; - - cl_ulong requiredAllocSize; - - if (gIsEmbedded) - requiredAllocSize = 1 * 1024 * 1024; - else - requiredAllocSize = 128 * 1024 * 1024; - - /* Get the max mem alloc size */ - error = clGetDeviceInfo( deviceID, CL_DEVICE_MAX_MEM_ALLOC_SIZE, sizeof( maxAllocSize ), &maxAllocSize, NULL ); - test_error( error, "Unable to get max mem alloc size from device" ); - - error = clGetDeviceInfo( deviceID, CL_DEVICE_GLOBAL_MEM_SIZE, sizeof( memSize ), &memSize, NULL ); - test_error( error, "Unable to get global memory size from device" ); - - if (memSize > (cl_ulong)SIZE_MAX) { - memSize = (cl_ulong)SIZE_MAX; - } - - if( maxAllocSize < requiredAllocSize) - { - log_error( "ERROR: Reported max allocation size is less than required %lldMB! (%llu or %lluMB, from a total mem size of %lldMB)\n", (requiredAllocSize / 1024) / 1024, maxAllocSize, (maxAllocSize / 1024)/1024, (memSize / 1024)/1024 ); - return -1; - } - - requiredAllocSize = ((memSize / 4) > (1024 * 1024 * 1024)) ? 1024 * 1024 * 1024 : memSize / 4; - - if (gIsEmbedded) - requiredAllocSize = (requiredAllocSize < 1 * 1024 * 1024) ? 1 * 1024 * 1024 : requiredAllocSize; - else - requiredAllocSize = (requiredAllocSize < 128 * 1024 * 1024) ? 128 * 1024 * 1024 : requiredAllocSize; - - if( maxAllocSize < requiredAllocSize ) - { - log_error( "ERROR: Reported max allocation size is less than required of total memory! (%llu or %lluMB, from a total mem size of %lluMB)\n", maxAllocSize, (maxAllocSize / 1024)/1024, (requiredAllocSize / 1024)/1024 ); - return -1; - } - - log_info("Reported max allocation size of %lld bytes (%gMB) and global mem size of %lld bytes (%gMB).\n", - maxAllocSize, maxAllocSize/(1024.0*1024.0), requiredAllocSize, requiredAllocSize/(1024.0*1024.0)); - - if ( memSize < maxAllocSize ) { - log_info("Global memory size is less than max allocation size, using that.\n"); - maxAllocSize = memSize; - } - - minSizeToTry = maxAllocSize/16; - while (maxAllocSize > (maxAllocSize/4)) { - - log_info("Trying to create a buffer of size of %lld bytes (%gMB).\n", maxAllocSize, (double)maxAllocSize/(1024.0*1024.0)); - memHdl = clCreateBuffer( context, CL_MEM_READ_ONLY, (size_t)maxAllocSize, NULL, &error ); - if (error == CL_MEM_OBJECT_ALLOCATION_FAILURE || error == CL_OUT_OF_RESOURCES || error == CL_OUT_OF_HOST_MEMORY) { - log_info("\tAllocation failed at size of %lld bytes (%gMB).\n", maxAllocSize, (double)maxAllocSize/(1024.0*1024.0)); - maxAllocSize -= minSizeToTry; - continue; - } - test_error( error, "clCreateBuffer failed for maximum sized buffer."); - return 0; - } - log_error("Failed to allocate even %lld bytes (%gMB).\n", maxAllocSize, (double)maxAllocSize/(1024.0*1024.0)); - return -1; -} - -int test_min_max_image_2d_width(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - size_t maxDimension; - clMemWrapper streams[1]; - cl_image_format image_format_desc; - cl_ulong maxAllocSize; - cl_uint minRequiredDimension; - cl_char buffer[ 4098 ]; - size_t length; - - - PASSIVE_REQUIRE_IMAGE_SUPPORT( deviceID ) - - // Device version should fit the regex "OpenCL [0-9]+\.[0-9]+ *.*" - error = clGetDeviceInfo( deviceID, CL_DEVICE_VERSION, sizeof( buffer ), buffer, &length ); - test_error( error, "Unable to get device version string" ); - if( memcmp( buffer, "OpenCL 2.0", strlen( "OpenCL 2.0" ) ) == 0 ) - minRequiredDimension = gIsEmbedded ? 2048 : 8192; - else if( memcmp( buffer, "OpenCL 2.1", strlen( "OpenCL 2.1" ) ) == 0 ) - minRequiredDimension = gIsEmbedded ? 2048 : 8192; - else if( memcmp( buffer, "OpenCL 1.2", strlen( "OpenCL 1.2" ) ) == 0 ) - minRequiredDimension = gIsEmbedded ? 2048 : 8192; - else if( memcmp( buffer, "OpenCL 1.1", strlen( "OpenCL 1.1" ) ) == 0 ) - minRequiredDimension = gIsEmbedded ? 2048 : 8192; - else if ( memcmp( buffer, "OpenCL 1.0", strlen( "OpenCL 1.0" ) ) == 0 ) - minRequiredDimension = gIsEmbedded ? 2048 : 4096; - else - { - log_error( "ERROR: device version string does not match required format! (returned: %s)\n", (char *)buffer ); - return -1; - } - - - /* Just get any ol format to test with */ - error = get_8_bit_image_format( context, CL_MEM_OBJECT_IMAGE2D, CL_MEM_READ_WRITE, 0, &image_format_desc ); - test_error( error, "Unable to obtain suitable image format to test with!" ); - - /* Get the max 2d image width */ - error = clGetDeviceInfo( deviceID, CL_DEVICE_IMAGE2D_MAX_WIDTH, sizeof( maxDimension ), &maxDimension, NULL ); - test_error( error, "Unable to get max image 2d width from device" ); - - if( maxDimension < minRequiredDimension ) - { - log_error( "ERROR: Reported max image 2d width is less than required! (%d)\n", (int)maxDimension ); - return -1; - } - log_info("Max reported width is %ld.\n", maxDimension); - - /* Verify we can use the format */ - image_format_desc.image_channel_data_type = CL_UNORM_INT8; - image_format_desc.image_channel_order = CL_RGBA; - if (!is_image_format_supported( context, CL_MEM_READ_ONLY, CL_MEM_OBJECT_IMAGE2D, &image_format_desc)) { - log_error("CL_UNORM_INT8 CL_RGBA not supported. Can not test."); - return -1; - } - - /* Verify that we can actually allocate an image that large */ - error = clGetDeviceInfo( deviceID, CL_DEVICE_MAX_MEM_ALLOC_SIZE, sizeof ( maxAllocSize ), &maxAllocSize, NULL ); - test_error( error, "Unable to get CL_DEVICE_MAX_MEM_ALLOC_SIZE." ); - if ( (cl_ulong)maxDimension*1*4 > maxAllocSize ) { - log_error("Can not allocate a large enough image (min size: %lld bytes, max allowed: %lld bytes) to test.\n", - (cl_ulong)maxDimension*1*4, maxAllocSize); - return -1; - } - - log_info("Attempting to create an image of size %d x 1 = %gMB.\n", (int)maxDimension, ((float)maxDimension*4/1024.0/1024.0)); - - /* Try to allocate a very big image */ - streams[0] = create_image_2d( context, CL_MEM_READ_ONLY, &image_format_desc, maxDimension, 1, 0, NULL, &error ); - if( ( streams[0] == NULL ) || ( error != CL_SUCCESS )) - { - print_error( error, "Image 2D creation failed for maximum width" ); - return -1; - } - - return 0; -} - -int test_min_max_image_2d_height(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - size_t maxDimension; - clMemWrapper streams[1]; - cl_image_format image_format_desc; - cl_ulong maxAllocSize; - cl_uint minRequiredDimension; - cl_char buffer[ 4098 ]; - size_t length; - - PASSIVE_REQUIRE_IMAGE_SUPPORT( deviceID ) - - // Device version should fit the regex "OpenCL [0-9]+\.[0-9]+ *.*" - error = clGetDeviceInfo( deviceID, CL_DEVICE_VERSION, sizeof( buffer ), buffer, &length ); - test_error( error, "Unable to get device version string" ); - if( memcmp( buffer, "OpenCL 2.0", strlen( "OpenCL 2.0" ) ) == 0 ) - minRequiredDimension = gIsEmbedded ? 2048 : 8192; - else if( memcmp( buffer, "OpenCL 2.1", strlen( "OpenCL 2.1" ) ) == 0 ) - minRequiredDimension = gIsEmbedded ? 2048 : 8192; - else if( memcmp( buffer, "OpenCL 1.2", strlen( "OpenCL 1.2" ) ) == 0 ) - minRequiredDimension = gIsEmbedded ? 2048 : 8192; - else if( memcmp( buffer, "OpenCL 1.1", strlen( "OpenCL 1.1" ) ) == 0 ) - minRequiredDimension = gIsEmbedded ? 2048 : 8192; - else if ( memcmp( buffer, "OpenCL 1.0", strlen( "OpenCL 1.0" ) ) == 0 ) - minRequiredDimension = gIsEmbedded ? 2048 : 4096; - else - { - log_error( "ERROR: device version string does not match required format! (returned: %s)\n", (char *)buffer ); - return -1; - } - - /* Just get any ol format to test with */ - error = get_8_bit_image_format( context, CL_MEM_OBJECT_IMAGE2D, CL_MEM_READ_WRITE, 0, &image_format_desc ); - test_error( error, "Unable to obtain suitable image format to test with!" ); - - /* Get the max 2d image width */ - error = clGetDeviceInfo( deviceID, CL_DEVICE_IMAGE2D_MAX_HEIGHT, sizeof( maxDimension ), &maxDimension, NULL ); - test_error( error, "Unable to get max image 2d height from device" ); - - if( maxDimension < minRequiredDimension ) - { - log_error( "ERROR: Reported max image 2d height is less than required! (%d)\n", (int)maxDimension ); - return -1; - } - log_info("Max reported height is %ld.\n", maxDimension); - - /* Verify we can use the format */ - image_format_desc.image_channel_data_type = CL_UNORM_INT8; - image_format_desc.image_channel_order = CL_RGBA; - if (!is_image_format_supported( context, CL_MEM_READ_ONLY, CL_MEM_OBJECT_IMAGE2D, &image_format_desc)) { - log_error("CL_UNORM_INT8 CL_RGBA not supported. Can not test."); - return -1; - } - - /* Verify that we can actually allocate an image that large */ - error = clGetDeviceInfo( deviceID, CL_DEVICE_MAX_MEM_ALLOC_SIZE, sizeof ( maxAllocSize ), &maxAllocSize, NULL ); - test_error( error, "Unable to get CL_DEVICE_MAX_MEM_ALLOC_SIZE." ); - if ( (cl_ulong)maxDimension*1*4 > maxAllocSize ) { - log_error("Can not allocate a large enough image (min size: %lld bytes, max allowed: %lld bytes) to test.\n", - (cl_ulong)maxDimension*1*4, maxAllocSize); - return -1; - } - - log_info("Attempting to create an image of size 1 x %d = %gMB.\n", (int)maxDimension, ((float)maxDimension*4/1024.0/1024.0)); - - /* Try to allocate a very big image */ - streams[0] = create_image_2d( context, CL_MEM_READ_ONLY, &image_format_desc, 1, maxDimension, 0, NULL, &error ); - if( ( streams[0] == NULL ) || ( error != CL_SUCCESS )) - { - print_error( error, "Image 2D creation failed for maximum height" ); - return -1; - } - - return 0; -} - -int test_min_max_image_3d_width(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - size_t maxDimension; - clMemWrapper streams[1]; - cl_image_format image_format_desc; - cl_ulong maxAllocSize; - - - PASSIVE_REQUIRE_3D_IMAGE_SUPPORT( deviceID ) - - /* Just get any ol format to test with */ - error = get_8_bit_image_format( context, CL_MEM_OBJECT_IMAGE3D, CL_MEM_READ_WRITE, 0, &image_format_desc ); - test_error( error, "Unable to obtain suitable image format to test with!" ); - - /* Get the max 2d image width */ - error = clGetDeviceInfo( deviceID, CL_DEVICE_IMAGE3D_MAX_WIDTH, sizeof( maxDimension ), &maxDimension, NULL ); - test_error( error, "Unable to get max image 3d width from device" ); - - if( maxDimension < 2048 ) - { - log_error( "ERROR: Reported max image 3d width is less than required! (%d)\n", (int)maxDimension ); - return -1; - } - log_info("Max reported width is %ld.\n", maxDimension); - - /* Verify we can use the format */ - image_format_desc.image_channel_data_type = CL_UNORM_INT8; - image_format_desc.image_channel_order = CL_RGBA; - if (!is_image_format_supported( context, CL_MEM_READ_ONLY, CL_MEM_OBJECT_IMAGE3D, &image_format_desc)) { - log_error("CL_UNORM_INT8 CL_RGBA not supported. Can not test."); - return -1; - } - - /* Verify that we can actually allocate an image that large */ - error = clGetDeviceInfo( deviceID, CL_DEVICE_MAX_MEM_ALLOC_SIZE, sizeof ( maxAllocSize ), &maxAllocSize, NULL ); - test_error( error, "Unable to get CL_DEVICE_MAX_MEM_ALLOC_SIZE." ); - if ( (cl_ulong)maxDimension*2*4 > maxAllocSize ) { - log_error("Can not allocate a large enough image (min size: %lld bytes, max allowed: %lld bytes) to test.\n", - (cl_ulong)maxDimension*2*4, maxAllocSize); - return -1; - } - - log_info("Attempting to create an image of size %d x 1 x 2 = %gMB.\n", (int)maxDimension, (2*(float)maxDimension*4/1024.0/1024.0)); - - /* Try to allocate a very big image */ - streams[0] = create_image_3d( context, CL_MEM_READ_ONLY, &image_format_desc, maxDimension, 1, 2, 0, 0, NULL, &error ); - if( ( streams[0] == NULL ) || ( error != CL_SUCCESS )) - { - print_error( error, "Image 3D creation failed for maximum width" ); - return -1; - } - - return 0; -} - -int test_min_max_image_3d_height(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - size_t maxDimension; - clMemWrapper streams[1]; - cl_image_format image_format_desc; - cl_ulong maxAllocSize; - - - PASSIVE_REQUIRE_3D_IMAGE_SUPPORT( deviceID ) - - /* Just get any ol format to test with */ - error = get_8_bit_image_format( context, CL_MEM_OBJECT_IMAGE3D, CL_MEM_READ_WRITE, 0, &image_format_desc ); - test_error( error, "Unable to obtain suitable image format to test with!" ); - - /* Get the max 2d image width */ - error = clGetDeviceInfo( deviceID, CL_DEVICE_IMAGE3D_MAX_HEIGHT, sizeof( maxDimension ), &maxDimension, NULL ); - test_error( error, "Unable to get max image 3d height from device" ); - - if( maxDimension < 2048 ) - { - log_error( "ERROR: Reported max image 3d height is less than required! (%d)\n", (int)maxDimension ); - return -1; - } - log_info("Max reported height is %ld.\n", maxDimension); - - /* Verify we can use the format */ - image_format_desc.image_channel_data_type = CL_UNORM_INT8; - image_format_desc.image_channel_order = CL_RGBA; - if (!is_image_format_supported( context, CL_MEM_READ_ONLY, CL_MEM_OBJECT_IMAGE3D, &image_format_desc)) { - log_error("CL_UNORM_INT8 CL_RGBA not supported. Can not test."); - return -1; - } - - /* Verify that we can actually allocate an image that large */ - error = clGetDeviceInfo( deviceID, CL_DEVICE_MAX_MEM_ALLOC_SIZE, sizeof ( maxAllocSize ), &maxAllocSize, NULL ); - test_error( error, "Unable to get CL_DEVICE_MAX_MEM_ALLOC_SIZE." ); - if ( (cl_ulong)maxDimension*2*4 > maxAllocSize ) { - log_error("Can not allocate a large enough image (min size: %lld bytes, max allowed: %lld bytes) to test.\n", - (cl_ulong)maxDimension*2*4, maxAllocSize); - return -1; - } - - log_info("Attempting to create an image of size 1 x %d x 2 = %gMB.\n", (int)maxDimension, (2*(float)maxDimension*4/1024.0/1024.0)); - - /* Try to allocate a very big image */ - streams[0] = create_image_3d( context, CL_MEM_READ_ONLY, &image_format_desc, 1, maxDimension, 2, 0, 0, NULL, &error ); - if( ( streams[0] == NULL ) || ( error != CL_SUCCESS )) - { - print_error( error, "Image 3D creation failed for maximum height" ); - return -1; - } - - return 0; -} - - -int test_min_max_image_3d_depth(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - size_t maxDimension; - clMemWrapper streams[1]; - cl_image_format image_format_desc; - cl_ulong maxAllocSize; - - - PASSIVE_REQUIRE_3D_IMAGE_SUPPORT( deviceID ) - - /* Just get any ol format to test with */ - error = get_8_bit_image_format( context, CL_MEM_OBJECT_IMAGE3D, CL_MEM_READ_WRITE, 0, &image_format_desc ); - test_error( error, "Unable to obtain suitable image format to test with!" ); - - /* Get the max 2d image width */ - error = clGetDeviceInfo( deviceID, CL_DEVICE_IMAGE3D_MAX_DEPTH, sizeof( maxDimension ), &maxDimension, NULL ); - test_error( error, "Unable to get max image 3d depth from device" ); - - if( maxDimension < 2048 ) - { - log_error( "ERROR: Reported max image 3d depth is less than required! (%d)\n", (int)maxDimension ); - return -1; - } - log_info("Max reported depth is %ld.\n", maxDimension); - - /* Verify we can use the format */ - image_format_desc.image_channel_data_type = CL_UNORM_INT8; - image_format_desc.image_channel_order = CL_RGBA; - if (!is_image_format_supported( context, CL_MEM_READ_ONLY, CL_MEM_OBJECT_IMAGE3D, &image_format_desc)) { - log_error("CL_UNORM_INT8 CL_RGBA not supported. Can not test."); - return -1; - } - - /* Verify that we can actually allocate an image that large */ - error = clGetDeviceInfo( deviceID, CL_DEVICE_MAX_MEM_ALLOC_SIZE, sizeof ( maxAllocSize ), &maxAllocSize, NULL ); - test_error( error, "Unable to get CL_DEVICE_MAX_MEM_ALLOC_SIZE." ); - if ( (cl_ulong)maxDimension*1*4 > maxAllocSize ) { - log_error("Can not allocate a large enough image (min size: %lld bytes, max allowed: %lld bytes) to test.\n", - (cl_ulong)maxDimension*1*4, maxAllocSize); - return -1; - } - - log_info("Attempting to create an image of size 1 x 1 x %d = %gMB.\n", (int)maxDimension, ((float)maxDimension*4/1024.0/1024.0)); - - /* Try to allocate a very big image */ - streams[0] = create_image_3d( context, CL_MEM_READ_ONLY, &image_format_desc, 1, 1, maxDimension, 0, 0, NULL, &error ); - if( ( streams[0] == NULL ) || ( error != CL_SUCCESS )) - { - print_error( error, "Image 3D creation failed for maximum depth" ); - return -1; - } - - return 0; -} - -int test_min_max_image_array_size(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - size_t maxDimension; - clMemWrapper streams[1]; - cl_image_format image_format_desc; - cl_ulong maxAllocSize; - size_t minRequiredDimension = gIsEmbedded ? 256 : 2048; - - PASSIVE_REQUIRE_IMAGE_SUPPORT( deviceID ); - - /* Just get any ol format to test with */ - error = get_8_bit_image_format( context, CL_MEM_OBJECT_IMAGE2D_ARRAY, CL_MEM_READ_WRITE, 0, &image_format_desc ); - test_error( error, "Unable to obtain suitable image format to test with!" ); - - /* Get the max image array width */ - error = clGetDeviceInfo( deviceID, CL_DEVICE_IMAGE_MAX_ARRAY_SIZE, sizeof( maxDimension ), &maxDimension, NULL ); - test_error( error, "Unable to get max image array size from device" ); - - if( maxDimension < minRequiredDimension ) - { - log_error( "ERROR: Reported max image array size is less than required! (%d)\n", (int)maxDimension ); - return -1; - } - log_info("Max reported image array size is %ld.\n", maxDimension); - - /* Verify we can use the format */ - image_format_desc.image_channel_data_type = CL_UNORM_INT8; - image_format_desc.image_channel_order = CL_RGBA; - if (!is_image_format_supported( context, CL_MEM_READ_ONLY, CL_MEM_OBJECT_IMAGE2D_ARRAY, &image_format_desc)) { - log_error("CL_UNORM_INT8 CL_RGBA not supported. Can not test."); - return -1; - } - - /* Verify that we can actually allocate an image that large */ - error = clGetDeviceInfo( deviceID, CL_DEVICE_MAX_MEM_ALLOC_SIZE, sizeof ( maxAllocSize ), &maxAllocSize, NULL ); - test_error( error, "Unable to get CL_DEVICE_MAX_MEM_ALLOC_SIZE." ); - if ( (cl_ulong)maxDimension*1*4 > maxAllocSize ) { - log_error("Can not allocate a large enough image (min size: %lld bytes, max allowed: %lld bytes) to test.\n", - (cl_ulong)maxDimension*1*4, maxAllocSize); - return -1; - } - - log_info("Attempting to create an image of size 1 x 1 x %d = %gMB.\n", (int)maxDimension, ((float)maxDimension*4/1024.0/1024.0)); - - /* Try to allocate a very big image */ - streams[0] = create_image_2d_array( context, CL_MEM_READ_ONLY, &image_format_desc, 1, 1, maxDimension, 0, 0, NULL, &error ); - if( ( streams[0] == NULL ) || ( error != CL_SUCCESS )) - { - print_error( error, "2D Image Array creation failed for maximum array size" ); - return -1; - } - - return 0; -} - -int test_min_max_image_buffer_size(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - size_t maxDimensionPixels; - clMemWrapper streams[2]; - cl_image_format image_format_desc = {0}; - cl_ulong maxAllocSize; - size_t minRequiredDimension = gIsEmbedded ? 2048 : 65536; - unsigned int i = 0; - size_t pixelBytes = 0; - - PASSIVE_REQUIRE_IMAGE_SUPPORT( deviceID ); - - /* Get the max memory allocation size */ - error = clGetDeviceInfo( deviceID, CL_DEVICE_MAX_MEM_ALLOC_SIZE, sizeof ( maxAllocSize ), &maxAllocSize, NULL ); - test_error( error, "Unable to get CL_DEVICE_MAX_MEM_ALLOC_SIZE." ); - - /* Get the max image array width */ - error = clGetDeviceInfo( deviceID, CL_DEVICE_IMAGE_MAX_BUFFER_SIZE, sizeof( maxDimensionPixels ), &maxDimensionPixels, NULL ); - test_error( error, "Unable to get max image buffer size from device" ); - - if( maxDimensionPixels < minRequiredDimension ) - { - log_error( "ERROR: Reported max image buffer size is less than required! (%d)\n", (int)maxDimensionPixels ); - return -1; - } - log_info("Max reported image buffer size is %ld pixels.\n", maxDimensionPixels); - - pixelBytes = maxAllocSize / maxDimensionPixels; - if ( pixelBytes == 0 ) - { - log_error( "Value of CL_DEVICE_IMAGE_MAX_BUFFER_SIZE is greater than CL_MAX_MEM_ALLOC_SIZE so there is no way to allocate image of maximum size!\n" ); - return -1; - } - - error = -1; - for ( i = pixelBytes; i > 0; --i ) - { - error = get_8_bit_image_format( context, CL_MEM_OBJECT_IMAGE1D, CL_MEM_READ_ONLY, i, &image_format_desc ); - if ( error == CL_SUCCESS ) - { - pixelBytes = i; - break; - } - } - test_error( error, "Device does not support format to be used to allocate image of CL_DEVICE_IMAGE_MAX_BUFFER_SIZE\n" ); - - log_info("Attempting to create an 1D image with channel order %s from buffer of size %d = %gMB.\n", - GetChannelOrderName( image_format_desc.image_channel_order ), (int)maxDimensionPixels, ((float)maxDimensionPixels*pixelBytes/1024.0/1024.0)); - - /* Try to allocate a buffer */ - streams[0] = clCreateBuffer( context, CL_MEM_READ_ONLY, maxDimensionPixels*pixelBytes, NULL, &error ); - if( ( streams[0] == NULL ) || ( error != CL_SUCCESS )) - { - print_error( error, "Buffer creation failed for maximum image buffer size" ); - return -1; - } - - /* Try to allocate a 1D image array from buffer */ - streams[1] = create_image_1d( context, CL_MEM_READ_ONLY, &image_format_desc, maxDimensionPixels, 0, NULL, streams[0], &error ); - if( ( streams[0] == NULL ) || ( error != CL_SUCCESS )) - { - print_error( error, "1D Image from buffer creation failed for maximum image buffer size" ); - return -1; - } - - return 0; -} - - - -int test_min_max_parameter_size(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error, retVal, i; - size_t maxSize; - char *programSrc; - char *ptr; - size_t numberExpected; - long numberOfIntParametersToTry; - char *argumentLine, *codeLines; - void *data; - cl_long long_result, expectedResult; - cl_int int_result; - size_t decrement; - cl_event event; - cl_int event_status; - - - /* Get the max param size */ - error = clGetDeviceInfo( deviceID, CL_DEVICE_MAX_PARAMETER_SIZE, sizeof( maxSize ), &maxSize, NULL ); - test_error( error, "Unable to get max parameter size from device" ); - - - if( ((!gIsEmbedded) && (maxSize < 1024)) || ((gIsEmbedded) && (maxSize < 256)) ) - { - log_error( "ERROR: Reported max parameter size is less than required! (%d)\n", (int)maxSize ); - return -1; - } - - /* The embedded profile does not require longs, so use ints */ - if(gIsEmbedded) - numberOfIntParametersToTry = numberExpected = (maxSize-sizeof(cl_mem))/sizeof(cl_int); - else - numberOfIntParametersToTry = numberExpected = (maxSize-sizeof(cl_mem))/sizeof(cl_long); - - decrement = (size_t)(numberOfIntParametersToTry/8); - if (decrement < 1) - decrement = 1; - log_info("Reported max parameter size of %d bytes.\n", (int)maxSize); - - while (numberOfIntParametersToTry > 0) { - // These need to be inside to be deallocated automatically on each loop iteration. - clProgramWrapper program; - clMemWrapper mem; - clKernelWrapper kernel; - - if(gIsEmbedded) - { - log_info("Trying a kernel with %ld int arguments (%ld bytes) and one cl_mem (%ld bytes) for %ld bytes total.\n", - numberOfIntParametersToTry, sizeof(cl_int)*numberOfIntParametersToTry, sizeof(cl_mem), - sizeof(cl_mem)+numberOfIntParametersToTry*sizeof(cl_int)); - } - else - { - log_info("Trying a kernel with %ld long arguments (%ld bytes) and one cl_mem (%ld bytes) for %ld bytes total.\n", - numberOfIntParametersToTry, sizeof(cl_long)*numberOfIntParametersToTry, sizeof(cl_mem), - sizeof(cl_mem)+numberOfIntParametersToTry*sizeof(cl_long)); - } - - // Allocate memory for the program storage - data = malloc(sizeof(cl_long)*numberOfIntParametersToTry); - - argumentLine = (char*)malloc(sizeof(char)*numberOfIntParametersToTry*32); - codeLines = (char*)malloc(sizeof(char)*numberOfIntParametersToTry*32); - programSrc = (char*)malloc(sizeof(char)*(numberOfIntParametersToTry*64+1024)); - argumentLine[0] = '\0'; - codeLines[0] = '\0'; - programSrc[0] = '\0'; - - // Generate our results - expectedResult = 0; - for (i=0; i<(int)numberOfIntParametersToTry; i++) - { - if( gHasLong ) - { - ((cl_long *)data)[i] = i; - expectedResult += i; - } - else - { - ((cl_int *)data)[i] = i; - expectedResult += i; - } - } - - // Build the program - if( gHasLong) - sprintf(argumentLine, "%s", "long arg0"); - else - sprintf(argumentLine, "%s", "int arg0"); - - sprintf(codeLines, "%s", "result[0] += arg0;"); - for (i=1; i<(int)numberOfIntParametersToTry; i++) - { - if( gHasLong) - sprintf(argumentLine + strlen( argumentLine), ", long arg%d", i); - else - sprintf(argumentLine + strlen( argumentLine), ", int arg%d", i); - - sprintf(codeLines + strlen( codeLines), "\nresult[0] += arg%d;", i); - } - - /* Create a kernel to test with */ - sprintf( programSrc, gHasLong ? sample_large_parmam_kernel_pattern[0]: - sample_large_int_parmam_kernel_pattern[0], argumentLine, codeLines); - - ptr = programSrc; - if( create_single_kernel_helper( context, &program, &kernel, 1, (const char **)&ptr, "sample_test" ) != 0 ) - { - log_info("Create program failed, decrementing number of parameters to try.\n"); - numberOfIntParametersToTry -= decrement; - continue; - } - - /* Try to set a large argument to the kernel */ - retVal = 0; - - mem = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_long), NULL, &error); - test_error(error, "clCreateBuffer failed"); - - for (i=0; i<(int)numberOfIntParametersToTry; i++) { - if(gHasLong) - error = clSetKernelArg(kernel, i, sizeof(cl_long), &(((cl_long*)data)[i])); - else - error = clSetKernelArg(kernel, i, sizeof(cl_int), &(((cl_int*)data)[i])); - - if (error != CL_SUCCESS) { - log_info( "clSetKernelArg failed (%s), decrementing number of parameters to try.\n", IGetErrorString(error)); - numberOfIntParametersToTry -= decrement; - break; - } - } - if (error != CL_SUCCESS) - continue; - - - error = clSetKernelArg(kernel, i, sizeof(cl_mem), &mem); - if (error != CL_SUCCESS) { - log_info( "clSetKernelArg failed (%s), decrementing number of parameters to try.\n", IGetErrorString(error)); - numberOfIntParametersToTry -= decrement; - continue; - } - - size_t globalDim[3]={1,1,1}, localDim[3]={1,1,1}; - error = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, globalDim, localDim, 0, NULL, &event); - if (error != CL_SUCCESS) { - log_info( "clEnqueueNDRangeKernel failed (%s), decrementing number of parameters to try.\n", IGetErrorString(error)); - numberOfIntParametersToTry -= decrement; - continue; - } - - // Verify that the event does not return an error from the execution - error = clWaitForEvents(1, &event); - test_error( error, "clWaitForEvent failed"); - error = clGetEventInfo(event, CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(event_status), &event_status, NULL); - test_error( error, "clGetEventInfo for CL_EVENT_COMMAND_EXECUTION_STATUS failed"); - clReleaseEvent(event); - if (event_status < 0) - test_error(error, "Kernel execution event returned error"); - - if(gHasLong) - error = clEnqueueReadBuffer(queue, mem, CL_TRUE, 0, sizeof(cl_long), &long_result, 0, NULL, NULL); - else - error = clEnqueueReadBuffer(queue, mem, CL_TRUE, 0, sizeof(cl_int), &int_result, 0, NULL, NULL); - - test_error(error, "clEnqueueReadBuffer failed") - - free(data); - free(argumentLine); - free(codeLines); - free(programSrc); - - if(gHasLong) - { - if (long_result != expectedResult) { - log_error("Expected result (%lld) does not equal actual result (%lld).\n", expectedResult, long_result); - numberOfIntParametersToTry -= decrement; - continue; - } else { - log_info("Results verified at %ld bytes of arguments.\n", sizeof(cl_mem)+numberOfIntParametersToTry*sizeof(cl_long)); - break; - } - } - else - { - if (int_result != expectedResult) { - log_error("Expected result (%lld) does not equal actual result (%d).\n", expectedResult, int_result); - numberOfIntParametersToTry -= decrement; - continue; - } else { - log_info("Results verified at %ld bytes of arguments.\n", sizeof(cl_mem)+numberOfIntParametersToTry*sizeof(cl_int)); - break; - } - } - } - - if (numberOfIntParametersToTry == (long)numberExpected) - return 0; - return -1; -} - -int test_min_max_samplers(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - cl_uint maxSamplers, i; - clProgramWrapper program; - clKernelWrapper kernel; - char *programSrc, samplerLine[1024]; - size_t maxParameterSize; - cl_event event; - cl_int event_status; - cl_uint minRequiredSamplers = gIsEmbedded ? 8 : 16; - - - PASSIVE_REQUIRE_IMAGE_SUPPORT( deviceID ) - - /* Get the max value */ - error = clGetDeviceInfo( deviceID, CL_DEVICE_MAX_SAMPLERS, sizeof( maxSamplers ), &maxSamplers, NULL ); - test_error( error, "Unable to get max sampler count from device" ); - - if( maxSamplers < minRequiredSamplers ) - { - log_error( "ERROR: Reported max sampler count is less than required! (%d)\n", (int)maxSamplers ); - return -1; - } - - log_info("Reported max %d samplers.\n", maxSamplers); - - error = clGetDeviceInfo( deviceID, CL_DEVICE_MAX_PARAMETER_SIZE, sizeof( maxParameterSize ), &maxParameterSize, NULL ); - test_error( error, "Unable to get max parameter size from device" ); - - // Subtract the size of the result - maxParameterSize -= 2*sizeof(cl_mem); - - // Calculate the number we can use - if (maxParameterSize/sizeof(cl_sampler) < maxSamplers) { - log_info("WARNING: Max parameter size of %d bytes limits test to %d max sampler arguments.\n", (int)maxParameterSize, (int)(maxParameterSize/sizeof(cl_sampler))); - maxSamplers = (unsigned int)(maxParameterSize/sizeof(cl_sampler)); - } - - /* Create a kernel to test with */ - programSrc = (char *)malloc( ( strlen( sample_sampler_kernel_pattern[ 1 ] ) + 8 ) * ( maxSamplers ) + - strlen( sample_sampler_kernel_pattern[ 0 ] ) + strlen( sample_sampler_kernel_pattern[ 2 ] ) + - ( strlen( sample_sampler_kernel_pattern[ 3 ] ) + 8 ) * maxSamplers + - strlen( sample_sampler_kernel_pattern[ 4 ] ) ); - strcpy( programSrc, sample_sampler_kernel_pattern[ 0 ] ); - for( i = 0; i < maxSamplers; i++ ) - { - sprintf( samplerLine, sample_sampler_kernel_pattern[ 1 ], i ); - strcat( programSrc, samplerLine ); - } - strcat( programSrc, sample_sampler_kernel_pattern[ 2 ] ); - for( i = 0; i < maxSamplers; i++ ) - { - sprintf( samplerLine, sample_sampler_kernel_pattern[ 3 ], i ); - strcat( programSrc, samplerLine ); - } - strcat( programSrc, sample_sampler_kernel_pattern[ 4 ] ); - - - error = create_single_kernel_helper(context, &program, &kernel, 1, (const char **)&programSrc, "sample_test"); - test_error( error, "Failed to create the program and kernel."); - - // We have to set up some fake parameters so it'll work - clSamplerWrapper *samplers = new clSamplerWrapper[maxSamplers]; - - cl_image_format format = { CL_RGBA, CL_SIGNED_INT8 }; - - clMemWrapper image = create_image_2d( context, CL_MEM_READ_WRITE, &format, 16, 16, 0, NULL, &error ); - test_error( error, "Unable to create a test image" ); - - clMemWrapper stream = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_READ_WRITE), 16, NULL, &error ); - test_error( error, "Unable to create test buffer" ); - - error = clSetKernelArg( kernel, 0, sizeof( cl_mem ), &image ); - error |= clSetKernelArg( kernel, 1, sizeof( cl_mem ), &stream ); - test_error( error, "Unable to set kernel arguments" ); - for( i = 0; i < maxSamplers; i++ ) - { - samplers[ i ] = clCreateSampler( context, CL_FALSE, CL_ADDRESS_NONE, CL_FILTER_NEAREST, &error ); - test_error( error, "Unable to create sampler" ); - - error = clSetKernelArg( kernel, 2 + i, sizeof( cl_sampler ), &samplers[ i ] ); - test_error( error, "Unable to set sampler argument" ); - } - - size_t globalDim[3]={1,1,1}, localDim[3]={1,1,1}; - error = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, globalDim, localDim, 0, NULL, &event); - test_error(error, "clEnqueueNDRangeKernel failed with maximum number of samplers."); - - // Verify that the event does not return an error from the execution - error = clWaitForEvents(1, &event); - test_error( error, "clWaitForEvent failed"); - error = clGetEventInfo(event, CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(event_status), &event_status, NULL); - test_error( error, "clGetEventInfo for CL_EVENT_COMMAND_EXECUTION_STATUS failed"); - clReleaseEvent(event); - if (event_status < 0) - test_error(error, "Kernel execution event returned error"); - - free( programSrc ); - delete[] samplers; - return 0; -} - -#define PASSING_FRACTION 4 -int test_min_max_constant_buffer_size(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - clProgramWrapper program; - clKernelWrapper kernel; - size_t threads[1], localThreads[1]; - cl_int *constantData, *resultData; - cl_ulong maxSize, stepSize, currentSize, maxGlobalSize, maxAllocSize; - int i; - cl_event event; - cl_int event_status; - MTdata d; - - /* Verify our test buffer won't be bigger than allowed */ - error = clGetDeviceInfo( deviceID, CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE, sizeof( maxSize ), &maxSize, 0 ); - test_error( error, "Unable to get max constant buffer size" ); - - if( ( 0 == gIsEmbedded && maxSize < 64L * 1024L ) || maxSize < 1L * 1024L ) - { - log_error( "ERROR: Reported max constant buffer size less than required by OpenCL 1.0 (reported %d KB)\n", (int)( maxSize / 1024L ) ); - return -1; - } - - log_info("Reported max constant buffer size of %lld bytes.\n", maxSize); - - error = clGetDeviceInfo(deviceID, CL_DEVICE_GLOBAL_MEM_SIZE, sizeof(maxGlobalSize), &maxGlobalSize, 0); - test_error(error, "Unable to get CL_DEVICE_GLOBAL_MEM_SIZE"); - if (maxSize > maxGlobalSize / 8) - maxSize = maxGlobalSize / 8; - error = clGetDeviceInfo(deviceID, CL_DEVICE_MAX_MEM_ALLOC_SIZE , sizeof(maxAllocSize), &maxAllocSize, 0); - test_error(error, "Unable to get CL_DEVICE_MAX_MEM_ALLOC_SIZE "); - if (maxSize > maxAllocSize) - maxSize = maxAllocSize; - /* Create a kernel to test with */ - if( create_single_kernel_helper( context, &program, &kernel, 1, sample_const_arg_kernel, "sample_test" ) != 0 ) - { - return -1; - } - - /* Try the returned max size and decrease it until we get one that works. */ - stepSize = maxSize/16; - currentSize = maxSize; - int allocPassed = 0; - d = init_genrand( gRandomSeed ); - while (!allocPassed && currentSize >= maxSize/PASSING_FRACTION) { - log_info("Attempting to allocate constant buffer of size %lld bytes\n", maxSize); - - /* Create some I/O streams */ - size_t sizeToAllocate = ((size_t)currentSize/sizeof( cl_int ))*sizeof(cl_int); - size_t numberOfInts = sizeToAllocate/sizeof(cl_int); - constantData = (cl_int *)malloc( sizeToAllocate); - for(i=0; i<(int)(numberOfInts); i++) - constantData[i] = (int)genrand_int32(d); - - clMemWrapper streams[3]; - streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), sizeToAllocate, constantData, &error); - test_error( error, "Creating test array failed" ); - streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeToAllocate, NULL, &error); - test_error( error, "Creating test array failed" ); - - - /* Set the arguments */ - error = clSetKernelArg(kernel, 0, sizeof( streams[0] ), &streams[0]); - test_error( error, "Unable to set indexed kernel arguments" ); - error = clSetKernelArg(kernel, 1, sizeof( streams[1] ), &streams[1]); - test_error( error, "Unable to set indexed kernel arguments" ); - - - /* Test running the kernel and verifying it */ - threads[0] = numberOfInts; - localThreads[0] = 1; - log_info("Filling constant buffer with %d cl_ints (%d bytes).\n", (int)threads[0], (int)(threads[0]*sizeof(cl_int))); - - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, &event ); - /* If we failed due to a resource issue, reduce the size and try again. */ - if ((error == CL_OUT_OF_RESOURCES) || (error == CL_MEM_OBJECT_ALLOCATION_FAILURE) || (error == CL_OUT_OF_HOST_MEMORY)) { - log_info("Kernel enqueue failed at size %lld, trying at a reduced size.\n", currentSize); - currentSize -= stepSize; - free(constantData); - continue; - } - test_error( error, "clEnqueueNDRangeKernel with maximum constant buffer size failed."); - - // Verify that the event does not return an error from the execution - error = clWaitForEvents(1, &event); - test_error( error, "clWaitForEvent failed"); - error = clGetEventInfo(event, CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(event_status), &event_status, NULL); - test_error( error, "clGetEventInfo for CL_EVENT_COMMAND_EXECUTION_STATUS failed"); - clReleaseEvent(event); - if (event_status < 0) { - if ((event_status == CL_OUT_OF_RESOURCES) || (event_status == CL_MEM_OBJECT_ALLOCATION_FAILURE) || (event_status == CL_OUT_OF_HOST_MEMORY)) { - log_info("Kernel event indicates failure at size %lld, trying at a reduced size.\n", currentSize); - currentSize -= stepSize; - free(constantData); - continue; - } else { - test_error(error, "Kernel execution event returned error"); - } - } - - /* Otherwise we did not fail due to resource issues. */ - allocPassed = 1; - - resultData = (cl_int *)malloc(sizeToAllocate); - error = clEnqueueReadBuffer(queue, streams[1], CL_TRUE, 0, sizeToAllocate, resultData, 0, NULL, NULL); - test_error( error, "clEnqueueReadBuffer failed"); - - for(i=0; i<(int)(numberOfInts); i++) - if (constantData[i] != resultData[i]) { - log_error("Data failed to verify: constantData[%d]=%d != resultData[%d]=%d\n", - i, constantData[i], i, resultData[i]); - free( constantData ); - free(resultData); - free_mtdata(d); d = NULL; - return -1; - } - - free( constantData ); - free(resultData); - } - free_mtdata(d); d = NULL; - - if (allocPassed) { - if (currentSize < maxSize/PASSING_FRACTION) { - log_error("Failed to allocate at least 1/4 of the reported constant size.\n"); - return -1; - } else if (currentSize != maxSize) { - log_info("Passed at reduced size. (%lld of %lld bytes)\n", currentSize, maxSize); - return 0; - } - return 0; - } - return -1; -} - -int test_min_max_constant_args(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - clProgramWrapper program; - clKernelWrapper kernel; - clMemWrapper *streams; - size_t threads[1], localThreads[1]; - cl_uint i, maxArgs; - cl_ulong maxSize; - cl_ulong maxParameterSize; - size_t individualBufferSize; - char *programSrc, *constArgs, *str2; - char str[512]; - const char *ptr; - cl_event event; - cl_int event_status; - - - /* Verify our test buffer won't be bigger than allowed */ - error = clGetDeviceInfo( deviceID, CL_DEVICE_MAX_CONSTANT_ARGS, sizeof( maxArgs ), &maxArgs, 0 ); - test_error( error, "Unable to get max constant arg count" ); - - error = clGetDeviceInfo( deviceID, CL_DEVICE_MAX_PARAMETER_SIZE, sizeof( maxParameterSize ), &maxParameterSize, NULL ); - test_error( error, "Unable to get max parameter size from device" ); - - // Subtract the size of the result - maxParameterSize -= sizeof(cl_mem); - - // Calculate the number we can use - if (maxParameterSize/sizeof(cl_mem) < maxArgs) { - log_info("WARNING: Max parameter size of %d bytes limits test to %d max image arguments.\n", (int)maxParameterSize, (int)(maxParameterSize/sizeof(cl_mem))); - maxArgs = (unsigned int)(maxParameterSize/sizeof(cl_mem)); - } - - - if( maxArgs < (gIsEmbedded ? 4 : 8) ) - { - log_error( "ERROR: Reported max constant arg count less than required by OpenCL 1.0 (reported %d)\n", (int)maxArgs ); - return -1; - } - - error = clGetDeviceInfo( deviceID, CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE, sizeof( maxSize ), &maxSize, 0 ); - test_error( error, "Unable to get max constant buffer size" ); - individualBufferSize = ((int)maxSize/2)/maxArgs; - - log_info("Reported max constant arg count of %d and max constant buffer size of %d. Test will attempt to allocate half of that, or %d buffers of size %d.\n", - (int)maxArgs, (int)maxSize, (int)maxArgs, (int)individualBufferSize); - - str2 = (char*)malloc(sizeof(char)*32*(maxArgs+2)); - constArgs = (char*)malloc(sizeof(char)*32*(maxArgs+2)); - programSrc = (char*)malloc(sizeof(char)*32*2*(maxArgs+2)+1024); - - /* Create a test program */ - constArgs[0] = 0; - str2[0] = 0; - for( i = 0; i < maxArgs-1; i++ ) - { - sprintf( str, ", __constant int *src%d", (int)( i + 2 ) ); - strcat( constArgs, str ); - sprintf( str2 + strlen( str2), "\tdst[tid] += src%d[tid];\n", (int)(i+2)); - if (strlen(str2) > (sizeof(char)*32*(maxArgs+2)-32) || strlen(constArgs) > (sizeof(char)*32*(maxArgs+2)-32)) { - log_info("Limiting number of arguments tested to %d due to test program allocation size.\n", i); - break; - } - } - sprintf( programSrc, sample_const_max_arg_kernel_pattern, constArgs, str2 ); - - /* Create a kernel to test with */ - ptr = programSrc; - if( create_single_kernel_helper( context, &program, &kernel, 1, &ptr, "sample_test" ) != 0 ) - { - return -1; - } - - /* Create some I/O streams */ - streams = new clMemWrapper[ maxArgs + 1 ]; - for( i = 0; i < maxArgs + 1; i++ ) - { - streams[i] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), individualBufferSize, NULL, &error); - test_error( error, "Creating test array failed" ); - } - - /* Set the arguments */ - for( i = 0; i < maxArgs + 1; i++ ) - { - error = clSetKernelArg(kernel, i, sizeof( streams[i] ), &streams[i]); - test_error( error, "Unable to set kernel argument" ); - } - - /* Test running the kernel and verifying it */ - threads[0] = (size_t)10; - while (threads[0]*sizeof(cl_int) > individualBufferSize) - threads[0]--; - - error = get_max_common_work_group_size( context, kernel, threads[0], &localThreads[0] ); - test_error( error, "Unable to get work group size to use" ); - - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, &event ); - test_error( error, "clEnqueueNDRangeKernel failed"); - - // Verify that the event does not return an error from the execution - error = clWaitForEvents(1, &event); - test_error( error, "clWaitForEvent failed"); - error = clGetEventInfo(event, CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(event_status), &event_status, NULL); - test_error( error, "clGetEventInfo for CL_EVENT_COMMAND_EXECUTION_STATUS failed"); - clReleaseEvent(event); - if (event_status < 0) - test_error(error, "Kernel execution event returned error"); - - error = clFinish(queue); - test_error( error, "clFinish failed."); - - delete [] streams; - free(str2); - free(constArgs); - free(programSrc); - return 0; -} - -int test_min_max_compute_units(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - cl_uint value; - - - error = clGetDeviceInfo( deviceID, CL_DEVICE_MAX_COMPUTE_UNITS, sizeof( value ), &value, 0 ); - test_error( error, "Unable to get compute unit count" ); - - if( value < 1 ) - { - log_error( "ERROR: Reported compute unit count less than required by OpenCL 1.0 (reported %d)\n", (int)value ); - return -1; - } - - log_info("Reported %d max compute units.\n", value); - - return 0; -} - -int test_min_max_address_bits(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - cl_uint value; - - - error = clGetDeviceInfo( deviceID, CL_DEVICE_ADDRESS_BITS, sizeof( value ), &value, 0 ); - test_error( error, "Unable to get address bit count" ); - - if( value != 32 && value != 64 ) - { - log_error( "ERROR: Reported address bit count not valid by OpenCL 1.0 (reported %d)\n", (int)value ); - return -1; - } - - log_info("Reported %d device address bits.\n", value); - - return 0; -} - -int test_min_max_single_fp_config(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - cl_device_fp_config value; - char profile[128] = ""; - - error = clGetDeviceInfo( deviceID, CL_DEVICE_SINGLE_FP_CONFIG, sizeof( value ), &value, 0 ); - test_error( error, "Unable to get device single fp config" ); - - //Check to see if we are an embedded profile device - if((error = clGetDeviceInfo( deviceID, CL_DEVICE_PROFILE, sizeof(profile), profile, NULL ))) - { - log_error( "FAILURE: Unable to get CL_DEVICE_PROFILE: error %d\n", error ); - return error; - } - - if( 0 == strcmp( profile, "EMBEDDED_PROFILE" )) - { // embedded device - - if( 0 == (value & (CL_FP_ROUND_TO_NEAREST | CL_FP_ROUND_TO_ZERO))) - { - log_error( "FAILURE: embedded device supports neither CL_FP_ROUND_TO_NEAREST or CL_FP_ROUND_TO_ZERO\n" ); - return -1; - } - } - else - { // Full profile - if( ( value & ( CL_FP_ROUND_TO_NEAREST | CL_FP_INF_NAN )) != ( CL_FP_ROUND_TO_NEAREST | CL_FP_INF_NAN ) ) - { - log_error( "ERROR: Reported single fp config doesn't meet minimum set by OpenCL 1.0 (reported 0x%08x)\n", (int)value ); - return -1; - } - } - return 0; -} - -int test_min_max_double_fp_config(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - cl_device_fp_config value; - - error = clGetDeviceInfo( deviceID, CL_DEVICE_DOUBLE_FP_CONFIG, sizeof( value ), &value, 0 ); - test_error( error, "Unable to get device double fp config" ); - - if (value == 0) - return 0; - - if( ( value & (CL_FP_FMA | CL_FP_ROUND_TO_NEAREST | CL_FP_ROUND_TO_ZERO | CL_FP_ROUND_TO_INF | CL_FP_INF_NAN | CL_FP_DENORM)) != ( CL_FP_FMA | CL_FP_ROUND_TO_NEAREST | CL_FP_ROUND_TO_ZERO | CL_FP_ROUND_TO_INF | CL_FP_INF_NAN | CL_FP_DENORM) ) - { - log_error( "ERROR: Reported double fp config doesn't meet minimum set by OpenCL 1.0 (reported 0x%08x)\n", (int)value ); - return -1; - } - return 0; -} - -int test_min_max_local_mem_size(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - clProgramWrapper program; - clKernelWrapper kernel; - clMemWrapper streams[3]; - size_t threads[1], localThreads[1]; - cl_int *localData, *resultData; - cl_ulong maxSize, kernelLocalUsage, min_max_local_mem_size; - cl_char buffer[ 4098 ]; - size_t length; - int i; - int err = 0; - MTdata d; - - /* Verify our test buffer won't be bigger than allowed */ - error = clGetDeviceInfo( deviceID, CL_DEVICE_LOCAL_MEM_SIZE, sizeof( maxSize ), &maxSize, 0 ); - test_error( error, "Unable to get max local buffer size" ); - - // Device version should fit the regex "OpenCL [0-9]+\.[0-9]+ *.*" - error = clGetDeviceInfo( deviceID, CL_DEVICE_VERSION, sizeof( buffer ), buffer, &length ); - test_error( error, "Unable to get device version string" ); - if (!gIsEmbedded) - { - if( memcmp( buffer, "OpenCL 2.0", strlen( "OpenCL 2.0" ) ) == 0 ) - min_max_local_mem_size = 16L * 1024L; - else if( memcmp( buffer, "OpenCL 2.1", strlen( "OpenCL 2.1" ) ) != 0 ) - min_max_local_mem_size = 16L * 1024L; - else if( memcmp( buffer, "OpenCL 1.2", strlen( "OpenCL 1.2" ) ) != 0 ) - min_max_local_mem_size = 16L * 1024L; - else if( memcmp( buffer, "OpenCL 1.1", strlen( "OpenCL 1.1" ) ) != 0 ) - min_max_local_mem_size = 16L * 1024L; - else if ( memcmp( buffer, "OpenCL 1.0", strlen( "OpenCL 1.0" ) ) != 0 ) - min_max_local_mem_size = 32L * 1024L; - else - { - log_error( "ERROR: device version string does not match required format! (returned: %s)\n", (char *)buffer ); - return -1; - } - } - - if( maxSize < (gIsEmbedded ? 1L * 1024L : min_max_local_mem_size) ) - { - log_error( "ERROR: Reported local mem size less than required by OpenCL 1.1 (reported %dKb)\n", (int)( maxSize / 1024L ) ); - return -1; - } - - log_info("Reported max local buffer size for device: %lld bytes.\n", maxSize); - - /* Create a kernel to test with */ - if( create_single_kernel_helper( context, &program, &kernel, 1, sample_local_arg_kernel, "sample_test" ) != 0 ) - { - return -1; - } - - error = clGetKernelWorkGroupInfo(kernel, deviceID, CL_KERNEL_LOCAL_MEM_SIZE, sizeof(kernelLocalUsage), &kernelLocalUsage, NULL); - test_error(error, "clGetKernelWorkGroupInfo for CL_KERNEL_LOCAL_MEM_SIZE failed"); - - log_info("Reported local buffer usage for kernel (CL_KERNEL_LOCAL_MEM_SIZE): %lld bytes.\n", kernelLocalUsage); - - /* Create some I/O streams */ - size_t sizeToAllocate = ((size_t)(maxSize-kernelLocalUsage)/sizeof( cl_int ))*sizeof(cl_int); - size_t numberOfInts = sizeToAllocate/sizeof(cl_int); - - log_info("Attempting to use %lld bytes of local memory.\n", (cl_ulong)sizeToAllocate); - - localData = (cl_int *)malloc( sizeToAllocate ); - d = init_genrand( gRandomSeed ); - for(i=0; i<(int)(numberOfInts); i++) - localData[i] = (int)genrand_int32(d); - free_mtdata(d); d = NULL; - - streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), sizeToAllocate, localData, &error); - test_error( error, "Creating test array failed" ); - streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeToAllocate, NULL, &error); - test_error( error, "Creating test array failed" ); - - - /* Set the arguments */ - error = clSetKernelArg(kernel, 0, sizeToAllocate, NULL); - test_error( error, "Unable to set indexed kernel arguments" ); - error = clSetKernelArg(kernel, 1, sizeof( streams[0] ), &streams[0]); - test_error( error, "Unable to set indexed kernel arguments" ); - error = clSetKernelArg(kernel, 2, sizeof( streams[1] ), &streams[1]); - test_error( error, "Unable to set indexed kernel arguments" ); - - - /* Test running the kernel and verifying it */ - threads[0] = numberOfInts; - localThreads[0] = 1; - log_info("Creating local buffer with %d cl_ints (%d bytes).\n", (int)numberOfInts, (int)sizeToAllocate); - - cl_event evt; - cl_int evt_err; - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, &evt ); - test_error(error, "clEnqueueNDRangeKernel failed"); - - error = clFinish(queue); - test_error( error, "clFinish failed"); - - error = clGetEventInfo(evt, CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof evt_err, &evt_err, NULL); - test_error( error, "clGetEventInfo with maximum local buffer size failed."); - - if (evt_err != CL_COMPLETE) { - print_error(evt_err, "Kernel event returned error"); - clReleaseEvent(evt); - return -1; - } - - resultData = (cl_int *)malloc(sizeToAllocate); - - error = clEnqueueReadBuffer(queue, streams[1], CL_TRUE, 0, sizeToAllocate, resultData, 0, NULL, NULL); - test_error( error, "clEnqueueReadBuffer failed"); - - for(i=0; i<(int)(numberOfInts); i++) - if (localData[i] != resultData[i]) { - clReleaseEvent(evt); - free( localData ); - free(resultData); - log_error("Results failed to verify.\n"); - return -1; - } - clReleaseEvent(evt); - free( localData ); - free(resultData); - - return err; -} - -int test_min_max_kernel_preferred_work_group_size_multiple(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int err; - clProgramWrapper program; - clKernelWrapper kernel; - - size_t max_local_workgroup_size[3]; - size_t max_workgroup_size = 0, preferred_workgroup_size = 0; - - err = create_single_kernel_helper(context, &program, &kernel, 1, sample_local_arg_kernel, "sample_test" ); - test_error(err, "Failed to build kernel/program."); - - err = clGetKernelWorkGroupInfo(kernel, deviceID, CL_KERNEL_WORK_GROUP_SIZE, - sizeof(max_workgroup_size), &max_workgroup_size, NULL); - test_error(err, "clGetKernelWorkgroupInfo failed."); - - err = clGetKernelWorkGroupInfo(kernel, deviceID, CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE, - sizeof(preferred_workgroup_size), &preferred_workgroup_size, NULL); - test_error(err, "clGetKernelWorkgroupInfo failed."); - - err = clGetDeviceInfo(deviceID, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(max_local_workgroup_size), max_local_workgroup_size, NULL); - test_error(err, "clGetDeviceInfo failed for CL_DEVICE_MAX_WORK_ITEM_SIZES"); - - // Since the preferred size is only a performance hint, we can only really check that we get a sane value - // back - log_info( "size: %ld preferred: %ld max: %ld\n", max_workgroup_size, preferred_workgroup_size, max_local_workgroup_size[0] ); - - if( preferred_workgroup_size > max_workgroup_size ) - { - log_error( "ERROR: Reported preferred workgroup multiple larger than max workgroup size (preferred %ld, max %ld)\n", preferred_workgroup_size, max_workgroup_size ); - return -1; - } - - return 0; -} - -int test_min_max_execution_capabilities(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - cl_device_exec_capabilities value; - - - error = clGetDeviceInfo( deviceID, CL_DEVICE_EXECUTION_CAPABILITIES, sizeof( value ), &value, 0 ); - test_error( error, "Unable to get execution capabilities" ); - - if( ( value & CL_EXEC_KERNEL ) != CL_EXEC_KERNEL ) - { - log_error( "ERROR: Reported execution capabilities less than required by OpenCL 1.0 (reported 0x%08x)\n", (int)value ); - return -1; - } - return 0; -} - -int test_min_max_queue_properties(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - cl_command_queue_properties value; - - - error = clGetDeviceInfo( deviceID, CL_DEVICE_QUEUE_ON_HOST_PROPERTIES, sizeof( value ), &value, 0 ); - test_error( error, "Unable to get queue properties" ); - - if( ( value & CL_QUEUE_PROFILING_ENABLE ) != CL_QUEUE_PROFILING_ENABLE ) - { - log_error( "ERROR: Reported queue properties less than required by OpenCL 1.0 (reported 0x%08x)\n", (int)value ); - return -1; - } - return 0; -} - -int test_min_max_device_version(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - cl_int error, i; - cl_char buffer[ 4098 ]; - size_t length; - - - // Device version should fit the regex "OpenCL [0-9]+\.[0-9]+ *.*" - error = clGetDeviceInfo( deviceID, CL_DEVICE_VERSION, sizeof( buffer ), buffer, &length ); - test_error( error, "Unable to get device version string" ); - if( memcmp( buffer, "OpenCL ", strlen( "OpenCL " ) ) != 0 ) - { - log_error( "ERROR: Initial part of device version string does not match required format! (returned: %s)\n", (char *)buffer ); - return -1; - } - - log_info("Returned version %s.\n", buffer); - - char *p1 = (char *)buffer + strlen( "OpenCL " ); - while( *p1 == ' ' ) - p1++; - char *p2 = p1; - if( ! isdigit(*p2) ) - { - log_error( "ERROR: Major revision number must follow space behind OpenCL! (returned %s)\n", (char*) buffer ); - return -1; - } - while( isdigit( *p2 ) ) - p2++; - if( *p2 != '.' ) - { - log_error( "ERROR: Version number must contain a decimal point! (returned: %s)\n", (char *)buffer ); - return -1; - } - char *p3 = p2 + 1; - if( ! isdigit(*p3) ) - { - log_error( "ERROR: Minor revision number is missing or does not abut the decimal point! (returned %s)\n", (char*) buffer ); - return -1; - } - while( isdigit( *p3 ) ) - p3++; - if( *p3 != ' ' ) - { - log_error( "ERROR: A space must appear after the minor version! (returned: %s)\n", (char *)buffer ); - return -1; - } - *p2 = ' '; // Put in a space for atoi below. - p2++; - - int major = atoi( p1 ); - int minor = atoi( p2 ); - int minor_revision = 2; - if( getenv("OPENCL_1_0_DEVICE")) - { - minor_revision = 0; - log_info( "WARNING: This test was run with OPENCL_1_0_DEVICE defined! This is not a OpenCL 1.1 or OpenCL 1.2 compatible device!!!\n" ); - } - else if( getenv("OPENCL_1_1_DEVICE")) - { - minor_revision = 1; - log_info( "WARNING: This test was run with OPENCL_1_1_DEVICE defined! This is not a OpenCL 1.2 compatible device!!!\n" ); - } - if( major * 10 + minor < 10 + minor_revision ) - { - log_error( "ERROR: OpenCL device version returned is less than 1.%d! (Returned: %s)\n", minor_revision, (char *)buffer ); - return -1; - } - - // Sanity checks on the returned values - if( length != (strlen( (char *)buffer ) + 1 )) - { - log_error( "ERROR: Returned length of version string does not match actual length (actual: %d, returned: %d)\n", (int)strlen( (char *)buffer ), (int)length ); - return -1; - } - - // Make sure 2.0 devices support required extensions for 2.0 - const char *requiredExtensions20[] = - { - "cl_khr_byte_addressable_store", - "cl_khr_3d_image_writes", - "cl_khr_image2d_from_buffer", - "cl_khr_depth_images", - "cl_khr_fp64", - }; - - // Make sure 1.1 devices support required extensions for 1.1 - const char *requiredExtensions[] = - { - "cl_khr_global_int32_base_atomics", - "cl_khr_global_int32_extended_atomics", - "cl_khr_local_int32_base_atomics", - "cl_khr_local_int32_extended_atomics", - "cl_khr_byte_addressable_store", - NULL - }; - - if( major * 10 + minor >= 11 ) - { - char *extensions; - size_t extensions_size = 0; - - log_info( "Checking for required extensions for OpenCL 1.1 and later devices...\n" ); - - if( (error = clGetDeviceInfo(deviceID, CL_DEVICE_EXTENSIONS, 0, NULL, &extensions_size))) - { - log_error( "ERROR: could not get extensions size. Err # %d\n", error ); - return -1; - } - - if( extensions_size < 1 ) - { - log_error( "ERROR: invalid extensions size. Err # %d\n", error ); - return -1; - } - - extensions = (char*) malloc(extensions_size); - if( NULL == extensions ) - { - log_error( "ERROR: cannot allocate %ld bytes to hold extension string.\n", extensions_size ); - return -1; - } - memset( extensions, -1, extensions_size ); - - if( (error = clGetDeviceInfo(deviceID, CL_DEVICE_EXTENSIONS, extensions_size, extensions, NULL))) - { - log_error( "ERROR: could not get extensions. Err # %d\n", error ); - free( extensions ); - return -1; - } - - if( '\0' != extensions[ extensions_size - 1 ] ) - { - if( -1 == extensions[ extensions_size - 1 ] ) - log_error( "ERROR: extensions size reported incorrectly. Last byte is not NUL. Size too big. Reported: %ld. Should be: %ld\n", extensions_size, strlen(extensions) + 1 ); - else - log_error( "ERROR: extensions size reported incorrectly. Last byte is not NUL. Size too small. \n" ); - - free( extensions ); - return -1; - } - - for( i = 0; NULL != requiredExtensions[i]; i++ ) - { - if( NULL == strstr( extensions, requiredExtensions[i] ) ) - { - log_error( "ERROR: Required extension for 1.1 and greater devices is not in extension string: %s\n", requiredExtensions[i] ); - free( extensions ); - return -1; - } - else - log_info( "\t%s\n", requiredExtensions[i] ); - } - - if( major >= 2 ) - { - log_info( "Checking for required extensions for OpenCL 2.0 and later devices...\n" ); - - // Check if double precision is supported, if it is, then check the extension "cl_khr_fp64" - cl_device_fp_config value; - int numRequiredExtension20 = sizeof(requiredExtensions20)/sizeof(char *); - - error = clGetDeviceInfo( deviceID, CL_DEVICE_DOUBLE_FP_CONFIG, sizeof( value ), &value, 0 ); - test_error( error, "Unable to get device double fp config" ); - - // if double precision is not supported, then don't check extension "cl_khr_fp64" - numRequiredExtension20 -= (value == 0); - - for( i = 0; i #include -extern cl_uint gRandomSeed; - const char *sample_single_param_kernel[] = { "__kernel void sample_test(__global int *src)\n" "{\n" @@ -241,6 +239,7 @@ int test_min_max_read_image_args(cl_device_id deviceID, cl_context context, cl_c { int error; unsigned int maxReadImages, i; + unsigned int deviceAddressSize; clProgramWrapper program; char readArgLine[128], *programSrc; const char *readArgPattern = ", read_only image2d_t srcimg%d"; @@ -273,6 +272,11 @@ int test_min_max_read_image_args(cl_device_id deviceID, cl_context context, cl_c log_info("Reported %d max read image args.\n", maxReadImages); + error = clGetDeviceInfo( deviceID, CL_DEVICE_ADDRESS_BITS, sizeof( deviceAddressSize ), &deviceAddressSize, NULL ); + test_error( error, "Unable to query CL_DEVICE_ADDRESS_BITS for device" ); + deviceAddressSize /= 8; // convert from bits to bytes + + error = clGetDeviceInfo( deviceID, CL_DEVICE_MAX_PARAMETER_SIZE, sizeof( maxParameterSize ), &maxParameterSize, NULL ); test_error( error, "Unable to get max parameter size from device" ); @@ -286,14 +290,13 @@ int test_min_max_read_image_args(cl_device_id deviceID, cl_context context, cl_c maxReadImages = 127; } } - // Subtract the size of the result - maxParameterSize -= sizeof(cl_mem); + maxParameterSize -= deviceAddressSize; // Calculate the number we can use - if (maxParameterSize/sizeof(cl_mem) < maxReadImages) { - log_info("WARNING: Max parameter size of %d bytes limits test to %d max image arguments.\n", (int)maxParameterSize, (int)(maxParameterSize/sizeof(cl_mem))); - maxReadImages = (unsigned int)(maxParameterSize/sizeof(cl_mem)); + if (maxParameterSize/deviceAddressSize < maxReadImages) { + log_info("WARNING: Max parameter size of %d bytes limits test to %d max image arguments.\n", (int)maxParameterSize, (int)(maxParameterSize/deviceAddressSize)); + maxReadImages = (unsigned int)(maxParameterSize/deviceAddressSize); } /* Create a program with that many read args */ @@ -496,6 +499,7 @@ int test_min_max_mem_alloc_size(cl_device_id deviceID, cl_context context, cl_co if (memSize > (cl_ulong)SIZE_MAX) { memSize = (cl_ulong)SIZE_MAX; } + if( maxAllocSize < requiredAllocSize) { log_error( "ERROR: Reported max allocation size is less than required %lldMB! (%llu or %lluMB, from a total mem size of %lldMB)\n", (requiredAllocSize / 1024) / 1024, maxAllocSize, (maxAllocSize / 1024)/1024, (memSize / 1024)/1024 ); @@ -503,10 +507,12 @@ int test_min_max_mem_alloc_size(cl_device_id deviceID, cl_context context, cl_co } requiredAllocSize = ((memSize / 4) > (1024 * 1024 * 1024)) ? 1024 * 1024 * 1024 : memSize / 4; + if (gIsEmbedded) requiredAllocSize = (requiredAllocSize < 1 * 1024 * 1024) ? 1 * 1024 * 1024 : requiredAllocSize; else requiredAllocSize = (requiredAllocSize < 128 * 1024 * 1024) ? 128 * 1024 * 1024 : requiredAllocSize; + if( maxAllocSize < requiredAllocSize ) { log_error( "ERROR: Reported max allocation size is less than required of total memory! (%llu or %lluMB, from a total mem size of %lluMB)\n", maxAllocSize, (maxAllocSize / 1024)/1024, (requiredAllocSize / 1024)/1024 ); @@ -519,7 +525,6 @@ int test_min_max_mem_alloc_size(cl_device_id deviceID, cl_context context, cl_co if ( memSize < maxAllocSize ) { log_info("Global memory size is less than max allocation size, using that.\n"); maxAllocSize = memSize; - } minSizeToTry = maxAllocSize/16; @@ -547,29 +552,19 @@ int test_min_max_image_2d_width(cl_device_id deviceID, cl_context context, cl_co cl_image_format image_format_desc; cl_ulong maxAllocSize; cl_uint minRequiredDimension; - cl_char buffer[ 4098 ]; size_t length; PASSIVE_REQUIRE_IMAGE_SUPPORT( deviceID ) - // Device version should fit the regex "OpenCL [0-9]+\.[0-9]+ *.*" - error = clGetDeviceInfo( deviceID, CL_DEVICE_VERSION, sizeof( buffer ), buffer, &length ); - test_error( error, "Unable to get device version string" ); - if( memcmp( buffer, "OpenCL 2.1", strlen( "OpenCL 2.1" ) ) == 0 ) - minRequiredDimension = gIsEmbedded ? 2048 : 8192; - else if( memcmp( buffer, "OpenCL 2.0", strlen( "OpenCL 2.0" ) ) == 0 ) - minRequiredDimension = gIsEmbedded ? 2048 : 8192; - else if( memcmp( buffer, "OpenCL 1.2", strlen( "OpenCL 1.2" ) ) == 0 ) - minRequiredDimension = gIsEmbedded ? 2048 : 8192; - else if( memcmp( buffer, "OpenCL 1.1", strlen( "OpenCL 1.1" ) ) == 0 ) - minRequiredDimension = gIsEmbedded ? 2048 : 8192; - else if ( memcmp( buffer, "OpenCL 1.0", strlen( "OpenCL 1.0" ) ) == 0 ) + auto version = get_device_cl_version(deviceID); + if (version == Version(1, 0)) + { minRequiredDimension = gIsEmbedded ? 2048 : 4096; + } else { - log_error( "ERROR: device version string does not match required format! (returned: %s)\n", (char *)buffer ); - return -1; + minRequiredDimension = gIsEmbedded ? 2048 : 8192; } @@ -626,28 +621,18 @@ int test_min_max_image_2d_height(cl_device_id deviceID, cl_context context, cl_c cl_image_format image_format_desc; cl_ulong maxAllocSize; cl_uint minRequiredDimension; - cl_char buffer[ 4098 ]; size_t length; PASSIVE_REQUIRE_IMAGE_SUPPORT( deviceID ) - // Device version should fit the regex "OpenCL [0-9]+\.[0-9]+ *.*" - error = clGetDeviceInfo( deviceID, CL_DEVICE_VERSION, sizeof( buffer ), buffer, &length ); - test_error( error, "Unable to get device version string" ); - if( memcmp( buffer, "OpenCL 2.1", strlen( "OpenCL 2.1" ) ) == 0 ) - minRequiredDimension = gIsEmbedded ? 2048 : 8192; - else if( memcmp( buffer, "OpenCL 2.0", strlen( "OpenCL 2.0" ) ) == 0 ) - minRequiredDimension = gIsEmbedded ? 2048 : 8192; - else if( memcmp( buffer, "OpenCL 1.2", strlen( "OpenCL 1.2" ) ) == 0 ) - minRequiredDimension = gIsEmbedded ? 2048 : 8192; - else if( memcmp( buffer, "OpenCL 1.1", strlen( "OpenCL 1.1" ) ) == 0 ) - minRequiredDimension = gIsEmbedded ? 2048 : 8192; - else if ( memcmp( buffer, "OpenCL 1.0", strlen( "OpenCL 1.0" ) ) == 0 ) - minRequiredDimension = gIsEmbedded ? 2048 : 4096; + auto version = get_device_cl_version(deviceID); + if (version == Version(1, 0)) + { + minRequiredDimension = gIsEmbedded ? 2048 : 4096; + } else { - log_error( "ERROR: device version string does not match required format! (returned: %s)\n", (char *)buffer ); - return -1; + minRequiredDimension = gIsEmbedded ? 2048 : 8192; } /* Just get any ol format to test with */ @@ -1012,6 +997,7 @@ int test_min_max_parameter_size(cl_device_id deviceID, cl_context context, cl_co error = clGetDeviceInfo( deviceID, CL_DEVICE_MAX_PARAMETER_SIZE, sizeof( maxSize ), &maxSize, NULL ); test_error( error, "Unable to get max parameter size from device" ); + if( ((!gIsEmbedded) && (maxSize < 1024)) || ((gIsEmbedded) && (maxSize < 256)) ) { log_error( "ERROR: Reported max parameter size is less than required! (%d)\n", (int)maxSize ); @@ -1299,7 +1285,6 @@ int test_min_max_constant_buffer_size(cl_device_id deviceID, cl_context context, int error; clProgramWrapper program; clKernelWrapper kernel; - clMemWrapper streams[3]; size_t threads[1], localThreads[1]; cl_int *constantData, *resultData; cl_ulong maxSize, stepSize, currentSize, maxGlobalSize, maxAllocSize; @@ -1320,14 +1305,19 @@ int test_min_max_constant_buffer_size(cl_device_id deviceID, cl_context context, log_info("Reported max constant buffer size of %lld bytes.\n", maxSize); + // Limit test buffer size to 1/8 of CL_DEVICE_GLOBAL_MEM_SIZE error = clGetDeviceInfo(deviceID, CL_DEVICE_GLOBAL_MEM_SIZE, sizeof(maxGlobalSize), &maxGlobalSize, 0); test_error(error, "Unable to get CL_DEVICE_GLOBAL_MEM_SIZE"); + if (maxSize > maxGlobalSize / 8) maxSize = maxGlobalSize / 8; + error = clGetDeviceInfo(deviceID, CL_DEVICE_MAX_MEM_ALLOC_SIZE , sizeof(maxAllocSize), &maxAllocSize, 0); test_error(error, "Unable to get CL_DEVICE_MAX_MEM_ALLOC_SIZE "); + if (maxSize > maxAllocSize) maxSize = maxAllocSize; + /* Create a kernel to test with */ if( create_single_kernel_helper( context, &program, &kernel, 1, sample_const_arg_kernel, "sample_test" ) != 0 ) { @@ -1346,9 +1336,17 @@ int test_min_max_constant_buffer_size(cl_device_id deviceID, cl_context context, size_t sizeToAllocate = ((size_t)currentSize/sizeof( cl_int ))*sizeof(cl_int); size_t numberOfInts = sizeToAllocate/sizeof(cl_int); constantData = (cl_int *)malloc( sizeToAllocate); + if (constantData == NULL) + { + log_error("Failed to allocate memory for constantData!\n"); + free_mtdata(d); + return EXIT_FAILURE; + } + for(i=0; i<(int)(numberOfInts); i++) constantData[i] = (int)genrand_int32(d); + clMemWrapper streams[3]; streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), sizeToAllocate, constantData, &error); test_error( error, "Creating test array failed" ); streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeToAllocate, NULL, &error); @@ -1398,6 +1396,14 @@ int test_min_max_constant_buffer_size(cl_device_id deviceID, cl_context context, allocPassed = 1; resultData = (cl_int *)malloc(sizeToAllocate); + if (resultData == NULL) + { + log_error("Failed to allocate memory for resultData!\n"); + free(constantData); + free_mtdata(d); + return EXIT_FAILURE; + } + error = clEnqueueReadBuffer(queue, streams[1], CL_TRUE, 0, sizeToAllocate, resultData, 0, NULL, NULL); test_error( error, "clEnqueueReadBuffer failed"); @@ -1418,7 +1424,7 @@ int test_min_max_constant_buffer_size(cl_device_id deviceID, cl_context context, if (allocPassed) { if (currentSize < maxSize/PASSING_FRACTION) { - log_error("Failed to allocate at least 1/4 of the reported constant size.\n"); + log_error("Failed to allocate at least 1/8 of the reported constant size.\n"); return -1; } else if (currentSize != maxSize) { log_info("Passed at reduced size. (%lld of %lld bytes)\n", currentSize, maxSize); @@ -1669,6 +1675,8 @@ int test_min_max_local_mem_size(cl_device_id deviceID, cl_context context, cl_co { if( memcmp( buffer, "OpenCL 2.0", strlen( "OpenCL 2.0" ) ) == 0 ) min_max_local_mem_size = 16L * 1024L; + else if( memcmp( buffer, "OpenCL 2.1", strlen( "OpenCL 2.1" ) ) != 0 ) + min_max_local_mem_size = 16L * 1024L; else if( memcmp( buffer, "OpenCL 1.2", strlen( "OpenCL 1.2" ) ) != 0 ) min_max_local_mem_size = 16L * 1024L; else if( memcmp( buffer, "OpenCL 1.1", strlen( "OpenCL 1.1" ) ) != 0 ) @@ -1829,7 +1837,7 @@ int test_min_max_queue_properties(cl_device_id deviceID, cl_context context, cl_ cl_command_queue_properties value; - error = clGetDeviceInfo( deviceID, CL_DEVICE_QUEUE_PROPERTIES, sizeof( value ), &value, 0 ); + error = clGetDeviceInfo( deviceID, CL_DEVICE_QUEUE_ON_HOST_PROPERTIES, sizeof( value ), &value, 0 ); test_error( error, "Unable to get queue properties" ); if( ( value & CL_QUEUE_PROFILING_ENABLE ) != CL_QUEUE_PROFILING_ENABLE ) @@ -1842,153 +1850,97 @@ int test_min_max_queue_properties(cl_device_id deviceID, cl_context context, cl_ int test_min_max_device_version(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) { - cl_int error, i; - cl_char buffer[ 4098 ]; - size_t length; + // Query for the device version. + Version device_cl_version = get_device_cl_version(deviceID); + log_info("Returned version %s.\n", device_cl_version.to_string().c_str()); - - // Device version should fit the regex "OpenCL [0-9]+\.[0-9]+ *.*" - error = clGetDeviceInfo( deviceID, CL_DEVICE_VERSION, sizeof( buffer ), buffer, &length ); - test_error( error, "Unable to get device version string" ); - if( memcmp( buffer, "OpenCL ", strlen( "OpenCL " ) ) != 0 ) - { - log_error( "ERROR: Initial part of device version string does not match required format! (returned: %s)\n", (char *)buffer ); - return -1; - } - - log_info("Returned version %s.\n", buffer); - - char *p1 = (char *)buffer + strlen( "OpenCL " ); - while( *p1 == ' ' ) - p1++; - char *p2 = p1; - if( ! isdigit(*p2) ) - { - log_error( "ERROR: Major revision number must follow space behind OpenCL! (returned %s)\n", (char*) buffer ); - return -1; - } - while( isdigit( *p2 ) ) - p2++; - if( *p2 != '.' ) - { - log_error( "ERROR: Version number must contain a decimal point! (returned: %s)\n", (char *)buffer ); - return -1; - } - char *p3 = p2 + 1; - if( ! isdigit(*p3) ) - { - log_error( "ERROR: Minor revision number is missing or does not abut the decimal point! (returned %s)\n", (char*) buffer ); - return -1; - } - while( isdigit( *p3 ) ) - p3++; - if( *p3 != ' ' ) - { - log_error( "ERROR: A space must appear after the minor version! (returned: %s)\n", (char *)buffer ); - return -1; - } - *p2 = ' '; // Put in a space for atoi below. - p2++; - - int major = atoi( p1 ); - int minor = atoi( p2 ); - int minor_revision = 2; - if( getenv("OPENCL_1_0_DEVICE")) - { - minor_revision = 0; - log_info( "WARNING: This test was run with OPENCL_1_0_DEVICE defined! This is not a OpenCL 1.1 or OpenCL 1.2 compatible device!!!\n" ); - } - else if( getenv("OPENCL_1_1_DEVICE")) - { - minor_revision = 1; - log_info( "WARNING: This test was run with OPENCL_1_1_DEVICE defined! This is not a OpenCL 1.2 compatible device!!!\n" ); - } - if( major * 10 + minor < 10 + minor_revision ) - { - log_error( "ERROR: OpenCL device version returned is less than 1.%d! (Returned: %s)\n", minor_revision, (char *)buffer ); - return -1; - } - - // Sanity checks on the returned values - if( length != (strlen( (char *)buffer ) + 1 )) - { - log_error( "ERROR: Returned length of version string does not match actual length (actual: %d, returned: %d)\n", (int)strlen( (char *)buffer ), (int)length ); - return -1; - } + // Make sure 2.x devices support required extensions for 2.x + // note: these extensions are **not** required for devices + // supporting OpenCL-3.0 + const char *requiredExtensions2x[] = { + "cl_khr_3d_image_writes", + "cl_khr_image2d_from_buffer", + "cl_khr_depth_images", + }; // Make sure 1.1 devices support required extensions for 1.1 - const char *requiredExtensions[] = - { + const char *requiredExtensions11[] = { "cl_khr_global_int32_base_atomics", "cl_khr_global_int32_extended_atomics", "cl_khr_local_int32_base_atomics", "cl_khr_local_int32_extended_atomics", "cl_khr_byte_addressable_store", - NULL }; - if( major * 10 + minor >= 11 ) + + if (device_cl_version >= Version(1, 1)) { - char *extensions; - size_t extensions_size = 0; - - log_info( "Checking for required extensions for OpenCL 1.1 and later devices...\n" ); - - if( (error = clGetDeviceInfo(deviceID, CL_DEVICE_EXTENSIONS, 0, NULL, &extensions_size))) + log_info("Checking for required extensions for OpenCL 1.1 and later " + "devices...\n"); + for (int i = 0; i < ARRAY_SIZE(requiredExtensions11); i++) { - log_error( "ERROR: could not get extensions size. Err # %d\n", error ); - return -1; - } - - if( extensions_size < 1 ) - { - log_error( "ERROR: invalid extensions size. Err # %d\n", error ); - return -1; - } - - extensions = (char*) malloc(extensions_size); - if( NULL == extensions ) - { - log_error( "ERROR: cannot allocate %ld bytes to hold extension string.\n", extensions_size ); - return -1; - } - memset( extensions, -1, extensions_size ); - - if( (error = clGetDeviceInfo(deviceID, CL_DEVICE_EXTENSIONS, extensions_size, extensions, NULL))) - { - log_error( "ERROR: could not get extensions. Err # %d\n", error ); - free( extensions ); - return -1; - } - - if( '\0' != extensions[ extensions_size - 1 ] ) - { - if( -1 == extensions[ extensions_size - 1 ] ) - log_error( "ERROR: extensions size reported incorrectly. Last byte is not NUL. Size too big. Reported: %ld. Should be: %ld\n", extensions_size, strlen(extensions) + 1 ); - else - log_error( "ERROR: extensions size reported incorrectly. Last byte is not NUL. Size too small. \n" ); - - free( extensions ); - return -1; - } - - for( i = 0; NULL != requiredExtensions[i]; i++ ) - { - if( NULL == strstr( extensions, requiredExtensions[i] ) ) + if (!is_extension_available(deviceID, requiredExtensions11[i])) { - log_error( "ERROR: Required extension for 1.1 and greater devices is not in extension string: %s\n", requiredExtensions[i] ); - free( extensions ); + log_error("ERROR: Required extension for 1.1 and greater " + "devices is not in extension string: %s\n", + requiredExtensions11[i]); return -1; } else - log_info( "\t%s\n", requiredExtensions[i] ); + log_info("\t%s\n", requiredExtensions11[i]); + } + + if (device_cl_version >= Version(1, 2)) + { + log_info("Checking for required extensions for OpenCL 1.2 and " + "later devices...\n"); + // The only required extension for an OpenCL-1.2 device is + // cl_khr_fp64 and it is only required if double precision is + // supported. + cl_device_fp_config doubles_supported; + cl_int error = clGetDeviceInfo(deviceID, CL_DEVICE_DOUBLE_FP_CONFIG, + sizeof(doubles_supported), + &doubles_supported, 0); + test_error(error, "Unable to get device double fp config"); + if (doubles_supported) + { + if (!is_extension_available(deviceID, "cl_khr_fp64")) + { + log_error( + "ERROR: Required extension for 1.2 and greater devices " + "is not in extension string: cl_khr_fp64\n"); + } + else + { + log_info("\t%s\n", "cl_khr_fp64"); + } + } + } + + if (device_cl_version >= Version(2, 0) + && device_cl_version < Version(3, 0)) + { + log_info("Checking for required extensions for OpenCL 2.0, 2.1 and " + "2.2 devices...\n"); + for (int i = 0; i < ARRAY_SIZE(requiredExtensions2x); i++) + { + if (!is_extension_available(deviceID, requiredExtensions2x[i])) + { + log_error("ERROR: Required extension for 2.0, 2.1 and 2.2 " + "devices is not in extension string: %s\n", + requiredExtensions2x[i]); + return -1; + } + else + { + log_info("\t%s\n", requiredExtensions2x[i]); + } + } } - free( extensions ); } else - log_info( "WARNING: skipping required extension test -- OpenCL 1.0 device.\n" ); - - + log_info("WARNING: skipping required extension test -- OpenCL 1.0 " + "device.\n"); return 0; } diff --git a/test_conformance/api/test_bool.c b/test_conformance/api/test_bool.cpp similarity index 93% rename from test_conformance/api/test_bool.c rename to test_conformance/api/test_bool.cpp index 30b15b3e..9c91f613 100644 --- a/test_conformance/api/test_bool.c +++ b/test_conformance/api/test_bool.cpp @@ -14,7 +14,7 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" const char *kernel_with_bool[] = { @@ -38,8 +38,8 @@ const char *kernel_with_bool[] = { int test_bool_type(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) { - cl_program program; - cl_kernel kernel; + clProgramWrapper program; + clKernelWrapper kernel; int err = create_single_kernel_helper(context, &program, diff --git a/test_conformance/api/test_clone_kernel.cpp b/test_conformance/api/test_clone_kernel.cpp index 5826d7dc..1f227816 100644 --- a/test_conformance/api/test_clone_kernel.cpp +++ b/test_conformance/api/test_clone_kernel.cpp @@ -14,8 +14,8 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/conversions.h" +#include "harness/typeWrappers.h" +#include "harness/conversions.h" #include #include #include @@ -261,28 +261,9 @@ int test_clone_kernel(cl_device_id deviceID, cl_context context, cl_command_queu test_error( error, "clGetDeviceInfo failed." ); // test double support - size_t ext_str_size; - error = clGetDeviceInfo(deviceID, CL_DEVICE_EXTENSIONS, 0, NULL, &ext_str_size); - test_error( error, "clGetDeviceInfo failed." ); - char* ext_str = new char[ext_str_size+1]; - - error = clGetDeviceInfo(deviceID, CL_DEVICE_EXTENSIONS, ext_str_size, ext_str, NULL); - test_error( error, "clGetDeviceInfo failed." ); - - ext_str[ext_str_size] = '\0'; - - stringstream ss; - ss << ext_str; - - while (!ss.eof()) + if (is_extension_available(deviceID, "cl_khr_fp64")) { - string s; - ss >> s; - if (s == "cl_khr_fp64") - { - bdouble = CL_TRUE; - break; - } + bdouble = CL_TRUE; } /* Create kernels to test with */ @@ -318,9 +299,6 @@ int test_clone_kernel(cl_device_id deviceID, cl_context context, cl_command_queu bufOut = clCreateBuffer(context, CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR, BUF_SIZE, NULL, &error); test_error( error, "clCreateBuffer failed." ); - clMemWrapper pipe = clCreatePipe(context, CL_MEM_HOST_NO_ACCESS, sizeof(int), 16, NULL, &error); - test_error( error, "clCreatePipe failed." ); - error = clSetKernelArg(kernel, 0, sizeof(int), &intarg); error += clSetKernelArg(kernel, 1, sizeof(float), &farg); error += clSetKernelArg(kernel, 2, sizeof(structArg), &sa); @@ -338,7 +316,7 @@ int test_clone_kernel(cl_device_id deviceID, cl_context context, cl_command_queu error = clEnqueueNDRangeKernel(queue, clonek, 1, NULL, &ndrange1, NULL, 0, NULL, NULL); test_error( error, "clEnqueueNDRangeKernel failed." ); - // shallow clone tests for buffer, svm and pipes + // shallow clone tests for buffer error = clSetKernelArg(kernel_buf_write, 0, sizeof(cl_mem), &buf); error += clSetKernelArg(kernel_buf_write, 1, sizeof(int), &write_val); test_error( error, "clSetKernelArg failed." ); @@ -404,7 +382,6 @@ int test_clone_kernel(cl_device_id deviceID, cl_context context, cl_command_queu delete [] pbuf; delete [] pbufRes; - delete [] ext_str; return 0; } diff --git a/test_conformance/api/test_context_destructor_callback.cpp b/test_conformance/api/test_context_destructor_callback.cpp new file mode 100644 index 00000000..1d73a3c4 --- /dev/null +++ b/test_conformance/api/test_context_destructor_callback.cpp @@ -0,0 +1,93 @@ +// +// Copyright (c) 2020 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "testBase.h" + +static volatile cl_int sDestructorIndex; + +void CL_CALLBACK context_destructor_callback(cl_context context, void *userData) +{ + int *userPtr = (int *)userData; + + // ordering of callbacks is guaranteed, meaning we don't need to do atomic + // operation here + *userPtr = ++sDestructorIndex; +} + +int test_context_destructor_callback(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements) +{ + cl_int error; + clContextWrapper localContext = + clCreateContext(NULL, 1, &deviceID, NULL, NULL, &error); + test_error(error, "Unable to create local context"); + + // Set up some variables to catch the order in which callbacks are called + volatile int callbackOrders[3] = { 0, 0, 0 }; + sDestructorIndex = 0; + + // Set up the callbacks + error = clSetContextDestructorCallback( + localContext, context_destructor_callback, (void *)&callbackOrders[0]); + test_error(error, "Unable to set destructor callback"); + + error = clSetContextDestructorCallback( + localContext, context_destructor_callback, (void *)&callbackOrders[1]); + test_error(error, "Unable to set destructor callback"); + + error = clSetContextDestructorCallback( + localContext, context_destructor_callback, (void *)&callbackOrders[2]); + test_error(error, "Unable to set destructor callback"); + + // Now release the context, which SHOULD call the callbacks + error = clReleaseContext(localContext); + test_error(error, "Unable to release local context"); + + // Note: since we manually released the context, we need to set it to NULL + // to prevent a double-release + localContext = NULL; + + // At this point, all three callbacks should have already been called + int numErrors = 0; + for (int i = 0; i < 3; i++) + { + // Spin waiting for the release to finish. If you don't call the + // context_destructor_callback, you will not pass the test. + log_info("\tWaiting for callback %d...\n", i); + int wait = 0; + while (0 == callbackOrders[i]) + { + usleep(100000); // 1/10th second + if (++wait >= 10 * 10) + { + log_error("\tERROR: Callback %d was not called within 10 " + "seconds! Assuming failure.\n", + i + 1); + numErrors++; + break; + } + } + + if (callbackOrders[i] != 3 - i) + { + log_error("\tERROR: Callback %d was called in the wrong order! " + "(Was called order %d, should have been order %d)\n", + i + 1, callbackOrders[i], 3 - i); + numErrors++; + } + } + + return (numErrors > 0) ? TEST_FAIL : TEST_PASS; +} diff --git a/test_conformance/api/test_create_context_from_type.cpp b/test_conformance/api/test_create_context_from_type.cpp index 4f560148..bbc2c866 100644 --- a/test_conformance/api/test_create_context_from_type.cpp +++ b/test_conformance/api/test_create_context_from_type.cpp @@ -14,15 +14,13 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" #ifndef _WIN32 #include #endif -#include "../../test_common/harness/conversions.h" - -extern cl_uint gRandomSeed; +#include "harness/conversions.h" int test_create_context_from_type(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) { @@ -58,7 +56,7 @@ int test_create_context_from_type(cl_device_id deviceID, cl_context context, cl_ cl_context_properties properties[3] = { (cl_context_properties)CL_CONTEXT_PLATFORM, (cl_context_properties)platform, - NULL + 0 }; context_to_test = clCreateContextFromType(properties, type, notify_callback, NULL, &error); @@ -68,7 +66,7 @@ int test_create_context_from_type(cl_device_id deviceID, cl_context context, cl_ return -1; } - queue_to_test = clCreateCommandQueueWithProperties(context_to_test, deviceID, NULL, &error); + queue_to_test = clCreateCommandQueue(context_to_test, deviceID, 0, &error); test_error(error, "clCreateCommandQueue failed"); if (queue_to_test == NULL) { log_error("clCreateCommandQueue returned NULL, but error was CL_SUCCESS."); diff --git a/test_conformance/api/test_create_kernels.c b/test_conformance/api/test_create_kernels.cpp similarity index 99% rename from test_conformance/api/test_create_kernels.c rename to test_conformance/api/test_create_kernels.cpp index ceb18732..59f7f0aa 100644 --- a/test_conformance/api/test_create_kernels.c +++ b/test_conformance/api/test_create_kernels.cpp @@ -14,7 +14,7 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" const char *sample_single_kernel[] = { @@ -521,7 +521,7 @@ int test_repeated_setup_cleanup(cl_device_id deviceID, cl_context context, cl_co local_context = clCreateContext(NULL, 1, &deviceID, notify_callback, NULL, &error); test_error( error, "clCreateContext failed"); - local_queue = clCreateCommandQueueWithProperties(local_context, deviceID, 0, &error); + local_queue = clCreateCommandQueue(local_context, deviceID, 0, &error); test_error( error, "clCreateCommandQueue failed"); error = create_single_kernel_helper(local_context, &local_program, NULL, 1, &repeate_test_kernel, NULL); diff --git a/test_conformance/api/test_device_min_data_type_align_size_alignment.cpp b/test_conformance/api/test_device_min_data_type_align_size_alignment.cpp index 4a742205..0115a2bc 100644 --- a/test_conformance/api/test_device_min_data_type_align_size_alignment.cpp +++ b/test_conformance/api/test_device_min_data_type_align_size_alignment.cpp @@ -14,7 +14,7 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" #ifndef _WIN32 #include #endif diff --git a/test_conformance/api/test_kernel_arg_changes.cpp b/test_conformance/api/test_kernel_arg_changes.cpp index b7aba632..d85ae99b 100644 --- a/test_conformance/api/test_kernel_arg_changes.cpp +++ b/test_conformance/api/test_kernel_arg_changes.cpp @@ -15,8 +15,6 @@ // #include "testBase.h" -extern "C" { extern cl_uint gRandomSeed;} - // This test is designed to stress changing kernel arguments between execute calls (that are asynchronous and thus // potentially overlapping) to make sure each kernel gets the right arguments diff --git a/test_conformance/api/test_kernel_arg_info.c b/test_conformance/api/test_kernel_arg_info.cpp similarity index 99% rename from test_conformance/api/test_kernel_arg_info.c rename to test_conformance/api/test_kernel_arg_info.cpp index 27d58987..f1039aec 100644 --- a/test_conformance/api/test_kernel_arg_info.c +++ b/test_conformance/api/test_kernel_arg_info.cpp @@ -5585,15 +5585,14 @@ const char * long_arg_info[][72] = { template int test(cl_device_id deviceID, cl_context context, kernel_args_t kernel_args, cl_uint lines_count, arg_info_t arg_info, size_t total_kernels_in_program) { - cl_program program; - cl_kernel kernel; const size_t max_name_len = 512; cl_char name[ max_name_len ]; cl_uint arg_count, numArgs; size_t i, j, size; int error; - program = clCreateProgramWithSource( context, lines_count, kernel_args, NULL, &error ); + clProgramWrapper program = + clCreateProgramWithSource(context, lines_count, kernel_args, NULL, &error); if ( program == NULL || error != CL_SUCCESS ) { print_error( error, "Unable to create required arguments kernel program" ); @@ -5704,7 +5703,7 @@ int test(cl_device_id deviceID, cl_context context, kernel_args_t kernel_args, c { int kernel_rc = 0; const char* kernel_name = arg_info[ i ][ 0 ]; - kernel = clCreateKernel( program, kernel_name, &error ); + clKernelWrapper kernel = clCreateKernel(program, kernel_name, &error); if( kernel == NULL || error != CL_SUCCESS ) { log_error( "ERROR: Could not get kernel: %s\n", kernel_name ); @@ -5824,8 +5823,6 @@ int test(cl_device_id deviceID, cl_context context, kernel_args_t kernel_args, c int test_get_kernel_arg_info( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ) { - clProgramWrapper program; - clKernelWrapper kernel; size_t size; int error; @@ -5848,37 +5845,7 @@ int test_get_kernel_arg_info( cl_device_id deviceID, cl_context context, cl_c log_info(" o Not testing image kernel arguments.\n"); } - // Get the extensions string for the device - error = clGetDeviceInfo(deviceID, CL_DEVICE_EXTENSIONS, 0, NULL, &size); - test_error(error, "clGetDeviceInfo for CL_DEVICE_EXTENSIONS size failed"); - - char *extensions = (char*)malloc(sizeof(char)*(size + 1)); - if (extensions == 0) { - log_error("Failed to allocate memory for extensions string.\n"); - return -1; - } - memset( extensions, CHAR_MIN, sizeof(char)*(size+1) ); - - error = clGetDeviceInfo(deviceID, CL_DEVICE_EXTENSIONS, sizeof(char)*size, extensions, NULL); - test_error(error, "clGetDeviceInfo for CL_DEVICE_EXTENSIONS failed"); - - // Check to make sure the extension string is NUL terminated. - if( extensions[size] != CHAR_MIN ) - { - test_error( -1, "clGetDeviceInfo for CL_DEVICE_EXTENSIONS wrote past the end of the array!" ); - return -1; - } - extensions[size] = '\0'; // set last char to NUL to avoid problems with string functions later - - // test for termination with '\0' - size_t stringSize = strlen( extensions ); - if( stringSize == size ) - { - test_error( -1, "clGetDeviceInfo for CL_DEVICE_EXTENSIONS is not NUL terminated!" ); - return -1; - } - - if (strstr(extensions, "cl_khr_fp64")) { + if (is_extension_available(deviceID, "cl_khr_fp64")) { log_info(" o Device claims extension 'cl_khr_fp64'\n"); log_info(" o Expecting SUCCESS when testing double kernel arguments.\n"); supports_double = 1; @@ -5895,7 +5862,7 @@ int test_get_kernel_arg_info( cl_device_id deviceID, cl_context context, cl_c } } - if (strstr(extensions, "cl_khr_fp16")) { + if (is_extension_available(deviceID, "cl_khr_fp16")) { log_info(" o Device claims extension 'cl_khr_fp16'\n"); log_info(" o Expecting SUCCESS when testing halfn* kernel arguments.\n"); supports_half = 1; @@ -5905,7 +5872,7 @@ int test_get_kernel_arg_info( cl_device_id deviceID, cl_context context, cl_c supports_half = 0; } - if (strstr(extensions, "cl_khr_int64")) + if (is_extension_available(deviceID, "cl_khr_int64")) { log_info(" o Device claims extension 'cl_khr_int64'\n"); log_info(" o Expecting SUCCESS when testing long kernel arguments.\n"); diff --git a/test_conformance/compatibility/test_conformance/api/test_kernel_arg_info.c b/test_conformance/api/test_kernel_arg_info_compatibility.cpp similarity index 99% rename from test_conformance/compatibility/test_conformance/api/test_kernel_arg_info.c rename to test_conformance/api/test_kernel_arg_info_compatibility.cpp index 5b1e5e6d..a6b60c26 100644 --- a/test_conformance/compatibility/test_conformance/api/test_kernel_arg_info.c +++ b/test_conformance/api/test_kernel_arg_info_compatibility.cpp @@ -30,7 +30,7 @@ typedef char const * kernel_args_t[]; -kernel_args_t required_kernel_args = { +static kernel_args_t required_kernel_args = { "typedef float4 typedef_type;\n" "\n" "typedef struct struct_type {\n" @@ -1857,7 +1857,7 @@ kernel_args_t required_kernel_args = { "\n" }; -const char * required_arg_info[][72] = { +static const char * required_arg_info[][72] = { // The minimum value of CL_DEVICE_MAX_CONSTANT_ARGS is 4 { "constant_scalar_p0", @@ -4038,7 +4038,7 @@ const char * required_arg_info[][72] = { }; // Support for optional image data type -const char * image_kernel_args[] = { +static const char * image_kernel_args[] = { "#pragma OPENCL EXTENSION cl_khr_3d_image_writes: enable\n" "kernel void image_d(read_only image2d_t image2d_td0,\n" " write_only image2d_t image2d_td1,\n" @@ -4057,7 +4057,7 @@ const char * image_kernel_args[] = { "\n" }; -const char * image_arg_info[][67] = { +static const char * image_arg_info[][67] = { { "image_d", (const char *)CL_KERNEL_ARG_ADDRESS_GLOBAL, (const char *)CL_KERNEL_ARG_ACCESS_READ_ONLY, (const char *)(CL_KERNEL_ARG_TYPE_NONE), "image2d_t", "image2d_td0", @@ -4078,7 +4078,7 @@ const char * image_arg_info[][67] = { }; // Support for optional double data type -const char * double_kernel_args[] = { +static const char * double_kernel_args[] = { "kernel void double_scalar_p(constant double*constantdoublep,\n" " constant double *restrict constantdoublerestrictp,\n" " global double*globaldoublep,\n" @@ -4249,7 +4249,7 @@ const char * double_kernel_args[] = { "\n" }; -const char * double_arg_info[][77] = { +static const char * double_arg_info[][77] = { { "double_scalar_p", (const char *)CL_KERNEL_ARG_ADDRESS_CONSTANT, (const char *)CL_KERNEL_ARG_ACCESS_NONE, (const char *)(CL_KERNEL_ARG_TYPE_CONST), "double*", "constantdoublep", @@ -4458,7 +4458,7 @@ const char * double_arg_info[][77] = { // Support for optional half data type -const char * half_kernel_args[] = { +static const char * half_kernel_args[] = { "#pragma OPENCL EXTENSION cl_khr_fp16 : enable\n" "\n" "kernel void half_scalar_p(constant half*constanthalfp,\n" @@ -4631,7 +4631,7 @@ const char * half_kernel_args[] = { "\n" }; -const char * half_arg_info[][77] = { +static const char * half_arg_info[][77] = { { "half_scalar_p", (const char *)CL_KERNEL_ARG_ADDRESS_CONSTANT, (const char *)CL_KERNEL_ARG_ACCESS_NONE, (const char *)(CL_KERNEL_ARG_TYPE_CONST), "half*", "constanthalfp", @@ -4842,15 +4842,14 @@ const char * half_arg_info[][77] = { template int test(cl_device_id deviceID, cl_context context, kernel_args_t kernel_args, cl_uint lines_count, arg_info_t arg_info, size_t total_kernels_in_program) { - cl_program program; - cl_kernel kernel; const size_t max_name_len = 512; cl_char name[ max_name_len ]; cl_uint arg_count, numArgs; size_t i, j, size; int error; - program = clCreateProgramWithSource( context, lines_count, kernel_args, NULL, &error ); + clProgramWrapper program = + clCreateProgramWithSource(context, lines_count, kernel_args, NULL, &error); if ( program == NULL || error != CL_SUCCESS ) { print_error( error, "Unable to create required arguments kernel program" ); @@ -4961,7 +4960,7 @@ int test(cl_device_id deviceID, cl_context context, kernel_args_t kernel_args, c { int kernel_rc = 0; const char* kernel_name = arg_info[ i ][ 0 ]; - kernel = clCreateKernel( program, kernel_name, &error ); + clKernelWrapper kernel = clCreateKernel(program, kernel_name, &error); if( kernel == NULL || error != CL_SUCCESS ) { log_error( "ERROR: Could not get kernel: %s\n", kernel_name ); @@ -5079,10 +5078,8 @@ int test(cl_device_id deviceID, cl_context context, kernel_args_t kernel_args, c } -int test_get_kernel_arg_info( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ) +int test_get_kernel_arg_info_compatibility( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ) { - clProgramWrapper program; - clKernelWrapper kernel; size_t size; int error; @@ -5103,37 +5100,7 @@ int test_get_kernel_arg_info( cl_device_id deviceID, cl_context context, cl_c log_info(" o Not testing image kernel arguments.\n"); } - // Get the extensions string for the device - error = clGetDeviceInfo(deviceID, CL_DEVICE_EXTENSIONS, 0, NULL, &size); - test_error(error, "clGetDeviceInfo for CL_DEVICE_EXTENSIONS size failed"); - - char *extensions = (char*)malloc(sizeof(char)*(size + 1)); - if (extensions == 0) { - log_error("Failed to allocate memory for extensions string.\n"); - return -1; - } - memset( extensions, CHAR_MIN, sizeof(char)*(size+1) ); - - error = clGetDeviceInfo(deviceID, CL_DEVICE_EXTENSIONS, sizeof(char)*size, extensions, NULL); - test_error(error, "clGetDeviceInfo for CL_DEVICE_EXTENSIONS failed"); - - // Check to make sure the extension string is NUL terminated. - if( extensions[size] != CHAR_MIN ) - { - test_error( -1, "clGetDeviceInfo for CL_DEVICE_EXTENSIONS wrote past the end of the array!" ); - return -1; - } - extensions[size] = '\0'; // set last char to NUL to avoid problems with string functions later - - // test for termination with '\0' - size_t stringSize = strlen( extensions ); - if( stringSize == size ) - { - test_error( -1, "clGetDeviceInfo for CL_DEVICE_EXTENSIONS is not NUL terminated!" ); - return -1; - } - - if (strstr(extensions, "cl_khr_fp64")) { + if (is_extension_available(deviceID, "cl_khr_fp64")) { log_info(" o Device claims extension 'cl_khr_fp64'\n"); log_info(" o Expecting SUCCESS when testing double kernel arguments.\n"); supports_double = 1; @@ -5150,7 +5117,7 @@ int test_get_kernel_arg_info( cl_device_id deviceID, cl_context context, cl_c } } - if (strstr(extensions, "cl_khr_fp16")) { + if (is_extension_available(deviceID, "cl_khr_fp16")) { log_info(" o Device claims extension 'cl_khr_fp16'\n"); log_info(" o Expecting SUCCESS when testing halfn* kernel arguments.\n"); supports_half = 1; diff --git a/test_conformance/api/test_kernel_arg_multi_setup.cpp b/test_conformance/api/test_kernel_arg_multi_setup.cpp index 89c5eeb1..92c039e1 100644 --- a/test_conformance/api/test_kernel_arg_multi_setup.cpp +++ b/test_conformance/api/test_kernel_arg_multi_setup.cpp @@ -14,7 +14,7 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/conversions.h" +#include "harness/conversions.h" // This test is designed to stress passing multiple vector parameters to kernels and verifying access between them all @@ -27,8 +27,6 @@ const char *multi_arg_kernel_source_pattern = " dst3[tid] = src3[tid];\n" "}\n"; -extern cl_uint gRandomSeed; - #define MAX_ERROR_TOLERANCE 0.0005f int test_multi_arg_set(cl_device_id device, cl_context context, cl_command_queue queue, diff --git a/test_conformance/api/test_kernels.c b/test_conformance/api/test_kernels.cpp similarity index 75% rename from test_conformance/api/test_kernels.c rename to test_conformance/api/test_kernels.cpp index 6daaabee..993a72fb 100644 --- a/test_conformance/api/test_kernels.c +++ b/test_conformance/api/test_kernels.cpp @@ -14,10 +14,8 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/conversions.h" - -extern cl_uint gRandomSeed; +#include "harness/typeWrappers.h" +#include "harness/conversions.h" const char *sample_single_test_kernel[] = { "__kernel void sample_test(__global float *src, __global int *dst)\n" @@ -28,20 +26,6 @@ const char *sample_single_test_kernel[] = { "\n" "}\n" }; -const char *sample_struct_test_kernel[] = { -"typedef struct {\n" -"__global int *A;\n" -"__global int *B;\n" -"} input_pair_t;\n" -"\n" -"__kernel void sample_test(__global input_pair_t *src, __global int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = src->A[tid] + src->B[tid];\n" -"\n" -"}\n" }; - const char *sample_struct_array_test_kernel[] = { "typedef struct {\n" "int A;\n" @@ -111,7 +95,7 @@ int test_get_kernel_info(cl_device_id deviceID, cl_context context, cl_command_q return -1; } - error = clGetKernelInfo( kernel, CL_KERNEL_FUNCTION_NAME, NULL, 0, ¶mSize ); + error = clGetKernelInfo( kernel, CL_KERNEL_FUNCTION_NAME, 0, NULL, ¶mSize ); test_error( error, "Unable to get kernel function name param size" ); if( paramSize != strlen( "sample_test" ) + 1 ) { @@ -157,7 +141,7 @@ int test_get_kernel_info(cl_device_id deviceID, cl_context context, cl_command_q test_error( error, "Unable to get kernel reference count" ); - error = clGetKernelInfo( kernel, CL_KERNEL_PROGRAM, NULL, 0, ¶mSize ); + error = clGetKernelInfo( kernel, CL_KERNEL_PROGRAM, 0, NULL, ¶mSize ); test_error( error, "Unable to get kernel program param size" ); if( paramSize != sizeof( testProgram ) ) { @@ -194,11 +178,13 @@ int test_execute_kernel_local_sizes(cl_device_id deviceID, cl_context context, c clKernelWrapper kernel; clMemWrapper streams[2]; size_t threads[1], localThreads[1]; - cl_float inputData[100]; - cl_int outputData[100]; RandomSeed seed( gRandomSeed ); int i; + num_elements = 100; + std::vector inputData(num_elements); + std::vector outputData(num_elements); + /* Create a kernel to test with */ if( create_single_kernel_helper( context, &program, &kernel, 1, sample_single_test_kernel, "sample_test" ) != 0 ) { @@ -206,18 +192,20 @@ int test_execute_kernel_local_sizes(cl_device_id deviceID, cl_context context, c } /* Create some I/O streams */ - streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_float) * 100, NULL, &error); + streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), + sizeof(cl_float) * num_elements, NULL, &error); test_error( error, "Creating test array failed" ); - streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int) * 100, NULL, &error); + streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), + sizeof(cl_int) * num_elements, NULL, &error); test_error( error, "Creating test array failed" ); /* Write some test data */ - memset( outputData, 0, sizeof( outputData ) ); - - for (i=0; i<100; i++) + for (i = 0; i < num_elements; i++) inputData[i] = get_random_float(-(float) 0x7fffffff, (float) 0x7fffffff, seed); - error = clEnqueueWriteBuffer(queue, streams[0], CL_TRUE, 0, sizeof(cl_float)*100, (void *)inputData, 0, NULL, NULL); + error = clEnqueueWriteBuffer(queue, streams[0], CL_TRUE, 0, + sizeof(cl_float) * num_elements, + (void *)inputData.data(), 0, NULL, NULL); test_error( error, "Unable to set testing kernel data" ); /* Set the arguments */ @@ -227,17 +215,19 @@ int test_execute_kernel_local_sizes(cl_device_id deviceID, cl_context context, c test_error( error, "Unable to set kernel arguments" ); /* Test running the kernel and verifying it */ - threads[0] = (size_t)100; + threads[0] = (size_t)num_elements; error = get_max_common_work_group_size( context, kernel, threads[0], &localThreads[0] ); test_error( error, "Unable to get work group size to use" ); error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); test_error( error, "Kernel execution failed" ); - error = clEnqueueReadBuffer( queue, streams[1], CL_TRUE, 0, sizeof(cl_int)*100, (void *)outputData, 0, NULL, NULL ); + error = clEnqueueReadBuffer(queue, streams[1], CL_TRUE, 0, + sizeof(cl_int) * num_elements, + (void *)outputData.data(), 0, NULL, NULL); test_error( error, "Unable to get result data" ); - for (i=0; i<100; i++) + for (i = 0; i < num_elements; i++) { if (outputData[i] != (int)inputData[i]) { @@ -254,10 +244,12 @@ int test_execute_kernel_local_sizes(cl_device_id deviceID, cl_context context, c error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); test_error( error, "Kernel execution failed" ); - error = clEnqueueReadBuffer( queue, streams[1], CL_TRUE, 0, sizeof(cl_int)*100, (void *)outputData, 0, NULL, NULL ); + error = clEnqueueReadBuffer(queue, streams[1], CL_TRUE, 0, + sizeof(cl_int) * num_elements, + (void *)outputData.data(), 0, NULL, NULL); test_error( error, "Unable to get result data" ); - for (i=0; i<100; i++) + for (i = 0; i < num_elements; i++) { if (outputData[i] != (int)inputData[i]) { @@ -274,10 +266,12 @@ int test_execute_kernel_local_sizes(cl_device_id deviceID, cl_context context, c error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); test_error( error, "Kernel execution failed" ); - error = clEnqueueReadBuffer( queue, streams[1], CL_TRUE, 0, sizeof(cl_int)*100, (void *)outputData, 0, NULL, NULL ); + error = clEnqueueReadBuffer(queue, streams[1], CL_TRUE, 0, + sizeof(cl_int) * num_elements, + (void *)outputData.data(), 0, NULL, NULL); test_error( error, "Unable to get result data" ); - for (i=0; i<100; i++) + for (i = 0; i < num_elements; i++) { if (outputData[i] != (int)inputData[i]) { @@ -291,10 +285,12 @@ int test_execute_kernel_local_sizes(cl_device_id deviceID, cl_context context, c error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); test_error( error, "Kernel execution failed" ); - error = clEnqueueReadBuffer( queue, streams[1], CL_TRUE, 0, sizeof(cl_int)*100, (void *)outputData, 0, NULL, NULL ); + error = clEnqueueReadBuffer(queue, streams[1], CL_TRUE, 0, + sizeof(cl_int) * num_elements, + (void *)outputData.data(), 0, NULL, NULL); test_error( error, "Unable to get result data" ); - for (i=0; i<100; i++) + for (i = 0; i < num_elements; i++) { if (outputData[i] != (int)inputData[i]) { @@ -313,11 +309,13 @@ int test_set_kernel_arg_by_index(cl_device_id deviceID, cl_context context, cl_c clKernelWrapper kernel; clMemWrapper streams[2]; size_t threads[1], localThreads[1]; - cl_float inputData[10]; - cl_int outputData[10]; RandomSeed seed( gRandomSeed ); int i; + num_elements = 10; + std::vector inputData(num_elements); + std::vector outputData(num_elements); + /* Create a kernel to test with */ if( create_single_kernel_helper( context, &program, &kernel, 1, sample_single_test_kernel, "sample_test" ) != 0 ) { @@ -325,18 +323,20 @@ int test_set_kernel_arg_by_index(cl_device_id deviceID, cl_context context, cl_c } /* Create some I/O streams */ - streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_float) * 10, NULL, &error); + streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), + sizeof(cl_float) * num_elements, NULL, &error); test_error( error, "Creating test array failed" ); - streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int) * 10, NULL, &error); + streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), + sizeof(cl_int) * num_elements, NULL, &error); test_error( error, "Creating test array failed" ); /* Write some test data */ - memset( outputData, 0, sizeof( outputData ) ); - - for (i=0; i<10; i++) + for (i = 0; i < num_elements; i++) inputData[i] = get_random_float(-(float) 0x7fffffff, (float) 0x7fffffff, seed); - error = clEnqueueWriteBuffer(queue, streams[0], CL_TRUE, 0, sizeof(cl_float)*10, (void *)inputData, 0, NULL, NULL); + error = clEnqueueWriteBuffer(queue, streams[0], CL_TRUE, 0, + sizeof(cl_float) * num_elements, + (void *)inputData.data(), 0, NULL, NULL); test_error( error, "Unable to set testing kernel data" ); /* Test setting the arguments by index manually */ @@ -347,7 +347,7 @@ int test_set_kernel_arg_by_index(cl_device_id deviceID, cl_context context, cl_c /* Test running the kernel and verifying it */ - threads[0] = (size_t)10; + threads[0] = (size_t)num_elements; error = get_max_common_work_group_size( context, kernel, threads[0], &localThreads[0] ); test_error( error, "Unable to get work group size to use" ); @@ -355,10 +355,12 @@ int test_set_kernel_arg_by_index(cl_device_id deviceID, cl_context context, cl_c error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); test_error( error, "Kernel execution failed" ); - error = clEnqueueReadBuffer( queue, streams[1], CL_TRUE, 0, sizeof(cl_int)*10, (void *)outputData, 0, NULL, NULL ); + error = clEnqueueReadBuffer(queue, streams[1], CL_TRUE, 0, + sizeof(cl_int) * num_elements, + (void *)outputData.data(), 0, NULL, NULL); test_error( error, "Unable to get result data" ); - for (i=0; i<10; i++) + for (i = 0; i < num_elements; i++) { if (outputData[i] != (int)inputData[i]) { @@ -370,88 +372,6 @@ int test_set_kernel_arg_by_index(cl_device_id deviceID, cl_context context, cl_c return 0; } -int test_set_kernel_arg_struct(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - cl_program program; - cl_kernel kernel; - void *args[2]; - cl_mem outStream; - size_t threads[1], localThreads[1]; - cl_int outputData[10]; - int i; - cl_int randomTestDataA[10], randomTestDataB[10]; - MTdata d; - - struct img_pair_t - { - cl_mem streamA; - cl_mem streamB; - } image_pair; - - - /* Create a kernel to test with */ - if( create_single_kernel_helper( context, &program, &kernel, 1, sample_struct_test_kernel, "sample_test" ) != 0 ) - { - return -1; - } - - /* Create some I/O streams */ - d = init_genrand( gRandomSeed ); - for( i = 0; i < 10; i++ ) - { - randomTestDataA[i] = (cl_int)genrand_int32(d); - randomTestDataB[i] = (cl_int)genrand_int32(d); - } - free_mtdata(d); d = NULL; - - image_pair.streamA = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), sizeof(cl_int) * 10, randomTestDataA, &error); - test_error( error, "Creating test array failed" ); - image_pair.streamB = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), sizeof(cl_int) * 10, randomTestDataB, &error); - test_error( error, "Creating test array failed" ); - outStream = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int) * 10, NULL, &error); - test_error( error, "Creating test array failed" ); - - /* Set the arguments */ - args[0] = &image_pair; - args[1] = outStream; - - error = clSetKernelArg(kernel, 0, sizeof( image_pair ), &image_pair); - test_error( error, "Unable to set indexed kernel arguments" ); - error = clSetKernelArg(kernel, 1, sizeof( cl_mem ), &args[1]); - test_error( error, "Unable to set indexed kernel arguments" ); - - /* Test running the kernel and verifying it */ - threads[0] = (size_t)10; - - error = get_max_common_work_group_size( context, kernel, threads[0], &localThreads[0] ); - test_error( error, "Unable to get work group size to use" ); - - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); - test_error( error, "Kernel execution failed" ); - - error = clEnqueueReadBuffer( queue, outStream, CL_TRUE, 0, sizeof(cl_int)*10, (void *)outputData, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - - for (i=0; i<10; i++) - { - if (outputData[i] != randomTestDataA[i] + randomTestDataB[i]) - { - log_error( "ERROR: Data did not verify!\n" ); - return -1; - } - } - - - clReleaseMemObject( image_pair.streamA ); - clReleaseMemObject( image_pair.streamB ); - clReleaseMemObject( outStream ); - clReleaseKernel( kernel ); - clReleaseProgram( program ); - - return 0; -} - int test_set_kernel_arg_constant(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) { int error; @@ -459,16 +379,19 @@ int test_set_kernel_arg_constant(cl_device_id deviceID, cl_context context, cl_c clKernelWrapper kernel; clMemWrapper streams[3]; size_t threads[1], localThreads[1]; - cl_int outputData[10]; int i; - cl_int randomTestDataA[10], randomTestDataB[10]; cl_ulong maxSize; MTdata d; + num_elements = 10; + std::vector outputData(num_elements); + std::vector randomTestDataA(num_elements); + std::vector randomTestDataB(num_elements); + /* Verify our test buffer won't be bigger than allowed */ error = clGetDeviceInfo( deviceID, CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE, sizeof( maxSize ), &maxSize, 0 ); test_error( error, "Unable to get max constant buffer size" ); - if( maxSize < sizeof( cl_int ) * 10 ) + if (maxSize < sizeof(cl_int) * num_elements) { log_error( "ERROR: Unable to test constant argument to kernel: max size of constant buffer is reported as %d!\n", (int)maxSize ); return -1; @@ -482,18 +405,23 @@ int test_set_kernel_arg_constant(cl_device_id deviceID, cl_context context, cl_c /* Create some I/O streams */ d = init_genrand( gRandomSeed ); - for( i = 0; i < 10; i++ ) + for (i = 0; i < num_elements; i++) { randomTestDataA[i] = (cl_int)genrand_int32(d) & 0xffffff; /* Make sure values are positive, just so we don't have to */ randomTestDataB[i] = (cl_int)genrand_int32(d) & 0xffffff; /* deal with overflow on the verification */ } free_mtdata(d); d = NULL; - streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), sizeof(cl_int) * 10, randomTestDataA, &error); + streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), + sizeof(cl_int) * num_elements, + randomTestDataA.data(), &error); test_error( error, "Creating test array failed" ); - streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), sizeof(cl_int) * 10, randomTestDataB, &error); + streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), + sizeof(cl_int) * num_elements, + randomTestDataB.data(), &error); test_error( error, "Creating test array failed" ); - streams[2] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int) * 10, NULL, &error); + streams[2] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), + sizeof(cl_int) * num_elements, NULL, &error); test_error( error, "Creating test array failed" ); /* Set the arguments */ @@ -506,7 +434,7 @@ int test_set_kernel_arg_constant(cl_device_id deviceID, cl_context context, cl_c /* Test running the kernel and verifying it */ - threads[0] = (size_t)10; + threads[0] = (size_t)num_elements; error = get_max_common_work_group_size( context, kernel, threads[0], &localThreads[0] ); test_error( error, "Unable to get work group size to use" ); @@ -514,10 +442,12 @@ int test_set_kernel_arg_constant(cl_device_id deviceID, cl_context context, cl_c error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); test_error( error, "Kernel execution failed" ); - error = clEnqueueReadBuffer( queue, streams[2], CL_TRUE, 0, sizeof(cl_int)*10, (void *)outputData, 0, NULL, NULL ); + error = clEnqueueReadBuffer(queue, streams[2], CL_TRUE, 0, + sizeof(cl_int) * num_elements, + (void *)outputData.data(), 0, NULL, NULL); test_error( error, "Unable to get result data" ); - for (i=0; i<10; i++) + for (i = 0; i < num_elements; i++) { if (outputData[i] != randomTestDataA[i] + randomTestDataB[i]) { @@ -536,17 +466,19 @@ int test_set_kernel_arg_struct_array(cl_device_id deviceID, cl_context context, clKernelWrapper kernel; clMemWrapper streams[2]; size_t threads[1], localThreads[1]; - cl_int outputData[10]; int i; MTdata d; + num_elements = 10; + std::vector outputData(num_elements); + typedef struct img_pair_type { int A; int B; } image_pair_t; - image_pair_t image_pair[ 10 ]; + std::vector image_pair(num_elements); /* Create a kernel to test with */ @@ -557,16 +489,19 @@ int test_set_kernel_arg_struct_array(cl_device_id deviceID, cl_context context, /* Create some I/O streams */ d = init_genrand( gRandomSeed ); - for( i = 0; i < 10; i++ ) + for (i = 0; i < num_elements; i++) { image_pair[i].A = (cl_int)genrand_int32(d); - image_pair[i].A = (cl_int)genrand_int32(d); + image_pair[i].B = (cl_int)genrand_int32(d); } free_mtdata(d); d = NULL; - streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), sizeof(image_pair_t) * 10, (void *)image_pair, &error); + streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), + sizeof(image_pair_t) * num_elements, + (void *)image_pair.data(), &error); test_error( error, "Creating test array failed" ); - streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int) * 10, NULL, &error); + streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), + sizeof(cl_int) * num_elements, NULL, &error); test_error( error, "Creating test array failed" ); /* Set the arguments */ @@ -576,7 +511,7 @@ int test_set_kernel_arg_struct_array(cl_device_id deviceID, cl_context context, test_error( error, "Unable to set indexed kernel arguments" ); /* Test running the kernel and verifying it */ - threads[0] = (size_t)10; + threads[0] = (size_t)num_elements; error = get_max_common_work_group_size( context, kernel, threads[0], &localThreads[0] ); test_error( error, "Unable to get work group size to use" ); @@ -584,10 +519,12 @@ int test_set_kernel_arg_struct_array(cl_device_id deviceID, cl_context context, error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); test_error( error, "Kernel execution failed" ); - error = clEnqueueReadBuffer( queue, streams[1], CL_TRUE, 0, sizeof(cl_int)*10, (void *)outputData, 0, NULL, NULL ); + error = clEnqueueReadBuffer(queue, streams[1], CL_TRUE, 0, + sizeof(cl_int) * num_elements, + (void *)outputData.data(), 0, NULL, NULL); test_error( error, "Unable to get result data" ); - for (i=0; i<10; i++) + for (i = 0; i < num_elements; i++) { if (outputData[i] != image_pair[i].A + image_pair[i].B) { @@ -635,11 +572,12 @@ int test_kernel_global_constant(cl_device_id deviceID, cl_context context, cl_co clKernelWrapper kernel; clMemWrapper streams[2]; size_t threads[1], localThreads[1]; - cl_int outputData[10]; int i; - cl_int randomTestDataA[10]; MTdata d; + num_elements = 10; + std::vector outputData(num_elements); + std::vector randomTestDataA(num_elements); /* Create a kernel to test with */ if( create_single_kernel_helper( context, &program, &kernel, 1, sample_const_global_test_kernel, "sample_test" ) != 0 ) @@ -649,15 +587,18 @@ int test_kernel_global_constant(cl_device_id deviceID, cl_context context, cl_co /* Create some I/O streams */ d = init_genrand( gRandomSeed ); - for( i = 0; i < 10; i++ ) + for (i = 0; i < num_elements; i++) { randomTestDataA[i] = (cl_int)genrand_int32(d) & 0xffff; /* Make sure values are positive and small, just so we don't have to */ } free_mtdata(d); d = NULL; - streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), sizeof(cl_int) * 10, randomTestDataA, &error); + streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), + sizeof(cl_int) * num_elements, + randomTestDataA.data(), &error); test_error( error, "Creating test array failed" ); - streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int) * 10, NULL, &error); + streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), + sizeof(cl_int) * num_elements, NULL, &error); test_error( error, "Creating test array failed" ); /* Set the arguments */ @@ -668,7 +609,7 @@ int test_kernel_global_constant(cl_device_id deviceID, cl_context context, cl_co /* Test running the kernel and verifying it */ - threads[0] = (size_t)10; + threads[0] = (size_t)num_elements; error = get_max_common_work_group_size( context, kernel, threads[0], &localThreads[0] ); test_error( error, "Unable to get work group size to use" ); @@ -676,10 +617,12 @@ int test_kernel_global_constant(cl_device_id deviceID, cl_context context, cl_co error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); test_error( error, "Kernel execution failed" ); - error = clEnqueueReadBuffer( queue, streams[1], CL_TRUE, 0, sizeof(cl_int)*10, (void *)outputData, 0, NULL, NULL ); + error = clEnqueueReadBuffer(queue, streams[1], CL_TRUE, 0, + sizeof(cl_int) * num_elements, + (void *)outputData.data(), 0, NULL, NULL); test_error( error, "Unable to get result data" ); - for (i=0; i<10; i++) + for (i = 0; i < num_elements; i++) { if (outputData[i] != randomTestDataA[i] + 1024) { diff --git a/test_conformance/api/test_mem_object_info.cpp b/test_conformance/api/test_mem_object_info.cpp index 85069a54..ccfeaafa 100644 --- a/test_conformance/api/test_mem_object_info.cpp +++ b/test_conformance/api/test_mem_object_info.cpp @@ -14,10 +14,8 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/testHarness.h" - -extern cl_uint gRandomSeed; +#include "harness/typeWrappers.h" +#include "harness/testHarness.h" #define TEST_MEM_OBJECT_PARAM( mem, paramName, val, expected, name, type, cast ) \ @@ -497,7 +495,11 @@ int test_get_image_info( cl_device_id deviceID, cl_context context, cl_mem_objec imageInfo.image_width = imageInfo.image_height = imageInfo.image_depth = 1; imageInfo.image_array_size = 0; imageInfo.num_mip_levels = imageInfo.num_samples = 0; +#ifdef CL_VERSION_2_0 imageInfo.mem_object = NULL; +#else + imageInfo.buffer = NULL; +#endif d = init_genrand( gRandomSeed ); diff --git a/test_conformance/api/test_mem_object_properties_queries.cpp b/test_conformance/api/test_mem_object_properties_queries.cpp new file mode 100644 index 00000000..a6ed7ad1 --- /dev/null +++ b/test_conformance/api/test_mem_object_properties_queries.cpp @@ -0,0 +1,275 @@ +// +// Copyright (c) 2020 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "testBase.h" +#include "harness/propertyHelpers.h" +#include "harness/typeWrappers.h" +#include +#include + +typedef enum +{ + image, + buffer +} mem_obj_type; + +struct test_data +{ + mem_obj_type obj_t; + std::vector properties; + std::string description; + std::string src; + std::string kernel_name; +}; + +static int create_object_and_check_properties(cl_context context, + clMemWrapper& test_object, + test_data test_case, + cl_mem_flags flags, + std::vector local_data, + cl_uint size_x, cl_uint size_y) +{ + cl_int error = CL_SUCCESS; + + if (test_case.obj_t == image) + { + cl_image_format format; + format.image_channel_order = CL_RGBA; + format.image_channel_data_type = CL_UNSIGNED_INT32; + cl_image_desc desc; + memset(&desc, 0x0, sizeof(cl_image_desc)); + desc.image_type = CL_MEM_OBJECT_IMAGE2D; + desc.image_width = size_x; + desc.image_height = size_y; + + if (test_case.properties.size() == 0) + { + test_object = + clCreateImageWithProperties(context, NULL, flags, &format, + &desc, local_data.data(), &error); + } + else + { + test_object = clCreateImageWithProperties( + context, test_case.properties.data(), flags, &format, &desc, + local_data.data(), &error); + } + test_error(error, "clCreateImageWithProperties failed"); + } + if (test_case.obj_t == buffer) + { + if (test_case.properties.size() == 0) + { + test_object = clCreateBufferWithProperties( + context, NULL, flags, local_data.size() * sizeof(cl_uint), + local_data.data(), &error); + } + else + { + test_object = clCreateBufferWithProperties( + context, test_case.properties.data(), flags, + local_data.size() * sizeof(cl_uint), local_data.data(), &error); + } + + test_error(error, "clCreateBufferWithProperties failed."); + } + + std::vector check_properties; + size_t set_size = 0; + + error = + clGetMemObjectInfo(test_object, CL_MEM_PROPERTIES, 0, NULL, &set_size); + test_error(error, + "clGetMemObjectInfo failed asking for CL_MEM_PROPERTIES size."); + + if (set_size == 0 && test_case.properties.size() == 0) + { + return TEST_PASS; + } + if (set_size != test_case.properties.size() * sizeof(cl_mem_properties)) + { + log_error("ERROR: CL_MEM_PROPERTIES size is %d, expected %d.\n", + set_size, + test_case.properties.size() * sizeof(cl_queue_properties)); + return TEST_FAIL; + } + + cl_uint number_of_props = set_size / sizeof(cl_mem_properties); + check_properties.resize(number_of_props); + error = clGetMemObjectInfo(test_object, CL_MEM_PROPERTIES, set_size, + check_properties.data(), NULL); + test_error(error, + "clGetMemObjectInfo failed asking for CL_MEM_PROPERTIES."); + + error = compareProperties(check_properties, test_case.properties); + return error; +} + +static int run_test_query_properties(cl_context context, cl_command_queue queue, + test_data test_case) +{ + int error = CL_SUCCESS; + log_info("\nTC description: %s\n", test_case.description.c_str()); + + clProgramWrapper program; + clKernelWrapper kernel; + clMemWrapper obj_src; + clMemWrapper obj_dst; + clEventWrapper event; + MTdata init_generator = init_genrand(gRandomSeed); + cl_mem_flags flags; + cl_uint size_x = 4; + cl_uint size_y = 4; + size_t size = size_x * size_y * 4; + size_t global_dim[2] = { size_x, size_y }; + const size_t origin[3] = { 0, 0, 0 }; + const size_t region[3] = { size_x, size_y, 1 }; + + std::vector src_data(size); + std::vector dst_data(size); + + generate_random_data(kUInt, size, init_generator, src_data.data()); + generate_random_data(kUInt, size, init_generator, dst_data.data()); + free_mtdata(init_generator); + init_generator = NULL; + const char* kernel_src = test_case.src.c_str(); + error = + create_single_kernel_helper(context, &program, &kernel, 1, &kernel_src, + test_case.kernel_name.c_str()); + + test_error(error, "create_single_kernel_helper failed"); + + flags = (cl_mem_flags)(CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR); + error = create_object_and_check_properties(context, obj_src, test_case, + flags, src_data, size_x, size_y); + test_error(error, "create_object_and_check_properties obj_src failed."); + + flags = (cl_mem_flags)(CL_MEM_WRITE_ONLY | CL_MEM_COPY_HOST_PTR); + error = create_object_and_check_properties(context, obj_dst, test_case, + flags, dst_data, size_x, size_y); + test_error(error, "create_object_and_check_properties obj_dst failed."); + + error = clSetKernelArg(kernel, 0, sizeof(obj_src), &obj_src); + test_error(error, "clSetKernelArg 0 failed."); + + error = clSetKernelArg(kernel, 1, sizeof(obj_dst), &obj_dst); + test_error(error, "clSetKernelArg 1 failed."); + if (test_case.obj_t == image) + { + error = clEnqueueNDRangeKernel(queue, kernel, 2, NULL, global_dim, NULL, + 0, NULL, &event); + test_error(error, "clEnqueueNDRangeKernel failed."); + + error = clWaitForEvents(1, &event); + test_error(error, "clWaitForEvents failed."); + + error = clEnqueueReadImage(queue, obj_dst, CL_TRUE, origin, region, 0, + 0, dst_data.data(), 0, NULL, NULL); + test_error(error, "clEnqueueReadImage failed."); + } + if (test_case.obj_t == buffer) + { + error = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &size, NULL, 0, + NULL, &event); + test_error(error, "clEnqueueNDRangeKernel failed."); + + error = clWaitForEvents(1, &event); + test_error(error, "clWaitForEvents failed."); + + error = clEnqueueReadBuffer(queue, obj_dst, CL_TRUE, 0, + dst_data.size() * sizeof(cl_uint), + dst_data.data(), 0, NULL, NULL); + test_error(error, "clEnqueueReadBuffer failed."); + } + + for (size_t i = 0; i < size; ++i) + { + if (dst_data[i] != src_data[i]) + { + log_error("ERROR: Output results mismatch."); + return TEST_FAIL; + } + } + + log_info("TC result: passed\n"); + return TEST_PASS; +} + +int test_image_properties_queries(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements) +{ + int error = CL_SUCCESS; + cl_bool supports_images = CL_TRUE; + + error = clGetDeviceInfo(deviceID, CL_DEVICE_IMAGE_SUPPORT, + sizeof(supports_images), &supports_images, NULL); + test_error(error, "clGetDeviceInfo for CL_DEVICE_IMAGE_SUPPORT failed"); + + if (supports_images == CL_FALSE) + { + log_info("No image support on current device - skipped\n"); + return TEST_SKIPPED_ITSELF; + } + + std::vector test_cases; + std::string test_kernel = { "__kernel void data_copy(read_only image2d_t " + "src, write_only image2d_t dst)\n" + "{\n" + " int tid_x = get_global_id(0);\n" + " int tid_y = get_global_id(1);\n" + " int2 coords = (int2)(tid_x, tid_y);\n" + " uint4 val = read_imageui(src, coords);\n" + " write_imageui(dst, coords, val);\n" + "\n" + "}\n" }; + test_cases.push_back( + { image, { 0 }, "image, 0 properties", test_kernel, "data_copy" }); + test_cases.push_back( + { image, {}, "image, NULL properties", test_kernel, "data_copy" }); + + for (auto test_case : test_cases) + { + error |= run_test_query_properties(context, queue, test_case); + } + + return error; +} + +int test_buffer_properties_queries(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements) +{ + int error = CL_SUCCESS; + std::vector test_cases; + std::string test_kernel = { + "__kernel void data_copy(__global int *src, __global int *dst)\n" + "{\n" + " int tid = get_global_id(0);\n" + "\n" + " dst[tid] = src[tid];\n" + "\n" + "}\n" + }; + test_cases.push_back( + { buffer, { 0 }, "buffer, 0 properties", test_kernel, "data_copy" }); + test_cases.push_back( + { buffer, {}, "buffer, NULL properties", test_kernel, "data_copy" }); + + for (auto test_case : test_cases) + { + error |= run_test_query_properties(context, queue, test_case); + } + + return error; +} diff --git a/test_conformance/api/test_mem_objects.cpp b/test_conformance/api/test_mem_objects.cpp index b0dc99d4..c29613f9 100644 --- a/test_conformance/api/test_mem_objects.cpp +++ b/test_conformance/api/test_mem_objects.cpp @@ -1,6 +1,6 @@ // -// Copyright (c) 2017 The Khronos Group Inc. -// +// Copyright (c) 2020 The Khronos Group Inc. +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -17,92 +17,109 @@ static volatile cl_int sDestructorIndex; -void CL_CALLBACK mem_destructor_callback( cl_mem memObject, void * userData ) +void CL_CALLBACK mem_destructor_callback(cl_mem memObject, void *userData) { - int * userPtr = (int *)userData; + int *userPtr = (int *)userData; - // ordering of callbacks is guaranteed, meaning we don't need to do atomic operation here + // ordering of callbacks is guaranteed, meaning we don't need to do atomic + // operation here *userPtr = ++sDestructorIndex; } -#ifndef ABS -#define ABS( x ) ( ( x < 0 ) ? -x : x ) -#endif - -int test_mem_object_destructor_callback_single( clMemWrapper &memObject ) +int test_mem_object_destructor_callback_single(clMemWrapper &memObject) { cl_int error; - int i; // Set up some variables to catch the order in which callbacks are called - volatile int callbackOrders[ 3 ] = { 0, 0, 0 }; + volatile int callbackOrders[3] = { 0, 0, 0 }; sDestructorIndex = 0; // Set up the callbacks - error = clSetMemObjectDestructorCallback( memObject, mem_destructor_callback, (void*) &callbackOrders[ 0 ] ); - test_error( error, "Unable to set destructor callback" ); + error = clSetMemObjectDestructorCallback(memObject, mem_destructor_callback, + (void *)&callbackOrders[0]); + test_error(error, "Unable to set destructor callback"); - error = clSetMemObjectDestructorCallback( memObject, mem_destructor_callback, (void*) &callbackOrders[ 1 ] ); - test_error( error, "Unable to set destructor callback" ); + error = clSetMemObjectDestructorCallback(memObject, mem_destructor_callback, + (void *)&callbackOrders[1]); + test_error(error, "Unable to set destructor callback"); - error = clSetMemObjectDestructorCallback( memObject, mem_destructor_callback, (void*) &callbackOrders[ 2 ] ); - test_error( error, "Unable to set destructor callback" ); + error = clSetMemObjectDestructorCallback(memObject, mem_destructor_callback, + (void *)&callbackOrders[2]); + test_error(error, "Unable to set destructor callback"); // Now release the buffer, which SHOULD call the callbacks - error = clReleaseMemObject( memObject ); - test_error( error, "Unable to release test buffer" ); + error = clReleaseMemObject(memObject); + test_error(error, "Unable to release test buffer"); - // Note: since we manually released the mem wrapper, we need to set it to NULL to prevent a double-release + // Note: since we manually released the mem wrapper, we need to set it to + // NULL to prevent a double-release memObject = NULL; // At this point, all three callbacks should have already been called int numErrors = 0; - for( i = 0; i < 3; i++ ) + for (int i = 0; i < 3; i++) { - // Spin waiting for the release to finish. If you don't call the mem_destructor_callback, you will not - // pass the test. bugzilla 6316 - while( 0 == callbackOrders[i] ) - {} - - if( ABS( callbackOrders[ i ] ) != 3-i ) + // Spin waiting for the release to finish. If you don't call the + // mem_destructor_callback, you will not pass the test. bugzilla 6316 + log_info("\tWaiting for callback %d...\n", i); + int wait = 0; + while (0 == callbackOrders[i]) { - log_error( "\tERROR: Callback %d was called in the wrong order! (Was called order %d, should have been order %d)\n", - i+1, ABS( callbackOrders[ i ] ), i ); + usleep(100000); // 1/10th second + if (++wait >= 10 * 10) + { + log_error("\tERROR: Callback %d was not called within 10 " + "seconds! Assuming failure.\n", + i + 1); + numErrors++; + break; + } + } + + if (callbackOrders[i] != 3 - i) + { + log_error("\tERROR: Callback %d was called in the wrong order! " + "(Was called order %d, should have been order %d)\n", + i + 1, callbackOrders[i], 3 - i); numErrors++; } } - return ( numErrors > 0 ) ? -1 : 0; + return (numErrors > 0) ? TEST_FAIL : TEST_PASS; } -int test_mem_object_destructor_callback(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) +int test_mem_object_destructor_callback(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements) { clMemWrapper testBuffer, testImage; cl_int error; // Create a buffer and an image to test callbacks against - testBuffer = clCreateBuffer( context, CL_MEM_READ_WRITE, 1024, NULL, &error ); - test_error( error, "Unable to create testing buffer" ); + testBuffer = clCreateBuffer(context, CL_MEM_READ_WRITE, 1024, NULL, &error); + test_error(error, "Unable to create testing buffer"); - if( test_mem_object_destructor_callback_single( testBuffer ) != 0 ) + if (test_mem_object_destructor_callback_single(testBuffer) != TEST_PASS) { - log_error( "ERROR: Destructor callbacks for buffer object FAILED\n" ); - return -1; + log_error("ERROR: Destructor callbacks for buffer object FAILED\n"); + return TEST_FAIL; } - if( checkForImageSupport( deviceID ) == 0 ) + if (checkForImageSupport(deviceID) == 0) { cl_image_format imageFormat = { CL_RGBA, CL_SIGNED_INT8 }; - testImage = create_image_2d( context, CL_MEM_READ_ONLY, &imageFormat, 16, 16, 0, NULL, &error ); - test_error( error, "Unable to create testing image" ); + testImage = create_image_2d(context, CL_MEM_READ_ONLY, &imageFormat, 16, + 16, 0, NULL, &error); + test_error(error, "Unable to create testing image"); - if( test_mem_object_destructor_callback_single( testImage ) != 0 ) + if (test_mem_object_destructor_callback_single(testImage) != TEST_PASS) { - log_error( "ERROR: Destructor callbacks for image object FAILED\n" ); - return -1; + log_error("ERROR: Destructor callbacks for image object FAILED\n"); + return TEST_FAIL; } } - return 0; + return TEST_PASS; } diff --git a/test_conformance/api/test_native_kernel.cpp b/test_conformance/api/test_native_kernel.cpp index 2d52134b..50505e22 100644 --- a/test_conformance/api/test_native_kernel.cpp +++ b/test_conformance/api/test_native_kernel.cpp @@ -19,9 +19,7 @@ #include #endif -#include "../../test_common/harness/conversions.h" - -extern cl_uint gRandomSeed; +#include "harness/conversions.h" static void CL_CALLBACK test_native_kernel_fn( void *userData ) { diff --git a/test_conformance/api/test_null_buffer_arg.c b/test_conformance/api/test_null_buffer_arg.cpp similarity index 98% rename from test_conformance/api/test_null_buffer_arg.c rename to test_conformance/api/test_null_buffer_arg.cpp index b845fc0b..ba43f183 100644 --- a/test_conformance/api/test_null_buffer_arg.c +++ b/test_conformance/api/test_null_buffer_arg.cpp @@ -22,8 +22,8 @@ #include #endif #include "testBase.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/typeWrappers.h" +#include "harness/testHarness.h" #include "procs.h" @@ -62,7 +62,7 @@ static int test_setargs_and_execution(cl_command_queue queue, cl_kernel kernel, unsigned int i; cl_int status; - char *typestr; + const char *typestr; if (type == NON_NULL_PATH) { status = clSetKernelArg(kernel, 0, sizeof(cl_mem), &test_buf); diff --git a/test_conformance/api/test_queries.cpp b/test_conformance/api/test_queries.cpp index 0d412a0d..ed01e894 100644 --- a/test_conformance/api/test_queries.cpp +++ b/test_conformance/api/test_queries.cpp @@ -14,9 +14,11 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/imageHelpers.h" +#include "harness/imageHelpers.h" +#include "harness/propertyHelpers.h" #include #include +#include int test_get_platform_info(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) { @@ -209,6 +211,40 @@ int test_get_sampler_info(cl_device_id deviceID, cl_context context, cl_command_ return -1; } + Version version = get_device_cl_version(deviceID); + if (version >= Version(3, 0)) + { + std::vector test_properties( + properties, properties + ARRAY_SIZE(properties)); + + std::vector check_properties; + size_t set_size; + + error = clGetSamplerInfo(sampler, CL_SAMPLER_PROPERTIES, 0, NULL, + &set_size); + test_error( + error, + "clGetSamplerInfo failed asking for CL_SAMPLER_PROPERTIES size."); + + if (set_size != test_properties.size() * sizeof(cl_sampler_properties)) + { + log_error("ERROR: CL_SAMPLER_PROPERTIES size is %d, expected %d.\n", + set_size, + test_properties.size() * sizeof(cl_sampler_properties)); + return TEST_FAIL; + } + + cl_uint number_of_props = set_size / sizeof(cl_sampler_properties); + check_properties.resize(number_of_props); + error = clGetSamplerInfo(sampler, CL_SAMPLER_PROPERTIES, set_size, + check_properties.data(), 0); + test_error(error, + "clGetSamplerInfo failed asking for CL_SAMPLER_PROPERTIES."); + + error = compareProperties(check_properties, test_properties); + test_error(error, "checkProperties mismatch."); + } + return 0; } @@ -237,6 +273,9 @@ int test_get_command_queue_info(cl_device_id deviceID, cl_context context, cl_co clGetDeviceInfo(deviceID, CL_DEVICE_QUEUE_ON_HOST_PROPERTIES, sizeof(device_props), &device_props, NULL); log_info("CL_DEVICE_QUEUE_ON_HOST_PROPERTIES is %d\n", (int)device_props); + // Mask off vendor extension properties. Only test standard OpenCL properties + device_props &= CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE|CL_QUEUE_PROFILING_ENABLE; + queue_props[1] = device_props; clCommandQueueWrapper queue = clCreateCommandQueueWithProperties( context, deviceID, &queue_props[0], &error ); test_error( error, "Unable to create command queue to test with" ); @@ -397,7 +436,8 @@ int test_get_device_info(cl_device_id deviceID, cl_context context, cl_command_q // extensions can support double but may not support cl_khr_fp64, which implies math library support. cl_uint baseAddrAlign; - TEST_DEVICE_PARAM( deviceID, CL_DEVICE_MEM_BASE_ADDR_ALIGN, baseAddrAlign, "base address alignment", "%d bytes", int ) + TEST_DEVICE_PARAM(deviceID, CL_DEVICE_MEM_BASE_ADDR_ALIGN, baseAddrAlign, + "base address alignment", "%d bits", int) cl_uint maxDataAlign; TEST_DEVICE_PARAM( deviceID, CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE, maxDataAlign, "min data type alignment", "%d bytes", int ) diff --git a/test_conformance/api/test_queries_compatibility.cpp b/test_conformance/api/test_queries_compatibility.cpp new file mode 100644 index 00000000..c53fba89 --- /dev/null +++ b/test_conformance/api/test_queries_compatibility.cpp @@ -0,0 +1,169 @@ +// +// Copyright (c) 2017 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "testBase.h" +#include "harness/imageHelpers.h" +#include +#include + +int test_get_sampler_info_compatibility(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) +{ + int error; + size_t size; + + PASSIVE_REQUIRE_IMAGE_SUPPORT( deviceID ) + + clSamplerWrapper sampler = clCreateSampler( context, CL_TRUE, CL_ADDRESS_CLAMP, CL_FILTER_LINEAR, &error ); + test_error( error, "Unable to create sampler to test with" ); + + cl_uint refCount; + error = clGetSamplerInfo( sampler, CL_SAMPLER_REFERENCE_COUNT, sizeof( refCount ), &refCount, &size ); + test_error( error, "Unable to get sampler ref count" ); + if( size != sizeof( refCount ) ) + { + log_error( "ERROR: Returned size of sampler refcount does not validate! (expected %d, got %d)\n", (int)sizeof( refCount ), (int)size ); + return -1; + } + + cl_context otherCtx; + error = clGetSamplerInfo( sampler, CL_SAMPLER_CONTEXT, sizeof( otherCtx ), &otherCtx, &size ); + test_error( error, "Unable to get sampler context" ); + if( otherCtx != context ) + { + log_error( "ERROR: Sampler context does not validate! (expected %p, got %p)\n", context, otherCtx ); + return -1; + } + if( size != sizeof( otherCtx ) ) + { + log_error( "ERROR: Returned size of sampler context does not validate! (expected %d, got %d)\n", (int)sizeof( otherCtx ), (int)size ); + return -1; + } + + cl_addressing_mode mode; + error = clGetSamplerInfo( sampler, CL_SAMPLER_ADDRESSING_MODE, sizeof( mode ), &mode, &size ); + test_error( error, "Unable to get sampler addressing mode" ); + if( mode != CL_ADDRESS_CLAMP ) + { + log_error( "ERROR: Sampler addressing mode does not validate! (expected %d, got %d)\n", (int)CL_ADDRESS_CLAMP, (int)mode ); + return -1; + } + if( size != sizeof( mode ) ) + { + log_error( "ERROR: Returned size of sampler addressing mode does not validate! (expected %d, got %d)\n", (int)sizeof( mode ), (int)size ); + return -1; + } + + cl_filter_mode fmode; + error = clGetSamplerInfo( sampler, CL_SAMPLER_FILTER_MODE, sizeof( fmode ), &fmode, &size ); + test_error( error, "Unable to get sampler filter mode" ); + if( fmode != CL_FILTER_LINEAR ) + { + log_error( "ERROR: Sampler filter mode does not validate! (expected %d, got %d)\n", (int)CL_FILTER_LINEAR, (int)fmode ); + return -1; + } + if( size != sizeof( fmode ) ) + { + log_error( "ERROR: Returned size of sampler filter mode does not validate! (expected %d, got %d)\n", (int)sizeof( fmode ), (int)size ); + return -1; + } + + cl_int norm; + error = clGetSamplerInfo( sampler, CL_SAMPLER_NORMALIZED_COORDS, sizeof( norm ), &norm, &size ); + test_error( error, "Unable to get sampler normalized flag" ); + if( norm != CL_TRUE ) + { + log_error( "ERROR: Sampler normalized flag does not validate! (expected %d, got %d)\n", (int)CL_TRUE, (int)norm ); + return -1; + } + if( size != sizeof( norm ) ) + { + log_error( "ERROR: Returned size of sampler normalized flag does not validate! (expected %d, got %d)\n", (int)sizeof( norm ), (int)size ); + return -1; + } + + return 0; +} + +#define TEST_COMMAND_QUEUE_PARAM( queue, paramName, val, expected, name, type, cast ) \ +error = clGetCommandQueueInfo( queue, paramName, sizeof( val ), &val, &size ); \ +test_error( error, "Unable to get command queue " name ); \ +if( val != expected ) \ +{ \ +log_error( "ERROR: Command queue " name " did not validate! (expected " type ", got " type ")\n", (cast)expected, (cast)val ); \ +return -1; \ +} \ +if( size != sizeof( val ) ) \ +{ \ +log_error( "ERROR: Returned size of command queue " name " does not validate! (expected %d, got %d)\n", (int)sizeof( val ), (int)size ); \ +return -1; \ +} + +int test_get_command_queue_info_compatibility(cl_device_id deviceID, cl_context context, cl_command_queue ignoreQueue, int num_elements) +{ + int error; + size_t size; + + cl_command_queue_properties device_props; + clGetDeviceInfo(deviceID, CL_DEVICE_QUEUE_PROPERTIES, sizeof(device_props), &device_props, NULL); + log_info("CL_DEVICE_QUEUE_PROPERTIES is %d\n", (int)device_props); + + // Mask off vendor extension properties. Only test standard OpenCL + // properties + device_props &= + CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_PROFILING_ENABLE; + + clCommandQueueWrapper queue = clCreateCommandQueue( context, deviceID, device_props, &error ); + test_error( error, "Unable to create command queue to test with" ); + + cl_uint refCount; + error = clGetCommandQueueInfo( queue, CL_QUEUE_REFERENCE_COUNT, sizeof( refCount ), &refCount, &size ); + test_error( error, "Unable to get command queue reference count" ); + if( size != sizeof( refCount ) ) + { + log_error( "ERROR: Returned size of command queue reference count does not validate! (expected %d, got %d)\n", (int)sizeof( refCount ), (int)size ); + return -1; + } + + cl_context otherCtx; + TEST_COMMAND_QUEUE_PARAM( queue, CL_QUEUE_CONTEXT, otherCtx, context, "context", "%p", cl_context ) + + cl_device_id otherDevice; + error = clGetCommandQueueInfo( queue, CL_QUEUE_DEVICE, sizeof(otherDevice), &otherDevice, &size); + test_error(error, "clGetCommandQueue failed."); + + if (size != sizeof(cl_device_id)) { + log_error( " ERROR: Returned size of command queue CL_QUEUE_DEVICE does not validate! (expected %d, got %d)\n", (int)sizeof( otherDevice ), (int)size ); + return -1; + } + + /* Since the device IDs are opaque types we check the CL_DEVICE_VENDOR_ID which is unique for identical hardware. */ + cl_uint otherDevice_vid, deviceID_vid; + error = clGetDeviceInfo(otherDevice, CL_DEVICE_VENDOR_ID, sizeof(otherDevice_vid), &otherDevice_vid, NULL ); + test_error( error, "Unable to get device CL_DEVICE_VENDOR_ID" ); + error = clGetDeviceInfo(deviceID, CL_DEVICE_VENDOR_ID, sizeof(deviceID_vid), &deviceID_vid, NULL ); + test_error( error, "Unable to get device CL_DEVICE_VENDOR_ID" ); + + if( otherDevice_vid != deviceID_vid ) + { + log_error( "ERROR: Incorrect device returned for queue! (Expected vendor ID 0x%x, got 0x%x)\n", deviceID_vid, otherDevice_vid ); + return -1; + } + + cl_command_queue_properties props; + TEST_COMMAND_QUEUE_PARAM( queue, CL_QUEUE_PROPERTIES, props, (unsigned int)( device_props ), "properties", "%d", unsigned int ) + + return 0; +} + diff --git a/test_conformance/api/test_queue.cpp b/test_conformance/api/test_queue.cpp new file mode 100644 index 00000000..27ed5f05 --- /dev/null +++ b/test_conformance/api/test_queue.cpp @@ -0,0 +1,61 @@ +// +// Copyright (c) 2020 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + + +#include "testBase.h" +#include "harness/typeWrappers.h" + +int test_queue_flush_on_release(cl_device_id deviceID, cl_context context, + cl_command_queue defaultQueue, int num_elements) +{ + cl_int err; + + // Create a command queue + cl_command_queue queue = clCreateCommandQueue(context, deviceID, 0, &err); + test_error(err, "Could not create command queue"); + + // Create a kernel + clProgramWrapper program; + clKernelWrapper kernel; + const char *source = "void kernel test(){}"; + err = create_single_kernel_helper(context, &program, &kernel, 1, &source, + "test"); + test_error(err, "Could not create kernel"); + + // Enqueue the kernel + size_t gws = 1; + clEventWrapper event; + err = clEnqueueNDRangeKernel(queue, kernel, 1, nullptr, &gws, nullptr, 0, + nullptr, &event); + test_error(err, "Could not enqueue kernel"); + + // Release the queue + err = clReleaseCommandQueue(queue); + + // Wait for kernel to execute since the queue must flush on release + bool success = poll_until(2000, 50, [&event]() { + cl_int status; + cl_int err = clGetEventInfo(event, CL_EVENT_COMMAND_EXECUTION_STATUS, + sizeof(cl_int), &status, nullptr); + if ((err != CL_SUCCESS) || (status != CL_COMPLETE)) + { + return false; + } + return true; + }); + + return success ? TEST_PASS : TEST_FAIL; +} diff --git a/test_conformance/api/test_queue_hint.cpp b/test_conformance/api/test_queue_hint.cpp index 2634a23a..558ca1aa 100644 --- a/test_conformance/api/test_queue_hint.cpp +++ b/test_conformance/api/test_queue_hint.cpp @@ -14,8 +14,8 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/conversions.h" +#include "harness/typeWrappers.h" +#include "harness/conversions.h" #include #include @@ -90,15 +90,8 @@ int test_queue_hint(cl_device_id deviceID, cl_context context, cl_command_queue int err = 0; // Query extension - cl_platform_id platform; clProgramWrapper program; clKernelWrapper kernel; - char *string_returned; - - string_returned = (char*)malloc(8192); - - err = clGetDeviceInfo(deviceID, CL_DEVICE_PLATFORM, sizeof(platform), &platform, NULL); - test_error(err, "clGetDeviceInfo for CL_DEVICE_PLATFORM failed"); err = create_single_kernel_helper_with_build_options(context, &program, &kernel, 1, queue_hint_test_kernel, "vec_cpy", NULL); if (err != 0) @@ -106,14 +99,9 @@ int test_queue_hint(cl_device_id deviceID, cl_context context, cl_command_queue return err; } - memset(string_returned, 0, 8192); - err = clGetPlatformInfo(platform, CL_PLATFORM_EXTENSIONS, 8192, string_returned, NULL); - test_error(err, "clGetPlatformInfo for CL_PLATFORM_EXTENSIONS failed"); - log_info("\tCL_PLATFORM_EXTENSIONS: %s\n", string_returned); - string strExt = string_returned; - if (strExt.find("cl_khr_priority_hints") != string::npos) + if (is_extension_available(deviceID, "cl_khr_priority_hints")) { - log_info("Testing cl_khr_priority_hints...\n", string_returned); + log_info("Testing cl_khr_priority_hints...\n"); cl_queue_properties queue_prop[][3] = { @@ -145,11 +133,12 @@ int test_queue_hint(cl_device_id deviceID, cl_context context, cl_command_queue } else { - log_info("cl_khr_priority_hints is not supported."); + log_info("cl_khr_priority_hints is not supported.\n"); } - if (strExt.find("cl_khr_throttle_hints") != string::npos) + if (is_extension_available(deviceID, "cl_khr_throttle_hints")) { + log_info("Testing cl_khr_throttle_hints...\n"); cl_queue_properties queue_prop[][3] = { { @@ -181,11 +170,9 @@ int test_queue_hint(cl_device_id deviceID, cl_context context, cl_command_queue } else { - log_info("cl_khr_throttle_hints is not supported."); + log_info("cl_khr_throttle_hints is not supported.\n"); } - free(string_returned); - return 0; } diff --git a/test_conformance/compatibility/test_conformance/api/test_queue_properties.cpp b/test_conformance/api/test_queue_properties.cpp similarity index 90% rename from test_conformance/compatibility/test_conformance/api/test_queue_properties.cpp rename to test_conformance/api/test_queue_properties.cpp index 3b368077..7975ec93 100644 --- a/test_conformance/compatibility/test_conformance/api/test_queue_properties.cpp +++ b/test_conformance/api/test_queue_properties.cpp @@ -16,8 +16,8 @@ #include "testBase.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/conversions.h" +#include "harness/typeWrappers.h" +#include "harness/conversions.h" #include #include #include @@ -107,20 +107,11 @@ int test_queue_properties(cl_device_id deviceID, cl_context context, cl_command_ clProgramWrapper program; clKernelWrapper kernel; - size_t strSize; - std::string strExt(0, '\0'); - cl_queue_properties_khr device_props = NULL; + cl_queue_properties_khr device_props = 0; cl_queue_properties_khr queue_prop_def[] = { CL_QUEUE_PROPERTIES, 0, 0 }; // Query extension - error = clGetDeviceInfo(deviceID, CL_DEVICE_EXTENSIONS, 0, NULL, &strSize); - test_error(error, "clGetDeviceInfo for CL_DEVICE_EXTENSIONS failed"); - strExt.resize(strSize); - error = clGetDeviceInfo(deviceID, CL_DEVICE_EXTENSIONS, strExt.size(), &strExt[0], NULL); - test_error(error, "clGetDeviceInfo for CL_DEVICE_EXTENSIONS failed"); - log_info("CL_DEVICE_EXTENSIONS:\n%s\n\n", strExt.c_str()); - - if (strExt.find("cl_khr_create_command_queue") == string::npos) + if (!is_extension_available(deviceID, "cl_khr_create_command_queue")) { log_info("extension cl_khr_create_command_queue is not supported.\n"); return 0; diff --git a/test_conformance/api/test_queue_properties_queries.cpp b/test_conformance/api/test_queue_properties_queries.cpp new file mode 100644 index 00000000..843fa845 --- /dev/null +++ b/test_conformance/api/test_queue_properties_queries.cpp @@ -0,0 +1,269 @@ +// +// Copyright (c) 2020 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "testBase.h" +#include "harness/propertyHelpers.h" +#include "harness/typeWrappers.h" +#include +#include + +struct test_queue_array_properties_data +{ + std::vector properties; + std::string description; +}; + +int verify_if_properties_supported( + cl_device_id deviceID, cl_command_queue_properties requested_bitfield, + cl_uint requested_size) +{ + int error = CL_SUCCESS; + bool on_host_queue = true; + + if (requested_bitfield & CL_QUEUE_ON_DEVICE) + { + on_host_queue = false; + + if (requested_size > 0) + { + cl_uint max_queue_size = 0; + error = + clGetDeviceInfo(deviceID, CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE, + sizeof(max_queue_size), &max_queue_size, NULL); + test_error(error, + "clGetDeviceInfo for " + "CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE failed"); + if (requested_size > max_queue_size) + { + log_info( + "The value of CL_QUEUE_SIZE = %d cannot be bigger than " + "CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE = %d, skipped\n", + requested_size, max_queue_size); + return TEST_SKIPPED_ITSELF; + } + } + } + + cl_command_queue_properties supported_properties = 0; + cl_command_queue_properties all_properties = 0; + + std::vector all_properties_vector{ + CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, CL_QUEUE_PROFILING_ENABLE + }; + for (auto each_property : all_properties_vector) + { + all_properties |= each_property; + } + cl_command_queue_properties requested_properties = + all_properties & requested_bitfield; + + if (on_host_queue) + { + error = clGetDeviceInfo(deviceID, CL_DEVICE_QUEUE_ON_HOST_PROPERTIES, + sizeof(supported_properties), + &supported_properties, NULL); + test_error(error, + "clGetDeviceInfo asking for " + "CL_DEVICE_QUEUE_ON_HOST_PROPERTIES failed"); + } + else + { + error = clGetDeviceInfo(deviceID, CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES, + sizeof(supported_properties), + &supported_properties, NULL); + test_error(error, + "clGetDeviceInfo asking for " + "CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES failed"); + } + + for (auto each_property : all_properties_vector) + { + if ((each_property & requested_properties) + && !(each_property & supported_properties)) + { + log_info("\t%s not supported, skipped\n", + GetQueuePropertyName(each_property)); + return TEST_SKIPPED_ITSELF; + } + else if ((each_property & requested_properties) + && each_property & supported_properties) + { + log_info("\t%s supported\n", GetQueuePropertyName(each_property)); + } + } + return error; +} + +static int create_queue_and_check_array_properties( + cl_context context, cl_device_id deviceID, + test_queue_array_properties_data test_case) +{ + cl_int error = CL_SUCCESS; + + clCommandQueueWrapper test_queue; + + if (test_case.properties.size() > 0) + { + test_queue = clCreateCommandQueueWithProperties( + context, deviceID, test_case.properties.data(), &error); + test_error(error, "clCreateCommandQueueWithProperties failed"); + } + else + { + test_queue = + clCreateCommandQueueWithProperties(context, deviceID, NULL, &error); + test_error(error, "clCreateCommandQueueWithProperties failed"); + } + + std::vector check_properties; + size_t set_size = 0; + + error = clGetCommandQueueInfo(test_queue, CL_QUEUE_PROPERTIES_ARRAY, 0, + NULL, &set_size); + test_error(error, + "clGetCommandQueueInfo failed asking for " + "CL_QUEUE_PROPERTIES_ARRAY size."); + + if (set_size == 0 && test_case.properties.size() == 0) + { + return TEST_PASS; + } + if (set_size != test_case.properties.size() * sizeof(cl_queue_properties)) + { + log_error("ERROR: CL_QUEUE_PROPERTIES_ARRAY size is %d, expected %d.\n", + set_size, + test_case.properties.size() * sizeof(cl_queue_properties)); + return TEST_FAIL; + } + + cl_uint number_of_props = set_size / sizeof(cl_queue_properties); + check_properties.resize(number_of_props); + error = clGetCommandQueueInfo(test_queue, CL_QUEUE_PROPERTIES_ARRAY, + set_size, check_properties.data(), NULL); + test_error( + error, + "clGetCommandQueueInfo failed asking for CL_QUEUE_PROPERTIES_ARRAY."); + + error = compareProperties(check_properties, test_case.properties); + return error; +} + +static int +run_test_queue_array_properties(cl_context context, cl_device_id deviceID, + test_queue_array_properties_data test_case) +{ + int error = TEST_PASS; + + std::vector requested_properties = + test_case.properties; + log_info("\nTC description: %s\n", test_case.description.c_str()); + + // first verify if user properties are supported + if (requested_properties.size() != 0) + { + requested_properties.pop_back(); + cl_command_queue_properties requested_bitfield = 0; + cl_uint requested_size = 0; + for (cl_uint i = 0; i < requested_properties.size(); i = i + 2) + { + if (requested_properties[i] == CL_QUEUE_PROPERTIES) + { + requested_bitfield = requested_properties[i + 1]; + } + if (requested_properties[i] == CL_QUEUE_SIZE) + { + requested_size = requested_properties[i + 1]; + } + } + + error = verify_if_properties_supported(deviceID, requested_bitfield, + requested_size); + if (error == TEST_SKIPPED_ITSELF) + { + log_info("TC result: skipped\n"); + return TEST_PASS; + } + test_error(error, + "Checking which queue properties supported failed.\n"); + } + + // continue testing if supported user properties + error = + create_queue_and_check_array_properties(context, deviceID, test_case); + test_error(error, "create_queue_and_check_array_properties failed.\n"); + + log_info("TC result: passed\n"); + return TEST_PASS; +} + +int test_queue_properties_queries(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements) +{ + int error = TEST_PASS; + std::vector test_cases; + + test_cases.push_back({ {}, "host queue, NULL properties" }); + + test_cases.push_back( + { { CL_QUEUE_PROPERTIES, 0, 0 }, "host queue, zero properties" }); + + test_cases.push_back( + { { CL_QUEUE_PROPERTIES, CL_QUEUE_PROFILING_ENABLE, 0 }, + "host queue, CL_QUEUE_PROFILING_ENABLE" }); + + test_cases.push_back( + { { CL_QUEUE_PROPERTIES, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, 0 }, + "host queue, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE" }); + + test_cases.push_back( + { { CL_QUEUE_PROPERTIES, + CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_PROFILING_ENABLE, + 0 }, + "host queue, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | " + "CL_QUEUE_PROFILING_ENABLE" }); + + test_cases.push_back( + { { CL_QUEUE_PROPERTIES, + CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE, 0 }, + "device queue, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | " + "CL_QUEUE_ON_DEVICE" }); + + test_cases.push_back( + { { CL_QUEUE_PROPERTIES, + CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE + | CL_QUEUE_ON_DEVICE_DEFAULT | CL_QUEUE_PROFILING_ENABLE, + CL_QUEUE_SIZE, 124, 0 }, + "device queue, all possible properties" }); + + test_cases.push_back( + { { CL_QUEUE_PROPERTIES, + CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE + | CL_QUEUE_PROFILING_ENABLE, + CL_QUEUE_SIZE, 124, 0 }, + "device queue, all without CL_QUEUE_ON_DEVICE_DEFAULT" }); + + test_cases.push_back( + { { CL_QUEUE_PROPERTIES, + CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE + | CL_QUEUE_ON_DEVICE_DEFAULT | CL_QUEUE_PROFILING_ENABLE, + 0 }, + "device queue, all without CL_QUEUE_SIZE" }); + + for (auto test_case : test_cases) + { + error |= run_test_queue_array_properties(context, deviceID, test_case); + } + return error; +} diff --git a/test_conformance/api/test_retain.cpp b/test_conformance/api/test_retain.cpp index 384d280e..cf065bcd 100644 --- a/test_conformance/api/test_retain.cpp +++ b/test_conformance/api/test_retain.cpp @@ -38,7 +38,7 @@ int test_retain_queue_single(cl_device_id deviceID, cl_context context, cl_comma /* Create a test queue */ - queue = clCreateCommandQueueWithProperties( context, deviceID, 0, &err ); + queue = clCreateCommandQueue( context, deviceID, 0, &err ); test_error( err, "Unable to create command queue to test with" ); /* Test the instance count */ @@ -70,7 +70,7 @@ int test_retain_queue_multiple(cl_device_id deviceID, cl_context context, cl_com /* Create a test program */ - queue = clCreateCommandQueueWithProperties( context, deviceID, 0, &err ); + queue = clCreateCommandQueue( context, deviceID, 0, &err ); test_error( err, "Unable to create command queue to test with" ); /* Increment 9 times, which should bring the count to 10 */ @@ -232,3 +232,44 @@ int test_retain_mem_object_multiple(cl_device_id deviceID, cl_context context, c return 0; } +int test_retain_mem_object_set_kernel_arg(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) +{ + int err; + cl_mem buffer = nullptr; + cl_program program; + cl_kernel kernel; + static volatile uint32_t sValue; + sValue = 0; + auto callback = []( cl_mem, void * ) { + ++sValue; + }; + const char *testProgram[] = { "__kernel void sample_test(__global int *data){}" }; + + buffer = clCreateBuffer( context, CL_MEM_READ_ONLY, 32, NULL, &err ); + test_error( err, "Unable to create buffer to test with" ); + + err = clSetMemObjectDestructorCallback( buffer, callback, nullptr ); + test_error( err, "Unable to set destructor callback" ); + + err = create_single_kernel_helper( context, &program, nullptr, 1, testProgram, nullptr ); + test_error( err, "Unable to build sample program" ); + + kernel = clCreateKernel( program, "sample_test", &err ); + test_error( err, "Unable to create sample_test kernel" ); + + err = clSetKernelArg( kernel, 0, sizeof(cl_mem), &buffer ); + test_error( err, "Unable to set kernel argument" ); + + err = clReleaseMemObject( buffer ); + test_error( err, "Unable to release buffer" ); + + // Spin waiting for the release to finish. If you don't call the mem_destructor_callback, you will not + // pass the test. bugzilla 6316 + while (sValue == 0) { } + + clReleaseKernel( kernel ); + clReleaseProgram( program ); + + // If we got this far, we succeeded. + return 0; +} diff --git a/test_conformance/api/test_retain_program.c b/test_conformance/api/test_retain_program.cpp similarity index 98% rename from test_conformance/api/test_retain_program.c rename to test_conformance/api/test_retain_program.cpp index 4930c862..a85bc704 100644 --- a/test_conformance/api/test_retain_program.c +++ b/test_conformance/api/test_retain_program.cpp @@ -19,7 +19,7 @@ #include #endif -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" int test_release_kernel_order(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) { diff --git a/test_conformance/api/test_sub_group_dispatch.cpp b/test_conformance/api/test_sub_group_dispatch.cpp index b17727c5..387d6c39 100644 --- a/test_conformance/api/test_sub_group_dispatch.cpp +++ b/test_conformance/api/test_sub_group_dispatch.cpp @@ -14,10 +14,11 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/conversions.h" +#include "harness/typeWrappers.h" +#include "harness/conversions.h" const char *subgroup_dispatch_kernel[] = { +"#pragma OPENCL EXTENSION cl_khr_subgroups : enable\n" "__kernel void subgroup_dispatch_kernel(__global int *output)\n" "{\n" " size_t size = get_num_sub_groups ();\n" @@ -74,6 +75,26 @@ int test_sub_group_dispatch(cl_device_id deviceID, cl_context context, cl_comman size_t ret_ndrange2d_flattened; size_t ret_ndrange3d_flattened; + if (get_device_cl_version(deviceID) >= Version(3, 0)) + { + int error; + cl_uint max_num_sub_groups; + + error = clGetDeviceInfo(deviceID, CL_DEVICE_MAX_NUM_SUB_GROUPS, + sizeof(max_num_sub_groups), &max_num_sub_groups, + NULL); + if (error != CL_SUCCESS) + { + print_error(error, "Unable to get max num subgroups"); + return error; + } + + if (max_num_sub_groups == 0) + { + return TEST_SKIPPED_ITSELF; + } + } + error = create_single_kernel_helper_with_build_options(context, &program, &kernel, 1, subgroup_dispatch_kernel, "subgroup_dispatch_kernel", "-cl-std=CL2.0"); if (error != 0) return error; diff --git a/test_conformance/api/test_zero_sized_enqueue.cpp b/test_conformance/api/test_zero_sized_enqueue.cpp index dbe2af2e..dabe75fe 100644 --- a/test_conformance/api/test_zero_sized_enqueue.cpp +++ b/test_conformance/api/test_zero_sized_enqueue.cpp @@ -14,8 +14,8 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/conversions.h" +#include "harness/typeWrappers.h" +#include "harness/conversions.h" const char *zero_sized_enqueue_test_kernel[] = { "__kernel void foo_kernel(__global float *src, __global int *dst)\n" @@ -134,7 +134,7 @@ int test_zero_sized_enqueue_helper(cl_device_id deviceID, cl_context context, cl // Verify zero-sized ND range kernel still satisfy event wait list and correct event object // is returned - cl_event ev = NULL; + clEventWrapper ev = NULL; clEventWrapper user_ev = clCreateUserEvent(context, &error); test_error( error, "user event creation failed." ); error = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, ndrange30, NULL, 1, &user_ev, &ev); diff --git a/test_conformance/atomics/CMakeLists.txt b/test_conformance/atomics/CMakeLists.txt index 5d9e8827..53c28725 100644 --- a/test_conformance/atomics/CMakeLists.txt +++ b/test_conformance/atomics/CMakeLists.txt @@ -1,18 +1,9 @@ set(MODULE_NAME ATOMICS) set(${MODULE_NAME}_SOURCES - main.c + main.cpp test_atomics.cpp - test_indexed_cases.c - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/threadTesting.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/mt19937.c - ../../test_common/harness/conversions.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c + test_indexed_cases.cpp ) include(../CMakeCommon.txt) diff --git a/test_conformance/atomics/main.c b/test_conformance/atomics/main.cpp similarity index 93% rename from test_conformance/atomics/main.c rename to test_conformance/atomics/main.cpp index 3ad70f7e..6904d7c3 100644 --- a/test_conformance/atomics/main.c +++ b/test_conformance/atomics/main.cpp @@ -13,12 +13,12 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include #include #include "procs.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" #if !defined(_WIN32) #include diff --git a/test_conformance/atomics/procs.h b/test_conformance/atomics/procs.h index 017e6c55..bf053f25 100644 --- a/test_conformance/atomics/procs.h +++ b/test_conformance/atomics/procs.h @@ -13,10 +13,10 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/threadTesting.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" +#include "harness/threadTesting.h" +#include "harness/typeWrappers.h" extern int create_program_and_kernel(const char *source, const char *kernel_name, cl_program *program_ret, cl_kernel *kernel_ret); diff --git a/test_conformance/atomics/testBase.h b/test_conformance/atomics/testBase.h index 8d58eeb6..ba67d140 100644 --- a/test_conformance/atomics/testBase.h +++ b/test_conformance/atomics/testBase.h @@ -16,7 +16,7 @@ #ifndef _testBase_h #define _testBase_h -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include #include diff --git a/test_conformance/atomics/test_atomics.cpp b/test_conformance/atomics/test_atomics.cpp index 06941e58..24bf974a 100644 --- a/test_conformance/atomics/test_atomics.cpp +++ b/test_conformance/atomics/test_atomics.cpp @@ -14,7 +14,7 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/conversions.h" +#include "harness/conversions.h" #ifndef _WIN32 #include #endif @@ -23,8 +23,6 @@ #define LONG_TEST_VALUE 515154531254381446LL -extern cl_uint gRandomSeed; - const char *atomic_global_pattern[] = { "__kernel void test_atomic_fn(volatile __global %s *destMemory, __global %s *oldValues)\n" "{\n" @@ -94,16 +92,13 @@ bool check_atomic_support( cl_device_id device, bool extended, bool isLocal, Exp if( isLocal ) index += 2; - size_t major, minor; - - int error = get_device_version(device, &major, &minor); - test_error( error, "get_device_version" ); + Version version = get_device_cl_version(device); switch (dataType) { case kInt: case kUInt: - if( major * 10 + minor >= 11 ) + if( version >= Version(1,1) ) return 1; break; case kLong: @@ -111,7 +106,7 @@ bool check_atomic_support( cl_device_id device, bool extended, bool isLocal, Exp index += 4; break; case kFloat: // this has to stay separate since the float atomics arent in the 1.0 extensions - return major * 10 + minor >= 11; + return version >= Version(1,1); default: log_error( "ERROR: Unsupported data type (%d) in check_atomic_support\n", dataType ); return 0; @@ -205,6 +200,12 @@ int test_atomic_function(cl_device_id deviceID, cl_context context, cl_command_q error = clGetKernelWorkGroupInfo( kernel, deviceID, CL_KERNEL_WORK_GROUP_SIZE, sizeof( workSize ), &workSize, NULL ); test_error( error, "Unable to obtain max work group size for device and kernel combo" ); + // "workSize" is limited to that of the first dimension as only a 1DRange is executed. + if( maxSizes[0] < workSize ) + { + workSize = maxSizes[0]; + } + threadSize = groupSize = workSize; } diff --git a/test_conformance/atomics/test_indexed_cases.c b/test_conformance/atomics/test_indexed_cases.cpp similarity index 99% rename from test_conformance/atomics/test_indexed_cases.c rename to test_conformance/atomics/test_indexed_cases.cpp index a620d6ef..9a27d076 100644 --- a/test_conformance/atomics/test_indexed_cases.c +++ b/test_conformance/atomics/test_indexed_cases.cpp @@ -14,9 +14,7 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/conversions.h" - -extern cl_uint gRandomSeed; +#include "harness/conversions.h" const char * atomic_index_source = "#pragma OPENCL EXTENSION cl_khr_global_int32_base_atomics : enable\n" diff --git a/test_conformance/basic/CMakeLists.txt b/test_conformance/basic/CMakeLists.txt index e390bb9b..d73b84a2 100644 --- a/test_conformance/basic/CMakeLists.txt +++ b/test_conformance/basic/CMakeLists.txt @@ -1,49 +1,48 @@ set(MODULE_NAME BASIC) set(${MODULE_NAME}_SOURCES - main.c - test_fpmath_float.c test_fpmath_float2.c test_fpmath_float4.c - test_intmath_int.c test_intmath_int2.c test_intmath_int4.c - test_intmath_long.c test_intmath_long2.c test_intmath_long4.c - test_hiloeo.c test_local.c test_pointercast.c - test_if.c test_loop.c - test_readimage.c test_readimage_int16.c test_readimage_fp32.c - test_readimage3d.c test_readimage3d_int16.c test_readimage3d_fp32.c - test_writeimage.c test_writeimage_int16.c test_writeimage_fp32.c - test_multireadimageonefmt.c test_multireadimagemultifmt.c - test_imagedim.c - test_vloadstore.c - test_int2float.c test_float2int.c - test_createkernelsinprogram.c - test_hostptr.c + main.cpp + test_fpmath_float.cpp test_fpmath_float2.cpp test_fpmath_float4.cpp + test_intmath.cpp + test_hiloeo.cpp test_local.cpp test_pointercast.cpp + test_if.cpp test_loop.cpp + test_readimage.cpp test_readimage_int16.cpp test_readimage_fp32.cpp + test_readimage3d.cpp test_readimage3d_int16.cpp test_readimage3d_fp32.cpp + test_writeimage.cpp test_writeimage_int16.cpp test_writeimage_fp32.cpp + test_multireadimageonefmt.cpp test_multireadimagemultifmt.cpp + test_imagedim.cpp + test_vloadstore.cpp + test_int2float.cpp test_float2int.cpp + test_createkernelsinprogram.cpp + test_hostptr.cpp test_explicit_s2v.cpp - test_constant.c - test_image_multipass.c - test_imagereadwrite.c test_imagereadwrite3d.c - test_image_param.c - test_imagenpot.c - test_image_r8.c - test_barrier.c - test_basic_parameter_types.c - test_arrayreadwrite.c - test_arraycopy.c - test_imagearraycopy.c - test_imagearraycopy3d.c - test_imagecopy.c - test_imagerandomcopy.c - test_arrayimagecopy.c - test_arrayimagecopy3d.c - test_imagecopy3d.c + test_constant.cpp + test_image_multipass.cpp + test_imagereadwrite.cpp test_imagereadwrite3d.cpp + test_image_param.cpp + test_imagenpot.cpp + test_image_r8.cpp + test_barrier.cpp + test_basic_parameter_types.cpp + test_arrayreadwrite.cpp + test_arraycopy.cpp + test_imagearraycopy.cpp + test_imagearraycopy3d.cpp + test_imagecopy.cpp + test_imagerandomcopy.cpp + test_arrayimagecopy.cpp + test_arrayimagecopy3d.cpp + test_imagecopy3d.cpp test_enqueue_map.cpp test_work_item_functions.cpp test_astype.cpp test_async_copy.cpp - test_sizeof.c + test_sizeof.cpp test_vector_creation.cpp - test_vec_type_hint.c + test_vec_type_hint.cpp test_numeric_constants.cpp test_constant_source.cpp - test_bufferreadwriterect.c + test_bufferreadwriterect.cpp test_async_strided_copy.cpp test_preprocessors.cpp test_kernel_memory_alignment.cpp @@ -51,34 +50,22 @@ set(${MODULE_NAME}_SOURCES test_kernel_call_kernel_function.cpp test_local_kernel_scope.cpp test_progvar.cpp - test_wg_barrier.c - test_global_linear_id.c - test_local_linear_id.c - test_enqueued_local_size.c - test_simple_image_pitch.c + test_wg_barrier.cpp + test_global_linear_id.cpp + test_local_linear_id.cpp + test_enqueued_local_size.cpp + test_simple_image_pitch.cpp test_get_linear_ids.cpp - test_rw_image_access_qualifier.c - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/threadTesting.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/typeWrappers.cpp - ../../test_common/harness/imageHelpers.cpp - ../../test_common/harness/mt19937.c - ../../test_common/harness/conversions.c - ../../test_common/harness/rounding_mode.c - ../../test_common/harness/msvc9.c - test_wg_barrier.c - test_enqueued_local_size.c - test_global_linear_id.c - test_local_linear_id.c + test_rw_image_access_qualifier.cpp + test_wg_barrier.cpp + test_enqueued_local_size.cpp + test_global_linear_id.cpp + test_local_linear_id.cpp test_progvar.cpp - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c ) if(APPLE) - list(APPEND ${MODULE_NAME}_SOURCES test_queue_priority.c) + list(APPEND ${MODULE_NAME}_SOURCES test_queue_priority.cpp) endif(APPLE) include(../CMakeCommon.txt) diff --git a/test_conformance/basic/main.c b/test_conformance/basic/main.cpp similarity index 84% rename from test_conformance/basic/main.c rename to test_conformance/basic/main.cpp index 07c37a4c..11ed2c38 100644 --- a/test_conformance/basic/main.c +++ b/test_conformance/basic/main.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #if !defined(_WIN32) #include @@ -22,15 +22,9 @@ #include #include #include -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" #include "procs.h" -// FIXME: To use certain functions in ../../test_common/harness/imageHelpers.h -// (for example, generate_random_image_data()), the tests are required to declare -// the following variables (): -cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT; -bool gTestRounding = false; - test_definition test_list[] = { ADD_TEST( hostptr ), ADD_TEST( fpmath_float ), @@ -63,7 +57,7 @@ test_definition test_list[] = { ADD_TEST( mri_multiple ), ADD_TEST( image_r8 ), ADD_TEST( barrier ), - ADD_TEST( wg_barrier ), + ADD_TEST_VERSION( wg_barrier, Version(2, 0) ), ADD_TEST( int2float ), ADD_TEST( float2int ), ADD_TEST( imagereadwrite ), @@ -97,7 +91,6 @@ test_definition test_list[] = { ADD_TEST( image_param ), ADD_TEST( image_multipass_integer_coord ), ADD_TEST( image_multipass_float_coord ), - ADD_TEST( explicit_s2v_bool ), ADD_TEST( explicit_s2v_char ), ADD_TEST( explicit_s2v_uchar ), ADD_TEST( explicit_s2v_short ), @@ -136,17 +129,17 @@ test_definition test_list[] = { ADD_TEST( kernel_memory_alignment_constant ), ADD_TEST( kernel_memory_alignment_private ), - ADD_TEST( progvar_prog_scope_misc ), - ADD_TEST( progvar_prog_scope_uninit ), - ADD_TEST( progvar_prog_scope_init ), - ADD_TEST( progvar_func_scope ), + ADD_TEST_VERSION( progvar_prog_scope_misc, Version(2, 0) ), + ADD_TEST_VERSION( progvar_prog_scope_uninit, Version(2, 0) ), + ADD_TEST_VERSION( progvar_prog_scope_init, Version(2, 0) ), + ADD_TEST_VERSION( progvar_func_scope, Version(2, 0) ), ADD_TEST( global_work_offsets ), ADD_TEST( get_global_offset ), - ADD_TEST( global_linear_id ), - ADD_TEST( local_linear_id ), - ADD_TEST( enqueued_local_size ), + ADD_TEST_VERSION( global_linear_id, Version(2, 0) ), + ADD_TEST_VERSION( local_linear_id, Version(2, 0) ), + ADD_TEST_VERSION( enqueued_local_size, Version(2, 0) ), ADD_TEST( simple_read_image_pitch ), ADD_TEST( simple_write_image_pitch ), @@ -155,8 +148,8 @@ test_definition test_list[] = { ADD_TEST( queue_priority ), #endif - ADD_TEST( get_linear_ids ), - ADD_TEST( rw_image_access_qualifier ), + ADD_TEST_VERSION( get_linear_ids, Version(2, 0) ), + ADD_TEST_VERSION( rw_image_access_qualifier, Version(2, 0) ), }; const int test_num = ARRAY_SIZE( test_list ); diff --git a/test_conformance/basic/procs.h b/test_conformance/basic/procs.h index 436f65f3..9fe17ef4 100644 --- a/test_conformance/basic/procs.h +++ b/test_conformance/basic/procs.h @@ -13,12 +13,12 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/rounding_mode.h" +#include "harness/kernelHelpers.h" +#include "harness/testHarness.h" +#include "harness/errorHelpers.h" +#include "harness/typeWrappers.h" +#include "harness/conversions.h" +#include "harness/rounding_mode.h" extern void memset_pattern4(void *dest, const void *src_pattern, size_t bytes ); @@ -91,7 +91,6 @@ extern int test_vstore_global(cl_device_id deviceID, cl_context context, cl extern int test_vstore_local(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_vstore_private(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_explicit_s2v_bool(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_explicit_s2v_char(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_explicit_s2v_uchar(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_explicit_s2v_short(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); diff --git a/test_conformance/basic/test_arraycopy.c b/test_conformance/basic/test_arraycopy.c deleted file mode 100644 index 5104c49b..00000000 --- a/test_conformance/basic/test_arraycopy.c +++ /dev/null @@ -1,201 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - - -#include "procs.h" - -const char *copy_kernel_code = -"__kernel void test_copy(__global unsigned int *src, __global unsigned int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = src[tid];\n" -"}\n"; - -int -test_arraycopy(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems) -{ - cl_uint *input_ptr, *output_ptr; - cl_mem streams[4], results; - cl_program program; - cl_kernel kernel; - unsigned num_elements = 128 * 1024; - cl_uint num_copies = 1; - size_t delta_offset; - unsigned i; - cl_int err; - MTdata d; - - int error_count = 0; - - input_ptr = (cl_uint*)malloc(sizeof(cl_uint) * num_elements); - output_ptr = (cl_uint*)malloc(sizeof(cl_uint) * num_elements); - - // results - results = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_uint) * num_elements, NULL, &err); - test_error(err, "clCreateBuffer failed"); - -/*****************************************************************************************************************************************/ -#pragma mark client backing - - log_info("Testing CL_MEM_USE_HOST_PTR buffer with clEnqueueCopyBuffer\n"); - // randomize data - d = init_genrand( gRandomSeed ); - for (i=0; i #include diff --git a/test_conformance/basic/test_arrayimagecopy.c b/test_conformance/basic/test_arrayimagecopy.cpp similarity index 97% rename from test_conformance/basic/test_arrayimagecopy.c rename to test_conformance/basic/test_arrayimagecopy.cpp index 2345be6b..5a0263fd 100644 --- a/test_conformance/basic/test_arrayimagecopy.c +++ b/test_conformance/basic/test_arrayimagecopy.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -68,6 +68,9 @@ int test_arrayimagecopy_single_format(cl_device_id device, cl_context context, c err = clEnqueueReadImage( queue, image, CL_TRUE, origin, region, 0, 0, imgptr, 1, ©event, NULL ); test_error(err, "clEnqueueReadBuffer failed"); + err = clReleaseEvent(copyevent); + test_error(err, "clReleaseEvent failed"); + if (memcmp(bufptr, imgptr, buffer_size) != 0) { log_error( "ERROR: Results did not validate!\n" ); unsigned char * inchar = (unsigned char*)bufptr; diff --git a/test_conformance/basic/test_arrayimagecopy3d.c b/test_conformance/basic/test_arrayimagecopy3d.cpp similarity index 97% rename from test_conformance/basic/test_arrayimagecopy3d.c rename to test_conformance/basic/test_arrayimagecopy3d.cpp index d5333777..d1d36524 100644 --- a/test_conformance/basic/test_arrayimagecopy3d.c +++ b/test_conformance/basic/test_arrayimagecopy3d.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -69,6 +69,9 @@ int test_arrayimagecopy3d_single_format(cl_device_id device, cl_context context, err = clEnqueueReadImage( queue, image, CL_TRUE, origin, region, 0, 0, imgptr, 1, ©event, NULL ); test_error(err, "clEnqueueReadBuffer failed"); + err = clReleaseEvent(copyevent); + test_error(err, "clReleaseEvent failed"); + if (memcmp(bufptr, imgptr, buffer_size) != 0) { log_error( "ERROR: Results did not validate!\n" ); unsigned char * inchar = (unsigned char*)bufptr; diff --git a/test_conformance/basic/test_arrayreadwrite.c b/test_conformance/basic/test_arrayreadwrite.cpp similarity index 98% rename from test_conformance/basic/test_arrayreadwrite.c rename to test_conformance/basic/test_arrayreadwrite.cpp index 96942ec1..68664398 100644 --- a/test_conformance/basic/test_arrayreadwrite.c +++ b/test_conformance/basic/test_arrayreadwrite.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/basic/test_astype.cpp b/test_conformance/basic/test_astype.cpp index 9043ece2..7281f904 100644 --- a/test_conformance/basic/test_astype.cpp +++ b/test_conformance/basic/test_astype.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -23,8 +23,8 @@ #include "procs.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/conversions.h" +#include "harness/typeWrappers.h" static const char *astype_kernel_pattern = diff --git a/test_conformance/basic/test_async_copy.cpp b/test_conformance/basic/test_async_copy.cpp index 4d2bd9ca..a537c8fe 100644 --- a/test_conformance/basic/test_async_copy.cpp +++ b/test_conformance/basic/test_async_copy.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -24,7 +24,7 @@ #include "procs.h" -#include "../../test_common/harness/conversions.h" +#include "harness/conversions.h" static const char *async_global_to_local_kernel = "%s\n" // optional pragma string diff --git a/test_conformance/basic/test_async_strided_copy.cpp b/test_conformance/basic/test_async_strided_copy.cpp index ca657787..fe76c844 100644 --- a/test_conformance/basic/test_async_strided_copy.cpp +++ b/test_conformance/basic/test_async_strided_copy.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -24,7 +24,7 @@ #include "procs.h" -#include "../../test_common/harness/conversions.h" +#include "harness/conversions.h" static const char *async_strided_global_to_local_kernel = "%s\n" // optional pragma string diff --git a/test_conformance/basic/test_barrier.c b/test_conformance/basic/test_barrier.cpp similarity index 99% rename from test_conformance/basic/test_barrier.c rename to test_conformance/basic/test_barrier.cpp index b24d771b..822b8eb6 100644 --- a/test_conformance/basic/test_barrier.c +++ b/test_conformance/basic/test_barrier.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/basic/test_basic_parameter_types.c b/test_conformance/basic/test_basic_parameter_types.cpp similarity index 99% rename from test_conformance/basic/test_basic_parameter_types.c rename to test_conformance/basic/test_basic_parameter_types.cpp index b10bdef3..886da6a1 100644 --- a/test_conformance/basic/test_basic_parameter_types.c +++ b/test_conformance/basic/test_basic_parameter_types.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/basic/test_bufferreadwriterect.c b/test_conformance/basic/test_bufferreadwriterect.cpp similarity index 99% rename from test_conformance/basic/test_bufferreadwriterect.c rename to test_conformance/basic/test_bufferreadwriterect.cpp index 1631056b..bd813807 100644 --- a/test_conformance/basic/test_bufferreadwriterect.c +++ b/test_conformance/basic/test_bufferreadwriterect.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/basic/test_constant.c b/test_conformance/basic/test_constant.cpp similarity index 98% rename from test_conformance/basic/test_constant.c rename to test_conformance/basic/test_constant.cpp index ddc9e016..2bd661a9 100644 --- a/test_conformance/basic/test_constant.c +++ b/test_conformance/basic/test_constant.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -111,14 +111,20 @@ test_constant(cl_device_id device, cl_context context, cl_command_queue queue, i test_error( err, "Unable to get max constant buffer size" ); log_info("Device reports CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE %llu bytes.\n", maxSize); + + // Limit test buffer size to 1/4 of CL_DEVICE_GLOBAL_MEM_SIZE err = clGetDeviceInfo(device, CL_DEVICE_GLOBAL_MEM_SIZE, sizeof(maxGlobalSize), &maxGlobalSize, 0); test_error(err, "Unable to get CL_DEVICE_GLOBAL_MEM_SIZE"); + if (maxSize > maxGlobalSize / 4) maxSize = maxGlobalSize / 4; + err = clGetDeviceInfo(device, CL_DEVICE_MAX_MEM_ALLOC_SIZE , sizeof(maxAllocSize), &maxAllocSize, 0); test_error(err, "Unable to get CL_DEVICE_MAX_MEM_ALLOC_SIZE "); + if (maxSize > maxAllocSize) maxSize = maxAllocSize; + maxSize/=4; num_ints = (size_t)maxSize/sizeof(cl_int); num_floats = (size_t)maxSize/sizeof(cl_float); diff --git a/test_conformance/basic/test_constant_source.cpp b/test_conformance/basic/test_constant_source.cpp index b6a3cf4c..d6099e7c 100644 --- a/test_conformance/basic/test_constant_source.cpp +++ b/test_conformance/basic/test_constant_source.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/basic/test_createkernelsinprogram.c b/test_conformance/basic/test_createkernelsinprogram.cpp similarity index 98% rename from test_conformance/basic/test_createkernelsinprogram.c rename to test_conformance/basic/test_createkernelsinprogram.cpp index 2940f298..77eba3f9 100644 --- a/test_conformance/basic/test_createkernelsinprogram.c +++ b/test_conformance/basic/test_createkernelsinprogram.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/basic/test_enqueue_map.cpp b/test_conformance/basic/test_enqueue_map.cpp index d78d20e5..3702726f 100644 --- a/test_conformance/basic/test_enqueue_map.cpp +++ b/test_conformance/basic/test_enqueue_map.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -23,8 +23,8 @@ #include "procs.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/conversions.h" +#include "harness/typeWrappers.h" const cl_mem_flags flag_set[] = { CL_MEM_ALLOC_HOST_PTR, @@ -45,27 +45,31 @@ int test_enqueue_map_buffer(cl_device_id deviceID, cl_context context, cl_comman { int error; const size_t bufferSize = 256*256; - int src_flag_id; - MTdata d = init_genrand( gRandomSeed ); - cl_char *initialData = (cl_char*)malloc(bufferSize); - cl_char *finalData = (cl_char*)malloc(bufferSize); + MTdataHolder d{gRandomSeed}; + BufferOwningPtr hostPtrData{ malloc(bufferSize) }; + BufferOwningPtr referenceData{ malloc(bufferSize) }; + BufferOwningPtr finalData{malloc(bufferSize)}; - for (src_flag_id=0; src_flag_id < sizeof(flag_set)/sizeof(flag_set[0]); src_flag_id++) + for (int src_flag_id=0; src_flag_id < ARRAY_SIZE(flag_set); src_flag_id++) { clMemWrapper memObject; log_info("Testing with cl_mem_flags src: %s\n", flag_set_names[src_flag_id]); - generate_random_data( kChar, (unsigned int)bufferSize, d, initialData ); + generate_random_data(kChar, (unsigned int)bufferSize, d, hostPtrData); + memcpy(referenceData, hostPtrData, bufferSize); - if ((flag_set[src_flag_id] & CL_MEM_USE_HOST_PTR) || (flag_set[src_flag_id] & CL_MEM_COPY_HOST_PTR)) - memObject = clCreateBuffer(context, flag_set[src_flag_id], bufferSize * sizeof( cl_char ), initialData, &error); - else - memObject = clCreateBuffer(context, flag_set[src_flag_id], bufferSize * sizeof( cl_char ), NULL, &error); + void *hostPtr = nullptr; + cl_mem_flags flags = flag_set[src_flag_id]; + bool hasHostPtr = (flags & CL_MEM_USE_HOST_PTR) || (flags & CL_MEM_COPY_HOST_PTR); + if (hasHostPtr) hostPtr = hostPtrData; + memObject = clCreateBuffer(context, flags, bufferSize, hostPtr, &error); test_error( error, "Unable to create testing buffer" ); - if (!(flag_set[src_flag_id] & CL_MEM_USE_HOST_PTR) && !(flag_set[src_flag_id] & CL_MEM_COPY_HOST_PTR)) + if (!hasHostPtr) { - error = clEnqueueWriteBuffer(queue, memObject, CL_TRUE, 0, bufferSize * sizeof( cl_char ), initialData, 0, NULL, NULL); + error = + clEnqueueWriteBuffer(queue, memObject, CL_TRUE, 0, bufferSize, + hostPtrData, 0, NULL, NULL); test_error( error, "clEnqueueWriteBuffer failed"); } @@ -81,9 +85,6 @@ int test_enqueue_map_buffer(cl_device_id deviceID, cl_context context, cl_comman { print_error( error, "clEnqueueMapBuffer call failed" ); log_error( "\tOffset: %d Length: %d\n", (int)offset, (int)length ); - free( initialData ); - free( finalData ); - free_mtdata(d); return -1; } @@ -98,9 +99,9 @@ int test_enqueue_map_buffer(cl_device_id deviceID, cl_context context, cl_comman mappedRegion[ j ] = value; // Also update the initial data array - value = initialData[ offset + j ]; + value = referenceData[offset + j]; value = spin - value; - initialData[ offset + j ] = value; + referenceData[offset + j] = value; } // Unmap @@ -109,26 +110,21 @@ int test_enqueue_map_buffer(cl_device_id deviceID, cl_context context, cl_comman } // Final validation: read actual values of buffer and compare against our reference - error = clEnqueueReadBuffer( queue, memObject, CL_TRUE, 0, sizeof( cl_char ) * bufferSize, finalData, 0, NULL, NULL ); + error = clEnqueueReadBuffer( queue, memObject, CL_TRUE, 0, bufferSize, finalData, 0, NULL, NULL ); test_error( error, "Unable to read results" ); for( size_t q = 0; q < bufferSize; q++ ) { - if( initialData[ q ] != finalData[ q ] ) + if (referenceData[q] != finalData[q]) { - log_error( "ERROR: Sample %d did not validate! Got %d, expected %d\n", (int)q, (int)finalData[ q ], (int)initialData[ q ] ); - free( initialData ); - free( finalData ); - free_mtdata(d); + log_error( + "ERROR: Sample %d did not validate! Got %d, expected %d\n", + (int)q, (int)finalData[q], (int)referenceData[q]); return -1; } } } // cl_mem flags - free( initialData ); - free( finalData ); - free_mtdata(d); - return 0; } @@ -137,42 +133,36 @@ int test_enqueue_map_image(cl_device_id deviceID, cl_context context, cl_command int error; cl_image_format format = { CL_RGBA, CL_UNSIGNED_INT32 }; const size_t imageSize = 256; - int src_flag_id; - cl_uint *initialData; - cl_uint *finalData; - MTdata d; + const size_t imageDataSize = imageSize * imageSize * 4 * sizeof(cl_uint); PASSIVE_REQUIRE_IMAGE_SUPPORT( deviceID ) - initialData = (cl_uint*)malloc(imageSize * imageSize * 4 *sizeof(cl_uint)); - finalData = (cl_uint*)malloc(imageSize * imageSize * 4 *sizeof(cl_uint)); + BufferOwningPtr hostPtrData{ malloc(imageDataSize) }; + BufferOwningPtr referenceData{ malloc(imageDataSize) }; + BufferOwningPtr finalData{malloc(imageDataSize)}; - if( !is_image_format_supported( context, CL_MEM_READ_ONLY, CL_MEM_OBJECT_IMAGE2D, &format ) ) - { - log_error( "ERROR: Test requires basic OpenCL 1.0 format CL_RGBA:CL_UNSIGNED_INT32, which is unsupported by this device!\n" ); - free(initialData); - free(finalData); - return -1; - } - - d = init_genrand( gRandomSeed ); - for (src_flag_id=0; src_flag_id < sizeof(flag_set)/sizeof(flag_set[0]); src_flag_id++) { + MTdataHolder d{gRandomSeed}; + for (int src_flag_id=0; src_flag_id < ARRAY_SIZE(flag_set); src_flag_id++) { clMemWrapper memObject; log_info("Testing with cl_mem_flags src: %s\n", flag_set_names[src_flag_id]); - generate_random_data( kUInt, (unsigned int)( imageSize * imageSize ), d, initialData ); + generate_random_data(kUInt, (unsigned int)(imageSize * imageSize), d, + hostPtrData); + memcpy(referenceData, hostPtrData, imageDataSize); - if ((flag_set[src_flag_id] & CL_MEM_USE_HOST_PTR) || (flag_set[src_flag_id] & CL_MEM_COPY_HOST_PTR)) - memObject = create_image_2d( context, CL_MEM_READ_WRITE | flag_set[src_flag_id], &format, - imageSize, imageSize, 0, initialData, &error ); - else - memObject = create_image_2d( context, CL_MEM_READ_WRITE | flag_set[src_flag_id], &format, - imageSize, imageSize, 0, NULL, &error ); + cl_mem_flags flags = flag_set[src_flag_id]; + bool hasHostPtr = (flags & CL_MEM_USE_HOST_PTR) || (flags & CL_MEM_COPY_HOST_PTR); + void *hostPtr = nullptr; + if (hasHostPtr) hostPtr = hostPtrData; + memObject = create_image_2d(context, CL_MEM_READ_WRITE | flags, &format, + imageSize, imageSize, 0, hostPtr, &error ); test_error( error, "Unable to create testing buffer" ); - if (!(flag_set[src_flag_id] & CL_MEM_USE_HOST_PTR) && !(flag_set[src_flag_id] & CL_MEM_COPY_HOST_PTR)) { + if (!hasHostPtr) { size_t write_origin[3]={0,0,0}, write_region[3]={imageSize, imageSize, 1}; - error = clEnqueueWriteImage(queue, memObject, CL_TRUE, write_origin, write_region, NULL, NULL, initialData, 0, NULL, NULL); + error = + clEnqueueWriteImage(queue, memObject, CL_TRUE, write_origin, write_region, + 0, 0, hostPtrData, 0, NULL, NULL); test_error( error, "Unable to write to testing buffer" ); } @@ -194,9 +184,6 @@ int test_enqueue_map_image(cl_device_id deviceID, cl_context context, cl_command { print_error( error, "clEnqueueMapImage call failed" ); log_error( "\tOffset: %d,%d Region: %d,%d\n", (int)offset[0], (int)offset[1], (int)region[0], (int)region[1] ); - free(initialData); - free(finalData); - free_mtdata(d); return -1; } @@ -215,9 +202,11 @@ int test_enqueue_map_image(cl_device_id deviceID, cl_context context, cl_command mappedPtr[ ( y * rowPitch/sizeof(cl_uint) ) + x ] = value; // Also update the initial data array - value = initialData[ ( ( offset[ 1 ] + y ) * imageSize + offset[ 0 ] ) * 4 + x ]; + value = + referenceData[((offset[1] + y) * imageSize + offset[0]) * 4 + x]; value = spin - value; - initialData[ ( ( offset[ 1 ] + y ) * imageSize + offset[ 0 ] ) * 4 + x ] = value; + referenceData[((offset[1] + y) * imageSize + offset[0]) * 4 + x] = + value; } } @@ -233,22 +222,18 @@ int test_enqueue_map_image(cl_device_id deviceID, cl_context context, cl_command for( size_t q = 0; q < imageSize * imageSize * 4; q++ ) { - if( initialData[ q ] != finalData[ q ] ) - { - log_error( "ERROR: Sample %d (coord %d,%d) did not validate! Got %d, expected %d\n", (int)q, (int)( ( q / 4 ) % imageSize ), (int)( ( q / 4 ) / imageSize ), - (int)finalData[ q ], (int)initialData[ q ] ); - free(initialData); - free(finalData); - free_mtdata(d); - return -1; - } + if (referenceData[q] != finalData[q]) + { + log_error("ERROR: Sample %d (coord %d,%d) did not validate! Got " + "%d, expected %d\n", + (int)q, (int)((q / 4) % imageSize), + (int)((q / 4) / imageSize), (int)finalData[q], + (int)referenceData[q]); + return -1; + } } } // cl_mem_flags - free(initialData); - free(finalData); - free_mtdata(d); return 0; } - diff --git a/test_conformance/basic/test_enqueued_local_size.c b/test_conformance/basic/test_enqueued_local_size.cpp similarity index 59% rename from test_conformance/basic/test_enqueued_local_size.c rename to test_conformance/basic/test_enqueued_local_size.cpp index 371f9ac6..e3bce93b 100644 --- a/test_conformance/basic/test_enqueued_local_size.c +++ b/test_conformance/basic/test_enqueued_local_size.cpp @@ -13,14 +13,14 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include #include #include #include -#include "../../test_common/harness/rounding_mode.h" +#include "harness/rounding_mode.h" #include "procs.h" @@ -74,14 +74,41 @@ test_enqueued_local_size(cl_device_id device, cl_context context, cl_command_que size_t localsize[2]; int err; + // For an OpenCL-3.0 device that does not support non-uniform work-groups + // we cannot enqueue local sizes which do not divide the global dimensions + // but we can still run the test checking that get_enqueued_local_size == + // get_local_size. + bool use_uniform_work_groups{ false }; + if (get_device_cl_version(device) >= Version(3, 0)) + { + cl_bool areNonUniformWorkGroupsSupported = false; + err = clGetDeviceInfo(device, CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT, + sizeof(areNonUniformWorkGroupsSupported), + &areNonUniformWorkGroupsSupported, nullptr); + test_error_ret(err, "clGetDeviceInfo failed.", TEST_FAIL); + + if (CL_FALSE == areNonUniformWorkGroupsSupported) + { + log_info("Non-uniform work group sizes are not supported, " + "enqueuing with uniform workgroups\n"); + use_uniform_work_groups = true; + } + } + output_ptr = (int*)malloc(2 * sizeof(int)); streams = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), 2*sizeof(int), NULL, &err); test_error( err, "clCreateBuffer failed."); - err = create_single_kernel_helper_with_build_options(context, &program[0], &kernel[0], 1, &enqueued_local_size_1d_code, "test_enqueued_local_size_1d", "-cl-std=CL2.0"); + std::string cl_std = "-cl-std=CL"; + cl_std += (get_device_cl_version(device) == Version(3, 0)) ? "3.0" : "2.0"; + err = create_single_kernel_helper_with_build_options( + context, &program[0], &kernel[0], 1, &enqueued_local_size_1d_code, + "test_enqueued_local_size_1d", cl_std.c_str()); test_error( err, "create_single_kernel_helper failed"); - err = create_single_kernel_helper_with_build_options(context, &program[1], &kernel[1], 1, &enqueued_local_size_2d_code, "test_enqueued_local_size_2d", "-cl-std=CL2.0"); + err = create_single_kernel_helper_with_build_options( + context, &program[1], &kernel[1], 1, &enqueued_local_size_2d_code, + "test_enqueued_local_size_2d", cl_std.c_str()); test_error( err, "create_single_kernel_helper failed"); err = clSetKernelArg(kernel[0], 0, sizeof streams, &streams); @@ -91,8 +118,28 @@ test_enqueued_local_size(cl_device_id device, cl_context context, cl_command_que globalsize[0] = (size_t)num_elements; globalsize[1] = (size_t)num_elements; - localsize[0] = 16; - localsize[1] = 11; + + size_t max_wgs; + err = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_GROUP_SIZE, sizeof(max_wgs), &max_wgs, NULL); + test_error( err, "clGetDeviceInfo failed."); + + localsize[0] = MIN(16, max_wgs); + localsize[1] = MIN(11, max_wgs / localsize[0]); + // If we need to use uniform workgroups because non-uniform workgroups are + // not supported, round up to the next global size that is divisible by the + // local size. + if (use_uniform_work_groups) + { + if (globalsize[0] % localsize[0]) + { + globalsize[0] += (localsize[0] - (globalsize[0] % localsize[0])); + } + if (globalsize[1] % localsize[1]) + { + globalsize[1] += (localsize[1] - (globalsize[1] % localsize[1])); + } + } + err = clEnqueueNDRangeKernel(queue, kernel[1], 2, NULL, globalsize, localsize, 0, NULL, NULL); test_error( err, "clEnqueueNDRangeKernel failed."); @@ -103,6 +150,10 @@ test_enqueued_local_size(cl_device_id device, cl_context context, cl_command_que globalsize[0] = (size_t)num_elements; localsize[0] = 9; + if (use_uniform_work_groups && (globalsize[0] % localsize[0])) + { + globalsize[0] += (localsize[0] - (globalsize[0] % localsize[0])); + } err = clEnqueueNDRangeKernel(queue, kernel[1], 1, NULL, globalsize, localsize, 0, NULL, NULL); test_error( err, "clEnqueueNDRangeKernel failed."); diff --git a/test_conformance/basic/test_explicit_s2v.cpp b/test_conformance/basic/test_explicit_s2v.cpp index 6da587cc..34e7da9c 100644 --- a/test_conformance/basic/test_explicit_s2v.cpp +++ b/test_conformance/basic/test_explicit_s2v.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -23,8 +23,8 @@ #include "procs.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/conversions.h" +#include "harness/typeWrappers.h" #define DECLARE_S2V_IDENT_KERNEL(srctype,dsttype,size) \ "__kernel void test_conversion(__global " srctype " *sourceValues, __global " dsttype #size " *destValues )\n" \ @@ -237,19 +237,6 @@ int test_explicit_s2v_function_set(cl_device_id deviceID, cl_context context, cl return failed; } -int test_explicit_s2v_bool(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - log_info( "NOTE: Boolean vectors not defined in OpenCL 1.0. Skipping test.\n" ); - return 0; -#if 0 - bool data[128]; - - generate_random_data( kBool, 128, data ); - - return test_explicit_s2v_function_set( deviceID, context, queue, kBool, 128, data ); -#endif -} - int test_explicit_s2v_char(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) { char data[128]; diff --git a/test_conformance/basic/test_float2int.c b/test_conformance/basic/test_float2int.cpp similarity index 98% rename from test_conformance/basic/test_float2int.c rename to test_conformance/basic/test_float2int.cpp index 55411728..b6af322c 100644 --- a/test_conformance/basic/test_float2int.c +++ b/test_conformance/basic/test_float2int.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/basic/test_fpmath_float.c b/test_conformance/basic/test_fpmath_float.cpp similarity index 97% rename from test_conformance/basic/test_fpmath_float.c rename to test_conformance/basic/test_fpmath_float.cpp index 7c395fc0..4ed81cc7 100644 --- a/test_conformance/basic/test_fpmath_float.c +++ b/test_conformance/basic/test_fpmath_float.cpp @@ -13,14 +13,14 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include #include #include #include -#include "../../test_common/harness/rounding_mode.h" +#include "harness/rounding_mode.h" #include "procs.h" @@ -132,7 +132,6 @@ test_fpmath_float(cl_device_id device, cl_context context, cl_command_queue queu err = clGetDeviceInfo( device, CL_DEVICE_SINGLE_FP_CONFIG, sizeof( single_config ), &single_config, NULL ); if (err) { log_error("clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed: %d", err); - test_finish(); return -1; } //If we only support rtz mode @@ -144,13 +143,11 @@ test_fpmath_float(cl_device_id device, cl_context context, cl_command_queue queu if( err ) { log_error("clGetDeviceInfo for CL_DEVICE_PROFILE failed: %d", err); - test_finish(); return -1; } if( 0 != strcmp( profile, "EMBEDDED_PROFILE")) { log_error( "FAILURE: Device doesn't support CL_FP_ROUND_TO_NEAREST and isn't EMBEDDED_PROFILE\n" ); - test_finish(); return -1; } diff --git a/test_conformance/basic/test_fpmath_float2.c b/test_conformance/basic/test_fpmath_float2.cpp similarity index 97% rename from test_conformance/basic/test_fpmath_float2.c rename to test_conformance/basic/test_fpmath_float2.cpp index 20747bc3..a964f6a4 100644 --- a/test_conformance/basic/test_fpmath_float2.c +++ b/test_conformance/basic/test_fpmath_float2.cpp @@ -13,14 +13,14 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include #include #include #include -#include "../../test_common/harness/rounding_mode.h" +#include "harness/rounding_mode.h" #include "procs.h" @@ -132,7 +132,6 @@ test_fpmath_float2(cl_device_id device, cl_context context, cl_command_queue que err = clGetDeviceInfo( device, CL_DEVICE_SINGLE_FP_CONFIG, sizeof( single_config ), &single_config, NULL ); if (err) { log_error("clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed: %d", err); - test_finish(); return -1; } //If we only support rtz mode @@ -144,13 +143,11 @@ test_fpmath_float2(cl_device_id device, cl_context context, cl_command_queue que if( err ) { log_error("clGetDeviceInfo for CL_DEVICE_PROFILE failed: %d", err); - test_finish(); return -1; } if( 0 != strcmp( profile, "EMBEDDED_PROFILE")) { log_error( "FAILURE: Device doesn't support CL_FP_ROUND_TO_NEAREST and isn't EMBEDDED_PROFILE\n" ); - test_finish(); return -1; } diff --git a/test_conformance/basic/test_fpmath_float4.c b/test_conformance/basic/test_fpmath_float4.cpp similarity index 97% rename from test_conformance/basic/test_fpmath_float4.c rename to test_conformance/basic/test_fpmath_float4.cpp index 7dee498c..275b4f37 100644 --- a/test_conformance/basic/test_fpmath_float4.c +++ b/test_conformance/basic/test_fpmath_float4.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -23,7 +23,7 @@ #include "procs.h" -#include "../../test_common/harness/rounding_mode.h" +#include "harness/rounding_mode.h" const char *fpadd4_kernel_code = "__kernel void test_fpadd4(__global float4 *srcA, __global float4 *srcB, __global float4 *dst)\n" @@ -132,7 +132,6 @@ test_fpmath_float4(cl_device_id device, cl_context context, cl_command_queue que err = clGetDeviceInfo( device, CL_DEVICE_SINGLE_FP_CONFIG, sizeof( single_config ), &single_config, NULL ); if (err) { log_error("clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed: %d", err); - test_finish(); return -1; } //If we only support rtz mode @@ -144,13 +143,11 @@ test_fpmath_float4(cl_device_id device, cl_context context, cl_command_queue que if( err ) { log_error("clGetDeviceInfo for CL_DEVICE_PROFILE failed: %d", err); - test_finish(); return -1; } if( 0 != strcmp( profile, "EMBEDDED_PROFILE")) { log_error( "FAILURE: Device doesn't support CL_FP_ROUND_TO_NEAREST and isn't EMBEDDED_PROFILE\n" ); - test_finish(); return -1; } diff --git a/test_conformance/basic/test_get_linear_ids.cpp b/test_conformance/basic/test_get_linear_ids.cpp index fba200a2..3496fd0b 100644 --- a/test_conformance/basic/test_get_linear_ids.cpp +++ b/test_conformance/basic/test_get_linear_ids.cpp @@ -59,7 +59,8 @@ test_get_linear_ids(cl_device_id device, cl_context context, cl_command_queue qu // Create the kernel - error = create_single_kernel_helper_with_build_options(context, &program, &kernel, 1, linear_ids_source, "test_linear_ids", "-cl-std=CL2.0"); + error = create_single_kernel_helper(context, &program, &kernel, 1, + linear_ids_source, "test_linear_ids"); if (error) return error; diff --git a/test_conformance/basic/test_global_linear_id.c b/test_conformance/basic/test_global_linear_id.cpp similarity index 88% rename from test_conformance/basic/test_global_linear_id.c rename to test_conformance/basic/test_global_linear_id.cpp index 159d5956..b14b3bbb 100644 --- a/test_conformance/basic/test_global_linear_id.c +++ b/test_conformance/basic/test_global_linear_id.cpp @@ -13,14 +13,14 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include #include #include #include -#include "../../test_common/harness/rounding_mode.h" +#include "harness/rounding_mode.h" #include "procs.h" @@ -80,9 +80,13 @@ test_global_linear_id(cl_device_id device, cl_context context, cl_command_queue streams = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), length*sizeof(int), NULL, &err); test_error( err, "clCreateBuffer failed."); - err = create_single_kernel_helper_with_build_options(context, &program[0], &kernel[0], 1, &global_linear_id_1d_code, "test_global_linear_id_1d", "-cl-std=CL2.0"); + err = create_single_kernel_helper(context, &program[0], &kernel[0], 1, + &global_linear_id_1d_code, + "test_global_linear_id_1d"); test_error( err, "create_single_kernel_helper failed"); - err = create_single_kernel_helper_with_build_options(context, &program[1], &kernel[1], 1, &global_linear_id_2d_code, "test_global_linear_id_2d", "-cl-std=CL2.0"); + err = create_single_kernel_helper(context, &program[1], &kernel[1], 1, + &global_linear_id_2d_code, + "test_global_linear_id_2d"); test_error( err, "create_single_kernel_helper failed"); err = clSetKernelArg(kernel[0], 0, sizeof streams, &streams); diff --git a/test_conformance/basic/test_hiloeo.c b/test_conformance/basic/test_hiloeo.cpp similarity index 99% rename from test_conformance/basic/test_hiloeo.c rename to test_conformance/basic/test_hiloeo.cpp index c9777ec8..4cdf2ac7 100644 --- a/test_conformance/basic/test_hiloeo.c +++ b/test_conformance/basic/test_hiloeo.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/basic/test_hostptr.c b/test_conformance/basic/test_hostptr.cpp similarity index 99% rename from test_conformance/basic/test_hostptr.c rename to test_conformance/basic/test_hostptr.cpp index 0719552f..f40cb698 100644 --- a/test_conformance/basic/test_hostptr.c +++ b/test_conformance/basic/test_hostptr.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/basic/test_if.c b/test_conformance/basic/test_if.cpp similarity index 98% rename from test_conformance/basic/test_if.c rename to test_conformance/basic/test_if.cpp index 0e40cf07..c92ec322 100644 --- a/test_conformance/basic/test_if.c +++ b/test_conformance/basic/test_if.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/basic/test_image_multipass.c b/test_conformance/basic/test_image_multipass.c deleted file mode 100644 index fa828767..00000000 --- a/test_conformance/basic/test_image_multipass.c +++ /dev/null @@ -1,654 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include -#include - - -#include "procs.h" - -static const char *image_to_image_kernel_integer_coord_code = -"\n" -"__kernel void image_to_image_copy(read_only image2d_t srcimg, write_only image2d_t dstimg, sampler_t sampler)\n" -"{\n" -" int tid_x = get_global_id(0);\n" -" int tid_y = get_global_id(1);\n" -" float4 color;\n" -"\n" -" color = read_imagef(srcimg, sampler, (int2)(tid_x, tid_y));\n" -" write_imagef(dstimg, (int2)(tid_x, tid_y), color);\n" -"\n" -"}\n"; - -static const char *image_to_image_kernel_float_coord_code = -"\n" -"__kernel void image_to_image_copy(read_only image2d_t srcimg, write_only image2d_t dstimg, sampler_t sampler)\n" -"{\n" -" int tid_x = get_global_id(0);\n" -" int tid_y = get_global_id(1);\n" -" float4 color;\n" -"\n" -" color = read_imagef(srcimg, sampler, (float2)((float)tid_x, (float)tid_y));\n" -" write_imagef(dstimg, (int2)(tid_x, tid_y), color);\n" -"\n" -"}\n"; - - -static const char *image_sum_kernel_integer_coord_code = -"\n" -"__kernel void image_sum(read_only image2d_t srcimg0, read_only image2d_t srcimg1, write_only image2d_t dstimg, sampler_t sampler)\n" -"{\n" -" int tid_x = get_global_id(0);\n" -" int tid_y = get_global_id(1);\n" -" float4 color0;\n" -" float4 color1;\n" -"\n" -" color0 = read_imagef(srcimg0, sampler, (int2)(tid_x, tid_y));\n" -" color1 = read_imagef(srcimg1, sampler, (int2)(tid_x, tid_y));\n" -" write_imagef(dstimg, (int2)(tid_x, tid_y), color0 + color1);\n" -"\n" -"}\n"; - - -static const char *image_sum_kernel_float_coord_code = -"\n" -"__kernel void image_sum(read_only image2d_t srcimg0, read_only image2d_t srcimg1, write_only image2d_t dstimg, sampler_t sampler)\n" -"{\n" -" int tid_x = get_global_id(0);\n" -" int tid_y = get_global_id(1);\n" -" float4 color0;\n" -" float4 color1;\n" -"\n" -" color0 = read_imagef(srcimg0, sampler, (float2)((float)tid_x, (float)tid_y));\n" -" color1 = read_imagef(srcimg1, sampler, (float2)((float)tid_x, (float)tid_y));\n" -" write_imagef(dstimg,(int2)(tid_x, tid_y), color0 + color1);\n" -"\n" -"}\n"; - - -static unsigned char * -generate_initial_byte_image(int w, int h, int num_elements, unsigned char value) -{ - unsigned char *ptr = (unsigned char*)malloc(w * h * num_elements); - int i; - - for (i = 0; i < w*h*num_elements; i++) - ptr[i] = value; - - return ptr; -} - -static unsigned char * -generate_expected_byte_image(unsigned char **input_data, int num_inputs, int w, int h, int num_elements) -{ - unsigned char *ptr = (unsigned char*)malloc(w * h * num_elements); - int i; - - for (i = 0; i < w*h*num_elements; i++) - { - int j; - ptr[i] = 0; - for (j = 0; j < num_inputs; j++) - { - unsigned char *input = *(input_data + j); - ptr[i] += input[i]; - } - } - - return ptr; -} - - -static unsigned char * -generate_byte_image(int w, int h, int num_elements, MTdata d) -{ - unsigned char *ptr = (unsigned char*)malloc(w * h * num_elements); - int i; - - for (i = 0; i < w*h*num_elements; i++) - ptr[i] = (unsigned char)genrand_int32(d) & 31; - - return ptr; -} - -static int -verify_byte_image(unsigned char *image, unsigned char *outptr, int w, int h, int num_elements) -{ - int i; - - for (i = 0; i < w*h*num_elements; i++) - { - if (outptr[i] != image[i]) - { - return -1; - } - } - return 0; -} - -int -test_image_multipass_integer_coord(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) -{ - int img_width = 512; - int img_height = 512; - cl_image_format img_format; - - int num_input_streams = 8; - cl_mem *input_streams; - cl_mem accum_streams[2]; - unsigned char *expected_output; - unsigned char *output_ptr; - cl_kernel kernel[2]; - int err; - - PASSIVE_REQUIRE_IMAGE_SUPPORT( device ) - - img_format.image_channel_order = CL_RGBA; - img_format.image_channel_data_type = CL_UNORM_INT8; - - expected_output = (unsigned char*)malloc(sizeof(unsigned char) * 4 * img_width * img_height); - output_ptr = (unsigned char*)malloc(sizeof(unsigned char) * 4 * img_width * img_height); - - // Create the accum images with initial data. - { - unsigned char *initial_data; - cl_mem_flags flags; - - initial_data = generate_initial_byte_image(img_width, img_height, 4, 0xF0); - flags = (cl_mem_flags)(CL_MEM_READ_WRITE); - - accum_streams[0] = create_image_2d(context, flags, &img_format, img_width, img_height, 0, NULL, NULL); - if (!accum_streams[0]) - { - log_error("create_image_2d failed\n"); - free(expected_output); - free(output_ptr); - return -1; - } - - size_t origin[3] = {0, 0, 0}, region[3] = {img_width, img_height, 1}; - err = clEnqueueWriteImage(queue, accum_streams[0], CL_TRUE, - origin, region, 0, 0, - initial_data, 0, NULL, NULL); - if (err) - { - log_error("clWriteImage failed: %d\n", err); - free(expected_output); - free(output_ptr); - return -1; - } - - accum_streams[1] = create_image_2d(context, flags, &img_format, img_width, img_height, 0, NULL, NULL); - if (!accum_streams[1]) - { - log_error("create_image_2d failed\n"); - free(expected_output); - free(output_ptr); - return -1; - } - err = clEnqueueWriteImage(queue, accum_streams[1], CL_TRUE, - origin, region, 0, 0, - initial_data, 0, NULL, NULL); - if (err) - { - log_error("clWriteImage failed: %d\n", err); - free(expected_output); - free(output_ptr); - return -1; - } - - free(initial_data); - } - - // Set up the input data. - { - cl_mem_flags flags; - unsigned char **input_data = (unsigned char **)malloc(sizeof(unsigned char*) * num_input_streams); - MTdata d; - - input_streams = (cl_mem*)malloc(sizeof(cl_mem) * num_input_streams); - flags = (cl_mem_flags)(CL_MEM_READ_WRITE); - - int i; - d = init_genrand( gRandomSeed ); - for ( i = 0; i < num_input_streams; i++) - { - input_data[i] = generate_byte_image(img_width, img_height, 4, d); - input_streams[i] = create_image_2d(context, flags, &img_format, img_width, img_height, 0, NULL, NULL); - if (!input_streams[i]) - { - log_error("create_image_2d failed\n"); - free_mtdata(d); - free(expected_output); - free(output_ptr); - return -1; - } - - size_t origin[3] = {0, 0, 0}, region[3] = {img_width, img_height, 1}; - err = clEnqueueWriteImage(queue, input_streams[i], CL_TRUE, - origin, region, 0, 0, - input_data[i], 0, NULL, NULL); - if (err) - { - log_error("clWriteImage failed: %d\n", err); - free_mtdata(d); - free(expected_output); - free(output_ptr); - free(input_streams); - return -1; - } - - - } - free_mtdata(d); d = NULL; - expected_output = generate_expected_byte_image(input_data, num_input_streams, img_width, img_height, 4); - for ( i = 0; i < num_input_streams; i++) - { - free(input_data[i]); - } - free( input_data ); - } - - // Set up the kernels. - { - cl_program program[4]; - - err = create_single_kernel_helper(context, &program[0], &kernel[0], 1, &image_to_image_kernel_integer_coord_code, "image_to_image_copy"); - if (err) - { - log_error("Failed to create kernel 0: %d\n", err); - return -1; - } - err = create_single_kernel_helper(context, &program[1], &kernel[1], 1, &image_sum_kernel_integer_coord_code, "image_sum"); - if (err) - { - log_error("Failed to create kernel 1: %d\n", err); - return -1; - } - clReleaseProgram(program[0]); - clReleaseProgram(program[1]); - } - - cl_sampler_properties properties[] = { - CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE, - CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP_TO_EDGE, - CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST, - 0 }; - cl_sampler sampler = clCreateSamplerWithProperties(context, properties, &err); - test_error(err, "clCreateSamplerWithProperties failed"); - - { - size_t threads[3] = {0, 0, 0}; - threads[0] = (size_t)img_width; - threads[1] = (size_t)img_height; - int i; - - { - cl_mem accum_input; - cl_mem accum_output; - - err = clSetKernelArg(kernel[0], 0, sizeof input_streams[0], &input_streams[0]); - err |= clSetKernelArg(kernel[0], 1, sizeof accum_streams[0], &accum_streams[0]); - err |= clSetKernelArg(kernel[0], 2, sizeof sampler, &sampler); - if (err != CL_SUCCESS) - { - log_error("clSetKernelArgs failed\n"); - return -1; - } - err = clEnqueueNDRangeKernel( queue, kernel[0], 2, NULL, threads, NULL, 0, NULL, NULL ); - if (err != CL_SUCCESS) - { - log_error("clEnqueueNDRangeKernel failed\n"); - return -1; - } - - for (i = 1; i < num_input_streams; i++) - { - accum_input = accum_streams[(i-1)%2]; - accum_output = accum_streams[i%2]; - - err = clSetKernelArg(kernel[1], 0, sizeof accum_input, &accum_input); - err |= clSetKernelArg(kernel[1], 1, sizeof input_streams[i], &input_streams[i]); - err |= clSetKernelArg(kernel[1], 2, sizeof accum_output, &accum_output); - err |= clSetKernelArg(kernel[1], 3, sizeof sampler, &sampler); - - if (err != CL_SUCCESS) - { - log_error("clSetKernelArgs failed\n"); - return -1; - } - err = clEnqueueNDRangeKernel( queue, kernel[1], 2, NULL, threads, NULL, 0, NULL, NULL ); - if (err != CL_SUCCESS) - { - log_error("clEnqueueNDRangeKernel failed\n"); - return -1; - } - } - - // Copy the last accum into the other one. - accum_input = accum_streams[(i-1)%2]; - accum_output = accum_streams[i%2]; - err = clSetKernelArg(kernel[0], 0, sizeof accum_input, &accum_input); - err |= clSetKernelArg(kernel[0], 1, sizeof accum_output, &accum_output); - if (err != CL_SUCCESS) - { - log_error("clSetKernelArgs failed\n"); - return -1; - } - err = clEnqueueNDRangeKernel( queue, kernel[0], 2, NULL, threads, NULL, 0, NULL, NULL ); - if (err != CL_SUCCESS) - { - log_error("clEnqueueNDRangeKernel failed\n"); - return -1; - } - - size_t origin[3] = {0, 0, 0}, region[3] = {img_width, img_height, 1}; - err = clEnqueueReadImage(queue, accum_output, CL_TRUE, - origin, region, 0, 0, - (void *)output_ptr, 0, NULL, NULL); - if (err != CL_SUCCESS) - { - log_error("clReadImage failed\n"); - return -1; - } - err = verify_byte_image(expected_output, output_ptr, img_width, img_height, 4); - if (err) - { - log_error("IMAGE_MULTIPASS test failed.\n"); - } - else - { - log_info("IMAGE_MULTIPASS test passed\n"); - } - } - - clReleaseSampler(sampler); - } - - - // cleanup - clReleaseMemObject(accum_streams[0]); - clReleaseMemObject(accum_streams[1]); - { - int i; - for (i = 0; i < num_input_streams; i++) - { - clReleaseMemObject(input_streams[i]); - } - } - free(input_streams); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - free(expected_output); - free(output_ptr); - - return err; -} - -int -test_image_multipass_float_coord(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) -{ - int img_width = 512; - int img_height = 512; - cl_image_format img_format; - - int num_input_streams = 8; - cl_mem *input_streams; - cl_mem accum_streams[2]; - unsigned char *expected_output; - unsigned char *output_ptr; - cl_kernel kernel[2]; - int err; - - PASSIVE_REQUIRE_IMAGE_SUPPORT( device ) - - img_format.image_channel_order = CL_RGBA; - img_format.image_channel_data_type = CL_UNORM_INT8; - - output_ptr = (unsigned char*)malloc(sizeof(unsigned char) * 4 * img_width * img_height); - - // Create the accum images with initial data. - { - unsigned char *initial_data; - cl_mem_flags flags; - - initial_data = generate_initial_byte_image(img_width, img_height, 4, 0xF0); - flags = (cl_mem_flags)(CL_MEM_READ_WRITE); - - accum_streams[0] = create_image_2d(context, flags, &img_format, img_width, img_height, 0, NULL, NULL); - if (!accum_streams[0]) - { - log_error("create_image_2d failed\n"); - return -1; - } - - size_t origin[3] = {0, 0, 0}, region[3] = {img_width, img_height, 1}; - err = clEnqueueWriteImage(queue, accum_streams[0], CL_TRUE, - origin, region, 0, 0, - initial_data, 0, NULL, NULL); - if (err) - { - log_error("clWriteImage failed: %d\n", err); - return -1; - } - - accum_streams[1] = create_image_2d(context, flags, &img_format, img_width, img_height, 0, NULL, NULL); - if (!accum_streams[1]) - { - log_error("create_image_2d failed\n"); - return -1; - } - err = clEnqueueWriteImage(queue, accum_streams[1], CL_TRUE, - origin, region, 0, 0, - initial_data, 0, NULL, NULL); - if (err) - { - log_error("clWriteImage failed: %d\n", err); - return -1; - } - - free(initial_data); - } - - // Set up the input data. - { - cl_mem_flags flags; - unsigned char **input_data = (unsigned char **)malloc(sizeof(unsigned char*) * num_input_streams); - MTdata d; - - input_streams = (cl_mem*)malloc(sizeof(cl_mem) * num_input_streams); - flags = (cl_mem_flags)(CL_MEM_READ_WRITE); - - int i; - d = init_genrand( gRandomSeed ); - for ( i = 0; i < num_input_streams; i++) - { - input_data[i] = generate_byte_image(img_width, img_height, 4, d); - input_streams[i] = create_image_2d(context, flags, &img_format, img_width, img_height, 0, NULL, NULL); - if (!input_streams[i]) - { - log_error("create_image_2d failed\n"); - free(input_data); - free(input_streams); - return -1; - } - - size_t origin[3] = {0, 0, 0}, region[3] = {img_width, img_height, 1}; - err = clEnqueueWriteImage(queue, input_streams[i], CL_TRUE, - origin, region, 0, 0, - input_data[i], 0, NULL, NULL); - if (err) - { - log_error("clWriteImage failed: %d\n", err); - free(input_data); - free(input_streams); - return -1; - } - } - free_mtdata(d); d = NULL; - expected_output = generate_expected_byte_image(input_data, num_input_streams, img_width, img_height, 4); - for ( i = 0; i < num_input_streams; i++) - { - free(input_data[i]); - } - free(input_data); - } - - // Set up the kernels. - { - cl_program program[2]; - - err = create_single_kernel_helper(context, &program[0], &kernel[0], 1, &image_to_image_kernel_float_coord_code, "image_to_image_copy"); - if (err) - { - log_error("Failed to create kernel 2: %d\n", err); - return -1; - } - err = create_single_kernel_helper(context, &program[1], &kernel[1], 1, &image_sum_kernel_float_coord_code, "image_sum"); - if (err) - { - log_error("Failed to create kernel 3: %d\n", err); - return -1; - } - - clReleaseProgram(program[0]); - clReleaseProgram(program[1]); - } - - cl_sampler_properties properties[] = { - CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE, - CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP_TO_EDGE, - CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST, - 0 }; - cl_sampler sampler = clCreateSamplerWithProperties(context, properties, &err); - test_error(err, "clCreateSamplerWithProperties failed"); - - { - size_t threads[3] = {0, 0, 0}; - threads[0] = (size_t)img_width; - threads[1] = (size_t)img_height; - int i; - - { - cl_mem accum_input; - cl_mem accum_output; - - err = clSetKernelArg(kernel[0], 0, sizeof input_streams[0], &input_streams[0]); - err |= clSetKernelArg(kernel[0], 1, sizeof accum_streams[0], &accum_streams[0]); - err |= clSetKernelArg(kernel[0], 2, sizeof sampler, &sampler); - if (err != CL_SUCCESS) - { - log_error("clSetKernelArgs failed\n"); - return -1; - } - err = clEnqueueNDRangeKernel( queue, kernel[0], 2, NULL, threads, NULL, 0, NULL, NULL ); - if (err != CL_SUCCESS) - { - log_error("clEnqueueNDRangeKernel failed\n"); - return -1; - } - - for (i = 1; i < num_input_streams; i++) - { - accum_input = accum_streams[(i-1)%2]; - accum_output = accum_streams[i%2]; - - err = clSetKernelArg(kernel[1], 0, sizeof accum_input, &accum_input); - err |= clSetKernelArg(kernel[1], 1, sizeof input_streams[i], &input_streams[i]); - err |= clSetKernelArg(kernel[1], 2, sizeof accum_output, &accum_output); - err |= clSetKernelArg(kernel[1], 3, sizeof sampler, &sampler); - - if (err != CL_SUCCESS) - { - log_error("clSetKernelArgs failed\n"); - return -1; - } - err = clEnqueueNDRangeKernel( queue, kernel[1], 2, NULL, threads, NULL, 0, NULL, NULL ); - if (err != CL_SUCCESS) - { - log_error("clEnqueueNDRangeKernel failed\n"); - return -1; - } - } - - // Copy the last accum into the other one. - accum_input = accum_streams[(i-1)%2]; - accum_output = accum_streams[i%2]; - err = clSetKernelArg(kernel[0], 0, sizeof accum_input, &accum_input); - err |= clSetKernelArg(kernel[0], 1, sizeof accum_output, &accum_output); - if (err != CL_SUCCESS) - { - log_error("clSetKernelArgs failed\n"); - return -1; - } - err = clEnqueueNDRangeKernel( queue, kernel[0], 2, NULL, threads, NULL, 0, NULL, NULL ); - if (err != CL_SUCCESS) - { - log_error("clEnqueueNDRangeKernel failed\n"); - return -1; - } - - size_t origin[3] = {0, 0, 0}, region[3] = {img_width, img_height, 1}; - err = clEnqueueReadImage(queue, accum_output, CL_TRUE, - origin, region, 0, 0, - (void *)output_ptr, 0, NULL, NULL); - if (err != CL_SUCCESS) - { - log_error("clReadImage failed\n"); - return -1; - } - err = verify_byte_image(expected_output, output_ptr, img_width, img_height, 4); - if (err) - { - log_error("IMAGE_MULTIPASS test failed.\n"); - } - else - { - log_info("IMAGE_MULTIPASS test passed\n"); - } - } - - } - - - // cleanup - clReleaseSampler(sampler); - clReleaseMemObject(accum_streams[0]); - clReleaseMemObject(accum_streams[1]); - { - int i; - for (i = 0; i < num_input_streams; i++) - { - clReleaseMemObject(input_streams[i]); - } - } - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - free(expected_output); - free(output_ptr); - free(input_streams); - - return err; -} - - - - - diff --git a/test_conformance/compatibility/test_conformance/basic/test_image_multipass.c b/test_conformance/basic/test_image_multipass.cpp similarity index 99% rename from test_conformance/compatibility/test_conformance/basic/test_image_multipass.c rename to test_conformance/basic/test_image_multipass.cpp index 74a539c8..cd91a136 100644 --- a/test_conformance/compatibility/test_conformance/basic/test_image_multipass.c +++ b/test_conformance/basic/test_image_multipass.cpp @@ -13,9 +13,10 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include +#include #include #include #include diff --git a/test_conformance/basic/test_image_param.c b/test_conformance/basic/test_image_param.cpp similarity index 95% rename from test_conformance/basic/test_image_param.c rename to test_conformance/basic/test_image_param.cpp index e9e99fea..c8fc1b4a 100644 --- a/test_conformance/basic/test_image_param.c +++ b/test_conformance/basic/test_image_param.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -23,9 +23,9 @@ #include "procs.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/imageHelpers.h" -#include "../../test_common/harness/conversions.h" +#include "harness/typeWrappers.h" +#include "harness/imageHelpers.h" +#include "harness/conversions.h" static const char *param_kernel[] = { @@ -239,13 +239,8 @@ int test_image_param(cl_device_id device, cl_context context, cl_command_queue q test_error( error, "Unable to create testing kernel" ); // Also create a sampler to use for all the runs - cl_sampler_properties properties[] = { - CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE, - CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP_TO_EDGE, - CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST, - 0 }; - clSamplerWrapper sampler = clCreateSamplerWithProperties(context, properties, &error); - test_error(error, "clCreateSamplerWithProperties failed"); + clSamplerWrapper sampler = clCreateSampler(context, CL_FALSE, CL_ADDRESS_CLAMP_TO_EDGE, CL_FILTER_NEAREST, &error ); + test_error( error, "clCreateSampler failed" ); // Set up the arguments for each and queue for( i = 0, idx = 0; i < numSizes; i++ ) diff --git a/test_conformance/basic/test_image_r8.c b/test_conformance/basic/test_image_r8.c deleted file mode 100644 index 02bb8483..00000000 --- a/test_conformance/basic/test_image_r8.c +++ /dev/null @@ -1,183 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include -#include - - -#include "procs.h" - -static const char *r_uint8_kernel_code = -"__kernel void test_r_uint8(read_only image2d_t srcimg, __global unsigned char *dst, sampler_t sampler)\n" -"{\n" -" int tid_x = get_global_id(0);\n" -" int tid_y = get_global_id(1);\n" -" int indx = tid_y * get_image_width(srcimg) + tid_x;\n" -" uint4 color;\n" -"\n" -" color = read_imageui(srcimg, sampler, (int2)(tid_x, tid_y));\n" -" dst[indx] = (unsigned char)(color.x);\n" -"\n" -"}\n"; - - -static unsigned char * -generate_8bit_image(int w, int h, MTdata d) -{ - unsigned char *ptr = (unsigned char*)malloc(w * h * sizeof(unsigned char)); - int i; - - for (i=0; i +#include #include #include #include @@ -164,6 +165,7 @@ test_image_r8(cl_device_id device, cl_context context, cl_command_queue queue, i clReleaseMemObject(streams[1]); clReleaseKernel(kernel); clReleaseProgram(program); + clReleaseSampler(sampler); free(input_ptr); free(output_ptr); diff --git a/test_conformance/basic/test_imagearraycopy.c b/test_conformance/basic/test_imagearraycopy.cpp similarity index 99% rename from test_conformance/basic/test_imagearraycopy.c rename to test_conformance/basic/test_imagearraycopy.cpp index a361b6a4..4240466b 100644 --- a/test_conformance/basic/test_imagearraycopy.c +++ b/test_conformance/basic/test_imagearraycopy.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/basic/test_imagearraycopy3d.c b/test_conformance/basic/test_imagearraycopy3d.cpp similarity index 99% rename from test_conformance/basic/test_imagearraycopy3d.c rename to test_conformance/basic/test_imagearraycopy3d.cpp index 9bb595a1..e34aa7d9 100644 --- a/test_conformance/basic/test_imagearraycopy3d.c +++ b/test_conformance/basic/test_imagearraycopy3d.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/basic/test_imagecopy.c b/test_conformance/basic/test_imagecopy.cpp similarity index 99% rename from test_conformance/basic/test_imagecopy.c rename to test_conformance/basic/test_imagecopy.cpp index 258fe033..e74827d2 100644 --- a/test_conformance/basic/test_imagecopy.c +++ b/test_conformance/basic/test_imagecopy.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/basic/test_imagecopy3d.c b/test_conformance/basic/test_imagecopy3d.cpp similarity index 99% rename from test_conformance/basic/test_imagecopy3d.c rename to test_conformance/basic/test_imagecopy3d.cpp index 67af31f2..39ca7e67 100644 --- a/test_conformance/basic/test_imagecopy3d.c +++ b/test_conformance/basic/test_imagecopy3d.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/basic/test_imagedim.c b/test_conformance/basic/test_imagedim.c deleted file mode 100644 index aa8602db..00000000 --- a/test_conformance/basic/test_imagedim.c +++ /dev/null @@ -1,524 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include -#include - - -#include "procs.h" - -static const char *image_dim_kernel_code = -"\n" -"__kernel void test_image_dim(read_only image2d_t srcimg, write_only image2d_t dstimg, sampler_t sampler)\n" -"{\n" -" int tid_x = get_global_id(0);\n" -" int tid_y = get_global_id(1);\n" -" float4 color;\n" -"\n" -" color = read_imagef(srcimg, sampler, (int2)(tid_x, tid_y));\n" -" write_imagef(dstimg, (int2)(tid_x, tid_y), color);\n" -"\n" -"}\n"; - - -static unsigned char * -generate_8888_image(int w, int h, MTdata d) -{ - unsigned char *ptr = (unsigned char*)malloc(w * h * 4); - int i; - - for (i=0; i (cl_ulong)SIZE_MAX) { - max_mem_size = (cl_ulong)SIZE_MAX; - } - - cl_sampler_properties properties[] = { - CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE, - CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP_TO_EDGE, - CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST, - 0 }; - cl_sampler sampler = clCreateSamplerWithProperties(context, properties, &err); - test_error(err, "clCreateSamplerWithProperties failed"); - - max_img_width = (int)max_image2d_width; - max_img_height = (int)max_image2d_height; - - // determine max image dim we can allocate - assume RGBA image, 4 bytes per pixel, - // and we want to consume 1/4 of global memory (this is the minimum required to be - // supported by the spec) - max_mem_size /= 4; // use 1/4 - max_mem_size /= 4; // 4 bytes per pixel - max_img_dim = (int)sqrt((double)max_mem_size); - // convert to a power of 2 - { - unsigned int n = (unsigned int)max_img_dim; - unsigned int m = 0x80000000; - - // round-down to the nearest power of 2 - while (m > n) - m >>= 1; - - max_img_dim = (int)m; - } - - if (max_img_width > max_img_dim) - max_img_width = max_img_dim; - if (max_img_height > max_img_dim) - max_img_height = max_img_dim; - - log_info("Adjusted maximum image size to test is %d x %d, which is a max mem size of %gMB.\n", - max_img_width, max_img_height, (max_img_width*max_img_height*4)/(1024.0*1024.0)); - - d = init_genrand( gRandomSeed ); - input_ptr = generate_8888_image(max_img_width, max_img_height, d); - output_ptr = (unsigned char*)malloc(sizeof(unsigned char) * 4 * max_img_width * max_img_height); - - // test power of 2 width, height starting at 1 to 4K - for (i=1,i2=0; i<=max_img_height; i<<=1,i2++) - { - img_height = (1 << i2); - for (j=1,j2=0; j<=max_img_width; j<<=1,j2++) - { - img_width = (1 << j2); - - img_format.image_channel_order = CL_RGBA; - img_format.image_channel_data_type = CL_UNORM_INT8; - streams[0] = create_image_2d(context, (cl_mem_flags)(CL_MEM_READ_WRITE), &img_format, img_width, img_height, 0, NULL, NULL); - if (!streams[0]) - { - log_error("create_image_2d failed. width = %d, height = %d\n", img_width, img_height); - free(input_ptr); - free(output_ptr); - free_mtdata(d); - return -1; - } - img_format.image_channel_order = CL_RGBA; - img_format.image_channel_data_type = CL_UNORM_INT8; - streams[1] = create_image_2d(context, (cl_mem_flags)(CL_MEM_READ_WRITE), &img_format, img_width, img_height, 0, NULL, NULL); - if (!streams[1]) - { - log_error("create_image_2d failed. width = %d, height = %d\n", img_width, img_height); - clReleaseMemObject(streams[0]); - free(input_ptr); - free(output_ptr); - free_mtdata(d); - return -1; - } - - size_t origin[3] = {0,0,0}; - size_t region[3] = {img_width, img_height, 1}; - err = clEnqueueWriteImage(queue, streams[0], CL_FALSE, origin, region, 0, 0, input_ptr, 0, NULL, NULL); - if (err != CL_SUCCESS) - { - log_error("clWriteImage failed\n"); - clReleaseMemObject(streams[0]); - clReleaseMemObject(streams[1]); - free(input_ptr); - free(output_ptr); - free_mtdata(d); - return -1; - } - - err = clSetKernelArg(kernel, 0, sizeof streams[0], &streams[0]); - err |= clSetKernelArg(kernel, 1, sizeof streams[1], &streams[1]); - err |= clSetKernelArg(kernel, 2, sizeof sampler, &sampler); - if (err != CL_SUCCESS) - { - log_error("clSetKernelArgs failed\n"); - clReleaseMemObject(streams[0]); - clReleaseMemObject(streams[1]); - free(input_ptr); - free(output_ptr); - free_mtdata(d); - return -1; - } - - threads[0] = (size_t)img_width; - threads[1] = (size_t)img_height; - log_info("Testing image dimensions %d x %d with local threads NULL.\n", img_width, img_height); - err = clEnqueueNDRangeKernel( queue, kernel, 2, NULL, threads, NULL, 0, NULL, NULL ); - if (err != CL_SUCCESS) - { - log_error("clEnqueueNDRangeKernel failed\n"); - log_error("Image Dimension test failed. image width = %d, image height = %d, local NULL\n", - img_width, img_height); - clReleaseMemObject(streams[0]); - clReleaseMemObject(streams[1]); - free(input_ptr); - free(output_ptr); - free_mtdata(d); - return -1; - } - err = clEnqueueReadImage(queue, streams[1], CL_TRUE, origin, region, 0, 0, output_ptr, 0, NULL, NULL); - if (err != CL_SUCCESS) - { - log_error("clReadImage failed\n"); - log_error("Image Dimension test failed. image width = %d, image height = %d, local NULL\n", - img_width, img_height); - clReleaseMemObject(streams[0]); - clReleaseMemObject(streams[1]); - free(input_ptr); - free(output_ptr); - free_mtdata(d); - return -1; - } - err = verify_8888_image(input_ptr, output_ptr, img_width, img_height); - if (err) - { - total_errors++; - log_error("Image Dimension test failed. image width = %d, image height = %d\n", img_width, img_height); - } - - clReleaseMemObject(streams[0]); - clReleaseMemObject(streams[1]); - } - } - - // cleanup - free(input_ptr); - free(output_ptr); - free_mtdata(d); - clReleaseSampler(sampler); - clReleaseKernel(kernel); - clReleaseProgram(program); - - return total_errors; -} - - - -int -test_imagedim_non_pow2(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems) -{ - cl_mem streams[2]; - cl_image_format img_format; - unsigned char *input_ptr, *output_ptr; - cl_program program; - cl_kernel kernel; - size_t threads[2], local_threads[2]; - cl_ulong max_mem_size; - int img_width, max_img_width; - int img_height, max_img_height; - int max_img_dim; - int i, j, i2, j2, err=0; - size_t max_image2d_width, max_image2d_height; - int total_errors = 0; - size_t max_local_workgroup_size[3]; - MTdata d; - - PASSIVE_REQUIRE_IMAGE_SUPPORT( device ) - - err = create_single_kernel_helper( context, &program, &kernel, 1, &image_dim_kernel_code, "test_image_dim" ); - if (err) - { - log_error("create_program_and_kernel_with_sources failed\n"); - return -1; - } - - size_t work_group_size = 0; - err = clGetKernelWorkGroupInfo(kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof(work_group_size), &work_group_size, NULL); - test_error(err, "clGetKerenlWorkgroupInfo failed for CL_KERNEL_WORK_GROUP_SIZE"); - - err = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(max_local_workgroup_size), max_local_workgroup_size, NULL); - test_error(err, "clGetDeviceInfo failed for CL_DEVICE_MAX_WORK_ITEM_SIZES"); - - err = clGetDeviceInfo(device, CL_DEVICE_GLOBAL_MEM_SIZE,sizeof(max_mem_size), &max_mem_size, NULL); - if (err) - { - log_error("clGetDeviceInfo for CL_DEVICE_GLOBAL_MEM_SIZE failed (%d)\n", err); - return -1; - } - err = clGetDeviceInfo(device, CL_DEVICE_IMAGE2D_MAX_WIDTH, sizeof(max_image2d_width), &max_image2d_width, NULL); - if (err) - { - log_error("clGetDeviceInfo for CL_DEVICE_IMAGE2D_MAX_WIDTH failed (%d)\n", err); - return -1; - } - err = clGetDeviceInfo(device, CL_DEVICE_IMAGE2D_MAX_HEIGHT, sizeof(max_image2d_width), &max_image2d_height, NULL); - if (err) - { - log_error("clGetDeviceInfo for CL_DEVICE_IMAGE2D_MAX_HEIGHT failed (%d)\n", err); - return -1; - } - log_info("Device reported max image sizes of %lu x %lu, and max mem size of %gMB.\n", - max_image2d_width, max_image2d_height, max_mem_size/(1024.0*1024.0)); - - cl_sampler_properties properties[] = { - CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE, - CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP_TO_EDGE, - CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST, - 0 }; - cl_sampler sampler = clCreateSamplerWithProperties(context, properties, &err); - test_error(err, "clCreateSamplerWithProperties failed"); - - max_img_width = (int)max_image2d_width; - max_img_height = (int)max_image2d_height; - - if (max_mem_size > (cl_ulong)SIZE_MAX) { - max_mem_size = (cl_ulong)SIZE_MAX; - } - - // determine max image dim we can allocate - assume RGBA image, 4 bytes per pixel, - // and we want to consume 1/4 of global memory (this is the minimum required to be - // supported by the spec) - max_mem_size /= 4; // use 1/4 - max_mem_size /= 4; // 4 bytes per pixel - max_img_dim = (int)sqrt((double)max_mem_size); - // convert to a power of 2 - { - unsigned int n = (unsigned int)max_img_dim; - unsigned int m = 0x80000000; - - // round-down to the nearest power of 2 - while (m > n) - m >>= 1; - - max_img_dim = (int)m; - } - - if (max_img_width > max_img_dim) - max_img_width = max_img_dim; - if (max_img_height > max_img_dim) - max_img_height = max_img_dim; - - log_info("Adjusted maximum image size to test is %d x %d, which is a max mem size of %gMB.\n", - max_img_width, max_img_height, (max_img_width*max_img_height*4)/(1024.0*1024.0)); - - d = init_genrand( gRandomSeed ); - input_ptr = generate_8888_image(max_img_width, max_img_height, d); - output_ptr = (unsigned char*)malloc(sizeof(unsigned char) * 4 * max_img_width * max_img_height); - - int plus_minus; - for (plus_minus=0; plus_minus < 3; plus_minus++) - { - - // test power of 2 width, height starting at 1 to 4K - for (i=2,i2=1; i<=max_img_height; i<<=1,i2++) - { - img_height = (1 << i2); - for (j=2,j2=1; j<=max_img_width; j<<=1,j2++) - { - img_width = (1 << j2); - - int effective_img_height = img_height; - int effective_img_width = img_width; - - local_threads[0] = 1; - local_threads[1] = 1; - - switch (plus_minus) { - case 0: - effective_img_height--; - local_threads[0] = work_group_size > max_local_workgroup_size[0] ? max_local_workgroup_size[0] : work_group_size; - while (img_width%local_threads[0] != 0) - local_threads[0]--; - break; - case 1: - effective_img_width--; - local_threads[1] = work_group_size > max_local_workgroup_size[1] ? max_local_workgroup_size[1] : work_group_size; - while (img_height%local_threads[1] != 0) - local_threads[1]--; - break; - case 2: - effective_img_width--; - effective_img_height--; - break; - default: - break; - } - - img_format.image_channel_order = CL_RGBA; - img_format.image_channel_data_type = CL_UNORM_INT8; - streams[0] = create_image_2d(context, (cl_mem_flags)(CL_MEM_READ_WRITE), &img_format, effective_img_width, effective_img_height, 0, NULL, NULL); - if (!streams[0]) - { - log_error("create_image_2d failed. width = %d, height = %d\n", effective_img_width, effective_img_height); - free(input_ptr); - free(output_ptr); - free_mtdata(d); - return -1; - } - img_format.image_channel_order = CL_RGBA; - img_format.image_channel_data_type = CL_UNORM_INT8; - streams[1] = create_image_2d(context, (cl_mem_flags)(CL_MEM_READ_WRITE), &img_format, effective_img_width, effective_img_height, 0, NULL, NULL); - if (!streams[1]) - { - log_error("create_image_2d failed. width = %d, height = %d\n", effective_img_width, effective_img_height); - clReleaseMemObject(streams[0]); - free(input_ptr); - free(output_ptr); - free_mtdata(d); - return -1; - } - - size_t origin[3] = {0,0,0}; - size_t region[3] = {effective_img_width, effective_img_height, 1}; - err = clEnqueueWriteImage(queue, streams[0], CL_FALSE, origin, region, 0, 0, input_ptr, 0, NULL, NULL); - if (err != CL_SUCCESS) - { - log_error("clWriteImage failed\n"); - clReleaseMemObject(streams[0]); - clReleaseMemObject(streams[1]); - free(input_ptr); - free(output_ptr); - free_mtdata(d); - return -1; - } - - err = clSetKernelArg(kernel, 0, sizeof streams[0], &streams[0]); - err |= clSetKernelArg(kernel, 1, sizeof streams[1], &streams[1]); - err |= clSetKernelArg(kernel, 2, sizeof sampler, &sampler); - if (err != CL_SUCCESS) - { - log_error("clSetKernelArgs failed\n"); - clReleaseMemObject(streams[0]); - clReleaseMemObject(streams[1]); - free(input_ptr); - free(output_ptr); - free_mtdata(d); - return -1; - } - - threads[0] = (size_t)effective_img_width; - threads[1] = (size_t)effective_img_height; - log_info("Testing image dimensions %d x %d with local threads %d x %d.\n", - effective_img_width, effective_img_height, (int)local_threads[0], (int)local_threads[1]); - err = clEnqueueNDRangeKernel( queue, kernel, 2, NULL, threads, local_threads, 0, NULL, NULL ); - if (err != CL_SUCCESS) - { - log_error("clEnqueueNDRangeKernel failed\n"); - log_error("Image Dimension test failed. image width = %d, image height = %d, local %d x %d\n", - effective_img_width, effective_img_height, (int)local_threads[0], (int)local_threads[1]); - clReleaseMemObject(streams[0]); - clReleaseMemObject(streams[1]); - free(input_ptr); - free(output_ptr); - free_mtdata(d); - return -1; - } - err = clEnqueueReadImage(queue, streams[1], CL_TRUE, origin, region, 0, 0, output_ptr, 0, NULL, NULL); - if (err != CL_SUCCESS) - { - log_error("clReadImage failed\n"); - log_error("Image Dimension test failed. image width = %d, image height = %d, local %d x %d\n", - effective_img_width, effective_img_height, (int)local_threads[0], (int)local_threads[1]); - clReleaseMemObject(streams[0]); - clReleaseMemObject(streams[1]); - free(input_ptr); - free(output_ptr); - free_mtdata(d); - return -1; - } - err = verify_8888_image(input_ptr, output_ptr, effective_img_width, effective_img_height); - if (err) - { - total_errors++; - log_error("Image Dimension test failed. image width = %d, image height = %d\n", effective_img_width, effective_img_height); - } - - clReleaseMemObject(streams[0]); - clReleaseMemObject(streams[1]); - } - } - - } - - // cleanup - free(input_ptr); - free(output_ptr); - free_mtdata(d); - clReleaseSampler(sampler); - clReleaseKernel(kernel); - clReleaseProgram(program); - - return total_errors; -} - - - - diff --git a/test_conformance/compatibility/test_conformance/basic/test_imagedim.c b/test_conformance/basic/test_imagedim.cpp similarity index 99% rename from test_conformance/compatibility/test_conformance/basic/test_imagedim.c rename to test_conformance/basic/test_imagedim.cpp index 81de4cbc..6d8cdb36 100644 --- a/test_conformance/compatibility/test_conformance/basic/test_imagedim.c +++ b/test_conformance/basic/test_imagedim.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/basic/test_imagenpot.c b/test_conformance/basic/test_imagenpot.c deleted file mode 100644 index 2682f626..00000000 --- a/test_conformance/basic/test_imagenpot.c +++ /dev/null @@ -1,226 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include -#include - - -#include "procs.h" - -static const char *rgba8888_kernel_code = -"\n" -"__kernel void test_rgba8888(read_only image2d_t srcimg, write_only image2d_t dstimg, sampler_t sampler)\n" -"{\n" -" int tid_x = get_global_id(0);\n" -" int tid_y = get_global_id(1);\n" -" float4 color;\n" -"\n" -" if ( (tid_x >= get_image_width(dstimg)) || (tid_y >= get_image_height(dstimg)) )\n" -" return;\n" -" color = read_imagef(srcimg, sampler, (int2)(tid_x, tid_y));\n" -" write_imagef(dstimg, (int2)(tid_x, tid_y), color);\n" -"\n" -"}\n"; - - -static unsigned char * -generate_8888_image(int w, int h, MTdata d) -{ - unsigned char *ptr = (unsigned char*)malloc(w * h * 4); - int i; - - for (i=0; i max_local_workgroup_size[0]) - local_workgroup_size = max_local_workgroup_size[0]; - - global_threads[0] = ((img_width + local_workgroup_size - 1) / local_workgroup_size) * local_workgroup_size; - global_threads[1] = img_height; - local_threads[0] = local_workgroup_size; - local_threads[1] = 1; - err = clEnqueueNDRangeKernel( queue, kernel, 2, NULL, global_threads, local_threads, 0, NULL, NULL ); - - if (err != CL_SUCCESS) - { - log_error("%s clEnqueueNDRangeKernel failed\n", __FUNCTION__); - free_mtdata(d); - return -1; - } - err = clEnqueueReadImage(queue, streams[1], CL_TRUE, - origin, region, 0, 0, - (void *)output_ptr, - 0, NULL, NULL); - if (err != CL_SUCCESS) - { - log_error("clEnqueueReadBuffer failed\n"); - return -1; - } - - err = verify_rgba8888_image(input_ptr, output_ptr, img_width, img_height); - - // cleanup - clReleaseSampler(sampler); - clReleaseMemObject(streams[0]); - clReleaseMemObject(streams[1]); - clReleaseKernel(kernel); - clReleaseProgram(program); - free(input_ptr); - free(output_ptr); - - if (err) - break; - } - - free_mtdata(d); - - return err; -} - - - - - diff --git a/test_conformance/compatibility/test_conformance/basic/test_imagenpot.c b/test_conformance/basic/test_imagenpot.cpp similarity index 99% rename from test_conformance/compatibility/test_conformance/basic/test_imagenpot.c rename to test_conformance/basic/test_imagenpot.cpp index acea61dc..4713c30e 100644 --- a/test_conformance/compatibility/test_conformance/basic/test_imagenpot.c +++ b/test_conformance/basic/test_imagenpot.cpp @@ -13,9 +13,10 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include +#include #include #include #include diff --git a/test_conformance/basic/test_imagerandomcopy.c b/test_conformance/basic/test_imagerandomcopy.cpp similarity index 99% rename from test_conformance/basic/test_imagerandomcopy.c rename to test_conformance/basic/test_imagerandomcopy.cpp index 1de572f1..494d6c25 100644 --- a/test_conformance/basic/test_imagerandomcopy.c +++ b/test_conformance/basic/test_imagerandomcopy.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/basic/test_imagereadwrite.c b/test_conformance/basic/test_imagereadwrite.cpp similarity index 99% rename from test_conformance/basic/test_imagereadwrite.c rename to test_conformance/basic/test_imagereadwrite.cpp index d5000edb..dd1923eb 100644 --- a/test_conformance/basic/test_imagereadwrite.c +++ b/test_conformance/basic/test_imagereadwrite.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/basic/test_imagereadwrite3d.c b/test_conformance/basic/test_imagereadwrite3d.cpp similarity index 99% rename from test_conformance/basic/test_imagereadwrite3d.c rename to test_conformance/basic/test_imagereadwrite3d.cpp index e83b32fb..66f64e09 100644 --- a/test_conformance/basic/test_imagereadwrite3d.c +++ b/test_conformance/basic/test_imagereadwrite3d.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/basic/test_int2float.c b/test_conformance/basic/test_int2float.cpp similarity index 98% rename from test_conformance/basic/test_int2float.c rename to test_conformance/basic/test_int2float.cpp index 3211ccd2..d298dc7f 100644 --- a/test_conformance/basic/test_int2float.c +++ b/test_conformance/basic/test_int2float.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/basic/test_intmath.cpp b/test_conformance/basic/test_intmath.cpp new file mode 100644 index 00000000..6fd41abb --- /dev/null +++ b/test_conformance/basic/test_intmath.cpp @@ -0,0 +1,240 @@ +// +// Copyright (c) 2020 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#include +#include +#include + +#include "procs.h" + +template struct TestDef +{ + const char *name; + const char *kernel_code; + std::function ref; +}; + +template +int test_intmath(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements, std::string typestr) +{ + TestDef tests[] = { + // Test addition + { + "test_add", + R"( + __kernel void test_add(__global TYPE *srcA, + __global TYPE *srcB, + __global TYPE *srcC, + __global TYPE *dst) + { + int tid = get_global_id(0); + dst[tid] = srcA[tid] + srcB[tid]; + }; +)", + [](T a, T b, T c) { return a + b; }, + }, + + // Test subtraction + { + "test_sub", + R"( + __kernel void test_sub(__global TYPE *srcA, + __global TYPE *srcB, + __global TYPE *srcC, + __global TYPE *dst) + { + int tid = get_global_id(0); + dst[tid] = srcA[tid] - srcB[tid]; + }; +)", + [](T a, T b, T c) { return a - b; }, + }, + + // Test multiplication + { + "test_mul", + R"( + __kernel void test_mul(__global TYPE *srcA, + __global TYPE *srcB, + __global TYPE *srcC, + __global TYPE *dst) + { + int tid = get_global_id(0); + dst[tid] = srcA[tid] * srcB[tid]; + }; +)", + [](T a, T b, T c) { return a * b; }, + }, + + // Test multiply-accumulate + { + "test_mad", + R"( + __kernel void test_mad(__global TYPE *srcA, + __global TYPE *srcB, + __global TYPE *srcC, + __global TYPE *dst) + { + int tid = get_global_id(0); + dst[tid] = srcA[tid] * srcB[tid] + srcC[tid]; + }; +)", + [](T a, T b, T c) { return a * b + c; }, + }, + }; + + clMemWrapper streams[4]; + cl_int err; + + if (std::is_same::value && !gHasLong) + { + log_info("64-bit integers are not supported on this device. Skipping " + "test.\n"); + return TEST_SKIPPED_ITSELF; + } + + // Create host buffers and fill with random data. + std::vector inputA(num_elements * N); + std::vector inputB(num_elements * N); + std::vector inputC(num_elements * N); + std::vector output(num_elements * N); + MTdataHolder d(gRandomSeed); + for (int i = 0; i < num_elements; i++) + { + inputA[i] = (T)genrand_int64(d); + inputB[i] = (T)genrand_int64(d); + inputC[i] = (T)genrand_int64(d); + } + + size_t datasize = sizeof(T) * num_elements * N; + + // Create device buffers. + for (int i = 0; i < ARRAY_SIZE(streams); i++) + { + streams[i] = + clCreateBuffer(context, CL_MEM_READ_WRITE, datasize, NULL, &err); + test_error(err, "clCreateBuffer failed"); + } + + // Copy input data to device. + err = clEnqueueWriteBuffer(queue, streams[0], CL_TRUE, 0, datasize, + inputA.data(), 0, NULL, NULL); + test_error(err, "clEnqueueWriteBuffer failed\n"); + err = clEnqueueWriteBuffer(queue, streams[1], CL_TRUE, 0, datasize, + inputB.data(), 0, NULL, NULL); + test_error(err, "clEnqueueWriteBuffer failed\n"); + err = clEnqueueWriteBuffer(queue, streams[2], CL_TRUE, 0, datasize, + inputC.data(), 0, NULL, NULL); + test_error(err, "clEnqueueWriteBuffer failed\n"); + + std::string build_options = "-DTYPE="; + build_options += typestr; + + // Run test for each operation + for (auto test : tests) + { + log_info("%s... ", test.name); + + // Create kernel and set args + clProgramWrapper program; + clKernelWrapper kernel; + err = create_single_kernel_helper(context, &program, &kernel, 1, + &test.kernel_code, test.name, + build_options.c_str()); + test_error(err, "create_single_kernel_helper failed\n"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &streams[0]); + err |= clSetKernelArg(kernel, 1, sizeof(cl_mem), &streams[1]); + err |= clSetKernelArg(kernel, 2, sizeof(cl_mem), &streams[2]); + err |= clSetKernelArg(kernel, 3, sizeof(cl_mem), &streams[3]); + test_error(err, "clSetKernelArgs failed\n"); + + // Run kernel + size_t threads[1] = { static_cast(num_elements) }; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, threads, NULL, 0, + NULL, NULL); + test_error(err, "clEnqueueNDRangeKernel failed\n"); + + // Read results + err = clEnqueueReadBuffer(queue, streams[3], CL_TRUE, 0, datasize, + output.data(), 0, NULL, NULL); + test_error(err, "clEnqueueReadBuffer failed\n"); + + // Verify results + for (int i = 0; i < num_elements * N; i++) + { + T r = test.ref(inputA[i], inputB[i], inputC[i]); + if (r != output[i]) + { + log_error("\n\nverification failed at index %d\n", i); + log_error("-> inputs: %llu, %llu, %llu\n", + static_cast(inputA[i]), + static_cast(inputB[i]), + static_cast(inputC[i])); + log_error("-> expected %llu, got %llu\n\n", + static_cast(r), + static_cast(output[i])); + return TEST_FAIL; + } + } + log_info("passed\n"); + } + + return TEST_PASS; +} + +int test_intmath_int(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements) +{ + return test_intmath(device, context, queue, num_elements, + "uint"); +} + +int test_intmath_int2(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements) +{ + return test_intmath(device, context, queue, num_elements, + "uint2"); +} + +int test_intmath_int4(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements) +{ + return test_intmath(device, context, queue, num_elements, + "uint4"); +} + +int test_intmath_long(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements) +{ + return test_intmath(device, context, queue, num_elements, + "ulong"); +} + +int test_intmath_long2(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements) +{ + return test_intmath(device, context, queue, num_elements, + "ulong2"); +} + +int test_intmath_long4(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements) +{ + return test_intmath(device, context, queue, num_elements, + "ulong4"); +} diff --git a/test_conformance/basic/test_intmath_int.c b/test_conformance/basic/test_intmath_int.c deleted file mode 100644 index 3706fd93..00000000 --- a/test_conformance/basic/test_intmath_int.c +++ /dev/null @@ -1,334 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include -#include - - -#include "procs.h" - -const char *int_add_kernel_code = -"__kernel void test_int_add(__global int *srcA, __global int *srcB, __global int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] + srcB[tid];\n" -"}\n"; - -const char *int_sub_kernel_code = -"__kernel void test_int_sub(__global int *srcA, __global int *srcB, __global int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] - srcB[tid];\n" -"}\n"; - -const char *int_mul_kernel_code = -"__kernel void test_int_mul(__global int *srcA, __global int *srcB, __global int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid];\n" -"}\n"; - -const char *int_mad_kernel_code = -"__kernel void test_int_mad(__global int *srcA, __global int *srcB, __global int *srcC, __global int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid] + srcC[tid];\n" -"}\n"; - -static const float MAX_ERR = 1e-5f; - -int -verify_int_add(int *inptrA, int *inptrB, int *outptr, int n) -{ - int r; - int i; - - for (i=0; i -#include -#include -#include -#include - - -#include "procs.h" - -const char *int_add2_kernel_code = -"__kernel void test_int_add2(__global int2 *srcA, __global int2 *srcB, __global int2 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] + srcB[tid];\n" -"}\n"; - -const char *int_sub2_kernel_code = -"__kernel void test_int_sub2(__global int2 *srcA, __global int2 *srcB, __global int2 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] - srcB[tid];\n" -"}\n"; - -const char *int_mul2_kernel_code = -"__kernel void test_int_mul2(__global int2 *srcA, __global int2 *srcB, __global int2 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid];\n" -"}\n"; - -const char *int_mad2_kernel_code = -"__kernel void test_int_mad2(__global int2 *srcA, __global int2 *srcB, __global int2 *srcC, __global int2 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid] + srcC[tid];\n" -"}\n"; - -int -verify_int_add2(int *inptrA, int *inptrB, int *outptr, int n) -{ - int r; - int i; - - for (i=0; i -#include -#include -#include -#include - - -#include "procs.h" - -const char *int_add4_kernel_code = -"__kernel void test_int_add4(__global int4 *srcA, __global int4 *srcB, __global int4 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] + srcB[tid];\n" -"}\n"; - -const char *int_sub4_kernel_code = -"__kernel void test_int_sub4(__global int4 *srcA, __global int4 *srcB, __global int4 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] - srcB[tid];\n" -"}\n"; - -const char *int_mul4_kernel_code = -"__kernel void test_int_mul4(__global int4 *srcA, __global int4 *srcB, __global int4 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid];\n" -"}\n"; - -const char *int_mad4_kernel_code = -"__kernel void test_int_mad4(__global int4 *srcA, __global int4 *srcB, __global int4 *srcC, __global int4 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid] + srcC[tid];\n" -"}\n"; - -int -verify_int_add4(int *inptrA, int *inptrB, int *outptr, int n) -{ - int r; - int i; - - for (i=0; i -#include -#include -#include -#include - - -#include "procs.h" - -const char *long_add_kernel_code = -"__kernel void test_long_add(__global long *srcA, __global long *srcB, __global long *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] + srcB[tid];\n" -"}\n"; - -const char *long_sub_kernel_code = -"__kernel void test_long_sub(__global long *srcA, __global long *srcB, __global long *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] - srcB[tid];\n" -"}\n"; - -const char *long_mul_kernel_code = -"__kernel void test_long_mul(__global long *srcA, __global long *srcB, __global long *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid];\n" -"}\n"; - -const char *long_mad_kernel_code = -"__kernel void test_long_mad(__global long *srcA, __global long *srcB, __global long *srcC, __global long *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid] + srcC[tid];\n" -"}\n"; - -static const float MAX_ERR = 1e-5f; - -int -verify_long_add(cl_long *inptrA, cl_long *inptrB, cl_long *outptr, int n) -{ - cl_long r; - int i; - - for (i=0; i -#include -#include -#include -#include - - -#include "procs.h" - -const char *long_add2_kernel_code = -"__kernel void test_long_add2(__global long2 *srcA, __global long2 *srcB, __global long2 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] + srcB[tid];\n" -"}\n"; - -const char *long_sub2_kernel_code = -"__kernel void test_long_sub2(__global long2 *srcA, __global long2 *srcB, __global long2 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] - srcB[tid];\n" -"}\n"; - -const char *long_mul2_kernel_code = -"__kernel void test_long_mul2(__global long2 *srcA, __global long2 *srcB, __global long2 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid];\n" -"}\n"; - -const char *long_mad2_kernel_code = -"__kernel void test_long_mad2(__global long2 *srcA, __global long2 *srcB, __global long2 *srcC, __global long2 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid] + srcC[tid];\n" -"}\n"; - -int -verify_long_add2(cl_long *inptrA, cl_long *inptrB, cl_long *outptr, int n) -{ - cl_long r; - int i; - - for (i=0; i -#include -#include -#include -#include - - -#include "procs.h" - -const char *long_add4_kernel_code = -"__kernel void test_long_add4(__global long4 *srcA, __global long4 *srcB, __global long4 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] + srcB[tid];\n" -"}\n"; - -const char *long_sub4_kernel_code = -"__kernel void test_long_sub4(__global long4 *srcA, __global long4 *srcB, __global long4 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] - srcB[tid];\n" -"}\n"; - -const char *long_mul4_kernel_code = -"__kernel void test_long_mul4(__global long4 *srcA, __global long4 *srcB, __global long4 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid];\n" -"}\n"; - -const char *long_mad4_kernel_code = -"__kernel void test_long_mad4(__global long4 *srcA, __global long4 *srcB, __global long4 *srcC, __global long4 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid] + srcC[tid];\n" -"}\n"; - -int -verify_long_add4(cl_long *inptrA, cl_long *inptrB, cl_long *outptr, int n) -{ - cl_long r; - int i; - - for (i=0; i #include diff --git a/test_conformance/basic/test_local_kernel_scope.cpp b/test_conformance/basic/test_local_kernel_scope.cpp index d958dc64..57174f03 100644 --- a/test_conformance/basic/test_local_kernel_scope.cpp +++ b/test_conformance/basic/test_local_kernel_scope.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/basic/test_local_linear_id.c b/test_conformance/basic/test_local_linear_id.cpp similarity index 88% rename from test_conformance/basic/test_local_linear_id.c rename to test_conformance/basic/test_local_linear_id.cpp index 52e4cb00..da6af0d7 100644 --- a/test_conformance/basic/test_local_linear_id.c +++ b/test_conformance/basic/test_local_linear_id.cpp @@ -13,14 +13,14 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include #include #include #include -#include "../../test_common/harness/rounding_mode.h" +#include "harness/rounding_mode.h" #include "procs.h" @@ -81,9 +81,13 @@ test_local_linear_id(cl_device_id device, cl_context context, cl_command_queue q streams = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), length*sizeof(int), NULL, &err); test_error( err, "clCreateBuffer failed."); - err = create_single_kernel_helper_with_build_options(context, &program[0], &kernel[0], 1, &local_linear_id_1d_code, "test_local_linear_id_1d", "-cl-std=CL2.0"); + err = create_single_kernel_helper(context, &program[0], &kernel[0], 1, + &local_linear_id_1d_code, + "test_local_linear_id_1d"); test_error( err, "create_single_kernel_helper failed"); - err = create_single_kernel_helper_with_build_options(context, &program[1], &kernel[1], 1, &local_linear_id_2d_code, "test_local_linear_id_2d", "-cl-std=CL2.0"); + err = create_single_kernel_helper(context, &program[1], &kernel[1], 1, + &local_linear_id_2d_code, + "test_local_linear_id_2d"); test_error( err, "create_single_kernel_helper failed"); err = clSetKernelArg(kernel[0], 0, sizeof streams, &streams); diff --git a/test_conformance/basic/test_loop.c b/test_conformance/basic/test_loop.cpp similarity index 99% rename from test_conformance/basic/test_loop.c rename to test_conformance/basic/test_loop.cpp index 250cce2a..1a91d9e4 100644 --- a/test_conformance/basic/test_loop.c +++ b/test_conformance/basic/test_loop.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/basic/test_multireadimagemultifmt.c b/test_conformance/basic/test_multireadimagemultifmt.c deleted file mode 100644 index a24c2aba..00000000 --- a/test_conformance/basic/test_multireadimagemultifmt.c +++ /dev/null @@ -1,236 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include -#include - - -#include "procs.h" - -static const char *multireadimage_kernel_code = -"__kernel void test_multireadimage(read_only image2d_t img0, read_only image2d_t img1, \n" -" read_only image2d_t img2, __global float4 *dst, sampler_t sampler)\n" -"{\n" -" int tid_x = get_global_id(0);\n" -" int tid_y = get_global_id(1);\n" -" int2 tid = (int2)(tid_x, tid_y);\n" -" int indx = tid_y * get_image_width(img1) + tid_x;\n" -" float4 sum;\n" -"\n" -" sum = read_imagef(img0, sampler, tid);\n" -" sum += read_imagef(img1, sampler, tid);\n" -" sum += read_imagef(img2, sampler, tid);\n" -"\n" -" dst[indx] = sum;\n" -"}\n"; - -#define MAX_ERR 1e-7f - -static unsigned char * -generate_8888_image(int w, int h, MTdata d) -{ - unsigned char *ptr = (unsigned char*)malloc(w * h * 4); - int i; - - for (i=0; i max_ulp) - max_ulp = ulp; - } - - if (max_ulp > max_ulp_allowed) { - log_error("READ_MULTIREADIMAGE_MULTIFORMAT test failed. Max ulp error = %g\n", max_ulp); - return -1; - } - - log_info("READ_MULTIREADIMAGE_MULTIFORMAT test passed. Max ulp error = %g\n", max_ulp); - return 0; -} - - -int -test_mri_multiple(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) -{ - cl_mem streams[4]; - cl_image_format img_format; - void *input_ptr[3], *output_ptr; - cl_program program; - cl_kernel kernel; - size_t threads[2]; - int img_width = 512; - int img_height = 512; - int i, err; - MTdata d; - - PASSIVE_REQUIRE_IMAGE_SUPPORT( device ) - - d = init_genrand( gRandomSeed ); - input_ptr[0] = (void *)generate_8888_image(img_width, img_height, d); - input_ptr[1] = (void *)generate_16bit_image(img_width, img_height, d); - input_ptr[2] = (void *)generate_float_image(img_width, img_height, d); - free_mtdata(d); d = NULL; - - output_ptr = (void *)malloc(sizeof(float) * 4 * img_width * img_height); - - img_format.image_channel_order = CL_RGBA; - img_format.image_channel_data_type = CL_UNORM_INT8; - streams[0] = create_image_2d(context, (cl_mem_flags)(CL_MEM_READ_WRITE), &img_format, img_width, img_height, 0, NULL, NULL); - if (!streams[0]) - { - log_error("create_image_2d failed\n"); - return -1; - } - img_format.image_channel_order = CL_RGBA; - img_format.image_channel_data_type = CL_UNORM_INT16; - streams[1] = create_image_2d(context, (cl_mem_flags)(CL_MEM_READ_WRITE), &img_format, img_width, img_height, 0, NULL, NULL); - if (!streams[1]) - { - log_error("create_image_2d failed\n"); - return -1; - } - img_format.image_channel_order = CL_RGBA; - img_format.image_channel_data_type = CL_FLOAT; - streams[2] = create_image_2d(context, (cl_mem_flags)(CL_MEM_READ_WRITE), &img_format, img_width, img_height, 0, NULL, NULL); - if (!streams[2]) - { - log_error("create_image_2d failed\n"); - return -1; - } - - streams[3] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(float)*4 * img_width*img_height, NULL, NULL); - if (!streams[3]) - { - log_error("clCreateBuffer failed\n"); - return -1; - } - - for (i=0; i<3; i++) - { - size_t origin[3] = {0,0,0}, region[3]={img_width, img_height,1}; - err = clEnqueueWriteImage(queue, streams[i], CL_TRUE, origin, region, 0, 0, input_ptr[i], 0, NULL, NULL); - if (err != CL_SUCCESS) - { - log_error("clWriteImage failed\n"); - return -1; - } - } - - err = create_single_kernel_helper( context, &program, &kernel, 1, &multireadimage_kernel_code, "test_multireadimage"); - if (err) - return -1; - - cl_sampler_properties properties[] = { - CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE, - CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP_TO_EDGE, - CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST, - 0 }; - cl_sampler sampler = clCreateSamplerWithProperties(context, properties, &err); - test_error(err, "clCreateSamplerWithProperties failed"); - - for (i=0; i<4; i++) - err |= clSetKernelArg(kernel, i,sizeof streams[i], &streams[i]); - err |= clSetKernelArg(kernel, 4, sizeof sampler, &sampler); - - if (err != CL_SUCCESS) - { - log_error("clSetKernelArgs failed\n"); - return -1; - } - - threads[0] = (size_t)img_width; - threads[1] = (size_t)img_height; - - err = clEnqueueNDRangeKernel( queue, kernel, 2, NULL, threads, NULL, 0, NULL, NULL ); - if (err != CL_SUCCESS) - { - log_error("clEnqueueNDRangeKernel failed\n"); - return -1; - } - err = clEnqueueReadBuffer( queue, streams[3], CL_TRUE, 0, sizeof(float)*4*img_width*img_height, (void *)output_ptr, 0, NULL, NULL ); - if (err != CL_SUCCESS) - { - log_error("clEnqueueReadBuffer failed\n"); - return -1; - } - - err = verify_multireadimage(input_ptr, (float*)output_ptr, img_width, img_height); - - // cleanup - clReleaseSampler(sampler); - for (i=0; i<4; i++) - clReleaseMemObject(streams[i]); - clReleaseKernel(kernel); - clReleaseProgram(program); - for (i=0; i<3; i++) - free(input_ptr[i]); - free(output_ptr); - - return err; -} - - - - - diff --git a/test_conformance/compatibility/test_conformance/basic/test_multireadimagemultifmt.c b/test_conformance/basic/test_multireadimagemultifmt.cpp similarity index 99% rename from test_conformance/compatibility/test_conformance/basic/test_multireadimagemultifmt.c rename to test_conformance/basic/test_multireadimagemultifmt.cpp index ac9794b9..5c93d2fc 100644 --- a/test_conformance/compatibility/test_conformance/basic/test_multireadimagemultifmt.c +++ b/test_conformance/basic/test_multireadimagemultifmt.cpp @@ -13,9 +13,10 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include +#include #include #include #include diff --git a/test_conformance/basic/test_multireadimageonefmt.c b/test_conformance/basic/test_multireadimageonefmt.c deleted file mode 100644 index fa18c8de..00000000 --- a/test_conformance/basic/test_multireadimageonefmt.c +++ /dev/null @@ -1,204 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include -#include - - -#include "procs.h" - -static const char *multireadimage_kernel_code = -"__kernel void test_multireadimage(int n, int m, sampler_t sampler, \n" -" read_only image2d_t img0, read_only image2d_t img1, \n" -" read_only image2d_t img2, read_only image2d_t img3, \n" -" read_only image2d_t img4, read_only image2d_t img5, \n" -" read_only image2d_t img6, __global float4 *dst)\n" -"{\n" -" int tid_x = get_global_id(0);\n" -" int tid_y = get_global_id(1);\n" -" int2 tid = (int2)(tid_x, tid_y);\n" -" int indx = tid_y * get_image_width(img5) + tid_x;\n" -" float4 sum;\n" -"\n" -" sum = read_imagef(img0, sampler, tid);\n" -" sum += read_imagef(img1, sampler, tid);\n" -" sum += read_imagef(img2, sampler, tid);\n" -" sum += read_imagef(img3, sampler, tid);\n" -" sum += read_imagef(img4, sampler, tid);\n" -" sum += read_imagef(img5, sampler, tid);\n" -" sum += read_imagef(img6, sampler, tid);\n" -"\n" -" dst[indx] = sum;\n" -"}\n"; - - -static unsigned char * -generate_8888_image(int w, int h, MTdata d) -{ - unsigned char *ptr = (unsigned char*)malloc(w * h * 4); - int i; - - for (i=0; i max_ulp) - max_ulp = ulp; - } - - if (max_ulp > max_ulp_allowed) - { - log_error("READ_MULTIREADIMAGE_RGBA8888 test failed. Max ULP err = %g\n", max_ulp); - return -1; - } - log_info("READ_MULTIREADIMAGE_RGBA8888 test passed. Max ULP err = %g\n", max_ulp); - return 0; -} - - -int test_mri_one(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) -{ - cl_mem streams[8]; - cl_image_format img_format; - void *input_ptr[7], *output_ptr; - cl_program program; - cl_kernel kernel; - size_t threads[2]; - int img_width = 512; - int img_height = 512; - int i, err; - size_t origin[3] = {0, 0, 0}; - size_t region[3] = {img_width, img_height, 1}; - size_t length = img_width * img_height * 4 * sizeof(float); - MTdata d; - - PASSIVE_REQUIRE_IMAGE_SUPPORT( device ) - - output_ptr = malloc(length); - - d = init_genrand( gRandomSeed ); - for (i=0; i<7; i++) { - input_ptr[i] = (void *)generate_8888_image(img_width, img_height, d); - - img_format.image_channel_order = CL_RGBA; - img_format.image_channel_data_type = CL_UNORM_INT8; - streams[i] = create_image_2d(context, CL_MEM_READ_WRITE, &img_format, img_width, img_height, 0, NULL, NULL); - if (!streams[i]) - { - log_error("create_image_2d failed\n"); - return -1; - } - - err = clEnqueueWriteImage(queue, streams[i], CL_TRUE, origin, region, 0, 0, input_ptr[i], 0, NULL, NULL); - if (err != CL_SUCCESS) - { - log_error("clWriteImage failed\n"); - return -1; - } - } - free_mtdata(d); d = NULL; - - - streams[7] = clCreateBuffer(context, CL_MEM_READ_WRITE, length, NULL, NULL); - if (!streams[7]) - { - log_error("clCreateArray failed\n"); - return -1; - } - - err = create_single_kernel_helper(context, &program, &kernel, 1, &multireadimage_kernel_code, "test_multireadimage"); - if (err) - return -1; - - cl_sampler_properties properties[] = { - CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE, - CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP_TO_EDGE, - CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST, - 0 }; - cl_sampler sampler = clCreateSamplerWithProperties(context, properties, &err); - test_error(err, "clCreateSamplerWithProperties failed"); - - err = clSetKernelArg(kernel, 0, sizeof i, &i); - err |= clSetKernelArg(kernel, 1, sizeof err, &err); - err |= clSetKernelArg(kernel, 2, sizeof sampler, &sampler); - for (i=0; i<8; i++) - err |= clSetKernelArg(kernel, 3+i, sizeof streams[i], &streams[i]); - - if (err != CL_SUCCESS) - { - log_error("clSetKernelArgs failed\n"); - return -1; - } - - threads[0] = (unsigned int)img_width; - threads[1] = (unsigned int)img_height; - - err = clEnqueueNDRangeKernel(queue, kernel, 2, NULL, threads, NULL, 0, NULL, NULL); - if (err != CL_SUCCESS) - { - log_error("clExecuteKernel failed\n"); - return -1; - } - err = clEnqueueReadBuffer(queue, streams[7], CL_TRUE, 0, length, output_ptr, 0, NULL, NULL); - if (err != CL_SUCCESS) - { - log_error("clReadArray failed\n"); - return -1; - } - - err = verify_multireadimage(input_ptr, 7, (float *)output_ptr, img_width, img_height); - - // cleanup - clReleaseSampler(sampler); - for (i=0; i<8; i++) - clReleaseMemObject(streams[i]); - clReleaseKernel(kernel); - clReleaseProgram(program); - for (i=0; i<7; i++) - free(input_ptr[i]); - free(output_ptr); - - return err; -} - - - - - diff --git a/test_conformance/compatibility/test_conformance/basic/test_multireadimageonefmt.c b/test_conformance/basic/test_multireadimageonefmt.cpp similarity index 99% rename from test_conformance/compatibility/test_conformance/basic/test_multireadimageonefmt.c rename to test_conformance/basic/test_multireadimageonefmt.cpp index 8a70329a..b37c8414 100644 --- a/test_conformance/compatibility/test_conformance/basic/test_multireadimageonefmt.c +++ b/test_conformance/basic/test_multireadimageonefmt.cpp @@ -13,9 +13,10 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include +#include #include #include #include diff --git a/test_conformance/basic/test_pointercast.c b/test_conformance/basic/test_pointercast.cpp similarity index 98% rename from test_conformance/basic/test_pointercast.c rename to test_conformance/basic/test_pointercast.cpp index 0b343f95..a3993d52 100644 --- a/test_conformance/basic/test_pointercast.c +++ b/test_conformance/basic/test_pointercast.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/basic/test_progvar.cpp b/test_conformance/basic/test_progvar.cpp index 9eb211c2..62c0a6be 100644 --- a/test_conformance/basic/test_progvar.cpp +++ b/test_conformance/basic/test_progvar.cpp @@ -1,6 +1,6 @@ // -// Copyright (c) 2017 The Khronos Group Inc. -// +// Copyright (c) 2017, 2020 The Khronos Group Inc. +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" // Bug: Missing in spec: atomic_intptr_t is always supported if device is 32-bits. // Bug: Missing in spec: CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE @@ -37,6 +37,7 @@ // TODO: pointer-to-half (and its vectors) // TODO: union of... +#include #include #include #include @@ -45,9 +46,9 @@ #include #include #include -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/mt19937.h" +#include "harness/typeWrappers.h" +#include "harness/errorHelpers.h" +#include "harness/mt19937.h" #include "procs.h" @@ -136,6 +137,7 @@ public: bool is_vecbase(void) const {return m_is_vecbase;} bool is_atomic(void) const {return m_is_atomic;} + bool is_atomic_64bit(void) const {return m_is_atomic && m_size == 8;} bool is_like_size_t(void) const {return m_is_like_size_t;} bool is_bool(void) const {return m_is_bool;} size_t get_size(void) const {return m_size;} @@ -331,6 +333,7 @@ static int l_copy( cl_uchar* dest, unsigned dest_idx, const cl_uchar* src, unsig static std::string conversion_functions(const TypeInfo& ti); static std::string global_decls(const TypeInfo& ti, bool with_init); +static std::string global_check_function(const TypeInfo& ti); static std::string writer_function(const TypeInfo& ti); static std::string reader_function(const TypeInfo& ti); @@ -485,6 +488,11 @@ static const char* l_get_cles_int64_pragma(void) return l_has_cles_int64 ? "#pragma OPENCL EXTENSION cles_khr_int64 : enable\n" : ""; } +static const char* l_get_int64_atomic_pragma(void) +{ + return "#pragma OPENCL EXTENSION cl_khr_int64_base_atomics : enable\n" + "#pragma OPENCL EXTENSION cl_khr_int64_extended_atomics : enable\n"; +} static int l_build_type_table(cl_device_id device) { @@ -588,10 +596,11 @@ static int l_build_type_table(cl_device_id device) static const TypeInfo& l_find_type( const char* name ) { - for ( size_t i = 0; i < num_type_info ; i++ ) { - if ( 0 == strcmp( name, type_info[i].get_name_c_str() ) ) return type_info[i]; - } - assert(0); + auto itr = + std::find_if(type_info, type_info + num_type_info, + [name](TypeInfo& ti) { return ti.get_name() == name; }); + assert(itr != type_info + num_type_info); + return *itr; } @@ -741,6 +750,40 @@ static std::string global_decls(const TypeInfo& ti, bool with_init ) return std::string(decls); } +// Return the source code for the "global_check" function for the given type. +// This function checks that all program-scope variables have appropriate +// initial values when no explicit initializer is used. If all tests pass the +// kernel writes a non-zero value to its output argument, otherwise it writes +// zero. +static std::string global_check_function(const TypeInfo& ti) +{ + const std::string type_name = ti.get_buf_elem_type(); + + // all() should only be used on vector inputs. For scalar comparison, the + // result of the equality operator can be used as a bool value. + const bool is_scalar = ti.num_elem() == 0; // 0 is used to represent scalar types, not 1. + const std::string is_equality_true = is_scalar ? "" : "all"; + + std::string code = "kernel void global_check(global int* out) {\n"; + code += " const " + type_name + " zero = ((" + type_name + ")0);\n"; + code += " bool status = true;\n"; + if (ti.is_atomic()) { + code += " status &= " + is_equality_true + "(atomic_load(&var) == zero);\n"; + code += " status &= " + is_equality_true + "(atomic_load(&g_var) == zero);\n"; + code += " status &= " + is_equality_true + "(atomic_load(&a_var[0]) == zero);\n"; + code += " status &= " + is_equality_true + "(atomic_load(&a_var[1]) == zero);\n"; + } else { + code += " status &= " + is_equality_true + "(var == zero);\n"; + code += " status &= " + is_equality_true + "(g_var == zero);\n"; + code += " status &= " + is_equality_true + "(a_var[0] == zero);\n"; + code += " status &= " + is_equality_true + "(a_var[1] == zero);\n"; + } + code += " status &= (p_var == NULL);\n"; + code += " *out = status ? 1 : 0;\n"; + code += "}\n\n"; + + return code; +} // Return the source text for the writer function for the given type. // For types that can't be passed as pointer-to-type as a kernel argument, @@ -809,6 +852,39 @@ static std::string reader_function(const TypeInfo& ti) return result; } +// Check that all globals where appropriately default-initialized. +static int check_global_initialization(cl_context context, cl_program program, cl_command_queue queue) +{ + int status = CL_SUCCESS; + + // Create a buffer on device to store a unique integer. + cl_int is_init_valid = 0; + clMemWrapper buffer(clCreateBuffer(context, CL_MEM_WRITE_ONLY | CL_MEM_COPY_HOST_PTR, sizeof(is_init_valid), &is_init_valid, &status)); + test_error_ret(status, "Failed to allocate buffer", status); + + // Create, setup and invoke kernel. + clKernelWrapper global_check(clCreateKernel(program, "global_check", &status)); + test_error_ret(status, "Failed to create global_check kernel", status); + status = clSetKernelArg(global_check, 0, sizeof(cl_mem), &buffer); + test_error_ret(status, "Failed to set up argument for the global_check kernel", status); + const cl_uint work_dim = 1; + const size_t global_work_offset[] = { 0 }; + const size_t global_work_size[] = { 1 }; + status = clEnqueueNDRangeKernel(queue, global_check, work_dim, global_work_offset, global_work_size, nullptr, 0, nullptr, nullptr); + test_error_ret(status, "Failed to run global_check kernel", status); + status = clFinish(queue); + test_error_ret(status, "clFinish() failed", status); + + // Read back the memory buffer from the device. + status = clEnqueueReadBuffer(queue, buffer, CL_TRUE, 0, sizeof(is_init_valid), &is_init_valid, 0, nullptr, nullptr); + test_error_ret(status, "Failed to read buffer from device", status); + if (is_init_valid == 0) { + log_error("Unexpected default values were detected"); + return 1; + } + + return CL_SUCCESS; +} // Check write-then-read. static int l_write_read( cl_device_id device, cl_context context, cl_command_queue queue ) @@ -825,6 +901,7 @@ static int l_write_read( cl_device_id device, cl_context context, cl_command_que return status; } + static int l_write_read_for_type( cl_device_id device, cl_context context, cl_command_queue queue, const TypeInfo& ti, RandomSeed& rand_state ) { int err = CL_SUCCESS; @@ -835,8 +912,11 @@ static int l_write_read_for_type( cl_device_id device, cl_context context, cl_co StringTable ksrc; ksrc.add( l_get_fp64_pragma() ); ksrc.add( l_get_cles_int64_pragma() ); + if (ti.is_atomic_64bit()) + ksrc.add( l_get_int64_atomic_pragma() ); ksrc.add( conversion_functions(ti) ); ksrc.add( global_decls(ti,false) ); + ksrc.add( global_check_function(ti) ); ksrc.add( writer_function(ti) ); ksrc.add( reader_function(ti) ); @@ -862,6 +942,8 @@ static int l_write_read_for_type( cl_device_id device, cl_context context, cl_co err |= 1; } + err |= check_global_initialization(context, program, queue); + // We need to create 5 random values of the given type, // and read 4 of them back. const size_t write_data_size = NUM_TESTED_VALUES * sizeof(cl_ulong16); @@ -982,6 +1064,8 @@ static int l_init_write_read_for_type( cl_device_id device, cl_context context, StringTable ksrc; ksrc.add( l_get_fp64_pragma() ); ksrc.add( l_get_cles_int64_pragma() ); + if (ti.is_atomic_64bit()) + ksrc.add( l_get_int64_atomic_pragma() ); ksrc.add( conversion_functions(ti) ); ksrc.add( global_decls(ti,true) ); ksrc.add( writer_function(ti) ); @@ -1426,6 +1510,29 @@ static int l_user_type( cl_device_id device, cl_context context, cl_command_queu return err; } +// Determines whether its valid to skip this test based on the driver version +// and the features it optionally supports. +// Whether the test should be skipped is writen into the out paramter skip. +// The check returns an error code for the clDeviceInfo query. +static cl_int should_skip(cl_device_id device, cl_bool& skip) +{ + // Assume we can't skip to begin with. + skip = CL_FALSE; + + // Progvar tests are already skipped for OpenCL < 2.0, so here we only need + // to test for 3.0 since that is when program scope global variables become + // optional. + if (get_device_cl_version(device) >= Version(3, 0)) + { + size_t max_global_variable_size{}; + test_error(clGetDeviceInfo(device, CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE, + sizeof(max_global_variable_size), + &max_global_variable_size, nullptr), + "clGetDeviceInfo failed"); + skip = (max_global_variable_size != 0) ? CL_FALSE : CL_TRUE; + } + return CL_SUCCESS; +} //////////////////// // Global functions @@ -1434,6 +1541,18 @@ static int l_user_type( cl_device_id device, cl_context context, cl_command_queu // Test support for variables at program scope. Miscellaneous int test_progvar_prog_scope_misc(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) { + cl_bool skip{ CL_FALSE }; + auto error = should_skip(device, skip); + if (CL_SUCCESS != error) + { + return TEST_FAIL; + } + if (skip) + { + log_info("Skipping progvar_prog_scope_misc since it is optionally not " + "supported on this device\n"); + return TEST_SKIPPED_ITSELF; + } size_t max_size = 0; size_t pref_size = 0; @@ -1453,6 +1572,19 @@ int test_progvar_prog_scope_misc(cl_device_id device, cl_context context, cl_com // Test support for variables at program scope. Unitialized data int test_progvar_prog_scope_uninit(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) { + cl_bool skip{ CL_FALSE }; + auto error = should_skip(device, skip); + if (CL_SUCCESS != error) + { + return TEST_FAIL; + } + if (skip) + { + log_info( + "Skipping progvar_prog_scope_uninit since it is optionally not " + "supported on this device\n"); + return TEST_SKIPPED_ITSELF; + } size_t max_size = 0; size_t pref_size = 0; @@ -1469,6 +1601,18 @@ int test_progvar_prog_scope_uninit(cl_device_id device, cl_context context, cl_c // Test support for variables at program scope. Initialized data. int test_progvar_prog_scope_init(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) { + cl_bool skip{ CL_FALSE }; + auto error = should_skip(device, skip); + if (CL_SUCCESS != error) + { + return TEST_FAIL; + } + if (skip) + { + log_info("Skipping progvar_prog_scope_init since it is optionally not " + "supported on this device\n"); + return TEST_SKIPPED_ITSELF; + } size_t max_size = 0; size_t pref_size = 0; @@ -1486,6 +1630,18 @@ int test_progvar_prog_scope_init(cl_device_id device, cl_context context, cl_com // A simple test for support of static variables inside a kernel. int test_progvar_func_scope(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) { + cl_bool skip{ CL_FALSE }; + auto error = should_skip(device, skip); + if (CL_SUCCESS != error) + { + return TEST_FAIL; + } + if (skip) + { + log_info("Skipping progvar_func_scope since it is optionally not " + "supported on this device\n"); + return TEST_SKIPPED_ITSELF; + } size_t max_size = 0; size_t pref_size = 0; diff --git a/test_conformance/basic/test_queue_priority.c b/test_conformance/basic/test_queue_priority.cpp similarity index 98% rename from test_conformance/basic/test_queue_priority.c rename to test_conformance/basic/test_queue_priority.cpp index f780962d..831defe7 100644 --- a/test_conformance/basic/test_queue_priority.c +++ b/test_conformance/basic/test_queue_priority.cpp @@ -13,14 +13,14 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include #include #include #include -#include "../../test_common/harness/rounding_mode.h" +#include "harness/rounding_mode.h" #include "procs.h" @@ -176,7 +176,6 @@ int test_queue_priority(cl_device_id device, cl_context context, cl_command_queu err = clGetDeviceInfo( device, CL_DEVICE_MAX_COMPUTE_UNITS, sizeof( num_compute_units ), &num_compute_units, NULL ); if (err) { log_error("clGetDeviceInfo for CL_DEVICE_MAX_COMPUTE_UNITS failed: %d", err); - test_finish(); return -1; } @@ -191,7 +190,6 @@ int test_queue_priority(cl_device_id device, cl_context context, cl_command_queu cl_command_queue background_queue = clCreateCommandQueueWithProperties(context, device, queue_properties, &err); if (err) { log_error("clCreateCommandQueueWithPropertiesAPPLE failed: %d", err); - test_finish(); return -1; } @@ -214,7 +212,6 @@ int test_queue_priority(cl_device_id device, cl_context context, cl_command_queu err = clGetDeviceInfo( device, CL_DEVICE_SINGLE_FP_CONFIG, sizeof( single_config ), &single_config, NULL ); if (err) { log_error("clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed: %d", err); - test_finish(); return -1; } //If we only support rtz mode @@ -226,13 +223,11 @@ int test_queue_priority(cl_device_id device, cl_context context, cl_command_queu if( err ) { log_error("clGetDeviceInfo for CL_DEVICE_PROFILE failed: %d", err); - test_finish(); return -1; } if( 0 != strcmp( profile, "EMBEDDED_PROFILE")) { log_error( "FAILURE: Device doesn't support CL_FP_ROUND_TO_NEAREST and isn't EMBEDDED_PROFILE\n" ); - test_finish(); return -1; } diff --git a/test_conformance/basic/test_readimage.c b/test_conformance/basic/test_readimage.cpp similarity index 95% rename from test_conformance/basic/test_readimage.c rename to test_conformance/basic/test_readimage.cpp index f6374964..57860090 100644 --- a/test_conformance/basic/test_readimage.c +++ b/test_conformance/basic/test_readimage.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -209,13 +209,8 @@ int test_readimage(cl_device_id device, cl_context context, cl_command_queue que if (err) return -1; - cl_sampler_properties properties[] = { - CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE, - CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP_TO_EDGE, - CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST, - 0 }; - cl_sampler sampler = clCreateSamplerWithProperties(context, properties, &err); - test_error(err, "clCreateSamplerWithProperties failed"); + cl_sampler sampler = clCreateSampler(context, CL_FALSE, CL_ADDRESS_CLAMP_TO_EDGE, CL_FILTER_NEAREST, &err); + test_error(err, "clCreateSampler failed"); if(supportsBGRA) { diff --git a/test_conformance/basic/test_readimage3d.c b/test_conformance/basic/test_readimage3d.c deleted file mode 100644 index 01c927b0..00000000 --- a/test_conformance/basic/test_readimage3d.c +++ /dev/null @@ -1,237 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include -#include -#include - - -#include "procs.h" - -static const char *bgra8888_kernel_code = -"\n" -"__kernel void test_bgra8888(read_only image3d_t srcimg, __global float4 *dst, sampler_t sampler)\n" -"{\n" -" int tid_x = get_global_id(0);\n" -" int tid_y = get_global_id(1);\n" -" int tid_z = get_global_id(2);\n" -" int indx = (tid_z * get_image_height(srcimg) + tid_y) * get_image_width(srcimg) + tid_x;\n" -" float4 color;\n" -"\n" -" color = read_imagef(srcimg, sampler, (int4)(tid_x, tid_y, tid_z, 0));\n" -" dst[indx].x = color.z;\n" -" dst[indx].y = color.y;\n" -" dst[indx].z = color.x;\n" -" dst[indx].w = color.w;\n" -"\n" -"}\n"; - - -static const char *rgba8888_kernel_code = -"\n" -"__kernel void test_rgba8888(read_only image3d_t srcimg, __global float4 *dst, sampler_t sampler)\n" -"{\n" -" int tid_x = get_global_id(0);\n" -" int tid_y = get_global_id(1);\n" -" int tid_z = get_global_id(2);\n" -" int indx = (tid_z * get_image_height(srcimg) + tid_y) * get_image_width(srcimg) + tid_x;\n" -" float4 color;\n" -"\n" -" color = read_imagef(srcimg, sampler, (int4)(tid_x, tid_y, tid_z, 0));\n" -" //indx *= 4;\n" -" dst[indx].x = color.x;\n" -" dst[indx].y = color.y;\n" -" dst[indx].z = color.z;\n" -" dst[indx].w = color.w;\n" -"\n" -"}\n"; - - -static unsigned char * -generate_3d_image8(int w, int h, int d, MTdata data) -{ - unsigned char *ptr = (unsigned char*)malloc(w * h * d * 4); - int i; - - for (i=0; i +#include +#include +#include +#include +#include + +#include "procs.h" + +static const char *bgra8888_kernel_code = +"\n" +"__kernel void test_bgra8888(read_only image3d_t srcimg, __global float4 *dst, sampler_t sampler)\n" +"{\n" +" int tid_x = get_global_id(0);\n" +" int tid_y = get_global_id(1);\n" +" int tid_z = get_global_id(2);\n" +" int indx = (tid_z * get_image_height(srcimg) + tid_y) * get_image_width(srcimg) + tid_x;\n" +" float4 color;\n" +"\n" +" color = read_imagef(srcimg, sampler, (int4)(tid_x, tid_y, tid_z, 0));\n" +" dst[indx].x = color.z;\n" +" dst[indx].y = color.y;\n" +" dst[indx].z = color.x;\n" +" dst[indx].w = color.w;\n" +"\n" +"}\n"; + +static const char *rgba8888_kernel_code = +"\n" +"__kernel void test_rgba8888(read_only image3d_t srcimg, __global float4 *dst, sampler_t sampler)\n" +"{\n" +" int tid_x = get_global_id(0);\n" +" int tid_y = get_global_id(1);\n" +" int tid_z = get_global_id(2);\n" +" int indx = (tid_z * get_image_height(srcimg) + tid_y) * get_image_width(srcimg) + tid_x;\n" +" float4 color;\n" +"\n" +" color = read_imagef(srcimg, sampler, (int4)(tid_x, tid_y, tid_z, 0));\n" +" //indx *= 4;\n" +" dst[indx].x = color.x;\n" +" dst[indx].y = color.y;\n" +" dst[indx].z = color.z;\n" +" dst[indx].w = color.w;\n" +"\n" +"}\n"; + +static unsigned char * +generate_3d_image8(int w, int h, int d, MTdata data) +{ + unsigned char *ptr = (unsigned char*)malloc(w * h * d * 4); + int i; + + for (i=0; i -#include -#include -#include -#include - - -#include "procs.h" - - -static const char *rgbaFFFF_kernel_code = -"__kernel void test_rgbaFFFF(read_only image3d_t srcimg, __global float *dst, sampler_t sampler)\n" -"{\n" -" int tid_x = get_global_id(0);\n" -" int tid_y = get_global_id(1);\n" -" int tid_z = get_global_id(2);\n" -" int indx = (tid_z * get_image_height(srcimg) + tid_y) * get_image_width(srcimg) + tid_x;\n" -" float4 color;\n" -"\n" -" color = read_imagef(srcimg, sampler, (int4)(tid_x, tid_y, tid_z, 0));\n" -" indx *= 4;\n" -" dst[indx+0] = color.x;\n" -" dst[indx+1] = color.y;\n" -" dst[indx+2] = color.z;\n" -" dst[indx+3] = color.w;\n" -"\n" -"}\n"; - - -static float * -generate_float_image(int w, int h, int d, MTdata data) -{ - float *ptr = (float*)malloc(w * h * d * 4 * sizeof(float)); - int i; - - for (i=0; i +#include #include #include #include diff --git a/test_conformance/basic/test_readimage3d_int16.c b/test_conformance/basic/test_readimage3d_int16.c deleted file mode 100644 index 598497b3..00000000 --- a/test_conformance/basic/test_readimage3d_int16.c +++ /dev/null @@ -1,152 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include -#include - - -#include "procs.h" - -static const char *rgba16_kernel_code = -"__kernel void test_rgba16(read_only image3d_t srcimg, __global ushort4 *dst, sampler_t sampler)\n" -"{\n" -" int tid_x = get_global_id(0);\n" -" int tid_y = get_global_id(1);\n" -" int tid_z = get_global_id(2);\n" -" int indx = (tid_z * get_image_height(srcimg) + tid_y) * get_image_width(srcimg) + tid_x;\n" -" float4 color;\n" -"\n" -" color = read_imagef(srcimg, sampler, (int4)(tid_x, tid_y, tid_z, 0));\n" -" ushort4 dst_write;\n" -" dst_write.x = convert_ushort_rte(color.x * 65535.0f);\n" -" dst_write.y = convert_ushort_rte(color.y * 65535.0f);\n" -" dst_write.z = convert_ushort_rte(color.z * 65535.0f);\n" -" dst_write.w = convert_ushort_rte(color.w * 65535.0f);\n" -" dst[indx] = dst_write;\n" -"\n" -"}\n"; - - -static unsigned short * -generate_16bit_image(int w, int h, int d, MTdata data) -{ - unsigned short *ptr = (cl_ushort*)malloc(w * h * d * 4 * sizeof(cl_ushort)); - int i; - - for (i=0; i +#include #include #include #include diff --git a/test_conformance/basic/test_readimage_fp32.c b/test_conformance/basic/test_readimage_fp32.c deleted file mode 100644 index b1663ab4..00000000 --- a/test_conformance/basic/test_readimage_fp32.c +++ /dev/null @@ -1,173 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include -#include - - -#include "procs.h" - - -static const char *rgbaFFFF_kernel_code = -"__kernel void test_rgbaFFFF(read_only image2d_t srcimg, __global float *dst, sampler_t smp)\n" -"{\n" -" int tid_x = get_global_id(0);\n" -" int tid_y = get_global_id(1);\n" -" int indx = tid_y * get_image_width(srcimg) + tid_x;\n" -" float4 color;\n" -"\n" -" color = read_imagef(srcimg, smp, (int2)(tid_x, tid_y));\n" -" indx *= 4;\n" -" dst[indx+0] = color.x;\n" -" dst[indx+1] = color.y;\n" -" dst[indx+2] = color.z;\n" -" dst[indx+3] = color.w;\n" -"\n" -"}\n"; - - -static float * -generate_float_image(int w, int h, MTdata d) -{ - float *ptr = (float*)malloc(w * h * 4 * sizeof(float)); - int i; - - for (i=0; i +#include #include #include #include diff --git a/test_conformance/basic/test_readimage_int16.c b/test_conformance/basic/test_readimage_int16.c deleted file mode 100644 index 4456f4ae..00000000 --- a/test_conformance/basic/test_readimage_int16.c +++ /dev/null @@ -1,172 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include -#include - - -#include "procs.h" - -static const char *rgba16_kernel_code = -"__kernel void test_rgba16(read_only image2d_t srcimg, __global ushort4 *dst, sampler_t smp)\n" -"{\n" -" int tid_x = get_global_id(0);\n" -" int tid_y = get_global_id(1);\n" -" int indx = tid_y * get_image_width(srcimg) + tid_x;\n" -" float4 color;\n" -"\n" -" color = read_imagef(srcimg, smp, (int2)(tid_x, tid_y));\n" -" ushort4 dst_write;\n" -" dst_write.x = convert_ushort_rte(color.x * 65535.0f);\n" -" dst_write.y = convert_ushort_rte(color.y * 65535.0f);\n" -" dst_write.z = convert_ushort_rte(color.z * 65535.0f);\n" -" dst_write.w = convert_ushort_rte(color.w * 65535.0f);\n" -" dst[indx] = dst_write;\n" -"\n" -"}\n"; - - -static unsigned short * -generate_16bit_image(int w, int h, MTdata d) -{ - cl_ushort *ptr = (cl_ushort*)malloc(w * h * 4 * sizeof(cl_ushort)); - int i; - - for (i=0; i +#include #include #include #include diff --git a/test_conformance/basic/test_rw_image_access_qualifier.c b/test_conformance/basic/test_rw_image_access_qualifier.cpp similarity index 81% rename from test_conformance/basic/test_rw_image_access_qualifier.c rename to test_conformance/basic/test_rw_image_access_qualifier.cpp index 0f33cd8d..c841a1dd 100644 --- a/test_conformance/basic/test_rw_image_access_qualifier.c +++ b/test_conformance/basic/test_rw_image_access_qualifier.cpp @@ -19,7 +19,7 @@ #include #include "procs.h" -#include "../../test_common/harness/clImageHelper.h" +#include "harness/clImageHelper.h" static const char* rw_kernel_code = "kernel void test_rw_images(read_write image2d_t src_image) {\n" @@ -43,6 +43,29 @@ static const char* rw_kernel_code = int test_rw_image_access_qualifier(cl_device_id device_id, cl_context context, cl_command_queue commands, int num_elements) { + // This test should be skipped if images are not supported. + if (checkForImageSupport(device_id)) + { + return TEST_SKIPPED_ITSELF; + } + + // Support for read-write image arguments is required for an + // or 2.X device if the device supports images. In OpenCL-3.0 + // read-write images are optional. This test is already being skipped + // for 1.X devices. + if (get_device_cl_version(device_id) >= Version(3, 0)) + { + cl_uint are_rw_images_supported{}; + test_error( + clGetDeviceInfo(device_id, CL_DEVICE_MAX_READ_IMAGE_ARGS, + sizeof(are_rw_images_supported), + &are_rw_images_supported, nullptr), + "clGetDeviceInfo failed for CL_DEVICE_MAX_READ_IMAGE_ARGS\n"); + if (0 == are_rw_images_supported) + { + return TEST_SKIPPED_ITSELF; + } + } unsigned int i; @@ -86,7 +109,8 @@ int test_rw_image_access_qualifier(cl_device_id device_id, cl_context context, c } /* Build the program executable */ - err = create_single_kernel_helper_with_build_options(context,&program,&kernel,1,&rw_kernel_code,"test_rw_images", "-cl-std=CL2.0"); + err = create_single_kernel_helper(context, &program, &kernel, 1, + &rw_kernel_code, "test_rw_images"); if (err != CL_SUCCESS || !program) { log_error("Error: clCreateProgramWithSource failed\n"); return err; diff --git a/test_conformance/basic/test_simple_image_pitch.c b/test_conformance/basic/test_simple_image_pitch.cpp similarity index 99% rename from test_conformance/basic/test_simple_image_pitch.c rename to test_conformance/basic/test_simple_image_pitch.cpp index 392fed58..1cd82b6f 100644 --- a/test_conformance/basic/test_simple_image_pitch.c +++ b/test_conformance/basic/test_simple_image_pitch.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/basic/test_sizeof.c b/test_conformance/basic/test_sizeof.cpp similarity index 94% rename from test_conformance/basic/test_sizeof.c rename to test_conformance/basic/test_sizeof.cpp index bdbc40fe..66a6c563 100644 --- a/test_conformance/basic/test_sizeof.c +++ b/test_conformance/basic/test_sizeof.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -24,7 +24,7 @@ -cl_int get_type_size( cl_context context, cl_command_queue queue, const char *type, cl_ulong *size ) +cl_int get_type_size( cl_context context, cl_command_queue queue, const char *type, cl_ulong *size, cl_device_id device ) { const char *sizeof_kernel_code[4] = { @@ -49,8 +49,8 @@ cl_int get_type_size( cl_context context, cl_command_queue queue, const char *ty { sizeof_kernel_code[0] = "#pragma OPENCL EXTENSION cl_khr_fp16 : enable\n"; } - - cl_int err = create_single_kernel_helper_with_build_options(context, &p, &k, 4, sizeof_kernel_code, "test_sizeof", "-cl-std=CL2.0"); + cl_int err = create_single_kernel_helper_with_build_options( + context, &p, &k, 4, sizeof_kernel_code, "test_sizeof", nullptr); if( err ) return err; @@ -134,7 +134,7 @@ const size_table vector_table[] = const char *ptr_table[] = { - "void*", + "global void*", "size_t", "sizeof(int)", // check return type of sizeof "ptrdiff_t" @@ -180,7 +180,7 @@ int test_sizeof(cl_device_id device, cl_context context, cl_command_queue queue, } test = CL_ULONG_MAX; - err = get_type_size( context, queue, scalar_table[i].name, &test ); + err = get_type_size( context, queue, scalar_table[i].name, &test, device); if( err ) return err; if( test != scalar_table[i].size ) @@ -215,7 +215,7 @@ int test_sizeof(cl_device_id device, cl_context context, cl_command_queue queue, sprintf( name, "%s%ld", vector_table[i].name, j ); test = CL_ULONG_MAX; - err = get_type_size( context, queue, name, &test ); + err = get_type_size( context, queue, name, &test, device ); if( err ) return err; if( test != j * vector_table[i].size ) @@ -237,7 +237,7 @@ int test_sizeof(cl_device_id device, cl_context context, cl_command_queue queue, for( i = 0; i < sizeof( ptr_table ) / sizeof( ptr_table[0] ); i++ ) { test = CL_ULONG_MAX; - err = get_type_size( context, queue, ptr_table[i], &test ); + err = get_type_size( context, queue, ptr_table[i], &test, device ); if( err ) return err; if( test != ptr_size ) @@ -250,7 +250,7 @@ int test_sizeof(cl_device_id device, cl_context context, cl_command_queue queue, // Check that intptr_t is large enough test = CL_ULONG_MAX; - err = get_type_size( context, queue, "intptr_t", &test ); + err = get_type_size( context, queue, "intptr_t", &test, device ); if( err ) return err; if( test < ptr_size ) @@ -267,7 +267,7 @@ int test_sizeof(cl_device_id device, cl_context context, cl_command_queue queue, // Check that uintptr_t is large enough test = CL_ULONG_MAX; - err = get_type_size( context, queue, "uintptr_t", &test ); + err = get_type_size( context, queue, "uintptr_t", &test, device ); if( err ) return err; if( test < ptr_size ) @@ -308,7 +308,7 @@ int test_sizeof(cl_device_id device, cl_context context, cl_command_queue queue, } test = CL_ULONG_MAX; - err = get_type_size( context, queue, other_types[i], &test ); + err = get_type_size( context, queue, other_types[i], &test, device ); if( err ) return err; if( ! IsPowerOfTwo( test ) ) @@ -326,7 +326,7 @@ int test_sizeof(cl_device_id device, cl_context context, cl_command_queue queue, { log_info( "\tcl_khr_fp64:" ); test = CL_ULONG_MAX; - err = get_type_size( context, queue, "double", &test ); + err = get_type_size( context, queue, "double", &test, device ); if( err ) return err; if( test != 8 ) @@ -343,7 +343,7 @@ int test_sizeof(cl_device_id device, cl_context context, cl_command_queue queue, sprintf( name, "double%ld", j ); test = CL_ULONG_MAX; - err = get_type_size( context, queue, name, &test ); + err = get_type_size( context, queue, name, &test, device ); if( err ) return err; if( test != 8*j ) @@ -361,7 +361,7 @@ int test_sizeof(cl_device_id device, cl_context context, cl_command_queue queue, { log_info( "\tcl_khr_fp16:" ); test = CL_ULONG_MAX; - err = get_type_size( context, queue, "half", &test ); + err = get_type_size( context, queue, "half", &test, device ); if( err ) return err; if( test != 2 ) @@ -378,7 +378,7 @@ int test_sizeof(cl_device_id device, cl_context context, cl_command_queue queue, sprintf( name, "half%ld", j ); test = CL_ULONG_MAX; - err = get_type_size( context, queue, name, &test ); + err = get_type_size( context, queue, name, &test, device ); if( err ) return err; if( test != 2*j ) diff --git a/test_conformance/basic/test_vec_type_hint.c b/test_conformance/basic/test_vec_type_hint.cpp similarity index 95% rename from test_conformance/basic/test_vec_type_hint.c rename to test_conformance/basic/test_vec_type_hint.cpp index a35d8403..33168b13 100644 --- a/test_conformance/basic/test_vec_type_hint.c +++ b/test_conformance/basic/test_vec_type_hint.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -23,8 +23,8 @@ #include "procs.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/conversions.h" +#include "harness/typeWrappers.h" static const char *sample_kernel = { diff --git a/test_conformance/basic/test_vector_creation.cpp b/test_conformance/basic/test_vector_creation.cpp index 9ab0103a..d9530b4e 100644 --- a/test_conformance/basic/test_vector_creation.cpp +++ b/test_conformance/basic/test_vector_creation.cpp @@ -14,9 +14,9 @@ // limitations under the License. // #include "procs.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/errorHelpers.h" +#include "harness/conversions.h" +#include "harness/typeWrappers.h" +#include "harness/errorHelpers.h" diff --git a/test_conformance/basic/test_vloadstore.c b/test_conformance/basic/test_vloadstore.c deleted file mode 100644 index 74518137..00000000 --- a/test_conformance/basic/test_vloadstore.c +++ /dev/null @@ -1,986 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include -#include -#include - - -#include "procs.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/errorHelpers.h" - -// Outputs debug information for stores -#define DEBUG 0 -// Forces stores/loads to be done with offsets = tid -#define LINEAR_OFFSETS 0 -#define NUM_LOADS 512 - -static const char *doubleExtensionPragma = "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n"; - -#pragma mark -------------------- vload harness -------------------------- - -typedef void (*create_vload_program_fn)( char *destBuffer, size_t inBufferSize, ExplicitType type, size_t inVectorSize, size_t outVectorSize ); - -int test_vload( cl_device_id device, cl_context context, cl_command_queue queue, ExplicitType type, unsigned int vecSize, - create_vload_program_fn createFn, size_t bufferSize, MTdata d ) -{ - int error; - - clProgramWrapper program; - clKernelWrapper kernel; - clMemWrapper streams[ 4 ]; - const size_t numLoads = (DEBUG) ? 16 : NUM_LOADS; - - if (DEBUG) bufferSize = (bufferSize < 128) ? bufferSize : 128; - - size_t threads[ 1 ], localThreads[ 1 ]; - clProtectedArray inBuffer( bufferSize ); - char programSrc[ 10240 ]; - cl_uint offsets[ numLoads ], alignmentOffsets[ numLoads ]; - size_t numElements, typeSize, i; - unsigned int outVectorSize; - - - typeSize = get_explicit_type_size( type ); - numElements = bufferSize / ( typeSize * vecSize ); - bufferSize = numElements * typeSize * vecSize; // To account for rounding - - if (DEBUG) log_info("Testing: numLoads: %d, typeSize: %d, vecSize: %d, numElements: %d, bufferSize: %d\n", (int)numLoads, (int)typeSize, vecSize, (int)numElements, (int)bufferSize); - - // Create some random input data and random offsets to load from - generate_random_data( type, numElements * vecSize, d, (void *)inBuffer ); - for( i = 0; i < numLoads; i++ ) - { - offsets[ i ] = (cl_uint)random_in_range( 0, (int)numElements - 1, d ); - if( offsets[ i ] < numElements - 2 ) - alignmentOffsets[ i ] = (cl_uint)random_in_range( 0, (int)vecSize - 1, d ); - else - alignmentOffsets[ i ] = 0; - if (LINEAR_OFFSETS) offsets[i] = (cl_uint)i; - } - if (LINEAR_OFFSETS) log_info("Offsets set to thread IDs to simplify output.\n"); - - // 32-bit fixup - outVectorSize = vecSize; - - // Declare output buffers now -#if !(defined(_WIN32) && defined(_MSC_VER)) - char outBuffer[ numLoads * typeSize * outVectorSize ]; - char referenceBuffer[ numLoads * typeSize * vecSize ]; -#else - char* outBuffer = (char*)_malloca(numLoads * typeSize * outVectorSize * sizeof(cl_char)); - char* referenceBuffer = (char*)_malloca(numLoads * typeSize * vecSize * sizeof(cl_char)); -#endif - - // Create the program - - - createFn( programSrc, numElements, type, vecSize, outVectorSize); - - // Create our kernel - const char *ptr = programSrc; - - error = create_single_kernel_helper( context, &program, &kernel, 1, &ptr, "test_fn" ); - test_error( error, "Unable to create testing kernel" ); - if (DEBUG) log_info("Kernel: \n%s\n", programSrc); - - // Get the number of args to differentiate the kernels with local storage. (They have 5) - cl_uint numArgs; - error = clGetKernelInfo(kernel, CL_KERNEL_NUM_ARGS, sizeof(numArgs), &numArgs, NULL); - test_error( error, "clGetKernelInfo failed"); - - // Set up parameters - streams[ 0 ] = clCreateBuffer( context, CL_MEM_COPY_HOST_PTR, bufferSize, (void *)inBuffer, &error ); - test_error( error, "Unable to create kernel stream" ); - streams[ 1 ] = clCreateBuffer( context, CL_MEM_COPY_HOST_PTR, numLoads*sizeof(offsets[0]), offsets, &error ); - test_error( error, "Unable to create kernel stream" ); - streams[ 2 ] = clCreateBuffer( context, CL_MEM_COPY_HOST_PTR, numLoads*sizeof(alignmentOffsets[0]), alignmentOffsets, &error ); - test_error( error, "Unable to create kernel stream" ); - streams[ 3 ] = clCreateBuffer( context, CL_MEM_COPY_HOST_PTR, numLoads*typeSize*outVectorSize, (void *)outBuffer, &error ); - test_error( error, "Unable to create kernel stream" ); - - // Set parameters and run - if (numArgs == 5) { - // We need to set the size of the local storage - error = clSetKernelArg(kernel, 0, bufferSize, NULL); - test_error( error, "clSetKernelArg for buffer failed"); - for( i = 0; i < 4; i++ ) - { - error = clSetKernelArg( kernel, (int)i+1, sizeof( streams[ i ] ), &streams[ i ] ); - test_error( error, "Unable to set kernel argument" ); - } - } else { - // No local storage - for( i = 0; i < 4; i++ ) - { - error = clSetKernelArg( kernel, (int)i, sizeof( streams[ i ] ), &streams[ i ] ); - test_error( error, "Unable to set kernel argument" ); - } - } - - threads[ 0 ] = numLoads; - error = get_max_common_work_group_size( context, kernel, threads[ 0 ], &localThreads[ 0 ] ); - test_error( error, "Unable to get local thread size" ); - - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); - test_error( error, "Unable to exec kernel" ); - - // Get the results - error = clEnqueueReadBuffer( queue, streams[ 3 ], CL_TRUE, 0, numLoads * typeSize * outVectorSize * sizeof(cl_char), (void *)outBuffer, 0, NULL, NULL ); - test_error( error, "Unable to read results" ); - - - // Create the reference results - memset( referenceBuffer, 0, numLoads * typeSize * vecSize * sizeof(cl_char)); - for( i = 0; i < numLoads; i++ ) - { - memcpy( referenceBuffer + i * typeSize * vecSize, ( (char *)(void *)inBuffer ) + ( ( offsets[ i ] * vecSize ) + alignmentOffsets[ i ] ) * typeSize, - typeSize * vecSize ); - } - - // Validate the results now - char *expected = referenceBuffer; - char *actual = outBuffer; - char *in = (char *)(void *)inBuffer; - - if (DEBUG) { - log_info("Memory contents:\n"); - for (i=0; i 10240 ) - localSize = 10240; - if (localSize > 4096) - localSize -= 2048; - else - localSize /= 2; - - return test_vloadset( device, context, queue, create_local_load_code, (size_t)localSize ); -} - - -void create_constant_load_code( char *destBuffer, size_t inBufferSize, ExplicitType type, size_t inVectorSize, size_t outVectorSize ) -{ - const char *pattern = - "%s%s" - "__kernel void test_fn( __constant %s *src, __global uint *offsets, __global uint *alignmentOffsets, __global %s%d *results )\n" - "{\n" - " int tid = get_global_id( 0 );\n" - " %s%d tmp = vload%d( offsets[ tid ], ( (__constant %s *) src ) + alignmentOffsets[ tid ] );\n" - " results[ tid ] = tmp;\n" - "}\n"; - - const char *patternV3 = - "%s%s" - "__kernel void test_fn( __constant %s *src, __global uint *offsets, __global uint *alignmentOffsets, __global %s *results )\n" - "{\n" - " int tid = get_global_id( 0 );\n" - " %s3 tmp = vload3( offsets[ tid ], ( (__constant %s *) src ) + alignmentOffsets[ tid ] );\n" - " results[ 3*tid ] = tmp.s0;\n" - " results[ 3*tid+1 ] = tmp.s1;\n" - " results[ 3*tid+2 ] = tmp.s2;\n" - "}\n"; - - const char *typeName = get_explicit_type_name(type); - if(inVectorSize == 3) { - sprintf( destBuffer, patternV3, - type == kDouble ? doubleExtensionPragma : "", - "", - typeName, typeName, typeName, - typeName ); - } else { - sprintf( destBuffer, pattern, - type == kDouble ? doubleExtensionPragma : "", - "", - typeName, typeName, (int)outVectorSize, typeName, (int)inVectorSize, - (int)inVectorSize, typeName ); - } -} - -int test_vload_constant(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems ) -{ - // Determine the max size of a local buffer that we can test against - cl_ulong maxSize; - int error = clGetDeviceInfo( device, CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE, sizeof( maxSize ), &maxSize, NULL ); - test_error( error, "Unable to get max size of constant memory buffer" ); - if( maxSize > 10240 ) - maxSize = 10240; - if (maxSize > 4096) - maxSize -= 2048; - else - maxSize /= 2; - - return test_vloadset( device, context, queue, create_constant_load_code, (size_t)maxSize ); -} - - -void create_private_load_code( char *destBuffer, size_t inBufferSize, ExplicitType type, size_t inVectorSize, size_t outVectorSize ) -{ - const char *pattern = - "%s%s" - // Private memory is unique per thread, unlike local storage which is unique per local work group. Which means - // for this test, we have to copy the entire test buffer into private storage ON EACH THREAD to be an effective test - "#define PRIV_TYPE %s%d\n" - "#define PRIV_SIZE %d\n" - "__kernel void test_fn( __global %s%d *src, __global uint *offsets, __global uint *alignmentOffsets, __global %s%d *results )\n" - "{\n" - " __private PRIV_TYPE sPrivateStorage[ PRIV_SIZE ];\n" - " int tid = get_global_id( 0 );\n" - "\n" - " for( int i = 0; i < %d; i++ )\n" - " sPrivateStorage[ i ] = src[ i ];\n" - // Note: unlike the local test, each thread runs the above copy loop independently, so nobody needs to wait for - // anybody else to sync up - "\n" - " %s%d tmp = vload%d( offsets[ tid ], ( (__private %s *) sPrivateStorage ) + alignmentOffsets[ tid ] );\n" - " results[ tid ] = tmp;\n" - "}\n"; - - const char *patternV3 = - "%s%s" - // Private memory is unique per thread, unlike local storage which is unique per local work group. Which means - // for this test, we have to copy the entire test buffer into private storage ON EACH THREAD to be an effective test - "#define PRIV_TYPE %s\n" - "#define PRIV_SIZE %d\n" - "__kernel void test_fn( __global %s *src, __global uint *offsets, __global uint *alignmentOffsets, __global %s *results )\n" - "{\n" - " __private PRIV_TYPE sPrivateStorage[ PRIV_SIZE ];\n" - " int tid = get_global_id( 0 );\n" - "\n" - " for( int i = 0; i < PRIV_SIZE; i++ )\n" - " {\n" - " sPrivateStorage[ i ] = src[ i ];\n" - " }\n" - // Note: unlike the local test, each thread runs the above copy loop independently, so nobody needs to wait for - // anybody else to sync up - "\n" - " %s3 tmp = vload3( offsets[ tid ], ( sPrivateStorage ) + alignmentOffsets[ tid ] );\n" - " results[ 3*tid ] = tmp.s0;\n" - " results[ 3*tid+1 ] = tmp.s1;\n" - " results[ 3*tid+2 ] = tmp.s2;\n" - "}\n"; - - const char *typeName = get_explicit_type_name(type); - if(inVectorSize ==3) { - sprintf( destBuffer, patternV3, - type == kDouble ? doubleExtensionPragma : "", - "", - typeName, 3*((int)inBufferSize), - typeName, typeName, - typeName ); - // log_info("Src is \"\n%s\n\"\n", destBuffer); - } else { - sprintf( destBuffer, pattern, - type == kDouble ? doubleExtensionPragma : "", - "", - typeName, (int)inVectorSize, (int)inBufferSize, - typeName, (int)inVectorSize, typeName, (int)outVectorSize, - (int)inBufferSize, - typeName, (int)inVectorSize, (int)inVectorSize, typeName ); - } -} - -int test_vload_private(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems ) -{ - // We have no idea how much actual private storage is available, so just pick a reasonable value, - // which is that we can fit at least two 16-element long, which is 2*8 bytes * 16 = 256 bytes - return test_vloadset( device, context, queue, create_private_load_code, 256 ); -} - - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#pragma mark -------------------- vstore harness -------------------------- - -typedef void (*create_vstore_program_fn)( char *destBuffer, size_t inBufferSize, ExplicitType type, size_t inVectorSize ); - -int test_vstore( cl_device_id device, cl_context context, cl_command_queue queue, ExplicitType type, unsigned int vecSize, - create_vstore_program_fn createFn, size_t bufferSize, MTdata d ) -{ - int error; - - clProgramWrapper program; - clKernelWrapper kernel; - clMemWrapper streams[ 3 ]; - - size_t threads[ 1 ], localThreads[ 1 ]; - - size_t numElements, typeSize, numStores = (DEBUG) ? 16 : NUM_LOADS; - - if (DEBUG) - bufferSize = (bufferSize < 128) ? bufferSize : 128; - - typeSize = get_explicit_type_size( type ); - numElements = bufferSize / ( typeSize * vecSize ); - bufferSize = numElements * typeSize * vecSize; // To account for rounding - if( numStores > numElements * 2 / 3 ) - { - // Note: unlike load, we have to restrict the # of stores here, since all offsets must be unique for our test - // (Plus, we leave some room for extra values to make sure didn't get written) - numStores = numElements * 2 / 3; - if( numStores < 1 ) - numStores = 1; - } - if (DEBUG) - log_info("Testing: numStores: %d, typeSize: %d, vecSize: %d, numElements: %d, bufferSize: %d\n", (int)numStores, (int)typeSize, vecSize, (int)numElements, (int)bufferSize); -#if !(defined(_WIN32) && defined(_MSC_VER)) - cl_uint offsets[ numStores ]; -#else - cl_uint* offsets = (cl_uint*)_malloca(numStores * sizeof(cl_uint)); -#endif - char programSrc[ 10240 ]; - size_t i; - -#if !(defined(_WIN32) && defined(_MSC_VER)) - char inBuffer[ numStores * typeSize * vecSize ]; -#else - char* inBuffer = (char*)_malloca( numStores * typeSize * vecSize * sizeof(cl_char)); -#endif - clProtectedArray outBuffer( numElements * typeSize * vecSize ); -#if !(defined(_WIN32) && defined(_MSC_VER)) - char referenceBuffer[ numElements * typeSize * vecSize ]; -#else - char* referenceBuffer = (char*)_malloca(numElements * typeSize * vecSize * sizeof(cl_char)); -#endif - - // Create some random input data and random offsets to load from - generate_random_data( type, numStores * vecSize, d, (void *)inBuffer ); - - // Note: make sure no two offsets are the same, otherwise the output would depend on - // the order that threads ran in, and that would be next to impossible to verify -#if !(defined(_WIN32) && defined(_MSC_VER)) - char flags[ numElements ]; -#else - char* flags = (char*)_malloca( numElements * sizeof(char)); -#endif - - memset( flags, 0, numElements * sizeof(char) ); - for( i = 0; i < numStores; i++ ) - { - do - { - offsets[ i ] = (cl_uint)random_in_range( 0, (int)numElements - 2, d ); // Note: keep it one vec below the end for offset testing - } while( flags[ offsets[ i ] ] != 0 ); - flags[ offsets[ i ] ] = -1; - if (LINEAR_OFFSETS) - offsets[i] = (int)i; - } - if (LINEAR_OFFSETS) - log_info("Offsets set to thread IDs to simplify output.\n"); - - createFn( programSrc, numElements, type, vecSize ); - - // Create our kernel - const char *ptr = programSrc; - error = create_single_kernel_helper( context, &program, &kernel, 1, &ptr, "test_fn" ); - test_error( error, "Unable to create testing kernel" ); - if (DEBUG) log_info("Kernel: \n%s\n", programSrc); - - // Get the number of args to differentiate the kernels with local storage. (They have 5) - cl_uint numArgs; - error = clGetKernelInfo(kernel, CL_KERNEL_NUM_ARGS, sizeof(numArgs), &numArgs, NULL); - test_error( error, "clGetKernelInfo failed"); - - // Set up parameters - streams[ 0 ] = clCreateBuffer( context, CL_MEM_COPY_HOST_PTR, numStores * typeSize * vecSize * sizeof(cl_char), (void *)inBuffer, &error ); - test_error( error, "Unable to create kernel stream" ); - streams[ 1 ] = clCreateBuffer( context, CL_MEM_COPY_HOST_PTR, numStores * sizeof(cl_uint), offsets, &error ); - test_error( error, "Unable to create kernel stream" ); - streams[ 2 ] = clCreateBuffer( context, CL_MEM_COPY_HOST_PTR, numElements * typeSize * vecSize, (void *)outBuffer, &error ); - test_error( error, "Unable to create kernel stream" ); - - // Set parameters and run - if (numArgs == 5) - { - // We need to set the size of the local storage - error = clSetKernelArg(kernel, 0, bufferSize, NULL); - test_error( error, "clSetKernelArg for buffer failed"); - for( i = 0; i < 3; i++ ) - { - error = clSetKernelArg( kernel, (int)i+1, sizeof( streams[ i ] ), &streams[ i ] ); - test_error( error, "Unable to set kernel argument" ); - } - } - else - { - // No local storage - for( i = 0; i < 3; i++ ) - { - error = clSetKernelArg( kernel, (int)i, sizeof( streams[ i ] ), &streams[ i ] ); - if (error) - log_info("%s\n", programSrc); - test_error( error, "Unable to set kernel argument" ); - } - } - - threads[ 0 ] = numStores; - error = get_max_common_work_group_size( context, kernel, threads[ 0 ], &localThreads[ 0 ] ); - test_error( error, "Unable to get local thread size" ); - - // Run in a loop, changing the address offset from 0 to ( vecSize - 1 ) each time, since - // otherwise stores might overlap each other, and it'd be a nightmare to test! - for( cl_uint addressOffset = 0; addressOffset < vecSize; addressOffset++ ) - { - if (DEBUG) - log_info("\tstore addressOffset is %d, executing with threads %d\n", addressOffset, (int)threads[0]); - - // Clear the results first - memset( outBuffer, 0, numElements * typeSize * vecSize ); - error = clEnqueueWriteBuffer( queue, streams[ 2 ], CL_TRUE, 0, numElements * typeSize * vecSize, (void *)outBuffer, 0, NULL, NULL ); - test_error( error, "Unable to erase result stream" ); - - // Set up the new offset and run - if (numArgs == 5) - error = clSetKernelArg( kernel, 3+1, sizeof( cl_uint ), &addressOffset ); - else - error = clSetKernelArg( kernel, 3, sizeof( cl_uint ), &addressOffset ); - test_error( error, "Unable to set address offset argument" ); - - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); - test_error( error, "Unable to exec kernel" ); - - // Get the results - error = clEnqueueReadBuffer( queue, streams[ 2 ], CL_TRUE, 0, numElements * typeSize * vecSize, (void *)outBuffer, 0, NULL, NULL ); - test_error( error, "Unable to read results" ); - - - // Create the reference results - memset( referenceBuffer, 0, numElements * typeSize * vecSize * sizeof(cl_char) ); - for( i = 0; i < numStores; i++ ) - { - memcpy( referenceBuffer + ( ( offsets[ i ] * vecSize ) + addressOffset ) * typeSize, inBuffer + i * typeSize * vecSize, typeSize * vecSize ); - } - - // Validate the results now - char *expected = referenceBuffer; - char *actual = (char *)(void *)outBuffer; - - if (DEBUG) - { - log_info("Memory contents:\n"); - for (i=0; i>2) ], offsets[ tid ], destBuffer + alignmentOffset );\n" - " } else {\n" - " vstore3( vload3(tid, (__global %s *)srcValues), offsets[ tid ], destBuffer + alignmentOffset );\n" - " }\n" - "}\n"; - - const char *typeName = get_explicit_type_name(type); - - if(inVectorSize == 3) { - sprintf( destBuffer, patternV3, - type == kDouble ? doubleExtensionPragma : "", - typeName, typeName, typeName); - - } else { - sprintf( destBuffer, pattern, - type == kDouble ? doubleExtensionPragma : "", - typeName, (int)inVectorSize, typeName, (int)inVectorSize ); - } - // if(inVectorSize == 3 || inVectorSize == 4) { - // log_info("\n----\n%s\n----\n", destBuffer); - // } -} - -int test_vstore_global(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems ) -{ - return test_vstoreset( device, context, queue, create_global_store_code, 10240 ); -} - - -void create_local_store_code( char *destBuffer, size_t inBufferSize, ExplicitType type, size_t inVectorSize ) -{ - const char *pattern = - "%s" - "\n" - "__kernel void test_fn(__local %s%d *sSharedStorage, __global %s%d *srcValues, __global uint *offsets, __global %s%d *destBuffer, uint alignmentOffset )\n" - "{\n" - " int tid = get_global_id( 0 );\n" - // We need to zero the shared storage since any locations we don't write to will have garbage otherwise. - " sSharedStorage[ offsets[tid] ] = (%s%d)(%s)0;\n" - " sSharedStorage[ offsets[tid] +1 ] = sSharedStorage[ offsets[tid] ];\n" - " barrier( CLK_LOCAL_MEM_FENCE );\n" - "\n" - " vstore%d( srcValues[ tid ], offsets[ tid ], ( (__local %s *)sSharedStorage ) + alignmentOffset );\n" - "\n" - // Note: Once all threads are done vstore'ing into our shared storage, we then copy into the global output - // buffer, but we have to make sure ALL threads are done vstore'ing before we do the copy - " barrier( CLK_LOCAL_MEM_FENCE );\n" - "\n" - // Note: we only copy the relevant portion of our local storage over to the dest buffer, because - // otherwise, local threads would be overwriting results from other local threads - " int i;\n" - " __local %s *sp = (__local %s*) (sSharedStorage + offsets[tid]) + alignmentOffset;\n" - " __global %s *dp = (__global %s*) (destBuffer + offsets[tid]) + alignmentOffset;\n" - " for( i = 0; (size_t)i < sizeof( sSharedStorage[0]) / sizeof( *sp ); i++ ) \n" - " dp[i] = sp[i];\n" - "}\n"; - - const char *patternV3 = - "%s" - "\n" - "__kernel void test_fn(__local %s *sSharedStorage, __global %s *srcValues, __global uint *offsets, __global %s *destBuffer, uint alignmentOffset )\n" - "{\n" - " int tid = get_global_id( 0 );\n" - // We need to zero the shared storage since any locations we don't write to will have garbage otherwise. - " sSharedStorage[ 3*offsets[tid] ] = (%s)0;\n" - " sSharedStorage[ 3*offsets[tid] +1 ] = \n" - " sSharedStorage[ 3*offsets[tid] ];\n" - " sSharedStorage[ 3*offsets[tid] +2 ] = \n" - " sSharedStorage[ 3*offsets[tid]];\n" - " sSharedStorage[ 3*offsets[tid] +3 ] = \n" - " sSharedStorage[ 3*offsets[tid]];\n" - " sSharedStorage[ 3*offsets[tid] +4 ] = \n" - " sSharedStorage[ 3*offsets[tid] ];\n" - " sSharedStorage[ 3*offsets[tid] +5 ] = \n" - " sSharedStorage[ 3*offsets[tid]];\n" - " barrier( CLK_LOCAL_MEM_FENCE );\n" - "\n" - " vstore3( vload3(tid,srcValues), offsets[ tid ], sSharedStorage + alignmentOffset );\n" - "\n" - // Note: Once all threads are done vstore'ing into our shared storage, we then copy into the global output - // buffer, but we have to make sure ALL threads are done vstore'ing before we do the copy - " barrier( CLK_LOCAL_MEM_FENCE );\n" - "\n" - // Note: we only copy the relevant portion of our local storage over to the dest buffer, because - // otherwise, local threads would be overwriting results from other local threads - " int i;\n" - " __local %s *sp = (sSharedStorage + 3*offsets[tid]) + alignmentOffset;\n" - " __global %s *dp = (destBuffer + 3*offsets[tid]) + alignmentOffset;\n" - " for( i = 0; i < 3; i++ ) \n" - " dp[i] = sp[i];\n" - "}\n"; - - const char *typeName = get_explicit_type_name(type); - if(inVectorSize == 3) { - sprintf( destBuffer, patternV3, - type == kDouble ? doubleExtensionPragma : "", - typeName, - typeName, - typeName, typeName, - typeName, typeName, typeName ); - } else { - sprintf( destBuffer, pattern, - type == kDouble ? doubleExtensionPragma : "", - typeName, (int)inVectorSize, - typeName, (int)inVectorSize, typeName, (int)inVectorSize, - typeName, (int)inVectorSize, typeName, - (int)inVectorSize, typeName, typeName, - typeName, typeName, typeName ); - } - // log_info(destBuffer); -} - -int test_vstore_local(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems ) -{ - // Determine the max size of a local buffer that we can test against - cl_ulong localSize; - int error = clGetDeviceInfo( device, CL_DEVICE_LOCAL_MEM_SIZE, sizeof( localSize ), &localSize, NULL ); - test_error( error, "Unable to get max size of local memory buffer" ); - if( localSize > 10240 ) - localSize = 10240; - if (localSize > 4096) - localSize -= 2048; - else - localSize /= 2; - return test_vstoreset( device, context, queue, create_local_store_code, (size_t)localSize ); -} - - -void create_private_store_code( char *destBuffer, size_t inBufferSize, ExplicitType type, size_t inVectorSize ) -{ - const char *pattern = - "%s" - // Private memory is unique per thread, unlike local storage which is unique per local work group. Which means - // for this test, we have to copy the entire test buffer into private storage ON EACH THREAD to be an effective test - "\n" - "__kernel void test_fn( __global %s%d *srcValues, __global uint *offsets, __global %s%d *destBuffer, uint alignmentOffset )\n" - "{\n" - " __private %s%d sPrivateStorage[ %d ];\n" - " int tid = get_global_id( 0 );\n" - // We need to zero the shared storage since any locations we don't write to will have garbage otherwise. - " sPrivateStorage[tid] = (%s%d)(%s)0;\n" - "\n" - " vstore%d( srcValues[ tid ], offsets[ tid ], ( (__private %s *)sPrivateStorage ) + alignmentOffset );\n" - "\n" - // Note: we only copy the relevant portion of our local storage over to the dest buffer, because - // otherwise, local threads would be overwriting results from other local threads - " uint i;\n" - " __private %s *sp = (__private %s*) (sPrivateStorage + offsets[tid]) + alignmentOffset;\n" - " __global %s *dp = (__global %s*) (destBuffer + offsets[tid]) + alignmentOffset;\n" - " for( i = 0; i < sizeof( sPrivateStorage[0]) / sizeof( *sp ); i++ ) \n" - " dp[i] = sp[i];\n" - "}\n"; - - - const char *patternV3 = - "%s" - // Private memory is unique per thread, unlike local storage which is unique per local work group. Which means - // for this test, we have to copy the entire test buffer into private storage ON EACH THREAD to be an effective test - "\n" - "__kernel void test_fn( __global %s *srcValues, __global uint *offsets, __global %s3 *destBuffer, uint alignmentOffset )\n" - "{\n" - " __private %s3 sPrivateStorage[ %d ];\n" // keep this %d - " int tid = get_global_id( 0 );\n" - // We need to zero the shared storage since any locations we don't write to will have garbage otherwise. - " sPrivateStorage[tid] = (%s3)(%s)0;\n" - "\n" - - " vstore3( vload3(tid,srcValues), offsets[ tid ], ( (__private %s *)sPrivateStorage ) + alignmentOffset );\n" - "\n" - // Note: we only copy the relevant portion of our local storage over to the dest buffer, because - // otherwise, local threads would be overwriting results from other local threads - " uint i;\n" - " __private %s *sp = ((__private %s*) sPrivateStorage) + 3*offsets[tid] + alignmentOffset;\n" - " __global %s *dp = ((__global %s*) destBuffer) + 3*offsets[tid] + alignmentOffset;\n" - " for( i = 0; i < 3; i++ ) \n" - " dp[i] = sp[i];\n" - "}\n"; - - const char *typeName = get_explicit_type_name(type); - if(inVectorSize == 3) { - sprintf( destBuffer, patternV3, - type == kDouble ? doubleExtensionPragma : "", - typeName, typeName, - typeName, (int)inBufferSize, - typeName, typeName, - typeName, typeName, typeName, typeName, typeName ); - } else { - sprintf( destBuffer, pattern, - type == kDouble ? doubleExtensionPragma : "", - typeName, (int)inVectorSize, typeName, (int)inVectorSize, - typeName, (int)inVectorSize, (int)inBufferSize, - typeName, (int)inVectorSize, typeName, - (int)inVectorSize, typeName, typeName, typeName, typeName, typeName ); - } -} - -int test_vstore_private(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems ) -{ - // We have no idea how much actual private storage is available, so just pick a reasonable value, - // which is that we can fit at least two 16-element long, which is 2*8 bytes * 16 = 256 bytes - return test_vstoreset( device, context, queue, create_private_store_code, 256 ); -} - - - diff --git a/test_conformance/compatibility/test_conformance/basic/test_vloadstore.c b/test_conformance/basic/test_vloadstore.cpp similarity index 99% rename from test_conformance/compatibility/test_conformance/basic/test_vloadstore.c rename to test_conformance/basic/test_vloadstore.cpp index 7a7911b9..e137f9e7 100644 --- a/test_conformance/compatibility/test_conformance/basic/test_vloadstore.c +++ b/test_conformance/basic/test_vloadstore.cpp @@ -13,9 +13,10 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include +#include #include #include #include @@ -23,9 +24,9 @@ #include "procs.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/errorHelpers.h" +#include "harness/conversions.h" +#include "harness/typeWrappers.h" +#include "harness/errorHelpers.h" // Outputs debug information for stores #define DEBUG 0 diff --git a/test_conformance/basic/test_wg_barrier.c b/test_conformance/basic/test_wg_barrier.cpp similarity index 96% rename from test_conformance/basic/test_wg_barrier.c rename to test_conformance/basic/test_wg_barrier.cpp index e23490d3..e89f4db5 100644 --- a/test_conformance/basic/test_wg_barrier.c +++ b/test_conformance/basic/test_wg_barrier.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -87,7 +87,9 @@ test_wg_barrier(cl_device_id device, cl_context context, cl_command_queue queue, size_t max_threadgroup_size = 0; MTdata d; - err = create_single_kernel_helper_with_build_options(context, &program, &kernel, 1, &wg_barrier_kernel_code, "compute_sum", "-cl-std=CL2.0" ); + err = create_single_kernel_helper_with_build_options( + context, &program, &kernel, 1, &wg_barrier_kernel_code, "compute_sum", + nullptr); test_error(err, "Failed to build kernel/program."); err = clGetKernelWorkGroupInfo(kernel, device, CL_KERNEL_WORK_GROUP_SIZE, diff --git a/test_conformance/basic/test_work_item_functions.cpp b/test_conformance/basic/test_work_item_functions.cpp index a9ae4df8..d95915cf 100644 --- a/test_conformance/basic/test_work_item_functions.cpp +++ b/test_conformance/basic/test_work_item_functions.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -23,10 +23,10 @@ #include "procs.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/conversions.h" +#include "harness/typeWrappers.h" -typedef struct work_item_data +struct work_item_data { cl_uint workDim; cl_uint globalSize[ 3 ]; @@ -130,7 +130,7 @@ int test_work_item_functions(cl_device_id deviceID, cl_context context, cl_comma free_mtdata(d); return -1; } - if( testData[ q ].globalID[ j ] < 0 || testData[ q ].globalID[ j ] >= (cl_uint)threads[ j ] ) + if (testData[q].globalID[j] >= (cl_uint)threads[j]) { log_error( "ERROR: get_global_id(%d) did not return proper value for %d dimensions (max %d, got %d)\n", (int)j, (int)dim, (int)threads[ j ], (int)testData[ q ].globalID[ j ] ); @@ -144,7 +144,7 @@ int test_work_item_functions(cl_device_id deviceID, cl_context context, cl_comma free_mtdata(d); return -1; } - if( testData[ q ].localID[ j ] < 0 && testData[ q ].localID[ j ] >= (cl_uint)localThreads[ j ] ) + if (testData[q].localID[j] >= (cl_uint)localThreads[j]) { log_error( "ERROR: get_local_id(%d) did not return proper value for %d dimensions (max %d, got %d)\n", (int)j, (int)dim, (int)localThreads[ j ], (int)testData[ q ].localID[ j ] ); @@ -159,7 +159,7 @@ int test_work_item_functions(cl_device_id deviceID, cl_context context, cl_comma free_mtdata(d); return -1; } - if( testData[ q ].groupID[ j ] < 0 || testData[ q ].groupID[ j ] >= (cl_uint)groupCount ) + if (testData[q].groupID[j] >= (cl_uint)groupCount) { log_error( "ERROR: get_group_id(%d) did not return proper value for %d dimensions (max %d, got %d)\n", (int)j, (int)dim, (int)groupCount, (int)testData[ q ].groupID[ j ] ); diff --git a/test_conformance/basic/test_writeimage.c b/test_conformance/basic/test_writeimage.cpp similarity index 99% rename from test_conformance/basic/test_writeimage.c rename to test_conformance/basic/test_writeimage.cpp index da4bd99d..259b50d9 100644 --- a/test_conformance/basic/test_writeimage.c +++ b/test_conformance/basic/test_writeimage.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/basic/test_writeimage_fp32.c b/test_conformance/basic/test_writeimage_fp32.cpp similarity index 99% rename from test_conformance/basic/test_writeimage_fp32.c rename to test_conformance/basic/test_writeimage_fp32.cpp index 0fc2f3de..fef71874 100644 --- a/test_conformance/basic/test_writeimage_fp32.c +++ b/test_conformance/basic/test_writeimage_fp32.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/basic/test_writeimage_int16.c b/test_conformance/basic/test_writeimage_int16.cpp similarity index 99% rename from test_conformance/basic/test_writeimage_int16.c rename to test_conformance/basic/test_writeimage_int16.cpp index c084c3a4..8afb77a9 100644 --- a/test_conformance/basic/test_writeimage_int16.c +++ b/test_conformance/basic/test_writeimage_int16.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/buffers/CMakeLists.txt b/test_conformance/buffers/CMakeLists.txt index 8e699e67..4b1ad285 100644 --- a/test_conformance/buffers/CMakeLists.txt +++ b/test_conformance/buffers/CMakeLists.txt @@ -1,27 +1,17 @@ set(MODULE_NAME BUFFERS) set(${MODULE_NAME}_SOURCES - main.c - test_buffer_copy.c - test_buffer_read.c - test_buffer_write.c - test_buffer_mem.c - array_info.c - test_buffer_map.c + main.cpp + test_buffer_copy.cpp + test_buffer_read.cpp + test_buffer_write.cpp + test_buffer_mem.cpp + array_info.cpp + test_buffer_map.cpp test_sub_buffers.cpp - test_buffer_fill.c - test_buffer_migrate.c - test_image_migrate.c - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/threadTesting.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/typeWrappers.cpp - ../../test_common/harness/mt19937.c - ../../test_common/harness/conversions.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c + test_buffer_fill.cpp + test_buffer_migrate.cpp + test_image_migrate.cpp ) include(../CMakeCommon.txt) diff --git a/test_conformance/buffers/array_info.c b/test_conformance/buffers/array_info.cpp similarity index 97% rename from test_conformance/buffers/array_info.c rename to test_conformance/buffers/array_info.cpp index 1fe0c553..be33c007 100644 --- a/test_conformance/buffers/array_info.c +++ b/test_conformance/buffers/array_info.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/buffers/main.c b/test_conformance/buffers/main.cpp similarity index 98% rename from test_conformance/buffers/main.c rename to test_conformance/buffers/main.cpp index 013cf659..1a5c8644 100644 --- a/test_conformance/buffers/main.c +++ b/test_conformance/buffers/main.cpp @@ -13,13 +13,13 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include #include #include "procs.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" test_definition test_list[] = { ADD_TEST( buffer_read_async_int ), diff --git a/test_conformance/buffers/procs.h b/test_conformance/buffers/procs.h index 256a4ccc..fb0f851a 100644 --- a/test_conformance/buffers/procs.h +++ b/test_conformance/buffers/procs.h @@ -16,12 +16,12 @@ #ifndef __PROCS_H__ #define __PROCS_H__ -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/mt19937.h" -#include "../../test_common/harness/conversions.h" +#include "harness/kernelHelpers.h" +#include "harness/testHarness.h" +#include "harness/errorHelpers.h" +#include "harness/typeWrappers.h" +#include "harness/mt19937.h" +#include "harness/conversions.h" #ifndef __APPLE__ #include diff --git a/test_conformance/buffers/test_buffer_copy.c b/test_conformance/buffers/test_buffer_copy.cpp similarity index 99% rename from test_conformance/buffers/test_buffer_copy.c rename to test_conformance/buffers/test_buffer_copy.cpp index fa2d579d..62862d2e 100644 --- a/test_conformance/buffers/test_buffer_copy.c +++ b/test_conformance/buffers/test_buffer_copy.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -22,7 +22,7 @@ #include #include "procs.h" -#include "../../test_common/harness/errorHelpers.h" +#include "harness/errorHelpers.h" static int verify_copy_buffer(int *inptr, int *outptr, int n) diff --git a/test_conformance/buffers/test_buffer_fill.c b/test_conformance/buffers/test_buffer_fill.cpp similarity index 99% rename from test_conformance/buffers/test_buffer_fill.c rename to test_conformance/buffers/test_buffer_fill.cpp index f5662da7..142b7da0 100644 --- a/test_conformance/buffers/test_buffer_fill.c +++ b/test_conformance/buffers/test_buffer_fill.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -22,7 +22,7 @@ #include #include "procs.h" -#include "../../test_common/harness/errorHelpers.h" +#include "harness/errorHelpers.h" #define USE_LOCAL_WORK_GROUP 1 diff --git a/test_conformance/buffers/test_buffer_map.c b/test_conformance/buffers/test_buffer_map.cpp similarity index 99% rename from test_conformance/buffers/test_buffer_map.c rename to test_conformance/buffers/test_buffer_map.cpp index 0f7089da..f0363dd5 100644 --- a/test_conformance/buffers/test_buffer_map.c +++ b/test_conformance/buffers/test_buffer_map.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -22,7 +22,7 @@ #include #include "procs.h" -#include "../../test_common/harness/errorHelpers.h" +#include "harness/errorHelpers.h" #define TEST_PRIME_INT ((1<<16)+1) @@ -595,7 +595,8 @@ static int test_buffer_map_read( cl_device_id deviceID, cl_context context, cl_c else buffers[i] = clCreateBuffer(context, flag_set[src_flag_id], ptrSizes[i] * num_elements, NULL, &err); - if ( ! buffers[i] | err){ + if (!buffers[i] || err) + { print_error(err, "clCreateBuffer failed\n" ); align_free( outptr[i] ); return -1; diff --git a/test_conformance/buffers/test_buffer_mem.c b/test_conformance/buffers/test_buffer_mem.cpp similarity index 99% rename from test_conformance/buffers/test_buffer_mem.c rename to test_conformance/buffers/test_buffer_mem.cpp index 380ca41e..a471c0f7 100644 --- a/test_conformance/buffers/test_buffer_mem.c +++ b/test_conformance/buffers/test_buffer_mem.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/buffers/test_buffer_migrate.c b/test_conformance/buffers/test_buffer_migrate.cpp similarity index 96% rename from test_conformance/buffers/test_buffer_migrate.c rename to test_conformance/buffers/test_buffer_migrate.cpp index 1c4ba043..a5b6f26a 100644 --- a/test_conformance/buffers/test_buffer_migrate.c +++ b/test_conformance/buffers/test_buffer_migrate.cpp @@ -17,8 +17,8 @@ #include #include "procs.h" -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/errorHelpers.h" +#include "harness/testHarness.h" #define MAX_SUB_DEVICES 16 // Limit the sub-devices to ensure no out of resource errors. #define BUFFER_SIZE 1024 @@ -69,6 +69,7 @@ static cl_int migrateMemObject(enum migrations migrate, cl_command_queue *queues // Choose a random set of flags flags[i] = (cl_mem_migration_flags)(genrand_int32(d) & (CL_MIGRATE_MEM_OBJECT_HOST | CL_MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED));; break; + default: log_error("Unhandled migration type: %d\n", migrate); return -1; } if ((err = clEnqueueMigrateMemObjects(queues[j], 1, (const cl_mem *)(&mem_objects[i]), flags[i], 0, NULL, NULL)) != CL_SUCCESS) { print_error(err, "Failed migrating memory object."); @@ -203,7 +204,7 @@ int test_buffer_migrate(cl_device_id deviceID, cl_context context, cl_command_qu // Create a command queue for each sub-device for (i=0; i #include diff --git a/test_conformance/buffers/test_buffer_write.c b/test_conformance/buffers/test_buffer_write.cpp similarity index 99% rename from test_conformance/buffers/test_buffer_write.c rename to test_conformance/buffers/test_buffer_write.cpp index c7b4dc60..0f672807 100644 --- a/test_conformance/buffers/test_buffer_write.c +++ b/test_conformance/buffers/test_buffer_write.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -22,7 +22,7 @@ #include #include "procs.h" -#include "../../test_common/harness/errorHelpers.h" +#include "harness/errorHelpers.h" #define USE_LOCAL_WORK_GROUP 1 diff --git a/test_conformance/buffers/test_image_migrate.c b/test_conformance/buffers/test_image_migrate.cpp similarity index 96% rename from test_conformance/buffers/test_image_migrate.c rename to test_conformance/buffers/test_image_migrate.cpp index c3c29757..31bb0a21 100644 --- a/test_conformance/buffers/test_image_migrate.c +++ b/test_conformance/buffers/test_image_migrate.cpp @@ -17,7 +17,7 @@ #include #include "procs.h" -#include "../../test_common/harness/errorHelpers.h" +#include "harness/errorHelpers.h" #define MAX_SUB_DEVICES 16 // Limit the sub-devices to ensure no out of resource errors. #define MEM_OBJ_SIZE 1024 @@ -80,6 +80,7 @@ static cl_int migrateMemObject(enum migrations migrate, cl_command_queue *queues // Choose a random set of flags flags[i] = (cl_mem_migration_flags)(genrand_int32(d) & (CL_MIGRATE_MEM_OBJECT_HOST | CL_MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED)); break; + default: log_error("Unhandled migration type: %d\n", migrate); return -1; } if ((err = clEnqueueMigrateMemObjects(queues[j], 1, (const cl_mem *)(&mem_objects[i]), flags[i], 0, NULL, NULL)) != CL_SUCCESS) { @@ -112,14 +113,6 @@ static cl_int restoreImage(cl_command_queue *queues, cl_mem *mem_objects, cl_uin return CL_SUCCESS; } -// Declaration moved out of protected scope/goto -cl_sampler_properties properties[] = { - CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE, - CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP, - CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST, - 0 -}; - int test_image_migrate(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) { int failed = 0; @@ -244,7 +237,7 @@ int test_image_migrate(cl_device_id deviceID, cl_context context, cl_command_que // Create a command queue for each sub-device for (i=0; i public: using CBasicTest::LocalMemory; using CBasicTest::MaxGroupSize; + using CBasicTest::CheckCapabilities; CBasicTestMemOrderScope(TExplicitAtomicType dataType, bool useSVM = false) : CBasicTest(dataType, useSVM) { } @@ -391,6 +474,10 @@ public: MaxGroupSize(16); // increase number of groups by forcing smaller group size else MaxGroupSize(0); // group size limited by device capabilities + + if (CheckCapabilities(MemoryScope(), MemoryOrder()) == TEST_SKIPPED_ITSELF) + return 0; // skip test - not applicable + return CBasicTest::ExecuteSingleTest(deviceID, context, queue); } virtual int ExecuteForEachParameterSet(cl_device_id deviceID, cl_context context, cl_command_queue queue) @@ -472,6 +559,8 @@ public: using CBasicTestMemOrderScope::MemoryScope; using CBasicTestMemOrderScope::MemoryOrderStr; using CBasicTestMemOrderScope::MemoryScopeStr; + using CBasicTest::CheckCapabilities; + CBasicTestMemOrder2Scope(TExplicitAtomicType dataType, bool useSVM = false) : CBasicTestMemOrderScope(dataType, useSVM) { } @@ -519,6 +608,15 @@ public: MemoryOrder(memoryOrder[oi]); MemoryOrder2(memoryOrder[o2i]); MemoryScope(memoryScope[si]); + + if (CheckCapabilities(MemoryScope(), MemoryOrder()) + == TEST_SKIPPED_ITSELF) + continue; // skip test - not applicable + + if (CheckCapabilities(MemoryScope(), MemoryOrder2()) + == TEST_SKIPPED_ITSELF) + continue; // skip test - not applicable + EXECUTE_TEST(error, (CBasicTest::ExecuteForEachParameterSet(deviceID, context, queue))); } } @@ -857,8 +955,9 @@ int CBasicTest::ExecuteSingleTest(cl_device_id dev // Set up the kernel code programSource = PragmaHeader(deviceID)+ProgramHeader(numDestItems)+FunctionCode()+KernelCode(numDestItems); programLine = programSource.c_str(); - if(create_single_kernel_helper_with_build_options(context, &program, &kernel, 1, &programLine, "test_atomic_kernel", - gOldAPI ? "" : "-cl-std=CL2.0")) + if (create_single_kernel_helper_with_build_options( + context, &program, &kernel, 1, &programLine, "test_atomic_kernel", + gOldAPI ? "" : nullptr)) { return -1; } diff --git a/test_conformance/c11_atomics/host_atomics.h b/test_conformance/c11_atomics/host_atomics.h index 9a044ded..6c4e783a 100644 --- a/test_conformance/c11_atomics/host_atomics.h +++ b/test_conformance/c11_atomics/host_atomics.h @@ -16,7 +16,7 @@ #ifndef _HOST_ATOMICS_H_ #define _HOST_ATOMICS_H_ -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" #ifdef WIN32 #include "Windows.h" diff --git a/test_conformance/c11_atomics/main.cpp b/test_conformance/c11_atomics/main.cpp index 27904f94..41b253a0 100644 --- a/test_conformance/c11_atomics/main.cpp +++ b/test_conformance/c11_atomics/main.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" #include #include @@ -26,6 +26,8 @@ bool gUseHostPtr = false; // use malloc/free with CL_MEM_USE_HOST_PTR instead of bool gDebug = false; // always print OpenCL kernel code int gInternalIterations = 10000; // internal test iterations for atomic operation, sufficient to verify atomicity int gMaxDeviceThreads = 1024; // maximum number of threads executed on OCL device +cl_device_atomic_capabilities gAtomicMemCap, + gAtomicFenceCap; // atomic memory and fence capabilities for this device extern int test_atomic_init(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_atomic_store(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); @@ -105,6 +107,77 @@ test_definition test_list[] = { const int test_num = ARRAY_SIZE( test_list ); +test_status InitCL(cl_device_id device) { + auto version = get_device_cl_version(device); + auto expected_min_version = Version(2, 0); + + if (version < expected_min_version) + { + version_expected_info("Test", "OpenCL", + expected_min_version.to_string().c_str(), + version.to_string().c_str()); + return TEST_SKIP; + } + + if (version >= Version(3, 0)) + { + cl_int error; + + error = clGetDeviceInfo(device, CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES, + sizeof(gAtomicMemCap), &gAtomicMemCap, NULL); + if (error != CL_SUCCESS) + { + print_error(error, "Unable to get atomic memory capabilities\n"); + return TEST_FAIL; + } + + error = + clGetDeviceInfo(device, CL_DEVICE_ATOMIC_FENCE_CAPABILITIES, + sizeof(gAtomicFenceCap), &gAtomicFenceCap, NULL); + if (error != CL_SUCCESS) + { + print_error(error, "Unable to get atomic fence capabilities\n"); + return TEST_FAIL; + } + + if ((gAtomicFenceCap + & (CL_DEVICE_ATOMIC_ORDER_RELAXED | CL_DEVICE_ATOMIC_ORDER_ACQ_REL + | CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP)) + == 0) + { + log_info( + "Minimum atomic fence capabilities unsupported by device\n"); + return TEST_FAIL; + } + + if ((gAtomicMemCap + & (CL_DEVICE_ATOMIC_ORDER_RELAXED + | CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP)) + == 0) + { + log_info( + "Minimum atomic memory capabilities unsupported by device\n"); + return TEST_FAIL; + } + } + else + { + // OpenCL 2.x device, default to all capabilities + gAtomicMemCap = CL_DEVICE_ATOMIC_ORDER_RELAXED + | CL_DEVICE_ATOMIC_ORDER_ACQ_REL | CL_DEVICE_ATOMIC_ORDER_SEQ_CST + | CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP | CL_DEVICE_ATOMIC_SCOPE_DEVICE + | CL_DEVICE_ATOMIC_SCOPE_ALL_DEVICES; + + gAtomicFenceCap = CL_DEVICE_ATOMIC_ORDER_RELAXED + | CL_DEVICE_ATOMIC_ORDER_ACQ_REL | CL_DEVICE_ATOMIC_ORDER_SEQ_CST + | CL_DEVICE_ATOMIC_SCOPE_WORK_ITEM + | CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP | CL_DEVICE_ATOMIC_SCOPE_DEVICE + | CL_DEVICE_ATOMIC_SCOPE_ALL_DEVICES; + } + + return TEST_PASS; +} + int main(int argc, const char *argv[]) { bool noCert = false; @@ -186,5 +259,5 @@ int main(int argc, const char *argv[]) log_info("*** Use of this mode is not sufficient to verify correctness. ***\n"); log_info("*** ***\n"); } - return runTestHarness(argc, argv, test_num, test_list, false, false, 0); + return runTestHarnessWithCheck(argc, argv, test_num, test_list, false, false, InitCL); } diff --git a/test_conformance/c11_atomics/test_atomics.cpp b/test_conformance/c11_atomics/test_atomics.cpp index d376f67a..c1e153be 100644 --- a/test_conformance/c11_atomics/test_atomics.cpp +++ b/test_conformance/c11_atomics/test_atomics.cpp @@ -13,9 +13,9 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/testHarness.h" +#include "harness/kernelHelpers.h" +#include "harness/typeWrappers.h" #include "common.h" #include "host_atomics.h" @@ -29,7 +29,9 @@ class CBasicTestStore : public CBasicTestMemOrderScope::OldValueCheck; using CBasicTestMemOrderScope::MemoryOrder; + using CBasicTestMemOrderScope::MemoryScope; using CBasicTestMemOrderScope::MemoryOrderScopeStr; + using CBasicTest::CheckCapabilities; CBasicTestStore(TExplicitAtomicType dataType, bool useSVM) : CBasicTestMemOrderScope(dataType, useSVM) { OldValueCheck(false); @@ -43,6 +45,10 @@ public: if(MemoryOrder() == MEMORY_ORDER_ACQUIRE || MemoryOrder() == MEMORY_ORDER_ACQ_REL) return 0; //skip test - not applicable + + if (CheckCapabilities(MemoryScope(), MemoryOrder()) == TEST_SKIPPED_ITSELF) + return 0; // skip test - not applicable + return CBasicTestMemOrderScope::ExecuteSingleTest(deviceID, context, queue); } virtual std::string ProgramCore() @@ -198,7 +204,9 @@ class CBasicTestLoad : public CBasicTestMemOrderScope::OldValueCheck; using CBasicTestMemOrderScope::MemoryOrder; + using CBasicTestMemOrderScope::MemoryScope; using CBasicTestMemOrderScope::MemoryOrderScopeStr; + using CBasicTest::CheckCapabilities; CBasicTestLoad(TExplicitAtomicType dataType, bool useSVM) : CBasicTestMemOrderScope(dataType, useSVM) { OldValueCheck(false); @@ -212,6 +220,10 @@ public: if(MemoryOrder() == MEMORY_ORDER_RELEASE || MemoryOrder() == MEMORY_ORDER_ACQ_REL) return 0; //skip test - not applicable + + if (CheckCapabilities(MemoryScope(), MemoryOrder()) == TEST_SKIPPED_ITSELF) + return 0; // skip test - not applicable + return CBasicTestMemOrderScope::ExecuteSingleTest(deviceID, context, queue); } virtual std::string ProgramCore() @@ -435,9 +447,11 @@ public: using CBasicTestMemOrder2Scope::MemoryOrder; using CBasicTestMemOrder2Scope::MemoryOrder2; using CBasicTestMemOrder2Scope::MemoryOrderScope; + using CBasicTestMemOrder2Scope::MemoryScope; using CBasicTestMemOrder2Scope::DataType; using CBasicTestMemOrder2Scope::Iterations; using CBasicTestMemOrder2Scope::IterationsStr; + using CBasicTest::CheckCapabilities; CBasicTestCompareStrong(TExplicitAtomicType dataType, bool useSVM) : CBasicTestMemOrder2Scope(dataType, useSVM) { StartValue(123456); @@ -451,6 +465,13 @@ public: if((MemoryOrder() == MEMORY_ORDER_RELAXED && MemoryOrder2() != MEMORY_ORDER_RELAXED) || (MemoryOrder() != MEMORY_ORDER_SEQ_CST && MemoryOrder2() == MEMORY_ORDER_SEQ_CST)) return 0; // failure argument shall be no stronger than the success + + if (CheckCapabilities(MemoryScope(), MemoryOrder()) == TEST_SKIPPED_ITSELF) + return 0; // skip test - not applicable + + if (CheckCapabilities(MemoryScope(), MemoryOrder2()) == TEST_SKIPPED_ITSELF) + return 0; // skip test - not applicable + return CBasicTestMemOrder2Scope::ExecuteSingleTest(deviceID, context, queue); } virtual std::string ProgramCore() @@ -698,9 +719,9 @@ public: std::string memoryOrderScope = MemoryOrderScopeStr(); std::string postfix(memoryOrderScope.empty() ? "" : "_explicit"); return - " oldValues[tid] = atomic_fetch_add"+postfix+"(&destMemory[0], tid + 3"+memoryOrderScope+");\n"+ - " atomic_fetch_add"+postfix+"(&destMemory[0], tid + 3"+memoryOrderScope+");\n" - " atomic_fetch_add"+postfix+"(&destMemory[0], tid + 3"+memoryOrderScope+");\n" + " oldValues[tid] = atomic_fetch_add"+postfix+"(&destMemory[0], ("+DataType().AddSubOperandTypeName()+")tid + 3"+memoryOrderScope+");\n"+ + " atomic_fetch_add"+postfix+"(&destMemory[0], ("+DataType().AddSubOperandTypeName()+")tid + 3"+memoryOrderScope+");\n" + " atomic_fetch_add"+postfix+"(&destMemory[0], ("+DataType().AddSubOperandTypeName()+")tid + 3"+memoryOrderScope+");\n" " atomic_fetch_add"+postfix+"(&destMemory[0], (("+DataType().AddSubOperandTypeName()+")tid + 3) << (sizeof("+DataType().AddSubOperandTypeName()+")-1)*8"+memoryOrderScope+");\n"; } virtual void HostFunction(cl_uint tid, cl_uint threadCount, volatile HostAtomicType *destMemory, HostDataType *oldValues) @@ -1761,7 +1782,16 @@ public: if (MemoryOrder() == MEMORY_ORDER_SEQ_CST) return 1; if (LocalMemory()) - return 32 * 1024 / 8 / CurrentGroupSize() - 1; //32KB of local memory required by spec + { + if (gIsEmbedded) + { + if (CurrentGroupSize() > 1024) + CurrentGroupSize(1024); + return 1; //1KB of local memory required by spec. Clamp group size to 1k and allow 1 variable per thread + } + else + return 32 * 1024 / 8 / CurrentGroupSize() - 1; //32KB of local memory required by spec + } return 256; } virtual std::string SingleTestName() diff --git a/test_conformance/clcpp/address_spaces/CMakeLists.txt b/test_conformance/clcpp/address_spaces/CMakeLists.txt index 7410b8fb..2b6369f6 100644 --- a/test_conformance/clcpp/address_spaces/CMakeLists.txt +++ b/test_conformance/clcpp/address_spaces/CMakeLists.txt @@ -2,13 +2,6 @@ set(MODULE_NAME CPP_ADDRESS_SPACES) set(${MODULE_NAME}_SOURCES main.cpp - - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c ) include(../../CMakeCommon.txt) diff --git a/test_conformance/clcpp/api/CMakeLists.txt b/test_conformance/clcpp/api/CMakeLists.txt index ac3e7dbb..30763d6f 100644 --- a/test_conformance/clcpp/api/CMakeLists.txt +++ b/test_conformance/clcpp/api/CMakeLists.txt @@ -2,12 +2,6 @@ set(MODULE_NAME CPP_API) set(${MODULE_NAME}_SOURCES main.cpp - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c ) include(../../CMakeCommon.txt) diff --git a/test_conformance/clcpp/atomics/CMakeLists.txt b/test_conformance/clcpp/atomics/CMakeLists.txt index 1ff163e3..4fb4bfd1 100644 --- a/test_conformance/clcpp/atomics/CMakeLists.txt +++ b/test_conformance/clcpp/atomics/CMakeLists.txt @@ -2,12 +2,6 @@ set(MODULE_NAME CPP_ATOMICS) set(${MODULE_NAME}_SOURCES main.cpp - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c ) include(../../CMakeCommon.txt) diff --git a/test_conformance/clcpp/attributes/CMakeLists.txt b/test_conformance/clcpp/attributes/CMakeLists.txt index e9e6539d..1b1c15aa 100644 --- a/test_conformance/clcpp/attributes/CMakeLists.txt +++ b/test_conformance/clcpp/attributes/CMakeLists.txt @@ -2,12 +2,6 @@ set(MODULE_NAME CPP_ATTRIBUTES) set(${MODULE_NAME}_SOURCES main.cpp - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c ) include(../../CMakeCommon.txt) diff --git a/test_conformance/clcpp/common.hpp b/test_conformance/clcpp/common.hpp index ff92f029..e0620026 100644 --- a/test_conformance/clcpp/common.hpp +++ b/test_conformance/clcpp/common.hpp @@ -24,13 +24,13 @@ #include // harness framework -#include "../../test_common/harness/compat.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" +#include "harness/compat.h" +#include "harness/testHarness.h" +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" // autotest -#include "../../test_common/autotest/autotest.hpp" +#include "autotest/autotest.hpp" // utils_common #include "utils_common/is_vector_type.hpp" diff --git a/test_conformance/clcpp/common_funcs/CMakeLists.txt b/test_conformance/clcpp/common_funcs/CMakeLists.txt index 8ec9b077..5e4d8b03 100644 --- a/test_conformance/clcpp/common_funcs/CMakeLists.txt +++ b/test_conformance/clcpp/common_funcs/CMakeLists.txt @@ -2,12 +2,6 @@ set(MODULE_NAME CPP_COMMON_FUNCS) set(${MODULE_NAME}_SOURCES main.cpp - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c ) include(../../CMakeCommon.txt) diff --git a/test_conformance/clcpp/convert/CMakeLists.txt b/test_conformance/clcpp/convert/CMakeLists.txt index 1f871c05..9f69feab 100644 --- a/test_conformance/clcpp/convert/CMakeLists.txt +++ b/test_conformance/clcpp/convert/CMakeLists.txt @@ -2,12 +2,6 @@ set(MODULE_NAME CPP_CONVERT) set(${MODULE_NAME}_SOURCES main.cpp - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c ) include(../../CMakeCommon.txt) diff --git a/test_conformance/clcpp/device_queue/CMakeLists.txt b/test_conformance/clcpp/device_queue/CMakeLists.txt index c9dcf91b..0e1b2ee4 100644 --- a/test_conformance/clcpp/device_queue/CMakeLists.txt +++ b/test_conformance/clcpp/device_queue/CMakeLists.txt @@ -2,12 +2,6 @@ set(MODULE_NAME CPP_DEVICE_QUEUE) set(${MODULE_NAME}_SOURCES main.cpp - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c ) include(../../CMakeCommon.txt) diff --git a/test_conformance/clcpp/geometric_funcs/CMakeLists.txt b/test_conformance/clcpp/geometric_funcs/CMakeLists.txt index 917e56dd..25d05ed1 100644 --- a/test_conformance/clcpp/geometric_funcs/CMakeLists.txt +++ b/test_conformance/clcpp/geometric_funcs/CMakeLists.txt @@ -2,12 +2,6 @@ set(MODULE_NAME CPP_GEOMETRIC_FUNCS) set(${MODULE_NAME}_SOURCES main.cpp - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c ) include(../../CMakeCommon.txt) diff --git a/test_conformance/clcpp/images/CMakeLists.txt b/test_conformance/clcpp/images/CMakeLists.txt index 51e45c16..3c92ecd7 100644 --- a/test_conformance/clcpp/images/CMakeLists.txt +++ b/test_conformance/clcpp/images/CMakeLists.txt @@ -2,15 +2,6 @@ set(MODULE_NAME CPP_IMAGES) set(${MODULE_NAME}_SOURCES main.cpp - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/mt19937.c - ../../../test_common/harness/conversions.c - ../../../test_common/harness/imageHelpers.cpp - ../../../test_common/harness/crc32.c ) include(../../CMakeCommon.txt) diff --git a/test_conformance/clcpp/images/common.hpp b/test_conformance/clcpp/images/common.hpp index f975d7ed..957d266d 100644 --- a/test_conformance/clcpp/images/common.hpp +++ b/test_conformance/clcpp/images/common.hpp @@ -21,10 +21,7 @@ #include "../common.hpp" #include "../funcs_test_utils.hpp" -// This global variable is used by read_image_pixel from harness/imageHelpers -bool gTestRounding = false; - -#include "../../../test_common/harness/imageHelpers.h" +#include "../harness/imageHelpers.h" namespace detail diff --git a/test_conformance/clcpp/images/main.cpp b/test_conformance/clcpp/images/main.cpp index 70b6c591..8c41bb6a 100644 --- a/test_conformance/clcpp/images/main.cpp +++ b/test_conformance/clcpp/images/main.cpp @@ -22,7 +22,6 @@ // FIXME: To use certain functions in test_common/harness/imageHelpers.h // (for example, generate_random_image_data()), the tests are required to declare // the following variable (hangover from code specific to Apple's implementation): -cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT; int main(int argc, const char *argv[]) { diff --git a/test_conformance/clcpp/integer_funcs/CMakeLists.txt b/test_conformance/clcpp/integer_funcs/CMakeLists.txt index 14a2517c..ba4cfe86 100644 --- a/test_conformance/clcpp/integer_funcs/CMakeLists.txt +++ b/test_conformance/clcpp/integer_funcs/CMakeLists.txt @@ -2,12 +2,6 @@ set(MODULE_NAME CPP_INTEGER_FUNCS) set(${MODULE_NAME}_SOURCES main.cpp - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c ) include(../../CMakeCommon.txt) diff --git a/test_conformance/clcpp/math_funcs/CMakeLists.txt b/test_conformance/clcpp/math_funcs/CMakeLists.txt index 1cd05c6f..c3b56c17 100644 --- a/test_conformance/clcpp/math_funcs/CMakeLists.txt +++ b/test_conformance/clcpp/math_funcs/CMakeLists.txt @@ -2,12 +2,6 @@ set(MODULE_NAME CPP_MATH_FUNCS) set(${MODULE_NAME}_SOURCES main.cpp - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c ) include(../../CMakeCommon.txt) diff --git a/test_conformance/clcpp/pipes/CMakeLists.txt b/test_conformance/clcpp/pipes/CMakeLists.txt index 57b6bf87..65daae97 100644 --- a/test_conformance/clcpp/pipes/CMakeLists.txt +++ b/test_conformance/clcpp/pipes/CMakeLists.txt @@ -2,12 +2,6 @@ set(MODULE_NAME CPP_PIPES) set(${MODULE_NAME}_SOURCES main.cpp - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c ) include(../../CMakeCommon.txt) diff --git a/test_conformance/clcpp/program_scope_ctors_dtors/CMakeLists.txt b/test_conformance/clcpp/program_scope_ctors_dtors/CMakeLists.txt index 9ea82c5e..fd36d300 100644 --- a/test_conformance/clcpp/program_scope_ctors_dtors/CMakeLists.txt +++ b/test_conformance/clcpp/program_scope_ctors_dtors/CMakeLists.txt @@ -2,12 +2,6 @@ set(MODULE_NAME CPP_PROGRAM_SCOPE_CTORS_DTORS) set(${MODULE_NAME}_SOURCES main.cpp - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c ) include(../../CMakeCommon.txt) diff --git a/test_conformance/clcpp/reinterpret/CMakeLists.txt b/test_conformance/clcpp/reinterpret/CMakeLists.txt index d893921e..ed02c56f 100644 --- a/test_conformance/clcpp/reinterpret/CMakeLists.txt +++ b/test_conformance/clcpp/reinterpret/CMakeLists.txt @@ -2,12 +2,6 @@ set(MODULE_NAME CPP_REINTERPRET) set(${MODULE_NAME}_SOURCES main.cpp - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c ) include(../../CMakeCommon.txt) diff --git a/test_conformance/clcpp/relational_funcs/CMakeLists.txt b/test_conformance/clcpp/relational_funcs/CMakeLists.txt index 8e1acc02..3a8389cb 100644 --- a/test_conformance/clcpp/relational_funcs/CMakeLists.txt +++ b/test_conformance/clcpp/relational_funcs/CMakeLists.txt @@ -2,12 +2,6 @@ set(MODULE_NAME CPP_RELATIONAL_FUNCS) set(${MODULE_NAME}_SOURCES main.cpp - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c ) include(../../CMakeCommon.txt) diff --git a/test_conformance/clcpp/spec_constants/CMakeLists.txt b/test_conformance/clcpp/spec_constants/CMakeLists.txt index 9a2d6dfd..3488a5a7 100644 --- a/test_conformance/clcpp/spec_constants/CMakeLists.txt +++ b/test_conformance/clcpp/spec_constants/CMakeLists.txt @@ -2,12 +2,6 @@ set(MODULE_NAME CPP_SPEC_CONSTANTS) set(${MODULE_NAME}_SOURCES main.cpp - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c ) include(../../CMakeCommon.txt) diff --git a/test_conformance/clcpp/subgroups/CMakeLists.txt b/test_conformance/clcpp/subgroups/CMakeLists.txt index 386bce9a..c8307d26 100644 --- a/test_conformance/clcpp/subgroups/CMakeLists.txt +++ b/test_conformance/clcpp/subgroups/CMakeLists.txt @@ -2,12 +2,6 @@ set(MODULE_NAME CPP_SUBGROUPS) set(${MODULE_NAME}_SOURCES main.cpp - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c ) include(../../CMakeCommon.txt) diff --git a/test_conformance/clcpp/synchronization/CMakeLists.txt b/test_conformance/clcpp/synchronization/CMakeLists.txt index 503392fe..70d3637c 100644 --- a/test_conformance/clcpp/synchronization/CMakeLists.txt +++ b/test_conformance/clcpp/synchronization/CMakeLists.txt @@ -2,12 +2,6 @@ set(MODULE_NAME CPP_SYNCHRONIZATION) set(${MODULE_NAME}_SOURCES main.cpp - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c ) include(../../CMakeCommon.txt) diff --git a/test_conformance/clcpp/utils_common/errors.hpp b/test_conformance/clcpp/utils_common/errors.hpp index e47eff3e..c1694626 100644 --- a/test_conformance/clcpp/utils_common/errors.hpp +++ b/test_conformance/clcpp/utils_common/errors.hpp @@ -18,7 +18,7 @@ #include -#include "../../../test_common/harness/errorHelpers.h" +#include "../harness/errorHelpers.h" // ------------- Check OpenCL error helpers (marcos) ----------------- diff --git a/test_conformance/clcpp/vload_vstore/CMakeLists.txt b/test_conformance/clcpp/vload_vstore/CMakeLists.txt index 6a9db9e8..c66cb6f7 100644 --- a/test_conformance/clcpp/vload_vstore/CMakeLists.txt +++ b/test_conformance/clcpp/vload_vstore/CMakeLists.txt @@ -2,12 +2,6 @@ set(MODULE_NAME CPP_VLOAD_VSTORE_FUNCS) set(${MODULE_NAME}_SOURCES main.cpp - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c ) include(../../CMakeCommon.txt) diff --git a/test_conformance/clcpp/vload_vstore/common.hpp b/test_conformance/clcpp/vload_vstore/common.hpp index 84cd539d..d78d7654 100644 --- a/test_conformance/clcpp/vload_vstore/common.hpp +++ b/test_conformance/clcpp/vload_vstore/common.hpp @@ -23,6 +23,7 @@ #include "../funcs_test_utils.hpp" #include "half_utils.hpp" +#include // Generates cl_half input std::vector generate_half_input(size_t count, @@ -36,7 +37,7 @@ std::vector generate_half_input(size_t count, std::uniform_real_distribution dis(min, max); for(auto& i : input) { - i = float2half_rte(dis(gen)); + i = cl_half_from_float(dis(gen), CL_HALF_RTE); } input.insert(input.begin(), special_cases.begin(), special_cases.end()); diff --git a/test_conformance/clcpp/vload_vstore/half_utils.hpp b/test_conformance/clcpp/vload_vstore/half_utils.hpp index 5c60599d..ce7ae822 100644 --- a/test_conformance/clcpp/vload_vstore/half_utils.hpp +++ b/test_conformance/clcpp/vload_vstore/half_utils.hpp @@ -51,86 +51,4 @@ inline int clz(INT_TYPE x) } // namespace detail -inline cl_float half2float(cl_half us) -{ - uint32_t u = us; - uint32_t sign = (u << 16) & 0x80000000; - int32_t exponent = (u & 0x7c00) >> 10; - uint32_t mantissa = (u & 0x03ff) << 13; - union{ cl_uint u; cl_float f;}uu; - - if( exponent == 0 ) - { - if( mantissa == 0 ) - return sign ? -0.0f : 0.0f; - - int shift = detail::clz( mantissa ) - 8; - exponent -= shift-1; - mantissa <<= shift; - mantissa &= 0x007fffff; - } - else - if( exponent == 31) - { - uu.u = mantissa | sign; - if( mantissa ) - uu.u |= 0x7fc00000; - else - uu.u |= 0x7f800000; - - return uu.f; - } - - exponent += 127 - 15; - exponent <<= 23; - - exponent |= mantissa; - uu.u = exponent | sign; - - return uu.f; -} - -inline cl_ushort float2half_rte(cl_float f) -{ - union{ cl_float f; cl_uint u; } u = {f}; - cl_uint sign = (u.u >> 16) & 0x8000; - cl_float x = fabsf(f); - - //Nan - if( x != x ) - { - u.u >>= (24-11); - u.u &= 0x7fff; - u.u |= 0x0200; //silence the NaN - return u.u | sign; - } - - // overflow - if( x >= MAKE_HEX_FLOAT(0x1.ffep15f, 0x1ffeL, 3) ) - return 0x7c00 | sign; - - // underflow - if( x <= MAKE_HEX_FLOAT(0x1.0p-25f, 0x1L, -25) ) - return sign; // The halfway case can return 0x0001 or 0. 0 is even. - - // very small - if( x < MAKE_HEX_FLOAT(0x1.8p-24f, 0x18L, -28) ) - return sign | 1; - - // half denormal - if( x < MAKE_HEX_FLOAT(0x1.0p-14f, 0x1L, -14) ) - { - u.f = x * MAKE_HEX_FLOAT(0x1.0p-125f, 0x1L, -125); - return sign | u.u; - } - - u.f *= MAKE_HEX_FLOAT(0x1.0p13f, 0x1L, 13); - u.u &= 0x7f800000; - x += u.f; - u.f = x - u.f; - u.f *= MAKE_HEX_FLOAT(0x1.0p-112f, 0x1L, -112); - - return (u.u >> (24-11)) | sign; -} - #endif // TEST_CONFORMANCE_CLCPP_HALF_UTILS_HPP diff --git a/test_conformance/clcpp/vload_vstore/vload_funcs.hpp b/test_conformance/clcpp/vload_vstore/vload_funcs.hpp index f0bbcfc5..5805f8b8 100644 --- a/test_conformance/clcpp/vload_vstore/vload_funcs.hpp +++ b/test_conformance/clcpp/vload_vstore/vload_funcs.hpp @@ -23,6 +23,8 @@ #include "common.hpp" +#include + // ----------------------------------------------------------------------------------- // ------------- ONLY FOR OPENCL 22 CONFORMANCE TEST 22 DEVELOPMENT ------------------ // ----------------------------------------------------------------------------------- @@ -263,7 +265,7 @@ struct vload_half_func : public unary_func< Iterator temp = x + static_cast(offset * N); for(size_t i = 0; i < N; i++) { - r.s[i] = half2float(*temp); + r.s[i] = cl_half_to_float(*temp); temp++; } return r; @@ -309,7 +311,7 @@ struct vloada_half_func : public unary_func< Iterator temp = x + static_cast(offset * alignment); for(size_t i = 0; i < N; i++) { - r.s[i] = half2float(*temp); + r.s[i] = cl_half_to_float(*temp); temp++; } return r; diff --git a/test_conformance/clcpp/vload_vstore/vstore_funcs.hpp b/test_conformance/clcpp/vload_vstore/vstore_funcs.hpp index 5bf83f51..290c273f 100644 --- a/test_conformance/clcpp/vload_vstore/vstore_funcs.hpp +++ b/test_conformance/clcpp/vload_vstore/vstore_funcs.hpp @@ -16,9 +16,6 @@ #ifndef TEST_CONFORMANCE_CLCPP_VLOAD_VSTORE_FUNCS_VSTORE_FUNCS_HPP #define TEST_CONFORMANCE_CLCPP_VLOAD_VSTORE_FUNCS_VSTORE_FUNCS_HPP -#include "../common.hpp" -#include "../funcs_test_utils.hpp" - #include #include "../common.hpp" @@ -26,6 +23,8 @@ #include "common.hpp" +#include + // ----------------------------------------------------------------------------------- // ------------- ONLY FOR OPENCL 22 CONFORMANCE TEST 22 DEVELOPMENT ------------------ // ----------------------------------------------------------------------------------- @@ -240,7 +239,7 @@ struct vstore_half_func : public unary_func< result_type r; for(size_t i = 0; i < N; i++) { - r.s[i] = float2half_rte(in.s[i]); + r.s[i] = cl_half_from_float(in.s[i], CL_HALF_RTE); } return r; } @@ -287,7 +286,7 @@ struct vstorea_half_func : public unary_func< result_type r; for(size_t i = 0; i < N; i++) { - r.s[i] = float2half_rte(in.s[i]); + r.s[i] = cl_half_from_float(in.s[i], CL_HALF_RTE); } return r; } diff --git a/test_conformance/clcpp/workgroups/CMakeLists.txt b/test_conformance/clcpp/workgroups/CMakeLists.txt index 87011be1..812e982e 100644 --- a/test_conformance/clcpp/workgroups/CMakeLists.txt +++ b/test_conformance/clcpp/workgroups/CMakeLists.txt @@ -2,12 +2,6 @@ set(MODULE_NAME CPP_WORKGROUPS) set(${MODULE_NAME}_SOURCES main.cpp - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c ) include(../../CMakeCommon.txt) diff --git a/test_conformance/clcpp/workitems/CMakeLists.txt b/test_conformance/clcpp/workitems/CMakeLists.txt index 37facc54..00359334 100644 --- a/test_conformance/clcpp/workitems/CMakeLists.txt +++ b/test_conformance/clcpp/workitems/CMakeLists.txt @@ -2,12 +2,6 @@ set(MODULE_NAME CPP_WORKITEMS) set(${MODULE_NAME}_SOURCES main.cpp - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c ) include(../../CMakeCommon.txt) diff --git a/test_conformance/clcpp/workitems/test_workitems.hpp b/test_conformance/clcpp/workitems/test_workitems.hpp index eb5087c5..099ef344 100644 --- a/test_conformance/clcpp/workitems/test_workitems.hpp +++ b/test_conformance/clcpp/workitems/test_workitems.hpp @@ -218,10 +218,9 @@ int test_workitems(cl_device_id device, cl_context context, cl_command_queue que check_sub_groups_limits = false; if (is_extension_available(device, "cl_khr_subgroups")) { - size_t major, minor; - error = get_device_version(device, &major, &minor); + Version version = get_device_cl_version(device); RETURN_ON_ERROR(error) - check_sub_groups_limits = (major > 2 || major == 2 && minor >= 1); // clGetKernelSubGroupInfo is from 2.1 + check_sub_groups_limits = (version >= Version(2,1)); // clGetKernelSubGroupInfo is from 2.1 check_sub_groups = true; } #endif diff --git a/test_conformance/commonfns/CMakeLists.txt b/test_conformance/commonfns/CMakeLists.txt index 50aef6c5..5aa29250 100644 --- a/test_conformance/commonfns/CMakeLists.txt +++ b/test_conformance/commonfns/CMakeLists.txt @@ -1,34 +1,25 @@ set(MODULE_NAME COMMONFNS) set(${MODULE_NAME}_SOURCES - main.c - test_clamp.c - test_degrees.c - test_max.c - test_maxf.c - test_min.c - test_minf.c - test_mix.c - test_radians.c - test_step.c - test_stepf.c - test_smoothstep.c - test_smoothstepf.c - test_sign.c - test_fmax.c - test_fmin.c - test_fmaxf.c - test_fminf.c - test_binary_fn.c - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/threadTesting.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/mt19937.c - ../../test_common/harness/conversions.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c + main.cpp + test_clamp.cpp + test_degrees.cpp + test_max.cpp + test_maxf.cpp + test_min.cpp + test_minf.cpp + test_mix.cpp + test_radians.cpp + test_step.cpp + test_stepf.cpp + test_smoothstep.cpp + test_smoothstepf.cpp + test_sign.cpp + test_fmax.cpp + test_fmin.cpp + test_fmaxf.cpp + test_fminf.cpp + test_binary_fn.cpp ) include(../CMakeCommon.txt) diff --git a/test_conformance/commonfns/main.c b/test_conformance/commonfns/main.cpp similarity index 97% rename from test_conformance/commonfns/main.c rename to test_conformance/commonfns/main.cpp index f6c38f3f..739e09ee 100644 --- a/test_conformance/commonfns/main.c +++ b/test_conformance/commonfns/main.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/commonfns/procs.h b/test_conformance/commonfns/procs.h index 1c6e9dab..dada94f9 100644 --- a/test_conformance/commonfns/procs.h +++ b/test_conformance/commonfns/procs.h @@ -13,11 +13,11 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/mt19937.h" +#include "harness/testHarness.h" +#include "harness/kernelHelpers.h" +#include "harness/errorHelpers.h" +#include "harness/conversions.h" +#include "harness/mt19937.h" #define kVectorSizeCount 5 #define kStrangeVectorSizeCount 1 diff --git a/test_conformance/commonfns/test_binary_fn.c b/test_conformance/commonfns/test_binary_fn.cpp similarity index 99% rename from test_conformance/commonfns/test_binary_fn.c rename to test_conformance/commonfns/test_binary_fn.cpp index f0a1109f..51d73659 100644 --- a/test_conformance/commonfns/test_binary_fn.c +++ b/test_conformance/commonfns/test_binary_fn.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/commonfns/test_clamp.c b/test_conformance/commonfns/test_clamp.cpp similarity index 99% rename from test_conformance/commonfns/test_clamp.c rename to test_conformance/commonfns/test_clamp.cpp index 9fb46749..5d01900f 100644 --- a/test_conformance/commonfns/test_clamp.c +++ b/test_conformance/commonfns/test_clamp.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/commonfns/test_degrees.c b/test_conformance/commonfns/test_degrees.cpp similarity index 99% rename from test_conformance/commonfns/test_degrees.c rename to test_conformance/commonfns/test_degrees.cpp index f3871fc9..d6593db3 100644 --- a/test_conformance/commonfns/test_degrees.c +++ b/test_conformance/commonfns/test_degrees.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/commonfns/test_fmax.c b/test_conformance/commonfns/test_fmax.cpp similarity index 99% rename from test_conformance/commonfns/test_fmax.c rename to test_conformance/commonfns/test_fmax.cpp index 0605eff9..462f9e49 100644 --- a/test_conformance/commonfns/test_fmax.c +++ b/test_conformance/commonfns/test_fmax.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/commonfns/test_fmaxf.c b/test_conformance/commonfns/test_fmaxf.cpp similarity index 99% rename from test_conformance/commonfns/test_fmaxf.c rename to test_conformance/commonfns/test_fmaxf.cpp index bba7f2ce..2ed1bcc2 100644 --- a/test_conformance/commonfns/test_fmaxf.c +++ b/test_conformance/commonfns/test_fmaxf.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/commonfns/test_fmin.c b/test_conformance/commonfns/test_fmin.cpp similarity index 99% rename from test_conformance/commonfns/test_fmin.c rename to test_conformance/commonfns/test_fmin.cpp index 20baed62..7efbb8fe 100644 --- a/test_conformance/commonfns/test_fmin.c +++ b/test_conformance/commonfns/test_fmin.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/commonfns/test_fminf.c b/test_conformance/commonfns/test_fminf.cpp similarity index 99% rename from test_conformance/commonfns/test_fminf.c rename to test_conformance/commonfns/test_fminf.cpp index 47abfd17..f04fb1ef 100644 --- a/test_conformance/commonfns/test_fminf.c +++ b/test_conformance/commonfns/test_fminf.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/commonfns/test_max.c b/test_conformance/commonfns/test_max.cpp similarity index 97% rename from test_conformance/commonfns/test_max.c rename to test_conformance/commonfns/test_max.cpp index cdb49c59..9f3b80ec 100644 --- a/test_conformance/commonfns/test_max.c +++ b/test_conformance/commonfns/test_max.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/commonfns/test_maxf.c b/test_conformance/commonfns/test_maxf.cpp similarity index 97% rename from test_conformance/commonfns/test_maxf.c rename to test_conformance/commonfns/test_maxf.cpp index b3992e46..f96df7ea 100644 --- a/test_conformance/commonfns/test_maxf.c +++ b/test_conformance/commonfns/test_maxf.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/commonfns/test_min.c b/test_conformance/commonfns/test_min.cpp similarity index 97% rename from test_conformance/commonfns/test_min.c rename to test_conformance/commonfns/test_min.cpp index e93b39f0..707e24b6 100644 --- a/test_conformance/commonfns/test_min.c +++ b/test_conformance/commonfns/test_min.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/commonfns/test_minf.c b/test_conformance/commonfns/test_minf.cpp similarity index 95% rename from test_conformance/commonfns/test_minf.c rename to test_conformance/commonfns/test_minf.cpp index 16f38e4f..71b1fbe0 100644 --- a/test_conformance/commonfns/test_minf.c +++ b/test_conformance/commonfns/test_minf.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -21,7 +21,7 @@ #include #include "procs.h" -#include "../../test_common/harness/errorHelpers.h" +#include "harness/errorHelpers.h" static int min_verify_float( float *x, float *y, float *out, int numElements, int vecSize ) { diff --git a/test_conformance/commonfns/test_mix.c b/test_conformance/commonfns/test_mix.cpp similarity index 99% rename from test_conformance/commonfns/test_mix.c rename to test_conformance/commonfns/test_mix.cpp index b7beb822..d773f76c 100644 --- a/test_conformance/commonfns/test_mix.c +++ b/test_conformance/commonfns/test_mix.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/commonfns/test_radians.c b/test_conformance/commonfns/test_radians.cpp similarity index 99% rename from test_conformance/commonfns/test_radians.c rename to test_conformance/commonfns/test_radians.cpp index 0f2dd9d5..9ff53a67 100644 --- a/test_conformance/commonfns/test_radians.c +++ b/test_conformance/commonfns/test_radians.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/commonfns/test_sign.c b/test_conformance/commonfns/test_sign.cpp similarity index 99% rename from test_conformance/commonfns/test_sign.c rename to test_conformance/commonfns/test_sign.cpp index 6a3a2c74..bf8d8c79 100644 --- a/test_conformance/commonfns/test_sign.c +++ b/test_conformance/commonfns/test_sign.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/commonfns/test_smoothstep.c b/test_conformance/commonfns/test_smoothstep.cpp similarity index 99% rename from test_conformance/commonfns/test_smoothstep.c rename to test_conformance/commonfns/test_smoothstep.cpp index ec3ff016..19201fd5 100644 --- a/test_conformance/commonfns/test_smoothstep.c +++ b/test_conformance/commonfns/test_smoothstep.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/commonfns/test_smoothstepf.c b/test_conformance/commonfns/test_smoothstepf.cpp similarity index 97% rename from test_conformance/commonfns/test_smoothstepf.c rename to test_conformance/commonfns/test_smoothstepf.cpp index 7b93ac12..7d708de7 100644 --- a/test_conformance/commonfns/test_smoothstepf.c +++ b/test_conformance/commonfns/test_smoothstepf.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -48,8 +48,8 @@ static const char *smoothstep4_kernel_code = #define MAX_ERR (1e-5f) -extern "C" float -verify_smoothstep(float *edge0, float *edge1, float *x, float *outptr, int n, int veclen) +float verify_smoothstep(float *edge0, float *edge1, float *x, float *outptr, + int n, int veclen) { float r, t, delta, max_err = 0.0f; int i, j; diff --git a/test_conformance/commonfns/test_step.c b/test_conformance/commonfns/test_step.cpp similarity index 99% rename from test_conformance/commonfns/test_step.c rename to test_conformance/commonfns/test_step.cpp index b81a0d95..3b1a5ba3 100644 --- a/test_conformance/commonfns/test_step.c +++ b/test_conformance/commonfns/test_step.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/commonfns/test_stepf.c b/test_conformance/commonfns/test_stepf.cpp similarity index 99% rename from test_conformance/commonfns/test_stepf.c rename to test_conformance/commonfns/test_stepf.cpp index 55b7ee45..ba7d2e1a 100644 --- a/test_conformance/commonfns/test_stepf.c +++ b/test_conformance/commonfns/test_stepf.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/compatibility/CMakeLists.txt b/test_conformance/compatibility/CMakeLists.txt deleted file mode 100644 index fd375068..00000000 --- a/test_conformance/compatibility/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test_conformance) diff --git a/test_conformance/compatibility/test_common/gl/gl_headers.h b/test_conformance/compatibility/test_common/gl/gl_headers.h deleted file mode 100644 index 85adbac4..00000000 --- a/test_conformance/compatibility/test_common/gl/gl_headers.h +++ /dev/null @@ -1,52 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef _gl_headers_h -#define _gl_headers_h - -#if defined( __APPLE__ ) - #include -#if defined(CGL_VERSION_1_3) - #include - #include -#else - #include - #include -#endif - #include -#else -#ifdef _WIN32 - #include -#endif - #include - #include - #include -#ifdef _WIN32 - #include -#else - #include -#endif - -#endif - -#ifdef _WIN32 - GLboolean gluCheckExtension(const GLubyte *extName, const GLubyte *extString); - // No glutGetProcAddress in the standard glut v3.7. - #define glutGetProcAddress(procName) wglGetProcAddress(procName) -#endif - - -#endif // __gl_headers_h - diff --git a/test_conformance/compatibility/test_common/gl/helpers.cpp b/test_conformance/compatibility/test_common/gl/helpers.cpp deleted file mode 100644 index 1cc5bcb1..00000000 --- a/test_conformance/compatibility/test_common/gl/helpers.cpp +++ /dev/null @@ -1,1622 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "helpers.h" - -// convert_float_to_half and convert_half_to_float may be found in test_conformance/images/image_helpers.cpp -cl_ushort convert_float_to_half( cl_float f ); -cl_float convert_half_to_float( cl_ushort h ); - -#if defined( __APPLE__ ) - #include -#else - #include -#endif - -#if defined(__linux__) -// On linux we dont link to GLU library to avoid comaptibility issues with -// libstdc++ -// FIXME: Implement this -const GLubyte* gluErrorString (GLenum error) -{ - const char* gl_Error = "OpenGL Error"; - return (const GLubyte*)gl_Error; -} -#endif - -void * CreateGLTexture1DArray(size_t width, size_t length, - GLenum target, GLenum glFormat, GLenum internalFormat, GLenum glType, - ExplicitType type, GLuint *outTextureID, int *outError, - bool allocateMem, MTdata d) -{ - *outError = 0; - GLenum err = 0; - - // width_in_pixels * pixel_width * number_of_images: - char* buffer = (char *)CreateRandomData(type, width * length * 4, d); - - glGenTextures( 1, outTextureID ); - glBindTexture( get_base_gl_target( target ), *outTextureID ); - err = glGetError(); - if( err != GL_NO_ERROR ) { - log_error( "ERROR: Failed to create GL texture object: %s!\n", gluErrorString( err )); - *outError = -1; - free( buffer ); - return NULL; - } - - glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE ); - glTexParameteri( get_base_gl_target( target ), GL_TEXTURE_MIN_FILTER, GL_NEAREST ); - glTexParameteri( get_base_gl_target( target ), GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - - // use TexImage2D to pump the 1D array fill of bits: - glTexImage2D( get_base_gl_target(target), 0, internalFormat, (GLsizei)width, - (GLsizei)length, 0, glFormat, glType, buffer ); - - err = glGetError(); - if( err != GL_NO_ERROR ) { - log_error( "ERROR: Unable to load data using glTexImage2D for " - "TEXTURE_1D_ARRAY : %s : %s : %d : %d : %s : %s : Error %s\n", - GetGLTargetName(target), - GetGLFormatName(internalFormat), - (int)(width), (int)(length), - GetGLFormatName(glFormat), - GetGLTypeName(glType), - gluErrorString( err )); - - *outError = -1; - free( buffer ); - return NULL; - } - - - if( !allocateMem ) { - free( buffer ); - return NULL; - } - - if( glType == GL_UNSIGNED_INT_8_8_8_8_REV && glFormat == GL_BGRA && allocateMem ) - { - // Reverse and reorder to validate since in the - // kernel the read_imagef() call always returns RGBA - - cl_uchar *p = (cl_uchar *)buffer; - for( size_t i = 0; i < width * length; i++ ) { - cl_uchar uc0 = p[i * 4 + 0]; - cl_uchar uc1 = p[i * 4 + 1]; - cl_uchar uc2 = p[i * 4 + 2]; - cl_uchar uc3 = p[i * 4 + 3]; - - p[ i * 4 + 0 ] = uc2; - p[ i * 4 + 1 ] = uc1; - p[ i * 4 + 2 ] = uc0; - p[ i * 4 + 3 ] = uc3; - } - } - else if( glType == GL_UNSIGNED_INT_8_8_8_8 && glFormat == GL_BGRA && allocateMem ) - { - // Reverse and reorder to validate since in the - // kernel the read_imagef() call always returns RGBA - cl_uchar *p = (cl_uchar *)buffer; - for( size_t i = 0; i < width * length; i++ ) - { - cl_uchar uc0 = p[i * 4 + 0]; - cl_uchar uc1 = p[i * 4 + 1]; - cl_uchar uc2 = p[i * 4 + 2]; - cl_uchar uc3 = p[i * 4 + 3]; - - p[ i * 4 + 0 ] = uc1; - p[ i * 4 + 1 ] = uc2; - p[ i * 4 + 2 ] = uc3; - p[ i * 4 + 3 ] = uc0; - } - } - - - return buffer; -} - -void * CreateGLTexture2DArray(size_t width, size_t height, size_t length, - GLenum target, GLenum glFormat, GLenum internalFormat, GLenum glType, - ExplicitType type, GLuint *outTextureID, int *outError, - bool allocateMem, MTdata d) -{ - *outError = 0; - - char * buffer = (char *)create_random_data( type, d, width * height * length * 4 ); - - if( type == kFloat && allocateMem ) - { - // Re-fill the created buffer to just have [0-1] floats, since that's what it'd expect - cl_float *p = (cl_float *)buffer; - for( size_t i = 0; i < width * height * length * 4; i++ ) - { - p[ i ] = (float) genrand_real1( d ); - } - } - else if( !allocateMem ) - memset( buffer, 0, width * height * length * 4 * get_explicit_type_size( type ) ); - - glGenTextures( 1, outTextureID ); - - glBindTexture( target, *outTextureID ); - glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE ); - glTexParameteri( target, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); - glTexParameteri( target, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - - glGetError(); - glTexImage3D( target, 0, internalFormat, (GLsizei)width, (GLsizei)height, - (GLsizei)length, 0, glFormat, glType, buffer ); - GLenum err = glGetError(); - if( err != GL_NO_ERROR ) - { - log_error( "ERROR: Unable to load data into GL texture (%s) format %s " - "type %s internal format %s\n", gluErrorString( err ), - GetGLFormatName( glFormat ), get_explicit_type_name( type ), - GetGLFormatName( internalFormat ) ); - *outError = -1; - delete [] buffer; - return NULL; - } - - if( !allocateMem ) - { - delete [] buffer; - return NULL; - } - - if( glType == GL_UNSIGNED_INT_8_8_8_8_REV && glFormat == GL_BGRA && allocateMem ) - { - // Reverse and reorder to validate since in the - // kernel the read_imagef() call always returns RGBA - - cl_uchar *p = (cl_uchar *)buffer; - for( size_t i = 0; i < width * height * length; i++ ) - { - cl_uchar uc0 = p[i * 4 + 0]; - cl_uchar uc1 = p[i * 4 + 1]; - cl_uchar uc2 = p[i * 4 + 2]; - cl_uchar uc3 = p[i * 4 + 3]; - - p[ i * 4 + 0 ] = uc2; - p[ i * 4 + 1 ] = uc1; - p[ i * 4 + 2 ] = uc0; - p[ i * 4 + 3 ] = uc3; - } - } - else if( glType == GL_UNSIGNED_INT_8_8_8_8 && glFormat == GL_BGRA && allocateMem ) - { - // Reverse and reorder to validate since in the - // kernel the read_imagef() call always returns RGBA - cl_uchar *p = (cl_uchar *)buffer; - for( size_t i = 0; i < width * length; i++ ) - { - cl_uchar uc0 = p[i * 4 + 0]; - cl_uchar uc1 = p[i * 4 + 1]; - cl_uchar uc2 = p[i * 4 + 2]; - cl_uchar uc3 = p[i * 4 + 3]; - - p[ i * 4 + 0 ] = uc1; - p[ i * 4 + 1 ] = uc2; - p[ i * 4 + 2 ] = uc3; - p[ i * 4 + 3 ] = uc0; - } - } - - - return buffer; -} - -void * CreateGLTextureBuffer(size_t width, GLenum target, - GLenum glFormat, GLenum internalFormat, GLenum glType, ExplicitType type, - GLuint *outTex, GLuint *outBuf, int *outError, bool allocateMem, MTdata d) -{ - // First, generate a regular GL Buffer from random data. - *outError = 0; - GLenum err = 0; - - char * buffer = (char*)CreateRandomData(type, width * 4, d); - - glGenBuffers(1, outBuf); - glBindBuffer(GL_TEXTURE_BUFFER, *outBuf); - - // The buffer should be the array width * number of elements * element pitch - size_t size = width * 4; - - // Need to multiply by the type size: - size *= ( GetGLTypeSize( GetGLTypeForExplicitType(type) ) ); - - glBufferData(GL_TEXTURE_BUFFER, size, buffer, GL_DYNAMIC_DRAW); - - // Now make a Texture out of this Buffer: - - glGenTextures(1, outTex); - glBindTexture(GL_TEXTURE_BUFFER, *outTex); - glTexBuffer(GL_TEXTURE_BUFFER, internalFormat, *outBuf); - - - - if( !allocateMem ) { - free( buffer ); - return NULL; - } - - if( glType == GL_UNSIGNED_INT_8_8_8_8_REV && glFormat == GL_BGRA && allocateMem ) - { - // Reverse and reorder to validate since in the - // kernel the read_imagef() call always returns RGBA - cl_uchar *p = (cl_uchar *)buffer; - for( size_t i = 0; i < width; i++ ) { - cl_uchar uc0 = p[i * 4 + 0]; - cl_uchar uc1 = p[i * 4 + 1]; - cl_uchar uc2 = p[i * 4 + 2]; - cl_uchar uc3 = p[i * 4 + 3]; - - p[ i * 4 + 0 ] = uc2; - p[ i * 4 + 1 ] = uc1; - p[ i * 4 + 2 ] = uc0; - p[ i * 4 + 3 ] = uc3; - } - } - else if( glType == GL_UNSIGNED_INT_8_8_8_8 && glFormat == GL_BGRA && allocateMem ) - { - // Reverse and reorder to validate since in the - // kernel the read_imagef() call always returns RGBA - cl_uchar *p = (cl_uchar *)buffer; - for( size_t i = 0; i < width; i++ ) - { - cl_uchar uc0 = p[i * 4 + 0]; - cl_uchar uc1 = p[i * 4 + 1]; - cl_uchar uc2 = p[i * 4 + 2]; - cl_uchar uc3 = p[i * 4 + 3]; - - p[ i * 4 + 0 ] = uc1; - p[ i * 4 + 1 ] = uc2; - p[ i * 4 + 2 ] = uc3; - p[ i * 4 + 3 ] = uc0; - } - } - - - return buffer; -} - -void* CreateGLTexture1D( size_t width, GLenum target, GLenum glFormat, - GLenum internalFormat, GLenum glType, ExplicitType type, - GLuint *outTextureID, int *outError, bool allocateMem, MTdata d ) -{ - *outError = 0; - GLenum err = 0; - - char * buffer = (char*)CreateRandomData(type, width * 4, d); - - glGenTextures( 1, outTextureID ); - glBindTexture( get_base_gl_target( target ), *outTextureID ); - err = glGetError(); - if( err != GL_NO_ERROR ) - { - log_error( "ERROR: Failed to create GL texture object: %s!\n", gluErrorString( err )); - *outError = -1; - free( buffer ); - return NULL; - } - - glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE ); - glTexParameteri( get_base_gl_target( target ), GL_TEXTURE_MIN_FILTER, GL_NEAREST ); - glTexParameteri( get_base_gl_target( target ), GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - - glTexImage1D( get_base_gl_target(target), 0, internalFormat, (GLsizei)width, - 0, glFormat, glType, buffer ); - - err = glGetError(); - if( err != GL_NO_ERROR ) - { - log_error( "ERROR: Unable to load data into glTexImage1D : %s : %s : %d : %s : %s : Error %s\n", - GetGLTargetName(target), - GetGLFormatName(internalFormat), - (int)(width), - GetGLFormatName(glFormat), - GetGLTypeName(glType), - gluErrorString( err )); - - *outError = -1; - free( buffer ); - return NULL; - } - - if( !allocateMem ) { - free( buffer ); - return NULL; - } - - if( glType == GL_UNSIGNED_INT_8_8_8_8_REV && glFormat == GL_BGRA && allocateMem ) - { - // Reverse and reorder to validate since in the - // kernel the read_imagef() call always returns RGBA - cl_uchar *p = (cl_uchar *)buffer; - for( size_t i = 0; i < width; i++ ) { - cl_uchar uc0 = p[i * 4 + 0]; - cl_uchar uc1 = p[i * 4 + 1]; - cl_uchar uc2 = p[i * 4 + 2]; - cl_uchar uc3 = p[i * 4 + 3]; - - p[ i * 4 + 0 ] = uc2; - p[ i * 4 + 1 ] = uc1; - p[ i * 4 + 2 ] = uc0; - p[ i * 4 + 3 ] = uc3; - } - } - else if( glType == GL_UNSIGNED_INT_8_8_8_8 && glFormat == GL_BGRA && allocateMem ) - { - // Reverse and reorder to validate since in the - // kernel the read_imagef() call always returns RGBA - cl_uchar *p = (cl_uchar *)buffer; - for( size_t i = 0; i < width; i++ ) - { - cl_uchar uc0 = p[i * 4 + 0]; - cl_uchar uc1 = p[i * 4 + 1]; - cl_uchar uc2 = p[i * 4 + 2]; - cl_uchar uc3 = p[i * 4 + 3]; - - p[ i * 4 + 0 ] = uc1; - p[ i * 4 + 1 ] = uc2; - p[ i * 4 + 2 ] = uc3; - p[ i * 4 + 3 ] = uc0; - } - } - - return buffer; -} - -void * CreateGLTexture2D( size_t width, size_t height, - GLenum target, GLenum glFormat, - GLenum internalFormat, GLenum glType, - ExplicitType type, GLuint *outTextureID, - int *outError, bool allocateMem, MTdata d ) -{ - *outError = 0; - GLenum err = 0; - - char * buffer = (char *)CreateRandomData(type, width * height * 4, d); - - glGenTextures( 1, outTextureID ); - glBindTexture( get_base_gl_target( target ), *outTextureID ); - err = glGetError(); - if( err != GL_NO_ERROR ) - { - log_error( "ERROR: Failed to create GL texture object: %s!\n", gluErrorString( err )); - *outError = -1; - free( buffer ); - return NULL; - } - - glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE ); - glTexParameteri( get_base_gl_target( target ), GL_TEXTURE_MIN_FILTER, GL_NEAREST ); - glTexParameteri( get_base_gl_target( target ), GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - - if( get_base_gl_target( target ) == GL_TEXTURE_CUBE_MAP ) - { - char * temp = (char *)malloc(width * height * 4 * get_explicit_type_size( type ) * sizeof(cl_char)); - if(allocateMem) - memcpy( temp, buffer, width * height * 4 * get_explicit_type_size( type ) ); - else - memset( temp, 0, width * height * 4 * get_explicit_type_size( type ) ); - - glTexImage2D( GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, internalFormat, (GLsizei)width, (GLsizei)height, 0, glFormat, glType, temp ); - glTexImage2D( GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 0, internalFormat, (GLsizei)width, (GLsizei)height, 0, glFormat, glType, temp ); - glTexImage2D( GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 0, internalFormat, (GLsizei)width, (GLsizei)height, 0, glFormat, glType, temp ); - glTexImage2D( GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 0, internalFormat, (GLsizei)width, (GLsizei)height, 0, glFormat, glType, temp ); - glTexImage2D( GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, internalFormat, (GLsizei)width, (GLsizei)height, 0, glFormat, glType, temp ); - glTexImage2D( GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, internalFormat, (GLsizei)width, (GLsizei)height, 0, glFormat, glType, temp ); - free(temp); - } - else - { -#ifdef DEBUG - log_info("- glTexImage2D : %s : %s : %d : %d : %s : %s\n", - GetGLTargetName(target), - GetGLFormatName(internalFormat), - width, height, - GetGLFormatName(glFormat), - GetGLTypeName(glType)); - - DumpGLBuffer(glType, width, height, buffer); - -#endif - glTexImage2D( get_base_gl_target(target), 0, internalFormat, (GLsizei)width, (GLsizei)height, 0, glFormat, glType, buffer ); - } - - err = glGetError(); - if( err != GL_NO_ERROR ) - { - log_error( "ERROR: Unable to load data into glTexImage2D : %s : %s : %d : %d : %s : %s : Error %s\n", - GetGLTargetName(target), - GetGLFormatName(internalFormat), - (int)(width), (int)(height), - GetGLFormatName(glFormat), - GetGLTypeName(glType), - gluErrorString( err )); - - *outError = -1; - free( buffer ); - return NULL; - } - -#ifdef DEBUG - memset(buffer, 0, width * height * 4 * get_explicit_type_size( type )); - - log_info("- glGetTexImage : %s : %s : %s\n", - GetGLTargetName(target), - GetGLFormatName(glFormat), - GetGLTypeName(glType)); - - glGetTexImage(target, 0, glFormat, glType, buffer); - - DumpGLBuffer(type, width, height, buffer); - - err = glGetError(); - if( err != GL_NO_ERROR ) - { - log_error( "ERROR: Unable to read data from glGetTexImage : %s : %s : %s : Error %s\n", - GetGLTargetName(target), - GetGLFormatName(glFormat), - GetGLTypeName(glType), - gluErrorString( err )); - return NULL; - } -#endif - - if( !allocateMem ) - { - free( buffer ); - return NULL; - } - - if( glType == GL_UNSIGNED_INT_8_8_8_8_REV && glFormat == GL_BGRA && allocateMem ) - { - // Reverse and reorder to validate since in the - // kernel the read_imagef() call always returns RGBA - cl_uchar *p = (cl_uchar *)buffer; - for( size_t i = 0; i < width * height; i++ ) - { - cl_uchar uc0 = p[i * 4 + 0]; - cl_uchar uc1 = p[i * 4 + 1]; - cl_uchar uc2 = p[i * 4 + 2]; - cl_uchar uc3 = p[i * 4 + 3]; - - p[ i * 4 + 0 ] = uc2; - p[ i * 4 + 1 ] = uc1; - p[ i * 4 + 2 ] = uc0; - p[ i * 4 + 3 ] = uc3; - } - } - else if( glType == GL_UNSIGNED_INT_8_8_8_8 && glFormat == GL_BGRA && allocateMem ) - { - // Reverse and reorder to validate since in the - // kernel the read_imagef() call always returns RGBA - cl_uchar *p = (cl_uchar *)buffer; - for( size_t i = 0; i < width * height; i++ ) - { - cl_uchar uc0 = p[i * 4 + 0]; - cl_uchar uc1 = p[i * 4 + 1]; - cl_uchar uc2 = p[i * 4 + 2]; - cl_uchar uc3 = p[i * 4 + 3]; - - p[ i * 4 + 0 ] = uc1; - p[ i * 4 + 1 ] = uc2; - p[ i * 4 + 2 ] = uc3; - p[ i * 4 + 3 ] = uc0; - } - } - - return buffer; -} - -void * CreateGLTexture3D( size_t width, size_t height, size_t depth, - GLenum target, GLenum glFormat, - GLenum internalFormat, GLenum glType, - ExplicitType type, GLuint *outTextureID, - int *outError, MTdata d, bool allocateMem) -{ - *outError = 0; - - char * buffer = (char *)create_random_data( type, d, width * height * depth * 4 ); - - if( type == kFloat && allocateMem ) - { - // Re-fill the created buffer to just have [0-1] floats, since that's what it'd expect - cl_float *p = (cl_float *)buffer; - for( size_t i = 0; i < width * height * depth * 4; i++ ) - { - p[ i ] = (float) genrand_real1( d ); - } - } - else if( !allocateMem ) - memset( buffer, 0, width * height * depth * 4 * get_explicit_type_size( type ) ); - - glGenTextures( 1, outTextureID ); - - glBindTexture( target, *outTextureID ); - glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE ); - glTexParameteri( target, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); - glTexParameteri( target, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - - glGetError(); - glTexImage3D( target, 0, internalFormat, (GLsizei)width, (GLsizei)height, (GLsizei)depth, 0, glFormat, glType, buffer ); - GLenum err = glGetError(); - if( err != GL_NO_ERROR ) - { - log_error( "ERROR: Unable to load data into GL texture (%s) format %s type %s internal format %s\n", gluErrorString( err ), GetGLFormatName( glFormat ), get_explicit_type_name( type ), GetGLFormatName( internalFormat ) ); - *outError = -1; - delete [] buffer; - return NULL; - } - - if( !allocateMem ) - { - delete [] buffer; - return NULL; - } - - if( glType == GL_UNSIGNED_INT_8_8_8_8_REV && glFormat == GL_BGRA && allocateMem ) - { - // Reverse and reorder to validate since in the - // kernel the read_imagef() call always returns RGBA - - cl_uchar *p = (cl_uchar *)buffer; - for( size_t i = 0; i < width * height * depth; i++ ) - { - cl_uchar uc0 = p[i * 4 + 0]; - cl_uchar uc1 = p[i * 4 + 1]; - cl_uchar uc2 = p[i * 4 + 2]; - cl_uchar uc3 = p[i * 4 + 3]; - - p[ i * 4 + 0 ] = uc2; - p[ i * 4 + 1 ] = uc1; - p[ i * 4 + 2 ] = uc0; - p[ i * 4 + 3 ] = uc3; - } - } - else if( glType == GL_UNSIGNED_INT_8_8_8_8 && glFormat == GL_BGRA && allocateMem ) - { - // Reverse and reorder to validate since in the - // kernel the read_imagef() call always returns RGBA - cl_uchar *p = (cl_uchar *)buffer; - for( size_t i = 0; i < width * height * depth; i++ ) - { - cl_uchar uc0 = p[i * 4 + 0]; - cl_uchar uc1 = p[i * 4 + 1]; - cl_uchar uc2 = p[i * 4 + 2]; - cl_uchar uc3 = p[i * 4 + 3]; - - p[ i * 4 + 0 ] = uc1; - p[ i * 4 + 1 ] = uc2; - p[ i * 4 + 2 ] = uc3; - p[ i * 4 + 3 ] = uc0; - } - } - - return buffer; -} - -void * ReadGLTexture( GLenum glTarget, GLuint glTexture, GLuint glBuf, GLint width, - GLenum glFormat, GLenum glInternalFormat, - GLenum glType, ExplicitType typeToReadAs, - size_t outWidth, size_t outHeight ) -{ - // Read results from the GL texture - glBindTexture(get_base_gl_target(glTarget), glTexture); - - GLint realWidth, realHeight, realDepth; - glGetTexLevelParameteriv( glTarget, 0, GL_TEXTURE_WIDTH, &realWidth ); - glGetTexLevelParameteriv( glTarget, 0, GL_TEXTURE_HEIGHT, &realHeight ); - glGetTexLevelParameteriv( glTarget, 0, GL_TEXTURE_WIDTH, &realDepth ); - - realDepth = realDepth == 0 ? realDepth : 1; - - GLint realInternalFormat; - glGetTexLevelParameteriv( glTarget, 0, GL_TEXTURE_INTERNAL_FORMAT, &realInternalFormat ); - -#ifdef DEBUG - log_info( "- Reading back from GL: %d x %d : %s : %s : %s : %s (stored as %s)\n", - realWidth, realHeight, - GetGLTargetName( glTarget), - GetGLFormatName( glInternalFormat ), - GetGLFormatName( glFormat ), - GetGLTypeName( glType ), - GetGLFormatName( realInternalFormat )); -#endif - - GLenum readBackFormat = glFormat == GL_RGBA_INTEGER_EXT ? GL_RGBA_INTEGER_EXT : GL_RGBA; - - GLenum readBackType; - switch (glType) { -#ifdef __APPLE__ - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - readBackType = GL_UNSIGNED_BYTE; - break; -#endif - case GL_HALF_FLOAT: - case GL_UNSIGNED_BYTE: - case GL_UNSIGNED_SHORT: - case GL_UNSIGNED_INT: - case GL_BYTE: - case GL_SHORT: - case GL_INT: - case GL_FLOAT: - default: - readBackType = glType; - } - - size_t outBytes; - if (get_base_gl_target(glTarget) != GL_TEXTURE_BUFFER) { - outBytes = realWidth * realHeight * realDepth * 4 - * GetGLTypeSize(readBackType); - } - else { - outBytes = width * 4; - - outBytes *= ( GetGLTypeSize( GetGLTypeForExplicitType(typeToReadAs) ) ); - } - - cl_char *outBuffer = (cl_char *)malloc( outBytes ); - memset(outBuffer, 0, outBytes); - - if (get_base_gl_target(glTarget) != GL_TEXTURE_BUFFER) { - glGetTexImage( glTarget, 0, readBackFormat, readBackType, outBuffer ); - } - else { - glBindBuffer(GL_ARRAY_BUFFER, glBuf); - glGetBufferSubData(GL_ARRAY_BUFFER, 0, outBytes, outBuffer); - } - -#ifdef DEBUG - - log_info( "- glGetTexImage: %s : %s : %s \n", - GetGLTargetName( glTarget), - GetGLFormatName(readBackFormat), - GetGLTypeName(readBackType)); - - DumpGLBuffer(readBackType, realWidth, realHeight, (void*)outBuffer); - -#endif - - return (void *)outBuffer; -} - -int CreateGLRenderbufferRaw( GLsizei width, GLsizei height, - GLenum attachment, GLenum glFormat, - GLenum internalFormat, GLenum glType, - GLuint *outFramebuffer, - GLuint *outRenderbuffer ) -{ - GLenum err = 0; - - // Generate a renderbuffer and bind - glGenRenderbuffersEXT( 1, outRenderbuffer ); - glBindRenderbufferEXT( GL_RENDERBUFFER_EXT, *outRenderbuffer ); - - // Allocate storage to the renderbuffer - glGetError(); - glRenderbufferStorageEXT( GL_RENDERBUFFER_EXT, internalFormat, (GLsizei)width, (GLsizei)height ); - err = glGetError(); - if( err != GL_NO_ERROR ) - { - log_error("Failed to allocate render buffer storage!\n"); - return 1701; - } - - GLint realInternalFormat; - glGetRenderbufferParameterivEXT( GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_INTERNAL_FORMAT_EXT, &realInternalFormat ); - internalFormat = realInternalFormat; - -#ifdef DEBUG - GLint rsize, gsize, bsize, asize; - glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_RED_SIZE_EXT,&rsize); - glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_GREEN_SIZE_EXT,&gsize); - glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_BLUE_SIZE_EXT,&bsize); - glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_ALPHA_SIZE_EXT,&asize); - - log_info("Renderbuffer internal format requested: %s actual: %s sizes: r=%d g=%d b=%d a=%d\n", - GetGLFormatName( internalFormat ), GetGLFormatName( realInternalFormat ), - rsize, gsize, bsize, asize ); -#endif - - // Create and bind a framebuffer to render with - glGenFramebuffersEXT( 1, outFramebuffer ); - glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, *outFramebuffer ); - if( err != GL_NO_ERROR ) - { - log_error( "ERROR: Unable to bind framebuffer : Error %s\n", - gluErrorString( err )); - - return -1; - } - - // Attach to the framebuffer - glFramebufferRenderbufferEXT( GL_FRAMEBUFFER_EXT, attachment, GL_RENDERBUFFER_EXT, *outRenderbuffer ); - err = glGetError(); - GLint status = glCheckFramebufferStatusEXT( GL_FRAMEBUFFER_EXT ); - if( status != GL_FRAMEBUFFER_COMPLETE_EXT ) - { - log_error( "ERROR: Unable to attach renderbuffer to framebuffer (%s, status %x)\n", gluErrorString( err ), (int)status ); - return -1; - } - - return 0; -} - -void * CreateGLRenderbuffer( GLsizei width, GLsizei height, - GLenum attachment, GLenum glFormat, - GLenum internalFormat, GLenum glType, - ExplicitType type, - GLuint *outFramebuffer, - GLuint *outRenderbuffer, - int *outError, MTdata d, bool allocateMem ) -{ - *outError = CreateGLRenderbufferRaw( width, height, attachment, glFormat, internalFormat, - glType, outFramebuffer, outRenderbuffer ); - - if( *outError != 0 ) - return NULL; - - GLenum err = 0; - - // Generate a renderbuffer and bind - glGenRenderbuffersEXT( 1, outRenderbuffer ); - glBindRenderbufferEXT( GL_RENDERBUFFER_EXT, *outRenderbuffer ); - - // Allocate storage to the renderbuffer - glGetError(); - glRenderbufferStorageEXT( GL_RENDERBUFFER_EXT, internalFormat, (GLsizei)width, (GLsizei)height ); - err = glGetError(); - if( err != GL_NO_ERROR ) - { - *outError = 1701; - log_error("Failed to allocate render buffer storage!\n"); - return NULL; - } - - GLint realInternalFormat; - glGetRenderbufferParameterivEXT( GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_INTERNAL_FORMAT_EXT, &realInternalFormat ); - internalFormat = realInternalFormat; - -#ifdef DEBUG - GLint rsize, gsize, bsize, asize; - glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_RED_SIZE_EXT,&rsize); - glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_GREEN_SIZE_EXT,&gsize); - glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_BLUE_SIZE_EXT,&bsize); - glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_ALPHA_SIZE_EXT,&asize); - - log_info("Renderbuffer internal format requested: %s actual: %s sizes: r=%d g=%d b=%d a=%d\n", - GetGLFormatName( internalFormat ), GetGLFormatName( realInternalFormat ), - rsize, gsize, bsize, asize ); -#endif - - // Create and bind a framebuffer to render with - glGenFramebuffersEXT( 1, outFramebuffer ); - glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, *outFramebuffer ); - if( err != GL_NO_ERROR ) - { - log_error( "ERROR: Unable to bind framebuffer : Error %s\n", - gluErrorString( err )); - - *outError = -1; - return NULL; - } - - // Attach to the framebuffer - glFramebufferRenderbufferEXT( GL_FRAMEBUFFER_EXT, attachment, GL_RENDERBUFFER_EXT, *outRenderbuffer ); - err = glGetError(); - GLint status = glCheckFramebufferStatusEXT( GL_FRAMEBUFFER_EXT ); - if( status != GL_FRAMEBUFFER_COMPLETE_EXT ) - { - *outError = -1; - log_error( "ERROR: Unable to attach renderbuffer to framebuffer (%s, status %x)\n", gluErrorString( err ), (int)status ); - return NULL; - } - - void* buffer = CreateRandomData(type, width * height * 4, d); - -#ifdef DEBUG - log_info( "- Fillling renderbuffer: %d : %d : %s : %s \n", - (int)width, (int)height, - GetGLFormatName(glFormat), - GetGLTypeName(glType)); - - DumpGLBuffer(glType, (int)width, (int)height, (void*)buffer); -#endif - - // Fill a texture with our input data - glTextureWrapper texture; - glGenTextures( 1, &texture ); - glBindTexture( GL_TEXTURE_RECTANGLE_ARB, texture ); - glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); - glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); - glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); - glTexImage2D( GL_TEXTURE_RECTANGLE_ARB, 0, internalFormat, width, height, 0, glFormat, glType, buffer ); - glEnable( GL_TEXTURE_RECTANGLE_ARB ); - - // Render fullscreen textured quad - glDisable( GL_LIGHTING ); - glViewport(0, 0, width, height); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glMatrixMode( GL_TEXTURE ); - glLoadIdentity(); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glClear(GL_COLOR_BUFFER_BIT); - gluOrtho2D( -1.0, 1.0, -1.0, 1.0 ); - glMatrixMode( GL_MODELVIEW ); - glBegin( GL_QUADS ); - { - glColor3f(1.0f, 1.0f, 1.0f); - glTexCoord2f( 0.0f, 0.0f ); - glVertex3f( -1.0f, -1.0f, 0.0f ); - glTexCoord2f( 0.0f, height ); - glVertex3f( -1.0f, 1.0f, 0.0f ); - glTexCoord2f( width, height ); - glVertex3f( 1.0f, 1.0f, 0.0f ); - glTexCoord2f( width, 0.0f ); - glVertex3f( 1.0f, -1.0f, 0.0f ); - } - glEnd(); - glBindTexture( GL_TEXTURE_RECTANGLE_ARB, 0 ); - glDisable( GL_TEXTURE_RECTANGLE_ARB ); - - glFlush(); - - // Read back the data in the renderbuffer - memset(buffer, 0, width * height * 4 * get_explicit_type_size( type )); - glReadBuffer( attachment ); - glReadPixels( 0, 0, (GLsizei)width, (GLsizei)height, glFormat, glType, buffer ); - - err = glGetError(); - if( err != GL_NO_ERROR ) - { - log_error( "ERROR: Unable to read data via glReadPixels : %d : %d : %s : %s : Error %s\n", - (int)width, (int)height, - GetGLFormatName(glFormat), - GetGLTypeName(glType), - gluErrorString( err )); - *outError = -1; - } - -#ifdef DEBUG - log_info( "- glReadPixels: %d : %d : %s : %s \n", - (int)width, (int)height, - GetGLFormatName(glFormat), - GetGLTypeName(glType)); - - DumpGLBuffer(glType, (int)width, (int)height, (void*)buffer); -#endif - - if( !allocateMem ) - { - free( buffer ); - return NULL; - } - - if( glType == GL_UNSIGNED_INT_8_8_8_8_REV && glFormat == GL_BGRA && allocateMem ) - { - // Reverse and reorder to validate since in the - // kernel the read_imagef() call always returns RGBA - cl_uchar *p = (cl_uchar *)buffer; - for( size_t i = 0; i < (size_t)width * height; i++ ) - { - cl_uchar uc0 = p[i * 4 + 0]; - cl_uchar uc1 = p[i * 4 + 1]; - cl_uchar uc2 = p[i * 4 + 2]; - cl_uchar uc3 = p[i * 4 + 3]; - - p[ i * 4 + 0 ] = uc2; - p[ i * 4 + 1 ] = uc1; - p[ i * 4 + 2 ] = uc0; - p[ i * 4 + 3 ] = uc3; - } - } - else if( glType == GL_UNSIGNED_INT_8_8_8_8 && glFormat == GL_BGRA && allocateMem ) - { - // Reverse and reorder to validate since in the - // kernel the read_imagef() call always returns RGBA - cl_uchar *p = (cl_uchar *)buffer; - for( size_t i = 0; i < width * height; i++ ) - { - cl_uchar uc0 = p[i * 4 + 0]; - cl_uchar uc1 = p[i * 4 + 1]; - cl_uchar uc2 = p[i * 4 + 2]; - cl_uchar uc3 = p[i * 4 + 3]; - - p[ i * 4 + 0 ] = uc1; - p[ i * 4 + 1 ] = uc2; - p[ i * 4 + 2 ] = uc3; - p[ i * 4 + 3 ] = uc0; - } - } - - return buffer; -} - -void * ReadGLRenderbuffer( GLuint glFramebuffer, GLuint glRenderbuffer, - GLenum attachment, GLenum glFormat, - GLenum glInternalFormat, GLenum glType, - ExplicitType typeToReadAs, - size_t outWidth, size_t outHeight ) -{ - glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, glFramebuffer ); - glFramebufferRenderbufferEXT( GL_FRAMEBUFFER_EXT, attachment, GL_RENDERBUFFER_EXT, glRenderbuffer ); - - // Attach to the framebuffer - GLint err = glGetError(); - if( glCheckFramebufferStatusEXT( GL_FRAMEBUFFER_EXT ) != GL_FRAMEBUFFER_COMPLETE_EXT ) - { - log_error( "ERROR: Unable to attach renderbuffer to framebuffer (%s)\n", gluErrorString( err ) ); - return NULL; - } - - // Read results from the GL renderbuffer -#ifdef DEBUG - log_info( "- Reading back from GL: %d x %d : %s : %s : %s\n", - (int)outWidth, (int)outHeight, - GetGLFormatName( glInternalFormat ), - GetGLFormatName( glFormat ), - GetGLTypeName( glType )); -#endif - - GLenum readBackFormat = glFormat == GL_RGBA_INTEGER_EXT ? GL_RGBA_INTEGER_EXT : GL_RGBA; - GLenum readBackType = glType; - - size_t outBytes = outWidth * outHeight * 4 * GetGLTypeSize(readBackType); - void *outBuffer = malloc( outBytes ); - memset(outBuffer, 0, outBytes); - - glReadPixels( 0, 0, (GLsizei)outWidth, (GLsizei)outHeight, readBackFormat, readBackType, outBuffer ); - -#ifdef DEBUG - log_info( "- glReadPixels: %d : %d : %s : %s \n", - (int)outWidth, (int)outHeight, - GetGLFormatName(readBackFormat), - GetGLTypeName(readBackType)); - - DumpGLBuffer(readBackType, outWidth, outHeight, outBuffer); -#endif - - return (void *)outBuffer; -} - -GLenum -GetGLFormat(GLenum internalFormat) -{ - GLenum glFormat; - switch (internalFormat) - { - case GL_BGRA: - case GL_RGBA8: - case GL_RGBA16: - case GL_RGBA32F_ARB: - glFormat = GL_RGBA; - break; - case GL_RGBA8I_EXT: - case GL_RGBA16I_EXT: - case GL_RGBA32I_EXT: - case GL_RGBA8UI_EXT: - case GL_RGBA16UI_EXT: - case GL_RGBA32UI_EXT: - glFormat = GL_RGBA_INTEGER_EXT; - break; - default: - glFormat = GL_RGBA; - break; - } - - return glFormat; -} - -GLenum GetGLTypeForExplicitType(ExplicitType type) -{ - switch( type ) - { - case kFloat: - return GL_FLOAT; - case kInt: - return GL_INT; - case kUInt: - return GL_UNSIGNED_INT; - case kShort: - return GL_SHORT; - case kUShort: - return GL_UNSIGNED_SHORT; - case kChar: - return GL_BYTE; - case kUChar: - return GL_UNSIGNED_BYTE; - case kHalf: -#if defined( __APPLE__ ) - return GL_HALF_FLOAT; -#else - return GL_HALF_FLOAT_ARB; -#endif - default: - return GL_INT; - }; -} - -size_t GetGLTypeSize(GLenum type) -{ - switch( type ) - { - case GL_FLOAT: - return sizeof(GLfloat); - case GL_INT: - return sizeof(GLint); - case GL_UNSIGNED_INT: - return sizeof(GLuint); - case GL_SHORT: - return sizeof(GLshort); - case GL_UNSIGNED_SHORT: - return sizeof(GLushort); - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_BYTE: - return sizeof(GLbyte); - case GL_UNSIGNED_BYTE: - return sizeof(GLubyte); -#if defined( __APPLE__ ) - case GL_HALF_FLOAT: -#else - case GL_HALF_FLOAT_ARB: -#endif - return sizeof(GLhalf); - default: - log_error("Unknown type 0x%x\n",type); - return 0; - }; -} - -ExplicitType GetExplicitTypeForGLType(GLenum type) -{ - switch( type ) - { - case GL_FLOAT: - return kFloat; - case GL_INT: - return kInt; - case GL_UNSIGNED_INT: - return kUInt; - case GL_SHORT: - return kShort; - case GL_UNSIGNED_SHORT: - return kUShort; - case GL_BYTE: - return kChar; - case GL_UNSIGNED_BYTE: - return kUChar; -#if defined( __APPLE__ ) - case GL_HALF_FLOAT: -#else - case GL_HALF_FLOAT_ARB: -#endif - return kHalf; - default: - return kFloat; - }; -} - -GLenum get_base_gl_target( GLenum target ) -{ - switch( target ) - { - case GL_TEXTURE_CUBE_MAP_POSITIVE_X: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: - return GL_TEXTURE_CUBE_MAP; - default: - return target; - } -} - -const char *GetGLTypeName( GLenum type ) -{ - switch( type ) - { - case GL_BYTE: return "GL_BYTE"; - case GL_UNSIGNED_BYTE: return "GL_UNSIGNED_BYTE"; - case GL_INT: return "GL_INT"; - case GL_UNSIGNED_INT: return "GL_UNSIGNED_INT"; - case GL_SHORT: return "GL_SHORT"; - case GL_UNSIGNED_SHORT: return "GL_UNSIGNED_SHORT"; -#if defined( __APPLE__ ) - case GL_HALF_FLOAT: return "GL_HALF_FLOAT"; -#else - case GL_HALF_FLOAT_ARB: return "GL_HALF_FLOAT_ARB"; -#endif - case GL_FLOAT: return "GL_FLOAT"; - case GL_UNSIGNED_INT_8_8_8_8: return "GL_UNSIGNED_INT_8_8_8_8"; - case GL_UNSIGNED_INT_8_8_8_8_REV: return "GL_UNSIGNED_INT_8_8_8_8_REV"; - default: - { - static char foo[ 128 ]; - sprintf( foo, "(Unknown:0x%08x)", (int)type ); - return foo; - } - } -} - -const char *GetGLTargetName( GLenum tgt ) -{ - if( tgt == GL_TEXTURE_2D ) return "GL_TEXTURE_2D"; - if( tgt == GL_TEXTURE_3D ) return "GL_TEXTURE_3D"; - if( tgt == GL_TEXTURE_RECTANGLE_EXT ) return "GL_TEXTURE_RECTANGLE_EXT"; - if( tgt == GL_TEXTURE_CUBE_MAP_POSITIVE_X ) return "GL_TEXTURE_CUBE_MAP_POSITIVE_X"; - if( tgt == GL_TEXTURE_CUBE_MAP_POSITIVE_Y ) return "GL_TEXTURE_CUBE_MAP_POSITIVE_Y"; - if( tgt == GL_TEXTURE_CUBE_MAP_POSITIVE_Z ) return "GL_TEXTURE_CUBE_MAP_POSITIVE_Z"; - if( tgt == GL_TEXTURE_CUBE_MAP_NEGATIVE_X ) return "GL_TEXTURE_CUBE_MAP_NEGATIVE_X"; - if( tgt == GL_TEXTURE_CUBE_MAP_NEGATIVE_Y ) return "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y"; - if( tgt == GL_TEXTURE_CUBE_MAP_NEGATIVE_Z ) return "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z"; - return ""; -} - -const char *GetGLAttachmentName( GLenum att ) -{ - if( att == GL_COLOR_ATTACHMENT0_EXT ) return "GL_COLOR_ATTACHMENT0_EXT"; - if( att == GL_COLOR_ATTACHMENT1_EXT ) return "GL_COLOR_ATTACHMENT1_EXT"; - if( att == GL_COLOR_ATTACHMENT2_EXT ) return "GL_COLOR_ATTACHMENT2_EXT"; - if( att == GL_COLOR_ATTACHMENT3_EXT ) return "GL_COLOR_ATTACHMENT3_EXT"; - if( att == GL_COLOR_ATTACHMENT4_EXT ) return "GL_COLOR_ATTACHMENT4_EXT"; - if( att == GL_COLOR_ATTACHMENT5_EXT ) return "GL_COLOR_ATTACHMENT5_EXT"; - if( att == GL_COLOR_ATTACHMENT6_EXT ) return "GL_COLOR_ATTACHMENT6_EXT"; - if( att == GL_COLOR_ATTACHMENT7_EXT ) return "GL_COLOR_ATTACHMENT7_EXT"; - if( att == GL_COLOR_ATTACHMENT8_EXT ) return "GL_COLOR_ATTACHMENT8_EXT"; - if( att == GL_DEPTH_ATTACHMENT_EXT ) return "GL_DEPTH_ATTACHMENT_EXT"; - return ""; -} -const char *GetGLBaseFormatName( GLenum baseformat ) -{ - switch( baseformat ) - { - case GL_RGBA8: return "GL_RGBA"; - case GL_RGBA16: return "GL_RGBA"; - case GL_RGBA: return "GL_RGBA"; - case GL_BGRA: return "GL_BGRA"; - case GL_RGBA8I_EXT: return "GL_RGBA_INTEGER_EXT"; - case GL_RGBA16I_EXT: return "GL_RGBA_INTEGER_EXT"; - case GL_RGBA32I_EXT: return "GL_RGBA_INTEGER_EXT"; - case GL_RGBA8UI_EXT: return "GL_RGBA_INTEGER_EXT"; - case GL_RGBA16UI_EXT: return "GL_RGBA_INTEGER_EXT"; - case GL_RGBA32UI_EXT: return "GL_RGBA_INTEGER_EXT"; - case GL_RGBA32F_ARB: return "GL_RGBA"; - - case GL_RGBA_INTEGER_EXT: return "GL_RGBA_INTEGER_EXT"; - - case GL_ALPHA4: return "GL_ALPHA"; - case GL_ALPHA8: return "GL_ALPHA"; - case GL_ALPHA12: return "GL_ALPHA"; - case GL_ALPHA16: return "GL_ALPHA"; - case GL_LUMINANCE4: return "GL_LUMINANCE"; - case GL_LUMINANCE8: return "GL_LUMINANCE"; - case GL_LUMINANCE12: return "GL_LUMINANCE"; - case GL_LUMINANCE16: return "GL_LUMINANCE"; - case GL_LUMINANCE4_ALPHA4: return "GL_LUMINANCE_ALPHA"; - case GL_LUMINANCE6_ALPHA2: return "GL_LUMINANCE_ALPHA"; - case GL_LUMINANCE8_ALPHA8: return "GL_LUMINANCE_ALPHA"; - case GL_LUMINANCE12_ALPHA4: return "GL_LUMINANCE_ALPHA"; - case GL_LUMINANCE12_ALPHA12: return "GL_LUMINANCE_ALPHA"; - case GL_LUMINANCE16_ALPHA16: return "GL_LUMINANCE_ALPHA"; - case GL_INTENSITY: return "GL_INTENSITY"; - case GL_INTENSITY4: return "GL_INTENSITY"; - case GL_INTENSITY8: return "GL_INTENSITY"; - case GL_INTENSITY12: return "GL_INTENSITY"; - case GL_INTENSITY16: return "GL_INTENSITY"; - case GL_R3_G3_B2: return "GL_RGB"; - case GL_RGB4: return "GL_RGB"; - case GL_RGB5: return "GL_RGB"; - case GL_RGB8: return "GL_RGB"; - case GL_RGB10: return "GL_RGB"; - case GL_RGB12: return "GL_RGB"; - case GL_RGB16: return "GL_RGB"; - case GL_RGBA2: return "GL_RGBA"; - case GL_RGBA4: return "GL_RGBA"; - case GL_RGB5_A1: return "GL_RGBA"; - case GL_RGB10_A2: return "GL_RGBA"; - case GL_RGBA12: return "GL_RGBA"; - - default: - { - static char foo[ 128 ]; - sprintf( foo, "(Unknown:0x%08x)", (int)baseformat ); - return foo; - } - } -} - -const char *GetGLFormatName( GLenum format ) -{ - switch( format ) - { - case GL_RGBA8: return "GL_RGBA8"; - case GL_RGBA16: return "GL_RGBA16"; - case GL_RGBA: return "GL_RGBA"; - case GL_BGRA: return "GL_BGRA"; - case GL_RGBA8I_EXT: return "GL_RGBA8I_EXT"; - case GL_RGBA16I_EXT: return "GL_RGBA16I_EXT"; - case GL_RGBA32I_EXT: return "GL_RGBA32I_EXT"; - case GL_RGBA8UI_EXT: return "GL_RGBA8UI_EXT"; - case GL_RGBA16UI_EXT: return "GL_RGBA16UI_EXT"; - case GL_RGBA32UI_EXT: return "GL_RGBA32UI_EXT"; - case GL_RGBA16F_ARB: return "GL_RGBA16F_ARB"; - case GL_RGBA32F_ARB: return "GL_RGBA32F_ARB"; - - case GL_RGBA_INTEGER_EXT: return "GL_RGBA_INTEGER_EXT"; - - case GL_ALPHA4: return "GL_ALPHA4"; - case GL_ALPHA8: return "GL_ALPHA8"; - case GL_ALPHA12: return "GL_ALPHA12"; - case GL_ALPHA16: return "GL_ALPHA16"; - case GL_LUMINANCE4: return "GL_LUMINANCE4"; - case GL_LUMINANCE8: return "GL_LUMINANCE8"; - case GL_LUMINANCE12: return "GL_LUMINANCE12"; - case GL_LUMINANCE16: return "GL_LUMINANCE16"; - case GL_LUMINANCE4_ALPHA4: return "GL_LUMINANCE4_ALPHA4"; - case GL_LUMINANCE6_ALPHA2: return "GL_LUMINANCE6_ALPHA2"; - case GL_LUMINANCE8_ALPHA8: return "GL_LUMINANCE8_ALPHA8"; - case GL_LUMINANCE12_ALPHA4: return "GL_LUMINANCE12_ALPHA4"; - case GL_LUMINANCE12_ALPHA12: return "GL_LUMINANCE12_ALPHA12"; - case GL_LUMINANCE16_ALPHA16: return "GL_LUMINANCE16_ALPHA16"; - case GL_INTENSITY: return "GL_INTENSITY"; - case GL_INTENSITY4: return "GL_INTENSITY4"; - case GL_INTENSITY8: return "GL_INTENSITY8"; - case GL_INTENSITY12: return "GL_INTENSITY12"; - case GL_INTENSITY16: return "GL_INTENSITY16"; - case GL_R3_G3_B2: return "GL_R3_G3_B2"; - case GL_RGB4: return "GL_RGB4"; - case GL_RGB5: return "GL_RGB5"; - case GL_RGB8: return "GL_RGB8"; - case GL_RGB10: return "GL_RGB10"; - case GL_RGB12: return "GL_RGB12"; - case GL_RGB16: return "GL_RGB16"; - case GL_RGBA2: return "GL_RGBA2"; - case GL_RGBA4: return "GL_RGBA4"; - case GL_RGB5_A1: return "GL_RGB5_A1"; - case GL_RGB10_A2: return "GL_RGB10_A2"; - case GL_RGBA12: return "GL_RGBA12"; - - case GL_INT: return "GL_INT"; - case GL_UNSIGNED_INT: return "GL_UNSIGNED_INT"; - case GL_SHORT: return "GL_SHORT"; - case GL_UNSIGNED_SHORT: return "GL_UNSIGNED_SHORT"; - case GL_BYTE: return "GL_BYTE"; - case GL_UNSIGNED_BYTE: return "GL_UNSIGNED_BYTE"; - case GL_FLOAT: return "GL_FLOAT"; -#if defined( __APPLE__ ) - case GL_HALF_FLOAT: return "GL_HALF_FLOAT"; -#else - case GL_HALF_FLOAT_ARB: return "GL_HALF_FLOAT_ARB"; -#endif - - default: - { - static char foo[ 128 ]; - sprintf( foo, "(Unknown:0x%08x)", (int)format ); - return foo; - } - } -} - -void* CreateRandomData( ExplicitType type, size_t count, MTdata d ) -{ - switch(type) - { - case (kChar): - { - cl_char *p = (cl_char *)malloc(count * sizeof(cl_char)); - if(!p) return 0; - - for( size_t i = 0; i < count; i++ ) - { - p[ i ] = (cl_char)genrand_int32(d); - } - return (void*)p; - } - case (kUChar): - { - cl_uchar *p = (cl_uchar *)malloc(count * sizeof(cl_uchar)); - if(!p) return 0; - - for( size_t i = 0; i < count; i++ ) - { - p[ i ] = (cl_uchar)genrand_int32(d); - } - - return (void*)p; - } - case (kShort): - { - cl_short *p = (cl_short *)malloc(count * sizeof(cl_short)); - if(!p) return 0; - - for( size_t i = 0; i < count; i++ ) - { - p[ i ] = (cl_short)genrand_int32(d); - } - - return (void*)p; - } - case (kUShort): - { - cl_ushort *p = (cl_ushort *)malloc(count * sizeof(cl_ushort)); - if(!p) return 0; - - for( size_t i = 0; i < count; i++ ) - { - p[ i ] = (cl_ushort)genrand_int32(d); - } - - return (void*)p; - } - case (kInt): - { - cl_int *p = (cl_int *)malloc(count * sizeof(cl_int)); - if(!p) return 0; - - for( size_t i = 0; i < count; i++ ) - { - p[ i ] = (cl_int)genrand_int32(d); - } - - return (void*)p; - } - case (kUInt): - { - cl_uint *p = (cl_uint *)malloc(count * sizeof(cl_uint)); - if(!p) return 0; - - for( size_t i = 0; i < count; i++ ) - { - p[ i ] = (cl_uint)genrand_int32(d); - } - - return (void*)p; - } - - case (kFloat): - { - cl_float *p = (cl_float *)malloc(count * sizeof(cl_float)); - if(!p) return 0; - - for( size_t i = 0; i < count; i++ ) - { - p[ i ] = get_random_float( 0.f, 1.f, d ); - } - - return (void*)p; - } - case (kHalf): - { - cl_half *p = (cl_half *)malloc(count * sizeof(cl_half)); - if(!p) return 0; - - for( size_t i = 0; i < count; i++ ) - { - p[ i ] = convert_float_to_half( get_random_float( 0.f, 1.f, d ) ); - } - - return (void*)p; - } - default: - { - log_error("Invalid explicit type specified for create random data!\n"); - return 0; - } - } - return 0; -} - -void DumpGLBuffer(GLenum type, size_t width, size_t height, void* buffer) -{ - size_t i; - size_t count = width * height; - if(type == GL_BYTE) - { - cl_char* p = (cl_char*)buffer; - for(i = 0; i < count; i++) - log_info("[%4d] %3d %3d %3d %3d\n", (unsigned int)(i), - p[i* 4 + 0], - p[i* 4 + 1], - p[i* 4 + 2], - p[i* 4 + 3]); - } - else if(type == GL_UNSIGNED_BYTE) - { - cl_uchar* p = (cl_uchar*)buffer; - for(i = 0; i < count; i++) - log_info("[%4d] %3d %3d %3d %3d\n", (unsigned int)(i), - p[i* 4 + 0], - p[i* 4 + 1], - p[i* 4 + 2], - p[i* 4 + 3]); - } - else if(type == GL_INT) - { - cl_int* p = (cl_int*)buffer; - for(i = 0; i < count; i++) - log_info("[%4d] %3d %3d %3d %3d\n", (unsigned int)(i), - p[i* 4 + 0], - p[i* 4 + 1], - p[i* 4 + 2], - p[i* 4 + 3]); - } - else if(type == GL_UNSIGNED_INT) - { - cl_uint* p = (cl_uint*)buffer; - for(i = 0; i < count; i++) - log_info("[%4d] %3d %3d %3d %3d\n", (unsigned int)(i), - p[i* 4 + 0], - p[i* 4 + 1], - p[i* 4 + 2], - p[i* 4 + 3]); - } - else if(type == GL_SHORT) - { - cl_short* p = (cl_short*)buffer; - for(i = 0; i < count; i++) - log_info("[%4d] %3d %3d %3d %3d\n", (unsigned int)(i), - p[i* 4 + 0], - p[i* 4 + 1], - p[i* 4 + 2], - p[i* 4 + 3]); - } - else if(type == GL_UNSIGNED_SHORT) - { - cl_ushort* p = (cl_ushort*)buffer; - for(i = 0; i < count; i++) - log_info("[%4d] %3d %3d %3d %3d\n", (unsigned int)(i), - p[i* 4 + 0], - p[i* 4 + 1], - p[i* 4 + 2], - p[i* 4 + 3]); - } - else if(type == GL_FLOAT) - { - cl_float* p = (cl_float*)buffer; - for(i = 0; i < count; i++) - log_info("[%4d] %#f %#f %#f %#f\n", (unsigned int)(i), - p[i* 4 + 0], - p[i* 4 + 1], - p[i* 4 + 2], - p[i* 4 + 3]); - } -} - -#if defined(_WIN32) -#include - -GLboolean gluCheckExtension(const GLubyte *extName, const GLubyte *extString) -{ - const size_t len = strlen((const char*)extName); - const char* str = (const char*)extString; - - while (str != NULL) { - str = strstr(str, (const char*)extName); - if (str == NULL) { - break; - } - if ((str > (const char*)extString || str[-1] == ' ') - && (str[len] == ' ' || str[len] == '\0')) { - return GL_TRUE; - } - str = strchr(str + len, ' '); - } - - return GL_FALSE; -} - -#endif - -// Function pointers for the GL/CL calls -clCreateFromGLBuffer_fn clCreateFromGLBuffer_ptr; -clCreateFromGLTexture_fn clCreateFromGLTexture_ptr; -clCreateFromGLTexture2D_fn clCreateFromGLTexture2D_ptr; -clCreateFromGLTexture3D_fn clCreateFromGLTexture3D_ptr; -clCreateFromGLRenderbuffer_fn clCreateFromGLRenderbuffer_ptr; -clGetGLObjectInfo_fn clGetGLObjectInfo_ptr; -clGetGLTextureInfo_fn clGetGLTextureInfo_ptr; -clEnqueueAcquireGLObjects_fn clEnqueueAcquireGLObjects_ptr; -clEnqueueReleaseGLObjects_fn clEnqueueReleaseGLObjects_ptr; - -int init_clgl_ext() { - - // As OpenCL for the platforms. Warn if more than one platform found, - // since this might not be the platform we want. By default, we simply - // use the first returned platform. - - cl_uint nplatforms; - cl_platform_id platform; - clGetPlatformIDs(0, NULL, &nplatforms); - clGetPlatformIDs(1, &platform, NULL); - - if (nplatforms > 1) { - log_info("clGetPlatformIDs returned multiple values. This is not " - "an error, but might result in obtaining incorrect function " - "pointers if you do not want the first returned platform.\n"); - - // Show them the platform name, in case it is a problem. - - size_t size; - char *name; - - clGetPlatformInfo(platform, CL_PLATFORM_NAME, 0, NULL, &size); - name = (char*)malloc(size); - clGetPlatformInfo(platform, CL_PLATFORM_NAME, size, name, NULL); - - log_info("Using platform with name: %s \n", name); - free(name); - } - - // Create the function pointer table - clCreateFromGLBuffer_ptr = (clCreateFromGLBuffer_fn)clGetExtensionFunctionAddressForPlatform(platform,"clCreateFromGLBuffer"); - if (clCreateFromGLBuffer_ptr == NULL) { - log_error("clGetExtensionFunctionAddressForPlatform(platform,clCreateFromGLBuffer) returned NULL.\n"); - return -1; - } - clCreateFromGLTexture2D_ptr = (clCreateFromGLTexture2D_fn)clGetExtensionFunctionAddressForPlatform(platform,"clCreateFromGLTexture2D"); - if (clCreateFromGLTexture2D_ptr == NULL) { - log_error("clGetExtensionFunctionAddressForPlatform(platform,clCreateFromGLTexture2D) returned NULL.\n"); - return -1; - } - clCreateFromGLTexture3D_ptr = (clCreateFromGLTexture3D_fn)clGetExtensionFunctionAddressForPlatform(platform,"clCreateFromGLTexture3D"); - if (clCreateFromGLTexture3D_ptr == NULL) { - log_error("clGetExtensionFunctionAddressForPlatform(platform,clCreateFromGLTexture3D\") returned NULL.\n"); - return -1; - } - clCreateFromGLTexture_ptr = (clCreateFromGLTexture_fn)clGetExtensionFunctionAddressForPlatform(platform,"clCreateFromGLTexture"); - if (clCreateFromGLTexture_ptr == NULL) { - log_error("clGetExtensionFunctionAddressForPlatform(platform,\"clCreateFromGLTexture\") returned NULL.\n"); - return -1; - } - clCreateFromGLRenderbuffer_ptr = (clCreateFromGLRenderbuffer_fn)clGetExtensionFunctionAddressForPlatform(platform,"clCreateFromGLRenderbuffer"); - if (clCreateFromGLRenderbuffer_ptr == NULL) { - log_error("clGetExtensionFunctionAddressForPlatform(platform,clCreateFromGLRenderbuffer) returned NULL.\n"); - return -1; - } - clGetGLObjectInfo_ptr = (clGetGLObjectInfo_fn)clGetExtensionFunctionAddressForPlatform(platform,"clGetGLObjectInfo"); - if (clGetGLObjectInfo_ptr == NULL) { - log_error("clGetExtensionFunctionAddressForPlatform(platform,clGetGLObjectInfo) returned NULL.\n"); - return -1; - } - clGetGLTextureInfo_ptr = (clGetGLTextureInfo_fn)clGetExtensionFunctionAddressForPlatform(platform,"clGetGLTextureInfo"); - if (clGetGLTextureInfo_ptr == NULL) { - log_error("clGetExtensionFunctionAddressForPlatform(platform,clGetGLTextureInfo) returned NULL.\n"); - return -1; - } - clEnqueueAcquireGLObjects_ptr = (clEnqueueAcquireGLObjects_fn)clGetExtensionFunctionAddressForPlatform(platform,"clEnqueueAcquireGLObjects"); - if (clEnqueueAcquireGLObjects_ptr == NULL) { - log_error("clGetExtensionFunctionAddressForPlatform(platform,clEnqueueAcquireGLObjects) returned NULL.\n"); - return -1; - } - clEnqueueReleaseGLObjects_ptr = (clEnqueueReleaseGLObjects_fn)clGetExtensionFunctionAddressForPlatform(platform,"clEnqueueReleaseGLObjects"); - if (clEnqueueReleaseGLObjects_ptr == NULL) { - log_error("clGetExtensionFunctionAddressForPlatform(platform,clEnqueueReleaseGLObjects) returned NULL.\n"); - return -1; - } - - return 0; -} - - diff --git a/test_conformance/compatibility/test_common/gl/helpers.h b/test_conformance/compatibility/test_common/gl/helpers.h deleted file mode 100644 index 86e7dde9..00000000 --- a/test_conformance/compatibility/test_common/gl/helpers.h +++ /dev/null @@ -1,283 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef _helpers_h -#define _helpers_h - -#include "../harness/compat.h" - -#include -#include -#include -#include - -#if !defined (__APPLE__) -#include -#include "gl_headers.h" -#include -#else -#include "gl_headers.h" -#endif - -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/threadTesting.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/mt19937.h" - -typedef cl_mem -(CL_API_CALL *clCreateFromGLBuffer_fn)(cl_context context, - cl_mem_flags flags, - GLuint bufobj, - int * errcode_ret); - -typedef cl_mem -(CL_API_CALL *clCreateFromGLTexture_fn)(cl_context context , - cl_mem_flags flags , - GLenum target , - GLint miplevel , - GLuint texture , - cl_int * errcode_ret) ; - -typedef cl_mem -(CL_API_CALL *clCreateFromGLTexture2D_fn)(cl_context context , - cl_mem_flags flags , - GLenum target , - GLint miplevel , - GLuint texture , - cl_int * errcode_ret) ; - -typedef cl_mem -(CL_API_CALL *clCreateFromGLTexture3D_fn)(cl_context context , - cl_mem_flags flags , - GLenum target , - GLint miplevel , - GLuint texture , - cl_int * errcode_ret) ; - -typedef cl_mem -(CL_API_CALL *clCreateFromGLRenderbuffer_fn)(cl_context context , - cl_mem_flags flags , - GLuint renderbuffer , - cl_int * errcode_ret) ; - -typedef cl_int -(CL_API_CALL *clGetGLObjectInfo_fn)(cl_mem memobj , - cl_gl_object_type * gl_object_type , - GLuint * gl_object_name) ; - -typedef cl_int -(CL_API_CALL *clGetGLTextureInfo_fn)(cl_mem memobj , - cl_gl_texture_info param_name , - size_t param_value_size , - void * param_value , - size_t * param_value_size_ret) ; - -typedef cl_int -(CL_API_CALL *clEnqueueAcquireGLObjects_fn)(cl_command_queue command_queue , - cl_uint num_objects , - const cl_mem * mem_objects , - cl_uint num_events_in_wait_list , - const cl_event * event_wait_list , - cl_event * event) ; - -typedef cl_int -(CL_API_CALL *clEnqueueReleaseGLObjects_fn)(cl_command_queue command_queue , - cl_uint num_objects , - const cl_mem * mem_objects , - cl_uint num_events_in_wait_list , - const cl_event * event_wait_list , - cl_event * event) ; - - -extern clCreateFromGLBuffer_fn clCreateFromGLBuffer_ptr; -extern clCreateFromGLTexture_fn clCreateFromGLTexture_ptr; -extern clCreateFromGLTexture2D_fn clCreateFromGLTexture2D_ptr; -extern clCreateFromGLTexture3D_fn clCreateFromGLTexture3D_ptr; -extern clCreateFromGLRenderbuffer_fn clCreateFromGLRenderbuffer_ptr; -extern clGetGLObjectInfo_fn clGetGLObjectInfo_ptr; -extern clGetGLTextureInfo_fn clGetGLTextureInfo_ptr; -extern clEnqueueAcquireGLObjects_fn clEnqueueAcquireGLObjects_ptr; -extern clEnqueueReleaseGLObjects_fn clEnqueueReleaseGLObjects_ptr; - - -class glBufferWrapper -{ - public: - glBufferWrapper() { mBuffer = 0; } - glBufferWrapper( GLuint b ) { mBuffer = b; } - ~glBufferWrapper() { if( mBuffer != 0 ) glDeleteBuffers( 1, &mBuffer ); } - - glBufferWrapper & operator=( const GLuint &rhs ) { mBuffer = rhs; return *this; } - operator GLuint() { return mBuffer; } - operator GLuint *() { return &mBuffer; } - - GLuint * operator&() { return &mBuffer; } - - bool operator==( GLuint rhs ) { return mBuffer == rhs; } - - protected: - - GLuint mBuffer; -}; - -class glTextureWrapper -{ - public: - glTextureWrapper() { mHandle = 0; } - glTextureWrapper( GLuint b ) { mHandle = b; } - ~glTextureWrapper() { - if( mHandle != 0 ) glDeleteTextures( 1, &mHandle ); - } - - glTextureWrapper & operator=( const GLuint &rhs ) { mHandle = rhs; return *this; } - operator GLuint() { return mHandle; } - operator GLuint *() { return &mHandle; } - - GLuint * operator&() { return &mHandle; } - - bool operator==( GLuint rhs ) { return mHandle == rhs; } - - protected: - - // The texture handle. - GLuint mHandle; -}; - -class glRenderbufferWrapper -{ - public: - glRenderbufferWrapper() { mBuffer = 0; } - glRenderbufferWrapper( GLuint b ) { mBuffer = b; } - ~glRenderbufferWrapper() { if( mBuffer != 0 ) glDeleteRenderbuffersEXT( 1, &mBuffer ); } - - glRenderbufferWrapper & operator=( const GLuint &rhs ) { mBuffer = rhs; return *this; } - operator GLuint() { return mBuffer; } - operator GLuint *() { return &mBuffer; } - - GLuint * operator&() { return &mBuffer; } - - bool operator==( GLuint rhs ) { return mBuffer == rhs; } - - protected: - - GLuint mBuffer; -}; - -class glFramebufferWrapper -{ - public: - glFramebufferWrapper() { mBuffer = 0; } - glFramebufferWrapper( GLuint b ) { mBuffer = b; } - ~glFramebufferWrapper() { if( mBuffer != 0 ) glDeleteFramebuffersEXT( 1, &mBuffer ); } - - glFramebufferWrapper & operator=( const GLuint &rhs ) { mBuffer = rhs; return *this; } - operator GLuint() { return mBuffer; } - operator GLuint *() { return &mBuffer; } - - GLuint * operator&() { return &mBuffer; } - - bool operator==( GLuint rhs ) { return mBuffer == rhs; } - - protected: - - GLuint mBuffer; -}; - - -// Helper functions (defined in helpers.cpp) - -extern void * CreateGLTexture1DArray( size_t width, size_t length, - GLenum target, GLenum glFormat, GLenum internalFormat, GLenum glType, - ExplicitType type, GLuint *outTextureID, int *outError, - bool allocateMem, MTdata d); - -extern void * CreateGLTexture2DArray( size_t width, size_t height, size_t length, - GLenum target, GLenum glFormat, GLenum internalFormat, GLenum glType, - ExplicitType type, GLuint *outTextureID, int *outError, - bool allocateMem, MTdata d); - -extern void * CreateGLTextureBuffer( size_t width, - GLenum target, GLenum glFormat, GLenum internalFormat, GLenum glType, - ExplicitType type, GLuint *outTex, GLuint *outBuf, int *outError, - bool allocateMem, MTdata d); - -extern void * CreateGLTexture1D(size_t width, - GLenum target, GLenum glFormat, - GLenum internalFormat, GLenum glType, - ExplicitType type, GLuint *outTextureID, - int *outError, bool allocateMem, MTdata d ); - -extern void * CreateGLTexture2D( size_t width, size_t height, - GLenum target, GLenum glFormat, - GLenum internalFormat, GLenum glType, - ExplicitType type, GLuint *outTextureID, - int *outError, bool allocateMem, MTdata d ); - - -extern void * CreateGLTexture3D( size_t width, size_t height, size_t depth, - GLenum target, GLenum glFormat, - GLenum internalFormat, GLenum glType, - ExplicitType type, GLuint *outTextureID, - int *outError, MTdata d, bool allocateMem = true ); - -extern void * ReadGLTexture( GLenum glTarget, GLuint glTexture, GLuint glBuf, GLint width, - GLenum glFormat, GLenum glInternalFormat, - GLenum glType, ExplicitType typeToReadAs, - size_t outWidth, size_t outHeight ); - -extern int CreateGLRenderbufferRaw( GLsizei width, GLsizei height, - GLenum target, GLenum glFormat, - GLenum internalFormat, GLenum glType, - GLuint *outFramebuffer, - GLuint *outRenderbuffer ); - -extern void * CreateGLRenderbuffer( GLsizei width, GLsizei height, - GLenum target, GLenum glFormat, - GLenum internalFormat, GLenum glType, - ExplicitType type, - GLuint *outFramebuffer, - GLuint *outRenderbuffer, - int *outError, MTdata d, bool allocateMem ); - -extern void * ReadGLRenderbuffer( GLuint glFramebuffer, GLuint glRenderbuffer, - GLenum attachment, GLenum glFormat, - GLenum glInternalFormat, GLenum glType, - ExplicitType typeToReadAs, - size_t outWidth, size_t outHeight ); - -extern void DumpGLBuffer(GLenum type, size_t width, size_t height, void* buffer); -extern const char *GetGLTypeName( GLenum type ); -extern const char *GetGLAttachmentName( GLenum att ); -extern const char *GetGLTargetName( GLenum tgt ); -extern const char *GetGLBaseFormatName( GLenum baseformat ); -extern const char *GetGLFormatName( GLenum format ); - -extern void* CreateRandomData( ExplicitType type, size_t count, MTdata d ); - -extern GLenum GetGLFormat(GLenum internalFormat); -extern GLenum GetGLTypeForExplicitType(ExplicitType type); -extern size_t GetGLTypeSize(GLenum type); -extern ExplicitType GetExplicitTypeForGLType(GLenum type); - -extern GLenum get_base_gl_target( GLenum target ); - -extern int init_clgl_ext( void ); - -#endif // _helpers_h - - - diff --git a/test_conformance/compatibility/test_common/gl/setup.h b/test_conformance/compatibility/test_common/gl/setup.h deleted file mode 100644 index 6ee810bb..00000000 --- a/test_conformance/compatibility/test_common/gl/setup.h +++ /dev/null @@ -1,48 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef _setup_h -#define _setup_h - -#include -#include -#include -#include "gl_headers.h" -#ifdef __APPLE__ -#include -#else -#include -#endif - - -// Note: the idea here is to have every platform define their own setup.cpp file that implements a GLEnvironment -// subclass internally, then return it as a definition for GLEnvironment::Create - -class GLEnvironment -{ - public: - GLEnvironment() {} - virtual ~GLEnvironment() {} - - virtual int Init( int *argc, char **argv, int use_opengl_32 ) = 0; - virtual cl_context CreateCLContext( void ) = 0; - virtual int SupportsCLGLInterop( cl_device_type device_type) = 0; - - static GLEnvironment * Instance( void ); - - -}; - -#endif // _setup_h diff --git a/test_conformance/compatibility/test_common/gl/setup_osx.cpp b/test_conformance/compatibility/test_common/gl/setup_osx.cpp deleted file mode 100644 index 01641be0..00000000 --- a/test_conformance/compatibility/test_common/gl/setup_osx.cpp +++ /dev/null @@ -1,156 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "setup.h" -#include "../../test_common/harness/errorHelpers.h" -#include - -class OSXGLEnvironment : public GLEnvironment -{ - public: - OSXGLEnvironment() - { - mCGLContext = NULL; - } - - virtual int Init( int *argc, char **argv, int use_opengl_32 ) - { - if (!use_opengl_32) { - - // Create a GLUT window to render into - glutInit( argc, argv ); - glutInitWindowSize( 512, 512 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow( "OpenCL <-> OpenGL Test" ); - } - - else { - - CGLPixelFormatAttribute attribs[] = { - kCGLPFAOpenGLProfile, (CGLPixelFormatAttribute)kCGLOGLPVersion_3_2_Core, - kCGLPFAAllowOfflineRenderers, - kCGLPFANoRecovery, - kCGLPFAAccelerated, - kCGLPFADoubleBuffer, - (CGLPixelFormatAttribute)0 - }; - - CGLError err; - CGLPixelFormatObj pix; - GLint npix; - err = CGLChoosePixelFormat (attribs, &pix, &npix); - if(err != kCGLNoError) - { - log_error("Failed to choose pixel format\n"); - return -1; - } - err = CGLCreateContext(pix, NULL, &mCGLContext); - if(err != kCGLNoError) - { - log_error("Failed to create GL context\n"); - return -1; - } - CGLSetCurrentContext(mCGLContext); - } - - return 0; - } - - virtual cl_context CreateCLContext( void ) - { - int error; - - if( mCGLContext == NULL ) - mCGLContext = CGLGetCurrentContext(); - - CGLShareGroupObj share_group = CGLGetShareGroup(mCGLContext); - cl_context_properties properties[] = { CL_CONTEXT_PROPERTY_USE_CGL_SHAREGROUP_APPLE, (cl_context_properties)share_group, 0 }; - cl_context context = clCreateContext(properties, 0, 0, 0, 0, &error); - if (error) { - print_error(error, "clCreateContext failed"); - return NULL; - } - - // Verify that all devices in the context support the required extension - cl_device_id devices[64]; - size_t size_out; - error = clGetContextInfo(context, CL_CONTEXT_DEVICES, sizeof(devices), devices, &size_out); - if (error) { - print_error(error, "clGetContextInfo failed"); - return NULL; - } - - char extensions[8192]; - for (int i=0; i<(int)(size_out/sizeof(cl_device_id)); i++) { - error = clGetDeviceInfo(devices[i], CL_DEVICE_EXTENSIONS, sizeof(extensions), extensions, NULL); - if (error) { - print_error(error, "clGetDeviceInfo failed"); - return NULL; - } - - if (strstr(extensions, "cl_APPLE_gl_sharing") == NULL) { - log_error("Device %d does not supporte required extension cl_APPLE_gl_sharing.\n", i); - return NULL; - } - } - return context; - } - - virtual int SupportsCLGLInterop( cl_device_type device_type ) - { - int found_valid_device = 0; - cl_device_id devices[64]; - cl_uint num_of_devices; - int error; - error = clGetDeviceIDs(NULL, device_type, 64, devices, &num_of_devices); - if (error) { - print_error(error, "clGetDeviceIDs failed"); - return -1; - } - - char extensions[8192]; - for (int i=0; i<(int)num_of_devices; i++) { - error = clGetDeviceInfo(devices[i], CL_DEVICE_EXTENSIONS, sizeof(extensions), extensions, NULL); - if (error) { - print_error(error, "clGetDeviceInfo failed"); - return -1; - } - - if (strstr(extensions, "cl_APPLE_gl_sharing") == NULL) { - log_info("Device %d of %d does not support required extension cl_APPLE_gl_sharing.\n", i, num_of_devices); - } else { - log_info("Device %d of %d does support required extension cl_APPLE_gl_sharing.\n", i, num_of_devices); - found_valid_device = 1; - } - } - return found_valid_device; - } - - virtual ~OSXGLEnvironment() - { - CGLDestroyContext( mCGLContext ); - } - - CGLContextObj mCGLContext; - -}; - -GLEnvironment * GLEnvironment::Instance( void ) -{ - static OSXGLEnvironment * env = NULL; - if( env == NULL ) - env = new OSXGLEnvironment(); - return env; -} diff --git a/test_conformance/compatibility/test_common/gl/setup_win32.cpp b/test_conformance/compatibility/test_common/gl/setup_win32.cpp deleted file mode 100644 index ff40dc25..00000000 --- a/test_conformance/compatibility/test_common/gl/setup_win32.cpp +++ /dev/null @@ -1,204 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#define GL_GLEXT_PROTOTYPES - -#include "setup.h" -#include "testBase.h" -#include "../../test_common/harness/errorHelpers.h" - -#include -#include -#include -#include -#include - -typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGLContextInfoKHR_fn)( - const cl_context_properties *properties, - cl_gl_context_info param_name, - size_t param_value_size, - void *param_value, - size_t *param_value_size_ret); - -// Rename references to this dynamically linked function to avoid -// collision with static link version -#define clGetGLContextInfoKHR clGetGLContextInfoKHR_proc -static clGetGLContextInfoKHR_fn clGetGLContextInfoKHR; - -#define MAX_DEVICES 32 - -class WGLEnvironment : public GLEnvironment -{ -private: - cl_device_id m_devices[MAX_DEVICES]; - int m_device_count; - cl_platform_id m_platform; - -public: - WGLEnvironment() - { - m_device_count = 0; - m_platform = 0; - - } - virtual int Init( int *argc, char **argv, int use_opengl_32 ) - { - // Create a GLUT window to render into - glutInit( argc, argv ); - glutInitWindowSize( 512, 512 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow( "OpenCL <-> OpenGL Test" ); - glewInit(); - return 0; - } - - virtual cl_context CreateCLContext( void ) - { - HGLRC hGLRC = wglGetCurrentContext(); - HDC hDC = wglGetCurrentDC(); - cl_context_properties properties[] = { - CL_CONTEXT_PLATFORM, (cl_context_properties) m_platform, - CL_GL_CONTEXT_KHR, (cl_context_properties) hGLRC, - CL_WGL_HDC_KHR, (cl_context_properties) hDC, - 0 - }; - cl_device_id devices[MAX_DEVICES]; - size_t dev_size; - cl_int status; - - if (!hGLRC || !hDC) { - print_error(CL_INVALID_CONTEXT, "No GL context bound"); - return 0; - } - - if (!clGetGLContextInfoKHR) { - // As OpenCL for the platforms. Warn if more than one platform found, - // since this might not be the platform we want. By default, we simply - // use the first returned platform. - - cl_uint nplatforms; - cl_platform_id platform; - clGetPlatformIDs(0, NULL, &nplatforms); - clGetPlatformIDs(1, &platform, NULL); - - if (nplatforms > 1) { - log_info("clGetPlatformIDs returned multiple values. This is not " - "an error, but might result in obtaining incorrect function " - "pointers if you do not want the first returned platform.\n"); - - // Show them the platform name, in case it is a problem. - - size_t size; - char *name; - - clGetPlatformInfo(platform, CL_PLATFORM_NAME, 0, NULL, &size); - name = (char*)malloc(size); - clGetPlatformInfo(platform, CL_PLATFORM_NAME, size, name, NULL); - - log_info("Using platform with name: %s \n", name); - free(name); - } - - clGetGLContextInfoKHR = (clGetGLContextInfoKHR_fn) clGetExtensionFunctionAddressForPlatform(platform, "clGetGLContextInfoKHR"); - if (!clGetGLContextInfoKHR) { - print_error(CL_INVALID_PLATFORM, "Failed to query proc address for clGetGLContextInfoKHR"); - } - } - - status = clGetGLContextInfoKHR(properties, - CL_DEVICES_FOR_GL_CONTEXT_KHR, - sizeof(devices), - devices, - &dev_size); - if (status != CL_SUCCESS) { - print_error(status, "clGetGLContextInfoKHR failed"); - return 0; - } - dev_size /= sizeof(cl_device_id); - log_info("GL context supports %d compute devices\n", dev_size); - - status = clGetGLContextInfoKHR(properties, - CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR, - sizeof(devices), - devices, - &dev_size); - if (status != CL_SUCCESS) { - print_error(status, "clGetGLContextInfoKHR failed"); - return 0; - } - - cl_device_id ctxDevice = m_devices[0]; - if (dev_size > 0) { - log_info("GL context current device: 0x%x\n", devices[0]); - for (int i = 0; i < m_device_count; i++) { - if (m_devices[i] == devices[0]) { - ctxDevice = devices[0]; - break; - } - } - } else { - log_info("GL context current device is not a CL device, using device %d.\n", ctxDevice); - } - - return clCreateContext(properties, 1, &ctxDevice, NULL, NULL, &status); - } - - virtual int SupportsCLGLInterop( cl_device_type device_type ) - { - cl_device_id devices[MAX_DEVICES]; - cl_uint num_of_devices; - int error; - error = clGetPlatformIDs(1, &m_platform, NULL); - if (error) { - print_error(error, "clGetPlatformIDs failed"); - return -1; - } - error = clGetDeviceIDs(m_platform, device_type, MAX_DEVICES, devices, &num_of_devices); - if (error) { - print_error(error, "clGetDeviceIDs failed"); - return -1; - } - - // Check all devices, search for one that supports cl_khr_gl_sharing - char extensions[8192]; - for (int i=0; i<(int)num_of_devices; i++) { - error = clGetDeviceInfo(devices[i], CL_DEVICE_EXTENSIONS, sizeof(extensions), extensions, NULL); - if (error) { - print_error(error, "clGetDeviceInfo failed"); - return -1; - } - - if (strstr(extensions, "cl_khr_gl_sharing") == NULL) { - log_info("Device %d of %d does not support required extension cl_khr_gl_sharing.\n", i+1, num_of_devices); - } else { - log_info("Device %d of %d supports required extension cl_khr_gl_sharing.\n", i+1, num_of_devices); - m_devices[m_device_count++] = devices[i]; - } - } - return m_device_count > 0; - } - - virtual ~WGLEnvironment() - { - } -}; - -GLEnvironment * GLEnvironment::Instance( void ) -{ - static WGLEnvironment * env = NULL; - if( env == NULL ) - env = new WGLEnvironment(); - return env; -} diff --git a/test_conformance/compatibility/test_common/gl/setup_x11.cpp b/test_conformance/compatibility/test_common/gl/setup_x11.cpp deleted file mode 100644 index 22bc7eed..00000000 --- a/test_conformance/compatibility/test_common/gl/setup_x11.cpp +++ /dev/null @@ -1,122 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#define GL_GLEXT_PROTOTYPES - -#include "setup.h" -#include "testBase.h" -#include "../../test_common/harness/errorHelpers.h" - -#include -#include -#include -#include -#include -#include - -class X11GLEnvironment : public GLEnvironment -{ -private: - cl_device_id m_devices[64]; - cl_uint m_device_count; - -public: - X11GLEnvironment() - { - m_device_count = 0; - } - virtual int Init( int *argc, char **argv, int use_opencl_32 ) - { - // Create a GLUT window to render into - glutInit( argc, argv ); - glutInitWindowSize( 512, 512 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow( "OpenCL <-> OpenGL Test" ); - glewInit(); - return 0; - } - - virtual cl_context CreateCLContext( void ) - { - GLXContext context = glXGetCurrentContext(); - Display *dpy = glXGetCurrentDisplay(); - - cl_context_properties properties[] = { - CL_GL_CONTEXT_KHR, (cl_context_properties) context, - CL_GLX_DISPLAY_KHR, (cl_context_properties) dpy, - 0 - }; - cl_int status; - - if (!context || !dpy) { - print_error(CL_INVALID_CONTEXT, "No GL context bound"); - return 0; - } - - return clCreateContext(properties, 1, m_devices, NULL, NULL, &status); - } - - virtual int SupportsCLGLInterop( cl_device_type device_type ) - { - int found_valid_device = 0; - cl_platform_id platform; - cl_device_id devices[64]; - cl_uint num_of_devices; - int error; - error = clGetPlatformIDs(1, &platform, NULL); - if (error) { - print_error(error, "clGetPlatformIDs failed"); - return -1; - } - error = clGetDeviceIDs(platform, device_type, 64, devices, &num_of_devices); - // If this platform doesn't have any of the requested device_type (namely GPUs) then return 0 - if (error == CL_DEVICE_NOT_FOUND) - return 0; - if (error) { - print_error(error, "clGetDeviceIDs failed"); - return -1; - } - - char extensions[8192]; - for (int i=0; i<(int)num_of_devices; i++) { - error = clGetDeviceInfo(devices[i], CL_DEVICE_EXTENSIONS, sizeof(extensions), extensions, NULL); - if (error) { - print_error(error, "clGetDeviceInfo failed"); - return -1; - } - - if (strstr(extensions, "cl_khr_gl_sharing ") == NULL) { - log_info("Device %d of %d does not support required extension cl_khr_gl_sharing.\n", i+1, num_of_devices); - } else { - log_info("Device %d of %d supports required extension cl_khr_gl_sharing.\n", i+1, num_of_devices); - found_valid_device = 1; - m_devices[m_device_count++] = devices[i]; - } - } - return found_valid_device; - } - - virtual ~X11GLEnvironment() - { - } -}; - -GLEnvironment * GLEnvironment::Instance( void ) -{ - static X11GLEnvironment * env = NULL; - if( env == NULL ) - env = new X11GLEnvironment(); - return env; -} diff --git a/test_conformance/compatibility/test_common/harness/ThreadPool.c b/test_conformance/compatibility/test_common/harness/ThreadPool.c deleted file mode 100644 index a4598f2e..00000000 --- a/test_conformance/compatibility/test_common/harness/ThreadPool.c +++ /dev/null @@ -1,899 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "ThreadPool.h" -#include "errorHelpers.h" -#include "fpcontrol.h" -#include -#include - -#if defined( __APPLE__ ) || defined( __linux__ ) || defined( _WIN32 ) // or any other POSIX system - -#if defined( _WIN32 ) -#include -#if defined(_MSC_VER) -#include -#endif -#include "mingw_compat.h" -#include -#else // !_WIN32 -#include -#include -#include -#endif // !_WIN32 - -// declarations -#ifdef _WIN32 -void ThreadPool_WorkerFunc( void *p ); -#else -void *ThreadPool_WorkerFunc( void *p ); -#endif -void ThreadPool_Init(void); -void ThreadPool_Exit(void); - -#if defined (__MINGW32__) - // Mutex for implementing super heavy atomic operations if you don't have GCC or MSVC - CRITICAL_SECTION gAtomicLock; -#elif defined( __GNUC__ ) || defined( _MSC_VER) -#else - pthread_mutex_t gAtomicLock; -#endif - -// Atomic add operator with mem barrier. Mem barrier needed to protect state modified by the worker functions. -cl_int ThreadPool_AtomicAdd( volatile cl_int *a, cl_int b ) -{ -#if defined (__MINGW32__) - // No atomics on Mingw32 - EnterCriticalSection(&gAtomicLock); - cl_int old = *a; - *a = old + b; - LeaveCriticalSection(&gAtomicLock); - return old; -#elif defined( __GNUC__ ) - // GCC extension: http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html#Atomic-Builtins - return __sync_fetch_and_add( a, b ); - // do we need __sync_synchronize() here, too? GCC docs are unclear whether __sync_fetch_and_add does a synchronize -#elif defined( _MSC_VER ) - return (cl_int) _InterlockedExchangeAdd( (volatile LONG*) a, (LONG) b ); -#else - #warning Please add a atomic add implementation here, with memory barrier. Fallback code is slow. - if( pthread_mutex_lock(&gAtomicLock) ) - log_error( "Atomic operation failed. pthread_mutex_lock(&gAtomicLock) returned an error\n"); - cl_int old = *a; - *a = old + b; - if( pthread_mutex_unlock(&gAtomicLock) ) - log_error( "Failed to release gAtomicLock. Further atomic operations may deadlock!\n"); - return old; -#endif -} - -#if defined( _WIN32 ) -// Uncomment the following line if Windows XP support is not required. -// #define HAS_INIT_ONCE_EXECUTE_ONCE 1 - -#if defined(HAS_INIT_ONCE_EXECUTE_ONCE) -#define _INIT_ONCE INIT_ONCE -#define _PINIT_ONCE PINIT_ONCE -#define _InitOnceExecuteOnce InitOnceExecuteOnce -#else // !HAS_INIT_ONCE_EXECUTE_ONCE - -typedef volatile LONG _INIT_ONCE; -typedef _INIT_ONCE *_PINIT_ONCE; -typedef BOOL (CALLBACK *_PINIT_ONCE_FN)(_PINIT_ONCE, PVOID, PVOID *); - -#define _INIT_ONCE_UNINITIALIZED 0 -#define _INIT_ONCE_IN_PROGRESS 1 -#define _INIT_ONCE_DONE 2 - -static BOOL _InitOnceExecuteOnce( - _PINIT_ONCE InitOnce, - _PINIT_ONCE_FN InitFn, - PVOID Parameter, - LPVOID *Context -) -{ - while ( *InitOnce != _INIT_ONCE_DONE ) - { - if (*InitOnce != _INIT_ONCE_IN_PROGRESS && _InterlockedCompareExchange( InitOnce, _INIT_ONCE_IN_PROGRESS, _INIT_ONCE_UNINITIALIZED ) == _INIT_ONCE_UNINITIALIZED ) - { - InitFn( InitOnce, Parameter, Context ); - *InitOnce = _INIT_ONCE_DONE; - return TRUE; - } - Sleep( 1 ); - } - return TRUE; -} -#endif // !HAS_INIT_ONCE_EXECUTE_ONCE - -// Uncomment the following line if Windows XP support is not required. -// #define HAS_CONDITION_VARIABLE 1 - -#if defined(HAS_CONDITION_VARIABLE) -#define _CONDITION_VARIABLE CONDITION_VARIABLE -#define _InitializeConditionVariable InitializeConditionVariable -#define _SleepConditionVariableCS SleepConditionVariableCS -#define _WakeAllConditionVariable WakeAllConditionVariable -#else // !HAS_CONDITION_VARIABLE -typedef struct -{ - HANDLE mEvent; // Used to park the thread. - CRITICAL_SECTION mLock[1]; // Used to protect mWaiters, mGeneration and mReleaseCount. - volatile cl_int mWaiters; // Number of threads waiting on this cond var. - volatile cl_int mGeneration; // Wait generation count. - volatile cl_int mReleaseCount; // Number of releases to execute before reseting the event. -} _CONDITION_VARIABLE; - -typedef _CONDITION_VARIABLE *_PCONDITION_VARIABLE; - -static void _InitializeConditionVariable( _PCONDITION_VARIABLE cond_var ) -{ - cond_var->mEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); - InitializeCriticalSection( cond_var->mLock ); - cond_var->mWaiters = 0; - cond_var->mGeneration = 0; -#if !defined ( NDEBUG ) - cond_var->mReleaseCount = 0; -#endif // !NDEBUG -} - -static void _SleepConditionVariableCS( _PCONDITION_VARIABLE cond_var, PCRITICAL_SECTION cond_lock, DWORD ignored) -{ - EnterCriticalSection( cond_var->mLock ); - cl_int generation = cond_var->mGeneration; - ++cond_var->mWaiters; - LeaveCriticalSection( cond_var->mLock ); - LeaveCriticalSection( cond_lock ); - - while ( TRUE ) - { - WaitForSingleObject( cond_var->mEvent, INFINITE ); - EnterCriticalSection( cond_var->mLock ); - BOOL done = cond_var->mReleaseCount > 0 && cond_var->mGeneration != generation; - LeaveCriticalSection( cond_var->mLock ); - if ( done ) - { - break; - } - } - - EnterCriticalSection( cond_lock ); - EnterCriticalSection( cond_var->mLock ); - if ( --cond_var->mReleaseCount == 0 ) - { - ResetEvent( cond_var->mEvent ); - } - --cond_var->mWaiters; - LeaveCriticalSection( cond_var->mLock ); -} - -static void _WakeAllConditionVariable( _PCONDITION_VARIABLE cond_var ) -{ - EnterCriticalSection( cond_var->mLock ); - if (cond_var->mWaiters > 0 ) - { - ++cond_var->mGeneration; - cond_var->mReleaseCount = cond_var->mWaiters; - SetEvent( cond_var->mEvent ); - } - LeaveCriticalSection( cond_var->mLock ); -} -#endif // !HAS_CONDITION_VARIABLE -#endif // _WIN32 - -#define MAX_COUNT (1<<29) - -// Global state to coordinate whether the threads have been launched successfully or not -#if defined( _MSC_VER ) && (_WIN32_WINNT >= 0x600) -static _INIT_ONCE threadpool_init_control; -#elif defined (_WIN32) // MingW of XP -static int threadpool_init_control; -#else // Posix platforms -pthread_once_t threadpool_init_control = PTHREAD_ONCE_INIT; -#endif -cl_int threadPoolInitErr = -1; // set to CL_SUCCESS on successful thread launch - -// critical region lock around ThreadPool_Do. We can only run one ThreadPool_Do at a time, -// because we are too lazy to set up a queue here, and don't expect to need one. -#if defined( _WIN32 ) -CRITICAL_SECTION gThreadPoolLock[1]; -#else // !_WIN32 -pthread_mutex_t gThreadPoolLock; -#endif // !_WIN32 - -// Condition variable to park ThreadPool threads when not working -#if defined( _WIN32 ) -CRITICAL_SECTION cond_lock[1]; -_CONDITION_VARIABLE cond_var[1]; -#else // !_WIN32 -pthread_mutex_t cond_lock; -pthread_cond_t cond_var; -#endif // !_WIN32 -volatile cl_int gRunCount = 0; // Condition variable state. How many iterations on the function left to run. - // set to CL_INT_MAX to cause worker threads to exit. Note: this value might go negative. - -// State that only changes when the threadpool is not working. -volatile TPFuncPtr gFunc_ptr = NULL; -volatile void *gUserInfo = NULL; -volatile cl_int gJobCount = 0; - -// State that may change while the thread pool is working -volatile cl_int jobError = CL_SUCCESS; // err code return for the job as a whole - -// Condition variable to park caller while waiting -#if defined( _WIN32 ) -HANDLE caller_event; -#else // !_WIN32 -pthread_mutex_t caller_cond_lock; -pthread_cond_t caller_cond_var; -#endif // !_WIN32 -volatile cl_int gRunning = 0; // # of threads intended to be running. Running threads will decrement this as they discover they've run out of work to do. - -// The total number of threads launched. -volatile cl_int gThreadCount = 0; -#ifdef _WIN32 -void ThreadPool_WorkerFunc( void *p ) -#else -void *ThreadPool_WorkerFunc( void *p ) -#endif -{ - cl_uint threadID = ThreadPool_AtomicAdd( (volatile cl_int *) p, 1 ); - cl_int item = ThreadPool_AtomicAdd( &gRunCount, -1 ); -// log_info( "ThreadPool_WorkerFunc start: gRunning = %d\n", gRunning ); - - while( MAX_COUNT > item ) - { - cl_int err; - - // check for more work to do - if( 0 >= item ) - { -// log_info( "Thread %d has run out of work.\n", threadID ); - - // No work to do. Attempt to block waiting for work -#if defined( _WIN32 ) - EnterCriticalSection( cond_lock ); -#else // !_WIN32 - if((err = pthread_mutex_lock( &cond_lock) )) - { - log_error("Error %d from pthread_mutex_lock. Worker %d unable to block waiting for work. ThreadPool_WorkerFunc failed.\n", err, threadID ); - goto exit; - } -#endif // !_WIN32 - - cl_int remaining = ThreadPool_AtomicAdd( &gRunning, -1 ); -// log_info( "ThreadPool_WorkerFunc: gRunning = %d\n", remaining - 1 ); - if( 1 == remaining ) - { // last thread out signal the main thread to wake up -#if defined( _WIN32 ) - SetEvent( caller_event ); -#else // !_WIN32 - if((err = pthread_mutex_lock( &caller_cond_lock) )) - { - log_error("Error %d from pthread_mutex_lock. Unable to wake caller.\n", err ); - goto exit; - } - if( (err = pthread_cond_broadcast( &caller_cond_var ))) - { - log_error("Error %d from pthread_cond_broadcast. Unable to wake up main thread. ThreadPool_WorkerFunc failed.\n", err ); - goto exit; - } - if((err = pthread_mutex_unlock( &caller_cond_lock) )) - { - log_error("Error %d from pthread_mutex_lock. Unable to wake caller.\n", err ); - goto exit; - } -#endif // !_WIN32 - } - - // loop in case we are woken only to discover that some other thread already did all the work - while( 0 >= item ) - { -#if defined( _WIN32 ) - _SleepConditionVariableCS( cond_var, cond_lock, INFINITE ); -#else // !_WIN32 - if((err = pthread_cond_wait( &cond_var, &cond_lock) )) - { - log_error("Error %d from pthread_cond_wait. Unable to block for waiting for work. ThreadPool_WorkerFunc failed.\n", err ); - pthread_mutex_unlock( &cond_lock); - goto exit; - } -#endif // !_WIN32 - - // try again to get a valid item id - item = ThreadPool_AtomicAdd( &gRunCount, -1 ); - if( MAX_COUNT <= item ) // exit if we are done - { -#if defined( _WIN32 ) - LeaveCriticalSection( cond_lock ); -#else // !_WIN32 - pthread_mutex_unlock( &cond_lock); -#endif // !_WIN32 - goto exit; - } - } - - ThreadPool_AtomicAdd( &gRunning, 1 ); -// log_info( "Thread %d has found work.\n", threadID); - -#if defined( _WIN32 ) - LeaveCriticalSection( cond_lock ); -#else // !_WIN32 - if((err = pthread_mutex_unlock( &cond_lock) )) - { - log_error("Error %d from pthread_mutex_unlock. Unable to block for waiting for work. ThreadPool_WorkerFunc failed.\n", err ); - goto exit; - } -#endif // !_WIN32 - - } - - // we have a valid item, so do the work - if( CL_SUCCESS == jobError ) // but only if we haven't already encountered an error - { -// log_info( "Thread %d doing job %d\n", threadID, item - 1); - -#if defined(__APPLE__) && defined(__arm__) - // On most platforms which support denorm, default is FTZ off. However, - // on some hardware where the reference is computed, default might be flush denorms to zero e.g. arm. - // This creates issues in result verification. Since spec allows the implementation to either flush or - // not flush denorms to zero, an implementation may choose not be flush i.e. return denorm result whereas - // reference result may be zero (flushed denorm). Hence we need to disable denorm flushing on host side - // where reference is being computed to make sure we get non-flushed reference result. If implementation - // returns flushed result, we correctly take care of that in verification code. - FPU_mode_type oldMode; - DisableFTZ( &oldMode ); -#endif - - // Call the user's function with this item ID - err = gFunc_ptr( item - 1, threadID, (void*) gUserInfo ); -#if defined(__APPLE__) && defined(__arm__) - // Restore FP state - RestoreFPState( &oldMode ); -#endif - - if( err ) - { -#if (__MINGW32__) - EnterCriticalSection(&gAtomicLock); - if( jobError == CL_SUCCESS ); - jobError = err; - gRunCount = 0; - LeaveCriticalSection(&gAtomicLock); -#elif defined( __GNUC__ ) - // GCC extension: http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html#Atomic-Builtins - // set the new error if we are the first one there. - __sync_val_compare_and_swap( &jobError, CL_SUCCESS, err ); - - // drop run count to 0 - gRunCount = 0; - __sync_synchronize(); -#elif defined( _MSC_VER ) - // set the new error if we are the first one there. - _InterlockedCompareExchange( (volatile LONG*) &jobError, err, CL_SUCCESS ); - - // drop run count to 0 - gRunCount = 0; - _mm_mfence(); -#else - if( pthread_mutex_lock(&gAtomicLock) ) - log_error( "Atomic operation failed. pthread_mutex_lock(&gAtomicLock) returned an error\n"); - if( jobError == CL_SUCCESS ); - jobError = err; - gRunCount = 0; - if( pthread_mutex_unlock(&gAtomicLock) ) - log_error( "Failed to release gAtomicLock. Further atomic operations may deadlock\n"); -#endif - } - } - - // get the next item - item = ThreadPool_AtomicAdd( &gRunCount, -1 ); - } - -exit: - log_info( "ThreadPool: thread %d exiting.\n", threadID ); - ThreadPool_AtomicAdd( &gThreadCount, -1 ); -#if !defined(_WIN32) - return NULL; -#endif -} - -// SetThreadCount() may be used to artifically set the number of worker threads -// If the value is 0 (the default) the number of threads will be determined based on -// the number of CPU cores. If it is a unicore machine, then 2 will be used, so -// that we still get some testing for thread safety. -// -// If count < 2 or the CL_TEST_SINGLE_THREADED environment variable is set then the -// code will run single threaded, but will report an error to indicate that the test -// is invalid. This option is intended for debugging purposes only. It is suggested -// as a convention that test apps set the thread count to 1 in response to the -m flag. -// -// SetThreadCount() must be called before the first call to GetThreadCount() or ThreadPool_Do(), -// otherwise the behavior is indefined. -void SetThreadCount( int count ) -{ - if( threadPoolInitErr == CL_SUCCESS ) - { - log_error( "Error: It is illegal to set the thread count after the first call to ThreadPool_Do or GetThreadCount\n" ); - abort(); - } - - gThreadCount = count; -} - -void ThreadPool_Init(void) -{ - cl_int i; - int err; - volatile cl_uint threadID = 0; - - // Check for manual override of multithreading code. We add this for better debuggability. - if( getenv( "CL_TEST_SINGLE_THREADED" ) ) - { - log_error("ERROR: CL_TEST_SINGLE_THREADED is set in the environment. Running single threaded.\n*** TEST IS INVALID! ***\n"); - gThreadCount = 1; - return; - } - - // Figure out how many threads to run -- check first for non-zero to give the implementation the chance - if( 0 == gThreadCount ) - { -#if defined(_MSC_VER) || defined (__MINGW64__) - PSYSTEM_LOGICAL_PROCESSOR_INFORMATION buffer = NULL; - DWORD length = 0; - - GetLogicalProcessorInformation( NULL, &length ); - buffer = (PSYSTEM_LOGICAL_PROCESSOR_INFORMATION) malloc( length ); - if( buffer != NULL && GetLogicalProcessorInformation( buffer, &length ) == TRUE ) - { - PSYSTEM_LOGICAL_PROCESSOR_INFORMATION ptr = buffer; - while( ptr < &buffer[ length / sizeof( SYSTEM_LOGICAL_PROCESSOR_INFORMATION ) ] ) - { - if( ptr->Relationship == RelationProcessorCore ) - { - // Count the number of bits in ProcessorMask (number of logical cores) - ULONG mask = ptr->ProcessorMask; - while( mask ) - { - ++gThreadCount; - mask &= mask - 1; // Remove 1 bit at a time - } - } - ++ptr; - } - free(buffer); - } -#elif defined (__MINGW32__) - { - #warning How about this, instead of hard coding it to 2? - SYSTEM_INFO sysinfo; - GetSystemInfo( &sysinfo ); - gThreadCount = sysinfo.dwNumberOfProcessors; - } -#else // !_WIN32 - gThreadCount = (cl_int) sysconf(_SC_NPROCESSORS_CONF); // Hopefully your system returns logical cpus here, as does MacOS X -#endif // !_WIN32 - - // Multithreaded tests are required to run multithreaded even on unicore systems so as to test thread safety - if( 1 == gThreadCount ) - gThreadCount = 2; - } - - //Allow the app to set thread count to <0 for debugging purposes. This will cause the test to run single threaded. - if( gThreadCount < 2 ) - { - log_error( "ERROR: Running single threaded because thread count < 2. \n*** TEST IS INVALID! ***\n"); - gThreadCount = 1; - return; - } - -#if defined( _WIN32 ) - InitializeCriticalSection( gThreadPoolLock ); - InitializeCriticalSection( cond_lock ); - _InitializeConditionVariable( cond_var ); - caller_event = CreateEvent( NULL, FALSE, FALSE, NULL ); -#elif defined (__GNUC__) - // Dont rely on PTHREAD_MUTEX_INITIALIZER for intialization of a mutex since it might cause problem - // with some flavors of gcc compilers. - pthread_cond_init(&cond_var, NULL); - pthread_mutex_init(&cond_lock ,NULL); - pthread_cond_init(&caller_cond_var, NULL); - pthread_mutex_init(&caller_cond_lock, NULL); - pthread_mutex_init(&gThreadPoolLock, NULL); -#endif - -#if !(defined(__GNUC__) || defined(_MSC_VER) || defined(__MINGW32__)) - pthread_mutex_initialize(gAtomicLock); -#elif defined (__MINGW32__) - InitializeCriticalSection(&gAtomicLock); -#endif - // Make sure the last thread done in the work pool doesn't signal us to wake before we get to the point where we are supposed to wait - // That would cause a deadlock. -#if !defined( _WIN32 ) - if((err = pthread_mutex_lock( &caller_cond_lock) )) - { - log_error("Error %d from pthread_mutex_lock. Unable to block for work to finish. ThreadPool_Init failed.\n", err ); - gThreadCount = 1; - return; - } -#endif // !_WIN32 - - gRunning = gThreadCount; - // init threads - for( i = 0; i < gThreadCount; i++ ) - { -#if defined( _WIN32 ) - uintptr_t handle = _beginthread(ThreadPool_WorkerFunc, 0, (void*) &threadID); - err = ( handle == 0 ); -#else // !_WIN32 - pthread_t tid = 0; - err = pthread_create( &tid, NULL, ThreadPool_WorkerFunc, (void*) &threadID ); -#endif // !_WIN32 - if( err ) - { - log_error( "Error %d launching thread %d\n", err, i ); - threadPoolInitErr = err; - gThreadCount = i; - break; - } - } - - atexit( ThreadPool_Exit ); - -// block until they are done launching. - do - { -#if defined( _WIN32 ) - WaitForSingleObject( caller_event, INFINITE ); -#else // !_WIN32 - if((err = pthread_cond_wait( &caller_cond_var, &caller_cond_lock) )) - { - log_error("Error %d from pthread_cond_wait. Unable to block for work to finish. ThreadPool_Init failed.\n", err ); - pthread_mutex_unlock( &caller_cond_lock); - return; - } -#endif // !_WIN32 - } - while( gRunCount != -gThreadCount ); -#if !defined( _WIN32 ) - if((err = pthread_mutex_unlock( &caller_cond_lock) )) - { - log_error("Error %d from pthread_mutex_unlock. Unable to block for work to finish. ThreadPool_Init failed.\n", err ); - return; - } -#endif // !_WIN32 - - threadPoolInitErr = CL_SUCCESS; -} - -#if defined(_MSC_VER) -static BOOL CALLBACK _ThreadPool_Init(_PINIT_ONCE InitOnce, PVOID Parameter, PVOID *lpContex) -{ - ThreadPool_Init(); - return TRUE; -} -#endif - -void ThreadPool_Exit(void) -{ - int err, count; - gRunCount = CL_INT_MAX; - -#if defined( __GNUC__ ) - // GCC extension: http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html#Atomic-Builtins - __sync_synchronize(); -#elif defined( _MSC_VER ) - _mm_mfence(); -#else - #warning If this is a weakly ordered memory system, please add a memory barrier here to force this and everything else to memory before we proceed -#endif - - // spin waiting for threads to die - for (count = 0; 0 != gThreadCount && count < 1000; count++) - { -#if defined( _WIN32 ) - _WakeAllConditionVariable( cond_var ); - Sleep(1); -#else // !_WIN32 - if( (err = pthread_cond_broadcast( &cond_var ))) - { - log_error("Error %d from pthread_cond_broadcast. Unable to wake up work threads. ThreadPool_Exit failed.\n", err ); - break; - } - usleep(1000); -#endif // !_WIN32 - } - - if( gThreadCount ) - log_error( "Error: Thread pool timed out after 1 second with %d threads still active.\n", gThreadCount ); - else - log_info( "Thread pool exited in a orderly fashion.\n" ); -} - - -// Blocking API that farms out count jobs to a thread pool. -// It may return with some work undone if func_ptr() returns a non-zero -// result. -// -// This function obviously has its shortcommings. Only one call to ThreadPool_Do -// can be running at a time. It is not intended for general purpose use. -// If clEnqueueNativeKernelFn, out of order queues and a CL_DEVICE_TYPE_CPU were -// all available then it would make more sense to use those features. -cl_int ThreadPool_Do( TPFuncPtr func_ptr, - cl_uint count, - void *userInfo ) -{ - cl_int newErr; - cl_int err = 0; - // Lazily set up our threads -#if defined(_MSC_VER) && (_WIN32_WINNT >= 0x600) - err = !_InitOnceExecuteOnce( &threadpool_init_control, _ThreadPool_Init, NULL, NULL ); -#elif defined (_WIN32) - if (threadpool_init_control == 0) { - #warning This is buggy and race prone. Find a better way. - ThreadPool_Init(); - threadpool_init_control = 1; - } -#else //posix platform - err = pthread_once( &threadpool_init_control, ThreadPool_Init ); - if( err ) - { - log_error("Error %d from pthread_once. Unable to init threads. ThreadPool_Do failed.\n", err ); - return err; - } -#endif - // Single threaded code to handle case where threadpool wasn't allocated or was disabled by environment variable - if( threadPoolInitErr ) - { - cl_uint currentJob = 0; - cl_int result = CL_SUCCESS; - -#if defined(__APPLE__) && defined(__arm__) - // On most platforms which support denorm, default is FTZ off. However, - // on some hardware where the reference is computed, default might be flush denorms to zero e.g. arm. - // This creates issues in result verification. Since spec allows the implementation to either flush or - // not flush denorms to zero, an implementation may choose not be flush i.e. return denorm result whereas - // reference result may be zero (flushed denorm). Hence we need to disable denorm flushing on host side - // where reference is being computed to make sure we get non-flushed reference result. If implementation - // returns flushed result, we correctly take care of that in verification code. - FPU_mode_type oldMode; - DisableFTZ( &oldMode ); -#endif - for( currentJob = 0; currentJob < count; currentJob++ ) - if((result = func_ptr( currentJob, 0, userInfo ))) - { -#if defined(__APPLE__) && defined(__arm__) - // Restore FP state before leaving - RestoreFPState( &oldMode ); -#endif - return result; - } - -#if defined(__APPLE__) && defined(__arm__) - // Restore FP state before leaving - RestoreFPState( &oldMode ); -#endif - - return CL_SUCCESS; - } - - if( count >= MAX_COUNT ) - { - log_error("Error: ThreadPool_Do count %d >= max threadpool count of %d\n", count, MAX_COUNT ); - return -1; - } - - // Enter critical region -#if defined( _WIN32 ) - EnterCriticalSection( gThreadPoolLock ); -#else // !_WIN32 - if( (err = pthread_mutex_lock( &gThreadPoolLock ))) - { - switch (err) - { - case EDEADLK: - log_error("Error EDEADLK returned in ThreadPool_Do(). ThreadPool_Do is not designed to work recursively!\n" ); - break; - case EINVAL: - log_error("Error EINVAL returned in ThreadPool_Do(). How did we end up with an invalid gThreadPoolLock?\n" ); - break; - default: - break; - } - return err; - } -#endif // !_WIN32 - - // Start modifying the job state observable by worker threads -#if defined( _WIN32 ) - EnterCriticalSection( cond_lock ); -#else // !_WIN32 - if((err = pthread_mutex_lock( &cond_lock) )) - { - log_error("Error %d from pthread_mutex_lock. Unable to wake up work threads. ThreadPool_Do failed.\n", err ); - goto exit; - } -#endif // !_WIN32 - - // Make sure the last thread done in the work pool doesn't signal us to wake before we get to the point where we are supposed to wait - // That would cause a deadlock. -#if !defined( _WIN32 ) - if((err = pthread_mutex_lock( &caller_cond_lock) )) - { - log_error("Error %d from pthread_mutex_lock. Unable to block for work to finish. ThreadPool_Do failed.\n", err ); - goto exit; - } -#endif // !_WIN32 - - // Prime the worker threads to get going - jobError = CL_SUCCESS; - gRunCount = gJobCount = count; - gFunc_ptr = func_ptr; - gUserInfo = userInfo; - -#if defined( _WIN32 ) - _WakeAllConditionVariable( cond_var ); - LeaveCriticalSection( cond_lock ); -#else // !_WIN32 - if( (err = pthread_cond_broadcast( &cond_var ))) - { - log_error("Error %d from pthread_cond_broadcast. Unable to wake up work threads. ThreadPool_Do failed.\n", err ); - goto exit; - } - if((err = pthread_mutex_unlock( &cond_lock) )) - { - log_error("Error %d from pthread_mutex_unlock. Unable to wake up work threads. ThreadPool_Do failed.\n", err ); - goto exit; - } -#endif // !_WIN32 - -// block until they are done. It would be slightly more efficient to do some of the work here though. - do - { -#if defined( _WIN32 ) - WaitForSingleObject( caller_event, INFINITE ); -#else // !_WIN32 - if((err = pthread_cond_wait( &caller_cond_var, &caller_cond_lock) )) - { - log_error("Error %d from pthread_cond_wait. Unable to block for work to finish. ThreadPool_Do failed.\n", err ); - pthread_mutex_unlock( &caller_cond_lock); - goto exit; - } -#endif // !_WIN32 - } - while( gRunning ); -#if !defined(_WIN32) - if((err = pthread_mutex_unlock( &caller_cond_lock) )) - { - log_error("Error %d from pthread_mutex_unlock. Unable to block for work to finish. ThreadPool_Do failed.\n", err ); - goto exit; - } -#endif // !_WIN32 - - err = jobError; - -exit: - // exit critical region -#if defined( _WIN32 ) - LeaveCriticalSection( gThreadPoolLock ); -#else // !_WIN32 - newErr = pthread_mutex_unlock( &gThreadPoolLock ); - if( newErr) - { - log_error("Error %d from pthread_mutex_unlock. Unable to exit critical region. ThreadPool_Do failed.\n", newErr ); - return err; - } -#endif // !_WIN32 - - return err; -} - -cl_uint GetThreadCount( void ) -{ - // Lazily set up our threads -#if defined(_MSC_VER) && (_WIN32_WINNT >= 0x600) - cl_int err = !_InitOnceExecuteOnce( &threadpool_init_control, _ThreadPool_Init, NULL, NULL ); -#elif defined (_WIN32) - if (threadpool_init_control == 0) { - #warning This is buggy and race prone. Find a better way. - ThreadPool_Init(); - threadpool_init_control = 1; - } -#else - cl_int err = pthread_once( &threadpool_init_control, ThreadPool_Init ); - if( err ) - { - log_error("Error %d from pthread_once. Unable to init threads. ThreadPool_Do failed.\n", err ); - return err; - } -#endif // !_WIN32 - - if( gThreadCount < 1 ) - return 1; - - return gThreadCount; -} - -#else - -#ifndef MY_OS_REALLY_REALLY_DOESNT_SUPPORT_THREADS - #error ThreadPool implementation has not been multithreaded for this operating system. You must multithread this section. -#endif -// -// We require multithreading in parts of the test as a means of simultaneously testing reentrancy requirements -// of OpenCL API, while also checking -// -// A sample single threaded implementation follows, for documentation / bootstrapping purposes. -// It is not okay to use this for conformance testing!!! -// -// Exception: If your operating system does not support multithreaded execution of any kind, then you may use this code. -// - -cl_int ThreadPool_AtomicAdd( volatile cl_int *a, cl_int b ) -{ - cl_uint r = *a; - - // since this fallback code path is not multithreaded, we just do a regular add here - // If your operating system supports memory-barrier-atomics, use those here - *a = r + b; - - return r; -} - -// Blocking API that farms out count jobs to a thread pool. -// It may return with some work undone if func_ptr() returns a non-zero -// result. -cl_int ThreadPool_Do( TPFuncPtr func_ptr, - cl_uint count, - void *userInfo ) -{ - cl_uint currentJob = 0; - cl_int result = CL_SUCCESS; - -#ifndef MY_OS_REALLY_REALLY_DOESNT_SUPPORT_THREADS - // THIS FUNCTION IS NOT INTENDED FOR USE!! - log_error( "ERROR: Test must be multithreaded!\n" ); - exit(-1); -#else - static int spewCount = 0; - - if( 0 == spewCount ) - { - log_info( "\nWARNING: The operating system is claimed not to support threads of any sort. Running single threaded.\n" ); - spewCount = 1; - } -#endif - -// The multithreaded code should mimic this behavior: - for( currentJob = 0; currentJob < count; currentJob++ ) - if((result = func_ptr( currentJob, 0, userInfo ))) - return result; - - return CL_SUCCESS; -} - -cl_uint GetThreadCount( void ) -{ - return 1; -} - -void SetThreadCount( int count ) -{ - if( count > 1 ) - log_info( "WARNING: SetThreadCount(%d) ignored\n", count ); -} - -#endif diff --git a/test_conformance/compatibility/test_common/harness/ThreadPool.h b/test_conformance/compatibility/test_common/harness/ThreadPool.h deleted file mode 100644 index 7c392306..00000000 --- a/test_conformance/compatibility/test_common/harness/ThreadPool.h +++ /dev/null @@ -1,76 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef THREAD_POOL_H -#define THREAD_POOL_H - -#if defined( __APPLE__ ) - #include -#else - #include -#endif - -#if defined(__cplusplus) - extern "C" { -#endif - -// -// An atomic add operator -cl_int ThreadPool_AtomicAdd( volatile cl_int *a, cl_int b ); // returns old value - -// Your function prototype -// -// A function pointer to the function you want to execute in a multithreaded context. No -// synchronization primitives are provided, other than the atomic add above. You may not -// call ThreadPool_Do from your function. ThreadPool_AtomicAdd() and GetThreadCount() should -// work, however. -// -// job ids and thread ids are 0 based. If number of jobs or threads was 8, they will numbered be 0 through 7. -// Note that while every job will be run, it is not guaranteed that every thread will wake up before -// the work is done. -typedef cl_int (*TPFuncPtr)( cl_uint /*job_id*/, cl_uint /* thread_id */, void *userInfo ); - -// returns first non-zero result from func_ptr, or CL_SUCCESS if all are zero. -// Some workitems may not run if a non-zero result is returned from func_ptr(). -// This function may not be called from a TPFuncPtr. -cl_int ThreadPool_Do( TPFuncPtr func_ptr, - cl_uint count, - void *userInfo ); - -// Returns the number of worker threads that underlie the threadpool. The value passed -// as the TPFuncPtrs thread_id will be between 0 and this value less one, inclusive. -// This is safe to call from a TPFuncPtr. -cl_uint GetThreadCount( void ); - -// SetThreadCount() may be used to artifically set the number of worker threads -// If the value is 0 (the default) the number of threads will be determined based on -// the number of CPU cores. If it is a unicore machine, then 2 will be used, so -// that we still get some testing for thread safety. -// -// If count < 2 or the CL_TEST_SINGLE_THREADED environment variable is set then the -// code will run single threaded, but will report an error to indicate that the test -// is invalid. This option is intended for debugging purposes only. It is suggested -// as a convention that test apps set the thread count to 1 in response to the -m flag. -// -// SetThreadCount() must be called before the first call to GetThreadCount() or ThreadPool_Do(), -// otherwise the behavior is indefined. It may not be called from a TPFuncPtr. -void SetThreadCount( int count ); - -#ifdef __cplusplus - } /* extern "C" */ -#endif - - -#endif /* THREAD_POOL_H */ diff --git a/test_conformance/compatibility/test_common/harness/clImageHelper.h b/test_conformance/compatibility/test_common/harness/clImageHelper.h deleted file mode 100644 index 8537ddcd..00000000 --- a/test_conformance/compatibility/test_common/harness/clImageHelper.h +++ /dev/null @@ -1,253 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef test_conformance_clImageHelper_h -#define test_conformance_clImageHelper_h - -#ifdef __APPLE__ -#include -#else -#include -#endif - -#include -#include "errorHelpers.h" - -#ifdef __cplusplus -extern "C" { -#endif - - - // helper function to replace clCreateImage2D , to make the existing code use - // the functions of version 1.2 and veriosn 1.1 respectively - - inline cl_mem create_image_2d (cl_context context, - cl_mem_flags flags, - const cl_image_format *image_format, - size_t image_width, - size_t image_height, - size_t image_row_pitch, - void *host_ptr, - cl_int *errcode_ret) - { - cl_mem mImage = NULL; - -#ifdef CL_VERSION_1_2 - cl_image_desc image_desc_dest; - image_desc_dest.image_type = CL_MEM_OBJECT_IMAGE2D;; - image_desc_dest.image_width = image_width; - image_desc_dest.image_height = image_height; - image_desc_dest.image_depth= 0;// not usedfor 2d - image_desc_dest.image_array_size = 0;// not used for 2d - image_desc_dest.image_row_pitch = image_row_pitch; - image_desc_dest.image_slice_pitch = 0; - image_desc_dest.num_mip_levels = 0; - image_desc_dest.num_samples = 0; - image_desc_dest.buffer = NULL;// no image type of CL_MEM_OBJECT_IMAGE1D_BUFFER in CL_VERSION_1_1, so always is NULL - mImage = clCreateImage( context, flags, image_format, &image_desc_dest, host_ptr, errcode_ret ); - if (errcode_ret && (*errcode_ret)) { - // Log an info message and rely on the calling function to produce an error - // if necessary. - log_info("clCreateImage failed (%d)\n", *errcode_ret); - } - -#else - mImage = clCreateImage2D( context, flags, image_format, image_width, image_height, image_row_pitch, host_ptr, errcode_ret ); - if (errcode_ret && (*errcode_ret)) { - // Log an info message and rely on the calling function to produce an error - // if necessary. - log_info("clCreateImage2D failed (%d)\n", *errcode_ret); - } -#endif - - return mImage; - } - - inline cl_mem create_image_3d (cl_context context, - cl_mem_flags flags, - const cl_image_format *image_format, - size_t image_width, - size_t image_height, - size_t image_depth, - size_t image_row_pitch, - size_t image_slice_pitch, - void *host_ptr, - cl_int *errcode_ret) - { - cl_mem mImage; - -#ifdef CL_VERSION_1_2 - cl_image_desc image_desc; - image_desc.image_type = CL_MEM_OBJECT_IMAGE3D; - image_desc.image_width = image_width; - image_desc.image_height = image_height; - image_desc.image_depth = image_depth; - image_desc.image_array_size = 0;// not used for one image - image_desc.image_row_pitch = image_row_pitch; - image_desc.image_slice_pitch = image_slice_pitch; - image_desc.num_mip_levels = 0; - image_desc.num_samples = 0; - image_desc.buffer = NULL; // no image type of CL_MEM_OBJECT_IMAGE1D_BUFFER in CL_VERSION_1_1, so always is NULL - mImage = clCreateImage( context, - flags, - image_format, - &image_desc, - host_ptr, - errcode_ret ); - if (errcode_ret && (*errcode_ret)) { - // Log an info message and rely on the calling function to produce an error - // if necessary. - log_info("clCreateImage failed (%d)\n", *errcode_ret); - } - -#else - mImage = clCreateImage3D( context, - flags, image_format, - image_width, - image_height, - image_depth, - image_row_pitch, - image_slice_pitch, - host_ptr, - errcode_ret ); - if (errcode_ret && (*errcode_ret)) { - // Log an info message and rely on the calling function to produce an error - // if necessary. - log_info("clCreateImage3D failed (%d)\n", *errcode_ret); - } -#endif - - return mImage; - } - - inline cl_mem create_image_2d_array (cl_context context, - cl_mem_flags flags, - const cl_image_format *image_format, - size_t image_width, - size_t image_height, - size_t image_array_size, - size_t image_row_pitch, - size_t image_slice_pitch, - void *host_ptr, - cl_int *errcode_ret) - { - cl_mem mImage; - - cl_image_desc image_desc; - image_desc.image_type = CL_MEM_OBJECT_IMAGE2D_ARRAY; - image_desc.image_width = image_width; - image_desc.image_height = image_height; - image_desc.image_depth = 1; - image_desc.image_array_size = image_array_size; - image_desc.image_row_pitch = image_row_pitch; - image_desc.image_slice_pitch = image_slice_pitch; - image_desc.num_mip_levels = 0; - image_desc.num_samples = 0; - image_desc.buffer = NULL; - mImage = clCreateImage( context, - flags, - image_format, - &image_desc, - host_ptr, - errcode_ret ); - if (errcode_ret && (*errcode_ret)) { - // Log an info message and rely on the calling function to produce an error - // if necessary. - log_info("clCreateImage failed (%d)\n", *errcode_ret); - } - - return mImage; - } - - inline cl_mem create_image_1d_array (cl_context context, - cl_mem_flags flags, - const cl_image_format *image_format, - size_t image_width, - size_t image_array_size, - size_t image_row_pitch, - size_t image_slice_pitch, - void *host_ptr, - cl_int *errcode_ret) - { - cl_mem mImage; - - cl_image_desc image_desc; - image_desc.image_type = CL_MEM_OBJECT_IMAGE1D_ARRAY; - image_desc.image_width = image_width; - image_desc.image_height = 1; - image_desc.image_depth = 1; - image_desc.image_array_size = image_array_size; - image_desc.image_row_pitch = image_row_pitch; - image_desc.image_slice_pitch = image_slice_pitch; - image_desc.num_mip_levels = 0; - image_desc.num_samples = 0; - image_desc.buffer = NULL; - mImage = clCreateImage( context, - flags, - image_format, - &image_desc, - host_ptr, - errcode_ret ); - if (errcode_ret && (*errcode_ret)) { - // Log an info message and rely on the calling function to produce an error - // if necessary. - log_info("clCreateImage failed (%d)\n", *errcode_ret); - } - - return mImage; - } - - inline cl_mem create_image_1d (cl_context context, - cl_mem_flags flags, - const cl_image_format *image_format, - size_t image_width, - size_t image_row_pitch, - void *host_ptr, - cl_mem buffer, - cl_int *errcode_ret) - { - cl_mem mImage; - - cl_image_desc image_desc; - image_desc.image_type = buffer ? CL_MEM_OBJECT_IMAGE1D_BUFFER: CL_MEM_OBJECT_IMAGE1D; - image_desc.image_width = image_width; - image_desc.image_height = 1; - image_desc.image_depth = 1; - image_desc.image_row_pitch = image_row_pitch; - image_desc.image_slice_pitch = 0; - image_desc.num_mip_levels = 0; - image_desc.num_samples = 0; - image_desc.buffer = buffer; - mImage = clCreateImage( context, - flags, - image_format, - &image_desc, - host_ptr, - errcode_ret ); - if (errcode_ret && (*errcode_ret)) { - // Log an info message and rely on the calling function to produce an error - // if necessary. - log_info("clCreateImage failed (%d)\n", *errcode_ret); - } - - return mImage; - } - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/test_conformance/compatibility/test_common/harness/compat.h b/test_conformance/compatibility/test_common/harness/compat.h deleted file mode 100644 index 608dc95e..00000000 --- a/test_conformance/compatibility/test_common/harness/compat.h +++ /dev/null @@ -1,393 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -/* - Header compat.h should be used instead of stdlib.h, stdbool.h, stdint.h, float.h, fenv.h, - math.h. It provides workarounds if these headers are not available or not complete. - - Important: It should be included before math.h, directly or indirectly, because Intel mathimf.h - is not compatible with Microsoft math.h. Including math.h before mathimf.h causes compile-time - error. -*/ -#ifndef _COMPAT_H_ -#define _COMPAT_H_ - -#if defined(_WIN32) && defined (_MSC_VER) -#include -#endif - -#ifdef __cplusplus - #define EXTERN_C extern "C" -#else - #define EXTERN_C -#endif - - -// -// stdlib.h -// - -#include // On Windows, _MAX_PATH defined there. - -// llabs appeared in MS C v16 (VS 10/2010). -#if defined( _MSC_VER ) && _MSC_VER <= 1500 - EXTERN_C inline long long llabs(long long __x) { return __x >= 0 ? __x : -__x; } -#endif - - -// -// stdbool.h -// - -// stdbool.h appeared in MS C v18 (VS 12/2013). -#if defined( _MSC_VER ) && MSC_VER <= 1700 -#if !defined(__cplusplus) -typedef char bool; - #define true 1 - #define false 0 - #endif -#else - #include -#endif - - - -// -// stdint.h -// - -// stdint.h appeared in MS C v16 (VS 10/2010) and Intel C v12. -#if defined( _MSC_VER ) && ( ! defined( __INTEL_COMPILER ) && _MSC_VER <= 1500 || defined( __INTEL_COMPILER ) && __INTEL_COMPILER < 1200 ) -typedef unsigned char uint8_t; -typedef char int8_t; -typedef unsigned short uint16_t; -typedef short int16_t; -typedef unsigned int uint32_t; -typedef int int32_t; -typedef unsigned long long uint64_t; -typedef long long int64_t; -#else -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS -#endif - #include -#endif - - - -// -// float.h -// - -#include - - - -// -// fenv.h -// - -// fenv.h appeared in MS C v18 (VS 12/2013). -#if defined( _MSC_VER ) && _MSC_VER <= 1700 && ! defined( __INTEL_COMPILER ) - // reimplement fenv.h because windows doesn't have it - #define FE_INEXACT 0x0020 - #define FE_UNDERFLOW 0x0010 - #define FE_OVERFLOW 0x0008 - #define FE_DIVBYZERO 0x0004 - #define FE_INVALID 0x0001 - #define FE_ALL_EXCEPT 0x003D - int fetestexcept(int excepts); - int feclearexcept(int excepts); -#else - #include -#endif - - -// -// math.h -// - -#if defined( __INTEL_COMPILER ) - #include -#else - #include -#endif - -#if defined( _MSC_VER ) - - #ifdef __cplusplus - extern "C" { - #endif - -#ifndef M_PI - #define M_PI 3.14159265358979323846264338327950288 -#endif - - #if ! defined( __INTEL_COMPILER ) - - #ifndef NAN - #define NAN (INFINITY - INFINITY) - #endif - #ifndef HUGE_VALF - #define HUGE_VALF (float)HUGE_VAL - #endif - #ifndef INFINITY - #define INFINITY (FLT_MAX + FLT_MAX) - #endif - #ifndef isfinite - #define isfinite(x) _finite(x) - #endif - #ifndef isnan -#define isnan( x ) ((x) != (x)) - #endif - #ifndef isinf -#define isinf( _x) ((_x) == INFINITY || (_x) == -INFINITY) - #endif - -double rint( double x); -float rintf( float x); -long double rintl( long double x); - -float cbrtf( float ); -double cbrt( double ); - -int ilogb( double x); -int ilogbf (float x); -int ilogbl(long double x); - -double fmax(double x, double y); -double fmin(double x, double y); -float fmaxf( float x, float y ); -float fminf(float x, float y); - -double log2(double x); -long double log2l(long double x); - -double exp2(double x); -long double exp2l(long double x); - -double fdim(double x, double y); -float fdimf(float x, float y); -long double fdiml(long double x, long double y); - -double remquo( double x, double y, int *quo); -float remquof( float x, float y, int *quo); -long double remquol( long double x, long double y, int *quo); - -long double scalblnl(long double x, long n); - -// snprintf added in _MSC_VER == 1900 (Visual Studio 2015) -#if defined( _MSC_VER ) && _MSC_VER < 1900 - #define snprintf sprintf_s -#endif -float hypotf(float x, float y); -long double hypotl(long double x, long double y) ; -double lgamma(double x); -float lgammaf(float x); - -double trunc(double x); -float truncf(float x); - -double log1p(double x); -float log1pf(float x); -long double log1pl(long double x); - -double copysign(double x, double y); -float copysignf(float x, float y); -long double copysignl(long double x, long double y); - -long lround(double x); -long lroundf(float x); -//long lroundl(long double x) - -double round(double x); -float roundf(float x); -long double roundl(long double x); - - int cf_signbit(double x); - int cf_signbitf(float x); - -// Added in _MSC_VER == 1800 (Visual Studio 2013) -#if defined( _MSC_VER ) && _MSC_VER < 1800 - static int signbit(double x) { return cf_signbit(x); } -#endif - static int signbitf(float x) { return cf_signbitf(x); } - -long int lrint (double flt); -long int lrintf (float flt); - -float int2float (int32_t ix); -int32_t float2int (float fx); - - #endif - - #if ! defined( __INTEL_COMPILER ) || __INTEL_COMPILER < 1300 - // These functions appeared in Intel C v13. - float nanf( const char* str); - double nan( const char* str); - long double nanl( const char* str); - #endif - - #ifdef __cplusplus - } - #endif - -#endif - -#if defined( __ANDROID__ ) - #define log2(X) (log(X)/log(2)) -#endif - - - -// -// stdio.h -// - - - -// -// unistd.h -// - -#if defined( _MSC_VER ) - EXTERN_C unsigned int sleep( unsigned int sec ); - EXTERN_C int usleep( int usec ); -#endif - - - -// -// syscall.h -// - -#if defined( __ANDROID__ ) - // Android bionic's isn't providing SYS_sysctl wrappers. - #define SYS__sysctl __NR__sysctl -#endif - - - -// Some tests use _malloca which defined in malloc.h. -#if !defined (__APPLE__) -#include -#endif - - -// -// ??? -// - -#if defined( _MSC_VER ) - - #define MAXPATHLEN _MAX_PATH - - EXTERN_C uint64_t ReadTime( void ); - EXTERN_C double SubtractTime( uint64_t endTime, uint64_t startTime ); - -/** Returns the number of leading 0-bits in x, - starting at the most significant bit position. - If x is 0, the result is undefined. -*/ - EXTERN_C int __builtin_clz(unsigned int pattern); - -#endif - -#ifndef MIN - #define MIN(x,y) (((x)<(y))?(x):(y)) -#endif -#ifndef MAX - #define MAX(x,y) (((x)>(y))?(x):(y)) -#endif - - -/* - ------------------------------------------------------------------------------------------------ - WARNING: DO NOT USE THESE MACROS: MAKE_HEX_FLOAT, MAKE_HEX_DOUBLE, MAKE_HEX_LONG. - - This is a typical usage of the macros: - - double yhi = MAKE_HEX_DOUBLE(0x1.5555555555555p-2,0x15555555555555LL,-2); - - (taken from math_brute_force/reference_math.c). There are two problems: - - 1. There is an error here. On Windows in will produce incorrect result - `0x1.5555555555555p+50'. To have a correct result it should be written as - `MAKE_HEX_DOUBLE(0x1.5555555555555p-2,0x15555555555555LL,-54)'. A proper value of the - third argument is not obvious -- sometimes it should be the same as exponent of the - first argument, but sometimes not. - - 2. Information is duplicated. It is easy to make a mistake. - - Use HEX_FLT, HEX_DBL, HEX_LDBL macros instead (see them in the bottom of the file). - ------------------------------------------------------------------------------------------------ -*/ -#if defined ( _MSC_VER ) && ! defined( __INTEL_COMPILER ) - - #define MAKE_HEX_FLOAT(x,y,z) ((float)ldexp( (float)(y), z)) - #define MAKE_HEX_DOUBLE(x,y,z) ldexp( (double)(y), z) - #define MAKE_HEX_LONG(x,y,z) ((long double) ldexp( (long double)(y), z)) - -#else - -// Do not use these macros in new code, use HEX_FLT, HEX_DBL, HEX_LDBL instead. -#define MAKE_HEX_FLOAT(x,y,z) x -#define MAKE_HEX_DOUBLE(x,y,z) x -#define MAKE_HEX_LONG(x,y,z) x - -#endif - - -/* - ------------------------------------------------------------------------------------------------ - HEX_FLT, HEXT_DBL, HEX_LDBL -- Create hex floating point literal of type float, double, long - double respectively. Arguments: - - sm -- sign of number, - int -- integer part of mantissa (without `0x' prefix), - fract -- fractional part of mantissa (without decimal point and `L' or `LL' suffixes), - se -- sign of exponent, - exp -- absolute value of (binary) exponent. - - Example: - - double yhi = HEX_DBL( +, 1, 5555555555555, -, 2 ); // == 0x1.5555555555555p-2 - - Note: - - We have to pass signs as separate arguments because gcc pass negative integer values - (e. g. `-2') into a macro as two separate tokens, so `HEX_FLT( 1, 0, -2 )' produces result - `0x1.0p- 2' (note a space between minus and two) which is not a correct floating point - literal. - ------------------------------------------------------------------------------------------------ -*/ -#if defined ( _MSC_VER ) && ! defined( __INTEL_COMPILER ) - // If compiler does not support hex floating point literals: - #define HEX_FLT( sm, int, fract, se, exp ) sm ldexpf( (float)( 0x ## int ## fract ## UL ), se exp + ilogbf( (float) 0x ## int ) - ilogbf( ( float )( 0x ## int ## fract ## UL ) ) ) - #define HEX_DBL( sm, int, fract, se, exp ) sm ldexp( (double)( 0x ## int ## fract ## ULL ), se exp + ilogb( (double) 0x ## int ) - ilogb( ( double )( 0x ## int ## fract ## ULL ) ) ) - #define HEX_LDBL( sm, int, fract, se, exp ) sm ldexpl( (long double)( 0x ## int ## fract ## ULL ), se exp + ilogbl( (long double) 0x ## int ) - ilogbl( ( long double )( 0x ## int ## fract ## ULL ) ) ) -#else - // If compiler supports hex floating point literals: just concatenate all the parts into a literal. - #define HEX_FLT( sm, int, fract, se, exp ) sm 0x ## int ## . ## fract ## p ## se ## exp ## F - #define HEX_DBL( sm, int, fract, se, exp ) sm 0x ## int ## . ## fract ## p ## se ## exp - #define HEX_LDBL( sm, int, fract, se, exp ) sm 0x ## int ## . ## fract ## p ## se ## exp ## L -#endif - -#if defined(__MINGW32__) - #include - #define sleep(sec) Sleep((sec) * 1000) -#endif - -#endif // _COMPAT_H_ diff --git a/test_conformance/compatibility/test_common/harness/conversions.c b/test_conformance/compatibility/test_common/harness/conversions.c deleted file mode 100644 index 72fd8cb3..00000000 --- a/test_conformance/compatibility/test_common/harness/conversions.c +++ /dev/null @@ -1,1198 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "conversions.h" -#include -#include -#include -#include "mt19937.h" -#include "compat.h" - -#if defined( __SSE__ ) || defined (_MSC_VER) - #include -#endif -#if defined( __SSE2__ ) || defined (_MSC_VER) - #include -#endif - -void print_type_to_string(ExplicitType type, void *data, char* string) { - switch (type) { - case kBool: - if (*(char*)data) - sprintf(string, "true"); - else - sprintf(string, "false"); - return; - case kChar: - sprintf(string, "%d", (int)*((cl_char*)data)); - return; - case kUChar: - case kUnsignedChar: - sprintf(string, "%u", (int)*((cl_uchar*)data)); - return; - case kShort: - sprintf(string, "%d", (int)*((cl_short*)data)); - return; - case kUShort: - case kUnsignedShort: - sprintf(string, "%u", (int)*((cl_ushort*)data)); - return; - case kInt: - sprintf(string, "%d", *((cl_int*)data)); - return; - case kUInt: - case kUnsignedInt: - sprintf(string, "%u", *((cl_uint*)data)); - return; - case kLong: - sprintf(string, "%lld", *((cl_long*)data)); - return; - case kULong: - case kUnsignedLong: - sprintf(string, "%llu", *((cl_ulong*)data)); - return; - case kFloat: - sprintf(string, "%f", *((cl_float*)data)); - return; - case kHalf: - sprintf(string, "half"); - return; - case kDouble: - sprintf(string, "%g", *((cl_double*)data)); - return; - default: - sprintf(string, "INVALID"); - return; - } - -} - -size_t get_explicit_type_size( ExplicitType type ) -{ - /* Quick method to avoid branching: make sure the following array matches the Enum order */ - static size_t sExplicitTypeSizes[] = { - sizeof( cl_bool ), - sizeof( cl_char ), - sizeof( cl_uchar ), - sizeof( cl_uchar ), - sizeof( cl_short ), - sizeof( cl_ushort ), - sizeof( cl_ushort ), - sizeof( cl_int ), - sizeof( cl_uint ), - sizeof( cl_uint ), - sizeof( cl_long ), - sizeof( cl_ulong ), - sizeof( cl_ulong ), - sizeof( cl_float ), - sizeof( cl_half ), - sizeof( cl_double ) - }; - - return sExplicitTypeSizes[ type ]; -} - -const char * get_explicit_type_name( ExplicitType type ) -{ - /* Quick method to avoid branching: make sure the following array matches the Enum order */ - static const char *sExplicitTypeNames[] = { "bool", "char", "uchar", "unsigned char", "short", "ushort", "unsigned short", "int", - "uint", "unsigned int", "long", "ulong", "unsigned long", "float", "half", "double" }; - - return sExplicitTypeNames[ type ]; -} - -static long lrintf_clamped( float f ); -static long lrintf_clamped( float f ) -{ - static const float magic[2] = { MAKE_HEX_FLOAT( 0x1.0p23f, 0x1, 23), - MAKE_HEX_FLOAT( 0x1.0p23f, 0x1, 23) }; - - if( f >= -(float) LONG_MIN ) - return LONG_MAX; - - if( f <= (float) LONG_MIN ) - return LONG_MIN; - - // Round fractional values to integer in round towards nearest mode - if( fabsf(f) < MAKE_HEX_FLOAT( 0x1.0p23f, 0x1, 23 ) ) - { - volatile float x = f; - float magicVal = magic[ f < 0 ]; - -#if defined( __SSE__ ) || defined (_WIN32) - // Defeat x87 based arithmetic, which cant do FTZ, and will round this incorrectly - __m128 v = _mm_set_ss( x ); - __m128 m = _mm_set_ss( magicVal ); - v = _mm_add_ss( v, m ); - v = _mm_sub_ss( v, m ); - _mm_store_ss( (float*) &x, v ); -#else - x += magicVal; - x -= magicVal; -#endif - f = x; - } - - return (long) f; -} - -static long lrint_clamped( double f ); -static long lrint_clamped( double f ) -{ - static const double magic[2] = { MAKE_HEX_DOUBLE(0x1.0p52, 0x1LL, 52), MAKE_HEX_DOUBLE(-0x1.0p52, -0x1LL, 52) }; - - if( sizeof( long ) > 4 ) - { - if( f >= -(double) LONG_MIN ) - return LONG_MAX; - } - else - { - if( f >= LONG_MAX ) - return LONG_MAX; - } - - if( f <= (double) LONG_MIN ) - return LONG_MIN; - - // Round fractional values to integer in round towards nearest mode - if( fabs(f) < MAKE_HEX_DOUBLE(0x1.0p52, 0x1LL, 52) ) - { - volatile double x = f; - double magicVal = magic[ f < 0 ]; -#if defined( __SSE2__ ) || (defined (_MSC_VER)) - // Defeat x87 based arithmetic, which cant do FTZ, and will round this incorrectly - __m128d v = _mm_set_sd( x ); - __m128d m = _mm_set_sd( magicVal ); - v = _mm_add_sd( v, m ); - v = _mm_sub_sd( v, m ); - _mm_store_sd( (double*) &x, v ); -#else - x += magicVal; - x -= magicVal; -#endif - f = x; - } - - return (long) f; -} - - -typedef cl_long Long; -typedef cl_ulong ULong; - -static ULong sUpperLimits[ kNumExplicitTypes ] = - { - 0, - 127, 255, 255, - 32767, 65535, 65535, - 0x7fffffffLL, 0xffffffffLL, 0xffffffffLL, - 0x7fffffffffffffffLL, 0xffffffffffffffffLL, 0xffffffffffffffffLL, - 0, 0 }; // Last two values aren't stored here - -static Long sLowerLimits[ kNumExplicitTypes ] = - { - -1, - -128, 0, 0, - -32768, 0, 0, - 0xffffffff80000000LL, 0, 0, - 0x8000000000000000LL, 0, 0, - 0, 0 }; // Last two values aren't stored here - -#define BOOL_CASE(inType) \ - case kBool: \ - boolPtr = (bool *)outRaw; \ - *boolPtr = ( *inType##Ptr ) != 0 ? true : false; \ - break; - -#define SIMPLE_CAST_CASE(inType,outEnum,outType) \ - case outEnum: \ - outType##Ptr = (outType *)outRaw; \ - *outType##Ptr = (outType)(*inType##Ptr); \ - break; - -// Sadly, the ULong downcasting cases need a separate #define to get rid of signed/unsigned comparison warnings -#define DOWN_CAST_CASE(inType,outEnum,outType,sat) \ - case outEnum: \ - outType##Ptr = (outType *)outRaw; \ - if( sat ) \ - { \ - if( ( sLowerLimits[outEnum] < 0 && *inType##Ptr > (Long)sUpperLimits[outEnum] ) || ( sLowerLimits[outEnum] == 0 && (ULong)*inType##Ptr > sUpperLimits[outEnum] ) )\ - *outType##Ptr = (outType)sUpperLimits[outEnum];\ - else if( *inType##Ptr < sLowerLimits[outEnum] )\ - *outType##Ptr = (outType)sLowerLimits[outEnum]; \ - else \ - *outType##Ptr = (outType)*inType##Ptr; \ - } else { \ - *outType##Ptr = (outType)( *inType##Ptr & ( 0xffffffffffffffffLL >> ( 64 - ( sizeof( outType ) * 8 ) ) ) ); \ - } \ - break; - -#define U_DOWN_CAST_CASE(inType,outEnum,outType,sat) \ - case outEnum: \ - outType##Ptr = (outType *)outRaw; \ - if( sat ) \ - { \ - if( (ULong)*inType##Ptr > sUpperLimits[outEnum] )\ - *outType##Ptr = (outType)sUpperLimits[outEnum];\ - else \ - *outType##Ptr = (outType)*inType##Ptr; \ - } else { \ - *outType##Ptr = (outType)( *inType##Ptr & ( 0xffffffffffffffffLL >> ( 64 - ( sizeof( outType ) * 8 ) ) ) ); \ - } \ - break; - -#define TO_FLOAT_CASE(inType) \ - case kFloat: \ - floatPtr = (float *)outRaw; \ - *floatPtr = (float)(*inType##Ptr); \ - break; -#define TO_DOUBLE_CASE(inType) \ - case kDouble: \ - doublePtr = (double *)outRaw; \ - *doublePtr = (double)(*inType##Ptr); \ - break; - - -/* Note: we use lrintf here to force the rounding instead of whatever the processor's current rounding mode is */ -#define FLOAT_ROUND_TO_NEAREST_CASE(outEnum,outType) \ - case outEnum: \ - outType##Ptr = (outType *)outRaw; \ - *outType##Ptr = (outType)lrintf_clamped( *floatPtr ); \ - break; - -#define FLOAT_ROUND_CASE(outEnum,outType,rounding,sat) \ - case outEnum: \ - { \ - outType##Ptr = (outType *)outRaw; \ - /* Get the tens digit */ \ - Long wholeValue = (Long)*floatPtr;\ - float largeRemainder = ( *floatPtr - (float)wholeValue ) * 10.f; \ - /* What do we do based on that? */ \ - if( rounding == kRoundToEven ) \ - { \ - if( wholeValue & 1LL ) /*between 1 and 1.99 */ \ - wholeValue += 1LL; /* round up to even */ \ - } \ - else if( rounding == kRoundToZero ) \ - { \ - /* Nothing to do, round-to-zero is what C casting does */ \ - } \ - else if( rounding == kRoundToPosInf ) \ - { \ - /* Only positive numbers are wrong */ \ - if( largeRemainder != 0.f && wholeValue >= 0 ) \ - wholeValue++; \ - } \ - else if( rounding == kRoundToNegInf ) \ - { \ - /* Only negative numbers are off */ \ - if( largeRemainder != 0.f && wholeValue < 0 ) \ - wholeValue--; \ - } \ - else \ - { /* Default is round-to-nearest */ \ - wholeValue = (Long)lrintf_clamped( *floatPtr ); \ - } \ - /* Now apply saturation rules */ \ - if( sat ) \ - { \ - if( ( sLowerLimits[outEnum] < 0 && wholeValue > (Long)sUpperLimits[outEnum] ) || ( sLowerLimits[outEnum] == 0 && (ULong)wholeValue > sUpperLimits[outEnum] ) )\ - *outType##Ptr = (outType)sUpperLimits[outEnum];\ - else if( wholeValue < sLowerLimits[outEnum] )\ - *outType##Ptr = (outType)sLowerLimits[outEnum]; \ - else \ - *outType##Ptr = (outType)wholeValue; \ - } else { \ - *outType##Ptr = (outType)( wholeValue & ( 0xffffffffffffffffLL >> ( 64 - ( sizeof( outType ) * 8 ) ) ) ); \ - } \ - } \ - break; - -#define DOUBLE_ROUND_CASE(outEnum,outType,rounding,sat) \ - case outEnum: \ - { \ - outType##Ptr = (outType *)outRaw; \ - /* Get the tens digit */ \ - Long wholeValue = (Long)*doublePtr;\ - double largeRemainder = ( *doublePtr - (double)wholeValue ) * 10.0; \ - /* What do we do based on that? */ \ - if( rounding == kRoundToEven ) \ - { \ - if( wholeValue & 1LL ) /*between 1 and 1.99 */ \ - wholeValue += 1LL; /* round up to even */ \ - } \ - else if( rounding == kRoundToZero ) \ - { \ - /* Nothing to do, round-to-zero is what C casting does */ \ - } \ - else if( rounding == kRoundToPosInf ) \ - { \ - /* Only positive numbers are wrong */ \ - if( largeRemainder != 0.0 && wholeValue >= 0 ) \ - wholeValue++; \ - } \ - else if( rounding == kRoundToNegInf ) \ - { \ - /* Only negative numbers are off */ \ - if( largeRemainder != 0.0 && wholeValue < 0 ) \ - wholeValue--; \ - } \ - else \ - { /* Default is round-to-nearest */ \ - wholeValue = (Long)lrint_clamped( *doublePtr ); \ - } \ - /* Now apply saturation rules */ \ - if( sat ) \ - { \ - if( ( sLowerLimits[outEnum] < 0 && wholeValue > (Long)sUpperLimits[outEnum] ) || ( sLowerLimits[outEnum] == 0 && (ULong)wholeValue > sUpperLimits[outEnum] ) )\ - *outType##Ptr = (outType)sUpperLimits[outEnum];\ - else if( wholeValue < sLowerLimits[outEnum] )\ - *outType##Ptr = (outType)sLowerLimits[outEnum]; \ - else \ - *outType##Ptr = (outType)wholeValue; \ - } else { \ - *outType##Ptr = (outType)( wholeValue & ( 0xffffffffffffffffLL >> ( 64 - ( sizeof( outType ) * 8 ) ) ) ); \ - } \ - } \ - break; - -typedef unsigned char uchar; -typedef unsigned short ushort; -typedef unsigned int uint; -typedef unsigned long ulong; - -void convert_explicit_value( void *inRaw, void *outRaw, ExplicitType inType, bool saturate, RoundingType roundType, ExplicitType outType ) -{ - bool *boolPtr; - char *charPtr; - uchar *ucharPtr; - short *shortPtr; - ushort *ushortPtr; - int *intPtr; - uint *uintPtr; - Long *LongPtr; - ULong *ULongPtr; - float *floatPtr; - double *doublePtr; - - - switch( inType ) - { - case kBool: - boolPtr = (bool *)inRaw; - switch( outType ) - { - case kBool: - memcpy( outRaw, inRaw, get_explicit_type_size( inType ) ); - break; - - case kChar: - case kUChar: - case kUnsignedChar: - case kShort: - case kUShort: - case kUnsignedShort: - case kInt: - case kUInt: - case kUnsignedInt: - case kLong: - case kULong: - case kUnsignedLong: - memset( outRaw, *boolPtr ? 0xff : 0, get_explicit_type_size( outType ) ); - break; - - case kFloat: - floatPtr = (float *)outRaw; - *floatPtr = ( *boolPtr ) ? -1.f : 0.f; - break; - case kDouble: - doublePtr = (double *)outRaw; - *doublePtr = ( *boolPtr ) ? -1.0 : 0.0; - break; - default: - log_error( "ERROR: Invalid type given to convert_explicit_value!!\n" ); - break; - } - break; - - case kChar: - charPtr = (char *)inRaw; - switch( outType ) - { - BOOL_CASE(char) - - case kChar: - memcpy( outRaw, inRaw, get_explicit_type_size( inType ) ); - break; - - DOWN_CAST_CASE(char,kUChar,uchar,saturate) - SIMPLE_CAST_CASE(char,kUnsignedChar,uchar) - SIMPLE_CAST_CASE(char,kShort,short) - SIMPLE_CAST_CASE(char,kUShort,ushort) - SIMPLE_CAST_CASE(char,kUnsignedShort,ushort) - SIMPLE_CAST_CASE(char,kInt,int) - SIMPLE_CAST_CASE(char,kUInt,uint) - SIMPLE_CAST_CASE(char,kUnsignedInt,uint) - SIMPLE_CAST_CASE(char,kLong,Long) - SIMPLE_CAST_CASE(char,kULong,ULong) - SIMPLE_CAST_CASE(char,kUnsignedLong,ULong) - - TO_FLOAT_CASE(char) - TO_DOUBLE_CASE(char) - - default: - log_error( "ERROR: Invalid type given to convert_explicit_value!!\n" ); - break; - } - break; - - case kUChar: - ucharPtr = (uchar *)inRaw; - switch( outType ) - { - BOOL_CASE(uchar) - - case kUChar: - case kUnsignedChar: - memcpy( outRaw, inRaw, get_explicit_type_size( inType ) ); - break; - - DOWN_CAST_CASE(uchar,kChar,char,saturate) - SIMPLE_CAST_CASE(uchar,kShort,short) - SIMPLE_CAST_CASE(uchar,kUShort,ushort) - SIMPLE_CAST_CASE(uchar,kUnsignedShort,ushort) - SIMPLE_CAST_CASE(uchar,kInt,int) - SIMPLE_CAST_CASE(uchar,kUInt,uint) - SIMPLE_CAST_CASE(uchar,kUnsignedInt,uint) - SIMPLE_CAST_CASE(uchar,kLong,Long) - SIMPLE_CAST_CASE(uchar,kULong,ULong) - SIMPLE_CAST_CASE(uchar,kUnsignedLong,ULong) - - TO_FLOAT_CASE(uchar) - TO_DOUBLE_CASE(uchar) - - default: - log_error( "ERROR: Invalid type given to convert_explicit_value!!\n" ); - break; - } - break; - - case kUnsignedChar: - ucharPtr = (uchar *)inRaw; - switch( outType ) - { - BOOL_CASE(uchar) - - case kUChar: - case kUnsignedChar: - memcpy( outRaw, inRaw, get_explicit_type_size( inType ) ); - break; - - DOWN_CAST_CASE(uchar,kChar,char,saturate) - SIMPLE_CAST_CASE(uchar,kShort,short) - SIMPLE_CAST_CASE(uchar,kUShort,ushort) - SIMPLE_CAST_CASE(uchar,kUnsignedShort,ushort) - SIMPLE_CAST_CASE(uchar,kInt,int) - SIMPLE_CAST_CASE(uchar,kUInt,uint) - SIMPLE_CAST_CASE(uchar,kUnsignedInt,uint) - SIMPLE_CAST_CASE(uchar,kLong,Long) - SIMPLE_CAST_CASE(uchar,kULong,ULong) - SIMPLE_CAST_CASE(uchar,kUnsignedLong,ULong) - - TO_FLOAT_CASE(uchar) - TO_DOUBLE_CASE(uchar) - - default: - log_error( "ERROR: Invalid type given to convert_explicit_value!!\n" ); - break; - } - break; - - case kShort: - shortPtr = (short *)inRaw; - switch( outType ) - { - BOOL_CASE(short) - - case kShort: - memcpy( outRaw, inRaw, get_explicit_type_size( inType ) ); - break; - - DOWN_CAST_CASE(short,kChar,char,saturate) - DOWN_CAST_CASE(short,kUChar,uchar,saturate) - DOWN_CAST_CASE(short,kUnsignedChar,uchar,saturate) - DOWN_CAST_CASE(short,kUShort,ushort,saturate) - DOWN_CAST_CASE(short,kUnsignedShort,ushort,saturate) - SIMPLE_CAST_CASE(short,kInt,int) - SIMPLE_CAST_CASE(short,kUInt,uint) - SIMPLE_CAST_CASE(short,kUnsignedInt,uint) - SIMPLE_CAST_CASE(short,kLong,Long) - SIMPLE_CAST_CASE(short,kULong,ULong) - SIMPLE_CAST_CASE(short,kUnsignedLong,ULong) - - TO_FLOAT_CASE(short) - TO_DOUBLE_CASE(short) - - default: - log_error( "ERROR: Invalid type given to convert_explicit_value!!\n" ); - break; - } - break; - - case kUShort: - ushortPtr = (ushort *)inRaw; - switch( outType ) - { - BOOL_CASE(ushort) - - case kUShort: - case kUnsignedShort: - memcpy( outRaw, inRaw, get_explicit_type_size( inType ) ); - break; - - DOWN_CAST_CASE(ushort,kChar,char,saturate) - DOWN_CAST_CASE(ushort,kUChar,uchar,saturate) - DOWN_CAST_CASE(ushort,kUnsignedChar,uchar,saturate) - DOWN_CAST_CASE(ushort,kShort,short,saturate) - SIMPLE_CAST_CASE(ushort,kInt,int) - SIMPLE_CAST_CASE(ushort,kUInt,uint) - SIMPLE_CAST_CASE(ushort,kUnsignedInt,uint) - SIMPLE_CAST_CASE(ushort,kLong,Long) - SIMPLE_CAST_CASE(ushort,kULong,ULong) - SIMPLE_CAST_CASE(ushort,kUnsignedLong,ULong) - - TO_FLOAT_CASE(ushort) - TO_DOUBLE_CASE(ushort) - - default: - log_error( "ERROR: Invalid type given to convert_explicit_value!!\n" ); - break; - } - break; - - case kUnsignedShort: - ushortPtr = (ushort *)inRaw; - switch( outType ) - { - BOOL_CASE(ushort) - - case kUShort: - case kUnsignedShort: - memcpy( outRaw, inRaw, get_explicit_type_size( inType ) ); - break; - - DOWN_CAST_CASE(ushort,kChar,char,saturate) - DOWN_CAST_CASE(ushort,kUChar,uchar,saturate) - DOWN_CAST_CASE(ushort,kUnsignedChar,uchar,saturate) - DOWN_CAST_CASE(ushort,kShort,short,saturate) - SIMPLE_CAST_CASE(ushort,kInt,int) - SIMPLE_CAST_CASE(ushort,kUInt,uint) - SIMPLE_CAST_CASE(ushort,kUnsignedInt,uint) - SIMPLE_CAST_CASE(ushort,kLong,Long) - SIMPLE_CAST_CASE(ushort,kULong,ULong) - SIMPLE_CAST_CASE(ushort,kUnsignedLong,ULong) - - TO_FLOAT_CASE(ushort) - TO_DOUBLE_CASE(ushort) - - default: - log_error( "ERROR: Invalid type given to convert_explicit_value!!\n" ); - break; - } - break; - - case kInt: - intPtr = (int *)inRaw; - switch( outType ) - { - BOOL_CASE(int) - - case kInt: - memcpy( outRaw, inRaw, get_explicit_type_size( inType ) ); - break; - - DOWN_CAST_CASE(int,kChar,char,saturate) - DOWN_CAST_CASE(int,kUChar,uchar,saturate) - DOWN_CAST_CASE(int,kUnsignedChar,uchar,saturate) - DOWN_CAST_CASE(int,kShort,short,saturate) - DOWN_CAST_CASE(int,kUShort,ushort,saturate) - DOWN_CAST_CASE(int,kUnsignedShort,ushort,saturate) - DOWN_CAST_CASE(int,kUInt,uint,saturate) - DOWN_CAST_CASE(int,kUnsignedInt,uint,saturate) - SIMPLE_CAST_CASE(int,kLong,Long) - SIMPLE_CAST_CASE(int,kULong,ULong) - SIMPLE_CAST_CASE(int,kUnsignedLong,ULong) - - TO_FLOAT_CASE(int) - TO_DOUBLE_CASE(int) - - default: - log_error( "ERROR: Invalid type given to convert_explicit_value!!\n" ); - break; - } - break; - - case kUInt: - uintPtr = (uint *)inRaw; - switch( outType ) - { - BOOL_CASE(uint) - - case kUInt: - case kUnsignedInt: - memcpy( outRaw, inRaw, get_explicit_type_size( inType ) ); - break; - - DOWN_CAST_CASE(uint,kChar,char,saturate) - DOWN_CAST_CASE(uint,kUChar,uchar,saturate) - DOWN_CAST_CASE(uint,kUnsignedChar,uchar,saturate) - DOWN_CAST_CASE(uint,kShort,short,saturate) - DOWN_CAST_CASE(uint,kUShort,ushort,saturate) - DOWN_CAST_CASE(uint,kUnsignedShort,ushort,saturate) - DOWN_CAST_CASE(uint,kInt,int,saturate) - SIMPLE_CAST_CASE(uint,kLong,Long) - SIMPLE_CAST_CASE(uint,kULong,ULong) - SIMPLE_CAST_CASE(uint,kUnsignedLong,ULong) - - TO_FLOAT_CASE(uint) - TO_DOUBLE_CASE(uint) - - default: - log_error( "ERROR: Invalid type given to convert_explicit_value!!\n" ); - break; - } - break; - - case kUnsignedInt: - uintPtr = (uint *)inRaw; - switch( outType ) - { - BOOL_CASE(uint) - - case kUInt: - case kUnsignedInt: - memcpy( outRaw, inRaw, get_explicit_type_size( inType ) ); - break; - - DOWN_CAST_CASE(uint,kChar,char,saturate) - DOWN_CAST_CASE(uint,kUChar,uchar,saturate) - DOWN_CAST_CASE(uint,kUnsignedChar,uchar,saturate) - DOWN_CAST_CASE(uint,kShort,short,saturate) - DOWN_CAST_CASE(uint,kUShort,ushort,saturate) - DOWN_CAST_CASE(uint,kUnsignedShort,ushort,saturate) - DOWN_CAST_CASE(uint,kInt,int,saturate) - SIMPLE_CAST_CASE(uint,kLong,Long) - SIMPLE_CAST_CASE(uint,kULong,ULong) - SIMPLE_CAST_CASE(uint,kUnsignedLong,ULong) - - TO_FLOAT_CASE(uint) - TO_DOUBLE_CASE(uint) - - default: - log_error( "ERROR: Invalid type given to convert_explicit_value!!\n" ); - break; - } - break; - - case kLong: - LongPtr = (Long *)inRaw; - switch( outType ) - { - BOOL_CASE(Long) - - case kLong: - memcpy( outRaw, inRaw, get_explicit_type_size( inType ) ); - break; - - DOWN_CAST_CASE(Long,kChar,char,saturate) - DOWN_CAST_CASE(Long,kUChar,uchar,saturate) - DOWN_CAST_CASE(Long,kUnsignedChar,uchar,saturate) - DOWN_CAST_CASE(Long,kShort,short,saturate) - DOWN_CAST_CASE(Long,kUShort,ushort,saturate) - DOWN_CAST_CASE(Long,kUnsignedShort,ushort,saturate) - DOWN_CAST_CASE(Long,kInt,int,saturate) - DOWN_CAST_CASE(Long,kUInt,uint,saturate) - DOWN_CAST_CASE(Long,kUnsignedInt,uint,saturate) - DOWN_CAST_CASE(Long,kULong,ULong,saturate) - DOWN_CAST_CASE(Long,kUnsignedLong,ULong,saturate) - - TO_FLOAT_CASE(Long) - TO_DOUBLE_CASE(Long) - - default: - log_error( "ERROR: Invalid type given to convert_explicit_value!!\n" ); - break; - } - break; - - case kULong: - ULongPtr = (ULong *)inRaw; - switch( outType ) - { - BOOL_CASE(ULong) - - case kUnsignedLong: - case kULong: - memcpy( outRaw, inRaw, get_explicit_type_size( inType ) ); - break; - - U_DOWN_CAST_CASE(ULong,kChar,char,saturate) - U_DOWN_CAST_CASE(ULong,kUChar,uchar,saturate) - U_DOWN_CAST_CASE(ULong,kUnsignedChar,uchar,saturate) - U_DOWN_CAST_CASE(ULong,kShort,short,saturate) - U_DOWN_CAST_CASE(ULong,kUShort,ushort,saturate) - U_DOWN_CAST_CASE(ULong,kUnsignedShort,ushort,saturate) - U_DOWN_CAST_CASE(ULong,kInt,int,saturate) - U_DOWN_CAST_CASE(ULong,kUInt,uint,saturate) - U_DOWN_CAST_CASE(ULong,kUnsignedInt,uint,saturate) - U_DOWN_CAST_CASE(ULong,kLong,Long,saturate) - - TO_FLOAT_CASE(ULong) - TO_DOUBLE_CASE(ULong) - - default: - log_error( "ERROR: Invalid type given to convert_explicit_value!!\n" ); - break; - } - break; - - case kUnsignedLong: - ULongPtr = (ULong *)inRaw; - switch( outType ) - { - BOOL_CASE(ULong) - - case kULong: - case kUnsignedLong: - memcpy( outRaw, inRaw, get_explicit_type_size( inType ) ); - break; - - U_DOWN_CAST_CASE(ULong,kChar,char,saturate) - U_DOWN_CAST_CASE(ULong,kUChar,uchar,saturate) - U_DOWN_CAST_CASE(ULong,kUnsignedChar,uchar,saturate) - U_DOWN_CAST_CASE(ULong,kShort,short,saturate) - U_DOWN_CAST_CASE(ULong,kUShort,ushort,saturate) - U_DOWN_CAST_CASE(ULong,kUnsignedShort,ushort,saturate) - U_DOWN_CAST_CASE(ULong,kInt,int,saturate) - U_DOWN_CAST_CASE(ULong,kUInt,uint,saturate) - U_DOWN_CAST_CASE(ULong,kUnsignedInt,uint,saturate) - U_DOWN_CAST_CASE(ULong,kLong,Long,saturate) - - TO_FLOAT_CASE(ULong) - TO_DOUBLE_CASE(ULong) - - default: - log_error( "ERROR: Invalid type given to convert_explicit_value!!\n" ); - break; - } - break; - - case kFloat: - floatPtr = (float *)inRaw; - switch( outType ) - { - BOOL_CASE(float) - - FLOAT_ROUND_CASE(kChar,char,roundType,saturate) - FLOAT_ROUND_CASE(kUChar,uchar,roundType,saturate) - FLOAT_ROUND_CASE(kUnsignedChar,uchar,roundType,saturate) - FLOAT_ROUND_CASE(kShort,short,roundType,saturate) - FLOAT_ROUND_CASE(kUShort,ushort,roundType,saturate) - FLOAT_ROUND_CASE(kUnsignedShort,ushort,roundType,saturate) - FLOAT_ROUND_CASE(kInt,int,roundType,saturate) - FLOAT_ROUND_CASE(kUInt,uint,roundType,saturate) - FLOAT_ROUND_CASE(kUnsignedInt,uint,roundType,saturate) - FLOAT_ROUND_CASE(kLong,Long,roundType,saturate) - FLOAT_ROUND_CASE(kULong,ULong,roundType,saturate) - FLOAT_ROUND_CASE(kUnsignedLong,ULong,roundType,saturate) - - case kFloat: - memcpy( outRaw, inRaw, get_explicit_type_size( inType ) ); - break; - - TO_DOUBLE_CASE(float); - - default: - log_error( "ERROR: Invalid type given to convert_explicit_value!!\n" ); - break; - } - break; - - case kDouble: - doublePtr = (double *)inRaw; - switch( outType ) - { - BOOL_CASE(double) - - DOUBLE_ROUND_CASE(kChar,char,roundType,saturate) - DOUBLE_ROUND_CASE(kUChar,uchar,roundType,saturate) - DOUBLE_ROUND_CASE(kUnsignedChar,uchar,roundType,saturate) - DOUBLE_ROUND_CASE(kShort,short,roundType,saturate) - DOUBLE_ROUND_CASE(kUShort,ushort,roundType,saturate) - DOUBLE_ROUND_CASE(kUnsignedShort,ushort,roundType,saturate) - DOUBLE_ROUND_CASE(kInt,int,roundType,saturate) - DOUBLE_ROUND_CASE(kUInt,uint,roundType,saturate) - DOUBLE_ROUND_CASE(kUnsignedInt,uint,roundType,saturate) - DOUBLE_ROUND_CASE(kLong,Long,roundType,saturate) - DOUBLE_ROUND_CASE(kULong,ULong,roundType,saturate) - DOUBLE_ROUND_CASE(kUnsignedLong,ULong,roundType,saturate) - - TO_FLOAT_CASE(double); - - case kDouble: - memcpy( outRaw, inRaw, get_explicit_type_size( inType ) ); - break; - - default: - log_error( "ERROR: Invalid type given to convert_explicit_value!!\n" ); - break; - } - break; - - default: - log_error( "ERROR: Invalid type given to convert_explicit_value!!\n" ); - break; - } -} - -void generate_random_data( ExplicitType type, size_t count, MTdata d, void *outData ) -{ - bool *boolPtr; - cl_char *charPtr; - cl_uchar *ucharPtr; - cl_short *shortPtr; - cl_ushort *ushortPtr; - cl_int *intPtr; - cl_uint *uintPtr; - cl_long *longPtr; - cl_ulong *ulongPtr; - cl_float *floatPtr; - cl_double *doublePtr; - cl_ushort *halfPtr; - size_t i; - cl_uint bits = genrand_int32(d); - cl_uint bitsLeft = 32; - - switch( type ) - { - case kBool: - boolPtr = (bool *)outData; - for( i = 0; i < count; i++ ) - { - if( 0 == bitsLeft) - { - bits = genrand_int32(d); - bitsLeft = 32; - } - boolPtr[i] = ( bits & 1 ) ? true : false; - bits >>= 1; bitsLeft -= 1; - } - break; - - case kChar: - charPtr = (cl_char *)outData; - for( i = 0; i < count; i++ ) - { - if( 0 == bitsLeft) - { - bits = genrand_int32(d); - bitsLeft = 32; - } - charPtr[i] = (cl_char)( (cl_int)(bits & 255 ) - 127 ); - bits >>= 8; bitsLeft -= 8; - } - break; - - case kUChar: - case kUnsignedChar: - ucharPtr = (cl_uchar *)outData; - for( i = 0; i < count; i++ ) - { - if( 0 == bitsLeft) - { - bits = genrand_int32(d); - bitsLeft = 32; - } - ucharPtr[i] = (cl_uchar)( bits & 255 ); - bits >>= 8; bitsLeft -= 8; - } - break; - - case kShort: - shortPtr = (cl_short *)outData; - for( i = 0; i < count; i++ ) - { - if( 0 == bitsLeft) - { - bits = genrand_int32(d); - bitsLeft = 32; - } - shortPtr[i] = (cl_short)( (cl_int)( bits & 65535 ) - 32767 ); - bits >>= 16; bitsLeft -= 16; - } - break; - - case kUShort: - case kUnsignedShort: - ushortPtr = (cl_ushort *)outData; - for( i = 0; i < count; i++ ) - { - if( 0 == bitsLeft) - { - bits = genrand_int32(d); - bitsLeft = 32; - } - ushortPtr[i] = (cl_ushort)( (cl_int)( bits & 65535 ) ); - bits >>= 16; bitsLeft -= 16; - } - break; - - case kInt: - intPtr = (cl_int *)outData; - for( i = 0; i < count; i++ ) - { - intPtr[i] = (cl_int)genrand_int32(d); - } - break; - - case kUInt: - case kUnsignedInt: - uintPtr = (cl_uint *)outData; - for( i = 0; i < count; i++ ) - { - uintPtr[i] = (unsigned int)genrand_int32(d); - } - break; - - case kLong: - longPtr = (cl_long *)outData; - for( i = 0; i < count; i++ ) - { - longPtr[i] = (cl_long)genrand_int32(d) | ( (cl_long)genrand_int32(d) << 32 ); - } - break; - - case kULong: - case kUnsignedLong: - ulongPtr = (cl_ulong *)outData; - for( i = 0; i < count; i++ ) - { - ulongPtr[i] = (cl_ulong)genrand_int32(d) | ( (cl_ulong)genrand_int32(d) << 32 ); - } - break; - - case kFloat: - floatPtr = (cl_float *)outData; - for( i = 0; i < count; i++ ) - { - // [ -(double) 0x7fffffff, (double) 0x7fffffff ] - double t = genrand_real1(d); - floatPtr[i] = (float) ((1.0 - t) * -(double) 0x7fffffff + t * (double) 0x7fffffff); - } - break; - - case kDouble: - doublePtr = (cl_double *)outData; - for( i = 0; i < count; i++ ) - { - cl_long u = (cl_long)genrand_int32(d) | ( (cl_long)genrand_int32(d) << 32 ); - double t = (double) u; - t *= MAKE_HEX_DOUBLE( 0x1.0p-32, 0x1, -32 ); // scale [-2**63, 2**63] to [-2**31, 2**31] - doublePtr[i] = t; - } - break; - - case kHalf: - halfPtr = (ushort *)outData; - for( i = 0; i < count; i++ ) - { - if( 0 == bitsLeft) - { - bits = genrand_int32(d); - bitsLeft = 32; - } - halfPtr[i] = bits & 65535; /* Kindly generates random bits for us */ - bits >>= 16; bitsLeft -= 16; - } - break; - - default: - log_error( "ERROR: Invalid type passed in to generate_random_data!\n" ); - break; - } -} - -void * create_random_data( ExplicitType type, MTdata d, size_t count ) -{ - void *data = malloc( get_explicit_type_size( type ) * count ); - generate_random_data( type, count, d, data ); - return data; -} - -cl_long read_upscale_signed( void *inRaw, ExplicitType inType ) -{ - switch( inType ) - { - case kChar: - return (cl_long)( *( (cl_char *)inRaw ) ); - case kUChar: - case kUnsignedChar: - return (cl_long)( *( (cl_uchar *)inRaw ) ); - case kShort: - return (cl_long)( *( (cl_short *)inRaw ) ); - case kUShort: - case kUnsignedShort: - return (cl_long)( *( (cl_ushort *)inRaw ) ); - case kInt: - return (cl_long)( *( (cl_int *)inRaw ) ); - case kUInt: - case kUnsignedInt: - return (cl_long)( *( (cl_uint *)inRaw ) ); - case kLong: - return (cl_long)( *( (cl_long *)inRaw ) ); - case kULong: - case kUnsignedLong: - return (cl_long)( *( (cl_ulong *)inRaw ) ); - default: - return 0; - } -} - -cl_ulong read_upscale_unsigned( void *inRaw, ExplicitType inType ) -{ - switch( inType ) - { - case kChar: - return (cl_ulong)( *( (cl_char *)inRaw ) ); - case kUChar: - case kUnsignedChar: - return (cl_ulong)( *( (cl_uchar *)inRaw ) ); - case kShort: - return (cl_ulong)( *( (cl_short *)inRaw ) ); - case kUShort: - case kUnsignedShort: - return (cl_ulong)( *( (cl_ushort *)inRaw ) ); - case kInt: - return (cl_ulong)( *( (cl_int *)inRaw ) ); - case kUInt: - case kUnsignedInt: - return (cl_ulong)( *( (cl_uint *)inRaw ) ); - case kLong: - return (cl_ulong)( *( (cl_long *)inRaw ) ); - case kULong: - case kUnsignedLong: - return (cl_ulong)( *( (cl_ulong *)inRaw ) ); - default: - return 0; - } -} - -float read_as_float( void *inRaw, ExplicitType inType ) -{ - switch( inType ) - { - case kChar: - return (float)( *( (cl_char *)inRaw ) ); - case kUChar: - case kUnsignedChar: - return (float)( *( (cl_char *)inRaw ) ); - case kShort: - return (float)( *( (cl_short *)inRaw ) ); - case kUShort: - case kUnsignedShort: - return (float)( *( (cl_ushort *)inRaw ) ); - case kInt: - return (float)( *( (cl_int *)inRaw ) ); - case kUInt: - case kUnsignedInt: - return (float)( *( (cl_uint *)inRaw ) ); - case kLong: - return (float)( *( (cl_long *)inRaw ) ); - case kULong: - case kUnsignedLong: - return (float)( *( (cl_ulong *)inRaw ) ); - case kFloat: - return *( (float *)inRaw ); - case kDouble: - return (float) *( (double*)inRaw ); - default: - return 0; - } -} - -float get_random_float(float low, float high, MTdata d) -{ - float t = (float)((double)genrand_int32(d) / (double)0xFFFFFFFF); - return (1.0f - t) * low + t * high; -} - -double get_random_double(double low, double high, MTdata d) -{ - cl_ulong u = (cl_ulong) genrand_int32(d) | ((cl_ulong) genrand_int32(d) << 32 ); - double t = (double) u * MAKE_HEX_DOUBLE( 0x1.0p-64, 0x1, -64); - return (1.0f - t) * low + t * high; -} - -float any_float( MTdata d ) -{ - union - { - float f; - cl_uint u; - }u; - - u.u = genrand_int32(d); - return u.f; -} - - -double any_double( MTdata d ) -{ - union - { - double f; - cl_ulong u; - }u; - - u.u = (cl_ulong) genrand_int32(d) | ((cl_ulong) genrand_int32(d) << 32); - return u.f; -} - -int random_in_range( int minV, int maxV, MTdata d ) -{ - cl_ulong r = ((cl_ulong) genrand_int32(d) ) * (maxV - minV + 1); - return (cl_uint)(r >> 32) + minV; -} - -size_t get_random_size_t(size_t low, size_t high, MTdata d) -{ - enum { N = sizeof(size_t)/sizeof(int) }; - - union { - int word[N]; - size_t size; - } u; - - for (unsigned i=0; i != N; ++i) { - u.word[i] = genrand_int32(d); - } - - assert(low <= high && "Invalid random number range specified"); - size_t range = high - low; - - return (range) ? low + ((u.size - low) % range) : low; -} - - diff --git a/test_conformance/compatibility/test_common/harness/conversions.h b/test_conformance/compatibility/test_common/harness/conversions.h deleted file mode 100644 index aa3cb6b4..00000000 --- a/test_conformance/compatibility/test_common/harness/conversions.h +++ /dev/null @@ -1,126 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef _conversions_h -#define _conversions_h - -#include "compat.h" - -#include "errorHelpers.h" -#include "mt19937.h" -#include -#include -#include -#include - -#if defined(__cplusplus) -extern "C" { -#endif - -/* Note: the next three all have to match in size and order!! */ - -enum ExplicitTypes -{ - kBool = 0, - kChar, - kUChar, - kUnsignedChar, - kShort, - kUShort, - kUnsignedShort, - kInt, - kUInt, - kUnsignedInt, - kLong, - kULong, - kUnsignedLong, - kFloat, - kHalf, - kDouble, - kNumExplicitTypes -}; - -typedef enum ExplicitTypes ExplicitType; - -enum RoundingTypes -{ - kRoundToEven = 0, - kRoundToZero, - kRoundToPosInf, - kRoundToNegInf, - kRoundToNearest, - - kNumRoundingTypes, - - kDefaultRoundingType = kRoundToNearest -}; - -typedef enum RoundingTypes RoundingType; - -extern void print_type_to_string(ExplicitType type, void *data, char* string); -extern size_t get_explicit_type_size( ExplicitType type ); -extern const char * get_explicit_type_name( ExplicitType type ); -extern void convert_explicit_value( void *inRaw, void *outRaw, ExplicitType inType, bool saturate, RoundingType roundType, ExplicitType outType ); - -extern void generate_random_data( ExplicitType type, size_t count, MTdata d, void *outData ); -extern void * create_random_data( ExplicitType type, MTdata d, size_t count ); - -extern cl_long read_upscale_signed( void *inRaw, ExplicitType inType ); -extern cl_ulong read_upscale_unsigned( void *inRaw, ExplicitType inType ); -extern float read_as_float( void *inRaw, ExplicitType inType ); - -extern float get_random_float(float low, float high, MTdata d); -extern double get_random_double(double low, double high, MTdata d); -extern float any_float( MTdata d ); -extern double any_double( MTdata d ); - -extern int random_in_range( int minV, int maxV, MTdata d ); - -size_t get_random_size_t(size_t low, size_t high, MTdata d); - -// Note: though this takes a double, this is for use with single precision tests -static inline int IsFloatSubnormal( float x ) -{ -#if 2 == FLT_RADIX - // Do this in integer to avoid problems with FTZ behavior - union{ float d; uint32_t u;}u; - u.d = fabsf(x); - return (u.u-1) < 0x007fffffU; -#else - // rely on floating point hardware for non-radix2 non-IEEE-754 hardware -- will fail if you flush subnormals to zero - return fabs(x) < (double) FLT_MIN && x != 0.0; -#endif -} - -static inline int IsDoubleSubnormal( double x ) -{ -#if 2 == FLT_RADIX - // Do this in integer to avoid problems with FTZ behavior - union{ double d; uint64_t u;}u; - u.d = fabs( x); - return (u.u-1) < 0x000fffffffffffffULL; -#else - // rely on floating point hardware for non-radix2 non-IEEE-754 hardware -- will fail if you flush subnormals to zero - return fabs(x) < (double) DBL_MIN && x != 0.0; -#endif -} - -#if defined(__cplusplus) -} -#endif - -#endif // _conversions_h - - diff --git a/test_conformance/compatibility/test_common/harness/errorHelpers.c b/test_conformance/compatibility/test_common/harness/errorHelpers.c deleted file mode 100644 index 79c4ca21..00000000 --- a/test_conformance/compatibility/test_common/harness/errorHelpers.c +++ /dev/null @@ -1,579 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "compat.h" - -#include -#include -#include - -#include "errorHelpers.h" - -const char *IGetErrorString( int clErrorCode ) -{ - switch( clErrorCode ) - { - case CL_SUCCESS: return "CL_SUCCESS"; - case CL_DEVICE_NOT_FOUND: return "CL_DEVICE_NOT_FOUND"; - case CL_DEVICE_NOT_AVAILABLE: return "CL_DEVICE_NOT_AVAILABLE"; - case CL_COMPILER_NOT_AVAILABLE: return "CL_COMPILER_NOT_AVAILABLE"; - case CL_MEM_OBJECT_ALLOCATION_FAILURE: return "CL_MEM_OBJECT_ALLOCATION_FAILURE"; - case CL_OUT_OF_RESOURCES: return "CL_OUT_OF_RESOURCES"; - case CL_OUT_OF_HOST_MEMORY: return "CL_OUT_OF_HOST_MEMORY"; - case CL_PROFILING_INFO_NOT_AVAILABLE: return "CL_PROFILING_INFO_NOT_AVAILABLE"; - case CL_MEM_COPY_OVERLAP: return "CL_MEM_COPY_OVERLAP"; - case CL_IMAGE_FORMAT_MISMATCH: return "CL_IMAGE_FORMAT_MISMATCH"; - case CL_IMAGE_FORMAT_NOT_SUPPORTED: return "CL_IMAGE_FORMAT_NOT_SUPPORTED"; - case CL_BUILD_PROGRAM_FAILURE: return "CL_BUILD_PROGRAM_FAILURE"; - case CL_MAP_FAILURE: return "CL_MAP_FAILURE"; - case CL_MISALIGNED_SUB_BUFFER_OFFSET: return "CL_MISALIGNED_SUB_BUFFER_OFFSET"; - case CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST: return "CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST"; - case CL_COMPILE_PROGRAM_FAILURE: return "CL_COMPILE_PROGRAM_FAILURE"; - case CL_LINKER_NOT_AVAILABLE: return "CL_LINKER_NOT_AVAILABLE"; - case CL_LINK_PROGRAM_FAILURE: return "CL_LINK_PROGRAM_FAILURE"; - case CL_DEVICE_PARTITION_FAILED: return "CL_DEVICE_PARTITION_FAILED"; - case CL_KERNEL_ARG_INFO_NOT_AVAILABLE: return "CL_KERNEL_ARG_INFO_NOT_AVAILABLE"; - case CL_INVALID_VALUE: return "CL_INVALID_VALUE"; - case CL_INVALID_DEVICE_TYPE: return "CL_INVALID_DEVICE_TYPE"; - case CL_INVALID_DEVICE: return "CL_INVALID_DEVICE"; - case CL_INVALID_CONTEXT: return "CL_INVALID_CONTEXT"; - case CL_INVALID_QUEUE_PROPERTIES: return "CL_INVALID_QUEUE_PROPERTIES"; - case CL_INVALID_COMMAND_QUEUE: return "CL_INVALID_COMMAND_QUEUE"; - case CL_INVALID_HOST_PTR: return "CL_INVALID_HOST_PTR"; - case CL_INVALID_MEM_OBJECT: return "CL_INVALID_MEM_OBJECT"; - case CL_INVALID_IMAGE_FORMAT_DESCRIPTOR: return "CL_INVALID_IMAGE_FORMAT_DESCRIPTOR"; - case CL_INVALID_IMAGE_SIZE: return "CL_INVALID_IMAGE_SIZE"; - case CL_INVALID_SAMPLER: return "CL_INVALID_SAMPLER"; - case CL_INVALID_BINARY: return "CL_INVALID_BINARY"; - case CL_INVALID_BUILD_OPTIONS: return "CL_INVALID_BUILD_OPTIONS"; - case CL_INVALID_PROGRAM: return "CL_INVALID_PROGRAM"; - case CL_INVALID_PROGRAM_EXECUTABLE: return "CL_INVALID_PROGRAM_EXECUTABLE"; - case CL_INVALID_KERNEL_NAME: return "CL_INVALID_KERNEL_NAME"; - case CL_INVALID_KERNEL_DEFINITION: return "CL_INVALID_KERNEL_DEFINITION"; - case CL_INVALID_KERNEL: return "CL_INVALID_KERNEL"; - case CL_INVALID_ARG_INDEX: return "CL_INVALID_ARG_INDEX"; - case CL_INVALID_ARG_VALUE: return "CL_INVALID_ARG_VALUE"; - case CL_INVALID_ARG_SIZE: return "CL_INVALID_ARG_SIZE"; - case CL_INVALID_KERNEL_ARGS: return "CL_INVALID_KERNEL_ARGS"; - case CL_INVALID_WORK_DIMENSION: return "CL_INVALID_WORK_DIMENSION"; - case CL_INVALID_WORK_GROUP_SIZE: return "CL_INVALID_WORK_GROUP_SIZE"; - case CL_INVALID_WORK_ITEM_SIZE: return "CL_INVALID_WORK_ITEM_SIZE"; - case CL_INVALID_GLOBAL_OFFSET: return "CL_INVALID_GLOBAL_OFFSET"; - case CL_INVALID_EVENT_WAIT_LIST: return "CL_INVALID_EVENT_WAIT_LIST"; - case CL_INVALID_EVENT: return "CL_INVALID_EVENT"; - case CL_INVALID_OPERATION: return "CL_INVALID_OPERATION"; - case CL_INVALID_GL_OBJECT: return "CL_INVALID_GL_OBJECT"; - case CL_INVALID_BUFFER_SIZE: return "CL_INVALID_BUFFER_SIZE"; - case CL_INVALID_MIP_LEVEL: return "CL_INVALID_MIP_LEVEL"; - case CL_INVALID_GLOBAL_WORK_SIZE: return "CL_INVALID_GLOBAL_WORK_SIZE"; - case CL_INVALID_PROPERTY: return "CL_INVALID_PROPERTY"; - case CL_INVALID_IMAGE_DESCRIPTOR: return "CL_INVALID_IMAGE_DESCRIPTOR"; - case CL_INVALID_COMPILER_OPTIONS: return "CL_INVALID_COMPILER_OPTIONS"; - case CL_INVALID_LINKER_OPTIONS: return "CL_INVALID_LINKER_OPTIONS"; - case CL_INVALID_DEVICE_PARTITION_COUNT: return "CL_INVALID_DEVICE_PARTITION_COUNT"; - default: return "(unknown)"; - } -} - -const char *GetChannelOrderName( cl_channel_order order ) -{ - switch( order ) - { - case CL_R: return "CL_R"; - case CL_A: return "CL_A"; - case CL_Rx: return "CL_Rx"; - case CL_RG: return "CL_RG"; - case CL_RA: return "CL_RA"; - case CL_RGx: return "CL_RGx"; - case CL_RGB: return "CL_RGB"; - case CL_RGBx: return "CL_RGBx"; - case CL_RGBA: return "CL_RGBA"; - case CL_ARGB: return "CL_ARGB"; - case CL_BGRA: return "CL_BGRA"; - case CL_INTENSITY: return "CL_INTENSITY"; - case CL_LUMINANCE: return "CL_LUMINANCE"; -#if defined CL_1RGB_APPLE - case CL_1RGB_APPLE: return "CL_1RGB_APPLE"; -#endif -#if defined CL_BGR1_APPLE - case CL_BGR1_APPLE: return "CL_BGR1_APPLE"; -#endif - default: return NULL; - } -} - -int IsChannelOrderSupported( cl_channel_order order ) -{ - switch( order ) - { - case CL_R: - case CL_A: - case CL_Rx: - case CL_RG: - case CL_RA: - case CL_RGx: - case CL_RGB: - case CL_RGBx: - case CL_RGBA: - case CL_ARGB: - case CL_BGRA: - case CL_INTENSITY: - case CL_LUMINANCE: - return 1; -#if defined CL_1RGB_APPLE - case CL_1RGB_APPLE: - return 1; -#endif -#if defined CL_BGR1_APPLE - case CL_BGR1_APPLE: - return 1; -#endif - default: - return 0; - } -} - -const char *GetChannelTypeName( cl_channel_type type ) -{ - switch( type ) - { - case CL_SNORM_INT8: return "CL_SNORM_INT8"; - case CL_SNORM_INT16: return "CL_SNORM_INT16"; - case CL_UNORM_INT8: return "CL_UNORM_INT8"; - case CL_UNORM_INT16: return "CL_UNORM_INT16"; - case CL_UNORM_SHORT_565: return "CL_UNORM_SHORT_565"; - case CL_UNORM_SHORT_555: return "CL_UNORM_SHORT_555"; - case CL_UNORM_INT_101010: return "CL_UNORM_INT_101010"; - case CL_SIGNED_INT8: return "CL_SIGNED_INT8"; - case CL_SIGNED_INT16: return "CL_SIGNED_INT16"; - case CL_SIGNED_INT32: return "CL_SIGNED_INT32"; - case CL_UNSIGNED_INT8: return "CL_UNSIGNED_INT8"; - case CL_UNSIGNED_INT16: return "CL_UNSIGNED_INT16"; - case CL_UNSIGNED_INT32: return "CL_UNSIGNED_INT32"; - case CL_HALF_FLOAT: return "CL_HALF_FLOAT"; - case CL_FLOAT: return "CL_FLOAT"; -#ifdef CL_SFIXED14_APPLE - case CL_SFIXED14_APPLE: return "CL_SFIXED14_APPLE"; -#endif - default: return NULL; - } -} - -int IsChannelTypeSupported( cl_channel_type type ) -{ - switch( type ) - { - case CL_SNORM_INT8: - case CL_SNORM_INT16: - case CL_UNORM_INT8: - case CL_UNORM_INT16: - case CL_UNORM_SHORT_565: - case CL_UNORM_SHORT_555: - case CL_UNORM_INT_101010: - case CL_SIGNED_INT8: - case CL_SIGNED_INT16: - case CL_SIGNED_INT32: - case CL_UNSIGNED_INT8: - case CL_UNSIGNED_INT16: - case CL_UNSIGNED_INT32: - case CL_HALF_FLOAT: - case CL_FLOAT: - return 1; -#ifdef CL_SFIXED14_APPLE - case CL_SFIXED14_APPLE: - return 1; -#endif - default: - return 0; - } -} - -const char *GetAddressModeName( cl_addressing_mode mode ) -{ - switch( mode ) - { - case CL_ADDRESS_NONE: return "CL_ADDRESS_NONE"; - case CL_ADDRESS_CLAMP_TO_EDGE: return "CL_ADDRESS_CLAMP_TO_EDGE"; - case CL_ADDRESS_CLAMP: return "CL_ADDRESS_CLAMP"; - case CL_ADDRESS_REPEAT: return "CL_ADDRESS_REPEAT"; - case CL_ADDRESS_MIRRORED_REPEAT: return "CL_ADDRESS_MIRRORED_REPEAT"; - default: return NULL; - } -} - -const char *GetDeviceTypeName( cl_device_type type ) -{ - switch( type ) - { - case CL_DEVICE_TYPE_GPU: return "CL_DEVICE_TYPE_GPU"; - case CL_DEVICE_TYPE_CPU: return "CL_DEVICE_TYPE_CPU"; - case CL_DEVICE_TYPE_ACCELERATOR: return "CL_DEVICE_TYPE_ACCELERATOR"; - case CL_DEVICE_TYPE_ALL: return "CL_DEVICE_TYPE_ALL"; - default: return NULL; - } -} - -const char *GetDataVectorString( void *dataBuffer, size_t typeSize, size_t vecSize, char *buffer ) -{ - static char scratch[ 1024 ]; - size_t i, j; - - if( buffer == NULL ) - buffer = scratch; - - unsigned char *p = (unsigned char *)dataBuffer; - char *bPtr; - - buffer[ 0 ] = 0; - bPtr = buffer; - for( i = 0; i < vecSize; i++ ) - { - if( i > 0 ) - { - bPtr[ 0 ] = ' '; - bPtr++; - } - for( j = 0; j < typeSize; j++ ) - { - sprintf( bPtr, "%02x", (unsigned int)p[ typeSize - j - 1 ] ); - bPtr += 2; - } - p += typeSize; - } - bPtr[ 0 ] = 0; - - return buffer; -} - -#ifndef MAX -#define MAX( _a, _b ) ((_a) > (_b) ? (_a) : (_b)) -#endif - -#if defined( _MSC_VER ) -#define scalbnf(_a, _i ) ldexpf( _a, _i ) -#define scalbn(_a, _i ) ldexp( _a, _i ) -#define scalbnl(_a, _i ) ldexpl( _a, _i ) -#endif - -static float Ulp_Error_Half_Float( float test, double reference ); -static inline float half2float( cl_ushort half ); - -// taken from math tests -#define HALF_MIN_EXP -13 -#define HALF_MANT_DIG 11 -static float Ulp_Error_Half_Float( float test, double reference ) -{ - union{ double d; uint64_t u; }u; u.d = reference; - - // Note: This function presumes that someone has already tested whether the result is correctly, - // rounded before calling this function. That test: - // - // if( (float) reference == test ) - // return 0.0f; - // - // would ensure that cases like fabs(reference) > FLT_MAX are weeded out before we get here. - // Otherwise, we'll return inf ulp error here, for what are otherwise correctly rounded - // results. - - double testVal = test; - if( u.u & 0x000fffffffffffffULL ) - { // Non-power of two and NaN - if( isnan( reference ) && isnan( test ) ) - return 0.0f; // if we are expecting a NaN, any NaN is fine - - // The unbiased exponent of the ulp unit place - int ulp_exp = HALF_MANT_DIG - 1 - MAX( ilogb( reference), HALF_MIN_EXP-1 ); - - // Scale the exponent of the error - return (float) scalbn( testVal - reference, ulp_exp ); - } - - if( isinf( reference ) ) - { - if( (double) test == reference ) - return 0.0f; - - return (float) (testVal - reference ); - } - - // reference is a normal power of two or a zero - int ulp_exp = HALF_MANT_DIG - 1 - MAX( ilogb( reference) - 1, HALF_MIN_EXP-1 ); - - // Scale the exponent of the error - return (float) scalbn( testVal - reference, ulp_exp ); -} - -// Taken from vLoadHalf test -static inline float half2float( cl_ushort us ) -{ - uint32_t u = us; - uint32_t sign = (u << 16) & 0x80000000; - int32_t exponent = (u & 0x7c00) >> 10; - uint32_t mantissa = (u & 0x03ff) << 13; - union{ unsigned int u; float f;}uu; - - if( exponent == 0 ) - { - if( mantissa == 0 ) - return sign ? -0.0f : 0.0f; - - int shift = __builtin_clz( mantissa ) - 8; - exponent -= shift-1; - mantissa <<= shift; - mantissa &= 0x007fffff; - } - else - if( exponent == 31) - { - uu.u = mantissa | sign; - if( mantissa ) - uu.u |= 0x7fc00000; - else - uu.u |= 0x7f800000; - - return uu.f; - } - - exponent += 127 - 15; - exponent <<= 23; - - exponent |= mantissa; - uu.u = exponent | sign; - - return uu.f; -} - -float Ulp_Error_Half( cl_ushort test, float reference ) -{ - return Ulp_Error_Half_Float( half2float(test), reference ); -} - - -float Ulp_Error( float test, double reference ) -{ - union{ double d; uint64_t u; }u; u.d = reference; - double testVal = test; - - // Note: This function presumes that someone has already tested whether the result is correctly, - // rounded before calling this function. That test: - // - // if( (float) reference == test ) - // return 0.0f; - // - // would ensure that cases like fabs(reference) > FLT_MAX are weeded out before we get here. - // Otherwise, we'll return inf ulp error here, for what are otherwise correctly rounded - // results. - - - if( isinf( reference ) ) - { - if( testVal == reference ) - return 0.0f; - - return (float) (testVal - reference ); - } - - if( isinf( testVal) ) - { // infinite test value, but finite (but possibly overflowing in float) reference. - // - // The function probably overflowed prematurely here. Formally, the spec says this is - // an infinite ulp error and should not be tolerated. Unfortunately, this would mean - // that the internal precision of some half_pow implementations would have to be 29+ bits - // at half_powr( 0x1.fffffep+31, 4) to correctly determine that 4*log2( 0x1.fffffep+31 ) - // is not exactly 128.0. You might represent this for example as 4*(32 - ~2**-24), which - // after rounding to single is 4*32 = 128, which will ultimately result in premature - // overflow, even though a good faith representation would be correct to within 2**-29 - // interally. - - // In the interest of not requiring the implementation go to extraordinary lengths to - // deliver a half precision function, we allow premature overflow within the limit - // of the allowed ulp error. Towards, that end, we "pretend" the test value is actually - // 2**128, the next value that would appear in the number line if float had sufficient range. - testVal = copysign( MAKE_HEX_DOUBLE(0x1.0p128, 0x1LL, 128), testVal ); - - // Note that the same hack may not work in long double, which is not guaranteed to have - // more range than double. It is not clear that premature overflow should be tolerated for - // double. - } - - if( u.u & 0x000fffffffffffffULL ) - { // Non-power of two and NaN - if( isnan( reference ) && isnan( test ) ) - return 0.0f; // if we are expecting a NaN, any NaN is fine - - // The unbiased exponent of the ulp unit place - int ulp_exp = FLT_MANT_DIG - 1 - MAX( ilogb( reference), FLT_MIN_EXP-1 ); - - // Scale the exponent of the error - return (float) scalbn( testVal - reference, ulp_exp ); - } - - // reference is a normal power of two or a zero - // The unbiased exponent of the ulp unit place - int ulp_exp = FLT_MANT_DIG - 1 - MAX( ilogb( reference) - 1, FLT_MIN_EXP-1 ); - - // Scale the exponent of the error - return (float) scalbn( testVal - reference, ulp_exp ); -} - -float Ulp_Error_Double( double test, long double reference ) -{ - // Deal with long double = double - // On most systems long double is a higher precision type than double. They provide either - // a 80-bit or greater floating point type, or they provide a head-tail double double format. - // That is sufficient to represent the accuracy of a floating point result to many more bits - // than double and we can calculate sub-ulp errors. This is the standard system for which this - // test suite is designed. - // - // On some systems double and long double are the same thing. Then we run into a problem, - // because our representation of the infinitely precise result (passed in as reference above) - // can be off by as much as a half double precision ulp itself. In this case, we inflate the - // reported error by half an ulp to take this into account. A more correct and permanent fix - // would be to undertake refactoring the reference code to return results in this format: - // - // typedef struct DoubleReference - // { // true value = correctlyRoundedResult + ulps * ulp(correctlyRoundedResult) (infinitely precise) - // double correctlyRoundedResult; // as best we can - // double ulps; // plus a fractional amount to account for the difference - // }DoubleReference; // between infinitely precise result and correctlyRoundedResult, in units of ulps. - // - // This would provide a useful higher-than-double precision format for everyone that we can use, - // and would solve a few problems with representing absolute errors below DBL_MIN and over DBL_MAX for systems - // that use a head to tail double double for long double. - - // Note: This function presumes that someone has already tested whether the result is correctly, - // rounded before calling this function. That test: - // - // if( (float) reference == test ) - // return 0.0f; - // - // would ensure that cases like fabs(reference) > FLT_MAX are weeded out before we get here. - // Otherwise, we'll return inf ulp error here, for what are otherwise correctly rounded - // results. - - - int x; - long double testVal = test; - if( 0.5L != frexpl( reference, &x) ) - { // Non-power of two and NaN - if( isinf( reference ) ) - { - if( testVal == reference ) - return 0.0f; - - return (float) ( testVal - reference ); - } - - if( isnan( reference ) && isnan( test ) ) - return 0.0f; // if we are expecting a NaN, any NaN is fine - - // The unbiased exponent of the ulp unit place - int ulp_exp = DBL_MANT_DIG - 1 - MAX( ilogbl( reference), DBL_MIN_EXP-1 ); - - // Scale the exponent of the error - float result = (float) scalbnl( testVal - reference, ulp_exp ); - - // account for rounding error in reference result on systems that do not have a higher precision floating point type (see above) - if( sizeof(long double) == sizeof( double ) ) - result += copysignf( 0.5f, result); - - return result; - - } - - // reference is a normal power of two or a zero - // The unbiased exponent of the ulp unit place - int ulp_exp = DBL_MANT_DIG - 1 - MAX( ilogbl( reference) - 1, DBL_MIN_EXP-1 ); - - // Scale the exponent of the error - float result = (float) scalbnl( testVal - reference, ulp_exp ); - - // account for rounding error in reference result on systems that do not have a higher precision floating point type (see above) - if( sizeof(long double) == sizeof( double ) ) - result += copysignf( 0.5f, result); - - return result; -} - -cl_int OutputBuildLogs(cl_program program, cl_uint num_devices, cl_device_id *device_list) -{ - int error; - size_t size_ret; - - // Does the program object exist? - if (program != NULL) { - - // Was the number of devices given - if (num_devices == 0) { - - // If zero devices were specified then allocate and query the device list from the context - cl_context context; - error = clGetProgramInfo(program, CL_PROGRAM_CONTEXT, sizeof(context), &context, NULL); - test_error( error, "Unable to query program's context" ); - error = clGetContextInfo(context, CL_CONTEXT_DEVICES, 0, NULL, &size_ret); - test_error( error, "Unable to query context's device size" ); - num_devices = size_ret / sizeof(cl_device_id); - device_list = (cl_device_id *) malloc(size_ret); - if (device_list == NULL) { - print_error( error, "malloc failed" ); - return CL_OUT_OF_HOST_MEMORY; - } - error = clGetContextInfo(context, CL_CONTEXT_DEVICES, size_ret, device_list, NULL); - test_error( error, "Unable to query context's devices" ); - - } - - // For each device in the device_list - unsigned int i; - for (i = 0; i < num_devices; i++) { - - // Get the build status - cl_build_status build_status; - error = clGetProgramBuildInfo(program, - device_list[i], - CL_PROGRAM_BUILD_STATUS, - sizeof(build_status), - &build_status, - &size_ret); - test_error( error, "Unable to query build status" ); - - // If the build failed then log the status, and allocate the build log, log it and free it - if (build_status != CL_BUILD_SUCCESS) { - - log_error("ERROR: CL_PROGRAM_BUILD_STATUS=%d\n", (int) build_status); - error = clGetProgramBuildInfo(program, device_list[i], CL_PROGRAM_BUILD_LOG, 0, NULL, &size_ret); - test_error( error, "Unable to query build log size" ); - char *build_log = (char *) malloc(size_ret); - error = clGetProgramBuildInfo(program, device_list[i], CL_PROGRAM_BUILD_LOG, size_ret, build_log, &size_ret); - test_error( error, "Unable to query build log" ); - log_error("ERROR: CL_PROGRAM_BUILD_LOG:\n%s\n", build_log); - free(build_log); - - } - - } - - // Was the number of devices given - if (num_devices == 0) { - - // If zero devices were specified then free the device list - free(device_list); - - } - - } - - return CL_SUCCESS; -} diff --git a/test_conformance/compatibility/test_common/harness/errorHelpers.h b/test_conformance/compatibility/test_common/harness/errorHelpers.h deleted file mode 100644 index 9b5d7097..00000000 --- a/test_conformance/compatibility/test_common/harness/errorHelpers.h +++ /dev/null @@ -1,149 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef _errorHelpers_h -#define _errorHelpers_h - -#ifdef __APPLE__ -#include -#else -#include -#endif -#include -#ifdef __cplusplus -extern "C" { -#endif - -#define LOWER_IS_BETTER 0 -#define HIGHER_IS_BETTER 1 - -// If USE_ATF is defined, all log_error and log_info calls can be routed to test library -// functions as described below. This is helpful for integration into an automated testing -// system. -#if USE_ATF -// export BUILD_WITH_ATF=1 - #include - #define test_start() ATFTestStart() - #define log_info ATFLogInfo - #define log_error ATFLogError - #define log_perf(_number, _higherBetter, _numType, _format, ...) ATFLogPerformanceNumber(_number, _higherBetter, _numType, _format, ##__VA_ARGS__) - #define test_finish() ATFTestFinish() - #define vlog_perf(_number, _higherBetter, _numType, _format, ...) ATFLogPerformanceNumber(_number, _higherBetter, _numType, _format,##__VA_ARGS__) - #define vlog ATFLogInfo - #define vlog_error ATFLogError -#else - #define test_start() - #define log_info printf - #define log_error printf - #define log_perf(_number, _higherBetter, _numType, _format, ...) printf("Performance Number " _format " (in %s, %s): %g\n",##__VA_ARGS__, _numType, \ - _higherBetter?"higher is better":"lower is better", _number ) - #define test_finish() - #define vlog_perf(_number, _higherBetter, _numType, _format, ...) printf("Performance Number " _format " (in %s, %s): %g\n",##__VA_ARGS__, _numType, \ - _higherBetter?"higher is better":"lower is better" , _number) - #ifdef _WIN32 - #ifdef __MINGW32__ - // Use __mingw_printf since it supports "%a" format specifier - #define vlog __mingw_printf - #define vlog_error __mingw_printf - #else - // Use home-baked function that treats "%a" as "%f" - static int vlog_win32(const char *format, ...); - #define vlog vlog_win32 - #define vlog_error vlog_win32 - #endif - #else - #define vlog_error printf - #define vlog printf - #endif -#endif - -#define ct_assert(b) ct_assert_i(b, __LINE__) -#define ct_assert_i(b, line) ct_assert_ii(b, line) -#define ct_assert_ii(b, line) int _compile_time_assertion_on_line_##line[b ? 1 : -1]; - -#define test_error(errCode,msg) test_error_ret(errCode,msg,errCode) -#define test_error_ret(errCode,msg,retValue) { if( errCode != CL_SUCCESS ) { print_error( errCode, msg ); return retValue ; } } -#define print_error(errCode,msg) log_error( "ERROR: %s! (%s from %s:%d)\n", msg, IGetErrorString( errCode ), __FILE__, __LINE__ ); - -// expected error code vs. what we got -#define test_failure_error(errCode, expectedErrCode, msg) test_failure_error_ret(errCode, expectedErrCode, msg, errCode != expectedErrCode) -#define test_failure_error_ret(errCode, expectedErrCode, msg, retValue) { if( errCode != expectedErrCode ) { print_failure_error( errCode, expectedErrCode, msg ); return retValue ; } } -#define print_failure_error(errCode, expectedErrCode, msg) log_error( "ERROR: %s! (Got %s, expected %s from %s:%d)\n", msg, IGetErrorString( errCode ), IGetErrorString( expectedErrCode ), __FILE__, __LINE__ ); -#define test_failure_warning(errCode, expectedErrCode, msg) test_failure_warning_ret(errCode, expectedErrCode, msg, errCode != expectedErrCode) -#define test_failure_warning_ret(errCode, expectedErrCode, msg, retValue) { if( errCode != expectedErrCode ) { print_failure_warning( errCode, expectedErrCode, msg ); warnings++ ; } } -#define print_failure_warning(errCode, expectedErrCode, msg) log_error( "WARNING: %s! (Got %s, expected %s from %s:%d)\n", msg, IGetErrorString( errCode ), IGetErrorString( expectedErrCode ), __FILE__, __LINE__ ); - -extern const char *IGetErrorString( int clErrorCode ); - -extern float Ulp_Error_Half( cl_ushort test, float reference ); -extern float Ulp_Error( float test, double reference ); -extern float Ulp_Error_Double( double test, long double reference ); - -extern const char *GetChannelTypeName( cl_channel_type type ); -extern int IsChannelTypeSupported( cl_channel_type type ); -extern const char *GetChannelOrderName( cl_channel_order order ); -extern int IsChannelOrderSupported( cl_channel_order order ); -extern const char *GetAddressModeName( cl_addressing_mode mode ); - -extern const char *GetDeviceTypeName( cl_device_type type ); - -// NON-REENTRANT UNLESS YOU PROVIDE A BUFFER PTR (pass null to use static storage, but it's not reentrant then!) -extern const char *GetDataVectorString( void *dataBuffer, size_t typeSize, size_t vecSize, char *buffer ); - -#if defined (_WIN32) && !defined(__MINGW32__) -#include -#include -#include -static int vlog_win32(const char *format, ...) -{ - const char *new_format = format; - - if (strstr(format, "%a")) { - char *temp; - if ((temp = strdup(format)) == NULL) { - printf("vlog_win32: Failed to allocate memory for strdup\n"); - return -1; - } - new_format = temp; - while (*temp) { - // replace %a with %f - if ((*temp == '%') && (*(temp+1) == 'a')) { - *(temp+1) = 'f'; - } - temp++; - } - } - - va_list args; - va_start(args, format); - vprintf(new_format, args); - va_end(args); - - if (new_format != format) { - free((void*)new_format); - } - - return 0; -} -#endif - - -#ifdef __cplusplus -} -#endif - -#endif // _errorHelpers_h - - diff --git a/test_conformance/compatibility/test_common/harness/fpcontrol.h b/test_conformance/compatibility/test_common/harness/fpcontrol.h deleted file mode 100644 index d6de0048..00000000 --- a/test_conformance/compatibility/test_common/harness/fpcontrol.h +++ /dev/null @@ -1,104 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef _fpcontrol_h -#define _fpcontrol_h - -// In order to get tests for correctly rounded operations (e.g. multiply) to work properly we need to be able to set the reference hardware -// to FTZ mode if the device hardware is running in that mode. We have explored all other options short of writing correctly rounded operations -// in integer code, and have found this is the only way to correctly verify operation. -// -// Non-Apple implementations will need to provide their own implentation for these features. If the reference hardware and device are both -// running in the same state (either FTZ or IEEE compliant modes) then these functions may be empty. If the device is running in non-default -// rounding mode (e.g. round toward zero), then these functions should also set the reference device into that rounding mode. -#if defined( __APPLE__ ) || defined( _MSC_VER ) || defined( __linux__ ) || defined (__MINGW32__) - typedef int FPU_mode_type; -#if defined( __i386__ ) || defined( __x86_64__ ) - #include -#elif defined( __PPC__ ) - #include - extern __thread fpu_control_t fpu_control; -#endif - // Set the reference hardware floating point unit to FTZ mode - static inline void ForceFTZ( FPU_mode_type *mode ) - { -#if defined( __i386__ ) || defined( __x86_64__ ) || defined( _MSC_VER ) || defined (__MINGW32__) - *mode = _mm_getcsr(); - _mm_setcsr( *mode | 0x8040); -#elif defined( __PPC__ ) - *mode = fpu_control; - fpu_control |= _FPU_MASK_NI; -#elif defined ( __arm__ ) - unsigned fpscr; - __asm__ volatile ("fmrx %0, fpscr" : "=r"(fpscr)); - *mode = fpscr; - __asm__ volatile ("fmxr fpscr, %0" :: "r"(fpscr | (1U << 24))); - // Add 64 bit support -#elif defined (__aarch64__) - unsigned fpscr; - __asm__ volatile ("mrs %0, fpcr" : "=r"(fpscr)); - *mode = fpscr; - __asm__ volatile ("msr fpcr, %0" :: "r"(fpscr | (1U << 24))); -#else - #error ForceFTZ needs an implentation -#endif - } - - // Disable the denorm flush to zero - static inline void DisableFTZ( FPU_mode_type *mode ) - { -#if defined( __i386__ ) || defined( __x86_64__ ) || defined( _MSC_VER ) || defined (__MINGW32__) - *mode = _mm_getcsr(); - _mm_setcsr( *mode & ~0x8040); -#elif defined( __PPC__ ) - *mode = fpu_control; - fpu_control &= ~_FPU_MASK_NI; -#elif defined ( __arm__ ) - unsigned fpscr; - __asm__ volatile ("fmrx %0, fpscr" : "=r"(fpscr)); - *mode = fpscr; - __asm__ volatile ("fmxr fpscr, %0" :: "r"(fpscr & ~(1U << 24))); - // Add 64 bit support -#elif defined (__aarch64__) - unsigned fpscr; - __asm__ volatile ("mrs %0, fpcr" : "=r"(fpscr)); - *mode = fpscr; - __asm__ volatile ("msr fpcr, %0" :: "r"(fpscr & ~(1U << 24))); -#else -#error DisableFTZ needs an implentation -#endif - } - - // Restore the reference hardware to floating point state indicated by *mode - static inline void RestoreFPState( FPU_mode_type *mode ) - { -#if defined( __i386__ ) || defined( __x86_64__ ) || defined( _MSC_VER ) || defined (__MINGW32__) - _mm_setcsr( *mode ); -#elif defined( __PPC__) - fpu_control = *mode; -#elif defined (__arm__) - __asm__ volatile ("fmxr fpscr, %0" :: "r"(*mode)); - // Add 64 bit support -#elif defined (__aarch64__) - __asm__ volatile ("msr fpcr, %0" :: "r"(*mode)); -#else - #error RestoreFPState needs an implementation -#endif - } -#else - #error ForceFTZ and RestoreFPState need implentations -#endif - -#endif diff --git a/test_conformance/compatibility/test_common/harness/genericThread.cpp b/test_conformance/compatibility/test_common/harness/genericThread.cpp deleted file mode 100644 index 2b742fa3..00000000 --- a/test_conformance/compatibility/test_common/harness/genericThread.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "genericThread.h" - -#if defined(_WIN32) -#include -#else // !_WIN32 -#include -#endif - -void * genericThread::IStaticReflector( void * data ) -{ - genericThread *t = (genericThread *)data; - return t->IRun(); -} - -bool genericThread::Start( void ) -{ -#if defined(_WIN32) - mHandle = CreateThread( NULL, 0, (LPTHREAD_START_ROUTINE) IStaticReflector, this, 0, NULL ); - return ( mHandle != NULL ); -#else // !_WIN32 - int error = pthread_create( (pthread_t*)&mHandle, NULL, IStaticReflector, (void *)this ); - return ( error == 0 ); -#endif // !_WIN32 -} - -void * genericThread::Join( void ) -{ -#if defined(_WIN32) - WaitForSingleObject( (HANDLE)mHandle, INFINITE ); - return NULL; -#else // !_WIN32 - void * retVal; - int error = pthread_join( (pthread_t)mHandle, &retVal ); - if( error != 0 ) - retVal = NULL; - return retVal; -#endif // !_WIN32 -} diff --git a/test_conformance/compatibility/test_common/harness/genericThread.h b/test_conformance/compatibility/test_common/harness/genericThread.h deleted file mode 100644 index 168b7407..00000000 --- a/test_conformance/compatibility/test_common/harness/genericThread.h +++ /dev/null @@ -1,42 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef _genericThread_h -#define _genericThread_h - -#include - -class genericThread -{ - public: - - virtual ~genericThread() {} - - bool Start( void ); - void * Join( void ); - - protected: - - virtual void * IRun( void ) = 0; - - private: - - void* mHandle; - - static void * IStaticReflector( void * data ); -}; - -#endif // _genericThread_h - diff --git a/test_conformance/compatibility/test_common/harness/imageHelpers.cpp b/test_conformance/compatibility/test_common/harness/imageHelpers.cpp deleted file mode 100644 index 60f744b4..00000000 --- a/test_conformance/compatibility/test_common/harness/imageHelpers.cpp +++ /dev/null @@ -1,249 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "imageHelpers.h" - -size_t get_format_type_size( const cl_image_format *format ) -{ - return get_channel_data_type_size( format->image_channel_data_type ); -} - -size_t get_channel_data_type_size( cl_channel_type channelType ) -{ - switch( channelType ) - { - case CL_SNORM_INT8: - case CL_UNORM_INT8: - case CL_SIGNED_INT8: - case CL_UNSIGNED_INT8: - return 1; - - case CL_SNORM_INT16: - case CL_UNORM_INT16: - case CL_SIGNED_INT16: - case CL_UNSIGNED_INT16: - case CL_HALF_FLOAT: -#ifdef CL_SFIXED14_APPLE - case CL_SFIXED14_APPLE: -#endif - return sizeof( cl_short ); - - case CL_SIGNED_INT32: - case CL_UNSIGNED_INT32: - return sizeof( cl_int ); - - case CL_UNORM_SHORT_565: - case CL_UNORM_SHORT_555: -#ifdef OBSOLETE_FORAMT - case CL_UNORM_SHORT_565_REV: - case CL_UNORM_SHORT_555_REV: -#endif - return 2; - -#ifdef OBSOLETE_FORAMT - case CL_UNORM_INT_8888: - case CL_UNORM_INT_8888_REV: - return 4; -#endif - - case CL_UNORM_INT_101010: -#ifdef OBSOLETE_FORAMT - case CL_UNORM_INT_101010_REV: -#endif - return 4; - - case CL_FLOAT: - return sizeof( cl_float ); - - default: - return 0; - } -} - -size_t get_format_channel_count( const cl_image_format *format ) -{ - return get_channel_order_channel_count( format->image_channel_order ); -} - -size_t get_channel_order_channel_count( cl_channel_order order ) -{ - switch( order ) - { - case CL_R: - case CL_A: - case CL_Rx: - case CL_INTENSITY: - case CL_LUMINANCE: - return 1; - - case CL_RG: - case CL_RA: - case CL_RGx: - return 2; - - case CL_RGB: - case CL_RGBx: - return 3; - - case CL_RGBA: - case CL_ARGB: - case CL_BGRA: -#ifdef CL_1RGB_APPLE - case CL_1RGB_APPLE: -#endif -#ifdef CL_BGR1_APPLE - case CL_BGR1_APPLE: -#endif - return 4; - - default: - return 0; - } -} - -int is_format_signed( const cl_image_format *format ) -{ - switch( format->image_channel_data_type ) - { - case CL_SNORM_INT8: - case CL_SIGNED_INT8: - case CL_SNORM_INT16: - case CL_SIGNED_INT16: - case CL_SIGNED_INT32: - case CL_HALF_FLOAT: - case CL_FLOAT: -#ifdef CL_SFIXED14_APPLE - case CL_SFIXED14_APPLE: -#endif - return 1; - - default: - return 0; - } -} - -size_t get_pixel_size( cl_image_format *format ) -{ - switch( format->image_channel_data_type ) - { - case CL_SNORM_INT8: - case CL_UNORM_INT8: - case CL_SIGNED_INT8: - case CL_UNSIGNED_INT8: - return get_format_channel_count( format ); - - case CL_SNORM_INT16: - case CL_UNORM_INT16: - case CL_SIGNED_INT16: - case CL_UNSIGNED_INT16: - case CL_HALF_FLOAT: -#ifdef CL_SFIXED14_APPLE - case CL_SFIXED14_APPLE: -#endif - return get_format_channel_count( format ) * sizeof( cl_ushort ); - - case CL_SIGNED_INT32: - case CL_UNSIGNED_INT32: - return get_format_channel_count( format ) * sizeof( cl_int ); - - case CL_UNORM_SHORT_565: - case CL_UNORM_SHORT_555: -#ifdef OBSOLETE_FORAMT - case CL_UNORM_SHORT_565_REV: - case CL_UNORM_SHORT_555_REV: -#endif - return 2; - -#ifdef OBSOLETE_FORAMT - case CL_UNORM_INT_8888: - case CL_UNORM_INT_8888_REV: - return 4; -#endif - - case CL_UNORM_INT_101010: -#ifdef OBSOLETE_FORAMT - case CL_UNORM_INT_101010_REV: -#endif - return 4; - - case CL_FLOAT: - return get_format_channel_count( format ) * sizeof( cl_float ); - - default: - return 0; - } -} - -int get_8_bit_image_format( cl_context context, cl_mem_object_type objType, cl_mem_flags flags, size_t channelCount, cl_image_format *outFormat ) -{ - cl_image_format formatList[ 128 ]; - unsigned int outFormatCount, i; - int error; - - - /* Make sure each image format is supported */ - if ((error = clGetSupportedImageFormats( context, flags, objType, 128, formatList, &outFormatCount ))) - return error; - - - /* Look for one that is an 8-bit format */ - for( i = 0; i < outFormatCount; i++ ) - { - if( formatList[ i ].image_channel_data_type == CL_SNORM_INT8 || - formatList[ i ].image_channel_data_type == CL_UNORM_INT8 || - formatList[ i ].image_channel_data_type == CL_SIGNED_INT8 || - formatList[ i ].image_channel_data_type == CL_UNSIGNED_INT8 ) - { - if ( !channelCount || ( channelCount && ( get_format_channel_count( &formatList[ i ] ) == channelCount ) ) ) - { - *outFormat = formatList[ i ]; - return 0; - } - } - } - - return -1; -} - -int get_32_bit_image_format( cl_context context, cl_mem_object_type objType, cl_mem_flags flags, size_t channelCount, cl_image_format *outFormat ) -{ - cl_image_format formatList[ 128 ]; - unsigned int outFormatCount, i; - int error; - - - /* Make sure each image format is supported */ - if ((error = clGetSupportedImageFormats( context, flags, objType, 128, formatList, &outFormatCount ))) - return error; - - /* Look for one that is an 8-bit format */ - for( i = 0; i < outFormatCount; i++ ) - { - if( formatList[ i ].image_channel_data_type == CL_UNORM_INT_101010 || - formatList[ i ].image_channel_data_type == CL_FLOAT || - formatList[ i ].image_channel_data_type == CL_SIGNED_INT32 || - formatList[ i ].image_channel_data_type == CL_UNSIGNED_INT32 ) - { - if ( !channelCount || ( channelCount && ( get_format_channel_count( &formatList[ i ] ) == channelCount ) ) ) - { - *outFormat = formatList[ i ]; - return 0; - } - } - } - - return -1; -} - diff --git a/test_conformance/compatibility/test_common/harness/imageHelpers.h b/test_conformance/compatibility/test_common/harness/imageHelpers.h deleted file mode 100644 index 05b7832f..00000000 --- a/test_conformance/compatibility/test_common/harness/imageHelpers.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef _imageHelpers_h -#define _imageHelpers_h - -#include "errorHelpers.h" - - -extern size_t get_format_type_size( const cl_image_format *format ); -extern size_t get_channel_data_type_size( cl_channel_type channelType ); -extern size_t get_format_channel_count( const cl_image_format *format ); -extern size_t get_channel_order_channel_count( cl_channel_order order ); -extern int is_format_signed( const cl_image_format *format ); -extern size_t get_pixel_size( cl_image_format *format ); - -/* Helper to get any ol image format as long as it is 8-bits-per-channel */ -extern int get_8_bit_image_format( cl_context context, cl_mem_object_type objType, cl_mem_flags flags, size_t channelCount, cl_image_format *outFormat ); - -/* Helper to get any ol image format as long as it is 32-bits-per-channel */ -extern int get_32_bit_image_format( cl_context context, cl_mem_object_type objType, cl_mem_flags flags, size_t channelCount, cl_image_format *outFormat ); - - -#endif // _imageHelpers_h - diff --git a/test_conformance/compatibility/test_common/harness/kernelHelpers.c b/test_conformance/compatibility/test_common/harness/kernelHelpers.c deleted file mode 100644 index 42f41aa4..00000000 --- a/test_conformance/compatibility/test_common/harness/kernelHelpers.c +++ /dev/null @@ -1,684 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "kernelHelpers.h" -#include "errorHelpers.h" -#include "imageHelpers.h" - -#if defined(__MINGW32__) -#include "mingw_compat.h" -#endif - -int create_single_kernel_helper( cl_context context, cl_program *outProgram, cl_kernel *outKernel, unsigned int numKernelLines, const char **kernelProgram, const char *kernelName ) -{ - int error = CL_SUCCESS; - - /* Create the program object from source */ - *outProgram = clCreateProgramWithSource( context, numKernelLines, kernelProgram, NULL, &error ); - if( *outProgram == NULL || error != CL_SUCCESS) - { - print_error( error, "clCreateProgramWithSource failed" ); - return error; - } - - /* Compile the program */ - int buildProgramFailed = 0; - int printedSource = 0; - error = clBuildProgram( *outProgram, 0, NULL, NULL, NULL, NULL ); - if (error != CL_SUCCESS) - { - unsigned int i; - print_error(error, "clBuildProgram failed"); - buildProgramFailed = 1; - printedSource = 1; - log_error( "Original source is: ------------\n" ); - for( i = 0; i < numKernelLines; i++ ) - log_error( "%s", kernelProgram[ i ] ); - } - - // Verify the build status on all devices - cl_uint deviceCount = 0; - error = clGetProgramInfo( *outProgram, CL_PROGRAM_NUM_DEVICES, sizeof( deviceCount ), &deviceCount, NULL ); - if (error != CL_SUCCESS) { - print_error(error, "clGetProgramInfo CL_PROGRAM_NUM_DEVICES failed"); - return error; - } - - if (deviceCount == 0) { - log_error("No devices found for program.\n"); - return -1; - } - - cl_device_id *devices = (cl_device_id*) malloc( deviceCount * sizeof( cl_device_id ) ); - if( NULL == devices ) - return -1; - memset( devices, 0, deviceCount * sizeof( cl_device_id )); - error = clGetProgramInfo( *outProgram, CL_PROGRAM_DEVICES, sizeof( cl_device_id ) * deviceCount, devices, NULL ); - if (error != CL_SUCCESS) { - print_error(error, "clGetProgramInfo CL_PROGRAM_DEVICES failed"); - free( devices ); - return error; - } - - cl_uint z; - for( z = 0; z < deviceCount; z++ ) - { - char deviceName[4096] = ""; - error = clGetDeviceInfo(devices[z], CL_DEVICE_NAME, sizeof( deviceName), deviceName, NULL); - if (error != CL_SUCCESS || deviceName[0] == '\0') { - log_error("Device \"%d\" failed to return a name\n", z); - print_error(error, "clGetDeviceInfo CL_DEVICE_NAME failed"); - } - - cl_build_status buildStatus; - error = clGetProgramBuildInfo(*outProgram, devices[z], CL_PROGRAM_BUILD_STATUS, sizeof(buildStatus), &buildStatus, NULL); - if (error != CL_SUCCESS) { - print_error(error, "clGetProgramBuildInfo CL_PROGRAM_BUILD_STATUS failed"); - free( devices ); - return error; - } - - if (buildStatus != CL_BUILD_SUCCESS || buildProgramFailed) { - char log[10240] = ""; - if (buildStatus == CL_BUILD_SUCCESS && buildProgramFailed) log_error("clBuildProgram returned an error, but buildStatus is marked as CL_BUILD_SUCCESS.\n"); - - char statusString[64] = ""; - if (buildStatus == (cl_build_status)CL_BUILD_SUCCESS) - sprintf(statusString, "CL_BUILD_SUCCESS"); - else if (buildStatus == (cl_build_status)CL_BUILD_NONE) - sprintf(statusString, "CL_BUILD_NONE"); - else if (buildStatus == (cl_build_status)CL_BUILD_ERROR) - sprintf(statusString, "CL_BUILD_ERROR"); - else if (buildStatus == (cl_build_status)CL_BUILD_IN_PROGRESS) - sprintf(statusString, "CL_BUILD_IN_PROGRESS"); - else - sprintf(statusString, "UNKNOWN (%d)", buildStatus); - - if (buildStatus != CL_BUILD_SUCCESS) log_error("Build not successful for device \"%s\", status: %s\n", deviceName, statusString); - error = clGetProgramBuildInfo( *outProgram, devices[z], CL_PROGRAM_BUILD_LOG, sizeof(log), log, NULL ); - if (error != CL_SUCCESS || log[0]=='\0'){ - log_error("Device %d (%s) failed to return a build log\n", z, deviceName); - if (error) { - print_error(error, "clGetProgramBuildInfo CL_PROGRAM_BUILD_LOG failed"); - free( devices ); - return error; - } else { - log_error("clGetProgramBuildInfo returned an empty log.\n"); - free( devices ); - return -1; - } - } - // In this case we've already printed out the code above. - if (!printedSource) - { - unsigned int i; - log_error( "Original source is: ------------\n" ); - for( i = 0; i < numKernelLines; i++ ) - log_error( "%s", kernelProgram[ i ] ); - printedSource = 1; - } - log_error( "Build log for device \"%s\" is: ------------\n", deviceName ); - log_error( "%s\n", log ); - log_error( "\n----------\n" ); - free( devices ); - return -1; - } - } - - /* And create a kernel from it */ - *outKernel = clCreateKernel( *outProgram, kernelName, &error ); - if( *outKernel == NULL || error != CL_SUCCESS) - { - print_error( error, "Unable to create kernel" ); - free( devices ); - return error; - } - - free( devices ); - return 0; -} - -int get_device_version( cl_device_id id, size_t* major, size_t* minor) -{ - cl_char buffer[ 4098 ]; - size_t length; - - // Device version should fit the regex "OpenCL [0-9]+\.[0-9]+ *.*" - cl_int error = clGetDeviceInfo( id, CL_DEVICE_VERSION, sizeof( buffer ), buffer, &length ); - test_error( error, "Unable to get device version string" ); - - char *p1 = (char *)buffer + strlen( "OpenCL " ); - char *p2; - while( *p1 == ' ' ) - p1++; - *major = strtol( p1, &p2, 10 ); - error = *p2 != '.'; - test_error(error, "ERROR: Version number must contain a decimal point!"); - *minor = strtol( ++p2, NULL, 10 ); - return error; -} - -int get_max_allowed_work_group_size( cl_context context, cl_kernel kernel, size_t *outMaxSize, size_t *outLimits ) -{ - cl_device_id *devices; - size_t size, maxCommonSize = 0; - int numDevices, i, j, error; - cl_uint numDims; - size_t outSize; - size_t sizeLimit[]={1,1,1}; - - - /* Assume fewer than 16 devices will be returned */ - error = clGetContextInfo( context, CL_CONTEXT_DEVICES, 0, NULL, &outSize ); - test_error( error, "Unable to obtain list of devices size for context" ); - devices = (cl_device_id *)malloc(outSize); - error = clGetContextInfo( context, CL_CONTEXT_DEVICES, outSize, devices, NULL ); - test_error( error, "Unable to obtain list of devices for context" ); - - numDevices = (int)( outSize / sizeof( cl_device_id ) ); - - for( i = 0; i < numDevices; i++ ) - { - error = clGetDeviceInfo( devices[i], CL_DEVICE_MAX_WORK_GROUP_SIZE, sizeof( size ), &size, NULL ); - test_error( error, "Unable to obtain max work group size for device" ); - if( size < maxCommonSize || maxCommonSize == 0) - maxCommonSize = size; - - error = clGetKernelWorkGroupInfo( kernel, devices[i], CL_KERNEL_WORK_GROUP_SIZE, sizeof( size ), &size, NULL ); - test_error( error, "Unable to obtain max work group size for device and kernel combo" ); - if( size < maxCommonSize || maxCommonSize == 0) - maxCommonSize = size; - - error= clGetDeviceInfo( devices[i], CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, sizeof( numDims ), &numDims, NULL); - test_error( error, "clGetDeviceInfo failed for CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS"); - sizeLimit[0] = 1; - error= clGetDeviceInfo( devices[i], CL_DEVICE_MAX_WORK_ITEM_SIZES, numDims*sizeof(size_t), sizeLimit, NULL); - test_error( error, "clGetDeviceInfo failed for CL_DEVICE_MAX_WORK_ITEM_SIZES"); - - if (outLimits != NULL) - { - if (i == 0) { - for (j=0; j<3; j++) - outLimits[j] = sizeLimit[j]; - } else { - for (j=0; j<(int)numDims; j++) { - if (sizeLimit[j] < outLimits[j]) - outLimits[j] = sizeLimit[j]; - } - } - } - } - free(devices); - - *outMaxSize = (unsigned int)maxCommonSize; - return 0; -} - - -int get_max_common_work_group_size( cl_context context, cl_kernel kernel, - size_t globalThreadSize, size_t *outMaxSize ) -{ - size_t sizeLimit[3]; - int error = get_max_allowed_work_group_size( context, kernel, outMaxSize, sizeLimit ); - if( error != 0 ) - return error; - - /* Now find the largest factor of globalThreadSize that is <= maxCommonSize */ - /* Note for speed, we don't need to check the range of maxCommonSize, b/c once it gets to 1, - the modulo test will succeed and break the loop anyway */ - for( ; ( globalThreadSize % *outMaxSize ) != 0 || (*outMaxSize > sizeLimit[0]); (*outMaxSize)-- ) - ; - return 0; -} - -int get_max_common_2D_work_group_size( cl_context context, cl_kernel kernel, - size_t *globalThreadSizes, size_t *outMaxSizes ) -{ - size_t sizeLimit[3]; - size_t maxSize; - int error = get_max_allowed_work_group_size( context, kernel, &maxSize, sizeLimit ); - if( error != 0 ) - return error; - - /* Now find a set of factors, multiplied together less than maxSize, but each a factor of the global - sizes */ - - /* Simple case */ - if( globalThreadSizes[ 0 ] * globalThreadSizes[ 1 ] <= maxSize ) - { - if (globalThreadSizes[ 0 ] <= sizeLimit[0] && globalThreadSizes[ 1 ] <= sizeLimit[1]) { - outMaxSizes[ 0 ] = globalThreadSizes[ 0 ]; - outMaxSizes[ 1 ] = globalThreadSizes[ 1 ]; - return 0; - } - } - - size_t remainingSize, sizeForThisOne; - remainingSize = maxSize; - int i, j; - for (i=0 ; i<2; i++) { - if (globalThreadSizes[i] > remainingSize) - sizeForThisOne = remainingSize; - else - sizeForThisOne = globalThreadSizes[i]; - for (; (globalThreadSizes[i] % sizeForThisOne) != 0 || (sizeForThisOne > sizeLimit[i]); sizeForThisOne--) ; - outMaxSizes[i] = sizeForThisOne; - remainingSize = maxSize; - for (j=0; j<=i; j++) - remainingSize /=outMaxSizes[j]; - } - - return 0; -} - -int get_max_common_3D_work_group_size( cl_context context, cl_kernel kernel, - size_t *globalThreadSizes, size_t *outMaxSizes ) -{ - size_t sizeLimit[3]; - size_t maxSize; - int error = get_max_allowed_work_group_size( context, kernel, &maxSize, sizeLimit ); - if( error != 0 ) - return error; - /* Now find a set of factors, multiplied together less than maxSize, but each a factor of the global - sizes */ - - /* Simple case */ - if( globalThreadSizes[ 0 ] * globalThreadSizes[ 1 ] * globalThreadSizes[ 2 ] <= maxSize ) - { - if (globalThreadSizes[ 0 ] <= sizeLimit[0] && globalThreadSizes[ 1 ] <= sizeLimit[1] && globalThreadSizes[ 2 ] <= sizeLimit[2]) { - outMaxSizes[ 0 ] = globalThreadSizes[ 0 ]; - outMaxSizes[ 1 ] = globalThreadSizes[ 1 ]; - outMaxSizes[ 2 ] = globalThreadSizes[ 2 ]; - return 0; - } - } - - size_t remainingSize, sizeForThisOne; - remainingSize = maxSize; - int i, j; - for (i=0 ; i<3; i++) { - if (globalThreadSizes[i] > remainingSize) - sizeForThisOne = remainingSize; - else - sizeForThisOne = globalThreadSizes[i]; - for (; (globalThreadSizes[i] % sizeForThisOne) != 0 || (sizeForThisOne > sizeLimit[i]); sizeForThisOne--) ; - outMaxSizes[i] = sizeForThisOne; - remainingSize = maxSize; - for (j=0; j<=i; j++) - remainingSize /=outMaxSizes[j]; - } - - return 0; -} - -/* Helper to determine if an extension is supported by a device */ -int is_extension_available( cl_device_id device, const char *extensionName ) -{ - char *extString; - size_t size = 0; - int err; - int result = 0; - - if(( err = clGetDeviceInfo(device, CL_DEVICE_EXTENSIONS, 0, NULL, &size) )) - { - log_error( "Error: failed to determine size of device extensions string at %s:%d (err = %d)\n", __FILE__, __LINE__, err ); - return 0; - } - - if( 0 == size ) - return 0; - - extString = (char*) malloc( size ); - if( NULL == extString ) - { - log_error( "Error: unable to allocate %ld byte buffer for extension string at %s:%d (err = %d)\n", size, __FILE__, __LINE__, err ); - return 0; - } - - if(( err = clGetDeviceInfo(device, CL_DEVICE_EXTENSIONS, size, extString, NULL) )) - { - log_error( "Error: failed to obtain device extensions string at %s:%d (err = %d)\n", __FILE__, __LINE__, err ); - free( extString ); - return 0; - } - - if( strstr( extString, extensionName ) ) - result = 1; - - free( extString ); - return result; -} - -/* Helper to determine if a device supports an image format */ -int is_image_format_supported( cl_context context, cl_mem_flags flags, cl_mem_object_type image_type, const cl_image_format *fmt ) -{ - cl_image_format *list; - cl_uint count = 0; - cl_int err = clGetSupportedImageFormats( context, flags, image_type, 128, NULL, &count ); - if( count == 0 ) - return 0; - - list = (cl_image_format*) malloc( count * sizeof( cl_image_format ) ); - if( NULL == list ) - { - log_error( "Error: unable to allocate %ld byte buffer for image format list at %s:%d (err = %d)\n", count * sizeof( cl_image_format ), __FILE__, __LINE__, err ); - return 0; - } - - cl_int error = clGetSupportedImageFormats( context, flags, image_type, count, list, NULL ); - if( error ) - { - log_error( "Error: failed to obtain supported image type list at %s:%d (err = %d)\n", __FILE__, __LINE__, err ); - free( list ); - return 0; - } - - // iterate looking for a match. - cl_uint i; - for( i = 0; i < count; i++ ) - { - if( fmt->image_channel_data_type == list[ i ].image_channel_data_type && - fmt->image_channel_order == list[ i ].image_channel_order ) - break; - } - - free( list ); - return ( i < count ) ? true : false; -} - -size_t get_pixel_bytes( const cl_image_format *fmt ); -size_t get_pixel_bytes( const cl_image_format *fmt ) -{ - size_t chanCount; - switch( fmt->image_channel_order ) - { - case CL_R: - case CL_A: - case CL_Rx: - case CL_INTENSITY: - case CL_LUMINANCE: - chanCount = 1; - break; - case CL_RG: - case CL_RA: - case CL_RGx: - chanCount = 2; - break; - case CL_RGB: - case CL_RGBx: - chanCount = 3; - break; - case CL_RGBA: - case CL_ARGB: - case CL_BGRA: -#ifdef CL_1RGB_APPLE - case CL_1RGB_APPLE: -#endif -#ifdef CL_BGR1_APPLE - case CL_BGR1_APPLE: -#endif - chanCount = 4; - break; - default: - log_error("Unknown channel order at %s:%d!\n", __FILE__, __LINE__ ); - abort(); - break; - } - - switch( fmt->image_channel_data_type ) - { - case CL_UNORM_SHORT_565: - case CL_UNORM_SHORT_555: - return 2; - - case CL_UNORM_INT_101010: - return 4; - - case CL_SNORM_INT8: - case CL_UNORM_INT8: - case CL_SIGNED_INT8: - case CL_UNSIGNED_INT8: - return chanCount; - - case CL_SNORM_INT16: - case CL_UNORM_INT16: - case CL_HALF_FLOAT: - case CL_SIGNED_INT16: - case CL_UNSIGNED_INT16: -#ifdef CL_SFIXED14_APPLE - case CL_SFIXED14_APPLE: -#endif - return chanCount * 2; - - case CL_SIGNED_INT32: - case CL_UNSIGNED_INT32: - case CL_FLOAT: - return chanCount * 4; - - default: - log_error("Unknown channel data type at %s:%d!\n", __FILE__, __LINE__ ); - abort(); - } - - return 0; -} - -test_status verifyImageSupport( cl_device_id device ) -{ - if( checkForImageSupport( device ) ) - { - log_error( "ERROR: Device does not supported images as required by this test!\n" ); - return TEST_FAIL; - } - return TEST_PASS; -} - -int checkForImageSupport( cl_device_id device ) -{ - cl_uint i; - int error; - - - /* Check the device props to see if images are supported at all first */ - error = clGetDeviceInfo( device, CL_DEVICE_IMAGE_SUPPORT, sizeof( i ), &i, NULL ); - test_error( error, "Unable to query device for image support" ); - if( i == 0 ) - { - return CL_IMAGE_FORMAT_NOT_SUPPORTED; - } - - /* So our support is good */ - return 0; -} - -int checkFor3DImageSupport( cl_device_id device ) -{ - cl_uint i; - int error; - - /* Check the device props to see if images are supported at all first */ - error = clGetDeviceInfo( device, CL_DEVICE_IMAGE_SUPPORT, sizeof( i ), &i, NULL ); - test_error( error, "Unable to query device for image support" ); - if( i == 0 ) - { - return CL_IMAGE_FORMAT_NOT_SUPPORTED; - } - - char profile[128]; - error = clGetDeviceInfo( device, CL_DEVICE_PROFILE, sizeof(profile ), profile, NULL ); - test_error( error, "Unable to query device for CL_DEVICE_PROFILE" ); - if( 0 == strcmp( profile, "EMBEDDED_PROFILE" ) ) - { - size_t width = -1L; - size_t height = -1L; - size_t depth = -1L; - error = clGetDeviceInfo( device, CL_DEVICE_IMAGE3D_MAX_WIDTH, sizeof(width), &width, NULL ); - test_error( error, "Unable to get CL_DEVICE_IMAGE3D_MAX_WIDTH" ); - error = clGetDeviceInfo( device, CL_DEVICE_IMAGE3D_MAX_HEIGHT, sizeof(height), &height, NULL ); - test_error( error, "Unable to get CL_DEVICE_IMAGE3D_MAX_HEIGHT" ); - error = clGetDeviceInfo( device, CL_DEVICE_IMAGE3D_MAX_DEPTH, sizeof(depth), &depth, NULL ); - test_error( error, "Unable to get CL_DEVICE_IMAGE3D_MAX_DEPTH" ); - - if( 0 == (height | width | depth )) - return CL_IMAGE_FORMAT_NOT_SUPPORTED; - } - - /* So our support is good */ - return 0; -} - -void * align_malloc(size_t size, size_t alignment) -{ -#if defined(_WIN32) && defined(_MSC_VER) - return _aligned_malloc(size, alignment); -#elif defined(__linux__) || defined (linux) || defined(__APPLE__) - void * ptr = NULL; - if (0 == posix_memalign(&ptr, alignment, size)) - return ptr; - return NULL; -#elif defined(__MINGW32__) - return __mingw_aligned_malloc(size, alignment); -#else - #error "Please add support OS for aligned malloc" -#endif -} - -void align_free(void * ptr) -{ -#if defined(_WIN32) && defined(_MSC_VER) - _aligned_free(ptr); -#elif defined(__linux__) || defined (linux) || defined(__APPLE__) - return free(ptr); -#elif defined(__MINGW32__) - return __mingw_aligned_free(ptr); -#else - #error "Please add support OS for aligned free" -#endif -} - -size_t get_min_alignment(cl_context context) -{ - static cl_uint align_size = 0; - - if( 0 == align_size ) - { - cl_device_id * devices; - size_t devices_size = 0; - cl_uint result = 0; - cl_int error; - int i; - - error = clGetContextInfo (context, - CL_CONTEXT_DEVICES, - 0, - NULL, - &devices_size); - test_error_ret(error, "clGetContextInfo failed", 0); - - devices = (cl_device_id*)malloc(devices_size); - if (devices == NULL) { - print_error( error, "malloc failed" ); - return 0; - } - - error = clGetContextInfo (context, - CL_CONTEXT_DEVICES, - devices_size, - (void*)devices, - NULL); - test_error_ret(error, "clGetContextInfo failed", 0); - - for (i = 0; i < (int)(devices_size/sizeof(cl_device_id)); i++) - { - cl_uint alignment = 0; - - error = clGetDeviceInfo (devices[i], - CL_DEVICE_MEM_BASE_ADDR_ALIGN, - sizeof(cl_uint), - (void*)&alignment, - NULL); - - if (error == CL_SUCCESS) - { - alignment >>= 3; // convert bits to bytes - result = (alignment > result) ? alignment : result; - } - else - print_error( error, "clGetDeviceInfo failed" ); - } - - align_size = result; - free(devices); - } - - return align_size; -} - -cl_device_fp_config get_default_rounding_mode( cl_device_id device ) -{ - char profileStr[128] = ""; - cl_device_fp_config single = 0; - int error = clGetDeviceInfo( device, CL_DEVICE_SINGLE_FP_CONFIG, sizeof( single ), &single, NULL ); - if( error ) - test_error_ret( error, "Unable to get device CL_DEVICE_SINGLE_FP_CONFIG", 0 ); - - if( single & CL_FP_ROUND_TO_NEAREST ) - return CL_FP_ROUND_TO_NEAREST; - - if( 0 == (single & CL_FP_ROUND_TO_ZERO) ) - test_error_ret( -1, "FAILURE: device must support either CL_DEVICE_SINGLE_FP_CONFIG or CL_FP_ROUND_TO_NEAREST", 0 ); - - // Make sure we are an embedded device before allowing a pass - if( (error = clGetDeviceInfo( device, CL_DEVICE_PROFILE, sizeof( profileStr ), &profileStr, NULL ) )) - test_error_ret( error, "FAILURE: Unable to get CL_DEVICE_PROFILE", 0 ); - - if( strcmp( profileStr, "EMBEDDED_PROFILE" ) ) - test_error_ret( error, "FAILURE: non-EMBEDDED_PROFILE devices must support CL_FP_ROUND_TO_NEAREST", 0 ); - - return CL_FP_ROUND_TO_ZERO; -} - -int checkDeviceForQueueSupport( cl_device_id device, cl_command_queue_properties prop ) -{ - cl_command_queue_properties realProps; - cl_int error = clGetDeviceInfo( device, CL_DEVICE_QUEUE_PROPERTIES, sizeof( realProps ), &realProps, NULL ); - test_error_ret( error, "FAILURE: Unable to get device queue properties", 0 ); - - return ( realProps & prop ) ? 1 : 0; -} - -int printDeviceHeader( cl_device_id device ) -{ - char deviceName[ 512 ], deviceVendor[ 512 ], deviceVersion[ 512 ], cLangVersion[ 512 ]; - int error; - - error = clGetDeviceInfo( device, CL_DEVICE_NAME, sizeof( deviceName ), deviceName, NULL ); - test_error( error, "Unable to get CL_DEVICE_NAME for device" ); - - error = clGetDeviceInfo( device, CL_DEVICE_VENDOR, sizeof( deviceVendor ), deviceVendor, NULL ); - test_error( error, "Unable to get CL_DEVICE_VENDOR for device" ); - - error = clGetDeviceInfo( device, CL_DEVICE_VERSION, sizeof( deviceVersion ), deviceVersion, NULL ); - test_error( error, "Unable to get CL_DEVICE_VERSION for device" ); - - error = clGetDeviceInfo( device, CL_DEVICE_OPENCL_C_VERSION, sizeof( cLangVersion ), cLangVersion, NULL ); - test_error( error, "Unable to get CL_DEVICE_OPENCL_C_VERSION for device" ); - - log_info("Compute Device Name = %s, Compute Device Vendor = %s, Compute Device Version = %s%s%s\n", - deviceName, deviceVendor, deviceVersion, ( error == CL_SUCCESS ) ? ", CL C Version = " : "", - ( error == CL_SUCCESS ) ? cLangVersion : "" ); - - return CL_SUCCESS; -} diff --git a/test_conformance/compatibility/test_common/harness/kernelHelpers.h b/test_conformance/compatibility/test_common/harness/kernelHelpers.h deleted file mode 100644 index 09515e28..00000000 --- a/test_conformance/compatibility/test_common/harness/kernelHelpers.h +++ /dev/null @@ -1,129 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef _kernelHelpers_h -#define _kernelHelpers_h - -#include "compat.h" -#include "testHarness.h" - -#include -#include - -#if defined (__MINGW32__) -#include -#endif - -#include - -#ifdef __APPLE__ - #include -#else - #include -#endif - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -/* - * The below code is intended to be used at the top of kernels that appear inline in files to set line and file info for the kernel: - * - * const char *source = { - * INIT_OPENCL_DEBUG_INFO - * "__kernel void foo( int x )\n" - * "{\n" - * " ...\n" - * "}\n" - * }; - */ -#define INIT_OPENCL_DEBUG_INFO SET_OPENCL_LINE_INFO( __LINE__, __FILE__ ) -#define SET_OPENCL_LINE_INFO(_line, _file) "#line " STRINGIFY(_line) " " STRINGIFY(_file) "\n" -#ifndef STRINGIFY_VALUE - #define STRINGIFY_VALUE(_x) STRINGIFY(_x) -#endif -#ifndef STRINGIFY - #define STRINGIFY(_x) #_x -#endif - -/* Helper that creates a single program and kernel from a single-kernel program source */ -extern int create_single_kernel_helper( cl_context context, cl_program *outProgram, cl_kernel *outKernel, unsigned int numKernelLines, const char **kernelProgram, const char *kernelName ); - -/* Helper to obtain the biggest fit work group size for all the devices in a given group and for the given global thread size */ -extern int get_max_common_work_group_size( cl_context context, cl_kernel kernel, size_t globalThreadSize, size_t *outSize ); - -/* Helper to obtain the biggest fit work group size for all the devices in a given group and for the given global thread size */ -extern int get_max_common_2D_work_group_size( cl_context context, cl_kernel kernel, size_t *globalThreadSize, size_t *outSizes ); - -/* Helper to obtain the biggest fit work group size for all the devices in a given group and for the given global thread size */ -extern int get_max_common_3D_work_group_size( cl_context context, cl_kernel kernel, size_t *globalThreadSize, size_t *outSizes ); - -/* Helper to get major/minor number for a device */ -extern int get_device_version( cl_device_id id, size_t* major, size_t* minor); - -/* Helper to obtain the biggest allowed work group size for all the devices in a given group */ -extern int get_max_allowed_work_group_size( cl_context context, cl_kernel kernel, size_t *outSize, size_t *outLimits ); - -/* Helper to determine if an extension is supported by a device */ -extern int is_extension_available( cl_device_id device, const char *extensionName ); - -/* Helper to determine if a device supports an image format */ -extern int is_image_format_supported( cl_context context, cl_mem_flags flags, cl_mem_object_type image_type, const cl_image_format *fmt ); - -/* Helper to get pixel size for a pixel format */ -size_t get_pixel_bytes( const cl_image_format *fmt ); - -/* Verify the given device supports images. */ -extern test_status verifyImageSupport( cl_device_id device ); - -/* Checks that the given device supports images. Same as verify, but doesn't print an error */ -extern int checkForImageSupport( cl_device_id device ); -extern int checkFor3DImageSupport( cl_device_id device ); - -/* Checks that a given queue property is supported on the specified device. Returns 1 if supported, 0 if not or an error. */ -extern int checkDeviceForQueueSupport( cl_device_id device, cl_command_queue_properties prop ); - -/* Helper for aligned memory allocation */ -void * align_malloc(size_t size, size_t alignment); -void align_free(void *); - -/* Helper to obtain the min alignment for a given context, i.e the max of all min alignments for devices attached to the context*/ -size_t get_min_alignment(cl_context context); - -/* Helper to obtain the default rounding mode for single precision computation. (Double is always CL_FP_ROUND_TO_NEAREST.) Returns 0 on error. */ -cl_device_fp_config get_default_rounding_mode( cl_device_id device ); - -#define PASSIVE_REQUIRE_IMAGE_SUPPORT( device ) \ - if( checkForImageSupport( device ) ) \ - { \ - log_info( "\n\tNote: device does not support images. Skipping test...\n" ); \ - return 0; \ - } - -#define PASSIVE_REQUIRE_3D_IMAGE_SUPPORT( device ) \ - if( checkFor3DImageSupport( device ) ) \ - { \ - log_info( "\n\tNote: device does not support 3D images. Skipping test...\n" ); \ - return 0; \ - } - -/* Prints out the standard device header for all tests given the device to print for */ -extern int printDeviceHeader( cl_device_id device ); - -#ifdef __cplusplus -} -#endif // __cplusplus - -#endif // _kernelHelpers_h diff --git a/test_conformance/compatibility/test_common/harness/mingw_compat.c b/test_conformance/compatibility/test_common/harness/mingw_compat.c deleted file mode 100644 index 54c44635..00000000 --- a/test_conformance/compatibility/test_common/harness/mingw_compat.c +++ /dev/null @@ -1,59 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#if defined(__MINGW32__) - -#include "mingw_compat.h" -#include -#include - -//This function is unavailable on various mingw compilers, -//especially 64 bit so implementing it here -const char *basename_dot="."; -char* -basename(char *path) -{ - char *p = path, *b = NULL; - int len = strlen(path); - - if (path == NULL) { - return (char*)basename_dot; - } - - // Not absolute path on windows - if (path[1] != ':') { - return path; - } - - // Trim trailing path seperators - if (path[len - 1] == '\\' || - path[len - 1] == '/' ) { - len--; - path[len] = '\0'; - } - - while (len) { - while((*p != '\\' || *p != '/') && len) { - p++; - len--; - } - p++; - b = p; - } - - return b; -} - -#endif \ No newline at end of file diff --git a/test_conformance/compatibility/test_common/harness/mingw_compat.h b/test_conformance/compatibility/test_common/harness/mingw_compat.h deleted file mode 100644 index ab28f398..00000000 --- a/test_conformance/compatibility/test_common/harness/mingw_compat.h +++ /dev/null @@ -1,31 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef MINGW_COMPAT_H -#define MINGW_COMPAT_H - -#if defined(__MINGW32__) -char *basename(char *path); -#include - -#if defined(__MINGW64__) -//mingw-w64 doesnot have __mingw_aligned_malloc, instead it has _aligned_malloc -#define __mingw_aligned_malloc _aligned_malloc -#define __mingw_aligned_free _aligned_free -#include -#endif //(__MINGW64__) - -#endif //(__MINGW32__) -#endif // MINGW_COMPAT_H diff --git a/test_conformance/compatibility/test_common/harness/msvc9.c b/test_conformance/compatibility/test_common/harness/msvc9.c deleted file mode 100644 index cf32b673..00000000 --- a/test_conformance/compatibility/test_common/harness/msvc9.c +++ /dev/null @@ -1,773 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "compat.h" - -#if defined ( _MSC_VER ) - -#include -#include - -#include - -#include - -#if ! defined( __INTEL_COMPILER ) - -/////////////////////////////////////////////////////////////////// -// -// rint, rintf -// -/////////////////////////////////////////////////////////////////// - -float copysignf( float x, float y ) -{ - union{ cl_uint u; float f; }ux, uy; - - ux.f = x; - uy.f = y; - - ux.u = (ux.u & 0x7fffffffU) | (uy.u & 0x80000000U); - - return ux.f; -} - -double copysign( double x, double y ) -{ - union{ cl_ulong u; double f; }ux, uy; - - ux.f = x; - uy.f = y; - - ux.u = (ux.u & 0x7fffffffffffffffULL) | (uy.u & 0x8000000000000000ULL); - - return ux.f; -} - -long double copysignl( long double x, long double y ) -{ - union - { - long double f; - struct{ cl_ulong m; cl_ushort sexp; }u; - }ux, uy; - - ux.f = x; - uy.f = y; - - ux.u.sexp = (ux.u.sexp & 0x7fff) | (uy.u.sexp & 0x8000); - - return ux.f; -} - -float rintf(float x) -{ - float absx = fabsf(x); - - if( absx < 8388608.0f /* 0x1.0p23f */ ) - { - float magic = copysignf( 8388608.0f /* 0x1.0p23f */, x ); - float rounded = x + magic; - rounded -= magic; - x = copysignf( rounded, x ); - } - - return x; -} - -double rint(double x) -{ - double absx = fabs(x); - - if( absx < 4503599627370496.0 /* 0x1.0p52f */ ) - { - double magic = copysign( 4503599627370496.0 /* 0x1.0p52 */, x ); - double rounded = x + magic; - rounded -= magic; - x = copysign( rounded, x ); - } - - return x; -} - -long double rintl(long double x) -{ - double absx = fabs(x); - - if( absx < 9223372036854775808.0L /* 0x1.0p64f */ ) - { - long double magic = copysignl( 9223372036854775808.0L /* 0x1.0p63L */, x ); - long double rounded = x + magic; - rounded -= magic; - x = copysignl( rounded, x ); - } - - return x; -} - - -/////////////////////////////////////////////////////////////////// -// -// ilogb, ilogbf, ilogbl -// -/////////////////////////////////////////////////////////////////// -#ifndef FP_ILOGB0 - #define FP_ILOGB0 INT_MIN -#endif - -#ifndef FP_ILOGBNAN - #define FP_ILOGBNAN INT_MIN -#endif - -int ilogb (double x) -{ - union{ double f; cl_ulong u;} u; - u.f = x; - - cl_ulong absx = u.u & CL_LONG_MAX; - if( absx - 0x0001000000000000ULL >= 0x7ff0000000000000ULL - 0x0001000000000000ULL) - { - switch( absx ) - { - case 0: - return FP_ILOGB0; - case 0x7ff0000000000000ULL: - return INT_MAX; - default: - if( absx > 0x7ff0000000000000ULL ) - return FP_ILOGBNAN; - - // subnormal - u.u = absx | 0x3ff0000000000000ULL; - u.f -= 1.0; - return (u.u >> 52) - (1023 + 1022); - } - } - - return (absx >> 52) - 1023; -} - - -int ilogbf (float x) -{ - union{ float f; cl_uint u;} u; - u.f = x; - - cl_uint absx = u.u & 0x7fffffff; - if( absx - 0x00800000U >= 0x7f800000U - 0x00800000U) - { - switch( absx ) - { - case 0: - return FP_ILOGB0; - case 0x7f800000U: - return INT_MAX; - default: - if( absx > 0x7f800000 ) - return FP_ILOGBNAN; - - // subnormal - u.u = absx | 0x3f800000U; - u.f -= 1.0f; - return (u.u >> 23) - (127 + 126); - } - } - - return (absx >> 23) - 127; -} - -int ilogbl (long double x) -{ - union - { - long double f; - struct{ cl_ulong m; cl_ushort sexp; }u; - } u; - u.f = x; - - int exp = u.u.sexp & 0x7fff; - if( 0 == exp ) - { - if( 0 == u.u.m ) - return FP_ILOGB0; - - //subnormal - u.u.sexp = 0x3fff; - u.f -= 1.0f; - exp = u.u.sexp & 0x7fff; - - return exp - (0x3fff + 0x3ffe); - } - else if( 0x7fff == exp ) - { - if( u.u.m & CL_LONG_MAX ) - return FP_ILOGBNAN; - - return INT_MAX; - } - - return exp - 0x3fff; -} - - - -/////////////////////////////////////////////////////////////////// -// -// fmax, fmin, fmaxf, fminf -// -/////////////////////////////////////////////////////////////////// - -static void GET_BITS_SP32(float fx, unsigned int* ux) -{ - volatile union {float f; unsigned int u;} _bitsy; - _bitsy.f = (fx); - *ux = _bitsy.u; -} -/* static void GET_BITS_SP32(float fx, unsigned int* ux) */ -/* { */ -/* volatile union {float f; unsigned int i;} _bitsy; */ -/* _bitsy.f = (fx); */ -/* *ux = _bitsy.i; */ -/* } */ -static void PUT_BITS_SP32(unsigned int ux, float* fx) -{ - volatile union {float f; unsigned int u;} _bitsy; - _bitsy.u = (ux); - *fx = _bitsy.f; -} -/* static void PUT_BITS_SP32(unsigned int ux, float* fx) */ -/* { */ -/* volatile union {float f; unsigned int i;} _bitsy; */ -/* _bitsy.i = (ux); */ -/* *fx = _bitsy.f; */ -/* } */ -static void GET_BITS_DP64(double dx, unsigned __int64* lx) -{ - volatile union {double d; unsigned __int64 l;} _bitsy; - _bitsy.d = (dx); - *lx = _bitsy.l; -} -static void PUT_BITS_DP64(unsigned __int64 lx, double* dx) -{ - volatile union {double d; unsigned __int64 l;} _bitsy; - _bitsy.l = (lx); - *dx = _bitsy.d; -} - -#if 0 -int SIGNBIT_DP64(double x ) -{ - int hx; - _GET_HIGH_WORD(hx,x); - return((hx>>31)); -} -#endif - -/* fmax(x, y) returns the larger (more positive) of x and y. - NaNs are treated as missing values: if one argument is NaN, - the other argument is returned. If both arguments are NaN, - the first argument is returned. */ - -/* This works so long as the compiler knows that (x != x) means - that x is NaN; gcc does. */ -double fmax(double x, double y) -{ - if( isnan(y) ) - return x; - - return x >= y ? x : y; -} - - -/* fmin(x, y) returns the smaller (more negative) of x and y. - NaNs are treated as missing values: if one argument is NaN, - the other argument is returned. If both arguments are NaN, - the first argument is returned. */ - -double fmin(double x, double y) -{ - if( isnan(y) ) - return x; - - return x <= y ? x : y; -} - - -float fmaxf( float x, float y ) -{ - if( isnan(y) ) - return x; - - return x >= y ? x : y; -} - -/* fminf(x, y) returns the smaller (more negative) of x and y. - NaNs are treated as missing values: if one argument is NaN, - the other argument is returned. If both arguments are NaN, - the first argument is returned. */ - -float fminf(float x, float y) -{ - if( isnan(y) ) - return x; - - return x <= y ? x : y; -} - -long double scalblnl(long double x, long n) -{ - union - { - long double d; - struct{ cl_ulong m; cl_ushort sexp;}u; - }u; - u.u.m = CL_LONG_MIN; - - if( x == 0.0L || n < -2200) - return copysignl( 0.0L, x ); - - if( n > 2200 ) - return INFINITY; - - if( n < 0 ) - { - u.u.sexp = 0x3fff - 1022; - while( n <= -1022 ) - { - x *= u.d; - n += 1022; - } - u.u.sexp = 0x3fff + n; - x *= u.d; - return x; - } - - if( n > 0 ) - { - u.u.sexp = 0x3fff + 1023; - while( n >= 1023 ) - { - x *= u.d; - n -= 1023; - } - u.u.sexp = 0x3fff + n; - x *= u.d; - return x; - } - - return x; -} - -/////////////////////////////////////////////////////////////////// -// -// log2 -// -/////////////////////////////////////////////////////////////////// -const static cl_double log_e_base2 = 1.4426950408889634074; -const static cl_double log_10_base2 = 3.3219280948873623478; - -//double log10(double x); - -double log2(double x) -{ - return 1.44269504088896340735992468100189214 * log(x); -} - -long double log2l(long double x) -{ - return 1.44269504088896340735992468100189214L * log(x); -} - -double trunc(double x) -{ - double absx = fabs(x); - - if( absx < 4503599627370496.0 /* 0x1.0p52f */ ) - { - cl_long rounded = x; - x = copysign( (double) rounded, x ); - } - - return x; -} - -float truncf(float x) -{ - float absx = fabsf(x); - - if( absx < 8388608.0f /* 0x1.0p23f */ ) - { - cl_int rounded = x; - x = copysignf( (float) rounded, x ); - } - - return x; -} - -long lround(double x) -{ - double absx = fabs(x); - - if( absx < 0.5 ) - return 0; - - if( absx < 4503599627370496.0 /* 0x1.0p52 */) - { - absx += 0.5; - cl_long rounded = absx; - absx = rounded; - x = copysign( absx, x ); - } - - if( x >= (double) LONG_MAX ) - return LONG_MAX; - - return (long) x; -} - -long lroundf(float x) -{ - float absx = fabsf(x); - - if( absx < 0.5f ) - return 0; - - if( absx < 8388608.0f ) - { - absx += 0.5f; - cl_int rounded = absx; - absx = rounded; - x = copysignf( absx, x ); - } - - if( x >= (float) LONG_MAX ) - return LONG_MAX; - - return (long) x; -} - -double round(double x) -{ - double absx = fabs(x); - - if( absx < 0.5 ) - return copysign( 0.0, x); - - if( absx < 4503599627370496.0 /* 0x1.0p52 */) - { - absx += 0.5; - cl_long rounded = absx; - absx = rounded; - x = copysign( absx, x ); - } - - return x; -} - -float roundf(float x) -{ - float absx = fabsf(x); - - if( absx < 0.5f ) - return copysignf( 0.0f, x); - - if( absx < 8388608.0f ) - { - absx += 0.5f; - cl_int rounded = absx; - absx = rounded; - x = copysignf( absx, x ); - } - - return x; -} - -long double roundl(long double x) -{ - long double absx = fabsl(x); - - if( absx < 0.5L ) - return copysignl( 0.0L, x); - - if( absx < 9223372036854775808.0L /*0x1.0p63L*/ ) - { - absx += 0.5L; - cl_ulong rounded = absx; - absx = rounded; - x = copysignl( absx, x ); - } - - return x; -} - -float cbrtf( float x ) -{ - float z = pow( fabs((double) x), 1.0 / 3.0 ); - return copysignf( z, x ); -} - -double cbrt( double x ) -{ - return copysign( pow( fabs( x ), 1.0 / 3.0 ), x ); -} - -long int lrint (double x) -{ - double absx = fabs(x); - - if( x >= (double) LONG_MAX ) - return LONG_MAX; - - if( absx < 4503599627370496.0 /* 0x1.0p52 */ ) - { - double magic = copysign( 4503599627370496.0 /* 0x1.0p52 */, x ); - double rounded = x + magic; - rounded -= magic; - return (long int) rounded; - } - - return (long int) x; -} - -long int lrintf (float x) -{ - float absx = fabsf(x); - - if( x >= (float) LONG_MAX ) - return LONG_MAX; - - if( absx < 8388608.0f /* 0x1.0p23f */ ) - { - float magic = copysignf( 8388608.0f /* 0x1.0p23f */, x ); - float rounded = x + magic; - rounded -= magic; - return (long int) rounded; - } - - return (long int) x; -} - - -/////////////////////////////////////////////////////////////////// -// -// fenv functions -// -/////////////////////////////////////////////////////////////////// -#if _MSC_VER < 1900 -int fetestexcept(int excepts) -{ - unsigned int status = _statusfp(); - return excepts & ( - ((status & _SW_INEXACT) ? FE_INEXACT : 0) | - ((status & _SW_UNDERFLOW) ? FE_UNDERFLOW : 0) | - ((status & _SW_OVERFLOW) ? FE_OVERFLOW : 0) | - ((status & _SW_ZERODIVIDE) ? FE_DIVBYZERO : 0) | - ((status & _SW_INVALID) ? FE_INVALID : 0) - ); -} - -int feclearexcept(int excepts) -{ - _clearfp(); - return 0; -} -#endif - -#endif // __INTEL_COMPILER - -#if ! defined( __INTEL_COMPILER ) || __INTEL_COMPILER < 1300 - -float make_nan() -{ -/* This is the IEEE 754 single-precision format: - unsigned int mantissa: 22; - unsigned int quiet_nan: 1; - unsigned int exponent: 8; - unsigned int negative: 1; -*/ - //const static unsigned - static const int32_t _nan = 0x7fc00000; - return *(const float*)(&_nan); -} - -float nanf( const char* str) -{ - cl_uint u = atoi( str ); - u |= 0x7fc00000U; - return *( float*)(&u); -} - - -double nan( const char* str) -{ - cl_ulong u = atoi( str ); - u |= 0x7ff8000000000000ULL; - return *( double*)(&u); -} - -// double check this implementatation -long double nanl( const char* str) -{ - union - { - long double f; - struct { cl_ulong m; cl_ushort sexp; }u; - }u; - u.u.sexp = 0x7fff; - u.u.m = 0x8000000000000000ULL | atoi( str ); - - return u.f; -} - -#endif - -/////////////////////////////////////////////////////////////////// -// -// misc functions -// -/////////////////////////////////////////////////////////////////// - -/* -// This function is commented out because the Windows implementation should never call munmap. -// If it is calling it, we have a bug. Please file a bugzilla. -int munmap(void *addr, size_t len) -{ -// FIXME: this is not correct. munmap is like free() http://www.opengroup.org/onlinepubs/7990989775/xsh/munmap.html - - return (int)VirtualAlloc( (LPVOID)addr, len, - MEM_COMMIT|MEM_RESERVE, PAGE_NOACCESS ); -} -*/ - -uint64_t ReadTime( void ) -{ - LARGE_INTEGER current; - QueryPerformanceCounter(¤t); - return (uint64_t)current.QuadPart; -} - -double SubtractTime( uint64_t endTime, uint64_t startTime ) -{ - static double PerformanceFrequency = 0.0; - - if (PerformanceFrequency == 0.0) { - LARGE_INTEGER frequency; - QueryPerformanceFrequency(&frequency); - PerformanceFrequency = (double) frequency.QuadPart; - } - - return (double)(endTime - startTime) / PerformanceFrequency * 1e9; -} - -int cf_signbit(double x) -{ - union - { - double f; - cl_ulong u; - }u; - u.f = x; - return u.u >> 63; -} - -int cf_signbitf(float x) -{ - union - { - float f; - cl_uint u; - }u; - u.f = x; - return u.u >> 31; -} - -float int2float (int32_t ix) -{ - union { - float f; - int32_t i; - } u; - u.i = ix; - return u.f; -} - -int32_t float2int (float fx) -{ - union { - float f; - int32_t i; - } u; - u.f = fx; - return u.i; -} - -#if !defined(_WIN64) -/** Returns the number of leading 0-bits in x, - starting at the most significant bit position. - If x is 0, the result is undefined. -*/ -int __builtin_clz(unsigned int pattern) -{ -#if 0 - int res; - __asm { - mov eax, pattern - bsr eax, eax - mov res, eax - } - return 31 - res; -#endif - unsigned long index; - unsigned char res = _BitScanReverse( &index, pattern); - if (res) { - return 8*sizeof(int) - 1 - index; - } else { - return 8*sizeof(int); - } -} -#else -int __builtin_clz(unsigned int pattern) -{ - int count; - if (pattern == 0u) { - return 32; - } - count = 31; - if (pattern >= 1u<<16) { pattern >>= 16; count -= 16; } - if (pattern >= 1u<<8) { pattern >>= 8; count -= 8; } - if (pattern >= 1u<<4) { pattern >>= 4; count -= 4; } - if (pattern >= 1u<<2) { pattern >>= 2; count -= 2; } - if (pattern >= 1u<<1) { count -= 1; } - return count; -} - -#endif // !defined(_WIN64) - -#include -#include - -int usleep(int usec) -{ - Sleep((usec + 999) / 1000); - return 0; -} - -unsigned int sleep( unsigned int sec ) -{ - Sleep( sec * 1000 ); - return 0; -} - -#endif // defined( _MSC_VER ) diff --git a/test_conformance/compatibility/test_common/harness/mt19937.h b/test_conformance/compatibility/test_common/harness/mt19937.h deleted file mode 100644 index d05beed1..00000000 --- a/test_conformance/compatibility/test_common/harness/mt19937.h +++ /dev/null @@ -1,99 +0,0 @@ - -/* - * mt19937.h - * - * Mersenne Twister. - * - A C-program for MT19937, with initialization improved 2002/1/26. - Coded by Takuji Nishimura and Makoto Matsumoto. - - Before using, initialize the state by using init_genrand(seed) - or init_by_array(init_key, key_length). - - Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. 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. - - 3. The names of its contributors may not 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. - - - Any feedback is very welcome. - http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html - email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space) - */ - -#ifndef MT19937_H -#define MT19937_H 1 - -#if defined( __APPLE__ ) - #include -#else - #include -#endif - -#ifdef __cplusplus - extern "C" { -#endif - -/* - * Interfaces here have been modified from original sources so that they - * are safe to call reentrantly, so long as a different MTdata is used - * on each thread. - */ - -typedef struct _MTdata *MTdata; - -/* Create the random number generator with seed */ -MTdata init_genrand( cl_uint /*seed*/ ); - -/* release memory used by a MTdata private data */ -void free_mtdata( MTdata /*data*/ ); - -/* generates a random number on [0,0xffffffff]-interval */ -cl_uint genrand_int32( MTdata /*data*/); - -/* generates a random number on [0,0xffffffffffffffffULL]-interval */ -cl_ulong genrand_int64( MTdata /*data*/); - -/* generates a random number on [0,1]-real-interval */ -double genrand_real1( MTdata /*data*/); - -/* generates a random number on [0,1)-real-interval */ -double genrand_real2( MTdata /*data*/); - -/* generates a random number on (0,1)-real-interval */ -double genrand_real3( MTdata /*data*/); - -/* generates a random number on [0,1) with 53-bit resolution*/ -double genrand_res53( MTdata /*data*/ ); - - -#ifdef __cplusplus - } -#endif - -#endif /* MT19937_H */ diff --git a/test_conformance/compatibility/test_common/harness/ref_counting.h b/test_conformance/compatibility/test_common/harness/ref_counting.h deleted file mode 100644 index 1a2aceee..00000000 --- a/test_conformance/compatibility/test_common/harness/ref_counting.h +++ /dev/null @@ -1,49 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef _ref_counting_h -#define _ref_counting_h - -#define MARK_REF_COUNT_BASE( c, type, bigType ) \ - cl_uint c##_refCount; \ - error = clGet##type##Info( c, CL_##bigType##_REFERENCE_COUNT, sizeof( c##_refCount ), &c##_refCount, NULL ); \ - test_error( error, "Unable to check reference count for " #type ); - -#define TEST_REF_COUNT_BASE( c, type, bigType ) \ - cl_uint c##_refCount_new; \ - error = clGet##type##Info( c, CL_##bigType##_REFERENCE_COUNT, sizeof( c##_refCount_new ), &c##_refCount_new, NULL ); \ - test_error( error, "Unable to check reference count for " #type ); \ - if( c##_refCount != c##_refCount_new ) \ - { \ - log_error( "ERROR: Reference count for " #type " changed! (was %d, now %d)\n", c##_refCount, c##_refCount_new ); \ - return -1; \ - } - -#define MARK_REF_COUNT_CONTEXT( c ) MARK_REF_COUNT_BASE( c, Context, CONTEXT ) -#define TEST_REF_COUNT_CONTEXT( c ) TEST_REF_COUNT_BASE( c, Context, CONTEXT ) - -#define MARK_REF_COUNT_DEVICE( c ) MARK_REF_COUNT_BASE( c, Device, DEVICE ) -#define TEST_REF_COUNT_DEVICE( c ) TEST_REF_COUNT_BASE( c, Device, DEVICE ) - -#define MARK_REF_COUNT_QUEUE( c ) MARK_REF_COUNT_BASE( c, CommandQueue, QUEUE ) -#define TEST_REF_COUNT_QUEUE( c ) TEST_REF_COUNT_BASE( c, CommandQueue, QUEUE ) - -#define MARK_REF_COUNT_PROGRAM( c ) MARK_REF_COUNT_BASE( c, Program, PROGRAM ) -#define TEST_REF_COUNT_PROGRAM( c ) TEST_REF_COUNT_BASE( c, Program, PROGRAM ) - -#define MARK_REF_COUNT_MEM( c ) MARK_REF_COUNT_BASE( c, MemObject, MEM ) -#define TEST_REF_COUNT_MEM( c ) TEST_REF_COUNT_BASE( c, MemObject, MEM ) - -#endif // _ref_counting_h diff --git a/test_conformance/compatibility/test_common/harness/rounding_mode.c b/test_conformance/compatibility/test_common/harness/rounding_mode.c deleted file mode 100644 index f77da958..00000000 --- a/test_conformance/compatibility/test_common/harness/rounding_mode.c +++ /dev/null @@ -1,175 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "rounding_mode.h" - -#if !(defined(_WIN32) && defined(_MSC_VER)) -RoundingMode set_round( RoundingMode r, Type outType ) -{ - static const int flt_rounds[ kRoundingModeCount ] = { FE_TONEAREST, FE_TONEAREST, FE_UPWARD, FE_DOWNWARD, FE_TOWARDZERO }; - static const int int_rounds[ kRoundingModeCount ] = { FE_TOWARDZERO, FE_TONEAREST, FE_UPWARD, FE_DOWNWARD, FE_TOWARDZERO }; - const int *p = int_rounds; - if( outType == kfloat || outType == kdouble ) - p = flt_rounds; - int oldRound = fegetround(); - fesetround( p[r] ); - - switch( oldRound ) - { - case FE_TONEAREST: - return kRoundToNearestEven; - case FE_UPWARD: - return kRoundUp; - case FE_DOWNWARD: - return kRoundDown; - case FE_TOWARDZERO: - return kRoundTowardZero; - default: - abort(); // ??! - } - return kDefaultRoundingMode; //never happens -} - -RoundingMode get_round( void ) -{ - int oldRound = fegetround(); - - switch( oldRound ) - { - case FE_TONEAREST: - return kRoundToNearestEven; - case FE_UPWARD: - return kRoundUp; - case FE_DOWNWARD: - return kRoundDown; - case FE_TOWARDZERO: - return kRoundTowardZero; - } - - return kDefaultRoundingMode; -} - -#else -RoundingMode set_round( RoundingMode r, Type outType ) -{ - static const int flt_rounds[ kRoundingModeCount ] = { _RC_NEAR, _RC_NEAR, _RC_UP, _RC_DOWN, _RC_CHOP }; - static const int int_rounds[ kRoundingModeCount ] = { _RC_CHOP, _RC_NEAR, _RC_UP, _RC_DOWN, _RC_CHOP }; - const int *p = ( outType == kfloat || outType == kdouble )? flt_rounds : int_rounds; - unsigned int oldRound; - - int err = _controlfp_s(&oldRound, 0, 0); //get rounding mode into oldRound - if (err) { - vlog_error("\t\tERROR: -- cannot get rounding mode in %s:%d\n", __FILE__, __LINE__); - return kDefaultRoundingMode; //what else never happens - } - - oldRound &= _MCW_RC; - - RoundingMode old = - (oldRound == _RC_NEAR)? kRoundToNearestEven : - (oldRound == _RC_UP)? kRoundUp : - (oldRound == _RC_DOWN)? kRoundDown : - (oldRound == _RC_CHOP)? kRoundTowardZero: - kDefaultRoundingMode; - - _controlfp_s(&oldRound, p[r], _MCW_RC); //setting new rounding mode - return old; //returning old rounding mode -} - -RoundingMode get_round( void ) -{ - unsigned int oldRound; - - int err = _controlfp_s(&oldRound, 0, 0); //get rounding mode into oldRound - oldRound &= _MCW_RC; - return - (oldRound == _RC_NEAR)? kRoundToNearestEven : - (oldRound == _RC_UP)? kRoundUp : - (oldRound == _RC_DOWN)? kRoundDown : - (oldRound == _RC_CHOP)? kRoundTowardZero: - kDefaultRoundingMode; -} - -#endif - -// -// FlushToZero() sets the host processor into ftz mode. It is intended to have a remote effect on the behavior of the code in -// basic_test_conversions.c. Some host processors may not support this mode, which case you'll need to do some clamping in -// software by testing against FLT_MIN or DBL_MIN in that file. -// -// Note: IEEE-754 says conversions are basic operations. As such they do *NOT* have the behavior in section 7.5.3 of -// the OpenCL spec. They *ALWAYS* flush to zero for subnormal inputs or outputs when FTZ mode is on like other basic -// operators do (e.g. add, subtract, multiply, divide, etc.) -// -// Configuring hardware to FTZ mode varies by platform. -// CAUTION: Some C implementations may also fail to behave properly in this mode. -// -// On PowerPC, it is done by setting the FPSCR into non-IEEE mode. -// On Intel, you can do this by turning on the FZ and DAZ bits in the MXCSR -- provided that SSE/SSE2 -// is used for floating point computation! If your OS uses x87, you'll need to figure out how -// to turn that off for the conversions code in basic_test_conversions.c so that they flush to -// zero properly. Otherwise, you'll need to add appropriate software clamping to basic_test_conversions.c -// in which case, these function are at liberty to do nothing. -// -#if defined( __i386__ ) || defined( __x86_64__ ) || defined (_WIN32) - #include -#elif defined( __PPC__ ) - #include -#endif -void *FlushToZero( void ) -{ -#if defined( __APPLE__ ) || defined(__linux__) || defined (_WIN32) - #if defined( __i386__ ) || defined( __x86_64__ ) || defined(_MSC_VER) - union{ int i; void *p; }u = { _mm_getcsr() }; - _mm_setcsr( u.i | 0x8040 ); - return u.p; - #elif defined( __arm__ ) || defined(__aarch64__) - // processor is already in FTZ mode -- do nothing - return NULL; - #elif defined( __PPC__ ) - fpu_control_t flags = 0; - _FPU_GETCW(flags); - flags |= _FPU_MASK_NI; - _FPU_SETCW(flags); - return NULL; - #else - #error Unknown arch - #endif -#else - #error Please configure FlushToZero and UnFlushToZero to behave properly on this operating system. -#endif -} - -// Undo the effects of FlushToZero above, restoring the host to default behavior, using the information passed in p. -void UnFlushToZero( void *p) -{ -#if defined( __APPLE__ ) || defined(__linux__) || defined (_WIN32) - #if defined( __i386__ ) || defined( __x86_64__ ) || defined(_MSC_VER) - union{ void *p; int i; }u = { p }; - _mm_setcsr( u.i ); - #elif defined( __arm__ ) || defined(__aarch64__) - // processor is already in FTZ mode -- do nothing - #elif defined( __PPC__) - fpu_control_t flags = 0; - _FPU_GETCW(flags); - flags &= ~_FPU_MASK_NI; - _FPU_SETCW(flags); - #else - #error Unknown arch - #endif -#else - #error Please configure FlushToZero and UnFlushToZero to behave properly on this operating system. -#endif -} diff --git a/test_conformance/compatibility/test_common/harness/rounding_mode.h b/test_conformance/compatibility/test_common/harness/rounding_mode.h deleted file mode 100644 index 837ec687..00000000 --- a/test_conformance/compatibility/test_common/harness/rounding_mode.h +++ /dev/null @@ -1,71 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef __ROUNDING_MODE_H__ -#define __ROUNDING_MODE_H__ - -#include "compat.h" - -#include - -#if (defined(_WIN32) && defined (_MSC_VER)) -#include "errorHelpers.h" -#include "testHarness.h" -#endif - -typedef enum -{ - kDefaultRoundingMode = 0, - kRoundToNearestEven, - kRoundUp, - kRoundDown, - kRoundTowardZero, - - kRoundingModeCount -}RoundingMode; - -typedef enum -{ - kuchar = 0, - kchar = 1, - kushort = 2, - kshort = 3, - kuint = 4, - kint = 5, - kfloat = 6, - kdouble = 7, - kulong = 8, - klong = 9, - - //This goes last - kTypeCount -}Type; - -#ifdef __cplusplus -extern "C" { -#endif - -extern RoundingMode set_round( RoundingMode r, Type outType ); -extern RoundingMode get_round( void ); -extern void *FlushToZero( void ); -extern void UnFlushToZero( void *p); - -#ifdef __cplusplus -} -#endif - - - -#endif /* __ROUNDING_MODE_H__ */ diff --git a/test_conformance/compatibility/test_common/harness/testHarness.c b/test_conformance/compatibility/test_common/harness/testHarness.c deleted file mode 100644 index 01810d20..00000000 --- a/test_conformance/compatibility/test_common/harness/testHarness.c +++ /dev/null @@ -1,886 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "testHarness.h" -#include "compat.h" -#include -#include - -#if !defined(_WIN32) -#include -#endif - -#include -#include "threadTesting.h" -#include "errorHelpers.h" -#include "kernelHelpers.h" -#include "fpcontrol.h" - -#if !defined(_WIN32) -#include -#endif - -#include - -#if !defined (__APPLE__) -#include -#endif - -int gTestsPassed = 0; -int gTestsFailed = 0; -cl_uint gRandomSeed = 0; -cl_uint gReSeed = 0; - -int gFlushDenormsToZero = 0; -int gInfNanSupport = 1; -int gIsEmbedded = 0; -int gIsOpenCL_C_1_0_Device = 0; -int gIsOpenCL_1_0_Device = 0; -int gHasLong = 1; - -#define DEFAULT_NUM_ELEMENTS 0x4000 - -int runTestHarness( int argc, const char *argv[], int testNum, test_definition testList[], - int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps ) -{ - return runTestHarnessWithCheck( argc, argv, testNum, testList, imageSupportRequired, forceNoContextCreation, queueProps, - ( imageSupportRequired ) ? verifyImageSupport : NULL ); -} - -int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_definition testList[], - int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps, - DeviceCheckFn deviceCheckFn ) -{ - test_start(); - log_info("*** Compatibility with Previous Versions test ***\n"); - - cl_device_type device_type = CL_DEVICE_TYPE_DEFAULT; - cl_uint num_platforms = 0; - cl_platform_id *platforms; - cl_device_id device; - int num_elements = DEFAULT_NUM_ELEMENTS; - cl_uint num_devices = 0; - cl_device_id *devices = NULL; - cl_uint choosen_device_index = 0; - cl_uint choosen_platform_index = 0; - - int err, ret; - char *endPtr; - int based_on_env_var = 0; - - - /* Check for environment variable to set device type */ - char *env_mode = getenv( "CL_DEVICE_TYPE" ); - if( env_mode != NULL ) - { - based_on_env_var = 1; - if( strcmp( env_mode, "gpu" ) == 0 || strcmp( env_mode, "CL_DEVICE_TYPE_GPU" ) == 0 ) - device_type = CL_DEVICE_TYPE_GPU; - else if( strcmp( env_mode, "cpu" ) == 0 || strcmp( env_mode, "CL_DEVICE_TYPE_CPU" ) == 0 ) - device_type = CL_DEVICE_TYPE_CPU; - else if( strcmp( env_mode, "accelerator" ) == 0 || strcmp( env_mode, "CL_DEVICE_TYPE_ACCELERATOR" ) == 0 ) - device_type = CL_DEVICE_TYPE_ACCELERATOR; - else if( strcmp( env_mode, "default" ) == 0 || strcmp( env_mode, "CL_DEVICE_TYPE_DEFAULT" ) == 0 ) - device_type = CL_DEVICE_TYPE_DEFAULT; - else - { - log_error( "Unknown CL_DEVICE_TYPE env variable setting: %s.\nAborting...\n", env_mode ); - abort(); - } - } - -#if defined( __APPLE__ ) - { - // report on any unusual library search path indirection - char *libSearchPath = getenv( "DYLD_LIBRARY_PATH"); - if( libSearchPath ) - log_info( "*** DYLD_LIBRARY_PATH = \"%s\"\n", libSearchPath ); - - // report on any unusual framework search path indirection - char *frameworkSearchPath = getenv( "DYLD_FRAMEWORK_PATH"); - if( libSearchPath ) - log_info( "*** DYLD_FRAMEWORK_PATH = \"%s\"\n", frameworkSearchPath ); - } -#endif - - env_mode = getenv( "CL_DEVICE_INDEX" ); - if( env_mode != NULL ) - { - choosen_device_index = atoi(env_mode); - } - - env_mode = getenv( "CL_PLATFORM_INDEX" ); - if( env_mode != NULL ) - { - choosen_platform_index = atoi(env_mode); - } - - /* Process the command line arguments */ - - /* Special case: just list the tests */ - if( ( argc > 1 ) && (!strcmp( argv[ 1 ], "-list" ) || !strcmp( argv[ 1 ], "-h" ) || !strcmp( argv[ 1 ], "--help" ))) - { - char *fileName = getenv("CL_CONFORMANCE_RESULTS_FILENAME"); - - log_info( "Usage: %s [*] [pid] [id] []\n", argv[0] ); - log_info( "\t\tOne or more of: (wildcard character '*') (default *)\n"); - log_info( "\tpid\tIndicates platform at index should be used (default 0).\n" ); - log_info( "\tid\t\tIndicates device at index should be used (default 0).\n" ); - log_info( "\t\tcpu|gpu|accelerator| (default CL_DEVICE_TYPE_DEFAULT)\n" ); - log_info( "\n" ); - log_info( "\tNOTE: You may pass environment variable CL_CONFORMANCE_RESULTS_FILENAME (currently '%s')\n", - fileName != NULL ? fileName : "" ); - log_info( "\t to save results to JSON file.\n" ); - - log_info( "\n" ); - log_info( "Test names:\n" ); - for( int i = 0; i < testNum; i++ ) - { - log_info( "\t%s\n", testList[i].name ); - } - test_finish(); - return 0; - } - - /* How are we supposed to seed the random # generators? */ - if( argc > 1 && strcmp( argv[ argc - 1 ], "randomize" ) == 0 ) - { - log_info(" Initializing random seed based on the clock.\n"); - gRandomSeed = (unsigned)clock(); - gReSeed = 1; - argc--; - } - else - { - log_info(" Initializing random seed to 0.\n"); - } - - /* Do we have an integer to specify the number of elements to pass to tests? */ - if( argc > 1 ) - { - ret = (int)strtol( argv[ argc - 1 ], &endPtr, 10 ); - if( endPtr != argv[ argc - 1 ] && *endPtr == 0 ) - { - /* By spec, this means the entire string was a valid integer, so we treat it as a num_elements spec */ - /* (hence why we stored the result in ret first) */ - num_elements = ret; - log_info( "Testing with num_elements of %d\n", num_elements ); - argc--; - } - } - - /* Do we have a CPU/GPU specification? */ - if( argc > 1 ) - { - if( strcmp( argv[ argc - 1 ], "gpu" ) == 0 || strcmp( argv[ argc - 1 ], "CL_DEVICE_TYPE_GPU" ) == 0 ) - { - device_type = CL_DEVICE_TYPE_GPU; - argc--; - } - else if( strcmp( argv[ argc - 1 ], "cpu" ) == 0 || strcmp( argv[ argc - 1 ], "CL_DEVICE_TYPE_CPU" ) == 0 ) - { - device_type = CL_DEVICE_TYPE_CPU; - argc--; - } - else if( strcmp( argv[ argc - 1 ], "accelerator" ) == 0 || strcmp( argv[ argc - 1 ], "CL_DEVICE_TYPE_ACCELERATOR" ) == 0 ) - { - device_type = CL_DEVICE_TYPE_ACCELERATOR; - argc--; - } - else if( strcmp( argv[ argc - 1 ], "CL_DEVICE_TYPE_DEFAULT" ) == 0 ) - { - device_type = CL_DEVICE_TYPE_DEFAULT; - argc--; - } - } - - /* Did we choose a specific device index? */ - if( argc > 1 ) - { - if( strlen( argv[ argc - 1 ] ) >= 3 && argv[ argc - 1 ][0] == 'i' && argv[ argc - 1 ][1] == 'd' ) - { - choosen_device_index = atoi( &(argv[ argc - 1 ][2]) ); - argc--; - } - } - - /* Did we choose a specific platform index? */ - if( argc > 1 ) - { - if( strlen( argv[ argc - 1 ] ) >= 3 && argv[ argc - 1 ][0] == 'p' && argv[ argc - 1 ][1] == 'i' && argv[ argc - 1 ][2] == 'd') - { - choosen_platform_index = atoi( &(argv[ argc - 1 ][3]) ); - argc--; - } - } - - switch( device_type ) - { - case CL_DEVICE_TYPE_GPU: log_info( "Requesting GPU device " ); break; - case CL_DEVICE_TYPE_CPU: log_info( "Requesting CPU device " ); break; - case CL_DEVICE_TYPE_ACCELERATOR: log_info( "Requesting Accelerator device " ); break; - case CL_DEVICE_TYPE_DEFAULT: log_info( "Requesting Default device " ); break; - default: log_error( "Requesting unknown device "); return -1; - } - log_info( based_on_env_var ? "based on environment variable " : "based on command line " ); - log_info( "for platform index %d and device index %d\n", choosen_platform_index, choosen_device_index); - -#if defined( __APPLE__ ) -#if defined( __i386__ ) || defined( __x86_64__ ) -#define kHasSSE3 0x00000008 -#define kHasSupplementalSSE3 0x00000100 -#define kHasSSE4_1 0x00000400 -#define kHasSSE4_2 0x00000800 - /* check our environment for a hint to disable SSE variants */ - { - const char *env = getenv( "CL_MAX_SSE" ); - if( env ) - { - extern int _cpu_capabilities; - int mask = 0; - if( 0 == strcasecmp( env, "SSE4.1" ) ) - mask = kHasSSE4_2; - else if( 0 == strcasecmp( env, "SSSE3" ) ) - mask = kHasSSE4_2 | kHasSSE4_1; - else if( 0 == strcasecmp( env, "SSE3" ) ) - mask = kHasSSE4_2 | kHasSSE4_1 | kHasSupplementalSSE3; - else if( 0 == strcasecmp( env, "SSE2" ) ) - mask = kHasSSE4_2 | kHasSSE4_1 | kHasSupplementalSSE3 | kHasSSE3; - else - { - log_error( "Error: Unknown CL_MAX_SSE setting: %s\n", env ); - return -2; - } - - log_info( "*** Environment: CL_MAX_SSE = %s ***\n", env ); - _cpu_capabilities &= ~mask; - } - } -#endif -#endif - - /* Get the platform */ - err = clGetPlatformIDs(0, NULL, &num_platforms); - if (err) { - print_error(err, "clGetPlatformIDs failed"); - test_finish(); - return -1; - } - - platforms = (cl_platform_id *) malloc( num_platforms * sizeof( cl_platform_id ) ); - if (!platforms || choosen_platform_index >= num_platforms) { - log_error( "platform index out of range -- choosen_platform_index (%d) >= num_platforms (%d)\n", choosen_platform_index, num_platforms ); - test_finish(); - return -1; - } - - err = clGetPlatformIDs(num_platforms, platforms, NULL); - if (err) { - print_error(err, "clGetPlatformIDs failed"); - test_finish(); - return -1; - } - - /* Get the number of requested devices */ - err = clGetDeviceIDs(platforms[choosen_platform_index], device_type, 0, NULL, &num_devices ); - if (err) { - print_error(err, "clGetDeviceIDs failed"); - test_finish(); - return -1; - } - - devices = (cl_device_id *) malloc( num_devices * sizeof( cl_device_id ) ); - if (!devices || choosen_device_index >= num_devices) { - log_error( "device index out of range -- choosen_device_index (%d) >= num_devices (%d)\n", choosen_device_index, num_devices ); - test_finish(); - return -1; - } - - /* Get the requested device */ - err = clGetDeviceIDs(platforms[choosen_platform_index], device_type, num_devices, devices, NULL ); - if (err) { - print_error(err, "clGetDeviceIDs failed"); - test_finish(); - return -1; - } - - device = devices[choosen_device_index]; - free(devices); - devices = NULL; - free(platforms); - platforms = NULL; - - if( printDeviceHeader( device ) != CL_SUCCESS ) - { - test_finish(); - return -1; - } - - cl_device_fp_config fpconfig = 0; - err = clGetDeviceInfo( device, CL_DEVICE_SINGLE_FP_CONFIG, sizeof( fpconfig ), &fpconfig, NULL ); - if (err) { - print_error(err, "clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed"); - test_finish(); - return -1; - } - - gFlushDenormsToZero = ( 0 == (fpconfig & CL_FP_DENORM)); - log_info( "Supports single precision denormals: %s\n", gFlushDenormsToZero ? "NO" : "YES" ); - log_info( "sizeof( void*) = %d (host)\n", (int) sizeof( void* ) ); - - //detect whether profile of the device is embedded - char profile[1024] = ""; - err = clGetDeviceInfo(device, CL_DEVICE_PROFILE, sizeof(profile), profile, NULL); - if (err) - { - print_error(err, "clGetDeviceInfo for CL_DEVICE_PROFILE failed\n" ); - test_finish(); - return -1; - } - gIsEmbedded = NULL != strstr(profile, "EMBEDDED_PROFILE"); - - //detect the floating point capabilities - cl_device_fp_config floatCapabilities = 0; - err = clGetDeviceInfo(device, CL_DEVICE_SINGLE_FP_CONFIG, sizeof(floatCapabilities), &floatCapabilities, NULL); - if (err) - { - print_error(err, "clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed\n"); - test_finish(); - return -1; - } - - // Check for problems that only embedded will have - if( gIsEmbedded ) - { - //If the device is embedded, we need to detect if the device supports Infinity and NaN - if ((floatCapabilities & CL_FP_INF_NAN) == 0) - gInfNanSupport = 0; - - // check the extensions list to see if ulong and long are supported - size_t extensionsStringSize = 0; - if( (err = clGetDeviceInfo( device, CL_DEVICE_EXTENSIONS, 0, NULL, &extensionsStringSize ) )) - { - print_error( err, "Unable to get extensions string size for embedded device" ); - test_finish(); - return -1; - } - char *extensions_string = (char*) malloc(extensionsStringSize); - if( NULL == extensions_string ) - { - print_error( CL_OUT_OF_HOST_MEMORY, "Unable to allocate storage for extensions string for embedded device" ); - test_finish(); - return -1; - } - - if( (err = clGetDeviceInfo( device, CL_DEVICE_EXTENSIONS, extensionsStringSize, extensions_string, NULL ) )) - { - print_error( err, "Unable to get extensions string for embedded device" ); - test_finish(); - return -1; - } - - if( extensions_string[extensionsStringSize-1] != '\0' ) - { - log_error( "FAILURE: extensions string for embedded device is not NUL terminated" ); - test_finish(); - return -1; - } - - if( NULL == strstr( extensions_string, "cles_khr_int64" )) - gHasLong = 0; - - free(extensions_string); - } - - if( getenv( "OPENCL_1_0_DEVICE" ) ) - { - char c_version[1024]; - gIsOpenCL_1_0_Device = 1; - memset( c_version, 0, sizeof( c_version ) ); - - if( (err = clGetDeviceInfo( device, CL_DEVICE_OPENCL_C_VERSION, sizeof(c_version), c_version, NULL )) ) - { - log_error( "FAILURE: unable to get CL_DEVICE_OPENCL_C_VERSION on 1.0 device. (%d)\n", err ); - test_finish(); - return -1; - } - - if( 0 == strncmp( c_version, "OpenCL C 1.0 ", strlen( "OpenCL C 1.0 " ) ) ) - { - gIsOpenCL_C_1_0_Device = 1; - log_info( "Device is a OpenCL C 1.0 device\n" ); - } - else - log_info( "Device is a OpenCL 1.0 device, but supports OpenCL C 1.1\n" ); - } - - cl_uint device_address_bits = 0; - if( (err = clGetDeviceInfo( device, CL_DEVICE_ADDRESS_BITS, sizeof( device_address_bits ), &device_address_bits, NULL ) )) - { - print_error( err, "Unable to obtain device address bits" ); - test_finish(); - return -1; - } - if( device_address_bits ) - log_info( "sizeof( void*) = %d (device)\n", device_address_bits/8 ); - else - { - log_error("Invalid device address bit size returned by device.\n"); - test_finish(); - return -1; - } - - - /* If we have a device checking function, run it */ - if( ( deviceCheckFn != NULL ) ) - { - test_status status = deviceCheckFn( device ); - switch (status) - { - case TEST_PASS: - break; - case TEST_FAIL: - return 1; - case TEST_SKIP: - return 0; - } - } - - if (num_elements <= 0) - num_elements = DEFAULT_NUM_ELEMENTS; - - // On most platforms which support denorm, default is FTZ off. However, - // on some hardware where the reference is computed, default might be flush denorms to zero e.g. arm. - // This creates issues in result verification. Since spec allows the implementation to either flush or - // not flush denorms to zero, an implementation may choose not be flush i.e. return denorm result whereas - // reference result may be zero (flushed denorm). Hence we need to disable denorm flushing on host side - // where reference is being computed to make sure we get non-flushed reference result. If implementation - // returns flushed result, we correctly take care of that in verification code. -#if defined(__APPLE__) && defined(__arm__) - FPU_mode_type oldMode; - DisableFTZ( &oldMode ); -#endif - - int error = parseAndCallCommandLineTests( argc, argv, device, testNum, testList, forceNoContextCreation, queueProps, num_elements ); - - #if defined(__APPLE__) && defined(__arm__) - // Restore the old FP mode before leaving. - RestoreFPState( &oldMode ); -#endif - - return error; -} - -static int find_matching_tests( test_definition testList[], unsigned char selectedTestList[], int testNum, - const char *argument, bool isWildcard ) -{ - int found_tests = 0; - size_t wildcard_length = strlen( argument ) - 1; /* -1 for the asterisk */ - - for( int i = 0; i < testNum; i++ ) - { - if( ( !isWildcard && strcmp( testList[i].name, argument ) == 0 ) || - ( isWildcard && strncmp( testList[i].name, argument, wildcard_length ) == 0 ) ) - { - if( selectedTestList[i] ) - { - log_error( "ERROR: Test '%s' has already been selected.\n", testList[i].name ); - return EXIT_FAILURE; - } - else if( testList[i].func == NULL ) - { - log_error( "ERROR: Test '%s' is missing implementation.\n", testList[i].name ); - return EXIT_FAILURE; - } - else - { - selectedTestList[i] = 1; - found_tests = 1; - if( !isWildcard ) - { - break; - } - } - } - } - - if( !found_tests ) - { - log_error( "ERROR: The argument '%s' did not match any test names.\n", argument ); - return EXIT_FAILURE; - } - - return EXIT_SUCCESS; -} - -static int saveResultsToJson( const char *fileName, const char *suiteName, test_definition testList[], - unsigned char selectedTestList[], int resultTestList[], int testNum ) -{ - FILE *file = fopen( fileName, "w" ); - if( NULL == file ) - { - log_error( "ERROR: Failed to open '%s' for writing results.\n", fileName ); - return EXIT_FAILURE; - } - - const char *save_map[] = { "success", "failure" }; - const char *result_map[] = { "pass", "fail" }; - const char *linebreak[] = { "", ",\n" }; - int add_linebreak = 0; - - fprintf( file, "{\n" ); - fprintf( file, "\t\"cmd\": \"%s\",\n", suiteName ); - fprintf( file, "\t\"results\": {\n" ); - - for( int i = 0; i < testNum; ++i ) - { - if( selectedTestList[i] ) - { - fprintf( file, "%s\t\t\"%s\": \"%s\"", linebreak[add_linebreak], testList[i].name, result_map[(bool)resultTestList[i]] ); - add_linebreak = 1; - } - } - fprintf( file, "\n"); - - fprintf( file, "\t}\n" ); - fprintf( file, "}\n" ); - - int ret = fclose( file ) ? 1 : 0; - - log_info( "Saving results to %s: %s!\n", fileName, save_map[ret] ); - - return ret; -} - -int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id device, int testNum, - test_definition testList[], int forceNoContextCreation, - cl_command_queue_properties queueProps, int num_elements ) -{ - int ret = EXIT_SUCCESS; - - unsigned char *selectedTestList = ( unsigned char* ) calloc( testNum, 1 ); - int *resultTestList = NULL; - - if( argc == 1 ) - { - /* No actual arguments, all tests will be run. */ - memset( selectedTestList, 1, testNum ); - } - else - { - for( int i = 1; i < argc; i++ ) - { - if( strchr( argv[i], '*' ) != NULL ) - { - ret = find_matching_tests( testList, selectedTestList, testNum, argv[i], true ); - } - else - { - if( strcmp( argv[i], "all" ) == 0 ) - { - memset( selectedTestList, 1, testNum ); - break; - } - else - { - ret = find_matching_tests( testList, selectedTestList, testNum, argv[i], false ); - } - } - - if( ret == EXIT_FAILURE ) - { - break; - } - } - } - - if( ret == EXIT_SUCCESS ) - { - resultTestList = ( int* ) calloc( testNum, sizeof(int) ); - - ret = callTestFunctions( testList, selectedTestList, resultTestList, testNum, device, forceNoContextCreation, num_elements, queueProps ); - - if( gTestsFailed == 0 ) - { - if( gTestsPassed > 1 ) - { - log_info("PASSED %d of %d tests.\n", gTestsPassed, gTestsPassed); - } - else if( gTestsPassed > 0 ) - { - log_info("PASSED test.\n"); - } - } - else if( gTestsFailed > 0 ) - { - if( gTestsFailed+gTestsPassed > 1 ) - { - log_error("FAILED %d of %d tests.\n", gTestsFailed, gTestsFailed+gTestsPassed); - } - else - { - log_error("FAILED test.\n"); - } - } - - char *filename = getenv( "CL_CONFORMANCE_RESULTS_FILENAME" ); - if( filename != NULL ) - { - ret += saveResultsToJson( filename, argv[0], testList, selectedTestList, resultTestList, testNum ); - } - } - - test_finish(); - - free( selectedTestList ); - free( resultTestList ); - - return ret; -} - -int callTestFunctions( test_definition testList[], unsigned char selectedTestList[], int resultTestList[], - int testNum, cl_device_id deviceToUse, int forceNoContextCreation, int numElementsToUse, - cl_command_queue_properties queueProps ) -{ - int totalErrors = 0; - - for( int i = 0; i < testNum; ++i ) - { - if( selectedTestList[i] ) - { - // Skip unimplemented test (can happen when you select all of the tests) - if( testList[i].func != NULL ) - { - int errors = callSingleTestFunction( testList[i], deviceToUse, forceNoContextCreation, - numElementsToUse, queueProps ); - resultTestList[i] = errors; - totalErrors += errors; - } - else - { - log_info( "Skipping %s. Test currently not implemented.\n", testList[i].name ); - } - } - } - - return totalErrors; -} - -void CL_CALLBACK notify_callback(const char *errinfo, const void *private_info, size_t cb, void *user_data) -{ - log_info( "%s\n", errinfo ); -} - -// Actual function execution -int callSingleTestFunction( test_definition test, cl_device_id deviceToUse, int forceNoContextCreation, - int numElementsToUse, cl_command_queue_properties queueProps ) -{ - int numErrors = 0, ret; - cl_int error; - cl_context context = NULL; - cl_command_queue queue = NULL; - - /* Create a context to work with, unless we're told not to */ - if( !forceNoContextCreation ) - { - context = clCreateContext(NULL, 1, &deviceToUse, notify_callback, NULL, &error ); - if (!context) - { - print_error( error, "Unable to create testing context" ); - return 1; - } - - queue = clCreateCommandQueue( context, deviceToUse, queueProps, &error ); - if( queue == NULL ) - { - print_error( error, "Unable to create testing command queue" ); - return 1; - } - } - - /* Run the test and print the result */ - log_info( "%s...\n", test.name ); - fflush( stdout ); - - ret = test.func( deviceToUse, context, queue, numElementsToUse); //test_threaded_function( ptr_basefn_list[i], group, context, num_elements); - if( ret == TEST_NOT_IMPLEMENTED ) - { - /* Tests can also let us know they're not implemented yet */ - log_info("%s test currently not implemented\n\n", test.name); - } - else - { - /* Print result */ - if( ret == 0 ) { - log_info( "%s passed\n", test.name ); - gTestsPassed++; - } - else - { - numErrors++; - log_error( "%s FAILED\n", test.name ); - gTestsFailed++; - } - } - - /* Release the context */ - if( !forceNoContextCreation ) - { - int error = clFinish(queue); - if (error) { - log_error("clFinish failed: %d", error); - numErrors++; - } - clReleaseCommandQueue( queue ); - clReleaseContext( context ); - } - - return numErrors; -} - -void checkDeviceTypeOverride( cl_device_type *inOutType ) -{ - /* Check if we are forced to CPU mode */ - char *force_cpu = getenv( "CL_DEVICE_TYPE" ); - if( force_cpu != NULL ) - { - if( strcmp( force_cpu, "gpu" ) == 0 || strcmp( force_cpu, "CL_DEVICE_TYPE_GPU" ) == 0 ) - *inOutType = CL_DEVICE_TYPE_GPU; - else if( strcmp( force_cpu, "cpu" ) == 0 || strcmp( force_cpu, "CL_DEVICE_TYPE_CPU" ) == 0 ) - *inOutType = CL_DEVICE_TYPE_CPU; - else if( strcmp( force_cpu, "accelerator" ) == 0 || strcmp( force_cpu, "CL_DEVICE_TYPE_ACCELERATOR" ) == 0 ) - *inOutType = CL_DEVICE_TYPE_ACCELERATOR; - else if( strcmp( force_cpu, "CL_DEVICE_TYPE_DEFAULT" ) == 0 ) - *inOutType = CL_DEVICE_TYPE_DEFAULT; - } - - switch( *inOutType ) - { - case CL_DEVICE_TYPE_GPU: log_info( "Requesting GPU device " ); break; - case CL_DEVICE_TYPE_CPU: log_info( "Requesting CPU device " ); break; - case CL_DEVICE_TYPE_ACCELERATOR: log_info( "Requesting Accelerator device " ); break; - case CL_DEVICE_TYPE_DEFAULT: log_info( "Requesting Default device " ); break; - default: break; - } - log_info( force_cpu != NULL ? "based on environment variable\n" : "based on command line\n" ); - -#if defined( __APPLE__ ) - { - // report on any unusual library search path indirection - char *libSearchPath = getenv( "DYLD_LIBRARY_PATH"); - if( libSearchPath ) - log_info( "*** DYLD_LIBRARY_PATH = \"%s\"\n", libSearchPath ); - - // report on any unusual framework search path indirection - char *frameworkSearchPath = getenv( "DYLD_FRAMEWORK_PATH"); - if( libSearchPath ) - log_info( "*** DYLD_FRAMEWORK_PATH = \"%s\"\n", frameworkSearchPath ); - } -#endif - -} - -#if ! defined( __APPLE__ ) -void memset_pattern4(void *dest, const void *src_pattern, size_t bytes ) -{ - uint32_t pat = ((uint32_t*) src_pattern)[0]; - size_t count = bytes / 4; - size_t i; - uint32_t *d = (uint32_t*)dest; - - for( i = 0; i < count; i++ ) - d[i] = pat; - - d += i; - - bytes &= 3; - if( bytes ) - memcpy( d, src_pattern, bytes ); -} -#endif - -extern cl_device_type GetDeviceType( cl_device_id d ) -{ - cl_device_type result = -1; - cl_int err = clGetDeviceInfo( d, CL_DEVICE_TYPE, sizeof( result ), &result, NULL ); - if( CL_SUCCESS != err ) - log_error( "ERROR: Unable to get device type for device %p\n", d ); - return result; -} - - -cl_device_id GetOpposingDevice( cl_device_id device ) -{ - cl_int error; - cl_device_id *otherDevices; - cl_uint actualCount; - cl_platform_id plat; - - // Get the platform of the device to use for getting a list of devices - error = clGetDeviceInfo( device, CL_DEVICE_PLATFORM, sizeof( plat ), &plat, NULL ); - if( error != CL_SUCCESS ) - { - print_error( error, "Unable to get device's platform" ); - return NULL; - } - - // Get a list of all devices - error = clGetDeviceIDs( plat, CL_DEVICE_TYPE_ALL, 0, NULL, &actualCount ); - if( error != CL_SUCCESS ) - { - print_error( error, "Unable to get list of devices size" ); - return NULL; - } - otherDevices = (cl_device_id *)malloc(actualCount*sizeof(cl_device_id)); - error = clGetDeviceIDs( plat, CL_DEVICE_TYPE_ALL, actualCount, otherDevices, NULL ); - if( error != CL_SUCCESS ) - { - print_error( error, "Unable to get list of devices" ); - free(otherDevices); - return NULL; - } - - if( actualCount == 1 ) - { - free(otherDevices); - return device; // NULL means error, returning self means we couldn't find another one - } - - // Loop and just find one that isn't the one we were given - cl_uint i; - for( i = 0; i < actualCount; i++ ) - { - if( otherDevices[ i ] != device ) - { - cl_device_type newType; - error = clGetDeviceInfo( otherDevices[ i ], CL_DEVICE_TYPE, sizeof( newType ), &newType, NULL ); - if( error != CL_SUCCESS ) - { - print_error( error, "Unable to get device type for other device" ); - free(otherDevices); - return NULL; - } - cl_device_id result = otherDevices[ i ]; - free(otherDevices); - return result; - } - } - - // Should never get here - free(otherDevices); - return NULL; -} - - diff --git a/test_conformance/compatibility/test_common/harness/testHarness.h b/test_conformance/compatibility/test_common/harness/testHarness.h deleted file mode 100644 index db30c0c7..00000000 --- a/test_conformance/compatibility/test_common/harness/testHarness.h +++ /dev/null @@ -1,116 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef _testHarness_h -#define _testHarness_h - -#include "threadTesting.h" -#include "clImageHelper.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ADD_TEST(fn) {test_##fn, #fn} -#define NOT_IMPLEMENTED_TEST(fn) {NULL, #fn} - -#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) - -typedef struct test_definition -{ - basefn func; - const char* name; -} test_definition; - -typedef enum test_status -{ - TEST_PASS = 0, - TEST_FAIL = 1, - TEST_SKIP = 2, -} test_status; - -extern cl_uint gReSeed; -extern cl_uint gRandomSeed; - -// Supply a list of functions to test here. This will allocate a CL device, create a context, all that -// setup work, and then call each function in turn as dictatated by the passed arguments. -extern int runTestHarness(int argc, const char *argv[], int testNum, test_definition testList[], - int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps ); - -// Device checking function. See runTestHarnessWithCheck. If this function returns anything other than TEST_PASS, the harness exits. -typedef test_status (*DeviceCheckFn)( cl_device_id device ); - -// Same as runTestHarness, but also supplies a function that checks the created device for required functionality. -extern int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_definition testList[], - int imageSupportRequired, int forceNoContextCreation, cl_command_queue_properties queueProps, - DeviceCheckFn deviceCheckFn ); - -// The command line parser used by runTestHarness to break up parameters into calls to callTestFunctions -extern int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id device, int testNum, - test_definition testList[], int forceNoContextCreation, - cl_command_queue_properties queueProps, int num_elements ); - -// Call this function if you need to do all the setup work yourself, and just need the function list called/ -// managed. -// testList is the data structure that contains test functions and its names -// selectedTestList is an array of integers (treated as bools) which tell which function is to be called, -// each element at index i, corresponds to the element in testList at index i -// resultTestList is an array of integers which contains the result of each selected test -// testNum is the number of tests in testList, selectedTestList and resultTestList -// contextProps are used to create a testing context for each test -// deviceToUse and numElementsToUse are all just passed to each test function -extern int callTestFunctions( test_definition testList[], unsigned char selectedTestList[], int resultTestList[], - int testNum, cl_device_id deviceToUse, int forceNoContextCreation, int numElementsToUse, - cl_command_queue_properties queueProps ); - -// This function is called by callTestFunctions, once per function, to do setup, call, logging and cleanup -extern int callSingleTestFunction( test_definition test, cl_device_id deviceToUse, int forceNoContextCreation, - int numElementsToUse, cl_command_queue_properties queueProps ); - -///// Miscellaneous steps - -// Given a pre-existing device type choice, check the environment for an override, then print what -// choice was made and how (and return the overridden choice, if there is one) -extern void checkDeviceTypeOverride( cl_device_type *inOutType ); - -// standard callback function for context pfn_notify -extern void CL_CALLBACK notify_callback(const char *errinfo, const void *private_info, size_t cb, void *user_data); - -extern cl_device_type GetDeviceType( cl_device_id ); - -// Given a device (most likely passed in by the harness, but not required), will attempt to find -// a DIFFERENT device and return it. Useful for finding another device to run multi-device tests against. -// Note that returning NULL means an error was hit, but if no error was hit and the device passed in -// is the only device available, the SAME device is returned, so check! -extern cl_device_id GetOpposingDevice( cl_device_id device ); - - -extern int gFlushDenormsToZero; // This is set to 1 if the device does not support denorms (CL_FP_DENORM) -extern int gInfNanSupport; // This is set to 1 if the device supports infinities and NaNs -extern int gIsEmbedded; // This is set to 1 if the device is an embedded device -extern int gHasLong; // This is set to 1 if the device suppots long and ulong types in OpenCL C. -extern int gIsOpenCL_C_1_0_Device; // This is set to 1 if the device supports only OpenCL C 1.0. - -#if ! defined( __APPLE__ ) - void memset_pattern4(void *, const void *, size_t); -#endif - -#ifdef __cplusplus -} -#endif - -#endif // _testHarness_h - - diff --git a/test_conformance/compatibility/test_common/harness/test_mt19937.c b/test_conformance/compatibility/test_common/harness/test_mt19937.c deleted file mode 100644 index c0498ea9..00000000 --- a/test_conformance/compatibility/test_common/harness/test_mt19937.c +++ /dev/null @@ -1,51 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "mt19937.h" -#include - -int main( void ) -{ - MTdata d = init_genrand(42); - int i; - const cl_uint reference[16] = { 0x5fe1dc66, 0x8b255210, 0x0380b0c8, 0xc87d2ce4, - 0x55c31f24, 0x8bcd21ab, 0x14d5fef5, 0x9416d2b6, - 0xdf875de9, 0x00517d76, 0xd861c944, 0xa7676404, - 0x5491aff4, 0x67616209, 0xc368b3fb, 0x929dfc92 }; - int errcount = 0; - - for( i = 0; i < 65536; i++ ) - { - cl_uint u = genrand_int32( d ); - if( 0 == (i & 4095) ) - { - if( u != reference[i>>12] ) - { - printf("ERROR: expected *0x%8.8x at %d. Got 0x%8.8x\n", reference[i>>12], i, u ); - errcount++; - } - } - } - - free_mtdata(d); - - if( errcount ) - printf("mt19937 test failed.\n"); - else - printf("mt19937 test passed.\n"); - - - return 0; -} \ No newline at end of file diff --git a/test_conformance/compatibility/test_common/harness/threadTesting.c b/test_conformance/compatibility/test_common/harness/threadTesting.c deleted file mode 100644 index 2f16dcca..00000000 --- a/test_conformance/compatibility/test_common/harness/threadTesting.c +++ /dev/null @@ -1,106 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "threadTesting.h" -#include "errorHelpers.h" -#include -#include - -#if !defined(_WIN32) -#include -#endif - -#include -#include - -#if !defined(_WIN32) -#include -#endif - -#if 0 // Disabed for now - -typedef struct -{ - basefn mFunction; - cl_device_id mDevice; - cl_context mContext; - int mNumElements; -} TestFnArgs; - -//////////////////////////////////////////////////////////////////////////////// -// Thread-based testing. Spawns a new thread to run the given test function, -// then waits for it to complete. The entire idea is that, if the thread crashes, -// we can catch it and report it as a failure instead of crashing the entire suite -//////////////////////////////////////////////////////////////////////////////// - -void *test_thread_wrapper( void *data ) -{ - TestFnArgs *args; - int retVal; - cl_context context; - - args = (TestFnArgs *)data; - - /* Create a new context to use (contexts can't cross threads) */ - context = clCreateContext(NULL, args->mDeviceGroup); - if( context == NULL ) - { - log_error("clCreateContext failed for new thread\n"); - return (void *)(-1); - } - - /* Call function */ - retVal = args->mFunction( args->mDeviceGroup, args->mDevice, context, args->mNumElements ); - - clReleaseContext( context ); - - return (void *)retVal; -} - -int test_threaded_function( basefn fnToTest, cl_device_id device, cl_context context, cl_command_queue queue, int numElements ) -{ - int error; - pthread_t threadHdl; - void *retVal; - TestFnArgs args; - - - args.mFunction = fnToTest; - args.mDeviceGroup = deviceGroup; - args.mDevice = device; - args.mContext = context; - args.mNumElements = numElements; - - - error = pthread_create( &threadHdl, NULL, test_thread_wrapper, (void *)&args ); - if( error != 0 ) - { - log_error( "ERROR: Unable to create thread for testing!\n" ); - return -1; - } - - /* Thread has been started, now just wait for it to complete (or crash) */ - error = pthread_join( threadHdl, &retVal ); - if( error != 0 ) - { - log_error( "ERROR: Unable to join testing thread!\n" ); - return -1; - } - - return (int)((intptr_t)retVal); -} -#endif - - diff --git a/test_conformance/compatibility/test_common/harness/threadTesting.h b/test_conformance/compatibility/test_common/harness/threadTesting.h deleted file mode 100644 index 81a5757b..00000000 --- a/test_conformance/compatibility/test_common/harness/threadTesting.h +++ /dev/null @@ -1,32 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef _threadTesting_h -#define _threadTesting_h - -#ifdef __APPLE__ - #include -#else - #include -#endif - -#define TEST_NOT_IMPLEMENTED -99 - -typedef int (*basefn)(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_threaded_function( basefn fnToTest, cl_device_id device, cl_context context, cl_command_queue queue, int numElements ); - -#endif // _threadTesting_h - - diff --git a/test_conformance/compatibility/test_common/harness/typeWrappers.cpp b/test_conformance/compatibility/test_common/harness/typeWrappers.cpp deleted file mode 100644 index d4e08fb9..00000000 --- a/test_conformance/compatibility/test_common/harness/typeWrappers.cpp +++ /dev/null @@ -1,481 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "typeWrappers.h" -#include "kernelHelpers.h" -#include "errorHelpers.h" -#include -#include "clImageHelper.h" - -#define ROUND_SIZE_UP( _size, _align ) (((size_t)(_size) + (size_t)(_align) - 1) & -((size_t)(_align))) - -#if defined( __APPLE__ ) - #define kPageSize 4096 - #include - #include -#elif defined(__linux__) - #include - #define kPageSize (getpagesize()) -#endif - -clProtectedImage::clProtectedImage( cl_context context, cl_mem_flags mem_flags, const cl_image_format *fmt, size_t width, cl_int *errcode_ret ) -{ - cl_int err = Create( context, mem_flags, fmt, width ); - if( errcode_ret != NULL ) - *errcode_ret = err; -} - -cl_int clProtectedImage::Create( cl_context context, cl_mem_flags mem_flags, const cl_image_format *fmt, size_t width ) -{ - cl_int error; -#if defined( __APPLE__ ) - int protect_pages = 1; - cl_device_id devices[16]; - size_t number_of_devices; - error = clGetContextInfo(context, CL_CONTEXT_DEVICES, sizeof(devices), devices, &number_of_devices); - test_error(error, "clGetContextInfo for CL_CONTEXT_DEVICES failed"); - - number_of_devices /= sizeof(cl_device_id); - for (int i=0; i<(int)number_of_devices; i++) { - cl_device_type type; - error = clGetDeviceInfo(devices[i], CL_DEVICE_TYPE, sizeof(type), &type, NULL); - test_error(error, "clGetDeviceInfo for CL_DEVICE_TYPE failed"); - if (type == CL_DEVICE_TYPE_GPU) { - protect_pages = 0; - break; - } - } - - if (protect_pages) { - size_t pixelBytes = get_pixel_bytes(fmt); - size_t rowBytes = ROUND_SIZE_UP( width * pixelBytes, kPageSize ); - size_t rowStride = rowBytes + kPageSize; - - // create backing store - backingStoreSize = rowStride + 8 * rowStride; - backingStore = mmap(0, backingStoreSize, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, 0, 0); - - // add guard pages - size_t row; - char *p = (char*) backingStore; - char *imagePtr = (char*) backingStore + 4 * rowStride; - for( row = 0; row < 4; row++ ) - { - mprotect( p, rowStride, PROT_NONE ); p += rowStride; - } - p += rowBytes; - mprotect( p, kPageSize, PROT_NONE ); p += rowStride; - p -= rowBytes; - for( row = 0; row < 4; row++ ) - { - mprotect( p, rowStride, PROT_NONE ); p += rowStride; - } - - if( getenv( "CL_ALIGN_RIGHT" ) ) - { - static int spewEnv = 1; - if(spewEnv) - { - log_info( "***CL_ALIGN_RIGHT is set. Aligning images at right edge of page\n" ); - spewEnv = 0; - } - imagePtr += rowBytes - pixelBytes * width; - } - - image = create_image_1d( context, mem_flags | CL_MEM_USE_HOST_PTR, fmt, width, rowStride, imagePtr, NULL, &error ); - } else { - backingStore = NULL; - image = create_image_1d( context, mem_flags, fmt, width, 0, NULL, NULL, &error ); - - } -#else - - backingStore = NULL; - image = create_image_1d( context, mem_flags, fmt, width, 0, NULL, NULL, &error ); - -#endif - return error; -} - - -clProtectedImage::clProtectedImage( cl_context context, cl_mem_flags mem_flags, const cl_image_format *fmt, size_t width, size_t height, cl_int *errcode_ret ) -{ - cl_int err = Create( context, mem_flags, fmt, width, height ); - if( errcode_ret != NULL ) - *errcode_ret = err; -} - -cl_int clProtectedImage::Create( cl_context context, cl_mem_flags mem_flags, const cl_image_format *fmt, size_t width, size_t height ) -{ - cl_int error; -#if defined( __APPLE__ ) - int protect_pages = 1; - cl_device_id devices[16]; - size_t number_of_devices; - error = clGetContextInfo(context, CL_CONTEXT_DEVICES, sizeof(devices), devices, &number_of_devices); - test_error(error, "clGetContextInfo for CL_CONTEXT_DEVICES failed"); - - number_of_devices /= sizeof(cl_device_id); - for (int i=0; i<(int)number_of_devices; i++) { - cl_device_type type; - error = clGetDeviceInfo(devices[i], CL_DEVICE_TYPE, sizeof(type), &type, NULL); - test_error(error, "clGetDeviceInfo for CL_DEVICE_TYPE failed"); - if (type == CL_DEVICE_TYPE_GPU) { - protect_pages = 0; - break; - } - } - - if (protect_pages) { - size_t pixelBytes = get_pixel_bytes(fmt); - size_t rowBytes = ROUND_SIZE_UP( width * pixelBytes, kPageSize ); - size_t rowStride = rowBytes + kPageSize; - - // create backing store - backingStoreSize = height * rowStride + 8 * rowStride; - backingStore = mmap(0, backingStoreSize, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, 0, 0); - - // add guard pages - size_t row; - char *p = (char*) backingStore; - char *imagePtr = (char*) backingStore + 4 * rowStride; - for( row = 0; row < 4; row++ ) - { - mprotect( p, rowStride, PROT_NONE ); p += rowStride; - } - p += rowBytes; - for( row = 0; row < height; row++ ) - { - mprotect( p, kPageSize, PROT_NONE ); p += rowStride; - } - p -= rowBytes; - for( row = 0; row < 4; row++ ) - { - mprotect( p, rowStride, PROT_NONE ); p += rowStride; - } - - if( getenv( "CL_ALIGN_RIGHT" ) ) - { - static int spewEnv = 1; - if(spewEnv) - { - log_info( "***CL_ALIGN_RIGHT is set. Aligning images at right edge of page\n" ); - spewEnv = 0; - } - imagePtr += rowBytes - pixelBytes * width; - } - - image = create_image_2d( context, mem_flags | CL_MEM_USE_HOST_PTR, fmt, width, height, rowStride, imagePtr, &error ); - } else { - backingStore = NULL; - image = create_image_2d( context, mem_flags, fmt, width, height, 0, NULL, &error ); - - } -#else - - backingStore = NULL; - image = create_image_2d( context, mem_flags, fmt, width, height, 0, NULL, &error ); - -#endif - return error; -} - -clProtectedImage::clProtectedImage( cl_context context, cl_mem_flags mem_flags, const cl_image_format *fmt, size_t width, size_t height, size_t depth, cl_int *errcode_ret ) -{ - cl_int err = Create( context, mem_flags, fmt, width, height, depth ); - if( errcode_ret != NULL ) - *errcode_ret = err; -} - -cl_int clProtectedImage::Create( cl_context context, cl_mem_flags mem_flags, const cl_image_format *fmt, size_t width, size_t height, size_t depth ) -{ - cl_int error; - -#if defined( __APPLE__ ) - int protect_pages = 1; - cl_device_id devices[16]; - size_t number_of_devices; - error = clGetContextInfo(context, CL_CONTEXT_DEVICES, sizeof(devices), devices, &number_of_devices); - test_error(error, "clGetContextInfo for CL_CONTEXT_DEVICES failed"); - - number_of_devices /= sizeof(cl_device_id); - for (int i=0; i<(int)number_of_devices; i++) { - cl_device_type type; - error = clGetDeviceInfo(devices[i], CL_DEVICE_TYPE, sizeof(type), &type, NULL); - test_error(error, "clGetDeviceInfo for CL_DEVICE_TYPE failed"); - if (type == CL_DEVICE_TYPE_GPU) { - protect_pages = 0; - break; - } - } - - if (protect_pages) { - size_t pixelBytes = get_pixel_bytes(fmt); - size_t rowBytes = ROUND_SIZE_UP( width * pixelBytes, kPageSize ); - size_t rowStride = rowBytes + kPageSize; - - // create backing store - backingStoreSize = height * depth * rowStride + 8 * rowStride; - backingStore = mmap(0, backingStoreSize, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, 0, 0); - - // add guard pages - size_t row; - char *p = (char*) backingStore; - char *imagePtr = (char*) backingStore + 4 * rowStride; - for( row = 0; row < 4; row++ ) - { - mprotect( p, rowStride, PROT_NONE ); p += rowStride; - } - p += rowBytes; - for( row = 0; row < height*depth; row++ ) - { - mprotect( p, kPageSize, PROT_NONE ); p += rowStride; - } - p -= rowBytes; - for( row = 0; row < 4; row++ ) - { - mprotect( p, rowStride, PROT_NONE ); p += rowStride; - } - - if( getenv( "CL_ALIGN_RIGHT" ) ) - { - static int spewEnv = 1; - if(spewEnv) - { - log_info( "***CL_ALIGN_RIGHT is set. Aligning images at right edge of page\n" ); - spewEnv = 0; - } - imagePtr += rowBytes - pixelBytes * width; - } - - image = create_image_3d( context, mem_flags | CL_MEM_USE_HOST_PTR, fmt, width, height, depth, rowStride, height*rowStride, imagePtr, &error ); - } else { - backingStore = NULL; - image = create_image_3d( context, mem_flags, fmt, width, height, depth, 0, 0, NULL, &error ); - } -#else - - backingStore = NULL; - image = create_image_3d( context, mem_flags, fmt, width, height, depth, 0, 0, NULL, &error ); - -#endif - - return error; -} - - -clProtectedImage::clProtectedImage( cl_context context, cl_mem_object_type imageType, cl_mem_flags mem_flags, const cl_image_format *fmt, size_t width, size_t height, size_t depth, size_t arraySize, cl_int *errcode_ret ) -{ - cl_int err = Create( context, imageType, mem_flags, fmt, width, height, depth, arraySize ); - if( errcode_ret != NULL ) - *errcode_ret = err; -} - -cl_int clProtectedImage::Create( cl_context context, cl_mem_object_type imageType, cl_mem_flags mem_flags, const cl_image_format *fmt, size_t width, size_t height, size_t depth, size_t arraySize ) -{ - cl_int error; -#if defined( __APPLE__ ) - int protect_pages = 1; - cl_device_id devices[16]; - size_t number_of_devices; - error = clGetContextInfo(context, CL_CONTEXT_DEVICES, sizeof(devices), devices, &number_of_devices); - test_error(error, "clGetContextInfo for CL_CONTEXT_DEVICES failed"); - - number_of_devices /= sizeof(cl_device_id); - for (int i=0; i<(int)number_of_devices; i++) { - cl_device_type type; - error = clGetDeviceInfo(devices[i], CL_DEVICE_TYPE, sizeof(type), &type, NULL); - test_error(error, "clGetDeviceInfo for CL_DEVICE_TYPE failed"); - if (type == CL_DEVICE_TYPE_GPU) { - protect_pages = 0; - break; - } - } - - if (protect_pages) { - size_t pixelBytes = get_pixel_bytes(fmt); - size_t rowBytes = ROUND_SIZE_UP( width * pixelBytes, kPageSize ); - size_t rowStride = rowBytes + kPageSize; - - // create backing store - switch (imageType) - { - case CL_MEM_OBJECT_IMAGE1D: - backingStoreSize = rowStride + 8 * rowStride; - break; - case CL_MEM_OBJECT_IMAGE2D: - backingStoreSize = height * rowStride + 8 * rowStride; - break; - case CL_MEM_OBJECT_IMAGE3D: - backingStoreSize = height * depth * rowStride + 8 * rowStride; - break; - case CL_MEM_OBJECT_IMAGE1D_ARRAY: - backingStoreSize = arraySize * rowStride + 8 * rowStride; - break; - case CL_MEM_OBJECT_IMAGE2D_ARRAY: - backingStoreSize = height * arraySize * rowStride + 8 * rowStride; - break; - } - backingStore = mmap(0, backingStoreSize, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, 0, 0); - - // add guard pages - size_t row; - char *p = (char*) backingStore; - char *imagePtr = (char*) backingStore + 4 * rowStride; - for( row = 0; row < 4; row++ ) - { - mprotect( p, rowStride, PROT_NONE ); p += rowStride; - } - p += rowBytes; - size_t sz = (height > 0 ? height : 1) * (depth > 0 ? depth : 1) * (arraySize > 0 ? arraySize : 1); - for( row = 0; row < sz; row++ ) - { - mprotect( p, kPageSize, PROT_NONE ); p += rowStride; - } - p -= rowBytes; - for( row = 0; row < 4; row++ ) - { - mprotect( p, rowStride, PROT_NONE ); p += rowStride; - } - - if( getenv( "CL_ALIGN_RIGHT" ) ) - { - static int spewEnv = 1; - if(spewEnv) - { - log_info( "***CL_ALIGN_RIGHT is set. Aligning images at right edge of page\n" ); - spewEnv = 0; - } - imagePtr += rowBytes - pixelBytes * width; - } - - switch (imageType) - { - case CL_MEM_OBJECT_IMAGE1D: - image = create_image_1d( context, mem_flags | CL_MEM_USE_HOST_PTR, fmt, width, rowStride, imagePtr, NULL, &error ); - break; - case CL_MEM_OBJECT_IMAGE2D: - image = create_image_2d( context, mem_flags | CL_MEM_USE_HOST_PTR, fmt, width, height, rowStride, imagePtr, &error ); - break; - case CL_MEM_OBJECT_IMAGE3D: - image = create_image_3d( context, mem_flags | CL_MEM_USE_HOST_PTR, fmt, width, height, depth, rowStride, height*rowStride, imagePtr, &error ); - break; - case CL_MEM_OBJECT_IMAGE1D_ARRAY: - image = create_image_1d_array( context, mem_flags | CL_MEM_USE_HOST_PTR, fmt, width, arraySize, rowStride, rowStride, imagePtr, &error ); - break; - case CL_MEM_OBJECT_IMAGE2D_ARRAY: - image = create_image_2d_array( context, mem_flags | CL_MEM_USE_HOST_PTR, fmt, width, height, arraySize, rowStride, height*rowStride, imagePtr, &error ); - break; - } - } else { - backingStore = NULL; - switch (imageType) - { - case CL_MEM_OBJECT_IMAGE1D: - image = create_image_1d( context, mem_flags, fmt, width, 0, NULL, NULL, &error ); - break; - case CL_MEM_OBJECT_IMAGE2D: - image = create_image_2d( context, mem_flags, fmt, width, height, 0, NULL, &error ); - break; - case CL_MEM_OBJECT_IMAGE3D: - image = create_image_3d( context, mem_flags, fmt, width, height, depth, 0, 0, NULL, &error );; - break; - case CL_MEM_OBJECT_IMAGE1D_ARRAY: - image = create_image_1d_array( context, mem_flags, fmt, width, arraySize, 0, 0, NULL, &error ); - break; - case CL_MEM_OBJECT_IMAGE2D_ARRAY: - image = create_image_2d_array( context, mem_flags, fmt, width, height, arraySize, 0, 0, NULL, &error ); - break; - } - - } -#else - - backingStore = NULL; - switch (imageType) - { - case CL_MEM_OBJECT_IMAGE1D: - image = create_image_1d( context, mem_flags, fmt, width, 0, NULL, NULL, &error ); - break; - case CL_MEM_OBJECT_IMAGE2D: - image = create_image_2d( context, mem_flags, fmt, width, height, 0, NULL, &error ); - break; - case CL_MEM_OBJECT_IMAGE3D: - image = create_image_3d( context, mem_flags, fmt, width, height, depth, 0, 0, NULL, &error );; - break; - case CL_MEM_OBJECT_IMAGE1D_ARRAY: - image = create_image_1d_array( context, mem_flags, fmt, width, arraySize, 0, 0, NULL, &error ); - break; - case CL_MEM_OBJECT_IMAGE2D_ARRAY: - image = create_image_2d_array( context, mem_flags, fmt, width, height, arraySize, 0, 0, NULL, &error ); - break; - } -#endif - return error; -} - - - -/******* - * clProtectedArray implementation - *******/ -clProtectedArray::clProtectedArray() -{ - mBuffer = mValidBuffer = NULL; -} - -clProtectedArray::clProtectedArray( size_t sizeInBytes ) -{ - mBuffer = mValidBuffer = NULL; - Allocate( sizeInBytes ); -} - -clProtectedArray::~clProtectedArray() -{ - if( mBuffer != NULL ) { -#if defined( __APPLE__ ) - int error = munmap( mBuffer, mRealSize ); - if (error) log_error("WARNING: munmap failed in clProtectedArray.\n"); -#else - free( mBuffer ); -#endif - } -} - -void clProtectedArray::Allocate( size_t sizeInBytes ) -{ - -#if defined( __APPLE__ ) - - // Allocate enough space to: round up our actual allocation to an even number of pages - // and allocate two pages on either side - mRoundedSize = ROUND_SIZE_UP( sizeInBytes, kPageSize ); - mRealSize = mRoundedSize + kPageSize * 2; - - // Use mmap here to ensure we start on a page boundary, so the mprotect calls will work OK - mBuffer = (char *)mmap(0, mRealSize, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, 0, 0); - - mValidBuffer = mBuffer + kPageSize; - - // Protect guard area from access - mprotect( mValidBuffer - kPageSize, kPageSize, PROT_NONE ); - mprotect( mValidBuffer + mRoundedSize, kPageSize, PROT_NONE ); -#else - mRoundedSize = mRealSize = sizeInBytes; - mBuffer = mValidBuffer = (char *)calloc(1, mRealSize); -#endif -} - - diff --git a/test_conformance/compatibility/test_common/harness/typeWrappers.h b/test_conformance/compatibility/test_common/harness/typeWrappers.h deleted file mode 100644 index 32f8966a..00000000 --- a/test_conformance/compatibility/test_common/harness/typeWrappers.h +++ /dev/null @@ -1,333 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef _typeWrappers_h -#define _typeWrappers_h - -#include -#include - -#if !defined(_WIN32) -#include -#endif - -#include "compat.h" -#include -#include "mt19937.h" -#include "errorHelpers.h" -#include "kernelHelpers.h" - -extern "C" cl_uint gReSeed; -extern "C" cl_uint gRandomSeed; - -/* cl_context wrapper */ - -class clContextWrapper -{ - public: - clContextWrapper() { mContext = NULL; } - clContextWrapper( cl_context program ) { mContext = program; } - ~clContextWrapper() { if( mContext != NULL ) clReleaseContext( mContext ); } - - clContextWrapper & operator=( const cl_context &rhs ) { mContext = rhs; return *this; } - operator cl_context() { return mContext; } - - cl_context * operator&() { return &mContext; } - - bool operator==( const cl_context &rhs ) { return mContext == rhs; } - - protected: - - cl_context mContext; -}; - -/* cl_program wrapper */ - -class clProgramWrapper -{ - public: - clProgramWrapper() { mProgram = NULL; } - clProgramWrapper( cl_program program ) { mProgram = program; } - ~clProgramWrapper() { if( mProgram != NULL ) clReleaseProgram( mProgram ); } - - clProgramWrapper & operator=( const cl_program &rhs ) { mProgram = rhs; return *this; } - operator cl_program() { return mProgram; } - - cl_program * operator&() { return &mProgram; } - - bool operator==( const cl_program &rhs ) { return mProgram == rhs; } - - protected: - - cl_program mProgram; -}; - -/* cl_kernel wrapper */ - -class clKernelWrapper -{ - public: - clKernelWrapper() { mKernel = NULL; } - clKernelWrapper( cl_kernel kernel ) { mKernel = kernel; } - ~clKernelWrapper() { if( mKernel != NULL ) clReleaseKernel( mKernel ); } - - clKernelWrapper & operator=( const cl_kernel &rhs ) { mKernel = rhs; return *this; } - operator cl_kernel() { return mKernel; } - - cl_kernel * operator&() { return &mKernel; } - - bool operator==( const cl_kernel &rhs ) { return mKernel == rhs; } - - protected: - - cl_kernel mKernel; -}; - -/* cl_mem (stream) wrapper */ - -class clMemWrapper -{ - public: - clMemWrapper() { mMem = NULL; } - clMemWrapper( cl_mem mem ) { mMem = mem; } - ~clMemWrapper() { if( mMem != NULL ) clReleaseMemObject( mMem ); } - - clMemWrapper & operator=( const cl_mem &rhs ) { mMem = rhs; return *this; } - operator cl_mem() { return mMem; } - - cl_mem * operator&() { return &mMem; } - - bool operator==( const cl_mem &rhs ) { return mMem == rhs; } - - protected: - - cl_mem mMem; -}; - -class clProtectedImage -{ - public: - clProtectedImage() { image = NULL; backingStore = NULL; } - clProtectedImage( cl_context context, cl_mem_flags flags, const cl_image_format *fmt, size_t width, cl_int *errcode_ret ); - clProtectedImage( cl_context context, cl_mem_flags flags, const cl_image_format *fmt, size_t width, size_t height, cl_int *errcode_ret ); - clProtectedImage( cl_context context, cl_mem_flags flags, const cl_image_format *fmt, size_t width, size_t height, size_t depth, cl_int *errcode_ret ); - clProtectedImage( cl_context context, cl_mem_object_type imageType, cl_mem_flags flags, const cl_image_format *fmt, size_t width, size_t height, size_t depth, size_t arraySize, cl_int *errcode_ret ); - ~clProtectedImage() - { - if( image != NULL ) - clReleaseMemObject( image ); - -#if defined( __APPLE__ ) - if(backingStore) - munmap(backingStore, backingStoreSize); -#endif - } - - cl_int Create( cl_context context, cl_mem_flags flags, const cl_image_format *fmt, size_t width ); - cl_int Create( cl_context context, cl_mem_flags flags, const cl_image_format *fmt, size_t width, size_t height ); - cl_int Create( cl_context context, cl_mem_flags flags, const cl_image_format *fmt, size_t width, size_t height, size_t depth ); - cl_int Create( cl_context context, cl_mem_object_type imageType, cl_mem_flags flags, const cl_image_format *fmt, size_t width, size_t height, size_t depth, size_t arraySize ); - - clProtectedImage & operator=( const cl_mem &rhs ) { image = rhs; backingStore = NULL; return *this; } - operator cl_mem() { return image; } - - cl_mem * operator&() { return ℑ } - - bool operator==( const cl_mem &rhs ) { return image == rhs; } - - protected: - void *backingStore; - size_t backingStoreSize; - cl_mem image; -}; - -/* cl_command_queue wrapper */ - -class clCommandQueueWrapper -{ - public: - clCommandQueueWrapper() { mMem = NULL; } - clCommandQueueWrapper( cl_command_queue mem ) { mMem = mem; } - ~clCommandQueueWrapper() { if( mMem != NULL ) {int error = clFinish(mMem); if (error) print_error(error, "clFinish failed"); clReleaseCommandQueue( mMem );} } - - clCommandQueueWrapper & operator=( const cl_command_queue &rhs ) { mMem = rhs; return *this; } - operator cl_command_queue() { return mMem; } - - cl_command_queue * operator&() { return &mMem; } - - bool operator==( const cl_command_queue &rhs ) { return mMem == rhs; } - - protected: - - cl_command_queue mMem; -}; - -/* cl_sampler wrapper */ -class clSamplerWrapper -{ - public: - clSamplerWrapper() { mMem = NULL; } - clSamplerWrapper( cl_sampler mem ) { mMem = mem; } - ~clSamplerWrapper() { if( mMem != NULL ) clReleaseSampler( mMem ); } - - clSamplerWrapper & operator=( const cl_sampler &rhs ) { mMem = rhs; return *this; } - operator cl_sampler() { return mMem; } - - cl_sampler * operator&() { return &mMem; } - - bool operator==( const cl_sampler &rhs ) { return mMem == rhs; } - - protected: - - cl_sampler mMem; -}; - -/* cl_event wrapper */ -class clEventWrapper -{ - public: - clEventWrapper() { mMem = NULL; } - clEventWrapper( cl_event mem ) { mMem = mem; } - ~clEventWrapper() { if( mMem != NULL ) clReleaseEvent( mMem ); } - - clEventWrapper & operator=( const cl_event &rhs ) { mMem = rhs; return *this; } - operator cl_event() { return mMem; } - - cl_event * operator&() { return &mMem; } - - bool operator==( const cl_event &rhs ) { return mMem == rhs; } - - protected: - - cl_event mMem; -}; - -/* Generic protected memory buffer, for verifying access within bounds */ -class clProtectedArray -{ - public: - clProtectedArray(); - clProtectedArray( size_t sizeInBytes ); - virtual ~clProtectedArray(); - - void Allocate( size_t sizeInBytes ); - - operator void *() { return (void *)mValidBuffer; } - operator const void *() const { return (const void *)mValidBuffer; } - - protected: - - char * mBuffer; - char * mValidBuffer; - size_t mRealSize, mRoundedSize; -}; - -class RandomSeed -{ - public: - RandomSeed( cl_uint seed ){ if(seed) log_info( "(seed = %10.10u) ", seed ); mtData = init_genrand(seed); } - ~RandomSeed() - { - if( gReSeed ) - gRandomSeed = genrand_int32( mtData ); - free_mtdata(mtData); - } - - operator MTdata () {return mtData;} - - protected: - MTdata mtData; -}; - -template class BufferOwningPtr -{ - BufferOwningPtr(BufferOwningPtr const &); // do not implement - void operator=(BufferOwningPtr const &); // do not implement - - void *ptr; - void *map; - size_t mapsize; // Bytes allocated total, pointed to by map. - size_t allocsize; // Bytes allocated in unprotected pages, pointed to by ptr. - bool aligned; - public: - explicit BufferOwningPtr(void *p = 0) : ptr(p), map(0), mapsize(0), allocsize(0), aligned(false) {} - explicit BufferOwningPtr(void *p, void *m, size_t s) - : ptr(p), map(m), mapsize(s), allocsize(0), aligned(false) - { -#if ! defined( __APPLE__ ) - if(m) - { - log_error( "ERROR: unhandled code path. BufferOwningPtr allocated with mapped buffer!" ); - abort(); - } -#endif - } - ~BufferOwningPtr() { - if (map) { -#if defined( __APPLE__ ) - int error = munmap(map, mapsize); - if (error) log_error("WARNING: munmap failed in BufferOwningPtr.\n"); -#endif - } else { - if ( aligned ) - { - align_free(ptr); - } - else - { - free(ptr); - } - } - } - void reset(void *p, void *m = 0, size_t mapsize_ = 0, size_t allocsize_ = 0, bool aligned_ = false) { - if (map){ -#if defined( __APPLE__ ) - int error = munmap(map, mapsize); - if (error) log_error("WARNING: munmap failed in BufferOwningPtr.\n"); -#else - log_error( "ERROR: unhandled code path. BufferOwningPtr reset with mapped buffer!" ); - abort(); -#endif - } else { - if ( aligned ) - { - align_free(ptr); - } - else - { - free(ptr); - } - } - ptr = p; - map = m; - mapsize = mapsize_; - allocsize = allocsize_; - aligned = aligned_; -#if ! defined( __APPLE__ ) - if(m) - { - log_error( "ERROR: unhandled code path. BufferOwningPtr allocated with mapped buffer!" ); - abort(); - } -#endif - } - operator T*() { return (T*)ptr; } - - size_t getSize() const { return allocsize; }; -}; - -#endif // _typeWrappers_h - - diff --git a/test_conformance/compatibility/test_conformance/CMakeLists.txt b/test_conformance/compatibility/test_conformance/CMakeLists.txt deleted file mode 100644 index 84858574..00000000 --- a/test_conformance/compatibility/test_conformance/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(api) -add_subdirectory(basic) diff --git a/test_conformance/compatibility/test_conformance/api/CMakeLists.txt b/test_conformance/compatibility/test_conformance/api/CMakeLists.txt deleted file mode 100644 index 4af76989..00000000 --- a/test_conformance/compatibility/test_conformance/api/CMakeLists.txt +++ /dev/null @@ -1,35 +0,0 @@ -set(MODULE_NAME COMPATIBILITY_API) - -set(${MODULE_NAME}_SOURCES - main.c - test_bool.c - test_retain.cpp - test_retain_program.c - test_queries.cpp - test_create_kernels.c - test_kernels.c - test_api_min_max.c - test_kernel_arg_changes.cpp - test_kernel_arg_multi_setup.cpp - test_binary.cpp - test_native_kernel.cpp - test_mem_objects.cpp - test_create_context_from_type.cpp - test_device_min_data_type_align_size_alignment.cpp - test_platform.cpp - test_mem_object_info.cpp - test_null_buffer_arg.c - test_kernel_arg_info.c - test_queue_properties.cpp - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/threadTesting.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/typeWrappers.cpp - ../../test_common/harness/conversions.c - ../../test_common/harness/mt19937.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/imageHelpers.cpp -) - -include(../../../CMakeCommon.txt) diff --git a/test_conformance/compatibility/test_conformance/api/main.c b/test_conformance/compatibility/test_conformance/api/main.c deleted file mode 100644 index 1c431c6b..00000000 --- a/test_conformance/compatibility/test_conformance/api/main.c +++ /dev/null @@ -1,125 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include "procs.h" -#include "../../test_common/harness/testHarness.h" - -#if !defined(_WIN32) -#include -#endif - -// FIXME: To use certain functions in ../../test_common/harness/imageHelpers.h -// (for example, generate_random_image_data()), the tests are required to declare -// the following variables: -cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT; -bool gTestRounding = false; - -test_definition test_list[] = { - ADD_TEST( get_platform_info ), - ADD_TEST( get_sampler_info ), - ADD_TEST( get_command_queue_info ), - ADD_TEST( get_context_info ), - ADD_TEST( get_device_info ), - ADD_TEST( enqueue_task ), - ADD_TEST( binary_get ), - ADD_TEST( binary_create ), - ADD_TEST( kernel_required_group_size ), - - ADD_TEST( release_kernel_order ), - ADD_TEST( release_during_execute ), - - ADD_TEST( load_single_kernel ), - ADD_TEST( load_two_kernels ), - ADD_TEST( load_two_kernels_in_one ), - ADD_TEST( load_two_kernels_manually ), - ADD_TEST( get_program_info_kernel_names ), - ADD_TEST( get_kernel_arg_info ), - ADD_TEST( create_kernels_in_program ), - ADD_TEST( get_kernel_info ), - ADD_TEST( execute_kernel_local_sizes ), - ADD_TEST( set_kernel_arg_by_index ), - ADD_TEST( set_kernel_arg_constant ), - ADD_TEST( set_kernel_arg_struct_array ), - ADD_TEST( kernel_global_constant ), - - ADD_TEST( min_max_thread_dimensions ), - ADD_TEST( min_max_work_items_sizes ), - ADD_TEST( min_max_work_group_size ), - ADD_TEST( min_max_read_image_args ), - ADD_TEST( min_max_write_image_args ), - ADD_TEST( min_max_mem_alloc_size ), - ADD_TEST( min_max_image_2d_width ), - ADD_TEST( min_max_image_2d_height ), - ADD_TEST( min_max_image_3d_width ), - ADD_TEST( min_max_image_3d_height ), - ADD_TEST( min_max_image_3d_depth ), - ADD_TEST( min_max_image_array_size ), - ADD_TEST( min_max_image_buffer_size ), - ADD_TEST( min_max_parameter_size ), - ADD_TEST( min_max_samplers ), - ADD_TEST( min_max_constant_buffer_size ), - ADD_TEST( min_max_constant_args ), - ADD_TEST( min_max_compute_units ), - ADD_TEST( min_max_address_bits ), - ADD_TEST( min_max_single_fp_config ), - ADD_TEST( min_max_double_fp_config ), - ADD_TEST( min_max_local_mem_size ), - ADD_TEST( min_max_kernel_preferred_work_group_size_multiple ), - ADD_TEST( min_max_execution_capabilities ), - ADD_TEST( min_max_queue_properties ), - ADD_TEST( min_max_device_version ), - ADD_TEST( min_max_language_version ), - - ADD_TEST( kernel_arg_changes ), - ADD_TEST( kernel_arg_multi_setup_random ), - - ADD_TEST( native_kernel ), - - ADD_TEST( create_context_from_type ), - - ADD_TEST( platform_extensions ), - ADD_TEST( get_platform_ids ), - ADD_TEST( bool_type ), - - ADD_TEST( repeated_setup_cleanup ), - - ADD_TEST( retain_queue_single ), - ADD_TEST( retain_queue_multiple ), - ADD_TEST( retain_mem_object_single ), - ADD_TEST( retain_mem_object_multiple ), - ADD_TEST( min_data_type_align_size_alignment ), - - ADD_TEST( mem_object_destructor_callback ), - ADD_TEST( null_buffer_arg ), - ADD_TEST( get_buffer_info ), - ADD_TEST( get_image2d_info ), - ADD_TEST( get_image3d_info ), - ADD_TEST( get_image1d_info ), - ADD_TEST( get_image1d_array_info ), - ADD_TEST( get_image2d_array_info ), - ADD_TEST( queue_properties ), -}; - -const int test_num = ARRAY_SIZE( test_list ); - -int main(int argc, const char *argv[]) -{ - return runTestHarness( argc, argv, test_num, test_list, false, false, 0 ); -} - diff --git a/test_conformance/compatibility/test_conformance/api/procs.h b/test_conformance/compatibility/test_conformance/api/procs.h deleted file mode 100644 index f16467ba..00000000 --- a/test_conformance/compatibility/test_conformance/api/procs.h +++ /dev/null @@ -1,109 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/clImageHelper.h" -#include "../../test_common/harness/imageHelpers.h" -extern float calculate_ulperror(float a, float b); - -extern int test_load_single_kernel(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_load_two_kernels(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_load_two_kernels_in_one(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_load_two_kernels_manually(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_get_program_info_kernel_names( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_create_kernels_in_program(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_enqueue_task(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_repeated_setup_cleanup(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_bool_type(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_platform_extensions(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_get_platform_info(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_get_sampler_info(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_get_command_queue_info(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_get_context_info(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_get_device_info(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_kernel_required_group_size(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_binary_get(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_binary_create(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_release_kernel_order(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_release_during_execute(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_get_kernel_info(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_execute_kernel_local_sizes(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_set_kernel_arg_by_index(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_set_kernel_arg_struct(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_set_kernel_arg_constant(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_set_kernel_arg_struct_array(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_kernel_global_constant(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_min_max_thread_dimensions(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_work_items_sizes(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_work_group_size(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_read_image_args(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_write_image_args(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_mem_alloc_size(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_image_2d_width(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_image_2d_height(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_image_3d_width(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_image_3d_height(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_image_3d_depth(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_image_array_size(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_image_buffer_size(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_parameter_size(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_samplers(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_constant_buffer_size(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_constant_args(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_compute_units(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_address_bits(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_single_fp_config(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_double_fp_config(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_local_mem_size(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_kernel_preferred_work_group_size_multiple(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_execution_capabilities(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_queue_properties(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_device_version(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_max_language_version(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_native_kernel(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems ); - -extern int test_create_context_from_type(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_get_platform_ids(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_kernel_arg_changes(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_kernel_arg_multi_setup_random(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_retain_queue_single(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_retain_queue_multiple(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_retain_mem_object_single(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_retain_mem_object_multiple(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_min_data_type_align_size_alignment(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems ); - -extern int test_mem_object_destructor_callback(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_null_buffer_arg( cl_device_id device_id, cl_context context, cl_command_queue queue, int num_elements ); -extern int test_get_buffer_info( cl_device_id deviceID, cl_context context, cl_command_queue ignoreQueue, int num_elements ); -extern int test_get_image2d_info( cl_device_id deviceID, cl_context context, cl_command_queue ignoreQueue, int num_elements ); -extern int test_get_image3d_info( cl_device_id deviceID, cl_context context, cl_command_queue ignoreQueue, int num_elements ); -extern int test_get_image1d_info( cl_device_id deviceID, cl_context context, cl_command_queue ignoreQueue, int num_elements ); -extern int test_get_image1d_array_info( cl_device_id deviceID, cl_context context, cl_command_queue ignoreQueue, int num_elements ); -extern int test_get_image2d_array_info( cl_device_id deviceID, cl_context context, cl_command_queue ignoreQueue, int num_elements ); -extern int test_get_kernel_arg_info( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); -extern int test_queue_properties( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); - diff --git a/test_conformance/compatibility/test_conformance/api/test_binary.cpp b/test_conformance/compatibility/test_conformance/api/test_binary.cpp deleted file mode 100644 index 41431252..00000000 --- a/test_conformance/compatibility/test_conformance/api/test_binary.cpp +++ /dev/null @@ -1,226 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "testBase.h" - -static const char *sample_binary_kernel_source[] = { -"__kernel void sample_test(__global float *src, __global int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = (int)src[tid] + 1;\n" -"\n" -"}\n" }; - - -int test_binary_get(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - clProgramWrapper program; - size_t binarySize; - - - program = clCreateProgramWithSource( context, 1, sample_binary_kernel_source, NULL, &error ); - test_error( error, "Unable to create program from source" ); - - // Build so we have a binary to get - error = clBuildProgram( program, 1, &deviceID, NULL, NULL, NULL ); - test_error( error, "Unable to build test program" ); - - // Get the size of the resulting binary (only one device) - error = clGetProgramInfo( program, CL_PROGRAM_BINARY_SIZES, sizeof( binarySize ), &binarySize, NULL ); - test_error( error, "Unable to get binary size" ); - - // Sanity check - if( binarySize == 0 ) - { - log_error( "ERROR: Binary size of program is zero\n" ); - return -1; - } - - // Create a buffer and get the actual binary - unsigned char *binary; - binary = (unsigned char*)malloc(sizeof(unsigned char)*binarySize); - unsigned char *buffers[ 1 ] = { binary }; - - // Do another sanity check here first - size_t size; - error = clGetProgramInfo( program, CL_PROGRAM_BINARIES, 0, NULL, &size ); - test_error( error, "Unable to get expected size of binaries array" ); - if( size != sizeof( buffers ) ) - { - log_error( "ERROR: Expected size of binaries array in clGetProgramInfo is incorrect (should be %d, got %d)\n", (int)sizeof( buffers ), (int)size ); - free(binary); - return -1; - } - - error = clGetProgramInfo( program, CL_PROGRAM_BINARIES, sizeof( buffers ), &buffers, NULL ); - test_error( error, "Unable to get program binary" ); - - // No way to verify the binary is correct, so just be good with that - free(binary); - return 0; -} - - -int test_binary_create(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - /* To test this in a self-contained fashion, we have to create a program with - source, then get the binary, then use that binary to reload the program, and then verify */ - - int error; - clProgramWrapper program, program_from_binary; - size_t binarySize; - - - program = clCreateProgramWithSource( context, 1, sample_binary_kernel_source, NULL, &error ); - test_error( error, "Unable to create program from source" ); - - // Build so we have a binary to get - error = clBuildProgram( program, 1, &deviceID, NULL, NULL, NULL ); - test_error( error, "Unable to build test program" ); - - // Get the size of the resulting binary (only one device) - error = clGetProgramInfo( program, CL_PROGRAM_BINARY_SIZES, sizeof( binarySize ), &binarySize, NULL ); - test_error( error, "Unable to get binary size" ); - - // Sanity check - if( binarySize == 0 ) - { - log_error( "ERROR: Binary size of program is zero\n" ); - return -1; - } - - // Create a buffer and get the actual binary - unsigned char *binary = (unsigned char*)malloc(binarySize); - const unsigned char *buffers[ 1 ] = { binary }; - - error = clGetProgramInfo( program, CL_PROGRAM_BINARIES, sizeof( buffers ), &buffers, NULL ); - test_error( error, "Unable to get program binary" ); - - cl_int loadErrors[ 1 ]; - program_from_binary = clCreateProgramWithBinary( context, 1, &deviceID, &binarySize, buffers, loadErrors, &error ); - test_error( error, "Unable to load valid program binary" ); - test_error( loadErrors[ 0 ], "Unable to load valid device binary into program" ); - - error = clBuildProgram( program_from_binary, 1, &deviceID, NULL, NULL, NULL ); - test_error( error, "Unable to build binary program" ); - - // Get the size of the binary built from the first binary - size_t binary2Size; - error = clGetProgramInfo( program_from_binary, CL_PROGRAM_BINARY_SIZES, sizeof( binary2Size ), &binary2Size, NULL ); - test_error( error, "Unable to get size for the binary program" ); - - // Now get the binary one more time and verify it loaded the right binary - unsigned char *binary2 = (unsigned char*)malloc(binary2Size); - buffers[ 0 ] = binary2; - error = clGetProgramInfo( program_from_binary, CL_PROGRAM_BINARIES, sizeof( buffers ), &buffers, NULL ); - test_error( error, "Unable to get program binary second time" ); - - // Try again, this time without passing the status ptr in, to make sure we still - // get a valid binary - clProgramWrapper programWithoutStatus = clCreateProgramWithBinary( context, 1, &deviceID, &binary2Size, buffers, NULL, &error ); - test_error( error, "Unable to load valid program binary when binary_status pointer is NULL" ); - - error = clBuildProgram( programWithoutStatus, 1, &deviceID, NULL, NULL, NULL ); - test_error( error, "Unable to build binary program created without binary_status" ); - - // Get the size of the binary created without passing binary_status - size_t binary3Size; - error = clGetProgramInfo( programWithoutStatus, CL_PROGRAM_BINARY_SIZES, sizeof( binary3Size ), &binary3Size, NULL ); - test_error( error, "Unable to get size for the binary program created without binary_status" ); - - // Now get the binary one more time - unsigned char *binary3 = (unsigned char*)malloc(binary3Size); - buffers[ 0 ] = binary3; - error = clGetProgramInfo( programWithoutStatus, CL_PROGRAM_BINARIES, sizeof( buffers ), &buffers, NULL ); - test_error( error, "Unable to get program binary from the program created without binary_status" ); - - // We no longer need these intermediate binaries - free(binary); - free(binary2); - free(binary3); - - // Now execute them both to see that they both do the same thing. - clMemWrapper in, out, out_binary; - clKernelWrapper kernel, kernel_binary; - cl_int *out_data, *out_data_binary; - cl_float *in_data; - size_t size_to_run = 1000; - - // Allocate some data - in_data = (cl_float*)malloc(sizeof(cl_float)*size_to_run); - out_data = (cl_int*)malloc(sizeof(cl_int)*size_to_run); - out_data_binary = (cl_int*)malloc(sizeof(cl_int)*size_to_run); - memset(out_data, 0, sizeof(cl_int)*size_to_run); - memset(out_data_binary, 0, sizeof(cl_int)*size_to_run); - for (size_t i=0; i -0.5f);\n" - " if(myBool)\n" - " {\n" - " dst[tid] = (int)src[tid];\n" - " }\n" - " else\n" - " {\n" - " dst[tid] = 0;\n" - " }\n" - "\n" - "}\n" -}; - -int test_bool_type(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - - cl_program program; - cl_kernel kernel; - - int err = create_single_kernel_helper(context, - &program, - &kernel, - 1, kernel_with_bool, - "kernel_with_bool" ); - return err; -} - diff --git a/test_conformance/compatibility/test_conformance/api/test_create_context_from_type.cpp b/test_conformance/compatibility/test_conformance/api/test_create_context_from_type.cpp deleted file mode 100644 index 2339aad8..00000000 --- a/test_conformance/compatibility/test_conformance/api/test_create_context_from_type.cpp +++ /dev/null @@ -1,130 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "testBase.h" - -#ifndef _WIN32 -#include -#endif - -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/conversions.h" - -extern cl_uint gRandomSeed; - -int test_create_context_from_type(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - clProgramWrapper program; - clKernelWrapper kernel; - clMemWrapper streams[2]; - clContextWrapper context_to_test; - clCommandQueueWrapper queue_to_test; - size_t threads[1], localThreads[1]; - cl_float inputData[10]; - cl_int outputData[10]; - int i; - RandomSeed seed( gRandomSeed ); - - const char *sample_single_test_kernel[] = { - "__kernel void sample_test(__global float *src, __global int *dst)\n" - "{\n" - " int tid = get_global_id(0);\n" - "\n" - " dst[tid] = (int)src[tid];\n" - "\n" - "}\n" }; - - cl_device_type type; - error = clGetDeviceInfo(deviceID, CL_DEVICE_TYPE, sizeof(type), &type, NULL); - test_error(error, "clGetDeviceInfo for CL_DEVICE_TYPE failed\n"); - - cl_platform_id platform; - error = clGetDeviceInfo(deviceID, CL_DEVICE_PLATFORM, sizeof(platform), &platform, NULL); - test_error(error, "clGetDeviceInfo for CL_DEVICE_PLATFORM failed\n"); - - cl_context_properties properties[3] = { - (cl_context_properties)CL_CONTEXT_PLATFORM, - (cl_context_properties)platform, - NULL - }; - - context_to_test = clCreateContextFromType(properties, type, notify_callback, NULL, &error); - test_error(error, "clCreateContextFromType failed"); - if (context_to_test == NULL) { - log_error("clCreateContextFromType returned NULL, but error was CL_SUCCESS."); - return -1; - } - - queue_to_test = clCreateCommandQueue(context_to_test, deviceID, NULL, &error); - test_error(error, "clCreateCommandQueue failed"); - if (queue_to_test == NULL) { - log_error("clCreateCommandQueue returned NULL, but error was CL_SUCCESS."); - return -1; - } - - /* Create a kernel to test with */ - if( create_single_kernel_helper( context_to_test, &program, &kernel, 1, sample_single_test_kernel, "sample_test" ) != 0 ) - { - return -1; - } - - /* Create some I/O streams */ - streams[0] = clCreateBuffer(context_to_test, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_float) * 10, NULL, &error); - test_error( error, "Creating test array failed" ); - streams[1] = clCreateBuffer(context_to_test, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int) * 10, NULL, &error); - test_error( error, "Creating test array failed" ); - - /* Write some test data */ - memset( outputData, 0, sizeof( outputData ) ); - - for (i=0; i<10; i++) - inputData[i] = get_random_float(-(float) 0x7fffffff, (float) 0x7fffffff, seed); - - error = clEnqueueWriteBuffer(queue_to_test, streams[0], CL_TRUE, 0, sizeof(cl_float)*10, (void *)inputData, 0, NULL, NULL); - test_error( error, "Unable to set testing kernel data" ); - - /* Test setting the arguments by index manually */ - error = clSetKernelArg(kernel, 1, sizeof( streams[1] ), &streams[1]); - test_error( error, "Unable to set indexed kernel arguments" ); - error = clSetKernelArg(kernel, 0, sizeof( streams[0] ), &streams[0]); - test_error( error, "Unable to set indexed kernel arguments" ); - - - /* Test running the kernel and verifying it */ - threads[0] = (size_t)10; - - error = get_max_common_work_group_size( context_to_test, kernel, threads[0], &localThreads[0] ); - test_error( error, "Unable to get work group size to use" ); - - error = clEnqueueNDRangeKernel( queue_to_test, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); - test_error( error, "Kernel execution failed" ); - - error = clEnqueueReadBuffer( queue_to_test, streams[1], CL_TRUE, 0, sizeof(cl_int)*10, (void *)outputData, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - - for (i=0; i<10; i++) - { - if (outputData[i] != (int)inputData[i]) - { - log_error( "ERROR: Data did not verify on first pass!\n" ); - return -1; - } - } - - return 0; -} - - diff --git a/test_conformance/compatibility/test_conformance/api/test_create_kernels.c b/test_conformance/compatibility/test_conformance/api/test_create_kernels.c deleted file mode 100644 index 438300b1..00000000 --- a/test_conformance/compatibility/test_conformance/api/test_create_kernels.c +++ /dev/null @@ -1,643 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "testBase.h" -#include "../../test_common/harness/testHarness.h" - - -const char *sample_single_kernel[] = { - "__kernel void sample_test(__global float *src, __global int *dst)\n" - "{\n" - " int tid = get_global_id(0);\n" - "\n" - " dst[tid] = (int)src[tid];\n" - "\n" - "}\n" }; - -size_t sample_single_kernel_lengths[1]; - -const char *sample_two_kernels[] = { - "__kernel void sample_test(__global float *src, __global int *dst)\n" - "{\n" - " int tid = get_global_id(0);\n" - "\n" - " dst[tid] = (int)src[tid];\n" - "\n" - "}\n", - "__kernel void sample_test2(__global int *src, __global float *dst)\n" - "{\n" - " int tid = get_global_id(0);\n" - "\n" - " dst[tid] = (float)src[tid];\n" - "\n" - "}\n" }; - -size_t sample_two_kernel_lengths[2]; - -const char *sample_two_kernels_in_1[] = { - "__kernel void sample_test(__global float *src, __global int *dst)\n" - "{\n" - " int tid = get_global_id(0);\n" - "\n" - " dst[tid] = (int)src[tid];\n" - "\n" - "}\n" - "__kernel void sample_test2(__global int *src, __global float *dst)\n" - "{\n" - " int tid = get_global_id(0);\n" - "\n" - " dst[tid] = (float)src[tid];\n" - "\n" - "}\n" }; - -size_t sample_two_kernels_in_1_lengths[1]; - - -const char *repeate_test_kernel = -"__kernel void test_kernel(__global int *src, __global int *dst)\n" -"{\n" -" dst[get_global_id(0)] = src[get_global_id(0)]+1;\n" -"}\n"; - - - -int test_load_single_kernel(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - clProgramWrapper program; - cl_program testProgram; - clKernelWrapper kernel; - cl_context testContext; - unsigned int numKernels; - cl_char testName[512]; - cl_uint testArgCount; - size_t realSize; - - - /* Preprocess: calc the length of each source file line */ - sample_single_kernel_lengths[ 0 ] = strlen( sample_single_kernel[ 0 ] ); - - /* Create a program */ - program = clCreateProgramWithSource( context, 1, sample_single_kernel, sample_single_kernel_lengths, &error ); - if( program == NULL || error != CL_SUCCESS ) - { - print_error( error, "Unable to create single kernel program" ); - return -1; - } - - error = clBuildProgram( program, 1, &deviceID, NULL, NULL, NULL ); - test_error( error, "Unable to build single kernel program" ); - error = clCreateKernelsInProgram(program, 1, &kernel, &numKernels); - test_error( error, "Unable to create single kernel program" ); - - /* Check program and context pointers */ - error = clGetKernelInfo( kernel, CL_KERNEL_PROGRAM, sizeof( cl_program ), &testProgram, &realSize ); - test_error( error, "Unable to get kernel's program" ); - if( (cl_program)testProgram != (cl_program)program ) - { - log_error( "ERROR: Returned kernel's program does not match program used to create it! (Got %p, expected %p)\n", (cl_program)testProgram, (cl_program)program ); - return -1; - } - if( realSize != sizeof( cl_program ) ) - { - log_error( "ERROR: Returned size of kernel's program does not match expected size (expected %d, got %d)\n", (int)sizeof( cl_program ), (int)realSize ); - return -1; - } - - error = clGetKernelInfo( kernel, CL_KERNEL_CONTEXT, sizeof( cl_context ), &testContext, &realSize ); - test_error( error, "Unable to get kernel's context" ); - if( (cl_context)testContext != (cl_context)context ) - { - log_error( "ERROR: Returned kernel's context does not match program used to create it! (Got %p, expected %p)\n", (cl_context)testContext, (cl_context)context ); - return -1; - } - if( realSize != sizeof( cl_context ) ) - { - log_error( "ERROR: Returned size of kernel's context does not match expected size (expected %d, got %d)\n", (int)sizeof( cl_context ), (int)realSize ); - return -1; - } - - /* Test arg count */ - error = clGetKernelInfo( kernel, CL_KERNEL_NUM_ARGS, 0, NULL, &realSize ); - test_error( error, "Unable to get size of arg count info from kernel" ); - - if( realSize != sizeof( testArgCount ) ) - { - log_error( "ERROR: size of arg count not valid! %d\n", (int)realSize ); - return -1; - } - - error = clGetKernelInfo( kernel, CL_KERNEL_NUM_ARGS, sizeof( testArgCount ), &testArgCount, NULL ); - test_error( error, "Unable to get arg count from kernel" ); - - if( testArgCount != 2 ) - { - log_error( "ERROR: Kernel arg count does not match!\n" ); - return -1; - } - - - /* Test function name */ - error = clGetKernelInfo( kernel, CL_KERNEL_FUNCTION_NAME, sizeof( testName ), testName, &realSize ); - test_error( error, "Unable to get name from kernel" ); - - if( strcmp( (char *)testName, "sample_test" ) != 0 ) - { - log_error( "ERROR: Kernel names do not match!\n" ); - return -1; - } - if( realSize != strlen( (char *)testName ) + 1 ) - { - log_error( "ERROR: Length of kernel name returned does not validate (expected %d, got %d)\n", (int)strlen( (char *)testName ) + 1, (int)realSize ); - return -1; - } - - /* All done */ - - return 0; -} - -int test_load_two_kernels(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - clProgramWrapper program; - clKernelWrapper kernel[2]; - unsigned int numKernels; - cl_char testName[ 512 ]; - cl_uint testArgCount; - - - /* Preprocess: calc the length of each source file line */ - sample_two_kernel_lengths[ 0 ] = strlen( sample_two_kernels[ 0 ] ); - sample_two_kernel_lengths[ 1 ] = strlen( sample_two_kernels[ 1 ] ); - - /* Now create a test program */ - program = clCreateProgramWithSource( context, 2, sample_two_kernels, sample_two_kernel_lengths, &error ); - if( program == NULL || error != CL_SUCCESS ) - { - print_error( error, "Unable to create dual kernel program!" ); - return -1; - } - error = clBuildProgram( program, 1, &deviceID, NULL, NULL, NULL ); - test_error( error, "Unable to build dual kernel program" ); - error = clCreateKernelsInProgram(program, 2, &kernel[0], &numKernels); - test_error( error, "Unable to create dual kernel program" ); - - if( numKernels != 2 ) - { - log_error( "ERROR: wrong # of kernels! (%d)\n", numKernels ); - return -1; - } - - /* Check first kernel */ - error = clGetKernelInfo( kernel[0], CL_KERNEL_FUNCTION_NAME, sizeof( testName ), testName, NULL ); - test_error( error, "Unable to get function name from kernel" ); - - int found_kernel1 = 0, found_kernel2 = 0; - - if( strcmp( (char *)testName, "sample_test" ) == 0 ) { - found_kernel1 = 1; - } else if( strcmp( (char *)testName, "sample_test2" ) == 0 ) { - found_kernel2 = 1; - } else { - log_error( "ERROR: Invalid kernel name returned: \"%s\" expected \"%s\" or \"%s\".\n", testName, "sample_test", "sample_test2"); - return -1; - } - - error = clGetKernelInfo( kernel[1], CL_KERNEL_FUNCTION_NAME, sizeof( testName ), testName, NULL ); - test_error( error, "Unable to get function name from second kernel" ); - - if( strcmp( (char *)testName, "sample_test" ) == 0 ) { - if (found_kernel1) { - log_error("Kernel \"%s\" returned twice.\n", (char *)testName); - return -1; - } - found_kernel1 = 1; - } else if( strcmp( (char *)testName, "sample_test2" ) == 0 ) { - if (found_kernel2) { - log_error("Kernel \"%s\" returned twice.\n", (char *)testName); - return -1; - } - found_kernel2 = 1; - } else { - log_error( "ERROR: Invalid kernel name returned: \"%s\" expected \"%s\" or \"%s\".\n", testName, "sample_test", "sample_test2"); - return -1; - } - - if( !found_kernel1 || !found_kernel2 ) - { - log_error( "ERROR: Kernel names do not match.\n" ); - if (!found_kernel1) - log_error("Kernel \"%s\" not returned.\n", "sample_test"); - if (!found_kernel2) - log_error("Kernel \"%s\" not returned.\n", "sample_test"); - return -1; - } - - error = clGetKernelInfo( kernel[0], CL_KERNEL_NUM_ARGS, sizeof( testArgCount ), &testArgCount, NULL ); - test_error( error, "Unable to get arg count from kernel" ); - - if( testArgCount != 2 ) - { - log_error( "ERROR: wrong # of args for kernel\n" ); - return -1; - } - - /* All done */ - return 0; -} - -int test_load_two_kernels_in_one(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - clProgramWrapper program; - clKernelWrapper kernel[2]; - unsigned int numKernels; - cl_char testName[512]; - cl_uint testArgCount; - - - /* Preprocess: calc the length of each source file line */ - sample_two_kernels_in_1_lengths[ 0 ] = strlen( sample_two_kernels_in_1[ 0 ] ); - - /* Now create a test program */ - program = clCreateProgramWithSource( context, 1, sample_two_kernels_in_1, sample_two_kernels_in_1_lengths, &error ); - if( program == NULL || error != CL_SUCCESS ) - { - print_error( error, "Unable to create dual kernel program" ); - return -1; - } - error = clBuildProgram( program, 1, &deviceID, NULL, NULL, NULL ); - test_error( error, "Unable to build dual kernel program" ); - error = clCreateKernelsInProgram(program, 2, &kernel[0], &numKernels); - test_error( error, "Unable to create dual kernel program" ); - - if( numKernels != 2 ) - { - log_error( "ERROR: wrong # of kernels! (%d)\n", numKernels ); - return -1; - } - - /* Check first kernel */ - error = clGetKernelInfo( kernel[0], CL_KERNEL_FUNCTION_NAME, sizeof( testName ), testName, NULL ); - test_error( error, "Unable to get function name from kernel" ); - - int found_kernel1 = 0, found_kernel2 = 0; - - if( strcmp( (char *)testName, "sample_test" ) == 0 ) { - found_kernel1 = 1; - } else if( strcmp( (char *)testName, "sample_test2" ) == 0 ) { - found_kernel2 = 1; - } else { - log_error( "ERROR: Invalid kernel name returned: \"%s\" expected \"%s\" or \"%s\".\n", testName, "sample_test", "sample_test2"); - return -1; - } - - error = clGetKernelInfo( kernel[0], CL_KERNEL_NUM_ARGS, sizeof( testArgCount ), &testArgCount, NULL ); - test_error( error, "Unable to get arg count from kernel" ); - - if( testArgCount != 2 ) - { - log_error( "ERROR: wrong # of args for kernel\n" ); - return -1; - } - - /* Check second kernel */ - error = clGetKernelInfo( kernel[1], CL_KERNEL_FUNCTION_NAME, sizeof( testName ), testName, NULL ); - test_error( error, "Unable to get function name from kernel" ); - - if( strcmp( (char *)testName, "sample_test" ) == 0 ) { - if (found_kernel1) { - log_error("Kernel \"%s\" returned twice.\n", (char *)testName); - return -1; - } - found_kernel1 = 1; - } else if( strcmp( (char *)testName, "sample_test2" ) == 0 ) { - if (found_kernel2) { - log_error("Kernel \"%s\" returned twice.\n", (char *)testName); - return -1; - } - found_kernel2 = 1; - } else { - log_error( "ERROR: Invalid kernel name returned: \"%s\" expected \"%s\" or \"%s\".\n", testName, "sample_test", "sample_test2"); - return -1; - } - - if( !found_kernel1 || !found_kernel2 ) - { - log_error( "ERROR: Kernel names do not match.\n" ); - if (!found_kernel1) - log_error("Kernel \"%s\" not returned.\n", "sample_test"); - if (!found_kernel2) - log_error("Kernel \"%s\" not returned.\n", "sample_test"); - return -1; - } - - /* All done */ - return 0; -} - -int test_load_two_kernels_manually( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - clProgramWrapper program; - clKernelWrapper kernel1, kernel2; - int error; - - - /* Now create a test program */ - program = clCreateProgramWithSource( context, 1, sample_two_kernels_in_1, NULL, &error ); - if( program == NULL || error != CL_SUCCESS ) - { - print_error( error, "Unable to create dual kernel program" ); - return -1; - } - - /* Compile the program */ - error = clBuildProgram( program, 1, &deviceID, NULL, NULL, NULL ); - test_error( error, "Unable to build kernel program" ); - - /* Try manually creating kernels (backwards just in case) */ - kernel1 = clCreateKernel( program, "sample_test2", &error ); - - if( kernel1 == NULL || error != CL_SUCCESS ) - { - print_error( error, "Could not get kernel 1" ); - return -1; - } - - kernel2 = clCreateKernel( program, "sample_test", &error ); - - if( kernel2 == NULL ) - { - print_error( error, "Could not get kernel 2" ); - return -1; - } - - return 0; -} - -int test_get_program_info_kernel_names( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - clProgramWrapper program; - clKernelWrapper kernel1, kernel2; - int error; - size_t i; - - /* Now create a test program */ - program = clCreateProgramWithSource( context, 1, sample_two_kernels_in_1, NULL, &error ); - if( program == NULL || error != CL_SUCCESS ) - { - print_error( error, "Unable to create dual kernel program" ); - return -1; - } - - /* Compile the program */ - error = clBuildProgram( program, 1, &deviceID, NULL, NULL, NULL ); - test_error( error, "Unable to build kernel program" ); - - /* Lookup the number of kernels in the program. */ - size_t total_kernels = 0; - error = clGetProgramInfo(program, CL_PROGRAM_NUM_KERNELS, sizeof(size_t),&total_kernels,NULL); - test_error( error, "Unable to get program info num kernels"); - - if (total_kernels != 2) - { - print_error( error, "Program did not contain two kernels" ); - return -1; - } - - /* Lookup the kernel names. */ - const char* actual_names[] = { "sample_test;sample_test2", "sample_test2;sample_test"} ; - - size_t kernel_names_len = 0; - error = clGetProgramInfo(program,CL_PROGRAM_KERNEL_NAMES,0,NULL,&kernel_names_len); - test_error( error, "Unable to get length of kernel names list." ); - - if (kernel_names_len != (strlen(actual_names[0])+1)) - { - print_error( error, "Kernel names length did not match"); - return -1; - } - - const size_t len = (kernel_names_len+1)*sizeof(char); - char* kernel_names = (char*)malloc(len); - error = clGetProgramInfo(program,CL_PROGRAM_KERNEL_NAMES,len,kernel_names,&kernel_names_len); - test_error( error, "Unable to get kernel names list." ); - - /* Check to see if the kernel name array is null terminated. */ - if (kernel_names[kernel_names_len-1] != '\0') - { - free(kernel_names); - print_error( error, "Kernel name list was not null terminated"); - return -1; - } - - /* Check to see if the correct kernel name string was returned. */ - for( i = 0; i < sizeof( actual_names ) / sizeof( actual_names[0] ); i++ ) - if( 0 == strcmp(actual_names[i],kernel_names) ) - break; - - if (i == sizeof( actual_names ) / sizeof( actual_names[0] ) ) - { - free(kernel_names); - log_error( "Kernel names \"%s\" did not match:\n", kernel_names ); - for( i = 0; i < sizeof( actual_names ) / sizeof( actual_names[0] ); i++ ) - log_error( "\t\t\"%s\"\n", actual_names[0] ); - return -1; - } - free(kernel_names); - - /* Try manually creating kernels (backwards just in case) */ - kernel1 = clCreateKernel( program, "sample_test", &error ); - if( kernel1 == NULL || error != CL_SUCCESS ) - { - print_error( error, "Could not get kernel 1" ); - return -1; - } - - kernel2 = clCreateKernel( program, "sample_test2", &error ); - if( kernel2 == NULL ) - { - print_error( error, "Could not get kernel 2" ); - return -1; - } - - return 0; -} - -static const char *single_task_kernel[] = { - "__kernel void sample_test(__global int *dst, int count)\n" - "{\n" - " int tid = get_global_id(0);\n" - "\n" - " for( int i = 0; i < count; i++ )\n" - " dst[i] = tid + i;\n" - "\n" - "}\n" }; - -int test_enqueue_task(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - clProgramWrapper program; - clKernelWrapper kernel; - clMemWrapper output; - cl_int count; - - - if( create_single_kernel_helper( context, &program, &kernel, 1, single_task_kernel, "sample_test" ) ) - return -1; - - // Create args - count = 100; - output = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof( cl_int ) * count, NULL, &error ); - test_error( error, "Unable to create output buffer" ); - - error = clSetKernelArg( kernel, 0, sizeof( cl_mem ), &output ); - test_error( error, "Unable to set kernel argument" ); - error = clSetKernelArg( kernel, 1, sizeof( cl_int ), &count ); - test_error( error, "Unable to set kernel argument" ); - - // Run task - error = clEnqueueTask( queue, kernel, 0, NULL, NULL ); - test_error( error, "Unable to run task" ); - - // Read results - cl_int *results = (cl_int*)malloc(sizeof(cl_int)*count); - error = clEnqueueReadBuffer( queue, output, CL_TRUE, 0, sizeof( cl_int ) * count, results, 0, NULL, NULL ); - test_error( error, "Unable to read results" ); - - // Validate - for( cl_int i = 0; i < count; i++ ) - { - if( results[ i ] != i ) - { - log_error( "ERROR: Task result value %d did not validate! Expected %d, got %d\n", (int)i, (int)i, (int)results[ i ] ); - free(results); - return -1; - } - } - - /* All done */ - free(results); - return 0; -} - - - -#define TEST_SIZE 1000 -int test_repeated_setup_cleanup(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - - cl_context local_context; - cl_command_queue local_queue; - cl_program local_program; - cl_kernel local_kernel; - cl_mem local_mem_in, local_mem_out; - cl_event local_event; - size_t global_dim[3]; - int i, j, error; - global_dim[0] = TEST_SIZE; - global_dim[1] = 1; global_dim[2] = 1; - cl_int *inData, *outData; - cl_int status; - - inData = (cl_int*)malloc(sizeof(cl_int)*TEST_SIZE); - outData = (cl_int*)malloc(sizeof(cl_int)*TEST_SIZE); - for (i=0; i -#endif - -int IsAPowerOfTwo( unsigned long x ) -{ - return 0 == (x & (x-1)); -} - - -int test_min_data_type_align_size_alignment(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems ) -{ - cl_uint min_alignment; - - if (gHasLong) - min_alignment = sizeof(cl_long)*16; - else - min_alignment = sizeof(cl_int)*16; - - int error = 0; - cl_uint alignment; - - error = clGetDeviceInfo(device, CL_DEVICE_MEM_BASE_ADDR_ALIGN, sizeof(alignment), &alignment, NULL); - test_error(error, "clGetDeviceInfo for CL_DEVICE_MEM_BASE_ADDR_ALIGN failed"); - log_info("Device reported CL_DEVICE_MEM_BASE_ADDR_ALIGN = %lu bits.\n", (unsigned long)alignment); - - // Verify the size is large enough - if (alignment < min_alignment*8) { - log_error("ERROR: alignment too small. Minimum alignment for %s16 is %lu bits, device reported %lu bits.", - (gHasLong) ? "long" : "int", - (unsigned long)(min_alignment*8), (unsigned long)alignment); - return -1; - } - - // Verify the size is a power of two - if (!IsAPowerOfTwo((unsigned long)alignment)) { - log_error("ERROR: alignment is not a power of two.\n"); - return -1; - } - - return 0; - -} diff --git a/test_conformance/compatibility/test_conformance/api/test_kernel_arg_changes.cpp b/test_conformance/compatibility/test_conformance/api/test_kernel_arg_changes.cpp deleted file mode 100644 index b7aba632..00000000 --- a/test_conformance/compatibility/test_conformance/api/test_kernel_arg_changes.cpp +++ /dev/null @@ -1,141 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "testBase.h" - -extern "C" { extern cl_uint gRandomSeed;} - -// This test is designed to stress changing kernel arguments between execute calls (that are asynchronous and thus -// potentially overlapping) to make sure each kernel gets the right arguments - -// Note: put a delay loop in the kernel to make sure we have time to queue the next kernel before this one finishes -const char *inspect_image_kernel_source[] = { -"__kernel void sample_test(read_only image2d_t src, __global int *outDimensions )\n" -"{\n" -" int tid = get_global_id(0), i;\n" -" for( i = 0; i < 100000; i++ ); \n" -" outDimensions[tid * 2] = get_image_width(src) * tid;\n" -" outDimensions[tid * 2 + 1] = get_image_height(src) * tid;\n" -"\n" -"}\n" }; - -#define NUM_TRIES 100 -#define NUM_THREADS 2048 - -int test_kernel_arg_changes(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) -{ - clProgramWrapper program; - clKernelWrapper kernel; - int error, i; - clMemWrapper images[ NUM_TRIES ]; - size_t sizes[ NUM_TRIES ][ 2 ]; - clMemWrapper results[ NUM_TRIES ]; - cl_image_format imageFormat; - size_t maxWidth, maxHeight; - size_t threads[1], localThreads[1]; - cl_int resultArray[ NUM_THREADS * 2 ]; - char errStr[ 128 ]; - RandomSeed seed( gRandomSeed ); - - - PASSIVE_REQUIRE_IMAGE_SUPPORT( device ) - - // Just get any ol format to test with - error = get_8_bit_image_format( context, CL_MEM_OBJECT_IMAGE2D, CL_MEM_READ_WRITE, 0, &imageFormat ); - test_error( error, "Unable to obtain suitable image format to test with!" ); - - // Create our testing kernel - error = create_single_kernel_helper( context, &program, &kernel, 1, inspect_image_kernel_source, "sample_test" ); - test_error( error, "Unable to create testing kernel" ); - - // Get max dimensions for each of our images - error = clGetDeviceInfo( device, CL_DEVICE_IMAGE2D_MAX_WIDTH, sizeof( maxWidth ), &maxWidth, NULL ); - error |= clGetDeviceInfo( device, CL_DEVICE_IMAGE2D_MAX_HEIGHT, sizeof( maxHeight ), &maxHeight, NULL ); - test_error( error, "Unable to get max image dimensions for device" ); - - // Get the number of threads we'll be able to run - threads[0] = NUM_THREADS; - error = get_max_common_work_group_size( context, kernel, threads[0], &localThreads[0] ); - test_error( error, "Unable to get work group size for kernel" ); - - // Create a variety of images and output arrays - for( i = 0; i < NUM_TRIES; i++ ) - { - sizes[ i ][ 0 ] = genrand_int32(seed) % (maxWidth/32) + 1; - sizes[ i ][ 1 ] = genrand_int32(seed) % (maxHeight/32) + 1; - - images[ i ] = create_image_2d( context, (cl_mem_flags)(CL_MEM_READ_ONLY), - &imageFormat, sizes[ i ][ 0], sizes[ i ][ 1 ], 0, NULL, &error ); - if( images[i] == NULL ) - { - log_error("Failed to create image %d of size %d x %d (%s).\n", i, (int)sizes[i][0], (int)sizes[i][1], IGetErrorString( error )); - return -1; - } - results[ i ] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof( cl_int ) * threads[0] * 2, NULL, &error ); - if( results[i] == NULL) - { - log_error("Failed to create array %d of size %d.\n", i, (int)threads[0]*2); - return -1; - } - } - - // Start setting arguments and executing kernels - for( i = 0; i < NUM_TRIES; i++ ) - { - // Set the arguments for this try - error = clSetKernelArg( kernel, 0, sizeof( cl_mem ), &images[ i ] ); - sprintf( errStr, "Unable to set argument 0 for kernel try %d", i ); - test_error( error, errStr ); - - error = clSetKernelArg( kernel, 1, sizeof( cl_mem ), &results[ i ] ); - sprintf( errStr, "Unable to set argument 1 for kernel try %d", i ); - test_error( error, errStr ); - - // Queue up execution - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); - sprintf( errStr, "Unable to execute kernel try %d", i ); - test_error( error, errStr ); - } - - // Read the results back out, one at a time, and verify - for( i = 0; i < NUM_TRIES; i++ ) - { - error = clEnqueueReadBuffer( queue, results[ i ], CL_TRUE, 0, sizeof( cl_int ) * threads[0] * 2, resultArray, 0, NULL, NULL ); - sprintf( errStr, "Unable to read results for kernel try %d", i ); - test_error( error, errStr ); - - // Verify. Each entry should be n * the (width/height) of image i - for( int j = 0; j < NUM_THREADS; j++ ) - { - if( resultArray[ j * 2 + 0 ] != (int)sizes[ i ][ 0 ] * j ) - { - log_error( "ERROR: Verficiation for kernel try %d, sample %d FAILED, expected a width of %d, got %d\n", - i, j, (int)sizes[ i ][ 0 ] * j, resultArray[ j * 2 + 0 ] ); - return -1; - } - if( resultArray[ j * 2 + 1 ] != (int)sizes[ i ][ 1 ] * j ) - { - log_error( "ERROR: Verficiation for kernel try %d, sample %d FAILED, expected a height of %d, got %d\n", - i, j, (int)sizes[ i ][ 1 ] * j, resultArray[ j * 2 + 1 ] ); - return -1; - } - } - } - - // If we got here, everything verified successfully - return 0; -} - - diff --git a/test_conformance/compatibility/test_conformance/api/test_kernel_arg_multi_setup.cpp b/test_conformance/compatibility/test_conformance/api/test_kernel_arg_multi_setup.cpp deleted file mode 100644 index 89c5eeb1..00000000 --- a/test_conformance/compatibility/test_conformance/api/test_kernel_arg_multi_setup.cpp +++ /dev/null @@ -1,277 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "testBase.h" -#include "../../test_common/harness/conversions.h" - -// This test is designed to stress passing multiple vector parameters to kernels and verifying access between them all - -const char *multi_arg_kernel_source_pattern = -"__kernel void sample_test(__global %s *src1, __global %s *src2, __global %s *src3, __global %s *dst1, __global %s *dst2, __global %s *dst3 )\n" -"{\n" -" int tid = get_global_id(0);\n" -" dst1[tid] = src1[tid];\n" -" dst2[tid] = src2[tid];\n" -" dst3[tid] = src3[tid];\n" -"}\n"; - -extern cl_uint gRandomSeed; - -#define MAX_ERROR_TOLERANCE 0.0005f - -int test_multi_arg_set(cl_device_id device, cl_context context, cl_command_queue queue, - ExplicitType vec1Type, int vec1Size, - ExplicitType vec2Type, int vec2Size, - ExplicitType vec3Type, int vec3Size, MTdata d) -{ - clProgramWrapper program; - clKernelWrapper kernel; - int error, i, j; - clMemWrapper streams[ 6 ]; - size_t threads[1], localThreads[1]; - char programSrc[ 10248 ], vec1Name[ 64 ], vec2Name[ 64 ], vec3Name[ 64 ]; - char sizeNames[][ 4 ] = { "", "2", "3", "4", "", "", "", "8" }; - const char *ptr; - void *initData[3], *resultData[3]; - - - // Create the program source - sprintf( vec1Name, "%s%s", get_explicit_type_name( vec1Type ), sizeNames[ vec1Size - 1 ] ); - sprintf( vec2Name, "%s%s", get_explicit_type_name( vec2Type ), sizeNames[ vec2Size - 1 ] ); - sprintf( vec3Name, "%s%s", get_explicit_type_name( vec3Type ), sizeNames[ vec3Size - 1 ] ); - - sprintf( programSrc, multi_arg_kernel_source_pattern, - vec1Name, vec2Name, vec3Name, vec1Name, vec2Name, vec3Name, - vec1Size, vec1Size, vec2Size, vec2Size, vec3Size, vec3Size ); - ptr = programSrc; - - // Create our testing kernel - error = create_single_kernel_helper( context, &program, &kernel, 1, &ptr, "sample_test" ); - test_error( error, "Unable to create testing kernel" ); - - // Get thread dimensions - threads[0] = 1024; - error = get_max_common_work_group_size( context, kernel, threads[0], &localThreads[0] ); - test_error( error, "Unable to get work group size for kernel" ); - - // Create input streams - initData[ 0 ] = create_random_data( vec1Type, d, (unsigned int)threads[ 0 ] * vec1Size ); - streams[ 0 ] = clCreateBuffer( context, (cl_mem_flags)( CL_MEM_COPY_HOST_PTR ), get_explicit_type_size( vec1Type ) * threads[0] * vec1Size, initData[ 0 ], &error ); - test_error( error, "Unable to create testing stream" ); - - initData[ 1 ] = create_random_data( vec2Type, d, (unsigned int)threads[ 0 ] * vec2Size ); - streams[ 1 ] = clCreateBuffer( context, (cl_mem_flags)( CL_MEM_COPY_HOST_PTR ), get_explicit_type_size( vec2Type ) * threads[0] * vec2Size, initData[ 1 ], &error ); - test_error( error, "Unable to create testing stream" ); - - initData[ 2 ] = create_random_data( vec3Type, d, (unsigned int)threads[ 0 ] * vec3Size ); - streams[ 2 ] = clCreateBuffer( context, (cl_mem_flags)( CL_MEM_COPY_HOST_PTR ), get_explicit_type_size( vec3Type ) * threads[0] * vec3Size, initData[ 2 ], &error ); - test_error( error, "Unable to create testing stream" ); - - streams[ 3 ] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_READ_WRITE), get_explicit_type_size( vec1Type ) * threads[0] * vec1Size, NULL, &error ); - test_error( error, "Unable to create testing stream" ); - - streams[ 4 ] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_READ_WRITE), get_explicit_type_size( vec2Type ) * threads[0] * vec2Size, NULL, &error ); - test_error( error, "Unable to create testing stream" ); - - streams[ 5 ] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_READ_WRITE), get_explicit_type_size( vec3Type ) * threads[0] * vec3Size, NULL, &error ); - test_error( error, "Unable to create testing stream" ); - - // Set the arguments - error = 0; - for( i = 0; i < 6; i++ ) - error |= clSetKernelArg( kernel, i, sizeof( cl_mem ), &streams[ i ] ); - test_error( error, "Unable to set arguments for kernel" ); - - // Execute! - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); - test_error( error, "Unable to execute kernel" ); - - // Read results - resultData[0] = malloc( get_explicit_type_size( vec1Type ) * vec1Size * threads[0] ); - resultData[1] = malloc( get_explicit_type_size( vec2Type ) * vec2Size * threads[0] ); - resultData[2] = malloc( get_explicit_type_size( vec3Type ) * vec3Size * threads[0] ); - error = clEnqueueReadBuffer( queue, streams[ 3 ], CL_TRUE, 0, get_explicit_type_size( vec1Type ) * vec1Size * threads[ 0 ], resultData[0], 0, NULL, NULL ); - error |= clEnqueueReadBuffer( queue, streams[ 4 ], CL_TRUE, 0, get_explicit_type_size( vec2Type ) * vec2Size * threads[ 0 ], resultData[1], 0, NULL, NULL ); - error |= clEnqueueReadBuffer( queue, streams[ 5 ], CL_TRUE, 0, get_explicit_type_size( vec3Type ) * vec3Size * threads[ 0 ], resultData[2], 0, NULL, NULL ); - test_error( error, "Unable to read result stream" ); - - // Verify - char *ptr1 = (char *)initData[ 0 ], *ptr2 = (char *)resultData[ 0 ]; - size_t span = get_explicit_type_size( vec1Type ); - for( i = 0; i < (int)threads[0]; i++ ) - { - for( j = 0; j < vec1Size; j++ ) - { - if( memcmp( ptr1 + span * j , ptr2 + span * j, span ) != 0 ) - { - log_error( "ERROR: Value did not validate for component %d of item %d of stream 0!\n", j, i ); - free( initData[ 0 ] ); - free( initData[ 1 ] ); - free( initData[ 2 ] ); - free( resultData[ 0 ] ); - free( resultData[ 1 ] ); - free( resultData[ 2 ] ); - return -1; - } - } - ptr1 += span * vec1Size; - ptr2 += span * vec1Size; - } - - ptr1 = (char *)initData[ 1 ]; - ptr2 = (char *)resultData[ 1 ]; - span = get_explicit_type_size( vec2Type ); - for( i = 0; i < (int)threads[0]; i++ ) - { - for( j = 0; j < vec2Size; j++ ) - { - if( memcmp( ptr1 + span * j , ptr2 + span * j, span ) != 0 ) - { - log_error( "ERROR: Value did not validate for component %d of item %d of stream 1!\n", j, i ); - free( initData[ 0 ] ); - free( initData[ 1 ] ); - free( initData[ 2 ] ); - free( resultData[ 0 ] ); - free( resultData[ 1 ] ); - free( resultData[ 2 ] ); - return -1; - } - } - ptr1 += span * vec2Size; - ptr2 += span * vec2Size; - } - - ptr1 = (char *)initData[ 2 ]; - ptr2 = (char *)resultData[ 2 ]; - span = get_explicit_type_size( vec3Type ); - for( i = 0; i < (int)threads[0]; i++ ) - { - for( j = 0; j < vec3Size; j++ ) - { - if( memcmp( ptr1 + span * j , ptr2 + span * j, span ) != 0 ) - { - log_error( "ERROR: Value did not validate for component %d of item %d of stream 2!\n", j, i ); - free( initData[ 0 ] ); - free( initData[ 1 ] ); - free( initData[ 2 ] ); - free( resultData[ 0 ] ); - free( resultData[ 1 ] ); - free( resultData[ 2 ] ); - return -1; - } - } - ptr1 += span * vec3Size; - ptr2 += span * vec3Size; - } - - // If we got here, everything verified successfully - free( initData[ 0 ] ); - free( initData[ 1 ] ); - free( initData[ 2 ] ); - free( resultData[ 0 ] ); - free( resultData[ 1 ] ); - free( resultData[ 2 ] ); - - return 0; -} - -int test_kernel_arg_multi_setup_exhaustive(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) -{ - // Loop through every combination of input and output types - ExplicitType types[] = { kChar, kShort, kInt, kFloat, kNumExplicitTypes }; - int type1, type2, type3; - int size1, size2, size3; - RandomSeed seed( gRandomSeed ); - - log_info( "\n" ); // for formatting - - for( type1 = 0; types[ type1 ] != kNumExplicitTypes; type1++ ) - { - for( type2 = 0; types[ type2 ] != kNumExplicitTypes; type2++ ) - { - for( type3 = 0; types[ type3 ] != kNumExplicitTypes; type3++ ) - { - log_info( "\n\ttesting %s, %s, %s...", get_explicit_type_name( types[ type1 ] ), get_explicit_type_name( types[ type2 ] ), get_explicit_type_name( types[ type3 ] ) ); - - // Loop through every combination of vector size - for( size1 = 2; size1 <= 8; size1 <<= 1 ) - { - for( size2 = 2; size2 <= 8; size2 <<= 1 ) - { - for( size3 = 2; size3 <= 8; size3 <<= 1 ) - { - log_info("."); - fflush( stdout); - if( test_multi_arg_set( device, context, queue, - types[ type1 ], size1, - types[ type2 ], size2, - types[ type3 ], size3, seed ) ) - return -1; - } - } - } - } - } - } - log_info( "\n" ); - return 0; -} - -int test_kernel_arg_multi_setup_random(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) -{ - // Loop through a selection of combinations - ExplicitType types[] = { kChar, kShort, kInt, kFloat, kNumExplicitTypes }; - int type1, type2, type3; - int size1, size2, size3; - RandomSeed seed( gRandomSeed ); - - num_elements = 3*3*3*4; - log_info( "Testing %d random configurations\n", num_elements ); - - // Loop through every combination of vector size - for( size1 = 2; size1 <= 8; size1 <<= 1 ) - { - for( size2 = 2; size2 <= 8; size2 <<= 1 ) - { - for( size3 = 2; size3 <= 8; size3 <<= 1 ) - { - // Loop through 4 type combinations for each size combination - int n; - for (n=0; n<4; n++) { - type1 = (int)get_random_float(0,4, seed); - type2 = (int)get_random_float(0,4, seed); - type3 = (int)get_random_float(0,4, seed); - - - log_info( "\ttesting %s%d, %s%d, %s%d...\n", - get_explicit_type_name( types[ type1 ] ), size1, - get_explicit_type_name( types[ type2 ] ), size2, - get_explicit_type_name( types[ type3 ] ), size3 ); - - if( test_multi_arg_set( device, context, queue, - types[ type1 ], size1, - types[ type2 ], size2, - types[ type3 ], size3, seed ) ) - return -1; - } - } - } - } - return 0; -} - - - - diff --git a/test_conformance/compatibility/test_conformance/api/test_kernels.c b/test_conformance/compatibility/test_conformance/api/test_kernels.c deleted file mode 100644 index 9cfbca27..00000000 --- a/test_conformance/compatibility/test_conformance/api/test_kernels.c +++ /dev/null @@ -1,704 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "testBase.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/conversions.h" - -extern cl_uint gRandomSeed; - -const char *sample_single_test_kernel[] = { -"__kernel void sample_test(__global float *src, __global int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = (int)src[tid];\n" -"\n" -"}\n" }; - -const char *sample_struct_test_kernel[] = { -"typedef struct {\n" -"__global int *A;\n" -"__global int *B;\n" -"} input_pair_t;\n" -"\n" -"__kernel void sample_test(__global input_pair_t *src, __global int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = src->A[tid] + src->B[tid];\n" -"\n" -"}\n" }; - -const char *sample_struct_array_test_kernel[] = { -"typedef struct {\n" -"int A;\n" -"int B;\n" -"} input_pair_t;\n" -"\n" -"__kernel void sample_test(__global input_pair_t *src, __global int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = src[tid].A + src[tid].B;\n" -"\n" -"}\n" }; - -const char *sample_const_test_kernel[] = { -"__kernel void sample_test(__constant int *src1, __constant int *src2, __global int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = src1[tid] + src2[tid];\n" -"\n" -"}\n" }; - -const char *sample_const_global_test_kernel[] = { -"__constant int addFactor = 1024;\n" -"__kernel void sample_test(__global int *src1, __global int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = src1[tid] + addFactor;\n" -"\n" -"}\n" }; - -const char *sample_two_kernel_program[] = { -"__kernel void sample_test(__global float *src, __global int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = (int)src[tid];\n" -"\n" -"}\n", -"__kernel void sample_test2(__global int *src, __global float *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = (float)src[tid];\n" -"\n" -"}\n" }; - - - - -int test_get_kernel_info(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - cl_program program, testProgram; - cl_context testContext; - cl_kernel kernel; - cl_char name[ 512 ]; - cl_uint numArgs, numInstances; - size_t paramSize; - - - /* Create reference */ - if( create_single_kernel_helper( context, &program, &kernel, 1, sample_single_test_kernel, "sample_test" ) != 0 ) - { - return -1; - } - - error = clGetKernelInfo( kernel, CL_KERNEL_FUNCTION_NAME, NULL, 0, ¶mSize ); - test_error( error, "Unable to get kernel function name param size" ); - if( paramSize != strlen( "sample_test" ) + 1 ) - { - log_error( "ERROR: Kernel function name param returns invalid size (expected %d, got %d)\n", (int)strlen( "sample_test" ) + 1, (int)paramSize ); - return -1; - } - - error = clGetKernelInfo( kernel, CL_KERNEL_FUNCTION_NAME, sizeof( name ), name, NULL ); - test_error( error, "Unable to get kernel function name" ); - if( strcmp( (char *)name, "sample_test" ) != 0 ) - { - log_error( "ERROR: Kernel function name returned invalid value (expected sample_test, got %s)\n", (char *)name ); - return -1; - } - - - error = clGetKernelInfo( kernel, CL_KERNEL_NUM_ARGS, 0, NULL, ¶mSize ); - test_error( error, "Unable to get kernel arg count param size" ); - if( paramSize != sizeof( numArgs ) ) - { - log_error( "ERROR: Kernel arg count param returns invalid size (expected %d, got %d)\n", (int)sizeof( numArgs ), (int)paramSize ); - return -1; - } - - error = clGetKernelInfo( kernel, CL_KERNEL_NUM_ARGS, sizeof( numArgs ), &numArgs, NULL ); - test_error( error, "Unable to get kernel arg count" ); - if( numArgs != 2 ) - { - log_error( "ERROR: Kernel arg count returned invalid value (expected %d, got %d)\n", 2, numArgs ); - return -1; - } - - - error = clGetKernelInfo( kernel, CL_KERNEL_REFERENCE_COUNT, 0, NULL, ¶mSize ); - test_error( error, "Unable to get kernel reference count param size" ); - if( paramSize != sizeof( numInstances ) ) - { - log_error( "ERROR: Kernel reference count param returns invalid size (expected %d, got %d)\n", (int)sizeof( numInstances ), (int)paramSize ); - return -1; - } - - error = clGetKernelInfo( kernel, CL_KERNEL_REFERENCE_COUNT, sizeof( numInstances ), &numInstances, NULL ); - test_error( error, "Unable to get kernel reference count" ); - - - error = clGetKernelInfo( kernel, CL_KERNEL_PROGRAM, NULL, 0, ¶mSize ); - test_error( error, "Unable to get kernel program param size" ); - if( paramSize != sizeof( testProgram ) ) - { - log_error( "ERROR: Kernel program param returns invalid size (expected %d, got %d)\n", (int)sizeof( testProgram ), (int)paramSize ); - return -1; - } - - error = clGetKernelInfo( kernel, CL_KERNEL_PROGRAM, sizeof( testProgram ), &testProgram, NULL ); - test_error( error, "Unable to get kernel program" ); - if( testProgram != program ) - { - log_error( "ERROR: Kernel program returned invalid value (expected %p, got %p)\n", program, testProgram ); - return -1; - } - - error = clGetKernelInfo( kernel, CL_KERNEL_CONTEXT, sizeof( testContext ), &testContext, NULL ); - test_error( error, "Unable to get kernel context" ); - if( testContext != context ) - { - log_error( "ERROR: Kernel context returned invalid value (expected %p, got %p)\n", context, testContext ); - return -1; - } - - /* Release memory */ - clReleaseKernel( kernel ); - clReleaseProgram( program ); - return 0; -} - -int test_execute_kernel_local_sizes(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - clProgramWrapper program; - clKernelWrapper kernel; - clMemWrapper streams[2]; - size_t threads[1], localThreads[1]; - cl_float inputData[100]; - cl_int outputData[100]; - RandomSeed seed( gRandomSeed ); - int i; - - /* Create a kernel to test with */ - if( create_single_kernel_helper( context, &program, &kernel, 1, sample_single_test_kernel, "sample_test" ) != 0 ) - { - return -1; - } - - /* Create some I/O streams */ - streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_float) * 100, NULL, &error); - test_error( error, "Creating test array failed" ); - streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int) * 100, NULL, &error); - test_error( error, "Creating test array failed" ); - - /* Write some test data */ - memset( outputData, 0, sizeof( outputData ) ); - - for (i=0; i<100; i++) - inputData[i] = get_random_float(-(float) 0x7fffffff, (float) 0x7fffffff, seed); - - error = clEnqueueWriteBuffer(queue, streams[0], CL_TRUE, 0, sizeof(cl_float)*100, (void *)inputData, 0, NULL, NULL); - test_error( error, "Unable to set testing kernel data" ); - - /* Set the arguments */ - error = clSetKernelArg( kernel, 0, sizeof( streams[0] ), &streams[0] ); - test_error( error, "Unable to set kernel arguments" ); - error = clSetKernelArg( kernel, 1, sizeof( streams[1] ), &streams[1] ); - test_error( error, "Unable to set kernel arguments" ); - - /* Test running the kernel and verifying it */ - threads[0] = (size_t)100; - error = get_max_common_work_group_size( context, kernel, threads[0], &localThreads[0] ); - test_error( error, "Unable to get work group size to use" ); - - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); - test_error( error, "Kernel execution failed" ); - - error = clEnqueueReadBuffer( queue, streams[1], CL_TRUE, 0, sizeof(cl_int)*100, (void *)outputData, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - - for (i=0; i<100; i++) - { - if (outputData[i] != (int)inputData[i]) - { - log_error( "ERROR: Data did not verify on first pass!\n" ); - return -1; - } - } - - /* Try again */ - if( localThreads[0] > 1 ) - localThreads[0] /= 2; - while( localThreads[0] > 1 && 0 != threads[0] % localThreads[0] ) - localThreads[0]--; - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); - test_error( error, "Kernel execution failed" ); - - error = clEnqueueReadBuffer( queue, streams[1], CL_TRUE, 0, sizeof(cl_int)*100, (void *)outputData, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - - for (i=0; i<100; i++) - { - if (outputData[i] != (int)inputData[i]) - { - log_error( "ERROR: Data did not verify on first pass!\n" ); - return -1; - } - } - - /* And again */ - if( localThreads[0] > 1 ) - localThreads[0] /= 2; - while( localThreads[0] > 1 && 0 != threads[0] % localThreads[0] ) - localThreads[0]--; - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); - test_error( error, "Kernel execution failed" ); - - error = clEnqueueReadBuffer( queue, streams[1], CL_TRUE, 0, sizeof(cl_int)*100, (void *)outputData, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - - for (i=0; i<100; i++) - { - if (outputData[i] != (int)inputData[i]) - { - log_error( "ERROR: Data did not verify on first pass!\n" ); - return -1; - } - } - - /* One more time */ - localThreads[0] = (unsigned int)1; - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); - test_error( error, "Kernel execution failed" ); - - error = clEnqueueReadBuffer( queue, streams[1], CL_TRUE, 0, sizeof(cl_int)*100, (void *)outputData, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - - for (i=0; i<100; i++) - { - if (outputData[i] != (int)inputData[i]) - { - log_error( "ERROR: Data did not verify on first pass!\n" ); - return -1; - } - } - - return 0; -} - -int test_set_kernel_arg_by_index(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - clProgramWrapper program; - clKernelWrapper kernel; - clMemWrapper streams[2]; - size_t threads[1], localThreads[1]; - cl_float inputData[10]; - cl_int outputData[10]; - RandomSeed seed( gRandomSeed ); - int i; - - /* Create a kernel to test with */ - if( create_single_kernel_helper( context, &program, &kernel, 1, sample_single_test_kernel, "sample_test" ) != 0 ) - { - return -1; - } - - /* Create some I/O streams */ - streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_float) * 10, NULL, &error); - test_error( error, "Creating test array failed" ); - streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int) * 10, NULL, &error); - test_error( error, "Creating test array failed" ); - - /* Write some test data */ - memset( outputData, 0, sizeof( outputData ) ); - - for (i=0; i<10; i++) - inputData[i] = get_random_float(-(float) 0x7fffffff, (float) 0x7fffffff, seed); - - error = clEnqueueWriteBuffer(queue, streams[0], CL_TRUE, 0, sizeof(cl_float)*10, (void *)inputData, 0, NULL, NULL); - test_error( error, "Unable to set testing kernel data" ); - - /* Test setting the arguments by index manually */ - error = clSetKernelArg(kernel, 1, sizeof( streams[1] ), &streams[1]); - test_error( error, "Unable to set indexed kernel arguments" ); - error = clSetKernelArg(kernel, 0, sizeof( streams[0] ), &streams[0]); - test_error( error, "Unable to set indexed kernel arguments" ); - - - /* Test running the kernel and verifying it */ - threads[0] = (size_t)10; - - error = get_max_common_work_group_size( context, kernel, threads[0], &localThreads[0] ); - test_error( error, "Unable to get work group size to use" ); - - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); - test_error( error, "Kernel execution failed" ); - - error = clEnqueueReadBuffer( queue, streams[1], CL_TRUE, 0, sizeof(cl_int)*10, (void *)outputData, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - - for (i=0; i<10; i++) - { - if (outputData[i] != (int)inputData[i]) - { - log_error( "ERROR: Data did not verify on first pass!\n" ); - return -1; - } - } - - return 0; -} - -int test_set_kernel_arg_struct(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - cl_program program; - cl_kernel kernel; - void *args[2]; - cl_mem outStream; - size_t threads[1], localThreads[1]; - cl_int outputData[10]; - int i; - cl_int randomTestDataA[10], randomTestDataB[10]; - MTdata d; - - struct img_pair_t - { - cl_mem streamA; - cl_mem streamB; - } image_pair; - - - /* Create a kernel to test with */ - if( create_single_kernel_helper( context, &program, &kernel, 1, sample_struct_test_kernel, "sample_test" ) != 0 ) - { - return -1; - } - - /* Create some I/O streams */ - d = init_genrand( gRandomSeed ); - for( i = 0; i < 10; i++ ) - { - randomTestDataA[i] = (cl_int)genrand_int32(d); - randomTestDataB[i] = (cl_int)genrand_int32(d); - } - free_mtdata(d); d = NULL; - - image_pair.streamA = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), sizeof(cl_int) * 10, randomTestDataA, &error); - test_error( error, "Creating test array failed" ); - image_pair.streamB = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), sizeof(cl_int) * 10, randomTestDataB, &error); - test_error( error, "Creating test array failed" ); - outStream = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int) * 10, NULL, &error); - test_error( error, "Creating test array failed" ); - - /* Set the arguments */ - args[0] = &image_pair; - args[1] = outStream; - - error = clSetKernelArg(kernel, 0, sizeof( image_pair ), &image_pair); - test_error( error, "Unable to set indexed kernel arguments" ); - error = clSetKernelArg(kernel, 1, sizeof( cl_mem ), &args[1]); - test_error( error, "Unable to set indexed kernel arguments" ); - - /* Test running the kernel and verifying it */ - threads[0] = (size_t)10; - - error = get_max_common_work_group_size( context, kernel, threads[0], &localThreads[0] ); - test_error( error, "Unable to get work group size to use" ); - - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); - test_error( error, "Kernel execution failed" ); - - error = clEnqueueReadBuffer( queue, outStream, CL_TRUE, 0, sizeof(cl_int)*10, (void *)outputData, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - - for (i=0; i<10; i++) - { - if (outputData[i] != randomTestDataA[i] + randomTestDataB[i]) - { - log_error( "ERROR: Data did not verify!\n" ); - return -1; - } - } - - - clReleaseMemObject( image_pair.streamA ); - clReleaseMemObject( image_pair.streamB ); - clReleaseMemObject( outStream ); - clReleaseKernel( kernel ); - clReleaseProgram( program ); - - return 0; -} - -int test_set_kernel_arg_constant(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - clProgramWrapper program; - clKernelWrapper kernel; - clMemWrapper streams[3]; - size_t threads[1], localThreads[1]; - cl_int outputData[10]; - int i; - cl_int randomTestDataA[10], randomTestDataB[10]; - cl_ulong maxSize; - MTdata d; - - /* Verify our test buffer won't be bigger than allowed */ - error = clGetDeviceInfo( deviceID, CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE, sizeof( maxSize ), &maxSize, 0 ); - test_error( error, "Unable to get max constant buffer size" ); - if( maxSize < sizeof( cl_int ) * 10 ) - { - log_error( "ERROR: Unable to test constant argument to kernel: max size of constant buffer is reported as %d!\n", (int)maxSize ); - return -1; - } - - /* Create a kernel to test with */ - if( create_single_kernel_helper( context, &program, &kernel, 1, sample_const_test_kernel, "sample_test" ) != 0 ) - { - return -1; - } - - /* Create some I/O streams */ - d = init_genrand( gRandomSeed ); - for( i = 0; i < 10; i++ ) - { - randomTestDataA[i] = (cl_int)genrand_int32(d) & 0xffffff; /* Make sure values are positive, just so we don't have to */ - randomTestDataB[i] = (cl_int)genrand_int32(d) & 0xffffff; /* deal with overflow on the verification */ - } - free_mtdata(d); d = NULL; - - streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), sizeof(cl_int) * 10, randomTestDataA, &error); - test_error( error, "Creating test array failed" ); - streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), sizeof(cl_int) * 10, randomTestDataB, &error); - test_error( error, "Creating test array failed" ); - streams[2] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int) * 10, NULL, &error); - test_error( error, "Creating test array failed" ); - - /* Set the arguments */ - error = clSetKernelArg(kernel, 0, sizeof( streams[0] ), &streams[0]); - test_error( error, "Unable to set indexed kernel arguments" ); - error = clSetKernelArg(kernel, 1, sizeof( streams[1] ), &streams[1]); - test_error( error, "Unable to set indexed kernel arguments" ); - error = clSetKernelArg(kernel, 2, sizeof( streams[2] ), &streams[2]); - test_error( error, "Unable to set indexed kernel arguments" ); - - - /* Test running the kernel and verifying it */ - threads[0] = (size_t)10; - - error = get_max_common_work_group_size( context, kernel, threads[0], &localThreads[0] ); - test_error( error, "Unable to get work group size to use" ); - - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); - test_error( error, "Kernel execution failed" ); - - error = clEnqueueReadBuffer( queue, streams[2], CL_TRUE, 0, sizeof(cl_int)*10, (void *)outputData, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - - for (i=0; i<10; i++) - { - if (outputData[i] != randomTestDataA[i] + randomTestDataB[i]) - { - log_error( "ERROR: Data sample %d did not verify! %d does not match %d + %d (%d)\n", i, outputData[i], randomTestDataA[i], randomTestDataB[i], ( randomTestDataA[i] + randomTestDataB[i] ) ); - return -1; - } - } - - return 0; -} - -int test_set_kernel_arg_struct_array(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - clProgramWrapper program; - clKernelWrapper kernel; - clMemWrapper streams[2]; - size_t threads[1], localThreads[1]; - cl_int outputData[10]; - int i; - MTdata d; - - typedef struct img_pair_type - { - int A; - int B; - } image_pair_t; - - image_pair_t image_pair[ 10 ]; - - - /* Create a kernel to test with */ - if( create_single_kernel_helper( context, &program, &kernel, 1, sample_struct_array_test_kernel, "sample_test" ) != 0 ) - { - return -1; - } - - /* Create some I/O streams */ - d = init_genrand( gRandomSeed ); - for( i = 0; i < 10; i++ ) - { - image_pair[i].A = (cl_int)genrand_int32(d); - image_pair[i].A = (cl_int)genrand_int32(d); - } - free_mtdata(d); d = NULL; - - streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), sizeof(image_pair_t) * 10, (void *)image_pair, &error); - test_error( error, "Creating test array failed" ); - streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int) * 10, NULL, &error); - test_error( error, "Creating test array failed" ); - - /* Set the arguments */ - error = clSetKernelArg(kernel, 0, sizeof( streams[0] ), &streams[0]); - test_error( error, "Unable to set indexed kernel arguments" ); - error = clSetKernelArg(kernel, 1, sizeof( streams[1] ), &streams[1]); - test_error( error, "Unable to set indexed kernel arguments" ); - - /* Test running the kernel and verifying it */ - threads[0] = (size_t)10; - - error = get_max_common_work_group_size( context, kernel, threads[0], &localThreads[0] ); - test_error( error, "Unable to get work group size to use" ); - - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); - test_error( error, "Kernel execution failed" ); - - error = clEnqueueReadBuffer( queue, streams[1], CL_TRUE, 0, sizeof(cl_int)*10, (void *)outputData, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - - for (i=0; i<10; i++) - { - if (outputData[i] != image_pair[i].A + image_pair[i].B) - { - log_error( "ERROR: Data did not verify!\n" ); - return -1; - } - } - - return 0; -} - -int test_create_kernels_in_program(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - cl_program program; - cl_kernel kernel[3]; - unsigned int kernelCount; - - /* Create a test program */ - program = clCreateProgramWithSource( context, 2, sample_two_kernel_program, NULL, &error); - if( program == NULL || error != CL_SUCCESS ) - { - log_error( "ERROR: Unable to create test program!\n" ); - return -1; - } - - /* Build */ - error = clBuildProgram( program, 1, &deviceID, NULL, NULL, NULL ); - test_error( error, "Unable to build test program" ); - - /* Try getting the kernel count */ - error = clCreateKernelsInProgram( program, 0, NULL, &kernelCount ); - test_error( error, "Unable to get kernel count for built program" ); - if( kernelCount != 2 ) - { - log_error( "ERROR: Returned kernel count from clCreateKernelsInProgram is incorrect! (got %d, expected 2)\n", kernelCount ); - return -1; - } - - /* Try actually getting the kernels */ - error = clCreateKernelsInProgram( program, 2, kernel, NULL ); - test_error( error, "Unable to get kernels for built program" ); - clReleaseKernel( kernel[0] ); - clReleaseKernel( kernel[1] ); - - clReleaseProgram( program ); - return 0; -} - -int test_kernel_global_constant(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - clProgramWrapper program; - clKernelWrapper kernel; - clMemWrapper streams[2]; - size_t threads[1], localThreads[1]; - cl_int outputData[10]; - int i; - cl_int randomTestDataA[10]; - MTdata d; - - - /* Create a kernel to test with */ - if( create_single_kernel_helper( context, &program, &kernel, 1, sample_const_global_test_kernel, "sample_test" ) != 0 ) - { - return -1; - } - - /* Create some I/O streams */ - d = init_genrand( gRandomSeed ); - for( i = 0; i < 10; i++ ) - { - randomTestDataA[i] = (cl_int)genrand_int32(d) & 0xffff; /* Make sure values are positive and small, just so we don't have to */ - } - free_mtdata(d); d = NULL; - - streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), sizeof(cl_int) * 10, randomTestDataA, &error); - test_error( error, "Creating test array failed" ); - streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int) * 10, NULL, &error); - test_error( error, "Creating test array failed" ); - - /* Set the arguments */ - error = clSetKernelArg(kernel, 0, sizeof( streams[0] ), &streams[0]); - test_error( error, "Unable to set indexed kernel arguments" ); - error = clSetKernelArg(kernel, 1, sizeof( streams[1] ), &streams[1]); - test_error( error, "Unable to set indexed kernel arguments" ); - - - /* Test running the kernel and verifying it */ - threads[0] = (size_t)10; - - error = get_max_common_work_group_size( context, kernel, threads[0], &localThreads[0] ); - test_error( error, "Unable to get work group size to use" ); - - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); - test_error( error, "Kernel execution failed" ); - - error = clEnqueueReadBuffer( queue, streams[1], CL_TRUE, 0, sizeof(cl_int)*10, (void *)outputData, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - - for (i=0; i<10; i++) - { - if (outputData[i] != randomTestDataA[i] + 1024) - { - log_error( "ERROR: Data sample %d did not verify! %d does not match %d + 1024 (%d)\n", i, outputData[i], randomTestDataA[i], ( randomTestDataA[i] + 1024 ) ); - return -1; - } - } - - return 0; -} - - - diff --git a/test_conformance/compatibility/test_conformance/api/test_mem_object_info.cpp b/test_conformance/compatibility/test_conformance/api/test_mem_object_info.cpp deleted file mode 100644 index b4e14569..00000000 --- a/test_conformance/compatibility/test_conformance/api/test_mem_object_info.cpp +++ /dev/null @@ -1,750 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "testBase.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/testHarness.h" - -extern cl_uint gRandomSeed; - - -#define TEST_MEM_OBJECT_PARAM( mem, paramName, val, expected, name, type, cast ) \ -error = clGetMemObjectInfo( mem, paramName, sizeof( val ), &val, &size ); \ -test_error( error, "Unable to get mem object " name ); \ -if( val != expected ) \ -{ \ -log_error( "ERROR: Mem object " name " did not validate! (expected " type ", got " type " from %s:%d)\n", \ -expected, (cast)val, __FILE__, __LINE__ ); \ -return -1; \ -} \ -if( size != sizeof( val ) ) \ -{ \ -log_error( "ERROR: Returned size of mem object " name " does not validate! (expected %d, got %d from %s:%d)\n", \ -(int)sizeof( val ), (int)size , __FILE__, __LINE__ ); \ -return -1; \ -} - -static void CL_CALLBACK mem_obj_destructor_callback( cl_mem, void * data ) -{ - free( data ); -} - -static unsigned int -get_image_dim(MTdata *d, unsigned int mod) -{ - unsigned int val = 0; - - do - { - val = (unsigned int)genrand_int32(*d) % mod; - } while (val == 0); - - return val; -} - - -int test_get_buffer_info( cl_device_id deviceID, cl_context context, cl_command_queue ignoreQueue, int num_elements ) -{ - int error; - size_t size; - void * buffer = NULL; - - clMemWrapper bufferObject; - clMemWrapper subBufferObject; - - cl_mem_flags bufferFlags[] = { - CL_MEM_READ_WRITE, - CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR, - CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR, - CL_MEM_READ_ONLY, - CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, - CL_MEM_READ_ONLY | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_READ_ONLY | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR, - CL_MEM_WRITE_ONLY, - CL_MEM_WRITE_ONLY | CL_MEM_COPY_HOST_PTR, - CL_MEM_WRITE_ONLY | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_WRITE_ONLY | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR, - CL_MEM_HOST_READ_ONLY | CL_MEM_READ_WRITE, - CL_MEM_HOST_READ_ONLY | CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_READ_ONLY | CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_HOST_READ_ONLY | CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_READ_ONLY | CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR, - CL_MEM_HOST_READ_ONLY | CL_MEM_READ_ONLY, - CL_MEM_HOST_READ_ONLY | CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_READ_ONLY | CL_MEM_READ_ONLY | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_HOST_READ_ONLY | CL_MEM_READ_ONLY | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_READ_ONLY | CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR, - CL_MEM_HOST_READ_ONLY | CL_MEM_WRITE_ONLY, - CL_MEM_HOST_READ_ONLY | CL_MEM_WRITE_ONLY | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_READ_ONLY | CL_MEM_WRITE_ONLY | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_HOST_READ_ONLY | CL_MEM_WRITE_ONLY | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_READ_ONLY | CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_READ_WRITE, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_READ_ONLY, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_READ_ONLY | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_READ_ONLY | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_WRITE_ONLY, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_WRITE_ONLY | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_WRITE_ONLY | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_WRITE_ONLY | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR, - CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_WRITE, - CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR, - CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_ONLY, - CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_ONLY | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_ONLY | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR, - CL_MEM_HOST_NO_ACCESS | CL_MEM_WRITE_ONLY, - CL_MEM_HOST_NO_ACCESS | CL_MEM_WRITE_ONLY | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_NO_ACCESS | CL_MEM_WRITE_ONLY | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_HOST_NO_ACCESS | CL_MEM_WRITE_ONLY | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_NO_ACCESS | CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR, - }; - - cl_mem_flags subBufferFlags[] = { - CL_MEM_READ_WRITE, - CL_MEM_READ_ONLY, - CL_MEM_WRITE_ONLY, - 0, - CL_MEM_HOST_READ_ONLY | CL_MEM_READ_WRITE, - CL_MEM_HOST_READ_ONLY | CL_MEM_READ_ONLY, - CL_MEM_HOST_READ_ONLY | CL_MEM_WRITE_ONLY, - CL_MEM_HOST_READ_ONLY | 0, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_READ_WRITE, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_READ_ONLY, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_WRITE_ONLY, - CL_MEM_HOST_WRITE_ONLY | 0, - CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_WRITE, - CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_ONLY, - CL_MEM_HOST_NO_ACCESS | CL_MEM_WRITE_ONLY, - CL_MEM_HOST_NO_ACCESS | 0, - }; - - - // Get the address alignment, so we can make sure the sub-buffer test later works properly. - cl_uint addressAlignBits; - error = clGetDeviceInfo( deviceID, CL_DEVICE_MEM_BASE_ADDR_ALIGN, sizeof(addressAlignBits), &addressAlignBits, NULL ); - - size_t addressAlign = addressAlignBits/8; - if ( addressAlign < 128 ) - { - addressAlign = 128; - } - - for ( unsigned int i = 0; i < sizeof(bufferFlags) / sizeof(cl_mem_flags); ++i ) - { - //printf("@@@ bufferFlags[%u]=0x%x\n", i, bufferFlags[ i ]); - if ( bufferFlags[ i ] & CL_MEM_USE_HOST_PTR ) - { - // Create a buffer object to test against. - buffer = malloc( addressAlign * 4 ); - bufferObject = clCreateBuffer( context, bufferFlags[ i ], addressAlign * 4, buffer, &error ); - if ( error ) - { - free( buffer ); - test_error( error, "Unable to create buffer (CL_MEM_USE_HOST_PTR) to test with" ); - } - - // Make sure buffer is cleaned up appropriately if we encounter an error in the rest of the calls. - error = clSetMemObjectDestructorCallback( bufferObject, mem_obj_destructor_callback, buffer ); - test_error( error, "Unable to set mem object destructor callback" ); - - void * ptr; - TEST_MEM_OBJECT_PARAM( bufferObject, CL_MEM_HOST_PTR, ptr, buffer, "host pointer", "%p", void * ) - } - else if ( (bufferFlags[ i ] & CL_MEM_ALLOC_HOST_PTR) && (bufferFlags[ i ] & CL_MEM_COPY_HOST_PTR) ) - { - // Create a buffer object to test against. - buffer = malloc( addressAlign * 4 ); - bufferObject = clCreateBuffer( context, bufferFlags[ i ], addressAlign * 4, buffer, &error ); - if ( error ) - { - free( buffer ); - test_error( error, "Unable to create buffer (CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR) to test with" ); - } - - // Make sure buffer is cleaned up appropriately if we encounter an error in the rest of the calls. - error = clSetMemObjectDestructorCallback( bufferObject, mem_obj_destructor_callback, buffer ); - test_error( error, "Unable to set mem object destructor callback" ); - } - else if ( bufferFlags[ i ] & CL_MEM_ALLOC_HOST_PTR ) - { - // Create a buffer object to test against. - bufferObject = clCreateBuffer( context, bufferFlags[ i ], addressAlign * 4, NULL, &error ); - test_error( error, "Unable to create buffer (CL_MEM_ALLOC_HOST_PTR) to test with" ); - } - else if ( bufferFlags[ i ] & CL_MEM_COPY_HOST_PTR ) - { - // Create a buffer object to test against. - buffer = malloc( addressAlign * 4 ); - bufferObject = clCreateBuffer( context, bufferFlags[ i ], addressAlign * 4, buffer, &error ); - if ( error ) - { - free( buffer ); - test_error( error, "Unable to create buffer (CL_MEM_COPY_HOST_PTR) to test with" ); - } - - // Make sure buffer is cleaned up appropriately if we encounter an error in the rest of the calls. - error = clSetMemObjectDestructorCallback( bufferObject, mem_obj_destructor_callback, buffer ); - test_error( error, "Unable to set mem object destructor callback" ); - } - else - { - // Create a buffer object to test against. - bufferObject = clCreateBuffer( context, bufferFlags[ i ], addressAlign * 4, NULL, &error ); - test_error( error, "Unable to create buffer to test with" ); - } - - // Perform buffer object queries. - cl_mem_object_type type; - TEST_MEM_OBJECT_PARAM( bufferObject, CL_MEM_TYPE, type, CL_MEM_OBJECT_BUFFER, "type", "%d", int ) - - cl_mem_flags flags; - TEST_MEM_OBJECT_PARAM( bufferObject, CL_MEM_FLAGS, flags, (unsigned int)bufferFlags[ i ], "flags", "%d", unsigned int ) - - size_t sz; - TEST_MEM_OBJECT_PARAM( bufferObject, CL_MEM_SIZE, sz, (size_t)( addressAlign * 4 ), "size", "%ld", size_t ) - - cl_uint mapCount; - error = clGetMemObjectInfo( bufferObject, CL_MEM_MAP_COUNT, sizeof( mapCount ), &mapCount, &size ); - test_error( error, "Unable to get mem object map count" ); - if( size != sizeof( mapCount ) ) - { - log_error( "ERROR: Returned size of mem object map count does not validate! (expected %d, got %d from %s:%d)\n", - (int)sizeof( mapCount ), (int)size, __FILE__, __LINE__ ); - return -1; - } - - cl_uint refCount; - error = clGetMemObjectInfo( bufferObject, CL_MEM_REFERENCE_COUNT, sizeof( refCount ), &refCount, &size ); - test_error( error, "Unable to get mem object reference count" ); - if( size != sizeof( refCount ) ) - { - log_error( "ERROR: Returned size of mem object reference count does not validate! (expected %d, got %d from %s:%d)\n", - (int)sizeof( refCount ), (int)size, __FILE__, __LINE__ ); - return -1; - } - - cl_context otherCtx; - TEST_MEM_OBJECT_PARAM( bufferObject, CL_MEM_CONTEXT, otherCtx, context, "context", "%p", cl_context ) - - cl_mem origObj; - TEST_MEM_OBJECT_PARAM( bufferObject, CL_MEM_ASSOCIATED_MEMOBJECT, origObj, (void *)NULL, "associated mem object", "%p", void * ) - - size_t offset; - TEST_MEM_OBJECT_PARAM( bufferObject, CL_MEM_OFFSET, offset, 0L, "offset", "%ld", size_t ) - - cl_buffer_region region; - region.origin = addressAlign; - region.size = addressAlign; - - // Loop over possible sub-buffer objects to create. - for ( unsigned int j = 0; j < sizeof(subBufferFlags) / sizeof(cl_mem_flags); ++j ) - { - if ( subBufferFlags[ j ] & CL_MEM_READ_WRITE ) - { - if ( !(bufferFlags[ i ] & CL_MEM_READ_WRITE) ) - continue; // Buffer must be read_write for sub-buffer to be read_write. - } - if ( subBufferFlags[ j ] & CL_MEM_READ_ONLY ) - { - if ( !(bufferFlags[ i ] & CL_MEM_READ_WRITE) && !(bufferFlags[ i ] & CL_MEM_READ_ONLY) ) - continue; // Buffer must be read_write or read_only for sub-buffer to be read_only - } - if ( subBufferFlags[ j ] & CL_MEM_WRITE_ONLY ) - { - if ( !(bufferFlags[ i ] & CL_MEM_READ_WRITE) && !(bufferFlags[ i ] & CL_MEM_WRITE_ONLY) ) - continue; // Buffer must be read_write or write_only for sub-buffer to be write_only - } - if ( subBufferFlags[ j ] & CL_MEM_HOST_READ_ONLY ) - { - if ( (bufferFlags[ i ] & CL_MEM_HOST_NO_ACCESS) || (bufferFlags[ i ] & CL_MEM_HOST_WRITE_ONLY) ) - continue; // Buffer must be host all access or host read_only for sub-buffer to be host read_only - } - if ( subBufferFlags[ j ] & CL_MEM_HOST_WRITE_ONLY ) - { - if ( (bufferFlags[ i ] & CL_MEM_HOST_NO_ACCESS) || (bufferFlags[ i ] & CL_MEM_HOST_READ_ONLY) ) - continue; // Buffer must be host all access or host write_only for sub-buffer to be host write_only - } - //printf("@@@ bufferFlags[%u]=0x%x subBufferFlags[%u]=0x%x\n", i, bufferFlags[ i ], j, subBufferFlags[ j ]); - - subBufferObject = clCreateSubBuffer( bufferObject, subBufferFlags[ j ], CL_BUFFER_CREATE_TYPE_REGION, ®ion, &error ); - test_error( error, "Unable to create sub-buffer to test against" ); - - // Perform sub-buffer object queries. - cl_mem_object_type type; - TEST_MEM_OBJECT_PARAM( subBufferObject, CL_MEM_TYPE, type, CL_MEM_OBJECT_BUFFER, "type", "%d", int ) - - cl_mem_flags flags; - cl_mem_flags inheritedFlags = subBufferFlags[ j ]; - if ( (subBufferFlags[ j ] & (CL_MEM_READ_WRITE | CL_MEM_READ_ONLY | CL_MEM_WRITE_ONLY)) == 0 ) - { - inheritedFlags |= bufferFlags[ i ] & (CL_MEM_READ_WRITE | CL_MEM_READ_ONLY | CL_MEM_WRITE_ONLY); - } - inheritedFlags |= bufferFlags[ i ] & (CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR | CL_MEM_USE_HOST_PTR); - if ( (subBufferFlags[ j ] & (CL_MEM_HOST_READ_ONLY | CL_MEM_HOST_WRITE_ONLY | CL_MEM_HOST_NO_ACCESS)) == 0) - { - inheritedFlags |= bufferFlags[ i ] & (CL_MEM_HOST_READ_ONLY | CL_MEM_HOST_WRITE_ONLY | CL_MEM_HOST_NO_ACCESS); - } - TEST_MEM_OBJECT_PARAM( subBufferObject, CL_MEM_FLAGS, flags, (unsigned int)inheritedFlags, "flags", "%d", unsigned int ) - - TEST_MEM_OBJECT_PARAM( subBufferObject, CL_MEM_SIZE, sz, (size_t)( addressAlign ), "size", "%ld", size_t ) - - if ( bufferFlags[ i ] & CL_MEM_USE_HOST_PTR ) - { - void * ptr; - void * offsetInBuffer = (char *)buffer + addressAlign; - - TEST_MEM_OBJECT_PARAM( subBufferObject, CL_MEM_HOST_PTR, ptr, offsetInBuffer, "host pointer", "%p", void * ) - } - - cl_uint mapCount; - error = clGetMemObjectInfo( subBufferObject, CL_MEM_MAP_COUNT, sizeof( mapCount ), &mapCount, &size ); - test_error( error, "Unable to get mem object map count" ); - if( size != sizeof( mapCount ) ) - { - log_error( "ERROR: Returned size of mem object map count does not validate! (expected %d, got %d from %s:%d)\n", - (int)sizeof( mapCount ), (int)size, __FILE__, __LINE__ ); - return -1; - } - - cl_uint refCount; - error = clGetMemObjectInfo( subBufferObject, CL_MEM_REFERENCE_COUNT, sizeof( refCount ), &refCount, &size ); - test_error( error, "Unable to get mem object reference count" ); - if( size != sizeof( refCount ) ) - { - log_error( "ERROR: Returned size of mem object reference count does not validate! (expected %d, got %d from %s:%d)\n", - (int)sizeof( refCount ), (int)size, __FILE__, __LINE__ ); - return -1; - } - - cl_context otherCtx; - TEST_MEM_OBJECT_PARAM( subBufferObject, CL_MEM_CONTEXT, otherCtx, context, "context", "%p", cl_context ) - - TEST_MEM_OBJECT_PARAM( subBufferObject, CL_MEM_ASSOCIATED_MEMOBJECT, origObj, (cl_mem)bufferObject, "associated mem object", "%p", void * ) - - TEST_MEM_OBJECT_PARAM( subBufferObject, CL_MEM_OFFSET, offset, (size_t)( addressAlign ), "offset", "%ld", size_t ) - - clReleaseMemObject( subBufferObject ); - subBufferObject = NULL; - - } - - clReleaseMemObject( bufferObject ); - bufferObject = NULL; - } - - return CL_SUCCESS; -} - - -int test_get_imageObject_info( cl_mem * image, cl_mem_flags objectFlags, cl_image_desc *imageInfo, cl_image_format *imageFormat, size_t pixelSize, cl_context context ) -{ - int error; - size_t size; - cl_mem_object_type type; - cl_mem_flags flags; - cl_uint mapCount; - cl_uint refCount; - size_t rowPitchMultiplier; - size_t slicePitchMultiplier; - cl_context otherCtx; - size_t offset; - size_t sz; - - TEST_MEM_OBJECT_PARAM( *image, CL_MEM_TYPE, type, imageInfo->image_type, "type", "%d", int ) - - TEST_MEM_OBJECT_PARAM( *image, CL_MEM_FLAGS, flags, (unsigned int)objectFlags, "flags", "%d", unsigned int ) - - error = clGetMemObjectInfo( *image, CL_MEM_SIZE, sizeof( sz ), &sz, NULL ); - test_error( error, "Unable to get mem size" ); - - // The size returned is not constrained by the spec. - - error = clGetMemObjectInfo( *image, CL_MEM_MAP_COUNT, sizeof( mapCount ), &mapCount, &size ); - test_error( error, "Unable to get mem object map count" ); - if( size != sizeof( mapCount ) ) - { - log_error( "ERROR: Returned size of mem object map count does not validate! (expected %d, got %d from %s:%d)\n", - (int)sizeof( mapCount ), (int)size, __FILE__, __LINE__ ); - return -1; - } - - error = clGetMemObjectInfo( *image, CL_MEM_REFERENCE_COUNT, sizeof( refCount ), &refCount, &size ); - test_error( error, "Unable to get mem object reference count" ); - if( size != sizeof( refCount ) ) - { - log_error( "ERROR: Returned size of mem object reference count does not validate! (expected %d, got %d from %s:%d)\n", - (int)sizeof( refCount ), (int)size, __FILE__, __LINE__ ); - return -1; - } - - TEST_MEM_OBJECT_PARAM( *image, CL_MEM_CONTEXT, otherCtx, context, "context", "%p", cl_context ) - - TEST_MEM_OBJECT_PARAM( *image, CL_MEM_OFFSET, offset, 0L, "offset", "%ld", size_t ) - - return CL_SUCCESS; -} - - -int test_get_image_info( cl_device_id deviceID, cl_context context, cl_mem_object_type type ) -{ - int error; - size_t size; - void * image = NULL; - - cl_mem imageObject; - cl_image_desc imageInfo; - - cl_mem_flags imageFlags[] = { - CL_MEM_READ_WRITE, - CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR, - CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR, - CL_MEM_READ_ONLY, - CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, - CL_MEM_READ_ONLY | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_READ_ONLY | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR, - CL_MEM_WRITE_ONLY, - CL_MEM_WRITE_ONLY | CL_MEM_COPY_HOST_PTR, - CL_MEM_WRITE_ONLY | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_WRITE_ONLY | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR, - CL_MEM_HOST_READ_ONLY | CL_MEM_READ_WRITE, - CL_MEM_HOST_READ_ONLY | CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_READ_ONLY | CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_HOST_READ_ONLY | CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_READ_ONLY | CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR, - CL_MEM_HOST_READ_ONLY | CL_MEM_READ_ONLY, - CL_MEM_HOST_READ_ONLY | CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_READ_ONLY | CL_MEM_READ_ONLY | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_HOST_READ_ONLY | CL_MEM_READ_ONLY | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_READ_ONLY | CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR, - CL_MEM_HOST_READ_ONLY | CL_MEM_WRITE_ONLY, - CL_MEM_HOST_READ_ONLY | CL_MEM_WRITE_ONLY | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_READ_ONLY | CL_MEM_WRITE_ONLY | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_HOST_READ_ONLY | CL_MEM_WRITE_ONLY | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_READ_ONLY | CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_READ_WRITE, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_READ_ONLY, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_READ_ONLY | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_READ_ONLY | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_WRITE_ONLY, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_WRITE_ONLY | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_WRITE_ONLY | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_WRITE_ONLY | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_WRITE_ONLY | CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR, - CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_WRITE, - CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR, - CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_ONLY, - CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_ONLY | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_ONLY | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR, - CL_MEM_HOST_NO_ACCESS | CL_MEM_WRITE_ONLY, - CL_MEM_HOST_NO_ACCESS | CL_MEM_WRITE_ONLY | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_NO_ACCESS | CL_MEM_WRITE_ONLY | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_HOST_NO_ACCESS | CL_MEM_WRITE_ONLY | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_HOST_NO_ACCESS | CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR, - }; - MTdata d; - - PASSIVE_REQUIRE_IMAGE_SUPPORT( deviceID ) - - cl_image_format imageFormat; - size_t pixelSize = 4; - - imageFormat.image_channel_order = CL_RGBA; - imageFormat.image_channel_data_type = CL_UNORM_INT8; - - imageInfo.image_width = imageInfo.image_height = imageInfo.image_depth = 1; - imageInfo.image_array_size = 0; - imageInfo.num_mip_levels = imageInfo.num_samples = 0; - imageInfo.buffer = NULL; - - d = init_genrand( gRandomSeed ); - - for ( unsigned int i = 0; i < sizeof(imageFlags) / sizeof(cl_mem_flags); ++i ) - { - imageInfo.image_row_pitch = 0; - imageInfo.image_slice_pitch = 0; - - switch (type) - { - case CL_MEM_OBJECT_IMAGE1D: - imageInfo.image_width = get_image_dim(&d, 1023); - imageInfo.image_type = CL_MEM_OBJECT_IMAGE1D; - break; - - case CL_MEM_OBJECT_IMAGE2D: - imageInfo.image_width = get_image_dim(&d, 1023); - imageInfo.image_height = get_image_dim(&d, 1023); - imageInfo.image_type = CL_MEM_OBJECT_IMAGE2D; - break; - - case CL_MEM_OBJECT_IMAGE3D: - imageInfo.image_width = get_image_dim(&d, 127); - imageInfo.image_height = get_image_dim(&d, 127); - imageInfo.image_depth = get_image_dim(&d, 127); - imageInfo.image_type = CL_MEM_OBJECT_IMAGE3D; - break; - - case CL_MEM_OBJECT_IMAGE1D_ARRAY: - imageInfo.image_width = get_image_dim(&d, 1023); - imageInfo.image_array_size = get_image_dim(&d, 1023); - imageInfo.image_type = CL_MEM_OBJECT_IMAGE1D_ARRAY; - break; - - case CL_MEM_OBJECT_IMAGE2D_ARRAY: - imageInfo.image_width = get_image_dim(&d, 255); - imageInfo.image_height = get_image_dim(&d, 255); - imageInfo.image_array_size = get_image_dim(&d, 255); - imageInfo.image_type = CL_MEM_OBJECT_IMAGE2D_ARRAY; - break; - } - - if ( imageFlags[i] & CL_MEM_USE_HOST_PTR ) - { - // Create an image object to test against. - image = malloc( imageInfo.image_width * imageInfo.image_height * imageInfo.image_depth * pixelSize * - ((imageInfo.image_array_size == 0) ? 1 : imageInfo.image_array_size) ); - imageObject = clCreateImage( context, imageFlags[i], &imageFormat, &imageInfo, image, &error ); - if ( error ) - { - free( image ); - test_error( error, "Unable to create image with (CL_MEM_USE_HOST_PTR) to test with" ); - } - - // Make sure image is cleaned up appropriately if we encounter an error in the rest of the calls. - error = clSetMemObjectDestructorCallback( imageObject, mem_obj_destructor_callback, image ); - test_error( error, "Unable to set mem object destructor callback" ); - - void * ptr; - TEST_MEM_OBJECT_PARAM( imageObject, CL_MEM_HOST_PTR, ptr, image, "host pointer", "%p", void * ) - int ret = test_get_imageObject_info( &imageObject, imageFlags[i], &imageInfo, &imageFormat, pixelSize, context ); - if (ret) - return ret; - - // release image object - clReleaseMemObject(imageObject); - - // Try again with non-zero rowPitch. - imageInfo.image_row_pitch = imageInfo.image_width * pixelSize; - switch (type) - { - case CL_MEM_OBJECT_IMAGE1D_ARRAY: - case CL_MEM_OBJECT_IMAGE2D_ARRAY: - case CL_MEM_OBJECT_IMAGE3D: - imageInfo.image_slice_pitch = imageInfo.image_row_pitch * imageInfo.image_height; - break; - } - - image = malloc( imageInfo.image_width * imageInfo.image_height * imageInfo.image_depth * pixelSize * - ((imageInfo.image_array_size == 0) ? 1 : imageInfo.image_array_size) ); - imageObject = clCreateImage( context, imageFlags[i], &imageFormat, &imageInfo, image, &error ); - if ( error ) - { - free( image ); - test_error( error, "Unable to create image2d (CL_MEM_USE_HOST_PTR) to test with" ); - } - - // Make sure image2d is cleaned up appropriately if we encounter an error in the rest of the calls. - error = clSetMemObjectDestructorCallback( imageObject, mem_obj_destructor_callback, image ); - test_error( error, "Unable to set mem object destructor callback" ); - - TEST_MEM_OBJECT_PARAM( imageObject, CL_MEM_HOST_PTR, ptr, image, "host pointer", "%p", void * ) - ret = test_get_imageObject_info( &imageObject, imageFlags[i], &imageInfo, &imageFormat, pixelSize, context ); - if (ret) - return ret; - - } - else if ( (imageFlags[i] & CL_MEM_ALLOC_HOST_PTR) && (imageFlags[i] & CL_MEM_COPY_HOST_PTR) ) - { - // Create an image object to test against. - image = malloc( imageInfo.image_width * imageInfo.image_height * imageInfo.image_depth * pixelSize * - ((imageInfo.image_array_size == 0) ? 1 : imageInfo.image_array_size) ); - imageObject = clCreateImage( context, imageFlags[i], &imageFormat, &imageInfo, image, &error ); - if ( error ) - { - free( image ); - test_error( error, "Unable to create image with (CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR) to test with" ); - } - - // Make sure image is cleaned up appropriately if we encounter an error in the rest of the calls. - error = clSetMemObjectDestructorCallback( imageObject, mem_obj_destructor_callback, image ); - test_error( error, "Unable to set mem object destructor callback" ); - int ret = test_get_imageObject_info( &imageObject, imageFlags[ i ], &imageInfo, &imageFormat, pixelSize, context ); - if (ret) - return ret; - - // release image object - clReleaseMemObject(imageObject); - - // Try again with non-zero rowPitch. - imageInfo.image_row_pitch = imageInfo.image_width * pixelSize; - switch (type) - { - case CL_MEM_OBJECT_IMAGE1D_ARRAY: - case CL_MEM_OBJECT_IMAGE2D_ARRAY: - case CL_MEM_OBJECT_IMAGE3D: - imageInfo.image_slice_pitch = imageInfo.image_row_pitch * imageInfo.image_height; - break; - } - - image = malloc( imageInfo.image_width * imageInfo.image_height * imageInfo.image_depth * pixelSize * - ((imageInfo.image_array_size == 0) ? 1 : imageInfo.image_array_size) ); - imageObject = clCreateImage( context, imageFlags[i], &imageFormat, &imageInfo, image, &error ); - if ( error ) - { - free( image ); - test_error( error, "Unable to create image with (CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR) to test with" ); - } - - // Make sure image is cleaned up appropriately if we encounter an error in the rest of the calls. - error = clSetMemObjectDestructorCallback( imageObject, mem_obj_destructor_callback, image ); - test_error( error, "Unable to set mem object destructor callback" ); - ret = test_get_imageObject_info( &imageObject, imageFlags[i], &imageInfo, &imageFormat, pixelSize, context ); - if (ret) - return ret; - - } - else if ( imageFlags[i] & CL_MEM_ALLOC_HOST_PTR ) - { - // Create an image object to test against. - imageObject = clCreateImage( context, imageFlags[i], &imageFormat, &imageInfo, NULL, &error ); - test_error( error, "Unable to create image with (CL_MEM_ALLOC_HOST_PTR) to test with" ); - int ret = test_get_imageObject_info( &imageObject, imageFlags[i], &imageInfo, &imageFormat, pixelSize, context ); - if (ret) - return ret; - - } - else if ( imageFlags[i] & CL_MEM_COPY_HOST_PTR ) - { - // Create an image object to test against. - image = malloc( imageInfo.image_width * imageInfo.image_height * imageInfo.image_depth * pixelSize * - ((imageInfo.image_array_size == 0) ? 1 : imageInfo.image_array_size) ); - imageObject = clCreateImage( context, imageFlags[i], &imageFormat, &imageInfo, image, &error ); - if ( error ) - { - free( image ); - test_error( error, "Unable to create image with (CL_MEM_COPY_HOST_PTR) to test with" ); - } - - // Make sure image is cleaned up appropriately if we encounter an error in the rest of the calls. - error = clSetMemObjectDestructorCallback( imageObject, mem_obj_destructor_callback, image ); - test_error( error, "Unable to set mem object destructor callback" ); - int ret = test_get_imageObject_info( &imageObject, imageFlags[i], &imageInfo, &imageFormat, pixelSize, context ); - if (ret) - return ret; - - clReleaseMemObject(imageObject); - - // Try again with non-zero rowPitch. - imageInfo.image_row_pitch = imageInfo.image_width * pixelSize; - switch (type) - { - case CL_MEM_OBJECT_IMAGE1D_ARRAY: - case CL_MEM_OBJECT_IMAGE2D_ARRAY: - case CL_MEM_OBJECT_IMAGE3D: - imageInfo.image_slice_pitch = imageInfo.image_row_pitch * imageInfo.image_height; - break; - } - - image = malloc( imageInfo.image_width * imageInfo.image_height * imageInfo.image_depth * pixelSize * - ((imageInfo.image_array_size == 0) ? 1 : imageInfo.image_array_size) ); - imageObject = clCreateImage( context, imageFlags[i], &imageFormat, &imageInfo, image, &error ); - if ( error ) - { - free( image ); - test_error( error, "Unable to create image with (CL_MEM_COPY_HOST_PTR) to test with" ); - } - - // Make sure image is cleaned up appropriately if we encounter an error in the rest of the calls. - error = clSetMemObjectDestructorCallback( imageObject, mem_obj_destructor_callback, image ); - test_error( error, "Unable to set mem object destructor callback" ); - ret = test_get_imageObject_info( &imageObject, imageFlags[i], &imageInfo, &imageFormat, pixelSize, context ); - if (ret) - return ret; - - } - else - { - // Create an image object to test against. - imageObject = clCreateImage( context, imageFlags[i], &imageFormat, &imageInfo, NULL, &error ); - test_error( error, "Unable to create image to test with" ); - int ret = test_get_imageObject_info( &imageObject, imageFlags[i], &imageInfo, &imageFormat, pixelSize, context ); - if (ret) - return ret; - - } - - clReleaseMemObject( imageObject ); - } - - return CL_SUCCESS; -} - - -int test_get_image2d_info( cl_device_id deviceID, cl_context context, cl_command_queue ignoreQueue, int num_elements ) -{ - return test_get_image_info(deviceID, context, CL_MEM_OBJECT_IMAGE2D); -} - -int test_get_image3d_info( cl_device_id deviceID, cl_context context, cl_command_queue ignoreQueue, int num_elements ) -{ - return test_get_image_info(deviceID, context, CL_MEM_OBJECT_IMAGE3D); -} - -int test_get_image1d_info( cl_device_id deviceID, cl_context context, cl_command_queue ignoreQueue, int num_elements ) -{ - return test_get_image_info(deviceID, context, CL_MEM_OBJECT_IMAGE1D); -} - -int test_get_image1d_array_info( cl_device_id deviceID, cl_context context, cl_command_queue ignoreQueue, int num_elements ) -{ - return test_get_image_info(deviceID, context, CL_MEM_OBJECT_IMAGE1D_ARRAY); -} - -int test_get_image2d_array_info( cl_device_id deviceID, cl_context context, cl_command_queue ignoreQueue, int num_elements ) -{ - return test_get_image_info(deviceID, context, CL_MEM_OBJECT_IMAGE2D_ARRAY); -} - - diff --git a/test_conformance/compatibility/test_conformance/api/test_mem_objects.cpp b/test_conformance/compatibility/test_conformance/api/test_mem_objects.cpp deleted file mode 100644 index b0dc99d4..00000000 --- a/test_conformance/compatibility/test_conformance/api/test_mem_objects.cpp +++ /dev/null @@ -1,108 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "testBase.h" - -static volatile cl_int sDestructorIndex; - -void CL_CALLBACK mem_destructor_callback( cl_mem memObject, void * userData ) -{ - int * userPtr = (int *)userData; - - // ordering of callbacks is guaranteed, meaning we don't need to do atomic operation here - *userPtr = ++sDestructorIndex; -} - -#ifndef ABS -#define ABS( x ) ( ( x < 0 ) ? -x : x ) -#endif - -int test_mem_object_destructor_callback_single( clMemWrapper &memObject ) -{ - cl_int error; - int i; - - // Set up some variables to catch the order in which callbacks are called - volatile int callbackOrders[ 3 ] = { 0, 0, 0 }; - sDestructorIndex = 0; - - // Set up the callbacks - error = clSetMemObjectDestructorCallback( memObject, mem_destructor_callback, (void*) &callbackOrders[ 0 ] ); - test_error( error, "Unable to set destructor callback" ); - - error = clSetMemObjectDestructorCallback( memObject, mem_destructor_callback, (void*) &callbackOrders[ 1 ] ); - test_error( error, "Unable to set destructor callback" ); - - error = clSetMemObjectDestructorCallback( memObject, mem_destructor_callback, (void*) &callbackOrders[ 2 ] ); - test_error( error, "Unable to set destructor callback" ); - - // Now release the buffer, which SHOULD call the callbacks - error = clReleaseMemObject( memObject ); - test_error( error, "Unable to release test buffer" ); - - // Note: since we manually released the mem wrapper, we need to set it to NULL to prevent a double-release - memObject = NULL; - - // At this point, all three callbacks should have already been called - int numErrors = 0; - for( i = 0; i < 3; i++ ) - { - // Spin waiting for the release to finish. If you don't call the mem_destructor_callback, you will not - // pass the test. bugzilla 6316 - while( 0 == callbackOrders[i] ) - {} - - if( ABS( callbackOrders[ i ] ) != 3-i ) - { - log_error( "\tERROR: Callback %d was called in the wrong order! (Was called order %d, should have been order %d)\n", - i+1, ABS( callbackOrders[ i ] ), i ); - numErrors++; - } - } - - return ( numErrors > 0 ) ? -1 : 0; -} - -int test_mem_object_destructor_callback(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - clMemWrapper testBuffer, testImage; - cl_int error; - - - // Create a buffer and an image to test callbacks against - testBuffer = clCreateBuffer( context, CL_MEM_READ_WRITE, 1024, NULL, &error ); - test_error( error, "Unable to create testing buffer" ); - - if( test_mem_object_destructor_callback_single( testBuffer ) != 0 ) - { - log_error( "ERROR: Destructor callbacks for buffer object FAILED\n" ); - return -1; - } - - if( checkForImageSupport( deviceID ) == 0 ) - { - cl_image_format imageFormat = { CL_RGBA, CL_SIGNED_INT8 }; - testImage = create_image_2d( context, CL_MEM_READ_ONLY, &imageFormat, 16, 16, 0, NULL, &error ); - test_error( error, "Unable to create testing image" ); - - if( test_mem_object_destructor_callback_single( testImage ) != 0 ) - { - log_error( "ERROR: Destructor callbacks for image object FAILED\n" ); - return -1; - } - } - - return 0; -} diff --git a/test_conformance/compatibility/test_conformance/api/test_native_kernel.cpp b/test_conformance/compatibility/test_conformance/api/test_native_kernel.cpp deleted file mode 100644 index 2d52134b..00000000 --- a/test_conformance/compatibility/test_conformance/api/test_native_kernel.cpp +++ /dev/null @@ -1,121 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "testBase.h" - -#ifndef _WIN32 -#include -#endif - -#include "../../test_common/harness/conversions.h" - -extern cl_uint gRandomSeed; - -static void CL_CALLBACK test_native_kernel_fn( void *userData ) -{ - struct arg_struct { - cl_int * source; - cl_int * dest; - cl_int count; - } *args = (arg_struct *)userData; - - for( cl_int i = 0; i < args->count; i++ ) - args->dest[ i ] = args->source[ i ]; -} - -int test_native_kernel(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems ) -{ - int error; - RandomSeed seed( gRandomSeed ); - // Check if we support native kernels - cl_device_exec_capabilities capabilities; - error = clGetDeviceInfo(device, CL_DEVICE_EXECUTION_CAPABILITIES, sizeof(capabilities), &capabilities, NULL); - if (!(capabilities & CL_EXEC_NATIVE_KERNEL)) { - log_info("Device does not support CL_EXEC_NATIVE_KERNEL.\n"); - return 0; - } - - clMemWrapper streams[ 2 ]; -#if !(defined (_WIN32) && defined (_MSC_VER)) - cl_int inBuffer[ n_elems ], outBuffer[ n_elems ]; -#else - cl_int* inBuffer = (cl_int *)_malloca( n_elems * sizeof(cl_int) ); - cl_int* outBuffer = (cl_int *)_malloca( n_elems * sizeof(cl_int) ); -#endif - clEventWrapper finishEvent; - - struct arg_struct - { - cl_mem inputStream; - cl_mem outputStream; - cl_int count; - } args; - - - // Create some input values - generate_random_data( kInt, n_elems, seed, inBuffer ); - - - // Create I/O streams - streams[ 0 ] = clCreateBuffer( context, CL_MEM_COPY_HOST_PTR, n_elems * sizeof(cl_int), inBuffer, &error ); - test_error( error, "Unable to create I/O stream" ); - streams[ 1 ] = clCreateBuffer( context, 0, n_elems * sizeof(cl_int), NULL, &error ); - test_error( error, "Unable to create I/O stream" ); - - - // Set up the arrays to call with - args.inputStream = streams[ 0 ]; - args.outputStream = streams[ 1 ]; - args.count = n_elems; - - void * memLocs[ 2 ] = { &args.inputStream, &args.outputStream }; - - - // Run the kernel - error = clEnqueueNativeKernel( queue, test_native_kernel_fn, - &args, sizeof( args ), - 2, &streams[ 0 ], - (const void **)memLocs, - 0, NULL, &finishEvent ); - test_error( error, "Unable to queue native kernel" ); - - // Finish and wait for the kernel to complete - error = clFinish( queue ); - test_error(error, "clFinish failed"); - - error = clWaitForEvents( 1, &finishEvent ); - test_error(error, "clWaitForEvents failed"); - - // Now read the results and verify - error = clEnqueueReadBuffer( queue, streams[ 1 ], CL_TRUE, 0, n_elems * sizeof(cl_int), outBuffer, 0, NULL, NULL ); - test_error( error, "Unable to read results" ); - - for( int i = 0; i < n_elems; i++ ) - { - if( inBuffer[ i ] != outBuffer[ i ] ) - { - log_error( "ERROR: Data sample %d for native kernel did not validate (expected %d, got %d)\n", - i, (int)inBuffer[ i ], (int)outBuffer[ i ] ); - return 1; - } - } - - return 0; -} - - - - - diff --git a/test_conformance/compatibility/test_conformance/api/test_null_buffer_arg.c b/test_conformance/compatibility/test_conformance/api/test_null_buffer_arg.c deleted file mode 100644 index 0d792136..00000000 --- a/test_conformance/compatibility/test_conformance/api/test_null_buffer_arg.c +++ /dev/null @@ -1,162 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include -#if defined(__APPLE__) -#include -#include -#else -#include -#include -#endif -#include "procs.h" - - -enum { SUCCESS, FAILURE }; -typedef enum { NON_NULL_PATH, ADDROF_NULL_PATH, NULL_PATH } test_type; - -#define NITEMS 4096 - -/* places the casted long value of the src ptr into each element of the output - * array, to allow testing that the kernel actually _gets_ the NULL value */ -const char *kernel_string = -"kernel void test_kernel(global float *src, global long *dst)\n" -"{\n" -" uint tid = get_global_id(0);\n" -" dst[tid] = (long)src;\n" -"}\n"; - -/* - * The guts of the test: - * call setKernelArgs with a regular buffer, &NULL, or NULL depending on - * the value of 'test_type' - */ -static int test_setargs_and_execution(cl_command_queue queue, cl_kernel kernel, - cl_mem test_buf, cl_mem result_buf, test_type type) -{ - unsigned int test_success = 0; - - unsigned int i; - cl_int status; - char *typestr; - - if (type == NON_NULL_PATH) { - status = clSetKernelArg(kernel, 0, sizeof(cl_mem), &test_buf); - typestr = "non-NULL"; - } else if (type == ADDROF_NULL_PATH) { - test_buf = NULL; - status = clSetKernelArg(kernel, 0, sizeof(cl_mem), &test_buf); - typestr = "&NULL"; - } else if (type == NULL_PATH) { - status = clSetKernelArg(kernel, 0, sizeof(cl_mem), NULL); - typestr = "NULL"; - } - - log_info("Testing setKernelArgs with %s buffer.\n", typestr); - - if (status != CL_SUCCESS) { - log_error("clSetKernelArg failed with status: %d\n", status); - return FAILURE; // no point in continuing *this* test - } - - size_t global = NITEMS; - status = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, - NULL, 0, NULL, NULL); - test_error(status, "NDRangeKernel failed."); - - cl_long* host_result = (cl_long*)malloc(NITEMS*sizeof(cl_long)); - status = clEnqueueReadBuffer(queue, result_buf, CL_TRUE, 0, - sizeof(cl_long)*NITEMS, host_result, 0, NULL, NULL); - test_error(status, "ReadBuffer failed."); - - // in the non-null case, we expect NONZERO values: - if (type == NON_NULL_PATH) { - for (i=0; i - -#define EXTENSION_NAME_BUF_SIZE 4096 - -#define PRINT_EXTENSION_INFO 0 - -int test_platform_extensions(cl_device_id deviceID, cl_context context, - cl_command_queue queue, int num_elements) -{ - const char * extensions[] = { - "cl_khr_byte_addressable_store", -// "cl_APPLE_SetMemObjectDestructor", - "cl_khr_global_int32_base_atomics", - "cl_khr_global_int32_extended_atomics", - "cl_khr_local_int32_base_atomics", - "cl_khr_local_int32_extended_atomics", - "cl_khr_int64_base_atomics", - "cl_khr_int64_extended_atomics", -// need to put in entires for various atomics - "cl_khr_3d_image_writes", - "cl_khr_fp16", - "cl_khr_fp64", - NULL - }; - - bool extensionsSupported[] = { - false, //"cl_khr_byte_addressable_store", - false, // need to put in entires for various atomics - false, // "cl_khr_global_int32_base_atomics", - false, // "cl_khr_global_int32_extended_atomics", - false, // "cl_khr_local_int32_base_atomics", - false, // "cl_khr_local_int32_extended_atomics", - false, // "cl_khr_int64_base_atomics", - false, // "cl_khr_int64_extended_atomics", - false, //"cl_khr_3d_image_writes", - false, //"cl_khr_fp16", - false, //"cl_khr_fp64", - false //NULL - }; - - int extensionIndex; - - cl_platform_id platformID; - cl_int err; - - char platform_extensions[EXTENSION_NAME_BUF_SIZE]; - char device_extensions[EXTENSION_NAME_BUF_SIZE]; - - // Okay, so what we're going to do is just check the device indicated by - // deviceID against the platform that includes this device - - - // pass CL_DEVICE_PLATFORM to clGetDeviceInfo - // to get a result of type cl_platform_id - - err = clGetDeviceInfo(deviceID, - CL_DEVICE_PLATFORM, - sizeof(cl_platform_id), - (void *)(&platformID), - NULL); - - if(err != CL_SUCCESS) - { - vlog_error("test_platform_extensions : could not get platformID from device\n"); - return -1; - } - - - // now we grab the set of extensions specified by the platform - err = clGetPlatformInfo(platformID, - CL_PLATFORM_EXTENSIONS, - sizeof(platform_extensions), - (void *)(&platform_extensions[0]), - NULL); - if(err != CL_SUCCESS) - { - vlog_error("test_platform_extensions : could not get extension string from platform\n"); - return -1; - } - -#if PRINT_EXTENSION_INFO - log_info("Platform extensions include \"%s\"\n\n", platform_extensions); -#endif - - // here we parse the platform extensions, to look for the "important" ones - for(extensionIndex=0; extensions[extensionIndex] != NULL; ++extensionIndex) - { - if(strstr(platform_extensions, extensions[extensionIndex]) != NULL) - { - // we found it -#if PRINT_EXTENSION_INFO - log_info("Found \"%s\" in platform extensions\n", - extensions[extensionIndex]); -#endif - extensionsSupported[extensionIndex] = true; - } - } - - // and then we grab the set of extensions specified by the device - // (this can be turned into a "loop over all devices in this platform") - err = clGetDeviceInfo(deviceID, - CL_DEVICE_EXTENSIONS, - sizeof(device_extensions), - (void *)(&device_extensions[0]), - NULL); - if(err != CL_SUCCESS) - { - vlog_error("test_platform_extensions : could not get extension string from device\n"); - return -1; - } - - -#if PRINT_EXTENSION_INFO - log_info("Device extensions include \"%s\"\n\n", device_extensions); -#endif - - for(extensionIndex=0; extensions[extensionIndex] != NULL; ++extensionIndex) - { - if(extensionsSupported[extensionIndex] == false) - { - continue; // skip this one - } - - if(strstr(device_extensions, extensions[extensionIndex]) == NULL) - { - // device does not support it - vlog_error("Platform supports extension \"%s\" but device does not\n", - extensions[extensionIndex]); - return -1; - } - } - return 0; -} - -int test_get_platform_ids(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) { - cl_platform_id platforms[16]; - cl_uint num_platforms; - char *string_returned; - - string_returned = (char*)malloc(8192); - - int total_errors = 0; - int err = CL_SUCCESS; - - - err = clGetPlatformIDs(16, platforms, &num_platforms); - test_error(err, "clGetPlatformIDs failed"); - - if (num_platforms <= 16) { - // Try with NULL - err = clGetPlatformIDs(num_platforms, platforms, NULL); - test_error(err, "clGetPlatformIDs failed with NULL for return size"); - } - - if (num_platforms < 1) { - log_error("Found 0 platforms.\n"); - return -1; - } - log_info("Found %d platforms.\n", num_platforms); - - - for (int p=0; p<(int)num_platforms; p++) { - cl_device_id *devices; - cl_uint num_devices; - size_t size; - - - log_info("Platform %d (%p):\n", p, platforms[p]); - - memset(string_returned, 0, 8192); - err = clGetPlatformInfo(platforms[p], CL_PLATFORM_PROFILE, 8192, string_returned, &size); - test_error(err, "clGetPlatformInfo for CL_PLATFORM_PROFILE failed"); - log_info("\tCL_PLATFORM_PROFILE: %s\n", string_returned); - if (strlen(string_returned)+1 != size) { - log_error("Returned string length %ld does not equal reported one %ld.\n", strlen(string_returned)+1, size); - total_errors++; - } - - memset(string_returned, 0, 8192); - err = clGetPlatformInfo(platforms[p], CL_PLATFORM_VERSION, 8192, string_returned, &size); - test_error(err, "clGetPlatformInfo for CL_PLATFORM_VERSION failed"); - log_info("\tCL_PLATFORM_VERSION: %s\n", string_returned); - if (strlen(string_returned)+1 != size) { - log_error("Returned string length %ld does not equal reported one %ld.\n", strlen(string_returned)+1, size); - total_errors++; - } - - memset(string_returned, 0, 8192); - err = clGetPlatformInfo(platforms[p], CL_PLATFORM_NAME, 8192, string_returned, &size); - test_error(err, "clGetPlatformInfo for CL_PLATFORM_NAME failed"); - log_info("\tCL_PLATFORM_NAME: %s\n", string_returned); - if (strlen(string_returned)+1 != size) { - log_error("Returned string length %ld does not equal reported one %ld.\n", strlen(string_returned)+1, size); - total_errors++; - } - - memset(string_returned, 0, 8192); - err = clGetPlatformInfo(platforms[p], CL_PLATFORM_VENDOR, 8192, string_returned, &size); - test_error(err, "clGetPlatformInfo for CL_PLATFORM_VENDOR failed"); - log_info("\tCL_PLATFORM_VENDOR: %s\n", string_returned); - if (strlen(string_returned)+1 != size) { - log_error("Returned string length %ld does not equal reported one %ld.\n", strlen(string_returned)+1, size); - total_errors++; - } - - memset(string_returned, 0, 8192); - err = clGetPlatformInfo(platforms[p], CL_PLATFORM_EXTENSIONS, 8192, string_returned, &size); - test_error(err, "clGetPlatformInfo for CL_PLATFORM_EXTENSIONS failed"); - log_info("\tCL_PLATFORM_EXTENSIONS: %s\n", string_returned); - if (strlen(string_returned)+1 != size) { - log_error("Returned string length %ld does not equal reported one %ld.\n", strlen(string_returned)+1, size); - total_errors++; - } - - err = clGetDeviceIDs(platforms[p], CL_DEVICE_TYPE_ALL, 0, NULL, &num_devices); - test_error(err, "clGetDeviceIDs size failed.\n"); - devices = (cl_device_id *)malloc(num_devices*sizeof(cl_device_id)); - memset(devices, 0, sizeof(cl_device_id)*num_devices); - err = clGetDeviceIDs(platforms[p], CL_DEVICE_TYPE_ALL, num_devices, devices, NULL); - test_error(err, "clGetDeviceIDs failed.\n"); - - log_info("\tPlatform has %d devices.\n", (int)num_devices); - for (int d=0; d<(int)num_devices; d++) { - size_t returned_size; - cl_platform_id returned_platform; - cl_context context; - cl_context_properties properties[] = { CL_CONTEXT_PLATFORM, (cl_context_properties)platforms[p], 0 }; - - err = clGetDeviceInfo(devices[d], CL_DEVICE_PLATFORM, sizeof(cl_platform_id), &returned_platform, &returned_size); - test_error(err, "clGetDeviceInfo failed for CL_DEVICE_PLATFORM\n"); - if (returned_size != sizeof(cl_platform_id)) { - log_error("Reported return size (%ld) does not match expected size (%ld).\n", returned_size, sizeof(cl_platform_id)); - total_errors++; - } - - memset(string_returned, 0, 8192); - err = clGetDeviceInfo(devices[d], CL_DEVICE_NAME, 8192, string_returned, NULL); - test_error(err, "clGetDeviceInfo failed for CL_DEVICE_NAME\n"); - - log_info("\t\tPlatform for device %d (%s) is %p.\n", d, string_returned, returned_platform); - - log_info("\t\t\tTesting clCreateContext for the platform/device...\n"); - // Try creating a context for the platform - context = clCreateContext(properties, 1, &devices[d], NULL, NULL, &err); - test_error(err, "\t\tclCreateContext failed for device with platform properties\n"); - - memset(properties, 0, sizeof(cl_context_properties)*3); - - err = clGetContextInfo(context, CL_CONTEXT_PROPERTIES, sizeof(cl_context_properties)*3, properties, &returned_size); - test_error(err, "clGetContextInfo for CL_CONTEXT_PROPERTIES failed"); - if (returned_size != sizeof(cl_context_properties)*3) { - log_error("Invalid size returned from clGetContextInfo for CL_CONTEXT_PROPERTIES. Got %ld, expected %ld.\n", - returned_size, sizeof(cl_context_properties)*3); - total_errors++; - } - - if (properties[0] != (cl_context_properties)CL_CONTEXT_PLATFORM || properties[1] != (cl_context_properties)platforms[p]) { - log_error("Wrong properties returned. Expected: [%p %p], got [%p %p]\n", - (void*)CL_CONTEXT_PLATFORM, platforms[p], (void*)properties[0], (void*)properties[1]); - total_errors++; - } - - err = clReleaseContext(context); - test_error(err, "clReleaseContext failed"); - } - free(devices); - } - - free(string_returned); - - return total_errors; -} diff --git a/test_conformance/compatibility/test_conformance/api/test_queries.cpp b/test_conformance/compatibility/test_conformance/api/test_queries.cpp deleted file mode 100644 index 8e34f97d..00000000 --- a/test_conformance/compatibility/test_conformance/api/test_queries.cpp +++ /dev/null @@ -1,635 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "testBase.h" -#include "../../test_common/harness/imageHelpers.h" -#include -#include - -int test_get_platform_info(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - cl_platform_id platform; - cl_int error; - char buffer[ 4098 ]; - size_t length; - - // Get the platform to use - error = clGetPlatformIDs(1, &platform, NULL); - test_error( error, "Unable to get platform" ); - - // Platform profile should either be FULL_PROFILE or EMBEDDED_PROFILE - error = clGetPlatformInfo(platform, CL_PLATFORM_PROFILE, sizeof( buffer ), buffer, &length ); - test_error( error, "Unable to get platform profile string" ); - - log_info("Returned CL_PLATFORM_PROFILE %s.\n", buffer); - - if( strcmp( buffer, "FULL_PROFILE" ) != 0 && strcmp( buffer, "EMBEDDED_PROFILE" ) != 0 ) - { - log_error( "ERROR: Returned platform profile string is not a valid string by OpenCL 1.2! (Returned: %s)\n", buffer ); - return -1; - } - if( strlen( buffer )+1 != length ) - { - log_error( "ERROR: Returned length of profile string is incorrect (actual length: %d, returned length: %d)\n", - (int)strlen( buffer )+1, (int)length ); - return -1; - } - - // Check just length return - error = clGetPlatformInfo(platform, CL_PLATFORM_PROFILE, 0, NULL, &length ); - test_error( error, "Unable to get platform profile length" ); - if( strlen( (char *)buffer )+1 != length ) - { - log_error( "ERROR: Returned length of profile string is incorrect (actual length: %d, returned length: %d)\n", - (int)strlen( (char *)buffer )+1, (int)length ); - return -1; - } - - - // Platform version should fit the regex "OpenCL *[0-9]+\.[0-9]+" - error = clGetPlatformInfo(platform, CL_PLATFORM_VERSION, sizeof( buffer ), buffer, &length ); - test_error( error, "Unable to get platform version string" ); - - log_info("Returned CL_PLATFORM_VERSION %s.\n", buffer); - - if( memcmp( buffer, "OpenCL ", strlen( "OpenCL " ) ) != 0 ) - { - log_error( "ERROR: Initial part of platform version string does not match required format! (returned: %s)\n", (char *)buffer ); - return -1; - } - char *p1 = (char *)buffer + strlen( "OpenCL " ); - while( *p1 == ' ' ) - p1++; - char *p2 = p1; - while( isdigit( *p2 ) ) - p2++; - if( *p2 != '.' ) - { - log_error( "ERROR: Numeric part of platform version string does not match required format! (returned: %s)\n", (char *)buffer ); - return -1; - } - char *p3 = p2 + 1; - while( isdigit( *p3 ) ) - p3++; - if( *p3 != ' ' ) - { - log_error( "ERROR: space expected after minor version number! (returned: %s)\n", (char *)buffer ); - return -1; - } - *p2 = ' '; // Put in a space for atoi below. - p2++; - - // make sure it is null terminated - for( ; p3 != buffer + length; p3++ ) - if( *p3 == '\0' ) - break; - if( p3 == buffer + length ) - { - log_error( "ERROR: platform version string is not NUL terminated!\n" ); - return -1; - } - - int major = atoi( p1 ); - int minor = atoi( p2 ); - int minor_revision = 2; - if( major * 10 + minor < 10 + minor_revision ) - { - log_error( "ERROR: OpenCL profile version returned is less than 1.%d!\n", minor_revision ); - return -1; - } - - // Sanity checks on the returned values - if( length != strlen( (char *)buffer ) + 1) - { - log_error( "ERROR: Returned length of version string does not match actual length (actual: %d, returned: %d)\n", (int)strlen( (char *)buffer )+1, (int)length ); - return -1; - } - - // Check just length - error = clGetPlatformInfo(platform, CL_PLATFORM_VERSION, 0, NULL, &length ); - test_error( error, "Unable to get platform version length" ); - if( length != strlen( (char *)buffer )+1 ) - { - log_error( "ERROR: Returned length of version string does not match actual length (actual: %d, returned: %d)\n", (int)strlen( buffer )+1, (int)length ); - return -1; - } - - return 0; -} - -int test_get_sampler_info(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - size_t size; - - PASSIVE_REQUIRE_IMAGE_SUPPORT( deviceID ) - - clSamplerWrapper sampler = clCreateSampler( context, CL_TRUE, CL_ADDRESS_CLAMP, CL_FILTER_LINEAR, &error ); - test_error( error, "Unable to create sampler to test with" ); - - cl_uint refCount; - error = clGetSamplerInfo( sampler, CL_SAMPLER_REFERENCE_COUNT, sizeof( refCount ), &refCount, &size ); - test_error( error, "Unable to get sampler ref count" ); - if( size != sizeof( refCount ) ) - { - log_error( "ERROR: Returned size of sampler refcount does not validate! (expected %d, got %d)\n", (int)sizeof( refCount ), (int)size ); - return -1; - } - - cl_context otherCtx; - error = clGetSamplerInfo( sampler, CL_SAMPLER_CONTEXT, sizeof( otherCtx ), &otherCtx, &size ); - test_error( error, "Unable to get sampler context" ); - if( otherCtx != context ) - { - log_error( "ERROR: Sampler context does not validate! (expected %p, got %p)\n", context, otherCtx ); - return -1; - } - if( size != sizeof( otherCtx ) ) - { - log_error( "ERROR: Returned size of sampler context does not validate! (expected %d, got %d)\n", (int)sizeof( otherCtx ), (int)size ); - return -1; - } - - cl_addressing_mode mode; - error = clGetSamplerInfo( sampler, CL_SAMPLER_ADDRESSING_MODE, sizeof( mode ), &mode, &size ); - test_error( error, "Unable to get sampler addressing mode" ); - if( mode != CL_ADDRESS_CLAMP ) - { - log_error( "ERROR: Sampler addressing mode does not validate! (expected %d, got %d)\n", (int)CL_ADDRESS_CLAMP, (int)mode ); - return -1; - } - if( size != sizeof( mode ) ) - { - log_error( "ERROR: Returned size of sampler addressing mode does not validate! (expected %d, got %d)\n", (int)sizeof( mode ), (int)size ); - return -1; - } - - cl_filter_mode fmode; - error = clGetSamplerInfo( sampler, CL_SAMPLER_FILTER_MODE, sizeof( fmode ), &fmode, &size ); - test_error( error, "Unable to get sampler filter mode" ); - if( fmode != CL_FILTER_LINEAR ) - { - log_error( "ERROR: Sampler filter mode does not validate! (expected %d, got %d)\n", (int)CL_FILTER_LINEAR, (int)fmode ); - return -1; - } - if( size != sizeof( fmode ) ) - { - log_error( "ERROR: Returned size of sampler filter mode does not validate! (expected %d, got %d)\n", (int)sizeof( fmode ), (int)size ); - return -1; - } - - cl_int norm; - error = clGetSamplerInfo( sampler, CL_SAMPLER_NORMALIZED_COORDS, sizeof( norm ), &norm, &size ); - test_error( error, "Unable to get sampler normalized flag" ); - if( norm != CL_TRUE ) - { - log_error( "ERROR: Sampler normalized flag does not validate! (expected %d, got %d)\n", (int)CL_TRUE, (int)norm ); - return -1; - } - if( size != sizeof( norm ) ) - { - log_error( "ERROR: Returned size of sampler normalized flag does not validate! (expected %d, got %d)\n", (int)sizeof( norm ), (int)size ); - return -1; - } - - return 0; -} - -#define TEST_COMMAND_QUEUE_PARAM( queue, paramName, val, expected, name, type, cast ) \ -error = clGetCommandQueueInfo( queue, paramName, sizeof( val ), &val, &size ); \ -test_error( error, "Unable to get command queue " name ); \ -if( val != expected ) \ -{ \ -log_error( "ERROR: Command queue " name " did not validate! (expected " type ", got " type ")\n", (cast)expected, (cast)val ); \ -return -1; \ -} \ -if( size != sizeof( val ) ) \ -{ \ -log_error( "ERROR: Returned size of command queue " name " does not validate! (expected %d, got %d)\n", (int)sizeof( val ), (int)size ); \ -return -1; \ -} - -int test_get_command_queue_info(cl_device_id deviceID, cl_context context, cl_command_queue ignoreQueue, int num_elements) -{ - int error; - size_t size; - - cl_command_queue_properties device_props; - clGetDeviceInfo(deviceID, CL_DEVICE_QUEUE_PROPERTIES, sizeof(device_props), &device_props, NULL); - log_info("CL_DEVICE_QUEUE_PROPERTIES is %d\n", (int)device_props); - - clCommandQueueWrapper queue = clCreateCommandQueue( context, deviceID, device_props, &error ); - test_error( error, "Unable to create command queue to test with" ); - - cl_uint refCount; - error = clGetCommandQueueInfo( queue, CL_QUEUE_REFERENCE_COUNT, sizeof( refCount ), &refCount, &size ); - test_error( error, "Unable to get command queue reference count" ); - if( size != sizeof( refCount ) ) - { - log_error( "ERROR: Returned size of command queue reference count does not validate! (expected %d, got %d)\n", (int)sizeof( refCount ), (int)size ); - return -1; - } - - cl_context otherCtx; - TEST_COMMAND_QUEUE_PARAM( queue, CL_QUEUE_CONTEXT, otherCtx, context, "context", "%p", cl_context ) - - cl_device_id otherDevice; - error = clGetCommandQueueInfo( queue, CL_QUEUE_DEVICE, sizeof(otherDevice), &otherDevice, &size); - test_error(error, "clGetCommandQueue failed."); - - if (size != sizeof(cl_device_id)) { - log_error( " ERROR: Returned size of command queue CL_QUEUE_DEVICE does not validate! (expected %d, got %d)\n", (int)sizeof( otherDevice ), (int)size ); - return -1; - } - - /* Since the device IDs are opaque types we check the CL_DEVICE_VENDOR_ID which is unique for identical hardware. */ - cl_uint otherDevice_vid, deviceID_vid; - error = clGetDeviceInfo(otherDevice, CL_DEVICE_VENDOR_ID, sizeof(otherDevice_vid), &otherDevice_vid, NULL ); - test_error( error, "Unable to get device CL_DEVICE_VENDOR_ID" ); - error = clGetDeviceInfo(deviceID, CL_DEVICE_VENDOR_ID, sizeof(deviceID_vid), &deviceID_vid, NULL ); - test_error( error, "Unable to get device CL_DEVICE_VENDOR_ID" ); - - if( otherDevice_vid != deviceID_vid ) - { - log_error( "ERROR: Incorrect device returned for queue! (Expected vendor ID 0x%x, got 0x%x)\n", deviceID_vid, otherDevice_vid ); - return -1; - } - - cl_command_queue_properties props; - TEST_COMMAND_QUEUE_PARAM( queue, CL_QUEUE_PROPERTIES, props, (unsigned int)( device_props ), "properties", "%d", unsigned int ) - - return 0; -} - -int test_get_context_info(cl_device_id deviceID, cl_context context, cl_command_queue ignoreQueue, int num_elements) -{ - int error; - size_t size; - cl_context_properties props; - - error = clGetContextInfo( context, CL_CONTEXT_PROPERTIES, sizeof( props ), &props, &size ); - test_error( error, "Unable to get context props" ); - - if (size == 0) { - // Valid size - return 0; - } else if (size == sizeof(cl_context_properties)) { - // Data must be NULL - if (props != 0) { - log_error("ERROR: Returned properties is no NULL.\n"); - return -1; - } - // Valid data and size - return 0; - } - // Size was not 0 or 1 - log_error( "ERROR: Returned size of context props is not valid! (expected 0 or %d, got %d)\n", - (int)sizeof(cl_context_properties), (int)size ); - return -1; -} - -#define TEST_MEM_OBJECT_PARAM( mem, paramName, val, expected, name, type, cast ) \ -error = clGetMemObjectInfo( mem, paramName, sizeof( val ), &val, &size ); \ -test_error( error, "Unable to get mem object " name ); \ -if( val != expected ) \ -{ \ -log_error( "ERROR: Mem object " name " did not validate! (expected " type ", got " type ")\n", (cast)(expected), (cast)val ); \ -return -1; \ -} \ -if( size != sizeof( val ) ) \ -{ \ -log_error( "ERROR: Returned size of mem object " name " does not validate! (expected %d, got %d)\n", (int)sizeof( val ), (int)size ); \ -return -1; \ -} - -void CL_CALLBACK mem_obj_destructor_callback( cl_mem, void *data ) -{ - free( data ); -} - -// All possible combinations of valid cl_mem_flags. -static cl_mem_flags all_flags[16] = { - 0, - CL_MEM_READ_WRITE, - CL_MEM_READ_ONLY, - CL_MEM_WRITE_ONLY, - CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR, - CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, - CL_MEM_WRITE_ONLY | CL_MEM_COPY_HOST_PTR, - CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_READ_ONLY | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_WRITE_ONLY | CL_MEM_ALLOC_HOST_PTR, - CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_READ_ONLY | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_WRITE_ONLY | CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR, - CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR, - CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR, -}; - -#define TEST_DEVICE_PARAM( device, paramName, val, name, type, cast ) \ -error = clGetDeviceInfo( device, paramName, sizeof( val ), &val, &size ); \ -test_error( error, "Unable to get device " name ); \ -if( size != sizeof( val ) ) \ -{ \ -log_error( "ERROR: Returned size of device " name " does not validate! (expected %d, got %d)\n", (int)sizeof( val ), (int)size ); \ -return -1; \ -} \ -log_info( "\tReported device " name " : " type "\n", (cast)val ); - -#define TEST_DEVICE_PARAM_MEM( device, paramName, val, name, type, div ) \ -error = clGetDeviceInfo( device, paramName, sizeof( val ), &val, &size ); \ -test_error( error, "Unable to get device " name ); \ -if( size != sizeof( val ) ) \ -{ \ -log_error( "ERROR: Returned size of device " name " does not validate! (expected %d, got %d)\n", (int)sizeof( val ), (int)size ); \ -return -1; \ -} \ -log_info( "\tReported device " name " : " type "\n", (int)( val / div ) ); - -int test_get_device_info(cl_device_id deviceID, cl_context context, cl_command_queue ignoreQueue, int num_elements) -{ - int error; - size_t size; - - cl_uint vendorID; - TEST_DEVICE_PARAM( deviceID, CL_DEVICE_VENDOR_ID, vendorID, "vendor ID", "0x%08x", int ) - - char extensions[ 10240 ]; - error = clGetDeviceInfo( deviceID, CL_DEVICE_EXTENSIONS, sizeof( extensions ), &extensions, &size ); - test_error( error, "Unable to get device extensions" ); - if( size != strlen( extensions ) + 1 ) - { - log_error( "ERROR: Returned size of device extensions does not validate! (expected %d, got %d)\n", (int)( strlen( extensions ) + 1 ), (int)size ); - return -1; - } - log_info( "\tReported device extensions: %s \n", extensions ); - - cl_uint preferred; - TEST_DEVICE_PARAM( deviceID, CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR, preferred, "preferred vector char width", "%d", int ) - TEST_DEVICE_PARAM( deviceID, CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT, preferred, "preferred vector short width", "%d", int ) - TEST_DEVICE_PARAM( deviceID, CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT, preferred, "preferred vector int width", "%d", int ) - TEST_DEVICE_PARAM( deviceID, CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG, preferred, "preferred vector long width", "%d", int ) - TEST_DEVICE_PARAM( deviceID, CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT, preferred, "preferred vector float width", "%d", int ) - TEST_DEVICE_PARAM( deviceID, CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE, preferred, "preferred vector double width", "%d", int ) - - // Note that even if cl_khr_fp64, the preferred width for double can be non-zero. For example, vendors - // extensions can support double but may not support cl_khr_fp64, which implies math library support. - - cl_uint baseAddrAlign; - TEST_DEVICE_PARAM( deviceID, CL_DEVICE_MEM_BASE_ADDR_ALIGN, baseAddrAlign, "base address alignment", "%d bytes", int ) - - cl_uint maxDataAlign; - TEST_DEVICE_PARAM( deviceID, CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE, maxDataAlign, "min data type alignment", "%d bytes", int ) - - cl_device_mem_cache_type cacheType; - error = clGetDeviceInfo( deviceID, CL_DEVICE_GLOBAL_MEM_CACHE_TYPE, sizeof( cacheType ), &cacheType, &size ); - test_error( error, "Unable to get device global mem cache type" ); - if( size != sizeof( cacheType ) ) - { - log_error( "ERROR: Returned size of device global mem cache type does not validate! (expected %d, got %d)\n", (int)sizeof( cacheType ), (int)size ); - return -1; - } - const char *cacheTypeName = ( cacheType == CL_NONE ) ? "CL_NONE" : ( cacheType == CL_READ_ONLY_CACHE ) ? "CL_READ_ONLY_CACHE" : ( cacheType == CL_READ_WRITE_CACHE ) ? "CL_READ_WRITE_CACHE" : ""; - log_info( "\tReported device global mem cache type: %s \n", cacheTypeName ); - - cl_uint cachelineSize; - TEST_DEVICE_PARAM( deviceID, CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE, cachelineSize, "global mem cacheline size", "%d bytes", int ) - - cl_ulong cacheSize; - TEST_DEVICE_PARAM_MEM( deviceID, CL_DEVICE_GLOBAL_MEM_CACHE_SIZE, cacheSize, "global mem cache size", "%d KB", 1024 ) - - cl_ulong memSize; - TEST_DEVICE_PARAM_MEM( deviceID, CL_DEVICE_GLOBAL_MEM_SIZE, memSize, "global mem size", "%d MB", ( 1024 * 1024 ) ) - - cl_device_local_mem_type localMemType; - error = clGetDeviceInfo( deviceID, CL_DEVICE_LOCAL_MEM_TYPE, sizeof( localMemType ), &localMemType, &size ); - test_error( error, "Unable to get device local mem type" ); - if( size != sizeof( cacheType ) ) - { - log_error( "ERROR: Returned size of device local mem type does not validate! (expected %d, got %d)\n", (int)sizeof( localMemType ), (int)size ); - return -1; - } - const char *localMemTypeName = ( localMemType == CL_LOCAL ) ? "CL_LOCAL" : ( cacheType == CL_GLOBAL ) ? "CL_GLOBAL" : ""; - log_info( "\tReported device local mem type: %s \n", localMemTypeName ); - - - cl_bool errSupport; - TEST_DEVICE_PARAM( deviceID, CL_DEVICE_ERROR_CORRECTION_SUPPORT, errSupport, "error correction support", "%d", int ) - - size_t timerResolution; - TEST_DEVICE_PARAM( deviceID, CL_DEVICE_PROFILING_TIMER_RESOLUTION, timerResolution, "profiling timer resolution", "%ld nanoseconds", long ) - - cl_bool endian; - TEST_DEVICE_PARAM( deviceID, CL_DEVICE_ENDIAN_LITTLE, endian, "little endian flag", "%d", int ) - - cl_bool avail; - TEST_DEVICE_PARAM( deviceID, CL_DEVICE_AVAILABLE, avail, "available flag", "%d", int ) - - cl_bool compilerAvail; - TEST_DEVICE_PARAM( deviceID, CL_DEVICE_COMPILER_AVAILABLE, compilerAvail, "compiler available flag", "%d", int ) - - char profile[ 1024 ]; - error = clGetDeviceInfo( deviceID, CL_DEVICE_PROFILE, sizeof( profile ), &profile, &size ); - test_error( error, "Unable to get device profile" ); - if( size != strlen( profile ) + 1 ) - { - log_error( "ERROR: Returned size of device profile does not validate! (expected %d, got %d)\n", (int)( strlen( profile ) + 1 ), (int)size ); - return -1; - } - if( strcmp( profile, "FULL_PROFILE" ) != 0 && strcmp( profile, "EMBEDDED_PROFILE" ) != 0 ) - { - log_error( "ERROR: Returned profile of device not FULL or EMBEDDED as required by OpenCL 1.2! (Returned %s)\n", profile ); - return -1; - } - log_info( "\tReported device profile: %s \n", profile ); - - - return 0; -} - - - - -static const char *sample_compile_size[2] = { - "__kernel void sample_test(__global int *src, __global int *dst)\n" - "{\n" - " int tid = get_global_id(0);\n" - " dst[tid] = src[tid];\n" - "\n" - "}\n", - "__kernel __attribute__((reqd_work_group_size(%d,%d,%d))) void sample_test(__global int *src, __global int *dst)\n" - "{\n" - " int tid = get_global_id(0);\n" - " dst[tid] = src[tid];\n" - "\n" - "}\n" }; - -int test_kernel_required_group_size(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - size_t realSize; - size_t kernel_max_workgroup_size; - size_t global[] = {64,14,10}; - size_t local[] = {0,0,0}; - - cl_uint max_dimensions; - - error = clGetDeviceInfo(deviceID, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, sizeof(max_dimensions), &max_dimensions, NULL); - test_error(error, "clGetDeviceInfo failed for CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS"); - log_info("Device reported CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS = %d.\n", (int)max_dimensions); - - { - clProgramWrapper program; - clKernelWrapper kernel; - - error = create_single_kernel_helper( context, &program, &kernel, 1, &sample_compile_size[ 0 ], "sample_test" ); - if( error != 0 ) - return error; - - error = clGetKernelWorkGroupInfo(kernel, deviceID, CL_KERNEL_WORK_GROUP_SIZE, sizeof(kernel_max_workgroup_size), &kernel_max_workgroup_size, NULL); - test_error( error, "clGetKernelWorkGroupInfo failed for CL_KERNEL_WORK_GROUP_SIZE"); - log_info("The CL_KERNEL_WORK_GROUP_SIZE for the kernel is %d.\n", (int)kernel_max_workgroup_size); - - size_t size[ 3 ]; - error = clGetKernelWorkGroupInfo( kernel, deviceID, CL_KERNEL_COMPILE_WORK_GROUP_SIZE, sizeof( size ), size, &realSize ); - test_error( error, "Unable to get work group info" ); - - if( size[ 0 ] != 0 || size[ 1 ] != 0 || size[ 2 ] != 0 ) - { - log_error( "ERROR: Nonzero compile work group size returned for nonspecified size! (returned %d,%d,%d)\n", (int)size[0], (int)size[1], (int)size[2] ); - return -1; - } - - if( realSize != sizeof( size ) ) - { - log_error( "ERROR: Returned size of compile work group size not valid! (Expected %d, got %d)\n", (int)sizeof( size ), (int)realSize ); - return -1; - } - - // Determine some local dimensions to use for the test. - if (max_dimensions == 1) { - error = get_max_common_work_group_size(context, kernel, global[0], &local[0]); - test_error( error, "get_max_common_work_group_size failed"); - log_info("For global dimension %d, kernel will require local dimension %d.\n", (int)global[0], (int)local[0]); - } else if (max_dimensions == 2) { - error = get_max_common_2D_work_group_size(context, kernel, global, local); - test_error( error, "get_max_common_2D_work_group_size failed"); - log_info("For global dimension %d x %d, kernel will require local dimension %d x %d.\n", (int)global[0], (int)global[1], (int)local[0], (int)local[1]); - } else { - error = get_max_common_3D_work_group_size(context, kernel, global, local); - test_error( error, "get_max_common_3D_work_group_size failed"); - log_info("For global dimension %d x %d x %d, kernel will require local dimension %d x %d x %d.\n", - (int)global[0], (int)global[1], (int)global[2], (int)local[0], (int)local[1], (int)local[2]); - } - } - - - { - clProgramWrapper program; - clKernelWrapper kernel; - clMemWrapper in, out; - //char source[1024]; - char *source = (char*)malloc(1024); - source[0] = '\0'; - - sprintf(source, sample_compile_size[1], local[0], local[1], local[2]); - - error = create_single_kernel_helper( context, &program, &kernel, 1, (const char**)&source, "sample_test" ); - if( error != 0 ) - return error; - - size_t size[ 3 ]; - error = clGetKernelWorkGroupInfo( kernel, deviceID, CL_KERNEL_COMPILE_WORK_GROUP_SIZE, sizeof( size ), size, &realSize ); - test_error( error, "Unable to get work group info" ); - - if( size[ 0 ] != local[0] || size[ 1 ] != local[1] || size[ 2 ] != local[2] ) - { - log_error( "ERROR: Incorrect compile work group size returned for specified size! (returned %d,%d,%d, expected %d,%d,%d)\n", - (int)size[0], (int)size[1], (int)size[2], (int)local[0], (int)local[1], (int)local[2]); - return -1; - } - - // Verify that the kernel will only execute with that size. - in = clCreateBuffer(context, CL_MEM_READ_ONLY, sizeof(cl_int)*global[0], NULL, &error); - test_error(error, "clCreateBuffer failed"); - out = clCreateBuffer(context, CL_MEM_WRITE_ONLY, sizeof(cl_int)*global[0], NULL, &error); - test_error(error, "clCreateBuffer failed"); - - error = clSetKernelArg(kernel, 0, sizeof(in), &in); - test_error(error, "clSetKernelArg failed"); - error = clSetKernelArg(kernel, 1, sizeof(out), &out); - test_error(error, "clSetKernelArg failed"); - - error = clEnqueueNDRangeKernel(queue, kernel, 3, NULL, global, local, 0, NULL, NULL); - test_error(error, "clEnqueueNDRangeKernel failed"); - - error = clFinish(queue); - test_error(error, "clFinish failed"); - - log_info("kernel_required_group_size may report spurious ERRORS in the conformance log.\n"); - - local[0]++; - error = clEnqueueNDRangeKernel(queue, kernel, 3, NULL, global, local, 0, NULL, NULL); - if (error != CL_INVALID_WORK_GROUP_SIZE) { - log_error("Incorrect error returned for executing a kernel with the wrong required local work group size. (used %d,%d,%d, required %d,%d,%d)\n", - (int)local[0], (int)local[1], (int)local[2], (int)local[0]-1, (int)local[1], (int)local[2] ); - print_error(error, "Expected: CL_INVALID_WORK_GROUP_SIZE."); - return -1; - } - - error = clFinish(queue); - test_error(error, "clFinish failed"); - - if (max_dimensions == 1) { - free(source); - return 0; - } - - local[0]--; local[1]++; - error = clEnqueueNDRangeKernel(queue, kernel, 3, NULL, global, local, 0, NULL, NULL); - if (error != CL_INVALID_WORK_GROUP_SIZE) { - log_error("Incorrect error returned for executing a kernel with the wrong required local work group size. (used %d,%d,%d, required %d,%d,%d)\n", - (int)local[0], (int)local[1], (int)local[2], (int)local[0]-1, (int)local[1], (int)local[2]); - print_error(error, "Expected: CL_INVALID_WORK_GROUP_SIZE."); - return -1; - } - - error = clFinish(queue); - test_error(error, "clFinish failed"); - - if (max_dimensions == 2) { - return 0; - free(source); - } - - local[1]--; local[2]++; - error = clEnqueueNDRangeKernel(queue, kernel, 3, NULL, global, local, 0, NULL, NULL); - if (error != CL_INVALID_WORK_GROUP_SIZE) { - log_error("Incorrect error returned for executing a kernel with the wrong required local work group size. (used %d,%d,%d, required %d,%d,%d)\n", - (int)local[0], (int)local[1], (int)local[2], (int)local[0]-1, (int)local[1], (int)local[2]); - print_error(error, "Expected: CL_INVALID_WORK_GROUP_SIZE."); - return -1; - } - - error = clFinish(queue); - test_error(error, "clFinish failed"); - free(source); - } - - return 0; -} - - diff --git a/test_conformance/compatibility/test_conformance/api/test_retain.cpp b/test_conformance/compatibility/test_conformance/api/test_retain.cpp deleted file mode 100644 index 0fa0ac6b..00000000 --- a/test_conformance/compatibility/test_conformance/api/test_retain.cpp +++ /dev/null @@ -1,234 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "testBase.h" -#if !defined(_WIN32) -#include -#endif // !_WIN32 - -// Note: According to spec, the various functions to get instance counts should return an error when passed in an object -// that has already been released. However, the spec is out of date. If it gets re-updated to allow such action, re-enable -// this define. -//#define VERIFY_AFTER_RELEASE 1 - -#define GET_QUEUE_INSTANCE_COUNT(p) numInstances = ( (err = clGetCommandQueueInfo(p, CL_QUEUE_REFERENCE_COUNT, sizeof( numInstances ), &numInstances, NULL)) == CL_SUCCESS ? numInstances : 0 ) -#define GET_MEM_INSTANCE_COUNT(p) numInstances = ( (err = clGetMemObjectInfo(p, CL_MEM_REFERENCE_COUNT, sizeof( numInstances ), &numInstances, NULL)) == CL_SUCCESS ? numInstances : 0 ) - -#define VERIFY_INSTANCE_COUNT(c,rightValue) if( c != rightValue ) { \ -log_error( "ERROR: Instance count for test object is not valid! (should be %d, really is %d)\n", rightValue, c ); \ -return -1; } - -int test_retain_queue_single(cl_device_id deviceID, cl_context context, cl_command_queue queueNotUsed, int num_elements) -{ - cl_command_queue queue; - cl_uint numInstances; - int err; - - - /* Create a test queue */ - queue = clCreateCommandQueue( context, deviceID, 0, &err ); - test_error( err, "Unable to create command queue to test with" ); - - /* Test the instance count */ - GET_QUEUE_INSTANCE_COUNT( queue ); - test_error( err, "Unable to get queue instance count" ); - VERIFY_INSTANCE_COUNT( numInstances, 1 ); - - /* Now release the program */ - clReleaseCommandQueue( queue ); -#ifdef VERIFY_AFTER_RELEASE - /* We're not allowed to get the instance count after the object has been completely released. But that's - exactly how we can tell the release worked--by making sure getting the instance count fails! */ - GET_QUEUE_INSTANCE_COUNT( queue ); - if( err != CL_INVALID_COMMAND_QUEUE ) - { - print_error( err, "Command queue was not properly released" ); - return -1; - } -#endif - - return 0; -} - -int test_retain_queue_multiple(cl_device_id deviceID, cl_context context, cl_command_queue queueNotUsed, int num_elements) -{ - cl_command_queue queue; - unsigned int numInstances, i; - int err; - - - /* Create a test program */ - queue = clCreateCommandQueue( context, deviceID, 0, &err ); - test_error( err, "Unable to create command queue to test with" ); - - /* Increment 9 times, which should bring the count to 10 */ - for( i = 0; i < 9; i++ ) - { - clRetainCommandQueue( queue ); - } - - /* Test the instance count */ - GET_QUEUE_INSTANCE_COUNT( queue ); - test_error( err, "Unable to get queue instance count" ); - VERIFY_INSTANCE_COUNT( numInstances, 10 ); - - /* Now release 5 times, which should take us to 5 */ - for( i = 0; i < 5; i++ ) - { - clReleaseCommandQueue( queue ); - } - - GET_QUEUE_INSTANCE_COUNT( queue ); - test_error( err, "Unable to get queue instance count" ); - VERIFY_INSTANCE_COUNT( numInstances, 5 ); - - /* Retain again three times, which should take us to 8 */ - for( i = 0; i < 3; i++ ) - { - clRetainCommandQueue( queue ); - } - - GET_QUEUE_INSTANCE_COUNT( queue ); - test_error( err, "Unable to get queue instance count" ); - VERIFY_INSTANCE_COUNT( numInstances, 8 ); - - /* Release 7 times, which should take it to 1 */ - for( i = 0; i < 7; i++ ) - { - clReleaseCommandQueue( queue ); - } - - GET_QUEUE_INSTANCE_COUNT( queue ); - test_error( err, "Unable to get queue instance count" ); - VERIFY_INSTANCE_COUNT( numInstances, 1 ); - - /* And one last one */ - clReleaseCommandQueue( queue ); - -#ifdef VERIFY_AFTER_RELEASE - /* We're not allowed to get the instance count after the object has been completely released. But that's - exactly how we can tell the release worked--by making sure getting the instance count fails! */ - GET_QUEUE_INSTANCE_COUNT( queue ); - if( err != CL_INVALID_COMMAND_QUEUE ) - { - print_error( err, "Command queue was not properly released" ); - return -1; - } -#endif - - return 0; -} - -int test_retain_mem_object_single(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - cl_mem object; - cl_uint numInstances; - int err; - - - /* Create a test object */ - object = clCreateBuffer( context, CL_MEM_READ_ONLY, 32, NULL, &err ); - test_error( err, "Unable to create buffer to test with" ); - - /* Test the instance count */ - GET_MEM_INSTANCE_COUNT( object ); - test_error( err, "Unable to get mem object count" ); - VERIFY_INSTANCE_COUNT( numInstances, 1 ); - - /* Now release the program */ - clReleaseMemObject( object ); -#ifdef VERIFY_AFTER_RELEASE - /* We're not allowed to get the instance count after the object has been completely released. But that's - exactly how we can tell the release worked--by making sure getting the instance count fails! */ - GET_MEM_INSTANCE_COUNT( object ); - if( err != CL_INVALID_MEM_OBJECT ) - { - print_error( err, "Mem object was not properly released" ); - return -1; - } -#endif - - return 0; -} - -int test_retain_mem_object_multiple(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - cl_mem object; - unsigned int numInstances, i; - int err; - - - /* Create a test object */ - object = clCreateBuffer( context, CL_MEM_READ_ONLY, 32, NULL, &err ); - test_error( err, "Unable to create buffer to test with" ); - - /* Increment 9 times, which should bring the count to 10 */ - for( i = 0; i < 9; i++ ) - { - clRetainMemObject( object ); - } - - /* Test the instance count */ - GET_MEM_INSTANCE_COUNT( object ); - test_error( err, "Unable to get mem object count" ); - VERIFY_INSTANCE_COUNT( numInstances, 10 ); - - /* Now release 5 times, which should take us to 5 */ - for( i = 0; i < 5; i++ ) - { - clReleaseMemObject( object ); - } - - GET_MEM_INSTANCE_COUNT( object ); - test_error( err, "Unable to get mem object count" ); - VERIFY_INSTANCE_COUNT( numInstances, 5 ); - - /* Retain again three times, which should take us to 8 */ - for( i = 0; i < 3; i++ ) - { - clRetainMemObject( object ); - } - - GET_MEM_INSTANCE_COUNT( object ); - test_error( err, "Unable to get mem object count" ); - VERIFY_INSTANCE_COUNT( numInstances, 8 ); - - /* Release 7 times, which should take it to 1 */ - for( i = 0; i < 7; i++ ) - { - clReleaseMemObject( object ); - } - - GET_MEM_INSTANCE_COUNT( object ); - test_error( err, "Unable to get mem object count" ); - VERIFY_INSTANCE_COUNT( numInstances, 1 ); - - /* And one last one */ - clReleaseMemObject( object ); - -#ifdef VERIFY_AFTER_RELEASE - /* We're not allowed to get the instance count after the object has been completely released. But that's - exactly how we can tell the release worked--by making sure getting the instance count fails! */ - GET_MEM_INSTANCE_COUNT( object ); - if( err != CL_INVALID_MEM_OBJECT ) - { - print_error( err, "Mem object was not properly released" ); - return -1; - } -#endif - - return 0; -} - diff --git a/test_conformance/compatibility/test_conformance/api/test_retain_program.c b/test_conformance/compatibility/test_conformance/api/test_retain_program.c deleted file mode 100644 index 7fe22f0c..00000000 --- a/test_conformance/compatibility/test_conformance/api/test_retain_program.c +++ /dev/null @@ -1,109 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "testBase.h" - -#if !defined(_WIN32) -#include -#endif - -#include "../../test_common/harness/compat.h" - -int test_release_kernel_order(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - cl_program program; - cl_kernel kernel; - int error; - const char *testProgram[] = { "__kernel void sample_test(__global int *data){}" }; - - /* Create a test program */ - program = clCreateProgramWithSource( context, 1, testProgram, NULL, &error); - test_error( error, "Unable to create program to test with" ); - - /* Compile the program */ - error = clBuildProgram( program, 1, &deviceID, NULL, NULL, NULL ); - test_error( error, "Unable to build sample program to test with" ); - - /* And create a kernel from it */ - kernel = clCreateKernel( program, "sample_test", &error ); - test_error( error, "Unable to create kernel" ); - - /* Now try freeing the program first, then the kernel. If refcounts are right, this should work just fine */ - clReleaseProgram( program ); - clReleaseKernel( kernel ); - - /* If we got here fine, we succeeded. If not, well, we won't be able to return an error :) */ - return 0; -} - -const char *sample_delay_kernel[] = { -"__kernel void sample_test(__global float *src, __global int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -" for( int i = 0; i < 1000000; i++ ); \n" -" dst[tid] = (int)src[tid];\n" -"\n" -"}\n" }; - -int test_release_during_execute( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - cl_program program; - cl_kernel kernel; - cl_mem streams[2]; - size_t threads[1] = { 10 }, localThreadSize; - - - /* We now need an event to test. So we'll execute a kernel to get one */ - if( create_single_kernel_helper( context, &program, &kernel, 1, sample_delay_kernel, "sample_test" ) ) - { - return -1; - } - - streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_float) * 10, NULL, &error); - test_error( error, "Creating test array failed" ); - streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int) * 10, NULL, &error); - test_error( error, "Creating test array failed" ); - - /* Set the arguments */ - error = clSetKernelArg(kernel, 0, sizeof( streams[0] ), &streams[ 0 ]); - test_error( error, "Unable to set indexed kernel arguments" ); - error = clSetKernelArg(kernel, 1, sizeof( streams[1] ), &streams[ 1 ]); - test_error( error, "Unable to set indexed kernel arguments" ); - - error = get_max_common_work_group_size( context, kernel, threads[0], &localThreadSize ); - test_error( error, "Unable to calc local thread size" ); - - - /* Execute the kernel */ - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, &localThreadSize, 0, NULL, NULL ); - test_error( error, "Unable to execute test kernel" ); - - /* The kernel should still be executing, but we should still be able to release it. It's not terribly - useful, but we should be able to do it, if the internal refcounting is indeed correct. */ - - clReleaseMemObject( streams[ 1 ] ); - clReleaseMemObject( streams[ 0 ] ); - clReleaseKernel( kernel ); - clReleaseProgram( program ); - - /* Now make sure we're really finished before we go on. */ - error = clFinish(queue); - test_error( error, "Unable to finish context."); - - return 0; -} - - diff --git a/test_conformance/compatibility/test_conformance/basic/CMakeLists.txt b/test_conformance/compatibility/test_conformance/basic/CMakeLists.txt deleted file mode 100644 index d6a5fe65..00000000 --- a/test_conformance/compatibility/test_conformance/basic/CMakeLists.txt +++ /dev/null @@ -1,65 +0,0 @@ -set(MODULE_NAME COMPATIBILITY_BASIC) - -set(${MODULE_NAME}_SOURCES - main.c - test_fpmath_float.c test_fpmath_float2.c test_fpmath_float4.c - test_intmath_int.c test_intmath_int2.c test_intmath_int4.c - test_intmath_long.c test_intmath_long2.c test_intmath_long4.c - test_hiloeo.c test_local.c test_pointercast.c - test_if.c test_loop.c - test_readimage.c test_readimage_int16.c test_readimage_fp32.c - test_readimage3d.c test_readimage3d_int16.c test_readimage3d_fp32.c - test_writeimage.c test_writeimage_int16.c test_writeimage_fp32.c - test_multireadimageonefmt.c test_multireadimagemultifmt.c - test_imagedim.c - test_vloadstore.c - test_int2float.c test_float2int.c - test_createkernelsinprogram.c - test_hostptr.c - test_explicit_s2v.cpp - test_constant.c - test_image_multipass.c - test_imagereadwrite.c test_imagereadwrite3d.c - test_image_param.c - test_imagenpot.c - test_image_r8.c - test_barrier.c - test_basic_parameter_types.c - test_arrayreadwrite.c - test_arraycopy.c - test_imagearraycopy.c - test_imagearraycopy3d.c - test_imagecopy.c - test_imagerandomcopy.c - test_arrayimagecopy.c - test_arrayimagecopy3d.c - test_imagecopy3d.c - test_enqueue_map.cpp - test_work_item_functions.cpp - test_astype.cpp - test_async_copy.cpp - test_sizeof.c - test_vector_creation.cpp - test_vec_type_hint.c - test_numeric_constants.cpp - test_constant_source.cpp - test_bufferreadwriterect.c - test_async_strided_copy.cpp - test_preprocessors.cpp - test_kernel_memory_alignment.cpp - test_global_work_offsets.cpp - test_kernel_call_kernel_function.cpp - test_local_kernel_scope.cpp - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/threadTesting.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/typeWrappers.cpp - ../../test_common/harness/imageHelpers.cpp - ../../test_common/harness/mt19937.c - ../../test_common/harness/conversions.c - ../../test_common/harness/rounding_mode.c - ../../test_common/harness/msvc9.c -) - -include(../../../CMakeCommon.txt) diff --git a/test_conformance/compatibility/test_conformance/basic/main.c b/test_conformance/compatibility/test_conformance/basic/main.c deleted file mode 100644 index f8fff798..00000000 --- a/test_conformance/compatibility/test_conformance/basic/main.c +++ /dev/null @@ -1,147 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#if !defined(_WIN32) -#include -#endif - -#include -#include -#include "../../test_common/harness/testHarness.h" -#include "procs.h" - -// FIXME: To use certain functions in ../../test_common/harness/imageHelpers.h -// (for example, generate_random_image_data()), the tests are required to declare -// the following variables: -cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT; -bool gTestRounding = false; - -test_definition test_list[] = { - ADD_TEST( hostptr ), - ADD_TEST( fpmath_float ), - ADD_TEST( fpmath_float2 ), - ADD_TEST( fpmath_float4 ), - ADD_TEST( intmath_int ), - ADD_TEST( intmath_int2 ), - ADD_TEST( intmath_int4 ), - ADD_TEST( intmath_long ), - ADD_TEST( intmath_long2 ), - ADD_TEST( intmath_long4 ), - ADD_TEST( hiloeo ), - ADD_TEST( if ), - ADD_TEST( sizeof ), - ADD_TEST( loop ), - ADD_TEST( pointer_cast ), - ADD_TEST( local_arg_def ), - ADD_TEST( local_kernel_def ), - ADD_TEST( local_kernel_scope ), - ADD_TEST( constant ), - ADD_TEST( constant_source ), - ADD_TEST( readimage ), - ADD_TEST( readimage_int16 ), - ADD_TEST( readimage_fp32 ), - ADD_TEST( writeimage ), - ADD_TEST( writeimage_int16 ), - ADD_TEST( writeimage_fp32 ), - ADD_TEST( mri_one ), - - ADD_TEST( mri_multiple ), - ADD_TEST( image_r8 ), - ADD_TEST( barrier ), - ADD_TEST( int2float ), - ADD_TEST( float2int ), - ADD_TEST( imagereadwrite ), - ADD_TEST( imagereadwrite3d ), - ADD_TEST( readimage3d ), - ADD_TEST( readimage3d_int16 ), - ADD_TEST( readimage3d_fp32 ), - ADD_TEST( bufferreadwriterect ), - ADD_TEST( arrayreadwrite ), - ADD_TEST( arraycopy ), - ADD_TEST( imagearraycopy ), - ADD_TEST( imagearraycopy3d ), - ADD_TEST( imagecopy ), - ADD_TEST( imagecopy3d ), - ADD_TEST( imagerandomcopy ), - ADD_TEST( arrayimagecopy ), - ADD_TEST( arrayimagecopy3d ), - ADD_TEST( imagenpot ), - - ADD_TEST( vload_global ), - ADD_TEST( vload_local ), - ADD_TEST( vload_constant ), - ADD_TEST( vload_private ), - ADD_TEST( vstore_global ), - ADD_TEST( vstore_local ), - ADD_TEST( vstore_private ), - - ADD_TEST( createkernelsinprogram ), - ADD_TEST( imagedim_pow2 ), - ADD_TEST( imagedim_non_pow2 ), - ADD_TEST( image_param ), - ADD_TEST( image_multipass_integer_coord ), - ADD_TEST( image_multipass_float_coord ), - ADD_TEST( explicit_s2v_bool ), - ADD_TEST( explicit_s2v_char ), - ADD_TEST( explicit_s2v_uchar ), - ADD_TEST( explicit_s2v_short ), - ADD_TEST( explicit_s2v_ushort ), - ADD_TEST( explicit_s2v_int ), - ADD_TEST( explicit_s2v_uint ), - ADD_TEST( explicit_s2v_long ), - ADD_TEST( explicit_s2v_ulong ), - ADD_TEST( explicit_s2v_float ), - ADD_TEST( explicit_s2v_double ), - - ADD_TEST( enqueue_map_buffer ), - ADD_TEST( enqueue_map_image ), - - ADD_TEST( work_item_functions ), - - ADD_TEST( astype ), - - ADD_TEST( async_copy_global_to_local ), - ADD_TEST( async_copy_local_to_global ), - ADD_TEST( async_strided_copy_global_to_local ), - ADD_TEST( async_strided_copy_local_to_global ), - ADD_TEST( prefetch ), - - ADD_TEST( kernel_call_kernel_function ), - ADD_TEST( host_numeric_constants ), - ADD_TEST( kernel_numeric_constants ), - ADD_TEST( kernel_limit_constants ), - ADD_TEST( kernel_preprocessor_macros ), - - ADD_TEST( parameter_types ), - ADD_TEST( vector_creation ), - ADD_TEST( vec_type_hint ), - ADD_TEST( kernel_memory_alignment_local ), - ADD_TEST( kernel_memory_alignment_global ), - ADD_TEST( kernel_memory_alignment_constant ), - ADD_TEST( kernel_memory_alignment_private ), - - ADD_TEST( global_work_offsets ), - ADD_TEST( get_global_offset ), -}; - -const int test_num = ARRAY_SIZE( test_list ); - -int main(int argc, const char *argv[]) -{ - return runTestHarness( argc, argv, test_num, test_list, false, false, 0 ); -} - diff --git a/test_conformance/compatibility/test_conformance/basic/procs.h b/test_conformance/compatibility/test_conformance/basic/procs.h deleted file mode 100644 index 750c3656..00000000 --- a/test_conformance/compatibility/test_conformance/basic/procs.h +++ /dev/null @@ -1,142 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/rounding_mode.h" - -extern void memset_pattern4(void *dest, const void *src_pattern, size_t bytes ); - -extern int test_hostptr(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_fpmath_float(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_fpmath_float2(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_fpmath_float4(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_intmath_int(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_intmath_int2(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_intmath_int4(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_intmath_long(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_intmath_long2(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_intmath_long4(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_hiloeo(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_if(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_sizeof(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_loop(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_pointer_cast(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_local_arg_def(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_local_kernel_def(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_local_kernel_scope(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_constant(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_constant_source(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_readimage(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_readimage_int16(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_readimage_fp32(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_writeimage(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_writeimage_int16(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_writeimage_fp32(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_mri_one(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_mri_multiple(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_image_r8(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_simplebarrier(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_barrier(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_int2float(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_float2int(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_imagearraycopy(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_imagearraycopy3d(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_imagereadwrite(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_imagereadwrite3d(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_readimage3d(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_readimage3d_int16(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_readimage3d_fp32(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_bufferreadwriterect(cl_device_id device, cl_context context, cl_command_queue queue_, int num_elements); -extern int test_imagecopy(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_imagecopy3d(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_imagerandomcopy(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_arraycopy(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems); -extern int test_arrayimagecopy(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_arrayimagecopy3d(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_imagenpot(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_sampler_float(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_sampler_int(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_createkernelsinprogram(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_single_large_allocation(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_multiple_max_allocation(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_arrayreadwrite(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_imagedim_pow2(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_imagedim_non_pow2(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_image_param(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_image_multipass_integer_coord(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_image_multipass_float_coord(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_vload_global(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_vload_local(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_vload_constant(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_vload_private(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_vstore_global(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_vstore_local(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_vstore_private(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_explicit_s2v_bool(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_explicit_s2v_char(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_explicit_s2v_uchar(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_explicit_s2v_short(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_explicit_s2v_ushort(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_explicit_s2v_int(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_explicit_s2v_uint(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_explicit_s2v_long(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_explicit_s2v_ulong(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_explicit_s2v_float(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_explicit_s2v_double(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_enqueue_map_buffer(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_enqueue_map_image(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_work_item_functions(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_astype(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_native_kernel(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_async_copy_global_to_local(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_async_copy_local_to_global(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_async_strided_copy_global_to_local(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_async_strided_copy_local_to_global(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_prefetch(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_host_numeric_constants(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_kernel_numeric_constants(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_kernel_limit_constants(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_kernel_preprocessor_macros(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_kernel_call_kernel_function(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_parameter_types(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements); -extern int test_vector_creation(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_vec_type_hint(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - - -extern int test_kernel_memory_alignment_local(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems ); -extern int test_kernel_memory_alignment_global(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems ); -extern int test_kernel_memory_alignment_constant(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems ); -extern int test_kernel_memory_alignment_private(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems ); - -extern int test_global_work_offsets(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems ); -extern int test_get_global_offset(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems ); - - - diff --git a/test_conformance/compatibility/test_conformance/basic/run_array b/test_conformance/compatibility/test_conformance/basic/run_array deleted file mode 100755 index 07d67892..00000000 --- a/test_conformance/compatibility/test_conformance/basic/run_array +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -cd `dirname $0` -./test_basic arrayreadwrite arraycopy bufferreadwriterect $@ diff --git a/test_conformance/compatibility/test_conformance/basic/run_array_image_copy b/test_conformance/compatibility/test_conformance/basic/run_array_image_copy deleted file mode 100755 index f88ec2a0..00000000 --- a/test_conformance/compatibility/test_conformance/basic/run_array_image_copy +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -cd `dirname $0` -./test_basic arrayimagecopy arrayimagecopy3d imagearraycopy diff --git a/test_conformance/compatibility/test_conformance/basic/run_image b/test_conformance/compatibility/test_conformance/basic/run_image deleted file mode 100755 index 9bb5ee1b..00000000 --- a/test_conformance/compatibility/test_conformance/basic/run_image +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -cd `dirname $0` -./test_basic \ -imagecopy imagerandomcopy \ -imagearraycopy imagearraycopy3d \ -image_r8 \ -readimage readimage_int16 readimage_fp32 \ -writeimage writeimage_int16 writeimage_fp32 \ -imagenpot \ -image_param \ -image_multipass_integer_coord \ -readimage3d \ -readimage3d_int16 \ -readimage3d_fp32 \ -imagereadwrite3d \ -imagereadwrite \ -$@ diff --git a/test_conformance/compatibility/test_conformance/basic/run_multi_read_image b/test_conformance/compatibility/test_conformance/basic/run_multi_read_image deleted file mode 100755 index aa87b1cd..00000000 --- a/test_conformance/compatibility/test_conformance/basic/run_multi_read_image +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -cd `dirname $0` -./test_basic mri_one mri_multiple - diff --git a/test_conformance/compatibility/test_conformance/basic/test_arrayimagecopy.c b/test_conformance/compatibility/test_conformance/basic/test_arrayimagecopy.c deleted file mode 100644 index 41627198..00000000 --- a/test_conformance/compatibility/test_conformance/basic/test_arrayimagecopy.c +++ /dev/null @@ -1,143 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - -#include "procs.h" - -int test_arrayimagecopy_single_format(cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format) -{ - cl_uchar *bufptr, *imgptr; - clMemWrapper buffer, image; - int img_width = 512; - int img_height = 512; - size_t elem_size; - size_t buffer_size; - int i; - cl_int err; - MTdata d; - cl_event copyevent; - - log_info("Testing %s %s\n", GetChannelOrderName(format->image_channel_order), GetChannelTypeName(format->image_channel_data_type)); - - image = create_image_2d(context, (cl_mem_flags)(CL_MEM_READ_WRITE), format, img_width, img_height, 0, NULL, &err); - test_error(err, "create_image_2d failed"); - - err = clGetImageInfo(image, CL_IMAGE_ELEMENT_SIZE, sizeof(size_t), &elem_size, NULL); - test_error(err, "clGetImageInfo failed"); - - buffer_size = sizeof(cl_uchar) * elem_size * img_width * img_height; - - buffer = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), buffer_size, NULL, &err); - test_error(err, "clCreateBuffer failed"); - - bufptr = (cl_uchar*)malloc(buffer_size); - - d = init_genrand( gRandomSeed ); - bufptr = (cl_uchar*)malloc(buffer_size); - for (i=0; i<(int)buffer_size; i++) { - bufptr[i] = (cl_uchar)genrand_int32(d); - } - free_mtdata(d); d = NULL; - - size_t origin[3]={0,0,0}, region[3]={img_width,img_height,1}; - err = clEnqueueWriteBuffer( queue, buffer, CL_TRUE, 0, buffer_size, bufptr, 0, NULL, NULL); - test_error(err, "clEnqueueWriteBuffer failed"); - - err = clEnqueueCopyBufferToImage( queue, buffer, image, 0, origin, region, 0, NULL, ©event ); - test_error(err, "clEnqueueCopyImageToBuffer failed"); - - imgptr = (cl_uchar*)malloc(buffer_size); - - err = clEnqueueReadImage( queue, image, CL_TRUE, origin, region, 0, 0, imgptr, 1, ©event, NULL ); - test_error(err, "clEnqueueReadBuffer failed"); - - if (memcmp(bufptr, imgptr, buffer_size) != 0) { - log_error( "ERROR: Results did not validate!\n" ); - unsigned char * inchar = (unsigned char*)bufptr; - unsigned char * outchar = (unsigned char*)imgptr; - int failuresPrinted = 0; - int i; - for (i=0; i< (int)buffer_size; i+=(int)elem_size) { - int failed = 0; - int j; - for (j=0; j<(int)elem_size; j++) - if (inchar[i+j] != outchar[i+j]) - failed = 1; - char values[4096]; - values[0] = 0; - if (failed) { - sprintf(values + strlen(values), "%d(0x%x) -> actual [", i, i); - int j; - for (j=0; j<(int)elem_size; j++) - sprintf(values + strlen( values), "0x%02x ", inchar[i+j]); - sprintf(values + strlen(values), "] != expected ["); - for (j=0; j<(int)elem_size; j++) - sprintf(values + strlen( values), "0x%02x ", outchar[i+j]); - sprintf(values + strlen(values), "]"); - log_error("%s\n", values); - failuresPrinted++; - } - if (failuresPrinted > 5) { - log_error("Not printing further failures...\n"); - break; - } - } - err = -1; - } - - free(bufptr); - free(imgptr); - - if (err) - log_error("ARRAY to IMAGE copy test failed for image_channel_order=0x%lx and image_channel_data_type=0x%lx\n", - (unsigned long)format->image_channel_order, (unsigned long)format->image_channel_data_type); - - return err; -} - -int test_arrayimagecopy(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) -{ - cl_int err; - cl_image_format *formats; - cl_uint num_formats; - cl_uint i; - - PASSIVE_REQUIRE_IMAGE_SUPPORT( device ) - - err = clGetSupportedImageFormats(context, CL_MEM_READ_WRITE, CL_MEM_OBJECT_IMAGE2D, 0, NULL, &num_formats); - test_error(err, "clGetSupportedImageFormats failed"); - - formats = (cl_image_format *)malloc(num_formats * sizeof(cl_image_format)); - - err = clGetSupportedImageFormats(context, CL_MEM_READ_WRITE, CL_MEM_OBJECT_IMAGE2D, num_formats, formats, NULL); - test_error(err, "clGetSupportedImageFormats failed"); - - for (i = 0; i < num_formats; i++) { - err |= test_arrayimagecopy_single_format(device, context, queue, &formats[i]); - } - - if (err) - log_error("ARRAY to IMAGE copy test failed\n"); - else - log_info("ARRAY to IMAGE copy test passed\n"); - - return err; -} diff --git a/test_conformance/compatibility/test_conformance/basic/test_arrayimagecopy3d.c b/test_conformance/compatibility/test_conformance/basic/test_arrayimagecopy3d.c deleted file mode 100644 index 5b7ed5a7..00000000 --- a/test_conformance/compatibility/test_conformance/basic/test_arrayimagecopy3d.c +++ /dev/null @@ -1,144 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - -#include "procs.h" - -int test_arrayimagecopy3d_single_format(cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format) -{ - cl_uchar *bufptr, *imgptr; - clMemWrapper buffer, image; - int img_width = 128; - int img_height = 128; - int img_depth = 32; - size_t elem_size; - size_t buffer_size; - int i; - cl_int err; - MTdata d; - cl_event copyevent; - - log_info("Testing %s %s\n", GetChannelOrderName(format->image_channel_order), GetChannelTypeName(format->image_channel_data_type)); - - image = create_image_3d(context, (cl_mem_flags)(CL_MEM_READ_WRITE), format, img_width, img_height, img_depth, 0, 0, NULL, &err); - test_error(err, "create_image_3d failed"); - - err = clGetImageInfo(image, CL_IMAGE_ELEMENT_SIZE, sizeof(size_t), &elem_size, NULL); - test_error(err, "clGetImageInfo failed"); - - buffer_size = sizeof(cl_uchar) * elem_size * img_width * img_height * img_depth; - - buffer = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), buffer_size, NULL, &err); - test_error(err, "clCreateBuffer failed"); - - bufptr = (cl_uchar*)malloc(buffer_size); - - d = init_genrand( gRandomSeed ); - bufptr = (cl_uchar*)malloc(buffer_size); - for (i=0; i<(int)buffer_size; i++) { - bufptr[i] = (cl_uchar)genrand_int32(d); - } - free_mtdata(d); d = NULL; - - size_t origin[3]={0,0,0}, region[3]={img_width,img_height,img_depth}; - err = clEnqueueWriteBuffer( queue, buffer, CL_TRUE, 0, buffer_size, bufptr, 0, NULL, NULL); - test_error(err, "clEnqueueWriteBuffer failed"); - - err = clEnqueueCopyBufferToImage( queue, buffer, image, 0, origin, region, 0, NULL, ©event ); - test_error(err, "clEnqueueCopyImageToBuffer failed"); - - imgptr = (cl_uchar*)malloc(buffer_size); - - err = clEnqueueReadImage( queue, image, CL_TRUE, origin, region, 0, 0, imgptr, 1, ©event, NULL ); - test_error(err, "clEnqueueReadBuffer failed"); - - if (memcmp(bufptr, imgptr, buffer_size) != 0) { - log_error( "ERROR: Results did not validate!\n" ); - unsigned char * inchar = (unsigned char*)bufptr; - unsigned char * outchar = (unsigned char*)imgptr; - int failuresPrinted = 0; - int i; - for (i=0; i< (int)buffer_size; i+=(int)elem_size) { - int failed = 0; - int j; - for (j=0; j<(int)elem_size; j++) - if (inchar[i+j] != outchar[i+j]) - failed = 1; - char values[4096]; - values[0] = 0; - if (failed) { - sprintf(values + strlen(values), "%d(0x%x) -> actual [", i, i); - int j; - for (j=0; j<(int)elem_size; j++) - sprintf(values + strlen( values), "0x%02x ", inchar[i+j]); - sprintf(values + strlen(values), "] != expected ["); - for (j=0; j<(int)elem_size; j++) - sprintf(values + strlen( values), "0x%02x ", outchar[i+j]); - sprintf(values + strlen(values), "]"); - log_error("%s\n", values); - failuresPrinted++; - } - if (failuresPrinted > 5) { - log_error("Not printing further failures...\n"); - break; - } - } - err = -1; - } - - free(bufptr); - free(imgptr); - - if (err) - log_error("ARRAY to IMAGE3D copy test failed for image_channel_order=0x%lx and image_channel_data_type=0x%lx\n", - (unsigned long)format->image_channel_order, (unsigned long)format->image_channel_data_type); - - return err; -} - -int test_arrayimagecopy3d(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) -{ - cl_int err; - cl_image_format *formats; - cl_uint num_formats; - cl_uint i; - - PASSIVE_REQUIRE_3D_IMAGE_SUPPORT( device ) - - err = clGetSupportedImageFormats(context, CL_MEM_READ_WRITE, CL_MEM_OBJECT_IMAGE3D, 0, NULL, &num_formats); - test_error(err, "clGetSupportedImageFormats failed"); - - formats = (cl_image_format *)malloc(num_formats * sizeof(cl_image_format)); - - err = clGetSupportedImageFormats(context, CL_MEM_READ_WRITE, CL_MEM_OBJECT_IMAGE3D, num_formats, formats, NULL); - test_error(err, "clGetSupportedImageFormats failed"); - - for (i = 0; i < num_formats; i++) { - err |= test_arrayimagecopy3d_single_format(device, context, queue, &formats[i]); - } - - if (err) - log_error("ARRAY to IMAGE3D copy test failed\n"); - else - log_info("ARRAY to IMAGE3D copy test passed\n"); - - return err; -} diff --git a/test_conformance/compatibility/test_conformance/basic/test_arrayreadwrite.c b/test_conformance/compatibility/test_conformance/basic/test_arrayreadwrite.c deleted file mode 100644 index 3a58c6aa..00000000 --- a/test_conformance/compatibility/test_conformance/basic/test_arrayreadwrite.c +++ /dev/null @@ -1,94 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - - -#include "procs.h" - - -int -test_arrayreadwrite(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) -{ - cl_uint *inptr, *outptr; - cl_mem streams[1]; - int num_tries = 400; - num_elements = 1024 * 1024 * 4; - int i, j, err; - MTdata d; - - inptr = (cl_uint*)malloc(num_elements*sizeof(cl_uint)); - outptr = (cl_uint*)malloc(num_elements*sizeof(cl_uint)); - - // randomize data - d = init_genrand( gRandomSeed ); - for (i=0; i 0 && offset < num_elements) - break; - } while (1); - cb = (int)(genrand_int32(d) & 0x7FFFFFFF); - if (cb > (num_elements - offset)) - cb = num_elements - offset; - - err = clEnqueueWriteBuffer(queue, streams[0], CL_TRUE, offset*sizeof(cl_uint), sizeof(cl_uint)*cb,&inptr[offset], 0, NULL, NULL); - test_error(err, "clEnqueueWriteBuffer failed"); - - err = clEnqueueReadBuffer( queue, streams[0], CL_TRUE, offset*sizeof(cl_uint), cb*sizeof(cl_uint), &outptr[offset], 0, NULL, NULL ); - test_error(err, "clEnqueueReadBuffer failed"); - - for (j=offset; j -#include -#include -#include -#include -#include - - -#include "procs.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" - - -static const char *astype_kernel_pattern = -"%s\n" -"__kernel void test_fn( __global %s%s *src, __global %s%s *dst )\n" -"{\n" -" int tid = get_global_id( 0 );\n" -" %s%s tmp = as_%s%s( src[ tid ] );\n" -" dst[ tid ] = tmp;\n" -"}\n"; - -static const char *astype_kernel_pattern_V3srcV3dst = -"%s\n" -"__kernel void test_fn( __global %s *src, __global %s *dst )\n" -"{\n" -" int tid = get_global_id( 0 );\n" -" %s%s tmp = as_%s%s( vload3(tid,src) );\n" -" vstore3(tmp,tid,dst);\n" -"}\n"; -// in the printf, remove the third and fifth argument, each of which -// should be a "3", when copying from the printf for astype_kernel_pattern - -static const char *astype_kernel_pattern_V3dst = -"%s\n" -"__kernel void test_fn( __global %s%s *src, __global %s *dst )\n" -"{\n" -" int tid = get_global_id( 0 );\n" -" %s3 tmp = as_%s3( src[ tid ] );\n" -" vstore3(tmp,tid,dst);\n" -"}\n"; -// in the printf, remove the fifth argument, which -// should be a "3", when copying from the printf for astype_kernel_pattern - - -static const char *astype_kernel_pattern_V3src = -"%s\n" -"__kernel void test_fn( __global %s *src, __global %s%s *dst )\n" -"{\n" -" int tid = get_global_id( 0 );\n" -" %s%s tmp = as_%s%s( vload3(tid,src) );\n" -" dst[ tid ] = tmp;\n" -"}\n"; -// in the printf, remove the third argument, which -// should be a "3", when copying from the printf for astype_kernel_pattern - - -int test_astype_set( cl_device_id device, cl_context context, cl_command_queue queue, ExplicitType inVecType, ExplicitType outVecType, - unsigned int vecSize, unsigned int outVecSize, - int numElements ) -{ - int error; - - clProgramWrapper program; - clKernelWrapper kernel; - clMemWrapper streams[ 2 ]; - - char programSrc[ 10240 ]; - size_t threads[ 1 ], localThreads[ 1 ]; - size_t typeSize = get_explicit_type_size( inVecType ); - size_t outTypeSize = get_explicit_type_size(outVecType); - char sizeNames[][ 3 ] = { "", "", "2", "3", "4", "", "", "", "8", "", "", "", "", "", "", "", "16" }; - MTdata d; - - - - // Create program - if(outVecSize == 3 && vecSize == 3) { - // astype_kernel_pattern_V3srcV3dst - sprintf( programSrc, astype_kernel_pattern_V3srcV3dst, - (outVecType == kDouble || inVecType == kDouble) ? "#pragma OPENCL EXTENSION cl_khr_fp64 : enable" : "", - get_explicit_type_name( inVecType ), // sizeNames[ vecSize ], - get_explicit_type_name( outVecType ), // sizeNames[ outVecSize ], - get_explicit_type_name( outVecType ), sizeNames[ outVecSize ], - get_explicit_type_name( outVecType ), sizeNames[ outVecSize ] ); - } else if(outVecSize == 3) { - // astype_kernel_pattern_V3dst - sprintf( programSrc, astype_kernel_pattern_V3dst, - (outVecType == kDouble || inVecType == kDouble) ? "#pragma OPENCL EXTENSION cl_khr_fp64 : enable" : "", - get_explicit_type_name( inVecType ), sizeNames[ vecSize ], - get_explicit_type_name( outVecType ), - get_explicit_type_name( outVecType ), - get_explicit_type_name( outVecType )); - - } else if(vecSize == 3) { - // astype_kernel_pattern_V3src - sprintf( programSrc, astype_kernel_pattern_V3src, - (outVecType == kDouble || inVecType == kDouble) ? "#pragma OPENCL EXTENSION cl_khr_fp64 : enable" : "", - get_explicit_type_name( inVecType ),// sizeNames[ vecSize ], - get_explicit_type_name( outVecType ), sizeNames[ outVecSize ], - get_explicit_type_name( outVecType ), sizeNames[ outVecSize ], - get_explicit_type_name( outVecType ), sizeNames[ outVecSize ]); - } else { - sprintf( programSrc, astype_kernel_pattern, - (outVecType == kDouble || inVecType == kDouble) ? "#pragma OPENCL EXTENSION cl_khr_fp64 : enable" : "", - get_explicit_type_name( inVecType ), sizeNames[ vecSize ], - get_explicit_type_name( outVecType ), sizeNames[ outVecSize ], - get_explicit_type_name( outVecType ), sizeNames[ outVecSize ], - get_explicit_type_name( outVecType ), sizeNames[ outVecSize ]); - } - - const char *ptr = programSrc; - error = create_single_kernel_helper( context, &program, &kernel, 1, &ptr, "test_fn" ); - test_error( error, "Unable to create testing kernel" ); - - - // Create some input values - size_t inBufferSize = sizeof(char)* numElements * get_explicit_type_size( inVecType ) * vecSize; - char *inBuffer = (char*)malloc( inBufferSize ); - size_t outBufferSize = sizeof(char)* numElements * get_explicit_type_size( outVecType ) *outVecSize; - char *outBuffer = (char*)malloc( outBufferSize ); - - d = init_genrand( gRandomSeed ); - generate_random_data( inVecType, numElements * vecSize, - d, inBuffer ); - free_mtdata(d); d = NULL; - - // Create I/O streams and set arguments - streams[ 0 ] = clCreateBuffer( context, CL_MEM_COPY_HOST_PTR, inBufferSize, inBuffer, &error ); - test_error( error, "Unable to create I/O stream" ); - streams[ 1 ] = clCreateBuffer( context, CL_MEM_READ_WRITE, outBufferSize, NULL, &error ); - test_error( error, "Unable to create I/O stream" ); - - error = clSetKernelArg( kernel, 0, sizeof( streams[ 0 ] ), &streams[ 0 ] ); - test_error( error, "Unable to set kernel argument" ); - error = clSetKernelArg( kernel, 1, sizeof( streams[ 1 ] ), &streams[ 1 ] ); - test_error( error, "Unable to set kernel argument" ); - - - // Run the kernel - threads[ 0 ] = numElements; - error = get_max_common_work_group_size( context, kernel, threads[ 0 ], &localThreads[ 0 ] ); - test_error( error, "Unable to get group size to run with" ); - - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); - test_error( error, "Unable to run kernel" ); - - - // Get the results and compare - // The beauty is that astype is supposed to return the bit pattern as a different type, which means - // the output should have the exact same bit pattern as the input. No interpretation necessary! - error = clEnqueueReadBuffer( queue, streams[ 1 ], CL_TRUE, 0, outBufferSize, outBuffer, 0, NULL, NULL ); - test_error( error, "Unable to read results" ); - - char *expected = inBuffer; - char *actual = outBuffer; - size_t compSize = typeSize*vecSize; - if(outTypeSize*outVecSize < compSize) { - compSize = outTypeSize*outVecSize; - } - - if(outVecSize == 4 && vecSize == 3) - { - // as_type4(vec3) should compile but produce undefined results?? - free(inBuffer); - free(outBuffer); - return 0; - } - - if(outVecSize != 3 && vecSize != 3 && outVecSize != vecSize) - { - // as_typen(vecm) should compile and run but produce - // implementation-defined results for m != n - // and n*sizeof(type) = sizeof(vecm) - free(inBuffer); - free(outBuffer); - return 0; - } - - for( int i = 0; i < numElements; i++ ) - { - if( memcmp( expected, actual, compSize ) != 0 ) - { - char expectedString[ 1024 ], actualString[ 1024 ]; - log_error( "ERROR: Data sample %d of %d for as_%s%d( %s%d ) did not validate (expected {%s}, got {%s})\n", - (int)i, (int)numElements, get_explicit_type_name( outVecType ), vecSize, get_explicit_type_name( inVecType ), vecSize, - GetDataVectorString( expected, typeSize, vecSize, expectedString ), - GetDataVectorString( actual, typeSize, vecSize, actualString ) ); - log_error("Src is :\n%s\n----\n%d threads %d localthreads\n", - programSrc, (int)threads[0],(int) localThreads[0]); - free(inBuffer); - free(outBuffer); - return 1; - } - expected += typeSize * vecSize; - actual += outTypeSize * outVecSize; - } - - free(inBuffer); - free(outBuffer); - return 0; -} - -int test_astype(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems ) -{ - // Note: although casting to different vector element sizes that match the same size (i.e. short2 -> char4) is - // legal in OpenCL 1.0, the result is dependent on the device it runs on, which means there's no actual way - // for us to verify what is "valid". So the only thing we can test are types that match in size independent - // of the element count (char -> uchar, etc) - ExplicitType vecTypes[] = { kChar, kUChar, kShort, kUShort, kInt, kUInt, kLong, kULong, kFloat, kDouble, kNumExplicitTypes }; - unsigned int vecSizes[] = { 1, 2, 3, 4, 8, 16, 0 }; - unsigned int inTypeIdx, outTypeIdx, sizeIdx, outSizeIdx; - size_t inTypeSize, outTypeSize; - int error = 0; - - for( inTypeIdx = 0; vecTypes[ inTypeIdx ] != kNumExplicitTypes; inTypeIdx++ ) - { - inTypeSize = get_explicit_type_size(vecTypes[inTypeIdx]); - - if( vecTypes[ inTypeIdx ] == kDouble && !is_extension_available( device, "cl_khr_fp64" ) ) - continue; - - if (( vecTypes[ inTypeIdx ] == kLong || vecTypes[ inTypeIdx ] == kULong ) && !gHasLong ) - continue; - - for( outTypeIdx = 0; vecTypes[ outTypeIdx ] != kNumExplicitTypes; outTypeIdx++ ) - { - outTypeSize = get_explicit_type_size(vecTypes[outTypeIdx]); - if( vecTypes[ outTypeIdx ] == kDouble && !is_extension_available( device, "cl_khr_fp64" ) ) { - continue; - } - - if (( vecTypes[ outTypeIdx ] == kLong || vecTypes[ outTypeIdx ] == kULong ) && !gHasLong ) - continue; - - // change this check - if( inTypeIdx == outTypeIdx ) { - continue; - } - - log_info( " (%s->%s)\n", get_explicit_type_name( vecTypes[ inTypeIdx ] ), get_explicit_type_name( vecTypes[ outTypeIdx ] ) ); - fflush( stdout ); - - for( sizeIdx = 0; vecSizes[ sizeIdx ] != 0; sizeIdx++ ) - { - - for(outSizeIdx = 0; vecSizes[outSizeIdx] != 0; outSizeIdx++) - { - if(vecSizes[sizeIdx]*inTypeSize != - vecSizes[outSizeIdx]*outTypeSize ) - { - continue; - } - error += test_astype_set( device, context, queue, vecTypes[ inTypeIdx ], vecTypes[ outTypeIdx ], vecSizes[ sizeIdx ], vecSizes[outSizeIdx], n_elems ); - - - } - - } - if(get_explicit_type_size(vecTypes[inTypeIdx]) == - get_explicit_type_size(vecTypes[outTypeIdx])) { - // as_type3(vec4) allowed, as_type4(vec3) not allowed - error += test_astype_set( device, context, queue, vecTypes[ inTypeIdx ], vecTypes[ outTypeIdx ], 3, 4, n_elems ); - error += test_astype_set( device, context, queue, vecTypes[ inTypeIdx ], vecTypes[ outTypeIdx ], 4, 3, n_elems ); - } - - } - } - return error; -} - - diff --git a/test_conformance/compatibility/test_conformance/basic/test_async_copy.cpp b/test_conformance/compatibility/test_conformance/basic/test_async_copy.cpp deleted file mode 100644 index 234ed698..00000000 --- a/test_conformance/compatibility/test_conformance/basic/test_async_copy.cpp +++ /dev/null @@ -1,276 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - - - -#include "procs.h" -#include "../../test_common/harness/conversions.h" - -static const char *async_global_to_local_kernel = -"%s\n" // optional pragma string -"__kernel void test_fn( const __global %s *src, __global %s *dst, __local %s *localBuffer, int copiesPerWorkgroup, int copiesPerWorkItem )\n" -"{\n" -" int i;\n" -// Zero the local storage first -" for(i=0; i max_local_workgroup_size[0]) - max_workgroup_size = max_local_workgroup_size[0]; - - size_t numberOfCopiesPerWorkitem = 13; - size_t localStorageSpacePerWorkitem = numberOfCopiesPerWorkitem*elementSize; - size_t maxLocalWorkgroupSize = (((int)max_local_mem_size/2)/localStorageSpacePerWorkitem); - - // Calculation can return 0 on embedded devices due to 1KB local mem limit - if(maxLocalWorkgroupSize == 0) - { - maxLocalWorkgroupSize = 1; - } - - size_t localWorkgroupSize = maxLocalWorkgroupSize; - if (maxLocalWorkgroupSize > max_workgroup_size) - localWorkgroupSize = max_workgroup_size; - - size_t localBufferSize = localWorkgroupSize*elementSize*numberOfCopiesPerWorkitem; - size_t numberOfLocalWorkgroups = 1111; - size_t globalBufferSize = numberOfLocalWorkgroups*localBufferSize; - size_t globalWorkgroupSize = numberOfLocalWorkgroups*localWorkgroupSize; - - inBuffer = (void*)malloc(globalBufferSize); - outBuffer = (void*)malloc(globalBufferSize); - memset(outBuffer, 0, globalBufferSize); - - cl_int copiesPerWorkItemInt, copiesPerWorkgroup; - copiesPerWorkItemInt = (int)numberOfCopiesPerWorkitem; - copiesPerWorkgroup = (int)(numberOfCopiesPerWorkitem*localWorkgroupSize); - - log_info("Global: %d, local %d, local buffer %db, global buffer %db, each work group will copy %d elements and each work item item will copy %d elements.\n", - (int) globalWorkgroupSize, (int)localWorkgroupSize, (int)localBufferSize, (int)globalBufferSize, copiesPerWorkgroup, copiesPerWorkItemInt); - - threads[0] = globalWorkgroupSize; - localThreads[0] = localWorkgroupSize; - - d = init_genrand( gRandomSeed ); - generate_random_data( vecType, globalBufferSize/get_explicit_type_size(vecType), d, inBuffer ); - free_mtdata(d); d = NULL; - - streams[ 0 ] = clCreateBuffer( context, CL_MEM_COPY_HOST_PTR, globalBufferSize, inBuffer, &error ); - test_error( error, "Unable to create input buffer" ); - streams[ 1 ] = clCreateBuffer( context, CL_MEM_COPY_HOST_PTR, globalBufferSize, outBuffer, &error ); - test_error( error, "Unable to create output buffer" ); - - error = clSetKernelArg( kernel, 0, sizeof( streams[ 0 ] ), &streams[ 0 ] ); - test_error( error, "Unable to set kernel argument" ); - error = clSetKernelArg( kernel, 1, sizeof( streams[ 1 ] ), &streams[ 1 ] ); - test_error( error, "Unable to set kernel argument" ); - error = clSetKernelArg( kernel, 2, localBufferSize, NULL ); - test_error( error, "Unable to set kernel argument" ); - error = clSetKernelArg( kernel, 3, sizeof(copiesPerWorkgroup), &copiesPerWorkgroup ); - test_error( error, "Unable to set kernel argument" ); - error = clSetKernelArg( kernel, 4, sizeof(copiesPerWorkItemInt), &copiesPerWorkItemInt ); - test_error( error, "Unable to set kernel argument" ); - - // Enqueue - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); - test_error( error, "Unable to queue kernel" ); - - // Read - error = clEnqueueReadBuffer( queue, streams[ 1 ], CL_TRUE, 0, globalBufferSize, outBuffer, 0, NULL, NULL ); - test_error( error, "Unable to read results" ); - - // Verify - if( memcmp( inBuffer, outBuffer, globalBufferSize ) != 0 ) - { - log_error( "ERROR: Results of copy did not validate!\n" ); - unsigned char * inchar = (unsigned char*)inBuffer; - unsigned char * outchar = (unsigned char*)outBuffer; - int failuresPrinted = 0; - for (int i=0; i< (int)globalBufferSize; i+=(int)elementSize) { - int failed = 0; - for (int j=0; j<(int)elementSize; j++) - if (inchar[i+j] != outchar[i+j]) - failed = 1; - char values[4096]; - values[0] = 0; - if (failed) { - sprintf(values + strlen( values), "%d -> [", i); - for (int j=0; j<(int)elementSize; j++) - sprintf(values + strlen( values), "%2x ", inchar[i+j]); - sprintf(values + strlen(values), "] != ["); - for (int j=0; j<(int)elementSize; j++) - sprintf(values + strlen( values), "%2x ", outchar[i+j]); - sprintf(values + strlen(values), "]"); - log_error("%s\n", values); - failuresPrinted++; - } - if (failuresPrinted > 5) { - log_error("Not printing further failures...\n"); - break; - } - } - return -1; - } - - free(inBuffer); - free(outBuffer); - - return 0; -} - -int test_copy_all_types(cl_device_id deviceID, cl_context context, cl_command_queue queue, const char *kernelCode) { - ExplicitType vecType[] = { kChar, kUChar, kShort, kUShort, kInt, kUInt, kLong, kULong, kFloat, kDouble, kNumExplicitTypes }; - unsigned int vecSizes[] = { 1, 2, 4, 8, 16, 0 }; - unsigned int size, typeIndex; - - int errors = 0; - - for( typeIndex = 0; vecType[ typeIndex ] != kNumExplicitTypes; typeIndex++ ) - { - if( vecType[ typeIndex ] == kDouble && !is_extension_available( deviceID, "cl_khr_fp64" ) ) - continue; - - if (( vecType[ typeIndex ] == kLong || vecType[ typeIndex ] == kULong ) && !gHasLong ) - continue; - - for( size = 0; vecSizes[ size ] != 0; size++ ) - { - if (test_copy( deviceID, context, queue, kernelCode, vecType[typeIndex],vecSizes[size] )) { - errors++; - } - } - } - if (errors) - return -1; - return 0; -} - - - - -int test_async_copy_global_to_local(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - return test_copy_all_types( deviceID, context, queue, async_global_to_local_kernel ); -} - -int test_async_copy_local_to_global(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - return test_copy_all_types( deviceID, context, queue, async_local_to_global_kernel ); -} - -int test_prefetch(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - return test_copy_all_types( deviceID, context, queue, prefetch_kernel ); -} - diff --git a/test_conformance/compatibility/test_conformance/basic/test_async_strided_copy.cpp b/test_conformance/compatibility/test_conformance/basic/test_async_strided_copy.cpp deleted file mode 100644 index dca52b5e..00000000 --- a/test_conformance/compatibility/test_conformance/basic/test_async_strided_copy.cpp +++ /dev/null @@ -1,267 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - - - -#include "procs.h" -#include "../../test_common/harness/conversions.h" - -static const char *async_strided_global_to_local_kernel = -"%s\n" // optional pragma string -"%s__kernel void test_fn( const __global %s *src, __global %s *dst, __local %s *localBuffer, int copiesPerWorkgroup, int copiesPerWorkItem, int stride )\n" -"{\n" -" int i;\n" -// Zero the local storage first -" for(i=0; i max_local_workgroup_size[0]) - max_workgroup_size = max_local_workgroup_size[0]; - - cl_ulong max_global_mem_size; - error = clGetDeviceInfo(deviceID, CL_DEVICE_GLOBAL_MEM_SIZE, sizeof(max_global_mem_size), &max_global_mem_size, NULL); - test_error (error, "clGetDeviceInfo failed for CL_DEVICE_GLOBAL_MEM_SIZE"); - - cl_bool unified_mem; - error = clGetDeviceInfo(deviceID, CL_DEVICE_HOST_UNIFIED_MEMORY, sizeof(unified_mem), &unified_mem, NULL); - test_error (error, "clGetDeviceInfo failed for CL_DEVICE_HOST_UNIFIED_MEMORY"); - - int number_of_global_mem_buffers = (unified_mem) ? 4 : 2; - - size_t numberOfCopiesPerWorkitem = 3; - size_t localStorageSpacePerWorkitem = numberOfCopiesPerWorkitem*elementSize; - size_t maxLocalWorkgroupSize = (((int)max_local_mem_size/2)/localStorageSpacePerWorkitem); - - size_t localWorkgroupSize = maxLocalWorkgroupSize; - if (maxLocalWorkgroupSize > max_workgroup_size) - localWorkgroupSize = max_workgroup_size; - - size_t localBufferSize = localWorkgroupSize*elementSize*numberOfCopiesPerWorkitem; - size_t numberOfLocalWorkgroups = 579;//1111; - - // Reduce the numberOfLocalWorkgroups so that no more than 1/2 of CL_DEVICE_GLOBAL_MEM_SIZE is consumed - // by the allocated buffer. This is done to avoid resource errors resulting from address space fragmentation. - size_t numberOfLocalWorkgroupsLimit = max_global_mem_size / (2 * number_of_global_mem_buffers * localBufferSize * stride); - if (numberOfLocalWorkgroups > numberOfLocalWorkgroupsLimit) numberOfLocalWorkgroups = numberOfLocalWorkgroupsLimit; - - size_t globalBufferSize = numberOfLocalWorkgroups*localBufferSize*stride; - size_t globalWorkgroupSize = numberOfLocalWorkgroups*localWorkgroupSize; - - inBuffer = (void*)malloc(globalBufferSize); - outBuffer = (void*)malloc(globalBufferSize); - memset(outBuffer, 0, globalBufferSize); - - cl_int copiesPerWorkItemInt, copiesPerWorkgroup; - copiesPerWorkItemInt = (int)numberOfCopiesPerWorkitem; - copiesPerWorkgroup = (int)(numberOfCopiesPerWorkitem*localWorkgroupSize); - - log_info("Global: %d, local %d, local buffer %db, global buffer %db, copy stride %d, each work group will copy %d elements and each work item item will copy %d elements.\n", - (int) globalWorkgroupSize, (int)localWorkgroupSize, (int)localBufferSize, (int)globalBufferSize, (int)stride, copiesPerWorkgroup, copiesPerWorkItemInt); - - threads[0] = globalWorkgroupSize; - localThreads[0] = localWorkgroupSize; - - d = init_genrand( gRandomSeed ); - generate_random_data( vecType, globalBufferSize/get_explicit_type_size(vecType), d, inBuffer ); - free_mtdata(d); d = NULL; - - streams[ 0 ] = clCreateBuffer( context, CL_MEM_COPY_HOST_PTR, globalBufferSize, inBuffer, &error ); - test_error( error, "Unable to create input buffer" ); - streams[ 1 ] = clCreateBuffer( context, CL_MEM_COPY_HOST_PTR, globalBufferSize, outBuffer, &error ); - test_error( error, "Unable to create output buffer" ); - - error = clSetKernelArg( kernel, 0, sizeof( streams[ 0 ] ), &streams[ 0 ] ); - test_error( error, "Unable to set kernel argument" ); - error = clSetKernelArg( kernel, 1, sizeof( streams[ 1 ] ), &streams[ 1 ] ); - test_error( error, "Unable to set kernel argument" ); - error = clSetKernelArg( kernel, 2, localBufferSize, NULL ); - test_error( error, "Unable to set kernel argument" ); - error = clSetKernelArg( kernel, 3, sizeof(copiesPerWorkgroup), &copiesPerWorkgroup ); - test_error( error, "Unable to set kernel argument" ); - error = clSetKernelArg( kernel, 4, sizeof(copiesPerWorkItemInt), &copiesPerWorkItemInt ); - test_error( error, "Unable to set kernel argument" ); - error = clSetKernelArg( kernel, 5, sizeof(stride), &stride ); - test_error( error, "Unable to set kernel argument" ); - - // Enqueue - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, localThreads, 0, NULL, NULL ); - test_error( error, "Unable to queue kernel" ); - - // Read - error = clEnqueueReadBuffer( queue, streams[ 1 ], CL_TRUE, 0, globalBufferSize, outBuffer, 0, NULL, NULL ); - test_error( error, "Unable to read results" ); - - // Verify - for (int i=0; i<(int)globalBufferSize; i+=(int)elementSize*(int)stride) - { - if (memcmp( ((char *)inBuffer)+i, ((char *)outBuffer)+i, elementSize) != 0 ) - { - unsigned char * inchar = (unsigned char*)inBuffer + i; - unsigned char * outchar = (unsigned char*)outBuffer + i; - char values[4096]; - values[0] = 0; - - log_error( "ERROR: Results of copy did not validate!\n" ); - sprintf(values + strlen( values), "%d -> [", i); - for (int j=0; j<(int)elementSize; j++) - sprintf(values + strlen( values), "%2x ", inchar[j]); - sprintf(values + strlen(values), "] != ["); - for (int j=0; j<(int)elementSize; j++) - sprintf(values + strlen( values), "%2x ", outchar[j]); - sprintf(values + strlen(values), "]"); - log_error("%s\n", values); - - return -1; - } - } - - free(inBuffer); - free(outBuffer); - - return 0; -} - -int test_strided_copy_all_types(cl_device_id deviceID, cl_context context, cl_command_queue queue, const char *kernelCode) -{ - ExplicitType vecType[] = { kChar, kUChar, kShort, kUShort, kInt, kUInt, kLong, kULong, kFloat, kDouble, kNumExplicitTypes }; - unsigned int vecSizes[] = { 1, 2, 4, 8, 16, 0 }; - unsigned int strideSizes[] = { 1, 3, 4, 5, 0 }; - unsigned int size, typeIndex, stride; - - int errors = 0; - - for( typeIndex = 0; vecType[ typeIndex ] != kNumExplicitTypes; typeIndex++ ) - { - if( vecType[ typeIndex ] == kDouble && !is_extension_available( deviceID, "cl_khr_fp64" ) ) - continue; - - if (( vecType[ typeIndex ] == kLong || vecType[ typeIndex ] == kULong ) && !gHasLong ) - continue; - - for( size = 0; vecSizes[ size ] != 0; size++ ) - { - for( stride = 0; strideSizes[ stride ] != 0; stride++) - { - if (test_strided_copy( deviceID, context, queue, kernelCode, vecType[typeIndex], vecSizes[size], strideSizes[stride] )) - { - errors++; - } - } - } - } - if (errors) - return -1; - return 0; -} - - - - -int test_async_strided_copy_global_to_local(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - return test_strided_copy_all_types( deviceID, context, queue, async_strided_global_to_local_kernel ); -} - -int test_async_strided_copy_local_to_global(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - return test_strided_copy_all_types( deviceID, context, queue, async_strided_local_to_global_kernel ); -} - diff --git a/test_conformance/compatibility/test_conformance/basic/test_barrier.c b/test_conformance/compatibility/test_conformance/basic/test_barrier.c deleted file mode 100644 index 87d106d3..00000000 --- a/test_conformance/compatibility/test_conformance/basic/test_barrier.c +++ /dev/null @@ -1,158 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - - -#include "procs.h" - -const char *barrier_kernel_code = -"__kernel void compute_sum(__global int *a, int n, __global int *tmp_sum, __global int *sum)\n" -"{\n" -" int tid = get_local_id(0);\n" -" int lsize = get_local_size(0);\n" -" int i;\n" -"\n" -" tmp_sum[tid] = 0;\n" -" for (i=tid; i1; i = hadd(i,1))\n" -" {\n" -" barrier(CLK_GLOBAL_MEM_FENCE);\n" -" if (tid + i < lsize)\n" -" tmp_sum[tid] += tmp_sum[tid + i];\n" -" lsize = i; \n" -" }\n" -"\n" -" //no barrier is required here because last person to write to tmp_sum[0] was tid 0 \n" -" if (tid == 0)\n" -" *sum = tmp_sum[0];\n" -"}\n"; - - -static int -verify_sum(int *inptr, int *tmpptr, int *outptr, int n) -{ - int r = 0; - int i; - - for (i=0; i max_local_workgroup_size[0]) - max_threadgroup_size = max_local_workgroup_size[0]; - - // work group size must divide evenly into the global size - while( num_elements % max_threadgroup_size ) - max_threadgroup_size--; - - input_ptr = (int*)malloc(sizeof(int) * num_elements); - output_ptr = (int*)malloc(sizeof(int)); - - streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int) * num_elements, NULL, &err); - test_error(err, "clCreateBuffer failed."); - streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int), NULL, &err); - test_error(err, "clCreateBuffer failed."); - streams[2] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int) * max_threadgroup_size, NULL, &err); - test_error(err, "clCreateBuffer failed."); - - d = init_genrand( gRandomSeed ); - for (i=0; i -#include -#include -#include - -#include "procs.h" - -const char *kernel_code = -"__kernel void test_kernel(\n" -"char%s c, uchar%s uc, short%s s, ushort%s us, int%s i, uint%s ui, float%s f,\n" -"__global float%s *result)\n" -"{\n" -" result[0] = %s(c);\n" -" result[1] = %s(uc);\n" -" result[2] = %s(s);\n" -" result[3] = %s(us);\n" -" result[4] = %s(i);\n" -" result[5] = %s(ui);\n" -" result[6] = f;\n" -"}\n"; - -const char *kernel_code_long = -"__kernel void test_kernel_long(\n" -"long%s l, ulong%s ul,\n" -"__global float%s *result)\n" -"{\n" -" result[0] = %s(l);\n" -" result[1] = %s(ul);\n" -"}\n"; - -int test_parameter_types_long(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) -{ - clMemWrapper results; - int error; - size_t global[3] = {1, 1, 1}; - float results_back[2*16]; - int count, index; - const char* types[] = { "long", "ulong" }; - char kernel_string[8192]; - int sizes[] = {1, 2, 4, 8, 16}; - const char* size_strings[] = {"", "2", "4", "8", "16"}; - float expected; - int total_errors = 0; - int size_to_test; - char *ptr; - char convert_string[1024]; - size_t max_parameter_size; - - // We don't really care about the contents since we're just testing that the types work. - cl_long l[16]={-21,-1,2,-3,4,-5,6,-7,8,-9,10,-11,12,-13,14,-15}; - cl_ulong ul[16]={22,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; - - // Calculate how large our paramter size is to the kernel - size_t parameter_size = sizeof(cl_long) + sizeof(cl_ulong); - - // Init our strings. - kernel_string[0] = '\0'; - convert_string[0] = '\0'; - - // Get the maximum parameter size allowed - error = clGetDeviceInfo( device, CL_DEVICE_MAX_PARAMETER_SIZE, sizeof( max_parameter_size ), &max_parameter_size, NULL ); - test_error( error, "Unable to get max parameter size from device" ); - - // Create the results buffer - results = clCreateBuffer(context, CL_MEM_READ_WRITE, sizeof(cl_float)*2*16, NULL, &error); - test_error(error, "clCreateBuffer failed"); - - // Go over all the vector sizes - for (size_to_test = 0; size_to_test < 5; size_to_test++) { - clProgramWrapper program; - clKernelWrapper kernel; - - size_t total_parameter_size = parameter_size*sizes[size_to_test] + sizeof(cl_mem); - if (total_parameter_size > max_parameter_size) { - log_info("Can not test with vector size %d because it would exceed the maximum allowed parameter size to the kernel. (%d > %d)\n", - (int)sizes[size_to_test], (int)total_parameter_size, (int)max_parameter_size); - continue; - } - - log_info("Testing vector size %d\n", sizes[size_to_test]); - - // If size is > 1, then we need a explicit convert call. - if (sizes[size_to_test] > 1) { - sprintf(convert_string, "convert_float%s", size_strings[size_to_test]); - } else { - sprintf(convert_string, " "); - } - - // Build the kernel - sprintf(kernel_string, kernel_code_long, - size_strings[size_to_test], size_strings[size_to_test], size_strings[size_to_test], - convert_string, convert_string - ); - - ptr = kernel_string; - error = create_single_kernel_helper(context, &program, &kernel, 1, (const char **)&ptr, "test_kernel_long"); - test_error(error, "create single kernel failed"); - - // Set the arguments - for (count = 0; count < 2; count++) { - switch (count) { - case 0: error = clSetKernelArg(kernel, count, sizeof(cl_long)*sizes[size_to_test], &l); break; - case 1: error = clSetKernelArg(kernel, count, sizeof(cl_ulong)*sizes[size_to_test], &ul); break; - default: log_error("Test error"); break; - } - if (error) - log_error("Setting kernel arg %d %s%s: ", count, types[count], size_strings[size_to_test]); - test_error(error, "clSetKernelArgs failed"); - } - error = clSetKernelArg(kernel, 2, sizeof(cl_mem), &results); - test_error(error, "clSetKernelArgs failed"); - - // Execute - error = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, global, NULL, 0, NULL, NULL); - test_error(error, "clEnqueueNDRangeKernel failed"); - - // Read back the results - error = clEnqueueReadBuffer(queue, results, CL_TRUE, 0, sizeof(cl_float)*2*16, results_back, 0, NULL, NULL); - test_error(error, "clEnqueueReadBuffer failed"); - - // Verify the results - for (count = 0; count < 2; count++) { - for (index=0; index < sizes[size_to_test]; index++) { - switch (count) { - case 0: expected = (float)l[index]; break; - case 1: expected = (float)ul[index]; break; - default: log_error("Test error"); break; - } - - if (results_back[count*sizes[size_to_test]+index] != expected) { - total_errors++; - log_error("Conversion from %s%s failed: index %d got %g, expected %g.\n", types[count], size_strings[size_to_test], - index, results_back[count*sizes[size_to_test]+index], expected); - } - } - } - } - - return total_errors; -} - -int test_parameter_types(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) -{ - clMemWrapper results; - int error; - size_t global[3] = {1, 1, 1}; - float results_back[7*16]; - int count, index; - const char* types[] = {"char", "uchar", "short", "ushort", "int", "uint", "float"}; - char kernel_string[8192]; - int sizes[] = {1, 2, 4, 8, 16}; - const char* size_strings[] = {"", "2", "4", "8", "16"}; - float expected; - int total_errors = 0; - int size_to_test; - char *ptr; - char convert_string[1024]; - size_t max_parameter_size; - - // We don't really care about the contents since we're just testing that the types work. - cl_char c[16]={0,-1,2,-3,4,-5,6,-7,8,-9,10,-11,12,-13,14,-15}; - cl_uchar uc[16]={16,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; - cl_short s[16]={-17,-1,2,-3,4,-5,6,-7,8,-9,10,-11,12,-13,14,-15}; - cl_ushort us[16]={18,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; - cl_int i[16]={-19,-1,2,-3,4,-5,6,-7,8,-9,10,-11,12,-13,14,-15}; - cl_uint ui[16]={20,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; - cl_float f[16]={-23,-1,2,-3,4,-5,6,-7,8,-9,10,-11,12,-13,14,-15}; - - // Calculate how large our paramter size is to the kernel - size_t parameter_size = sizeof(cl_char) + sizeof(cl_uchar) + - sizeof(cl_short) +sizeof(cl_ushort) + - sizeof(cl_int) +sizeof(cl_uint) + - sizeof(cl_float); - - // Init our strings. - kernel_string[0] = '\0'; - convert_string[0] = '\0'; - - // Get the maximum parameter size allowed - error = clGetDeviceInfo( device, CL_DEVICE_MAX_PARAMETER_SIZE, sizeof( max_parameter_size ), &max_parameter_size, NULL ); - test_error( error, "Unable to get max parameter size from device" ); - - // Create the results buffer - results = clCreateBuffer(context, CL_MEM_READ_WRITE, sizeof(cl_float)*7*16, NULL, &error); - test_error(error, "clCreateBuffer failed"); - - // Go over all the vector sizes - for (size_to_test = 0; size_to_test < 5; size_to_test++) { - clProgramWrapper program; - clKernelWrapper kernel; - - size_t total_parameter_size = parameter_size*sizes[size_to_test] + sizeof(cl_mem); - if (total_parameter_size > max_parameter_size) { - log_info("Can not test with vector size %d because it would exceed the maximum allowed parameter size to the kernel. (%d > %d)\n", - (int)sizes[size_to_test], (int)total_parameter_size, (int)max_parameter_size); - continue; - } - - log_info("Testing vector size %d\n", sizes[size_to_test]); - - // If size is > 1, then we need a explicit convert call. - if (sizes[size_to_test] > 1) { - sprintf(convert_string, "convert_float%s", size_strings[size_to_test]); - } else { - sprintf(convert_string, " "); - } - - // Build the kernel - sprintf(kernel_string, kernel_code, - size_strings[size_to_test], size_strings[size_to_test], size_strings[size_to_test], - size_strings[size_to_test], size_strings[size_to_test], size_strings[size_to_test], - size_strings[size_to_test], size_strings[size_to_test], - convert_string, convert_string, convert_string, - convert_string, convert_string, convert_string - ); - - ptr = kernel_string; - error = create_single_kernel_helper(context, &program, &kernel, 1, (const char **)&ptr, "test_kernel"); - test_error(error, "create single kernel failed"); - - // Set the arguments - for (count = 0; count < 7; count++) { - switch (count) { - case 0: error = clSetKernelArg(kernel, count, sizeof(cl_char)*sizes[size_to_test], &c); break; - case 1: error = clSetKernelArg(kernel, count, sizeof(cl_uchar)*sizes[size_to_test], &uc); break; - case 2: error = clSetKernelArg(kernel, count, sizeof(cl_short)*sizes[size_to_test], &s); break; - case 3: error = clSetKernelArg(kernel, count, sizeof(cl_ushort)*sizes[size_to_test], &us); break; - case 4: error = clSetKernelArg(kernel, count, sizeof(cl_int)*sizes[size_to_test], &i); break; - case 5: error = clSetKernelArg(kernel, count, sizeof(cl_uint)*sizes[size_to_test], &ui); break; - case 6: error = clSetKernelArg(kernel, count, sizeof(cl_float)*sizes[size_to_test], &f); break; - default: log_error("Test error"); break; - } - if (error) - log_error("Setting kernel arg %d %s%s: ", count, types[count], size_strings[size_to_test]); - test_error(error, "clSetKernelArgs failed"); - } - error = clSetKernelArg(kernel, 7, sizeof(cl_mem), &results); - test_error(error, "clSetKernelArgs failed"); - - // Execute - error = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, global, NULL, 0, NULL, NULL); - test_error(error, "clEnqueueNDRangeKernel failed"); - - // Read back the results - error = clEnqueueReadBuffer(queue, results, CL_TRUE, 0, sizeof(cl_float)*7*16, results_back, 0, NULL, NULL); - test_error(error, "clEnqueueReadBuffer failed"); - - // Verify the results - for (count = 0; count < 7; count++) { - for (index=0; index < sizes[size_to_test]; index++) { - switch (count) { - case 0: expected = (float)c[index]; break; - case 1: expected = (float)uc[index]; break; - case 2: expected = (float)s[index]; break; - case 3: expected = (float)us[index]; break; - case 4: expected = (float)i[index]; break; - case 5: expected = (float)ui[index]; break; - case 6: expected = (float)f[index]; break; - default: log_error("Test error"); break; - } - - if (results_back[count*sizes[size_to_test]+index] != expected) { - total_errors++; - log_error("Conversion from %s%s failed: index %d got %g, expected %g.\n", types[count], size_strings[size_to_test], - index, results_back[count*sizes[size_to_test]+index], expected); - } - } - } - } - - if (gHasLong) { - log_info("Testing long types...\n"); - total_errors += test_parameter_types_long( device, context, queue, num_elements ); - } - else { - log_info("Longs unsupported, skipping."); - } - - return total_errors; -} - - - diff --git a/test_conformance/compatibility/test_conformance/basic/test_bufferreadwriterect.c b/test_conformance/compatibility/test_conformance/basic/test_bufferreadwriterect.c deleted file mode 100644 index e72ae708..00000000 --- a/test_conformance/compatibility/test_conformance/basic/test_bufferreadwriterect.c +++ /dev/null @@ -1,529 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - -#include "procs.h" - -#define CL_EXIT_ERROR(cmd,format,...) \ -{ \ -if ((cmd) != CL_SUCCESS) { \ -log_error("CL ERROR: %s %u: ", __FILE__,__LINE__); \ -log_error(format,## __VA_ARGS__ ); \ -log_error("\n"); \ -/*abort();*/ \ -} \ -} - -typedef unsigned char BufferType; - -// Globals for test -cl_command_queue queue; - -// Width and height of each pair of images. -enum { TotalImages = 8 }; -size_t width [TotalImages]; -size_t height [TotalImages]; -size_t depth [TotalImages]; - -// cl buffer and host buffer. -cl_mem buffer [TotalImages]; -BufferType* verify[TotalImages]; -BufferType* backing[TotalImages]; - -// Temporary buffer used for read and write operations. -BufferType* tmp_buffer; -size_t tmp_buffer_size; - -size_t num_tries = 50; // Number of randomly selected operations to perform. -size_t alloc_scale = 2; // Scale term applied buffer allocation size. -MTdata mt; - -// Initialize a buffer in host memory containing random values of the specified size. -static void initialize_image(BufferType* ptr, size_t w, size_t h, size_t d, MTdata mt) -{ - enum { ElementSize = sizeof(BufferType)/sizeof(unsigned char) }; - - unsigned char* buf = (unsigned char*)ptr; - size_t size = w*h*d*ElementSize; - - for (size_t i = 0; i != size; i++) { - buf[i] = (unsigned char)(genrand_int32(mt) % 0xff); - } -} - -// This function prints the contents of a buffer to standard error. -void print_buffer(BufferType* buf, size_t w, size_t h, size_t d) { - log_error("Size = %lux%lux%lu (%lu total)\n",w,h,d,w*h*d); - for (unsigned k=0; k!=d;++k) { - log_error("Slice: %u\n",k); - for (unsigned j=0; j!=h;++j) { - for (unsigned i=0;i!=w;++i) { - log_error("%02x",buf[k*(w*h)+j*w+i]); - } - log_error("\n"); - } - log_error("\n"); - } -} - -// Returns true if the two specified regions overlap. -bool check_overlap(const size_t src_offset[3], const size_t dst_offset[3], const size_t region[3]) { - - const size_t src_min[] = {src_offset[0], src_offset[1], src_offset[2]}; - const size_t src_max[] = {src_offset[0]+region[0], src_offset[1]+region[1], src_offset[2]+region[2]}; - - const size_t dst_min[] = {dst_offset[0], dst_offset[1], dst_offset[2]}; - const size_t dst_max[] = {dst_offset[0]+region[0], dst_offset[1]+region[1], dst_offset[2]+region[2]}; - - // Check for overlap, using the span space formulation. - bool overlap = true; - unsigned i; - for (i=0; i != 3; ++i) { - overlap = overlap && (src_min[i] < dst_max[i]) && (src_max[i] > dst_min[i]); - } - - return overlap; -} - -// This function invokes the CopyBufferRect CL command and then mirrors the operation on the host side verify buffers. -int copy_region(size_t src, size_t soffset[3], size_t sregion[3], size_t dst, size_t doffset[3], size_t dregion[3]) { - - // Copy between cl buffers. - size_t src_slice_pitch = (width[src]*height[src] != 1) ? width[src]*height[src] : 0; - size_t dst_slice_pitch = (width[dst]*height[dst] != 1) ? width[dst]*height[dst] : 0; - - cl_int err; - if (check_overlap(soffset,doffset,sregion)) { - log_info( "Copy overlap reported, skipping copy buffer rect\n" ); - return CL_SUCCESS; - } else { - if ((err = clEnqueueCopyBufferRect(queue, - buffer[src],buffer[dst], - soffset, doffset, - sregion,/*dregion,*/ - width[src], src_slice_pitch, - width[dst], dst_slice_pitch, - 0, NULL, NULL)) != CL_SUCCESS) - { - CL_EXIT_ERROR(err, "clEnqueueCopyBufferRect failed between %u and %u",(unsigned)src,(unsigned)dst); - } - } - - // Copy between host buffers. - size_t total = sregion[0] * sregion[1] * sregion[2]; - - size_t spitch = width[src]; - size_t sslice = width[src]*height[src]; - - size_t dpitch = width[dst]; - size_t dslice = width[dst]*height[dst]; - - for (size_t i = 0; i != total; ++i) { - - // Compute the coordinates of the element within the source and destination regions. - size_t rslice = sregion[0]*sregion[1]; - size_t sz = i / rslice; - size_t sy = (i % rslice) / sregion[0]; - size_t sx = (i % rslice) % sregion[0]; - - size_t dz = sz; - size_t dy = sy; - size_t dx = sx; - - // Compute the offset in bytes of the source and destination. - size_t s_idx = (soffset[2]+sz)*sslice + (soffset[1]+sy)*spitch + soffset[0]+sx; - size_t d_idx = (doffset[2]+dz)*dslice + (doffset[1]+dy)*dpitch + doffset[0]+dx; - - verify[dst][d_idx] = verify[src][s_idx]; - } - - return 0; -} - -// This function compares the destination region in the buffer pointed -// to by device, to the source region of the specified verify buffer. -int verify_region(BufferType* device, size_t src, size_t soffset[3], size_t sregion[3], size_t dst, size_t doffset[3]) { - - // Copy between host buffers. - size_t spitch = width[src]; - size_t sslice = width[src]*height[src]; - - size_t dpitch = width[dst]; - size_t dslice = width[dst]*height[dst]; - - size_t total = sregion[0] * sregion[1] * sregion[2]; - for (size_t i = 0; i != total; ++i) { - - // Compute the coordinates of the element within the source and destination regions. - size_t rslice = sregion[0]*sregion[1]; - size_t sz = i / rslice; - size_t sy = (i % rslice) / sregion[0]; - size_t sx = (i % rslice) % sregion[0]; - - // Compute the offset in bytes of the source and destination. - size_t s_idx = (soffset[2]+sz)*sslice + (soffset[1]+sy)*spitch + soffset[0]+sx; - size_t d_idx = (doffset[2]+sz)*dslice + (doffset[1]+sy)*dpitch + doffset[0]+sx; - - if (device[d_idx] != verify[src][s_idx]) { - log_error("Verify failed on comparsion %lu: coordinate (%lu, %lu, %lu) of region\n",i,sx,sy,sz); - log_error("0x%02x != 0x%02x\n", device[d_idx], verify[src][s_idx]); -#if 0 - // Uncomment this section to print buffers. - log_error("Device (copy): [%lu]\n",dst); - print_buffer(device,width[dst],height[dst],depth[dst]); - log_error("\n"); - log_error("Verify: [%lu]\n",src); - print_buffer(verify[src],width[src],height[src],depth[src]); - log_error("\n"); - abort(); -#endif - return -1; - } - } - - return 0; -} - - -// This function invokes ReadBufferRect to read a region from the -// specified source buffer into a temporary destination buffer. The -// contents of the temporary buffer are then compared to the source -// region of the corresponding verify buffer. -int read_verify_region(size_t src, size_t soffset[3], size_t sregion[3], size_t dst, size_t doffset[3], size_t dregion[3]) { - - // Clear the temporary destination host buffer. - memset(tmp_buffer, 0xff, tmp_buffer_size); - - size_t src_slice_pitch = (width[src]*height[src] != 1) ? width[src]*height[src] : 0; - size_t dst_slice_pitch = (width[dst]*height[dst] != 1) ? width[dst]*height[dst] : 0; - - // Copy the source region of the cl buffer, to the destination region of the temporary buffer. - CL_EXIT_ERROR(clEnqueueReadBufferRect(queue, - buffer[src], - CL_TRUE, - soffset,doffset, - sregion, - width[src], src_slice_pitch, - width[dst], dst_slice_pitch, - tmp_buffer, - 0, NULL, NULL), "clEnqueueCopyBufferRect failed between %u and %u",(unsigned)src,(unsigned)dst); - - return verify_region(tmp_buffer,src,soffset,sregion,dst,doffset); -} - -// This function performs the same verification check as -// read_verify_region, except a MapBuffer command is used to access the -// device buffer data instead of a ReadBufferRect, and the whole -// buffer is checked. -int map_verify_region(size_t src) { - - size_t size_bytes = width[src]*height[src]*depth[src]*sizeof(BufferType); - - // Copy the source region of the cl buffer, to the destination region of the temporary buffer. - cl_int err; - BufferType* mapped = (BufferType*)clEnqueueMapBuffer(queue,buffer[src],CL_TRUE,CL_MAP_READ,0,size_bytes,0,NULL,NULL,&err); - CL_EXIT_ERROR(err, "clEnqueueMapBuffer failed for buffer %u",(unsigned)src); - - size_t soffset[] = { 0, 0, 0 }; - size_t sregion[] = { width[src], height[src], depth[src] }; - - int ret = verify_region(mapped,src,soffset,sregion,src,soffset); - - CL_EXIT_ERROR(clEnqueueUnmapMemObject(queue,buffer[src],mapped,0,NULL,NULL), - "clEnqueueUnmapMemObject failed for buffer %u",(unsigned)src); - - return ret; -} - -// This function generates a new temporary buffer and then writes a -// region of it to a region in the specified destination buffer. -int write_region(size_t src, size_t soffset[3], size_t sregion[3], size_t dst, size_t doffset[3], size_t dregion[3]) { - - initialize_image(tmp_buffer, tmp_buffer_size, 1, 1, mt); - // memset(tmp_buffer, 0xf0, tmp_buffer_size); - - size_t src_slice_pitch = (width[src]*height[src] != 1) ? width[src]*height[src] : 0; - size_t dst_slice_pitch = (width[dst]*height[dst] != 1) ? width[dst]*height[dst] : 0; - - // Copy the source region of the cl buffer, to the destination region of the temporary buffer. - CL_EXIT_ERROR(clEnqueueWriteBufferRect(queue, - buffer[dst], - CL_TRUE, - doffset,soffset, - /*sregion,*/dregion, - width[dst], dst_slice_pitch, - width[src], src_slice_pitch, - tmp_buffer, - 0, NULL, NULL), "clEnqueueWriteBufferRect failed between %u and %u",(unsigned)src,(unsigned)dst); - - // Copy from the temporary buffer to the host buffer. - size_t spitch = width[src]; - size_t sslice = width[src]*height[src]; - size_t dpitch = width[dst]; - size_t dslice = width[dst]*height[dst]; - - size_t total = sregion[0] * sregion[1] * sregion[2]; - for (size_t i = 0; i != total; ++i) { - - // Compute the coordinates of the element within the source and destination regions. - size_t rslice = sregion[0]*sregion[1]; - size_t sz = i / rslice; - size_t sy = (i % rslice) / sregion[0]; - size_t sx = (i % rslice) % sregion[0]; - - size_t dz = sz; - size_t dy = sy; - size_t dx = sx; - - // Compute the offset in bytes of the source and destination. - size_t s_idx = (soffset[2]+sz)*sslice + (soffset[1]+sy)*spitch + soffset[0]+sx; - size_t d_idx = (doffset[2]+dz)*dslice + (doffset[1]+dy)*dpitch + doffset[0]+dx; - - verify[dst][d_idx] = tmp_buffer[s_idx]; - } - return 0; -} - -void CL_CALLBACK mem_obj_destructor_callback( cl_mem, void *data ) -{ - free( data ); -} - -// This is the main test function for the conformance test. -int -test_bufferreadwriterect(cl_device_id device, cl_context context, cl_command_queue queue_, int num_elements) -{ - queue = queue_; - cl_int err; - - // Initialize the random number generator. - mt = init_genrand( gRandomSeed ); - - // Compute a maximum buffer size based on the number of test images and the device maximum. - cl_ulong max_mem_alloc_size = 0; - CL_EXIT_ERROR(clGetDeviceInfo(device, CL_DEVICE_MAX_MEM_ALLOC_SIZE, sizeof(cl_ulong), &max_mem_alloc_size, NULL),"Could not get device info"); - log_info("CL_DEVICE_MAX_MEM_ALLOC_SIZE = %llu bytes.\n", max_mem_alloc_size); - - // Confirm that the maximum allocation size is not zero. - if (max_mem_alloc_size == 0) { - log_error("Error: CL_DEVICE_MAX_MEM_ALLOC_SIZE is zero bytes\n"); - return -1; - } - - // Guess at a reasonable maximum dimension. - size_t max_mem_alloc_dim = (size_t)cbrt((double)(max_mem_alloc_size/sizeof(BufferType)))/alloc_scale; - if (max_mem_alloc_dim == 0) { - max_mem_alloc_dim = max_mem_alloc_size; - } - - log_info("Using maximum dimension = %lu.\n", max_mem_alloc_dim); - - // Create pairs of cl buffers and host buffers on which operations will be mirrored. - log_info("Creating %u pairs of random sized host and cl buffers.\n", TotalImages); - - size_t max_size = 0; - size_t total_bytes = 0; - - for (unsigned i=0; i != TotalImages; ++i) { - - // Determine a width and height for this buffer. - size_t size_bytes; - size_t tries = 0; - size_t max_tries = 1048576; - do { - width[i] = get_random_size_t(1, max_mem_alloc_dim, mt); - height[i] = get_random_size_t(1, max_mem_alloc_dim, mt); - depth[i] = get_random_size_t(1, max_mem_alloc_dim, mt); - ++tries; - } while ((tries < max_tries) && (size_bytes = width[i]*height[i]*depth[i]*sizeof(BufferType)) > max_mem_alloc_size); - - // Check to see if adequately sized buffers were found. - if (tries >= max_tries) { - log_error("Error: Could not find random buffer sized less than %llu bytes in %lu tries.\n", - max_mem_alloc_size, max_tries); - return -1; - } - - // Keep track of the dimensions of the largest buffer. - max_size = (size_bytes > max_size) ? size_bytes : max_size; - total_bytes += size_bytes; - - log_info("Buffer[%u] is (%lu,%lu,%lu) = %lu MB (truncated)\n",i,width[i],height[i],depth[i],(size_bytes)/1048576); - } - - log_info( "Total size: %lu MB (truncated)\n", total_bytes/1048576 ); - - // Allocate a temporary buffer for read and write operations. - tmp_buffer_size = max_size; - tmp_buffer = (BufferType*)malloc(tmp_buffer_size); - - // Initialize cl buffers - log_info( "Initializing buffers\n" ); - for (unsigned i=0; i != TotalImages; ++i) { - - size_t size_bytes = width[i]*height[i]*depth[i]*sizeof(BufferType); - - // Allocate a host copy of the buffer for verification. - verify[i] = (BufferType*)malloc(size_bytes); - CL_EXIT_ERROR(verify[i] ? CL_SUCCESS : -1, "malloc of host buffer failed for buffer %u", i); - - // Allocate the buffer in host memory. - backing[i] = (BufferType*)malloc(size_bytes); - CL_EXIT_ERROR(backing[i] ? CL_SUCCESS : -1, "malloc of backing buffer failed for buffer %u", i); - - // Generate a random buffer. - log_info( "Initializing buffer %u\n", i ); - initialize_image(verify[i], width[i], height[i], depth[i], mt); - - // Copy the image into a buffer which will passed to CL. - memcpy(backing[i], verify[i], size_bytes); - - // Create the CL buffer. - buffer[i] = clCreateBuffer (context, CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, size_bytes, backing[i], &err); - CL_EXIT_ERROR(err,"clCreateBuffer failed for buffer %u", i); - - // Make sure buffer is cleaned up appropriately if we encounter an error in the rest of the calls. - err = clSetMemObjectDestructorCallback( buffer[i], mem_obj_destructor_callback, backing[i] ); - CL_EXIT_ERROR(err, "Unable to set mem object destructor callback" ); - } - - // Main test loop, run num_tries times. - log_info( "Executing %u test operations selected at random.\n", (unsigned)num_tries ); - for (size_t iter = 0; iter < num_tries; ++iter) { - - // Determine a source and a destination. - size_t src = get_random_size_t(0,TotalImages,mt); - size_t dst = get_random_size_t(0,TotalImages,mt); - - // Determine the minimum dimensions. - size_t min_width = width[src] < width[dst] ? width[src] : width[dst]; - size_t min_height = height[src] < height[dst] ? height[src] : height[dst]; - size_t min_depth = depth[src] < depth[dst] ? depth[src] : depth[dst]; - - // Generate a random source rectangle within the minimum dimensions. - size_t mx = get_random_size_t(0, min_width-1, mt); - size_t my = get_random_size_t(0, min_height-1, mt); - size_t mz = get_random_size_t(0, min_depth-1, mt); - - size_t sw = get_random_size_t(1, (min_width - mx), mt); - size_t sh = get_random_size_t(1, (min_height - my), mt); - size_t sd = get_random_size_t(1, (min_depth - mz), mt); - - size_t sx = get_random_size_t(0, width[src]-sw, mt); - size_t sy = get_random_size_t(0, height[src]-sh, mt); - size_t sz = get_random_size_t(0, depth[src]-sd, mt); - - size_t soffset[] = { sx, sy, sz }; - size_t sregion[] = { sw, sh, sd }; - - // Generate a destination rectangle of the same size. - size_t dw = sw; - size_t dh = sh; - size_t dd = sd; - - // Generate a random destination offset within the buffer. - size_t dx = get_random_size_t(0, (width[dst] - dw), mt); - size_t dy = get_random_size_t(0, (height[dst] - dh), mt); - size_t dz = get_random_size_t(0, (depth[dst] - dd), mt); - size_t doffset[] = { dx, dy, dz }; - size_t dregion[] = { dw, dh, dd }; - - // Execute one of three operations: - // - Copy: Copies between src and dst within each set of host, buffer, and images. - // - Read & verify: Reads src region from buffer and image, and compares to host. - // - Write: Generates new buffer with src dimensions, and writes to cl buffer and image. - - enum { TotalOperations = 3 }; - size_t operation = get_random_size_t(0,TotalOperations,mt); - - switch (operation) { - case 0: - log_info("%lu Copy %lu offset (%lu,%lu,%lu) -> %lu offset (%lu,%lu,%lu) region (%lux%lux%lu = %lu)\n", - iter, - src, soffset[0], soffset[1], soffset[2], - dst, doffset[0], doffset[1], doffset[2], - sregion[0], sregion[1], sregion[2], - sregion[0]*sregion[1]*sregion[2]); - if ((err = copy_region(src, soffset, sregion, dst, doffset, dregion))) - return err; - break; - case 1: - log_info("%lu Read %lu offset (%lu,%lu,%lu) -> %lu offset (%lu,%lu,%lu) region (%lux%lux%lu = %lu)\n", - iter, - src, soffset[0], soffset[1], soffset[2], - dst, doffset[0], doffset[1], doffset[2], - sregion[0], sregion[1], sregion[2], - sregion[0]*sregion[1]*sregion[2]); - if ((err = read_verify_region(src, soffset, sregion, dst, doffset, dregion))) - return err; - break; - case 2: - log_info("%lu Write %lu offset (%lu,%lu,%lu) -> %lu offset (%lu,%lu,%lu) region (%lux%lux%lu = %lu)\n", - iter, - src, soffset[0], soffset[1], soffset[2], - dst, doffset[0], doffset[1], doffset[2], - sregion[0], sregion[1], sregion[2], - sregion[0]*sregion[1]*sregion[2]); - if ((err = write_region(src, soffset, sregion, dst, doffset, dregion))) - return err; - break; - } - -#if 0 - // Uncomment this section to verify each operation. - // If commented out, verification won't occur until the end of the - // test, and it will not be possible to determine which operation failed. - log_info("Verify src %lu offset (%u,%u,%u) region (%lux%lux%lu)\n", src, 0, 0, 0, width[src], height[src], depth[src]); - if (err = map_verify_region(src)) - return err; - - log_info("Verify dst %lu offset (%u,%u,%u) region (%lux%lux%lu)\n", dst, 0, 0, 0, width[dst], height[dst], depth[dst]); - if (err = map_verify_region(dst)) - return err; - - -#endif - - } // end main for loop. - - for (unsigned i=0;i -#include -#include -#include - - -#include "procs.h" - -const char *constant_kernel_code = -"__kernel void constant_kernel(__global float *out, __constant float *tmpF, __constant int *tmpI)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" float ftmp = tmpF[tid]; \n" -" float Itmp = tmpI[tid]; \n" -" out[tid] = ftmp * Itmp; \n" -"}\n"; - -const char *loop_constant_kernel_code = -"kernel void loop_constant_kernel(global float *out, constant float *i_pos, int num)\n" -"{\n" -" int tid = get_global_id(0);\n" -" float sum = 0;\n" -" for (int i = 0; i < num; i++) {\n" -" float pos = i_pos[i*3];\n" -" sum += pos;\n" -" }\n" -" out[tid] = sum;\n" -"}\n"; - - -static int -verify(cl_float *tmpF, cl_int *tmpI, cl_float *out, int n) -{ - int i; - - for (i=0; i < n; i++) - { - float f = tmpF[i] * tmpI[i]; - if( out[i] != f ) - { - log_error("CONSTANT test failed\n"); - return -1; - } - } - - log_info("CONSTANT test passed\n"); - return 0; -} - - -static int -verify_loop_constant(const cl_float *tmp, cl_float *out, cl_int l, int n) -{ - int i; - cl_int j; - for (i=0; i < n; i++) - { - float sum = 0; - for (j=0; j < l; ++j) - sum += tmp[j*3]; - - if( out[i] != sum ) - { - log_error("loop CONSTANT test failed\n"); - return -1; - } - } - - log_info("loop CONSTANT test passed\n"); - return 0; -} - -int -test_constant(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) -{ - cl_mem streams[3]; - cl_int *tmpI; - cl_float *tmpF, *out; - cl_program program; - cl_kernel kernel; - size_t global_threads[3]; - int err; - unsigned int i; - cl_ulong maxSize, maxGlobalSize, maxAllocSize; - size_t num_floats, num_ints, constant_values; - MTdata d; - RoundingMode oldRoundMode; - int isRTZ = 0; - - /* Verify our test buffer won't be bigger than allowed */ - err = clGetDeviceInfo( device, CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE, sizeof( maxSize ), &maxSize, 0 ); - test_error( err, "Unable to get max constant buffer size" ); - - log_info("Device reports CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE %llu bytes.\n", maxSize); - err = clGetDeviceInfo(device, CL_DEVICE_GLOBAL_MEM_SIZE, sizeof(maxGlobalSize), &maxGlobalSize, 0); - test_error(err, "Unable to get CL_DEVICE_GLOBAL_MEM_SIZE"); - if (maxSize > maxGlobalSize / 4) - maxSize = maxGlobalSize / 4; - err = clGetDeviceInfo(device, CL_DEVICE_MAX_MEM_ALLOC_SIZE , sizeof(maxAllocSize), &maxAllocSize, 0); - test_error(err, "Unable to get CL_DEVICE_MAX_MEM_ALLOC_SIZE "); - if (maxSize > maxAllocSize) - maxSize = maxAllocSize; - maxSize/=4; - num_ints = (size_t)maxSize/sizeof(cl_int); - num_floats = (size_t)maxSize/sizeof(cl_float); - if (num_ints >= num_floats) { - constant_values = num_floats; - } else { - constant_values = num_ints; - } - - log_info("Test will attempt to use %lu bytes with one %lu byte constant int buffer and one %lu byte constant float buffer.\n", - constant_values*sizeof(cl_int) + constant_values*sizeof(cl_float), constant_values*sizeof(cl_int), constant_values*sizeof(cl_float)); - - tmpI = (cl_int*)malloc(sizeof(cl_int) * constant_values); - tmpF = (cl_float*)malloc(sizeof(cl_float) * constant_values); - out = (cl_float*)malloc(sizeof(cl_float) * constant_values); - streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_float) * constant_values, NULL, NULL); - if (!streams[0]) - { - log_error("clCreateBuffer failed\n"); - return -1; - } - streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_float) * constant_values, NULL, NULL); - if (!streams[1]) - { - log_error("clCreateBuffer failed\n"); - return -1; - } - streams[2] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(cl_int) * constant_values, NULL, NULL); - if (!streams[2]) - { - log_error("clCreateBuffer failed\n"); - return -1; - } - - d = init_genrand( gRandomSeed ); - for (i=0; i -#include -#include -#include - - -#include "procs.h" - -const char *constant_source_kernel_code[] = { -"__constant int outVal = 42;\n" -"__constant int outIndex = 7;\n" -"__constant int outValues[ 16 ] = { 17, 01, 11, 12, 1955, 11, 5, 1985, 113, 1, 24, 1984, 7, 23, 1979, 97 };\n" -"\n" -"__kernel void constant_kernel( __global int *out )\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" if( tid == 0 )\n" -" {\n" -" out[ 0 ] = outVal;\n" -" out[ 1 ] = outValues[ outIndex ];\n" -" }\n" -" else\n" -" {\n" -" out[ tid + 1 ] = outValues[ tid ];\n" -" }\n" -"}\n" }; - -int test_constant_source(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) -{ - clProgramWrapper program; - clKernelWrapper kernel; - - clMemWrapper outStream; - cl_int outValues[ 17 ]; - cl_int expectedValues[ 17 ] = { 42, 1985, 01, 11, 12, 1955, 11, 5, 1985, 113, 1, 24, 1984, 7, 23, 1979, 97 }; - - cl_int error; - - - // Create a kernel to test with - error = create_single_kernel_helper( context, &program, &kernel, 1, constant_source_kernel_code, "constant_kernel" ); - test_error( error, "Unable to create testing kernel" ); - - // Create our output buffer - outStream = clCreateBuffer( context, CL_MEM_WRITE_ONLY, sizeof( outValues ), NULL, &error ); - test_error( error, "Unable to create output buffer" ); - - // Set the argument - error = clSetKernelArg( kernel, 0, sizeof( outStream ), &outStream ); - test_error( error, "Unable to set kernel argument" ); - - // Run test kernel - size_t threads[ 1 ] = { 16 }; - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, NULL, 0, NULL, NULL ); - test_error( error, "Unable to enqueue kernel" ); - - // Read results - error = clEnqueueReadBuffer( queue, outStream, CL_TRUE, 0, sizeof( outValues ), outValues, 0, NULL, NULL ); - test_error( error, "Unable to read results" ); - - // Verify results - for( int i = 0; i < 17; i++ ) - { - if( expectedValues[ i ] != outValues[ i ] ) - { - if( i == 0 ) - log_error( "ERROR: Output value %d from constant source global did not validate! (Expected %d, got %d)\n", i, expectedValues[ i ], outValues[ i ] ); - else if( i == 1 ) - log_error( "ERROR: Output value %d from constant-indexed constant array did not validate! (Expected %d, got %d)\n", i, expectedValues[ i ], outValues[ i ] ); - else - log_error( "ERROR: Output value %d from variable-indexed constant array did not validate! (Expected %d, got %d)\n", i, expectedValues[ i ], outValues[ i ] ); - return -1; - } - } - - return 0; -} - - - - - diff --git a/test_conformance/compatibility/test_conformance/basic/test_createkernelsinprogram.c b/test_conformance/compatibility/test_conformance/basic/test_createkernelsinprogram.c deleted file mode 100644 index 58bcc810..00000000 --- a/test_conformance/compatibility/test_conformance/basic/test_createkernelsinprogram.c +++ /dev/null @@ -1,121 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - - -#include "procs.h" - -const char *sample_single_kernel = { -"__kernel void sample_test(__global float *src, __global int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = (int)src[tid];\n" -"\n" -"}\n"}; - -const char *sample_double_kernel = { -"__kernel void sample_test(__global float *src, __global int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = (int)src[tid];\n" -"\n" -"}\n" -"__kernel void sample_test2(__global float *src, __global int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = (int)src[tid];\n" -"\n" -"}\n"}; - - -int -test_createkernelsinprogram(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) -{ - cl_program program; - cl_kernel kernel[2]; - unsigned int num_kernels; - size_t lengths[2]; - int err; - - lengths[0] = strlen(sample_single_kernel); - program = clCreateProgramWithSource(context, 1, &sample_single_kernel, lengths, NULL); - if (!program) - { - log_error("clCreateProgramWithSource failed\n"); - return -1; - } - - err = clBuildProgram(program, 0, NULL, NULL, NULL, NULL); - if (err != CL_SUCCESS) - { - log_error("clBuildProgramExecutable failed\n"); - return -1; - } - - err = clCreateKernelsInProgram(program, 1, kernel, &num_kernels); - if ( (err != CL_SUCCESS) || (num_kernels != 1) ) - { - log_error("clCreateKernelsInProgram test failed for a single kernel\n"); - return -1; - } - - clReleaseKernel(kernel[0]); - clReleaseProgram(program); - - lengths[0] = strlen(sample_double_kernel); - program = clCreateProgramWithSource(context, 1, &sample_double_kernel, lengths, NULL); - if (!program) - { - log_error("clCreateProgramWithSource failed\n"); - return -1; - } - - err = clBuildProgram(program, 0, NULL, NULL, NULL, NULL); - if (err != CL_SUCCESS) - { - log_error("clBuildProgramExecutable failed\n"); - return -1; - } - - err = clCreateKernelsInProgram(program, 2, kernel, &num_kernels); - if ( (err != CL_SUCCESS) || (num_kernels != 2) ) - { - log_error("clCreateKernelsInProgram test failed for two kernels\n"); - return -1; - } - - log_info("clCreateKernelsInProgram test passed\n"); - - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseProgram(program); - - - return err; -} - - - - - diff --git a/test_conformance/compatibility/test_conformance/basic/test_enqueue_map.cpp b/test_conformance/compatibility/test_conformance/basic/test_enqueue_map.cpp deleted file mode 100644 index 3bf7be58..00000000 --- a/test_conformance/compatibility/test_conformance/basic/test_enqueue_map.cpp +++ /dev/null @@ -1,253 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - - -#include "procs.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" - -const cl_mem_flags flag_set[] = { - CL_MEM_ALLOC_HOST_PTR, - CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR, - CL_MEM_USE_HOST_PTR, - CL_MEM_COPY_HOST_PTR, - 0 -}; -const char* flag_set_names[] = { - "CL_MEM_ALLOC_HOST_PTR", - "CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR", - "CL_MEM_USE_HOST_PTR", - "CL_MEM_COPY_HOST_PTR", - "0" -}; - -int test_enqueue_map_buffer(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - const size_t bufferSize = 256*256; - int src_flag_id; - MTdata d = init_genrand( gRandomSeed ); - cl_char *initialData = (cl_char*)malloc(bufferSize); - cl_char *finalData = (cl_char*)malloc(bufferSize); - - for (src_flag_id=0; src_flag_id < 5; src_flag_id++) - { - clMemWrapper memObject; - log_info("Testing with cl_mem_flags src: %s\n", flag_set_names[src_flag_id]); - - generate_random_data( kChar, (unsigned int)bufferSize, d, initialData ); - - if ((flag_set[src_flag_id] & CL_MEM_USE_HOST_PTR) || (flag_set[src_flag_id] & CL_MEM_COPY_HOST_PTR)) - memObject = clCreateBuffer(context, flag_set[src_flag_id], bufferSize * sizeof( cl_char ), initialData, &error); - else - memObject = clCreateBuffer(context, flag_set[src_flag_id], bufferSize * sizeof( cl_char ), NULL, &error); - test_error( error, "Unable to create testing buffer" ); - - if (!(flag_set[src_flag_id] & CL_MEM_USE_HOST_PTR) && !(flag_set[src_flag_id] & CL_MEM_COPY_HOST_PTR)) - { - error = clEnqueueWriteBuffer(queue, memObject, CL_TRUE, 0, bufferSize * sizeof( cl_char ), initialData, 0, NULL, NULL); - test_error( error, "clEnqueueWriteBuffer failed"); - } - - for( int i = 0; i < 128; i++ ) - { - - size_t offset = (size_t)random_in_range( 0, (int)bufferSize - 1, d ); - size_t length = (size_t)random_in_range( 1, (int)( bufferSize - offset ), d ); - - cl_char *mappedRegion = (cl_char *)clEnqueueMapBuffer( queue, memObject, CL_TRUE, CL_MAP_READ | CL_MAP_WRITE, - offset, length, 0, NULL, NULL, &error ); - if( error != CL_SUCCESS ) - { - print_error( error, "clEnqueueMapBuffer call failed" ); - log_error( "\tOffset: %d Length: %d\n", (int)offset, (int)length ); - free( initialData ); - free( finalData ); - free_mtdata(d); - return -1; - } - - // Write into the region - for( size_t j = 0; j < length; j++ ) - { - cl_char spin = (cl_char)genrand_int32( d ); - - // Test read AND write in one swipe - cl_char value = mappedRegion[ j ]; - value = spin - value; - mappedRegion[ j ] = value; - - // Also update the initial data array - value = initialData[ offset + j ]; - value = spin - value; - initialData[ offset + j ] = value; - } - - // Unmap - error = clEnqueueUnmapMemObject( queue, memObject, mappedRegion, 0, NULL, NULL ); - test_error( error, "Unable to unmap buffer" ); - } - - // Final validation: read actual values of buffer and compare against our reference - error = clEnqueueReadBuffer( queue, memObject, CL_TRUE, 0, sizeof( cl_char ) * bufferSize, finalData, 0, NULL, NULL ); - test_error( error, "Unable to read results" ); - - for( size_t q = 0; q < bufferSize; q++ ) - { - if( initialData[ q ] != finalData[ q ] ) - { - log_error( "ERROR: Sample %d did not validate! Got %d, expected %d\n", (int)q, (int)finalData[ q ], (int)initialData[ q ] ); - free( initialData ); - free( finalData ); - free_mtdata(d); - return -1; - } - } - } // cl_mem flags - - free( initialData ); - free( finalData ); - free_mtdata(d); - - return 0; -} - -int test_enqueue_map_image(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - cl_image_format format = { CL_RGBA, CL_UNSIGNED_INT32 }; - const size_t imageSize = 256; - int src_flag_id; - cl_uint *initialData; - cl_uint *finalData; - MTdata d; - - PASSIVE_REQUIRE_IMAGE_SUPPORT( deviceID ) - - initialData = (cl_uint*)malloc(imageSize * imageSize * 4 *sizeof(cl_uint)); - finalData = (cl_uint*)malloc(imageSize * imageSize * 4 *sizeof(cl_uint)); - - if( !is_image_format_supported( context, CL_MEM_READ_ONLY, CL_MEM_OBJECT_IMAGE2D, &format ) ) - { - log_error( "ERROR: Test requires basic OpenCL 1.0 format CL_RGBA:CL_UNSIGNED_INT32, which is unsupported by this device!\n" ); - free(initialData); - free(finalData); - return -1; - } - - d = init_genrand( gRandomSeed ); - for (src_flag_id=0; src_flag_id < 5; src_flag_id++) { - clMemWrapper memObject; - log_info("Testing with cl_mem_flags src: %s\n", flag_set_names[src_flag_id]); - - generate_random_data( kUInt, (unsigned int)( imageSize * imageSize ), d, initialData ); - - if ((flag_set[src_flag_id] & CL_MEM_USE_HOST_PTR) || (flag_set[src_flag_id] & CL_MEM_COPY_HOST_PTR)) - memObject = create_image_2d( context, CL_MEM_READ_WRITE | flag_set[src_flag_id], &format, - imageSize, imageSize, 0, initialData, &error ); - else - memObject = create_image_2d( context, CL_MEM_READ_WRITE | flag_set[src_flag_id], &format, - imageSize, imageSize, 0, NULL, &error ); - test_error( error, "Unable to create testing buffer" ); - - if (!(flag_set[src_flag_id] & CL_MEM_USE_HOST_PTR) && !(flag_set[src_flag_id] & CL_MEM_COPY_HOST_PTR)) { - size_t write_origin[3]={0,0,0}, write_region[3]={imageSize, imageSize, 1}; - error = clEnqueueWriteImage(queue, memObject, CL_TRUE, write_origin, write_region, NULL, NULL, initialData, 0, NULL, NULL); - test_error( error, "Unable to write to testing buffer" ); - } - - for( int i = 0; i < 128; i++ ) - { - - size_t offset[3], region[3]; - size_t rowPitch; - - offset[ 0 ] = (size_t)random_in_range( 0, (int)imageSize - 1, d ); - region[ 0 ] = (size_t)random_in_range( 1, (int)( imageSize - offset[ 0 ] - 1), d ); - offset[ 1 ] = (size_t)random_in_range( 0, (int)imageSize - 1, d ); - region[ 1 ] = (size_t)random_in_range( 1, (int)( imageSize - offset[ 1 ] - 1), d ); - offset[ 2 ] = 0; - region[ 2 ] = 1; - cl_uint *mappedRegion = (cl_uint *)clEnqueueMapImage( queue, memObject, CL_TRUE, CL_MAP_READ | CL_MAP_WRITE, - offset, region, &rowPitch, NULL, 0, NULL, NULL, &error ); - if( error != CL_SUCCESS ) - { - print_error( error, "clEnqueueMapImage call failed" ); - log_error( "\tOffset: %d,%d Region: %d,%d\n", (int)offset[0], (int)offset[1], (int)region[0], (int)region[1] ); - free(initialData); - free(finalData); - free_mtdata(d); - return -1; - } - - // Write into the region - cl_uint *mappedPtr = mappedRegion; - for( size_t y = 0; y < region[ 1 ]; y++ ) - { - for( size_t x = 0; x < region[ 0 ] * 4; x++ ) - { - cl_int spin = (cl_int)random_in_range( 16, 1024, d ); - - cl_int value; - // Test read AND write in one swipe - value = mappedPtr[ ( y * rowPitch/sizeof(cl_uint) ) + x ]; - value = spin - value; - mappedPtr[ ( y * rowPitch/sizeof(cl_uint) ) + x ] = value; - - // Also update the initial data array - value = initialData[ ( ( offset[ 1 ] + y ) * imageSize + offset[ 0 ] ) * 4 + x ]; - value = spin - value; - initialData[ ( ( offset[ 1 ] + y ) * imageSize + offset[ 0 ] ) * 4 + x ] = value; - } - } - - // Unmap - error = clEnqueueUnmapMemObject( queue, memObject, mappedRegion, 0, NULL, NULL ); - test_error( error, "Unable to unmap buffer" ); - } - - // Final validation: read actual values of buffer and compare against our reference - size_t finalOrigin[3] = { 0, 0, 0 }, finalRegion[3] = { imageSize, imageSize, 1 }; - error = clEnqueueReadImage( queue, memObject, CL_TRUE, finalOrigin, finalRegion, 0, 0, finalData, 0, NULL, NULL ); - test_error( error, "Unable to read results" ); - - for( size_t q = 0; q < imageSize * imageSize * 4; q++ ) - { - if( initialData[ q ] != finalData[ q ] ) - { - log_error( "ERROR: Sample %d (coord %d,%d) did not validate! Got %d, expected %d\n", (int)q, (int)( ( q / 4 ) % imageSize ), (int)( ( q / 4 ) / imageSize ), - (int)finalData[ q ], (int)initialData[ q ] ); - free(initialData); - free(finalData); - free_mtdata(d); - return -1; - } - } - } // cl_mem_flags - - free(initialData); - free(finalData); - free_mtdata(d); - return 0; -} - - diff --git a/test_conformance/compatibility/test_conformance/basic/test_explicit_s2v.cpp b/test_conformance/compatibility/test_conformance/basic/test_explicit_s2v.cpp deleted file mode 100644 index 205e7bbd..00000000 --- a/test_conformance/compatibility/test_conformance/basic/test_explicit_s2v.cpp +++ /dev/null @@ -1,384 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - - -#include "procs.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" - -#define DECLARE_S2V_IDENT_KERNEL(srctype,dsttype,size) \ -"__kernel void test_conversion(__global " srctype " *sourceValues, __global " dsttype #size " *destValues )\n" \ -"{\n" \ -" int tid = get_global_id(0);\n" \ -" " srctype " src = sourceValues[tid];\n" \ -"\n" \ -" destValues[tid] = (" dsttype #size ")src;\n" \ -"\n" \ -"}\n" - -#define DECLARE_S2V_IDENT_KERNELS(srctype,dsttype) \ -{ \ -DECLARE_S2V_IDENT_KERNEL(srctype,#dsttype,2), \ -DECLARE_S2V_IDENT_KERNEL(srctype,#dsttype,4), \ -DECLARE_S2V_IDENT_KERNEL(srctype,#dsttype,8), \ -DECLARE_S2V_IDENT_KERNEL(srctype,#dsttype,16) \ -} - -#define DECLARE_EMPTY { NULL, NULL, NULL, NULL, NULL } - -/* Note: the next four arrays all must match in order and size to the ExplicitTypes enum in conversions.h!!! */ - -#define DECLARE_S2V_IDENT_KERNELS_SET(srctype) \ -{ \ -DECLARE_S2V_IDENT_KERNELS(#srctype,bool), \ - DECLARE_S2V_IDENT_KERNELS(#srctype,char), \ - DECLARE_S2V_IDENT_KERNELS(#srctype,uchar), \ - DECLARE_S2V_IDENT_KERNELS(#srctype,unsigned char), \ -DECLARE_S2V_IDENT_KERNELS(#srctype,short), \ -DECLARE_S2V_IDENT_KERNELS(#srctype,ushort), \ -DECLARE_S2V_IDENT_KERNELS(#srctype,unsigned short), \ -DECLARE_S2V_IDENT_KERNELS(#srctype,int), \ -DECLARE_S2V_IDENT_KERNELS(#srctype,uint), \ -DECLARE_S2V_IDENT_KERNELS(#srctype,unsigned int), \ -DECLARE_S2V_IDENT_KERNELS(#srctype,long), \ -DECLARE_S2V_IDENT_KERNELS(#srctype,ulong), \ -DECLARE_S2V_IDENT_KERNELS(#srctype,unsigned long), \ -DECLARE_S2V_IDENT_KERNELS(#srctype,float), \ -DECLARE_EMPTY \ -} - -#define DECLARE_EMPTY_SET \ -{ \ -DECLARE_EMPTY, \ -DECLARE_EMPTY, \ -DECLARE_EMPTY, \ -DECLARE_EMPTY, \ -DECLARE_EMPTY, \ -DECLARE_EMPTY, \ -DECLARE_EMPTY, \ -DECLARE_EMPTY, \ -DECLARE_EMPTY, \ -DECLARE_EMPTY, \ -DECLARE_EMPTY, \ -DECLARE_EMPTY, \ -DECLARE_EMPTY, \ -DECLARE_EMPTY, \ -DECLARE_EMPTY \ -} - - -/* The overall array */ -const char * kernel_explicit_s2v_set[kNumExplicitTypes][kNumExplicitTypes][5] = { - DECLARE_S2V_IDENT_KERNELS_SET(bool), - DECLARE_S2V_IDENT_KERNELS_SET(char), - DECLARE_S2V_IDENT_KERNELS_SET(uchar), - DECLARE_S2V_IDENT_KERNELS_SET(unsigned char), - DECLARE_S2V_IDENT_KERNELS_SET(short), - DECLARE_S2V_IDENT_KERNELS_SET(ushort), - DECLARE_S2V_IDENT_KERNELS_SET(unsigned short), - DECLARE_S2V_IDENT_KERNELS_SET(int), - DECLARE_S2V_IDENT_KERNELS_SET(uint), - DECLARE_S2V_IDENT_KERNELS_SET(unsigned int), - DECLARE_S2V_IDENT_KERNELS_SET(long), - DECLARE_S2V_IDENT_KERNELS_SET(ulong), - DECLARE_S2V_IDENT_KERNELS_SET(unsigned long), - DECLARE_S2V_IDENT_KERNELS_SET(float), - DECLARE_EMPTY_SET -}; - -int test_explicit_s2v_function(cl_device_id deviceID, cl_context context, cl_command_queue queue, const char *programSrc, - ExplicitType srcType, unsigned int count, ExplicitType destType, unsigned int vecSize, void *inputData ) -{ - clProgramWrapper program; - clKernelWrapper kernel; - int error; - clMemWrapper streams[2]; - void *outData; - unsigned char convertedData[ 8 ]; /* Max type size is 8 bytes */ - size_t threadSize[3], groupSize[3]; - unsigned int i, s; - unsigned char *inPtr, *outPtr; - size_t paramSize, destTypeSize; - - const char* finalProgramSrc[2] = { - "", // optional pragma - programSrc - }; - - if (srcType == kDouble || destType == kDouble) { - finalProgramSrc[0] = "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n"; - } - - - if( programSrc == NULL ) - return 0; - - paramSize = get_explicit_type_size( srcType ); - destTypeSize = get_explicit_type_size( destType ); - - size_t destStride = destTypeSize * vecSize; - - outData = malloc( destStride * count ); - - if( create_single_kernel_helper( context, &program, &kernel, 2, finalProgramSrc, "test_conversion" ) ) - { - log_info( "****** %s%s *******\n", finalProgramSrc[0], finalProgramSrc[1] ); - return -1; - } - - streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), paramSize * count, inputData, &error); - test_error( error, "clCreateBuffer failed"); - streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), destStride * count, NULL, &error); - test_error( error, "clCreateBuffer failed"); - - /* Set the arguments */ - error = clSetKernelArg(kernel, 0, sizeof( streams[0] ), &streams[0] ); - test_error( error, "Unable to set indexed kernel arguments" ); - error = clSetKernelArg(kernel, 1, sizeof( streams[1] ), &streams[1] ); - test_error( error, "Unable to set indexed kernel arguments" ); - - /* Run the kernel */ - threadSize[0] = count; - - error = get_max_common_work_group_size( context, kernel, threadSize[0], &groupSize[0] ); - test_error( error, "Unable to get work group size to use" ); - - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threadSize, groupSize, 0, NULL, NULL ); - test_error( error, "Unable to execute test kernel" ); - - /* Now verify the results. Each value should have been duplicated four times, and we should be able to just - do a memcpy instead of relying on the actual type of data */ - error = clEnqueueReadBuffer( queue, streams[1], CL_TRUE, 0, destStride * count, outData, 0, NULL, NULL ); - test_error( error, "Unable to read output values!" ); - - inPtr = (unsigned char *)inputData; - outPtr = (unsigned char *)outData; - - for( i = 0; i < count; i++ ) - { - /* Convert the input data element to our output data type to compare against */ - convert_explicit_value( (void *)inPtr, (void *)convertedData, srcType, false, kDefaultRoundingType, destType ); - - /* Now compare every element of the vector */ - for( s = 0; s < vecSize; s++ ) - { - if( memcmp( convertedData, outPtr + destTypeSize * s, destTypeSize ) != 0 ) - { - unsigned int *p = (unsigned int *)outPtr; - log_error( "ERROR: Output value %d:%d does not validate for size %d:%d!\n", i, s, vecSize, (int)destTypeSize ); - log_error( " Input: 0x%0*x\n", (int)( paramSize * 2 ), *(unsigned int *)inPtr & ( 0xffffffff >> ( 32 - paramSize * 8 ) ) ); - log_error( " Actual: 0x%08x 0x%08x 0x%08x 0x%08x\n", p[ 0 ], p[ 1 ], p[ 2 ], p[ 3 ] ); - return -1; - } - } - inPtr += paramSize; - outPtr += destStride; - } - - free( outData ); - - return 0; -} - -int test_explicit_s2v_function_set(cl_device_id deviceID, cl_context context, cl_command_queue queue, ExplicitType srcType, - unsigned int count, void *inputData ) -{ - unsigned int sizes[] = { 2, 4, 8, 16, 0 }; - int i, dstType, failed = 0; - - - for( dstType = kBool; dstType < kNumExplicitTypes; dstType++ ) - { - if( dstType == kDouble && !is_extension_available( deviceID, "cl_khr_fp64" ) ) - continue; - - if (( dstType == kLong || dstType == kULong ) && !gHasLong ) - continue; - - for( i = 0; sizes[i] != 0; i++ ) - { - if( dstType != srcType ) - continue; - if( strchr( get_explicit_type_name( (ExplicitType)srcType ), ' ' ) != NULL || - strchr( get_explicit_type_name( (ExplicitType)dstType ), ' ' ) != NULL ) - continue; - - if( test_explicit_s2v_function( deviceID, context, queue, kernel_explicit_s2v_set[ srcType ][ dstType ][ i ], - srcType, count, (ExplicitType)dstType, sizes[ i ], inputData ) != 0 ) - { - log_error( "ERROR: Explicit cast of scalar %s to vector %s%d FAILED; skipping other %s vector tests\n", - get_explicit_type_name(srcType), get_explicit_type_name((ExplicitType)dstType), sizes[i], get_explicit_type_name((ExplicitType)dstType) ); - failed = -1; - break; - } - } - } - - return failed; -} - -int test_explicit_s2v_bool(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - log_info( "NOTE: Boolean vectors not defined in OpenCL 1.0. Skipping test.\n" ); - return 0; -#if 0 - bool data[128]; - - generate_random_data( kBool, 128, data ); - - return test_explicit_s2v_function_set( deviceID, context, queue, kBool, 128, data ); -#endif -} - -int test_explicit_s2v_char(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - char data[128]; - RandomSeed seed(gRandomSeed); - - generate_random_data( kChar, 128, seed, data ); - - return test_explicit_s2v_function_set( deviceID, context, queue, kChar, 128, data ); -} - -int test_explicit_s2v_uchar(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - unsigned char data[128]; - RandomSeed seed(gRandomSeed); - - generate_random_data( kUChar, 128, seed, data ); - - if( test_explicit_s2v_function_set( deviceID, context, queue, kUChar, 128, data ) != 0 ) - return -1; - if( test_explicit_s2v_function_set( deviceID, context, queue, kUnsignedChar, 128, data ) != 0 ) - return -1; - return 0; -} - -int test_explicit_s2v_short(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - short data[128]; - RandomSeed seed(gRandomSeed); - - generate_random_data( kShort, 128, seed, data ); - - if( test_explicit_s2v_function_set( deviceID, context, queue, kShort, 128, data ) != 0 ) - return -1; - return 0; -} - -int test_explicit_s2v_ushort(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - unsigned short data[128]; - RandomSeed seed(gRandomSeed); - - generate_random_data( kUShort, 128, seed, data ); - - if( test_explicit_s2v_function_set( deviceID, context, queue, kUShort, 128, data ) != 0 ) - return -1; - if( test_explicit_s2v_function_set( deviceID, context, queue, kUnsignedShort, 128, data ) != 0 ) - return -1; - return 0; -} - -int test_explicit_s2v_int(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int data[128]; - RandomSeed seed(gRandomSeed); - - generate_random_data( kInt, 128, seed, data ); - - if( test_explicit_s2v_function_set( deviceID, context, queue, kInt, 128, data ) != 0 ) - return -1; - return 0; -} - -int test_explicit_s2v_uint(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - unsigned int data[128]; - RandomSeed seed(gRandomSeed); - - generate_random_data( kUInt, 128, seed, data ); - - if( test_explicit_s2v_function_set( deviceID, context, queue, kUInt, 128, data ) != 0 ) - return -1; - if( test_explicit_s2v_function_set( deviceID, context, queue, kUnsignedInt, 128, data ) != 0 ) - return -1; - return 0; -} - -int test_explicit_s2v_long(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - cl_long data[128]; - RandomSeed seed(gRandomSeed); - - generate_random_data( kLong, 128, seed, data ); - - if( test_explicit_s2v_function_set( deviceID, context, queue, kLong, 128, data ) != 0 ) - return -1; - return 0; -} - -int test_explicit_s2v_ulong(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - cl_ulong data[128]; - RandomSeed seed(gRandomSeed); - - generate_random_data( kULong, 128, seed, data ); - - if( test_explicit_s2v_function_set( deviceID, context, queue, kULong, 128, data ) != 0 ) - return -1; - if( test_explicit_s2v_function_set( deviceID, context, queue, kUnsignedLong, 128, data ) != 0 ) - return -1; - return 0; -} - -int test_explicit_s2v_float(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - float data[128]; - RandomSeed seed(gRandomSeed); - - generate_random_data( kFloat, 128, seed, data ); - - if( test_explicit_s2v_function_set( deviceID, context, queue, kFloat, 128, data ) != 0 ) - return -1; - return 0; -} - - -int test_explicit_s2v_double(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - double data[128]; - RandomSeed seed(gRandomSeed); - - if( !is_extension_available( deviceID, "cl_khr_fp64" ) ) { - log_info("Extension cl_khr_fp64 not supported. Skipping test.\n"); - return 0; - } - - generate_random_data( kDouble, 128, seed, data ); - - if( test_explicit_s2v_function_set( deviceID, context, queue, kDouble, 128, data ) != 0 ) - return -1; - return 0; -} - - diff --git a/test_conformance/compatibility/test_conformance/basic/test_float2int.c b/test_conformance/compatibility/test_conformance/basic/test_float2int.c deleted file mode 100644 index 0191ceec..00000000 --- a/test_conformance/compatibility/test_conformance/basic/test_float2int.c +++ /dev/null @@ -1,160 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - - -#include "procs.h" - -const char *float2int_kernel_code = -"__kernel void test_float2int(__global float *src, __global int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = (int)src[tid];\n" -"\n" -"}\n"; - - -int -verify_float2int(cl_float *inptr, cl_int *outptr, int n) -{ - int i; - - for (i=0; i -#include -#include -#include -#include "../../test_common/harness/rounding_mode.h" - -#include "procs.h" - -const char *fpadd_kernel_code = -"__kernel void test_fpadd(__global float *srcA, __global float *srcB, __global float *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] + srcB[tid];\n" -"}\n"; - -const char *fpsub_kernel_code = -"__kernel void test_fpsub(__global float *srcA, __global float *srcB, __global float *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] - srcB[tid];\n" -"}\n"; - -const char *fpmul_kernel_code = -"__kernel void test_fpmul(__global float *srcA, __global float *srcB, __global float *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid];\n" -"}\n"; - - -static const float MAX_ERR = 1e-5f; - -int -verify_fpadd(float *inptrA, float *inptrB, float *outptr, int n) -{ - float r; - int i; - - for (i=0; i -#include -#include -#include -#include "../../test_common/harness/rounding_mode.h" - - -#include "procs.h" - -const char *fpadd2_kernel_code = -"__kernel void test_fpadd2(__global float2 *srcA, __global float2 *srcB, __global float2 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] + srcB[tid];\n" -"}\n"; - -const char *fpsub2_kernel_code = -"__kernel void test_fpsub2(__global float2 *srcA, __global float2 *srcB, __global float2 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] - srcB[tid];\n" -"}\n"; - -const char *fpmul2_kernel_code = -"__kernel void test_fpmul2(__global float2 *srcA, __global float2 *srcB, __global float2 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid];\n" -"}\n"; - - -int -verify_fpadd2(float *inptrA, float *inptrB, float *outptr, int n) -{ - float r; - int i; - - for (i=0; i -#include -#include -#include - - -#include "procs.h" -#include "../../test_common/harness/rounding_mode.h" - -const char *fpadd4_kernel_code = -"__kernel void test_fpadd4(__global float4 *srcA, __global float4 *srcB, __global float4 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] + srcB[tid];\n" -"}\n"; - -const char *fpsub4_kernel_code = -"__kernel void test_fpsub4(__global float4 *srcA, __global float4 *srcB, __global float4 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] - srcB[tid];\n" -"}\n"; - -const char *fpmul4_kernel_code = -"__kernel void test_fpmul4(__global float4 *srcA, __global float4 *srcB, __global float4 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid];\n" -"}\n"; - - -int -verify_fpadd4(float *inptrA, float *inptrB, float *outptr, int n) -{ - float r; - int i; - - for (i=0; i - - -const char *work_offset_test[] = { - "__kernel void test( __global int * outputID_A, \n" - " __global int * outputID_B, __global int * outputID_C )\n" - "{\n" - " size_t id0 = get_local_id( 0 ) + get_group_id( 0 ) * get_local_size( 0 );\n" - " size_t id1 = get_local_id( 1 ) + get_group_id( 1 ) * get_local_size( 1 );\n" - " size_t id2 = get_local_id( 2 ) + get_group_id( 2 ) * get_local_size( 2 );\n" - " size_t id = ( id2 * get_global_size( 0 ) * get_global_size( 1 ) ) + ( id1 * get_global_size( 0 ) ) + id0;\n" - "\n" - " outputID_A[ id ] = get_global_id( 0 );\n" - " outputID_B[ id ] = get_global_id( 1 );\n" - " outputID_C[ id ] = get_global_id( 2 );\n" - "}\n" - }; - -#define MAX_TEST_ITEMS 16 * 16 * 16 -#define NUM_TESTS 16 -#define MAX_OFFSET 256 - -#define CHECK_RANGE( v, m, c ) \ - if( ( v >= (cl_int)m ) || ( v < 0 ) ) \ - { \ - log_error( "ERROR: ouputID_%c[%lu]: %d is < 0 or >= %lu\n", c, i, v, m ); \ - return -1; \ - } - -int check_results( size_t threads[], size_t offsets[], cl_int outputA[], cl_int outputB[], cl_int outputC[] ) -{ - size_t offsettedSizes[ 3 ] = { threads[ 0 ] + offsets[ 0 ], threads[ 1 ] + offsets[ 1 ], threads[ 2 ] + offsets[ 2 ] }; - size_t limit = threads[ 0 ] * threads[ 1 ] * threads[ 2 ]; - - static char counts[ MAX_OFFSET + 32 ][ MAX_OFFSET + 16 ][ MAX_OFFSET + 16 ]; - memset( counts, 0, sizeof( counts ) ); - - for( size_t i = 0; i < limit; i++ ) - { - // Check ranges first - CHECK_RANGE( outputA[ i ], offsettedSizes[ 0 ], 'A' ) - CHECK_RANGE( outputB[ i ], offsettedSizes[ 1 ], 'B' ) - CHECK_RANGE( outputC[ i ], offsettedSizes[ 2 ], 'C' ) - - // Now set the value in the map - counts[ outputA[ i ] ][ outputB[ i ] ][ outputC[ i ] ]++; - } - - // Now check the map - int missed = 0, multiple = 0, errored = 0, corrected = 0; - for( size_t x = 0; x < offsettedSizes[ 0 ]; x++ ) - { - for( size_t y = 0; y < offsettedSizes[ 1 ]; y++ ) - { - for( size_t z = 0; z < offsettedSizes[ 2 ]; z++ ) - { - const char * limitMsg = " (further errors of this type suppressed)"; - if( ( x >= offsets[ 0 ] ) && ( y >= offsets[ 1 ] ) && ( z >= offsets[ 2 ] ) ) - { - if( counts[ x ][ y ][ z ] < 1 ) - { - if( missed < 3 ) - log_error( "ERROR: Map value (%ld,%ld,%ld) was missed%s\n", x, y, z, ( missed == 2 ) ? limitMsg : "" ); - missed++; - } - else if( counts[ x ][ y ][ z ] > 1 ) - { - if( multiple < 3 ) - log_error( "ERROR: Map value (%ld,%ld,%ld) was returned multiple times%s\n", x, y, z, ( multiple == 2 ) ? limitMsg : "" ); - multiple++; - } - } - else - { - if( counts[ x ][ y ][ z ] > 0 ) - { - if( errored < 3 ) - log_error( "ERROR: Map value (%ld,%ld,%ld) was erroneously returned%s\n", x, y, z, ( errored == 2 ) ? limitMsg : "" ); - errored++; - } - } - } - } - } - - if( missed || multiple || errored ) - { - size_t diffs[3] = { ( offsets[ 0 ] > threads[ 0 ] ? 0 : threads[ 0 ] - offsets[ 0 ] ), - ( offsets[ 1 ] > threads[ 1 ] ? 0 : threads[ 1 ] - offsets[ 1 ] ), - ( offsets[ 2 ] > threads[ 2 ] ? 0 : threads[ 2 ] - offsets[ 2 ] ) }; - int diff = (int)( ( threads[ 0 ] - diffs[ 0 ] ) * ( threads[ 1 ] - diffs[ 1 ] ) * ( threads[ 2 ] - diffs[ 2 ] ) ); - - if( ( multiple == 0 ) && ( missed == diff ) && ( errored == diff ) ) - log_error( "ERROR: Global work offset values are not being respected by get_global_id()\n" ); - else - log_error( "ERROR: Global work offset values did not function as expected (%d missed, %d reported multiple times, %d erroneously hit)\n", - missed, multiple, errored ); - } - return ( missed | multiple | errored | corrected ); -} - -int test_global_work_offsets(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - clProgramWrapper program; - clKernelWrapper kernel; - clMemWrapper streams[ 7 ]; - - int error; - size_t threads[] = {1,1,1}, localThreads[] = {1,1,1}, offsets[] = {0,0,0}; - cl_int outputA[ MAX_TEST_ITEMS ], outputB[ MAX_TEST_ITEMS ], outputC[ MAX_TEST_ITEMS ]; - - - // Create the kernel - if( create_single_kernel_helper( context, &program, &kernel, 1, work_offset_test, "test" ) != 0 ) - { - return -1; - } - - //// Create some output streams - - // Use just one output array to init them all (no need to init every single stack storage here) - memset( outputA, 0xff, sizeof( outputA ) ); - for( int i = 0; i < 3; i++ ) - { - streams[ i ] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR), sizeof(outputA), outputA, &error ); - test_error( error, "Unable to create output array" ); - } - - // Run a few different times - MTdata seed = init_genrand( gRandomSeed ); - for( int test = 0; test < NUM_TESTS; test++ ) - { - // Choose a random combination of thread size, but in total less than MAX_TEST_ITEMS - threads[ 0 ] = random_in_range( 1, 32, seed ); - threads[ 1 ] = random_in_range( 1, 16, seed ); - threads[ 2 ] = random_in_range( 1, MAX_TEST_ITEMS / (int)( threads[ 0 ] * threads[ 1 ] ), seed ); - - // Make sure we get the local thread count right - error = get_max_common_3D_work_group_size( context, kernel, threads, localThreads ); - test_error( error, "Unable to determine local work group sizes" ); - - // Randomize some offsets - for( int j = 0; j < 3; j++ ) - offsets[ j ] = random_in_range( 0, MAX_OFFSET, seed ); - - log_info( "\tTesting %ld,%ld,%ld (%ld,%ld,%ld) with offsets (%ld,%ld,%ld)...\n", - threads[ 0 ], threads[ 1 ], threads[ 2 ], localThreads[ 0 ], localThreads[ 1 ], localThreads[ 2 ], - offsets[ 0 ], offsets[ 1 ], offsets[ 2 ] ); - - // Now set up and run - for( int i = 0; i < 3; i++ ) - { - error = clSetKernelArg( kernel, i, sizeof( streams[i] ), &streams[i] ); - test_error( error, "Unable to set indexed kernel arguments" ); - } - - error = clEnqueueNDRangeKernel( queue, kernel, 3, offsets, threads, localThreads, 0, NULL, NULL ); - test_error( error, "Kernel execution failed" ); - - // Read our results back now - cl_int * resultBuffers[] = { outputA, outputB, outputC }; - for( int i = 0; i < 3; i++ ) - { - error = clEnqueueReadBuffer( queue, streams[ i ], CL_TRUE, 0, sizeof( outputA ), resultBuffers[ i ], 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - } - - // Now we need to check the results. The outputs should have one entry for each possible ID, - // but they won't be in order, so we need to construct a count map to determine what we got - if( check_results( threads, offsets, outputA, outputB, outputC ) ) - { - log_error( "\t(Test failed for global dim %ld,%ld,%ld, local dim %ld,%ld,%ld, offsets %ld,%ld,%ld)\n", - threads[ 0 ], threads[ 1 ], threads[ 2 ], localThreads[ 0 ], localThreads[ 1 ], localThreads[ 2 ], - offsets[ 0 ], offsets[ 1 ], offsets[ 2 ] ); - return -1; - } - } - - free_mtdata(seed); - - // All done! - return 0; -} - -const char *get_offset_test[] = { - "__kernel void test( __global int * outOffsets )\n" - "{\n" - " // We use local ID here so we don't have to worry about offsets\n" - " // Also note that these should be the same for ALL threads, so we won't worry about contention\n" - " outOffsets[ 0 ] = (int)get_global_offset( 0 );\n" - " outOffsets[ 1 ] = (int)get_global_offset( 1 );\n" - " outOffsets[ 2 ] = (int)get_global_offset( 2 );\n" - "}\n" -}; - -int test_get_global_offset(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - clProgramWrapper program; - clKernelWrapper kernel; - clMemWrapper streams[ 1 ]; - - int error; - size_t threads[] = {1,1,1}, localThreads[] = {1,1,1}, offsets[] = {0,0,0}; - cl_int outOffsets[ 3 ]; - - - // Create the kernel - if( create_single_kernel_helper( context, &program, &kernel, 1, get_offset_test, "test" ) != 0 ) - { - return -1; - } - - // Create some output streams, and storage for a single control ID - memset( outOffsets, 0xff, sizeof( outOffsets ) ); - streams[0] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR), sizeof( outOffsets ), outOffsets, &error ); - test_error( error, "Unable to create control ID buffer" ); - - // Run a few different times - MTdata seed = init_genrand( gRandomSeed ); - for( int test = 0; test < NUM_TESTS; test++ ) - { - // Choose a random combination of thread size, but in total less than MAX_TEST_ITEMS - threads[ 0 ] = random_in_range( 1, 32, seed ); - threads[ 1 ] = random_in_range( 1, 16, seed ); - threads[ 2 ] = random_in_range( 1, MAX_TEST_ITEMS / (int)( threads[ 0 ] * threads[ 1 ] ), seed ); - - // Make sure we get the local thread count right - error = get_max_common_3D_work_group_size( context, kernel, threads, localThreads ); - test_error( error, "Unable to determine local work group sizes" ); - - // Randomize some offsets - for( int j = 0; j < 3; j++ ) - offsets[ j ] = random_in_range( 0, MAX_OFFSET, seed ); - - log_info( "\tTesting %ld,%ld,%ld (%ld,%ld,%ld) with offsets (%ld,%ld,%ld)...\n", - threads[ 0 ], threads[ 1 ], threads[ 2 ], localThreads[ 0 ], localThreads[ 1 ], localThreads[ 2 ], - offsets[ 0 ], offsets[ 1 ], offsets[ 2 ] ); - - // Now set up and run - error = clSetKernelArg( kernel, 0, sizeof( streams[0] ), &streams[0] ); - test_error( error, "Unable to set indexed kernel arguments" ); - - error = clEnqueueNDRangeKernel( queue, kernel, 3, offsets, threads, localThreads, 0, NULL, NULL ); - test_error( error, "Kernel execution failed" ); - - // Read our results back now - error = clEnqueueReadBuffer( queue, streams[ 0 ], CL_TRUE, 0, sizeof( outOffsets ), outOffsets, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - - // And check! - int errors = 0; - for( int j = 0; j < 3; j++ ) - { - if( outOffsets[ j ] != (cl_int)offsets[ j ] ) - { - log_error( "ERROR: get_global_offset( %d ) did not return expected value (expected %ld, got %d)\n", j, offsets[ j ], outOffsets[ j ] ); - errors++; - } - } - if( errors > 0 ) - return errors; - } - free_mtdata(seed); - - // All done! - return 0; -} - diff --git a/test_conformance/compatibility/test_conformance/basic/test_hiloeo.c b/test_conformance/compatibility/test_conformance/basic/test_hiloeo.c deleted file mode 100644 index 72e97cee..00000000 --- a/test_conformance/compatibility/test_conformance/basic/test_hiloeo.c +++ /dev/null @@ -1,421 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include -#include - - -#include "procs.h" - -int hi_offset( int index, int vectorSize) { return index + vectorSize / 2; } -int lo_offset( int index, int vectorSize) { return index; } -int even_offset( int index, int vectorSize ) { return index * 2; } -int odd_offset( int index, int vectorSize ) { return index * 2 + 1; } - -typedef int (*OffsetFunc)( int index, int vectorSize ); -static const OffsetFunc offsetFuncs[4] = { hi_offset, lo_offset, even_offset, odd_offset }; -typedef int (*verifyFunc)( const void *, const void *, const void *, int n, const char *sizeName ); -static const char *operatorToUse_names[] = { "hi", "lo", "even", "odd" }; -static const char *test_str_names[] = { "char", "uchar", "short", "ushort", "int", "uint", "long", "ulong", "float", "double" }; - -static const unsigned int vector_sizes[] = { 1, 2, 3, 4, 8, 16}; -static const unsigned int vector_aligns[] = { 1, 2, 4, 4, 8, 16}; -static const unsigned int out_vector_idx[] = { 0, 0, 1, 1, 3, 4}; -// if input is size vector_sizes[i], output is size -// vector_sizes[out_vector_idx[i]] -// input type name is strcat(gentype, vector_size_names[i]); -// and output type name is -// strcat(gentype, vector_size_names[out_vector_idx[i]]); -static const int size_to_idx[] = {-1,0,1,2,3,-1,-1,-1,4, - -1,-1,-1,-1,-1,-1,-1,5}; -static const char *vector_size_names[] = { "", "2", "3", "4", "8", "16"}; - -static const size_t kSizes[] = { 1, 1, 2, 2, 4, 4, 8, 8, 4, 8 }; -static int CheckResults( void *in, void *out, size_t elementCount, int type, int vectorSize, int operatorToUse ); - -int test_hiloeo(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems) -{ - cl_int *input_ptr, *output_ptr, *p; - int err; - cl_uint i; - int hasDouble = is_extension_available( device, "cl_khr_fp64" ); - cl_uint vectorSize, operatorToUse; - cl_uint type; - MTdata d; - - int expressionMode; - int numExpressionModes = 2; - - size_t length = sizeof(cl_int) * 4 * n_elems; - - input_ptr = (cl_int*)malloc(length); - output_ptr = (cl_int*)malloc(length); - - p = input_ptr; - d = init_genrand( gRandomSeed ); - for (i=0; i<4 * (cl_uint) n_elems; i++) - p[i] = genrand_int32(d); - free_mtdata(d); d = NULL; - - for( type = 0; type < sizeof( test_str_names ) / sizeof( test_str_names[0] ); type++ ) - { - // Note: restrict the element count here so we don't end up overrunning the output buffer if we're compensating for 32-bit writes - size_t elementCount = length / kSizes[type]; - cl_mem streams[2]; - - // skip double if unavailable - if( !hasDouble && ( 0 == strcmp( test_str_names[type], "double" ))) - continue; - - if( !gHasLong && - ( 0 == strcmp( test_str_names[type], "long" )) && - ( 0 == strcmp( test_str_names[type], "ulong" ))) - continue; - - log_info( "%s", test_str_names[type] ); - fflush( stdout ); - - // Set up data streams for the type - streams[0] = clCreateBuffer(context, CL_MEM_READ_WRITE, length, NULL, NULL); - if (!streams[0]) - { - log_error("clCreateBuffer failed\n"); - return -1; - } - streams[1] = clCreateBuffer(context, CL_MEM_READ_WRITE, length, NULL, NULL); - if (!streams[1]) - { - log_error("clCreateBuffer failed\n"); - return -1; - } - - err = clEnqueueWriteBuffer(queue, streams[0], CL_TRUE, 0, length, input_ptr, 0, NULL, NULL); - if (err != CL_SUCCESS) - { - log_error("clEnqueueWriteBuffer failed\n"); - return -1; - } - - for( operatorToUse = 0; operatorToUse < sizeof( operatorToUse_names ) / sizeof( operatorToUse_names[0] ); operatorToUse++ ) - { - log_info( " %s", operatorToUse_names[ operatorToUse ] ); - fflush( stdout ); - for( vectorSize = 1; vectorSize < sizeof( vector_size_names ) / sizeof( vector_size_names[0] ); vectorSize++ ) { - for(expressionMode = 0; expressionMode < numExpressionModes; ++expressionMode) { - - cl_program program = NULL; - cl_kernel kernel = NULL; - cl_uint outVectorSize = out_vector_idx[vectorSize]; - char expression[1024]; - - const char *source[] = { - "", // optional pragma string - "__kernel void test_", operatorToUse_names[ operatorToUse ], "_", test_str_names[type], vector_size_names[vectorSize], - "(__global ", test_str_names[type], vector_size_names[vectorSize], - " *srcA, __global ", test_str_names[type], vector_size_names[outVectorSize], - " *dst)\n" - "{\n" - " int tid = get_global_id(0);\n" - "\n" - " ", test_str_names[type], - vector_size_names[out_vector_idx[vectorSize]], - " tmp = ", expression, ".", operatorToUse_names[ operatorToUse ], ";\n" - " dst[tid] = tmp;\n" - "}\n" - }; - - if(expressionMode == 0) { - sprintf(expression, "srcA[tid]"); - } else if(expressionMode == 1) { - switch(vector_sizes[vectorSize]) { - case 16: - sprintf(expression, - "((%s16)(srcA[tid].s0, srcA[tid].s1, srcA[tid].s2, srcA[tid].s3, srcA[tid].s4, srcA[tid].s5, srcA[tid].s6, srcA[tid].s7, srcA[tid].s8, srcA[tid].s9, srcA[tid].sA, srcA[tid].sB, srcA[tid].sC, srcA[tid].sD, srcA[tid].sE, srcA[tid].sf))", - test_str_names[type] - ); - break; - case 8: - sprintf(expression, - "((%s8)(srcA[tid].s0, srcA[tid].s1, srcA[tid].s2, srcA[tid].s3, srcA[tid].s4, srcA[tid].s5, srcA[tid].s6, srcA[tid].s7))", - test_str_names[type] - ); - break; - case 4: - sprintf(expression, - "((%s4)(srcA[tid].s0, srcA[tid].s1, srcA[tid].s2, srcA[tid].s3))", - test_str_names[type] - ); - break; - case 3: - sprintf(expression, - "((%s3)(srcA[tid].s0, srcA[tid].s1, srcA[tid].s2))", - test_str_names[type] - ); - break; - case 2: - sprintf(expression, - "((%s2)(srcA[tid].s0, srcA[tid].s1))", - test_str_names[type] - ); - break; - default : - sprintf(expression, "srcA[tid]"); - log_info("Default\n"); - } - } else { - sprintf(expression, "srcA[tid]"); - } - - if (0 == strcmp( test_str_names[type], "double" )) - source[0] = "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n"; - - char kernelName[128]; - snprintf( kernelName, sizeof( kernelName ), "test_%s_%s%s", operatorToUse_names[ operatorToUse ], test_str_names[type], vector_size_names[vectorSize] ); - err = create_single_kernel_helper(context, &program, &kernel, sizeof( source ) / sizeof( source[0] ), source, kernelName ); - if (err) - return -1; - - err = clSetKernelArg(kernel, 0, sizeof streams[0], &streams[0]); - err |= clSetKernelArg(kernel, 1, sizeof streams[1], &streams[1]); - if (err != CL_SUCCESS) - { - log_error("clSetKernelArgs failed\n"); - return -1; - } - - //Wipe the output buffer clean - uint32_t pattern = 0xdeadbeef; - memset_pattern4( output_ptr, &pattern, length ); - err = clEnqueueWriteBuffer(queue, streams[1], CL_TRUE, 0, length, output_ptr, 0, NULL, NULL); - if (err != CL_SUCCESS) - { - log_error("clEnqueueWriteBuffer failed\n"); - return -1; - } - - size_t size = elementCount / (vector_aligns[vectorSize]); - err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &size, NULL, 0, NULL, NULL); - if (err != CL_SUCCESS) - { - log_error("clEnqueueNDRangeKernel failed\n"); - return -1; - } - - err = clEnqueueReadBuffer(queue, streams[1], CL_TRUE, 0, length, output_ptr, 0, NULL, NULL); - if (err != CL_SUCCESS) - { - log_error("clEnqueueReadBuffer failed\n"); - return -1; - } - - char *inP = (char *)input_ptr; - char *outP = (char *)output_ptr; - outP += kSizes[type] * ( ( vector_sizes[outVectorSize] ) - - ( vector_sizes[ out_vector_idx[vectorSize] ] ) ); - // was outP += kSizes[type] * ( ( 1 << outVectorSize ) - ( 1 << ( vectorSize - 1 ) ) ); - for( size_t e = 0; e < size; e++ ) - { - if( CheckResults( inP, outP, 1, type, vectorSize, operatorToUse ) ) { - - log_info("e is %d\n", (int)e); - fflush(stdout); - // break; - return -1; - } - inP += kSizes[type] * ( vector_aligns[vectorSize] ); - outP += kSizes[type] * ( vector_aligns[outVectorSize] ); - } - - clReleaseKernel( kernel ); - clReleaseProgram( program ); - log_info( "." ); - fflush( stdout ); - } - } - } - - clReleaseMemObject( streams[0] ); - clReleaseMemObject( streams[1] ); - log_info( "done\n" ); - } - - log_info("HiLoEO test passed\n"); - - free(input_ptr); - free(output_ptr); - - return err; -} - -static int CheckResults( void *in, void *out, size_t elementCount, int type, int vectorSize, int operatorToUse ) -{ - cl_ulong array[8]; - void *p = array; - size_t halfVectorSize = vector_sizes[out_vector_idx[vectorSize]]; - size_t cmpVectorSize = vector_sizes[out_vector_idx[vectorSize]]; - // was 1 << (vectorSize-1); - OffsetFunc f = offsetFuncs[ operatorToUse ]; - size_t elementSize = kSizes[type]; - - if(vector_size_names[vectorSize][0] == '3') { - if(operatorToUse_names[operatorToUse][0] == 'h' || - operatorToUse_names[operatorToUse][0] == 'o') // hi or odd - { - cmpVectorSize = 1; // special case for vec3 ignored values - } - } - - switch( elementSize ) - { - case 1: - { - char *i = (char*)in; - char *o = (char*)out; - size_t j; - cl_uint k; - OffsetFunc f = offsetFuncs[ operatorToUse ]; - - for( k = 0; k < elementCount; k++ ) - { - char *o2 = (char*)p; - for( j = 0; j < halfVectorSize; j++ ) - o2[j] = i[ f((int)j, (int)halfVectorSize*2) ]; - - if( memcmp( o, o2, elementSize * cmpVectorSize ) ) - { - log_info( "\n%d) Failure for %s%s.%s { %d", k, test_str_names[type], vector_size_names[ vectorSize ], operatorToUse_names[ operatorToUse ], i[0] ); - for( j = 1; j < halfVectorSize * 2; j++ ) - log_info( ", %d", i[j] ); - log_info( " } --> { %d", o[0] ); - for( j = 1; j < halfVectorSize; j++ ) - log_info( ", %d", o[j] ); - log_info( " }\n" ); - return -1; - } - i += 2 * halfVectorSize; - o += halfVectorSize; - } - } - break; - - case 2: - { - short *i = (short*)in; - short *o = (short*)out; - size_t j; - cl_uint k; - - for( k = 0; k < elementCount; k++ ) - { - short *o2 = (short*)p; - for( j = 0; j < halfVectorSize; j++ ) - o2[j] = i[ f((int)j, (int)halfVectorSize*2) ]; - - if( memcmp( o, o2, elementSize * cmpVectorSize ) ) - { - log_info( "\n%d) Failure for %s%s.%s { %d", k, test_str_names[type], vector_size_names[ vectorSize ], operatorToUse_names[ operatorToUse ], i[0] ); - for( j = 1; j < halfVectorSize * 2; j++ ) - log_info( ", %d", i[j] ); - log_info( " } --> { %d", o[0] ); - for( j = 1; j < halfVectorSize; j++ ) - log_info( ", %d", o[j] ); - log_info( " }\n" ); - return -1; - } - i += 2 * halfVectorSize; - o += halfVectorSize; - } - } - break; - - case 4: - { - int *i = (int*)in; - int *o = (int*)out; - size_t j; - cl_uint k; - - for( k = 0; k < elementCount; k++ ) - { - int *o2 = (int *)p; - for( j = 0; j < halfVectorSize; j++ ) - o2[j] = i[ f((int)j, (int)halfVectorSize*2) ]; - - for( j = 0; j < cmpVectorSize; j++ ) - { - /* Allow float nans to be binary different */ - if( memcmp( &o[j], &o2[j], elementSize ) && !((strcmp(test_str_names[type], "float") == 0) && isnan(((float *)o)[j]) && isnan(((float *)o2)[j]))) - { - log_info( "\n%d) Failure for %s%s.%s { 0x%8.8x", k, test_str_names[type], vector_size_names[ vectorSize ], operatorToUse_names[ operatorToUse ], i[0] ); - for( j = 1; j < halfVectorSize * 2; j++ ) - log_info( ", 0x%8.8x", i[j] ); - log_info( " } --> { 0x%8.8x", o[0] ); - for( j = 1; j < halfVectorSize; j++ ) - log_info( ", 0x%8.8x", o[j] ); - log_info( " }\n" ); - return -1; - } - } - i += 2 * halfVectorSize; - o += halfVectorSize; - } - } - break; - - case 8: - { - cl_ulong *i = (cl_ulong*)in; - cl_ulong *o = (cl_ulong*)out; - size_t j; - cl_uint k; - - for( k = 0; k < elementCount; k++ ) - { - cl_ulong *o2 = (cl_ulong*)p; - for( j = 0; j < halfVectorSize; j++ ) - o2[j] = i[ f((int)j, (int)halfVectorSize*2) ]; - - if( memcmp( o, o2, elementSize * cmpVectorSize ) ) - { - log_info( "\n%d) Failure for %s%s.%s { 0x%16.16llx", k, test_str_names[type], vector_size_names[ vectorSize ], operatorToUse_names[ operatorToUse ], i[0] ); - for( j = 1; j < halfVectorSize * 2; j++ ) - log_info( ", 0x%16.16llx", i[j] ); - log_info( " } --> { 0x%16.16llx", o[0] ); - for( j = 1; j < halfVectorSize; j++ ) - log_info( ", 0x%16.16llx", o[j] ); - log_info( " }\n" ); - return -1; - } - i += 2 * halfVectorSize; - o += halfVectorSize; - } - } - break; - - default: - log_info( "Internal error. Unknown data type\n" ); - return -2; - } - - return 0; -} - - - diff --git a/test_conformance/compatibility/test_conformance/basic/test_hostptr.c b/test_conformance/compatibility/test_conformance/basic/test_hostptr.c deleted file mode 100644 index fed42ff0..00000000 --- a/test_conformance/compatibility/test_conformance/basic/test_hostptr.c +++ /dev/null @@ -1,276 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - - -#include "procs.h" - -const char *hostptr_kernel_code = -"__kernel void test_hostptr(__global float *srcA, __global float *srcB, __global float *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] + srcB[tid];\n" -"}\n"; - -static const float MAX_ERR = 1e-5f; - -static int verify_hostptr(cl_float *inptrA, cl_float *inptrB, cl_float *outptr, int n) -{ - cl_float r; - int i; - - for (i=0; i -#include -#include -#include - - -#include "procs.h" - -const char *conditional_kernel_code = -"__kernel void test_if(__global int *src, __global int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" if (src[tid] == 0)\n" -" dst[tid] = 0x12345678;\n" -" else if (src[tid] == 1)\n" -" dst[tid] = 0x23456781;\n" -" else if (src[tid] == 2)\n" -" dst[tid] = 0x34567812;\n" -" else if (src[tid] == 3)\n" -" dst[tid] = 0x45678123;\n" -" else if (src[tid] == 4)\n" -" dst[tid] = 0x56781234;\n" -" else if (src[tid] == 5)\n" -" dst[tid] = 0x67812345;\n" -" else if (src[tid] == 6)\n" -" dst[tid] = 0x78123456;\n" -" else if (src[tid] == 7)\n" -" dst[tid] = 0x81234567;\n" -" else\n" -" dst[tid] = 0x7FFFFFFF;\n" -"\n" -"}\n"; - -const int results[] = { - 0x12345678, - 0x23456781, - 0x34567812, - 0x45678123, - 0x56781234, - 0x67812345, - 0x78123456, - 0x81234567, -}; - -int -verify_if(int *inptr, int *outptr, int n) -{ - int r, i; - - for (i=0; i -#include -#include -#include - - -#include "procs.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/imageHelpers.h" -#include "../../test_common/harness/conversions.h" - - -static const char *param_kernel[] = { -"__kernel void test_fn(read_only image2d_t srcimg, sampler_t sampler, __global float4 *results )\n" -"{\n" -" int tid_x = get_global_id(0);\n" -" int tid_y = get_global_id(1);\n" -" results[ tid_y * get_image_width( srcimg ) + tid_x ] = read_imagef(srcimg, sampler, (int2)(tid_x, tid_y));\n" -"\n" -"}\n" }; - -int validate_results( size_t width, size_t height, cl_image_format &format, char *inputData, cl_float *actualResults ) -{ - for( size_t i = 0; i < width * height; i++ ) - { - cl_float expected[ 4 ], tolerance; - - switch( format.image_channel_data_type ) - { - case CL_UNORM_INT8: - { - cl_uchar *p = (cl_uchar *)inputData; - expected[ 0 ] = p[ 0 ] / 255.f; - expected[ 1 ] = p[ 1 ] / 255.f; - expected[ 2 ] = p[ 2 ] / 255.f; - expected[ 3 ] = p[ 3 ] / 255.f; - tolerance = 1.f / 255.f; - break; - } - case CL_SNORM_INT8: - { - cl_char *p = (cl_char *)inputData; - expected[ 0 ] = fmaxf( p[ 0 ] / 127.f, -1.f ); - expected[ 1 ] = fmaxf( p[ 1 ] / 127.f, -1.f ); - expected[ 2 ] = fmaxf( p[ 2 ] / 127.f, -1.f ); - expected[ 3 ] = fmaxf( p[ 3 ] / 127.f, -1.f ); - tolerance = 1.f / 127.f; - break; - } - case CL_UNSIGNED_INT8: - { - cl_uchar *p = (cl_uchar *)inputData; - expected[ 0 ] = p[ 0 ]; - expected[ 1 ] = p[ 1 ]; - expected[ 2 ] = p[ 2 ]; - expected[ 3 ] = p[ 3 ]; - tolerance = 1.f / 127.f; - break; - } - case CL_SIGNED_INT8: - { - cl_short *p = (cl_short *)inputData; - expected[ 0 ] = p[ 0 ]; - expected[ 1 ] = p[ 1 ]; - expected[ 2 ] = p[ 2 ]; - expected[ 3 ] = p[ 3 ]; - tolerance = 1.f / 127.f; - break; - } - case CL_UNORM_INT16: - { - cl_ushort *p = (cl_ushort *)inputData; - expected[ 0 ] = p[ 0 ] / 65535.f; - expected[ 1 ] = p[ 1 ] / 65535.f; - expected[ 2 ] = p[ 2 ] / 65535.f; - expected[ 3 ] = p[ 3 ] / 65535.f; - tolerance = 1.f / 65535.f; - break; - } - case CL_UNSIGNED_INT32: - { - cl_uint *p = (cl_uint *)inputData; - expected[ 0 ] = p[ 0 ]; - expected[ 1 ] = p[ 1 ]; - expected[ 2 ] = p[ 2 ]; - expected[ 3 ] = p[ 3 ]; - tolerance = 0.0001f; - break; - } - case CL_FLOAT: - { - cl_float *p = (cl_float *)inputData; - expected[ 0 ] = p[ 0 ]; - expected[ 1 ] = p[ 1 ]; - expected[ 2 ] = p[ 2 ]; - expected[ 3 ] = p[ 3 ]; - tolerance = 0.0001f; - break; - } - default: - // Should never get here - break; - } - - if( format.image_channel_order == CL_BGRA ) - { - cl_float tmp = expected[ 0 ]; - expected[ 0 ] = expected[ 2 ]; - expected[ 2 ] = tmp; - } - - // Within an error tolerance, make sure the results match - cl_float error1 = fabsf( expected[ 0 ] - actualResults[ 0 ] ); - cl_float error2 = fabsf( expected[ 1 ] - actualResults[ 1 ] ); - cl_float error3 = fabsf( expected[ 2 ] - actualResults[ 2 ] ); - cl_float error4 = fabsf( expected[ 3 ] - actualResults[ 3 ] ); - - if( error1 > tolerance || error2 > tolerance || error3 > tolerance || error4 > tolerance ) - { - log_error( "ERROR: Sample %d did not validate against expected results for %d x %d %s:%s image\n", (int)i, (int)width, (int)height, - GetChannelOrderName( format.image_channel_order ), GetChannelTypeName( format.image_channel_data_type ) ); - log_error( " Expected: %f %f %f %f\n", (float)expected[ 0 ], (float)expected[ 1 ], (float)expected[ 2 ], (float)expected[ 3 ] ); - log_error( " Actual: %f %f %f %f\n", (float)actualResults[ 0 ], (float)actualResults[ 1 ], (float)actualResults[ 2 ], (float)actualResults[ 3 ] ); - - // Check real quick a special case error here - cl_float error1 = fabsf( expected[ 3 ] - actualResults[ 0 ] ); - cl_float error2 = fabsf( expected[ 2 ] - actualResults[ 1 ] ); - cl_float error3 = fabsf( expected[ 1 ] - actualResults[ 2 ] ); - cl_float error4 = fabsf( expected[ 0 ] - actualResults[ 3 ] ); - if( error1 <= tolerance && error2 <= tolerance && error3 <= tolerance && error4 <= tolerance ) - { - log_error( "\t(Kernel did not respect change in channel order)\n" ); - } - return -1; - } - - // Increment and go - actualResults += 4; - inputData += get_format_type_size( &format ) * 4; - } - - return 0; -} - -int test_image_param(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) -{ - size_t sizes[] = { 64, 100, 128, 250, 512 }; - cl_image_format formats[] = { { CL_RGBA, CL_UNORM_INT8 }, { CL_RGBA, CL_UNORM_INT16 }, { CL_RGBA, CL_FLOAT }, { CL_BGRA, CL_UNORM_INT8 } }; - ExplicitType types[] = { kUChar, kUShort, kFloat, kUChar }; - int error; - size_t i, j, idx; - size_t threads[ 2 ]; - MTdata d; - - const size_t numSizes = sizeof( sizes ) / sizeof( sizes[ 0 ] ); - const size_t numFormats = sizeof( formats ) / sizeof( formats[ 0 ] ); - const size_t numAttempts = numSizes * numFormats; - - - clProgramWrapper program; - clKernelWrapper kernel; - clMemWrapper streams[ numAttempts ][ 2 ]; - BufferOwningPtr inputs[ numAttempts ]; - - PASSIVE_REQUIRE_IMAGE_SUPPORT( device ) - - d = init_genrand( gRandomSeed ); - for( i = 0, idx = 0; i < numSizes; i++ ) - { - for( j = 0; j < numFormats; j++, idx++ ) - { - // For each attempt, we create a pair: an input image, whose parameters keep changing, and an output buffer - // that we can read values from. The output buffer will remain consistent to ensure that any changes we - // witness are due to the image changes - inputs[ idx ].reset(create_random_data( types[ j ], d, sizes[ i ] * sizes[ i ] * 4 )); - - streams[ idx ][ 0 ] = create_image_2d( context, CL_MEM_COPY_HOST_PTR, &formats[ j ], sizes[ i ], sizes[ i ], 0, inputs[ idx ], &error ); - { - char err_str[256]; - sprintf(err_str, "Unable to create input image for format %s order %s" , - GetChannelOrderName( formats[j].image_channel_order ), - GetChannelTypeName( formats[j].image_channel_data_type )); - test_error( error, err_str); - } - - streams[ idx ][ 1 ] = clCreateBuffer( context, CL_MEM_READ_WRITE, sizes[ i ] * sizes[ i ] * 4 * sizeof( cl_float ), NULL, &error ); - test_error( error, "Unable to create output buffer" ); - } - } - free_mtdata(d); d = NULL; - - // Create a single kernel to use for all the tests - error = create_single_kernel_helper( context, &program, &kernel, 1, param_kernel, "test_fn" ); - test_error( error, "Unable to create testing kernel" ); - - // Also create a sampler to use for all the runs - clSamplerWrapper sampler = clCreateSampler(context, CL_FALSE, CL_ADDRESS_CLAMP_TO_EDGE, CL_FILTER_NEAREST, &error ); - test_error( error, "clCreateSampler failed" ); - - // Set up the arguments for each and queue - for( i = 0, idx = 0; i < numSizes; i++ ) - { - for( j = 0; j < numFormats; j++, idx++ ) - { - error = clSetKernelArg( kernel, 0, sizeof( streams[ idx ][ 0 ] ), &streams[ idx ][ 0 ] ); - error |= clSetKernelArg( kernel, 1, sizeof( sampler ), &sampler ); - error |= clSetKernelArg( kernel, 2, sizeof( streams[ idx ][ 1 ] ), &streams[ idx ][ 1 ]); - test_error( error, "Unable to set kernel arguments" ); - - threads[ 0 ] = threads[ 1 ] = (size_t)sizes[ i ]; - - error = clEnqueueNDRangeKernel( queue, kernel, 2, NULL, threads, NULL, 0, NULL, NULL ); - test_error( error, "clEnqueueNDRangeKernel failed" ); - } - } - - // Now go through each combo and validate the results - for( i = 0, idx = 0; i < numSizes; i++ ) - { - for( j = 0; j < numFormats; j++, idx++ ) - { - BufferOwningPtr output(malloc(sizeof(cl_float) * sizes[ i ] * sizes[ i ] * 4 )); - - error = clEnqueueReadBuffer( queue, streams[ idx ][ 1 ], CL_TRUE, 0, sizes[ i ] * sizes[ i ] * 4 * sizeof( cl_float ), output, 0, NULL, NULL ); - test_error( error, "Unable to read results" ); - - error = validate_results( sizes[ i ], sizes[ i ], formats[ j ], inputs[ idx ], output ); - if( error ) - return -1; - } - } - - return 0; -} diff --git a/test_conformance/compatibility/test_conformance/basic/test_imagearraycopy.c b/test_conformance/compatibility/test_conformance/basic/test_imagearraycopy.c deleted file mode 100644 index a361b6a4..00000000 --- a/test_conformance/compatibility/test_conformance/basic/test_imagearraycopy.c +++ /dev/null @@ -1,146 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include -#include - -#include "procs.h" - -int test_imagearraycopy_single_format(cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format) -{ - cl_uchar *imgptr, *bufptr; - clMemWrapper image, buffer; - int img_width = 512; - int img_height = 512; - size_t elem_size; - size_t buffer_size; - int i; - cl_int err; - MTdata d; - cl_event copyevent; - - log_info("Testing %s %s\n", GetChannelOrderName(format->image_channel_order), GetChannelTypeName(format->image_channel_data_type)); - - image = create_image_2d(context, (cl_mem_flags)(CL_MEM_READ_WRITE), format, img_width, img_height, 0, NULL, &err); - test_error(err, "create_image_2d failed"); - - err = clGetImageInfo(image, CL_IMAGE_ELEMENT_SIZE, sizeof(size_t), &elem_size, NULL); - test_error(err, "clGetImageInfo failed"); - - buffer_size = sizeof(cl_uchar) * elem_size * img_width * img_height; - - buffer = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), buffer_size, NULL, &err); - test_error(err, "clCreateBuffer failed"); - - d = init_genrand( gRandomSeed ); - imgptr = (cl_uchar*)malloc(buffer_size); - for (i=0; i<(int)buffer_size; i++) { - imgptr[i] = (cl_uchar)genrand_int32(d); - } - free_mtdata(d); d = NULL; - - size_t origin[3]={0,0,0}, region[3]={img_width,img_height,1}; - err = clEnqueueWriteImage( queue, image, CL_TRUE, origin, region, 0, 0, imgptr, 0, NULL, NULL ); - test_error(err, "clEnqueueWriteBuffer failed"); - - err = clEnqueueCopyImageToBuffer( queue, image, buffer, origin, region, 0, 0, NULL, ©event ); - test_error(err, "clEnqueueCopyImageToBuffer failed"); - - bufptr = (cl_uchar*)malloc(buffer_size); - - err = clEnqueueReadBuffer( queue, buffer, CL_TRUE, 0, buffer_size, bufptr, 1, ©event, NULL); - test_error(err, "clEnqueueReadBuffer failed"); - - err = clReleaseEvent(copyevent); - test_error(err, "clReleaseEvent failed"); - - if (memcmp(imgptr, bufptr, buffer_size) != 0) { - log_error( "ERROR: Results did not validate!\n" ); - unsigned char * inchar = (unsigned char*)imgptr; - unsigned char * outchar = (unsigned char*)bufptr; - int failuresPrinted = 0; - int i; - for (i=0; i< (int)buffer_size; i+=(int)elem_size) { - int failed = 0; - int j; - for (j=0; j<(int)elem_size; j++) - if (inchar[i+j] != outchar[i+j]) - failed = 1; - char values[4096]; - values[0] = 0; - if (failed) { - sprintf(values + strlen(values), "%d(0x%x) -> actual [", i, i); - int j; - for (j=0; j<(int)elem_size; j++) - sprintf(values + strlen( values), "0x%02x ", inchar[i+j]); - sprintf(values + strlen(values), "] != expected ["); - for (j=0; j<(int)elem_size; j++) - sprintf(values + strlen( values), "0x%02x ", outchar[i+j]); - sprintf(values + strlen(values), "]"); - log_error("%s\n", values); - failuresPrinted++; - } - if (failuresPrinted > 5) { - log_error("Not printing further failures...\n"); - break; - } - } - err = -1; - } - - free(imgptr); - free(bufptr); - - if (err) - log_error("IMAGE to ARRAY copy test failed for image_channel_order=0x%lx and image_channel_data_type=0x%lx\n", - (unsigned long)format->image_channel_order, (unsigned long)format->image_channel_data_type); - - return err; -} - -int test_imagearraycopy(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) -{ - cl_int err; - cl_image_format *formats; - cl_uint num_formats; - cl_uint i; - - PASSIVE_REQUIRE_IMAGE_SUPPORT( device ) - - err = clGetSupportedImageFormats(context, CL_MEM_READ_WRITE, CL_MEM_OBJECT_IMAGE2D, 0, NULL, &num_formats); - test_error(err, "clGetSupportedImageFormats failed"); - - formats = (cl_image_format *)malloc(num_formats * sizeof(cl_image_format)); - - err = clGetSupportedImageFormats(context, CL_MEM_READ_WRITE, CL_MEM_OBJECT_IMAGE2D, num_formats, formats, NULL); - test_error(err, "clGetSupportedImageFormats failed"); - - for (i = 0; i < num_formats; i++) { - err |= test_imagearraycopy_single_format(device, context, queue, &formats[i]); - } - - free(formats); - if (err) - log_error("IMAGE to ARRAY copy test failed\n"); - else - log_info("IMAGE to ARRAY copy test passed\n"); - - return err; -} diff --git a/test_conformance/compatibility/test_conformance/basic/test_imagearraycopy3d.c b/test_conformance/compatibility/test_conformance/basic/test_imagearraycopy3d.c deleted file mode 100644 index d0fc05a3..00000000 --- a/test_conformance/compatibility/test_conformance/basic/test_imagearraycopy3d.c +++ /dev/null @@ -1,144 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - -#include "procs.h" - -int test_imagearraycopy3d_single_format(cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format) -{ - cl_uchar *imgptr, *bufptr; - clMemWrapper image, buffer; - int img_width = 128; - int img_height = 128; - int img_depth = 32; - size_t elem_size; - size_t buffer_size; - int i; - cl_int err; - MTdata d; - cl_event copyevent; - - log_info("Testing %s %s\n", GetChannelOrderName(format->image_channel_order), GetChannelTypeName(format->image_channel_data_type)); - - image = create_image_3d(context, (cl_mem_flags)(CL_MEM_READ_WRITE), format, img_width, img_height, img_depth, 0, 0, NULL, &err); - test_error(err, "create_image_3d failed"); - - err = clGetImageInfo(image, CL_IMAGE_ELEMENT_SIZE, sizeof(size_t), &elem_size, NULL); - test_error(err, "clGetImageInfo failed"); - - buffer_size = sizeof(cl_uchar) * elem_size * img_width * img_height * img_depth; - - buffer = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), buffer_size, NULL, &err); - test_error(err, "clCreateBuffer failed"); - - imgptr = (cl_uchar*)malloc(buffer_size); - - d = init_genrand( gRandomSeed ); - imgptr = (cl_uchar*)malloc(buffer_size); - for (i=0; i<(int)buffer_size; i++) { - imgptr[i] = (cl_uchar)genrand_int32(d); - } - free_mtdata(d); d = NULL; - - size_t origin[3]={0,0,0}, region[3]={img_width,img_height,img_depth}; - err = clEnqueueWriteImage( queue, image, CL_TRUE, origin, region, 0, 0, imgptr, 0, NULL, NULL ); - test_error(err, "clEnqueueWriteBuffer failed"); - - err = clEnqueueCopyImageToBuffer( queue, image, buffer, origin, region, 0, 0, NULL, ©event ); - test_error(err, "clEnqueueCopyImageToBuffer failed"); - - bufptr = (cl_uchar*)malloc(buffer_size); - - err = clEnqueueReadBuffer( queue, buffer, CL_TRUE, 0, buffer_size, bufptr, 1, ©event, NULL); - test_error(err, "clEnqueueReadBuffer failed"); - - if (memcmp(imgptr, bufptr, buffer_size) != 0) { - log_error( "ERROR: Results did not validate!\n" ); - unsigned char * inchar = (unsigned char*)imgptr; - unsigned char * outchar = (unsigned char*)bufptr; - int failuresPrinted = 0; - int i; - for (i=0; i< (int)buffer_size; i+=(int)elem_size) { - int failed = 0; - int j; - for (j=0; j<(int)elem_size; j++) - if (inchar[i+j] != outchar[i+j]) - failed = 1; - char values[4096]; - values[0] = 0; - if (failed) { - sprintf(values + strlen(values), "%d(0x%x) -> actual [", i, i); - int j; - for (j=0; j<(int)elem_size; j++) - sprintf(values + strlen( values), "0x%02x ", inchar[i+j]); - sprintf(values + strlen(values), "] != expected ["); - for (j=0; j<(int)elem_size; j++) - sprintf(values + strlen( values), "0x%02x ", outchar[i+j]); - sprintf(values + strlen(values), "]"); - log_error("%s\n", values); - failuresPrinted++; - } - if (failuresPrinted > 5) { - log_error("Not printing further failures...\n"); - break; - } - } - err = -1; - } - - free(imgptr); - free(bufptr); - - if (err) - log_error("IMAGE3D to ARRAY copy test failed for image_channel_order=0x%lx and image_channel_data_type=0x%lx\n", - (unsigned long)format->image_channel_order, (unsigned long)format->image_channel_data_type); - - return err; -} - -int test_imagearraycopy3d(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) -{ - cl_int err; - cl_image_format *formats; - cl_uint num_formats; - cl_uint i; - - PASSIVE_REQUIRE_3D_IMAGE_SUPPORT( device ) - - err = clGetSupportedImageFormats(context, CL_MEM_READ_WRITE, CL_MEM_OBJECT_IMAGE3D, 0, NULL, &num_formats); - test_error(err, "clGetSupportedImageFormats failed"); - - formats = (cl_image_format *)malloc(num_formats * sizeof(cl_image_format)); - - err = clGetSupportedImageFormats(context, CL_MEM_READ_WRITE, CL_MEM_OBJECT_IMAGE3D, num_formats, formats, NULL); - test_error(err, "clGetSupportedImageFormats failed"); - - for (i = 0; i < num_formats; i++) { - err |= test_imagearraycopy3d_single_format(device, context, queue, &formats[i]); - } - - if (err) - log_error("IMAGE3D to ARRAY copy test failed\n"); - else - log_info("IMAGE3D to ARRAY copy test passed\n"); - - return err; -} diff --git a/test_conformance/compatibility/test_conformance/basic/test_imagecopy.c b/test_conformance/compatibility/test_conformance/basic/test_imagecopy.c deleted file mode 100644 index d01ff5ff..00000000 --- a/test_conformance/compatibility/test_conformance/basic/test_imagecopy.c +++ /dev/null @@ -1,234 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - - -#include "procs.h" - -static unsigned char * -generate_rgba8_image(int w, int h, MTdata d) -{ - unsigned char *ptr = (unsigned char*)malloc(w * h * 4); - int i; - - for (i=0; i -#include -#include -#include - - -#include "procs.h" - -static unsigned char * -generate_uint8_image(unsigned num_elements, MTdata d) -{ - unsigned char *ptr = (unsigned char*)malloc(num_elements); - unsigned i; - - for (i=0; i -#include -#include -#include - - -#include "procs.h" - -static unsigned char * -generate_rgba8_image(int w, int h, MTdata d) -{ - unsigned char *ptr = (unsigned char*)malloc(w * h * 4); - int i; - - for (i=0; i -#include -#include -#include - - -#include "procs.h" - -static unsigned char * -generate_rgba8_image(int w, int h, MTdata d) -{ - unsigned char *ptr = (unsigned char*)malloc(w * h * 4); - int i; - - for (i=0; i -#include -#include -#include - - -#include "procs.h" - -static unsigned char * -generate_rgba8_image(int w, int h, int d, MTdata mtData) -{ - unsigned char *ptr = (unsigned char*)malloc(w * h * d *4); - int i; - - for (i=0; i -#include -#include -#include - - -#include "procs.h" - -const char *int2float_kernel_code = -"__kernel void test_int2float(__global int *src, __global float *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = (float)src[tid];\n" -"\n" -"}\n"; - - -int -verify_int2float(cl_int *inptr, cl_float *outptr, int n) -{ - int i; - - for (i=0; i -#include -#include -#include - - -#include "procs.h" - -const char *int_add_kernel_code = -"__kernel void test_int_add(__global int *srcA, __global int *srcB, __global int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] + srcB[tid];\n" -"}\n"; - -const char *int_sub_kernel_code = -"__kernel void test_int_sub(__global int *srcA, __global int *srcB, __global int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] - srcB[tid];\n" -"}\n"; - -const char *int_mul_kernel_code = -"__kernel void test_int_mul(__global int *srcA, __global int *srcB, __global int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid];\n" -"}\n"; - -const char *int_mad_kernel_code = -"__kernel void test_int_mad(__global int *srcA, __global int *srcB, __global int *srcC, __global int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid] + srcC[tid];\n" -"}\n"; - -static const float MAX_ERR = 1e-5f; - -int -verify_int_add(int *inptrA, int *inptrB, int *outptr, int n) -{ - int r; - int i; - - for (i=0; i -#include -#include -#include - - -#include "procs.h" - -const char *int_add2_kernel_code = -"__kernel void test_int_add2(__global int2 *srcA, __global int2 *srcB, __global int2 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] + srcB[tid];\n" -"}\n"; - -const char *int_sub2_kernel_code = -"__kernel void test_int_sub2(__global int2 *srcA, __global int2 *srcB, __global int2 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] - srcB[tid];\n" -"}\n"; - -const char *int_mul2_kernel_code = -"__kernel void test_int_mul2(__global int2 *srcA, __global int2 *srcB, __global int2 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid];\n" -"}\n"; - -const char *int_mad2_kernel_code = -"__kernel void test_int_mad2(__global int2 *srcA, __global int2 *srcB, __global int2 *srcC, __global int2 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid] + srcC[tid];\n" -"}\n"; - -int -verify_int_add2(int *inptrA, int *inptrB, int *outptr, int n) -{ - int r; - int i; - - for (i=0; i -#include -#include -#include - - -#include "procs.h" - -const char *int_add4_kernel_code = -"__kernel void test_int_add4(__global int4 *srcA, __global int4 *srcB, __global int4 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] + srcB[tid];\n" -"}\n"; - -const char *int_sub4_kernel_code = -"__kernel void test_int_sub4(__global int4 *srcA, __global int4 *srcB, __global int4 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] - srcB[tid];\n" -"}\n"; - -const char *int_mul4_kernel_code = -"__kernel void test_int_mul4(__global int4 *srcA, __global int4 *srcB, __global int4 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid];\n" -"}\n"; - -const char *int_mad4_kernel_code = -"__kernel void test_int_mad4(__global int4 *srcA, __global int4 *srcB, __global int4 *srcC, __global int4 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid] + srcC[tid];\n" -"}\n"; - -int -verify_int_add4(int *inptrA, int *inptrB, int *outptr, int n) -{ - int r; - int i; - - for (i=0; i -#include -#include -#include - - -#include "procs.h" - -const char *long_add_kernel_code = -"__kernel void test_long_add(__global long *srcA, __global long *srcB, __global long *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] + srcB[tid];\n" -"}\n"; - -const char *long_sub_kernel_code = -"__kernel void test_long_sub(__global long *srcA, __global long *srcB, __global long *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] - srcB[tid];\n" -"}\n"; - -const char *long_mul_kernel_code = -"__kernel void test_long_mul(__global long *srcA, __global long *srcB, __global long *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid];\n" -"}\n"; - -const char *long_mad_kernel_code = -"__kernel void test_long_mad(__global long *srcA, __global long *srcB, __global long *srcC, __global long *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid] + srcC[tid];\n" -"}\n"; - -static const float MAX_ERR = 1e-5f; - -int -verify_long_add(cl_long *inptrA, cl_long *inptrB, cl_long *outptr, int n) -{ - cl_long r; - int i; - - for (i=0; i -#include -#include -#include - - -#include "procs.h" - -const char *long_add2_kernel_code = -"__kernel void test_long_add2(__global long2 *srcA, __global long2 *srcB, __global long2 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] + srcB[tid];\n" -"}\n"; - -const char *long_sub2_kernel_code = -"__kernel void test_long_sub2(__global long2 *srcA, __global long2 *srcB, __global long2 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] - srcB[tid];\n" -"}\n"; - -const char *long_mul2_kernel_code = -"__kernel void test_long_mul2(__global long2 *srcA, __global long2 *srcB, __global long2 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid];\n" -"}\n"; - -const char *long_mad2_kernel_code = -"__kernel void test_long_mad2(__global long2 *srcA, __global long2 *srcB, __global long2 *srcC, __global long2 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid] + srcC[tid];\n" -"}\n"; - -int -verify_long_add2(cl_long *inptrA, cl_long *inptrB, cl_long *outptr, int n) -{ - cl_long r; - int i; - - for (i=0; i -#include -#include -#include - - -#include "procs.h" - -const char *long_add4_kernel_code = -"__kernel void test_long_add4(__global long4 *srcA, __global long4 *srcB, __global long4 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] + srcB[tid];\n" -"}\n"; - -const char *long_sub4_kernel_code = -"__kernel void test_long_sub4(__global long4 *srcA, __global long4 *srcB, __global long4 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] - srcB[tid];\n" -"}\n"; - -const char *long_mul4_kernel_code = -"__kernel void test_long_mul4(__global long4 *srcA, __global long4 *srcB, __global long4 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid];\n" -"}\n"; - -const char *long_mad4_kernel_code = -"__kernel void test_long_mad4(__global long4 *srcA, __global long4 *srcB, __global long4 *srcC, __global long4 *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = srcA[tid] * srcB[tid] + srcC[tid];\n" -"}\n"; - -int -verify_long_add4(cl_long *inptrA, cl_long *inptrB, cl_long *outptr, int n) -{ - cl_long r; - int i; - - for (i=0; i 10) - continue; - if (errors == 10) { - log_error("Suppressing further results...\n"); - continue; - } - log_error("Results do not match: output[%d]=%d != expected[%d]=%d\n", i, output[i], i, expected[i]); - errors++; - pass = 0; - } - } - if (pass) log_info("Passed kernel calling kernel...\n"); - - - - // Test kernel calling a function - log_info("Testing kernel calling function...\n"); - // Reset the inputs - for (int i=0; i 10) - continue; - if (errors > 10) { - log_error("Suppressing further results...\n"); - continue; - } - log_error("Results do not match: output[%d]=%d != expected[%d]=%d\n", i, output[i], i, expected[i]); - errors++; - pass = 0; - } - } - if (pass) log_info("Passed kernel calling function...\n"); - - - // Test calling the kernel we called from another kernel - log_info("Testing calling the kernel we called from another kernel before...\n"); - // Reset the inputs - for (int i=0; i 10) - continue; - if (errors > 10) { - log_error("Suppressing further results...\n"); - continue; - } - log_error("Results do not match: output[%d]=%d != expected[%d]=%d\n", i, output[i], i, expected[i]); - errors++; - pass = 0; - } - } - if (pass) log_info("Passed calling the kernel we called from another kernel before...\n"); - - free( input ); - free( output ); - free( expected ); - - return errors; -} - - diff --git a/test_conformance/compatibility/test_conformance/basic/test_kernel_memory_alignment.cpp b/test_conformance/compatibility/test_conformance/basic/test_kernel_memory_alignment.cpp deleted file mode 100644 index 1352e46a..00000000 --- a/test_conformance/compatibility/test_conformance/basic/test_kernel_memory_alignment.cpp +++ /dev/null @@ -1,572 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef _WIN32 -#include -#endif - -#include "procs.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/errorHelpers.h" - -// For global, local, and constant -const char *parameter_kernel_long = -"%s\n" // optional pragma -"kernel void test(global ulong *results, %s %s *mem0, %s %s2 *mem2, %s %s3 *mem3, %s %s4 *mem4, %s %s8 *mem8, %s %s16 *mem16)\n" -"{\n" -" results[0] = (ulong)&mem0[0];\n" -" results[1] = (ulong)&mem2[0];\n" -" results[2] = (ulong)&mem3[0];\n" -" results[3] = (ulong)&mem4[0];\n" -" results[4] = (ulong)&mem8[0];\n" -" results[5] = (ulong)&mem16[0];\n" -"}\n"; - -// For private and local -const char *local_kernel_long = -"%s\n" // optional pragma -"kernel void test(global ulong *results)\n" -"{\n" -" %s %s mem0[3];\n" -" %s %s2 mem2[3];\n" -" %s %s3 mem3[3];\n" -" %s %s4 mem4[3];\n" -" %s %s8 mem8[3];\n" -" %s %s16 mem16[3];\n" -" results[0] = (ulong)&mem0[0];\n" -" results[1] = (ulong)&mem2[0];\n" -" results[2] = (ulong)&mem3[0];\n" -" results[3] = (ulong)&mem4[0];\n" -" results[4] = (ulong)&mem8[0];\n" -" results[5] = (ulong)&mem16[0];\n" -"}\n"; - -// For constant -const char *constant_kernel_long = -"%s\n" // optional pragma -" constant %s mem0[3] = {0};\n" -" constant %s2 mem2[3] = {(%s2)(0)};\n" -" constant %s3 mem3[3] = {(%s3)(0)};\n" -" constant %s4 mem4[3] = {(%s4)(0)};\n" -" constant %s8 mem8[3] = {(%s8)(0)};\n" -" constant %s16 mem16[3] = {(%s16)(0)};\n" -"\n" -"kernel void test(global ulong *results)\n" -"{\n" -" results[0] = (ulong)&mem0;\n" -" results[1] = (ulong)&mem2;\n" -" results[2] = (ulong)&mem3;\n" -" results[3] = (ulong)&mem4;\n" -" results[4] = (ulong)&mem8;\n" -" results[5] = (ulong)&mem16;\n" -"}\n"; - - -// For global, local, and constant -const char *parameter_kernel_no_long = -"%s\n" // optional pragma -"kernel void test(global uint *results, %s %s *mem0, %s %s2 *mem2, %s %s3 *mem3, %s %s4 *mem4, %s %s8 *mem8, %s %s16 *mem16)\n" -"{\n" -" results[0] = (uint)&mem0[0];\n" -" results[1] = (uint)&mem2[0];\n" -" results[2] = (uint)&mem3[0];\n" -" results[3] = (uint)&mem4[0];\n" -" results[4] = (uint)&mem8[0];\n" -" results[5] = (uint)&mem16[0];\n" -"}\n"; - -// For private and local -const char *local_kernel_no_long = -"%s\n" // optional pragma -"kernel void test(global uint *results)\n" -"{\n" -" %s %s mem0[3];\n" -" %s %s2 mem2[3];\n" -" %s %s3 mem3[3];\n" -" %s %s4 mem4[3];\n" -" %s %s8 mem8[3];\n" -" %s %s16 mem16[3];\n" -" results[0] = (uint)&mem0[0];\n" -" results[1] = (uint)&mem2[0];\n" -" results[2] = (uint)&mem3[0];\n" -" results[3] = (uint)&mem4[0];\n" -" results[4] = (uint)&mem8[0];\n" -" results[5] = (uint)&mem16[0];\n" -"}\n"; - -// For constant -const char *constant_kernel_no_long = -"%s\n" // optional pragma -" constant %s mem0[3] = {0};\n" -" constant %s2 mem2[3] = {(%s2)(0)};\n" -" constant %s3 mem3[3] = {(%s3)(0)};\n" -" constant %s4 mem4[3] = {(%s4)(0)};\n" -" constant %s8 mem8[3] = {(%s8)(0)};\n" -" constant %s16 mem16[3] = {(%s16)(0)};\n" -"\n" -"kernel void test(global uint *results)\n" -"{\n" -" results[0] = (uint)&mem0;\n" -" results[1] = (uint)&mem2;\n" -" results[2] = (uint)&mem3;\n" -" results[3] = (uint)&mem4;\n" -" results[4] = (uint)&mem8;\n" -" results[5] = (uint)&mem16;\n" -"}\n"; - -enum AddressSpaces -{ - kGlobal = 0, - kLocal, - kConstant, - kPrivate -}; - -typedef enum AddressSpaces AddressSpaces; - -#define DEBUG 0 - -const char * get_explicit_address_name( AddressSpaces address ) -{ - /* Quick method to avoid branching: make sure the following array matches the Enum order */ - static const char *sExplicitAddressNames[] = { "global", "local", "constant", "private"}; - - return sExplicitAddressNames[ address ]; -} - - -int test_kernel_memory_alignment(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems, AddressSpaces address ) -{ - const char *constant_kernel; - const char *parameter_kernel; - const char *local_kernel; - - if ( gHasLong ) - { - constant_kernel = constant_kernel_long; - parameter_kernel = parameter_kernel_long; - local_kernel = local_kernel_long; - } - else - { - constant_kernel = constant_kernel_no_long; - parameter_kernel = parameter_kernel_no_long; - local_kernel = local_kernel_no_long; - } - - ExplicitType vecType[] = { kChar, kUChar, kShort, kUShort, kInt, kUInt, kLong, kULong, kFloat, kDouble }; - char *kernel_code = (char*)malloc(4096); - cl_kernel kernel; - cl_program program; - int error; - int total_errors = 0; - cl_mem results; - cl_ulong *results_data; - cl_mem mem0, mem2, mem3, mem4, mem8, mem16; - - results_data = (cl_ulong*)malloc(sizeof(cl_ulong)*6); - results = clCreateBuffer(context, 0, sizeof(cl_ulong)*6, NULL, &error); - test_error(error, "clCreateBuffer failed"); - - mem0 = clCreateBuffer(context, 0, sizeof(cl_long), NULL, &error); - test_error(error, "clCreateBuffer failed"); - mem2 = clCreateBuffer(context, 0, sizeof(cl_long)*2, NULL, &error); - test_error(error, "clCreateBuffer failed"); - mem3 = clCreateBuffer(context, 0, sizeof(cl_long)*4, NULL, &error); - test_error(error, "clCreateBuffer failed"); - mem4 = clCreateBuffer(context, 0, sizeof(cl_long)*4, NULL, &error); - test_error(error, "clCreateBuffer failed"); - mem8 = clCreateBuffer(context, 0, sizeof(cl_long)*8, NULL, &error); - test_error(error, "clCreateBuffer failed"); - mem16 = clCreateBuffer(context, 0, sizeof(cl_long)*16, NULL, &error); - test_error(error, "clCreateBuffer failed"); - - - // For each type - - // Calculate alignment mask for each size - - // For global, local, constant, private - - // If global, local or constant -- do parameter_kernel - // If private or local -- do local_kernel - // If constant -- do constant kernel - - int numConstantArgs; - clGetDeviceInfo(device, CL_DEVICE_MAX_CONSTANT_ARGS, sizeof(numConstantArgs), &numConstantArgs, NULL); - - int typeIndex; - for (typeIndex = 0; typeIndex < 10; typeIndex++) { - // Skip double tests if we don't support doubles - if (vecType[typeIndex] == kDouble && !is_extension_available(device, "cl_khr_fp64")) { - log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); - continue; - } - - if (( vecType[ typeIndex ] == kLong || vecType[ typeIndex ] == kULong ) && !gHasLong ) - continue; - - log_info("Testing %s...\n", get_explicit_type_name(vecType[typeIndex])); - - // Determine the expected alignment masks. - // E.g., if it is supposed to be 4 byte aligned, we should get 4-1=3 = ... 000011 - // We can then and the returned address with that and we should have 0. - cl_ulong alignments[6]; - alignments[0] = get_explicit_type_size(vecType[typeIndex])-1; - alignments[1] = (get_explicit_type_size(vecType[typeIndex])<<1)-1; - alignments[2] = (get_explicit_type_size(vecType[typeIndex])<<2)-1; - alignments[3] = (get_explicit_type_size(vecType[typeIndex])<<2)-1; - alignments[4] = (get_explicit_type_size(vecType[typeIndex])<<3)-1; - alignments[5] = (get_explicit_type_size(vecType[typeIndex])<<4)-1; - - // Parameter kernel - if (address == kGlobal || address == kLocal || address == kConstant) { - log_info("\tTesting parameter kernel...\n"); - - if ( (gIsEmbedded) && (address == kConstant) && (numConstantArgs < 6)) { - sprintf(kernel_code, parameter_kernel, - vecType[typeIndex] == kDouble ? "#pragma OPENCL EXTENSION cl_khr_fp64 : enable" : "", - get_explicit_address_name(address), get_explicit_type_name(vecType[typeIndex]), - get_explicit_address_name(address), get_explicit_type_name(vecType[typeIndex]), - get_explicit_address_name(address), get_explicit_type_name(vecType[typeIndex]), - get_explicit_address_name(address), get_explicit_type_name(vecType[typeIndex]), - get_explicit_address_name(address), get_explicit_type_name(vecType[typeIndex]), - get_explicit_address_name(address), get_explicit_type_name(vecType[typeIndex]) - ); - } - else { - sprintf(kernel_code, parameter_kernel, - vecType[typeIndex] == kDouble ? "#pragma OPENCL EXTENSION cl_khr_fp64 : enable" : "", - get_explicit_address_name(address), get_explicit_type_name(vecType[typeIndex]), - get_explicit_address_name(address), get_explicit_type_name(vecType[typeIndex]), - get_explicit_address_name(address), get_explicit_type_name(vecType[typeIndex]), - get_explicit_address_name(address), get_explicit_type_name(vecType[typeIndex]), - get_explicit_address_name(address), get_explicit_type_name(vecType[typeIndex]), - get_explicit_address_name(address), get_explicit_type_name(vecType[typeIndex]) - ); - } - //printf("Kernel is: \n%s\n", kernel_code); - - // Create the kernel - error = create_single_kernel_helper(context, &program, &kernel, 1, (const char **)&kernel_code, "test"); - test_error(error, "create_single_kernel_helper failed"); - - // Initialize the results - memset(results_data, 0, sizeof(cl_long)*5); - error = clEnqueueWriteBuffer(queue, results, CL_TRUE, 0, sizeof(cl_long)*6, results_data, 0, NULL, NULL); - test_error(error, "clEnqueueWriteBuffer failed"); - - // Set the arguments - error = clSetKernelArg(kernel, 0, sizeof(results), &results); - test_error(error, "clSetKernelArg failed"); - if (address != kLocal) { - error = clSetKernelArg(kernel, 1, sizeof(mem0), &mem0); - test_error(error, "clSetKernelArg failed"); - error = clSetKernelArg(kernel, 2, sizeof(mem2), &mem2); - test_error(error, "clSetKernelArg failed"); - error = clSetKernelArg(kernel, 3, sizeof(mem3), &mem3); - test_error(error, "clSetKernelArg failed"); - error = clSetKernelArg(kernel, 4, sizeof(mem4), &mem4); - test_error(error, "clSetKernelArg failed"); - error = clSetKernelArg(kernel, 5, sizeof(mem8), &mem8); - test_error(error, "clSetKernelArg failed"); - error = clSetKernelArg(kernel, 6, sizeof(mem16), &mem16); - test_error(error, "clSetKernelArg failed"); - } else { - error = clSetKernelArg(kernel, 1, get_explicit_type_size(vecType[typeIndex]), NULL); - test_error(error, "clSetKernelArg failed"); - error = clSetKernelArg(kernel, 2, get_explicit_type_size(vecType[typeIndex])*2, NULL); - test_error(error, "clSetKernelArg failed"); - error = clSetKernelArg(kernel, 3, get_explicit_type_size(vecType[typeIndex])*4, NULL); - test_error(error, "clSetKernelArg failed"); - error = clSetKernelArg(kernel, 4, get_explicit_type_size(vecType[typeIndex])*4, NULL); - test_error(error, "clSetKernelArg failed"); - error = clSetKernelArg(kernel, 5, get_explicit_type_size(vecType[typeIndex])*8, NULL); - test_error(error, "clSetKernelArg failed"); - error = clSetKernelArg(kernel, 6, get_explicit_type_size(vecType[typeIndex])*16, NULL); - test_error(error, "clSetKernelArg failed"); - } - - // Enqueue the kernel - size_t global_size = 1; - error = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global_size, NULL, 0, NULL, NULL); - test_error(error, "clEnqueueNDRangeKernel failed"); - - // Read back the results - error = clEnqueueReadBuffer(queue, results, CL_TRUE, 0, sizeof(cl_ulong)*6, results_data, 0, NULL, NULL); - test_error(error, "clEnqueueReadBuffer failed"); - - // Verify the results - if (gHasLong) { - for (int i = 0; i < 6; i++) { - if ((results_data[i] & alignments[i]) != 0) { - total_errors++; - log_error("\tVector size %d failed: 0x%llx is not properly aligned.\n", 1 << i, results_data[i]); - } else { - if (DEBUG) log_info("\tVector size %d passed: 0x%llx is properly aligned.\n", 1 << i, results_data[i]); - } - } - } - // Verify the results on devices that do not support longs - else { - cl_uint *results_data_no_long = (cl_uint *)results_data; - - for (int i = 0; i < 6; i++) { - if ((results_data_no_long[i] & alignments[i]) != 0) { - total_errors++; - log_error("\tVector size %d failed: 0x%llx is not properly aligned.\n", 1 << i, results_data_no_long[i]); - } else { - if (DEBUG) log_info("\tVector size %d passed: 0x%llx is properly aligned.\n", 1 << i, results_data_no_long[i]); - } - } - } - - clReleaseKernel(kernel); - clReleaseProgram(program); - } - - - - - // Local kernel - if (address == kLocal || address == kPrivate) { - log_info("\tTesting local kernel...\n"); - sprintf(kernel_code, local_kernel, - vecType[typeIndex] == kDouble ? "#pragma OPENCL EXTENSION cl_khr_fp64 : enable" : "", - get_explicit_address_name(address), get_explicit_type_name(vecType[typeIndex]), - get_explicit_address_name(address), get_explicit_type_name(vecType[typeIndex]), - get_explicit_address_name(address), get_explicit_type_name(vecType[typeIndex]), - get_explicit_address_name(address), get_explicit_type_name(vecType[typeIndex]), - get_explicit_address_name(address), get_explicit_type_name(vecType[typeIndex]), - get_explicit_address_name(address), get_explicit_type_name(vecType[typeIndex]) - ); - //printf("Kernel is: \n%s\n", kernel_code); - - // Create the kernel - error = create_single_kernel_helper(context, &program, &kernel, 1, (const char **)&kernel_code, "test"); - test_error(error, "create_single_kernel_helper failed"); - - // Initialize the results - memset(results_data, 0, sizeof(cl_long)*5); - error = clEnqueueWriteBuffer(queue, results, CL_TRUE, 0, sizeof(cl_long)*5, results_data, 0, NULL, NULL); - test_error(error, "clEnqueueWriteBuffer failed"); - - // Set the arguments - error = clSetKernelArg(kernel, 0, sizeof(results), &results); - test_error(error, "clSetKernelArg failed"); - - // Enqueue the kernel - size_t global_size = 1; - error = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global_size, NULL, 0, NULL, NULL); - test_error(error, "clEnqueueNDRangeKernel failed"); - - // Read back the results - error = clEnqueueReadBuffer(queue, results, CL_TRUE, 0, sizeof(cl_ulong)*5, results_data, 0, NULL, NULL); - test_error(error, "clEnqueueReadBuffer failed"); - - // Verify the results - if (gHasLong) { - for (int i = 0; i < 5; i++) { - if ((results_data[i] & alignments[i]) != 0) { - total_errors++; - log_error("\tVector size %d failed: 0x%llx is not properly aligned.\n", 1 << i, results_data[i]); - } else { - if (DEBUG) log_info("\tVector size %d passed: 0x%llx is properly aligned.\n", 1 << i, results_data[i]); - } - } - } - // Verify the results on devices that do not support longs - else { - cl_uint *results_data_no_long = (cl_uint *)results_data; - - for (int i = 0; i < 5; i++) { - if ((results_data_no_long[i] & alignments[i]) != 0) { - total_errors++; - log_error("\tVector size %d failed: 0x%llx is not properly aligned.\n", 1 << i, results_data_no_long[i]); - } else { - if (DEBUG) log_info("\tVector size %d passed: 0x%llx is properly aligned.\n", 1 << i, results_data_no_long[i]); - } - } - } - clReleaseKernel(kernel); - clReleaseProgram(program); - } - - - - // Constant kernel - if (address == kConstant) { - log_info("\tTesting constant kernel...\n"); - sprintf(kernel_code, constant_kernel, - vecType[typeIndex] == kDouble ? "#pragma OPENCL EXTENSION cl_khr_fp64 : enable" : "", - get_explicit_type_name(vecType[typeIndex]), - get_explicit_type_name(vecType[typeIndex]), - get_explicit_type_name(vecType[typeIndex]), - get_explicit_type_name(vecType[typeIndex]), - get_explicit_type_name(vecType[typeIndex]), - get_explicit_type_name(vecType[typeIndex]), - get_explicit_type_name(vecType[typeIndex]), - get_explicit_type_name(vecType[typeIndex]), - get_explicit_type_name(vecType[typeIndex]), - get_explicit_type_name(vecType[typeIndex]), - get_explicit_type_name(vecType[typeIndex]), - get_explicit_type_name(vecType[typeIndex]) - ); - //printf("Kernel is: \n%s\n", kernel_code); - - // Create the kernel - error = create_single_kernel_helper(context, &program, &kernel, 1, (const char **)&kernel_code, "test"); - test_error(error, "create_single_kernel_helper failed"); - - // Initialize the results - memset(results_data, 0, sizeof(cl_long)*5); - error = clEnqueueWriteBuffer(queue, results, CL_TRUE, 0, sizeof(cl_long)*5, results_data, 0, NULL, NULL); - test_error(error, "clEnqueueWriteBuffer failed"); - - // Set the arguments - error = clSetKernelArg(kernel, 0, sizeof(results), &results); - test_error(error, "clSetKernelArg failed"); - - // Enqueue the kernel - size_t global_size = 1; - error = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global_size, NULL, 0, NULL, NULL); - test_error(error, "clEnqueueNDRangeKernel failed"); - - // Read back the results - error = clEnqueueReadBuffer(queue, results, CL_TRUE, 0, sizeof(cl_ulong)*5, results_data, 0, NULL, NULL); - test_error(error, "clEnqueueReadBuffer failed"); - - // Verify the results - if (gHasLong) { - for (int i = 0; i < 5; i++) { - if ((results_data[i] & alignments[i]) != 0) { - total_errors++; - log_error("\tVector size %d failed: 0x%llx is not properly aligned.\n", 1 << i, results_data[i]); - } else { - if (DEBUG) log_info("\tVector size %d passed: 0x%llx is properly aligned.\n", 1 << i, results_data[i]); - } - } - } - // Verify the results on devices that do not support longs - else { - cl_uint *results_data_no_long = (cl_uint *)results_data; - - for (int i = 0; i < 5; i++) { - if ((results_data_no_long[i] & alignments[i]) != 0) { - total_errors++; - log_error("\tVector size %d failed: 0x%llx is not properly aligned.\n", 1 << i, results_data_no_long[i]); - } else { - if (DEBUG) log_info("\tVector size %d passed: 0x%llx is properly aligned.\n", 1 << i, results_data_no_long[i]); - } - } - } - clReleaseKernel(kernel); - clReleaseProgram(program); - } - - - } - - clReleaseMemObject(results); - clReleaseMemObject(mem0); - clReleaseMemObject(mem2); - clReleaseMemObject(mem3); - clReleaseMemObject(mem4); - clReleaseMemObject(mem8); - clReleaseMemObject(mem16); - free( kernel_code ); - free( results_data ); - - if (total_errors != 0) - return -1; - return 0; - -} - - -int test_kernel_memory_alignment_local(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems ) -{ - return test_kernel_memory_alignment( device, context, queue, n_elems, kLocal ); -} - -int test_kernel_memory_alignment_global(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems ) -{ - return test_kernel_memory_alignment( device, context, queue, n_elems, kGlobal ); -} - -int test_kernel_memory_alignment_constant(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems ) -{ - // There is a class of approved OpenCL 1.0 conformant devices out there that in some circumstances - // are unable to meaningfully take (or more precisely use) the address of constant data by virtue - // of limitations in their ISA design. This feature was not tested in 1.0, so they were declared - // conformant by Khronos. The failure is however caught here. - // - // Unfortunately, determining whether or not these devices are 1.0 conformant is not the jurisdiction - // of the 1.1 tests -- We can't fail them from 1.1 conformance here because they are not 1.1 - // devices. They are merely 1.0 conformant devices that interop with 1.1 devices in a 1.1 platform. - // To add new binding tests now to conformant 1.0 devices would violate the workingroup requirement - // of no new tests for 1.0 devices. So certain allowances have to be made in intractable cases - // such as this one. - // - // There is some precedent. Similar allowances are made for other 1.0 hardware features such as - // local memory size. The minimum required local memory size grew from 16 kB to 32 kB in OpenCL 1.1. - - // Detect 1.0 devices - // Get CL_DEVICE_VERSION size - size_t string_size = 0; - int err; - if( (err = clGetDeviceInfo( device, CL_DEVICE_VERSION, 0, NULL, &string_size ) ) ) - { - log_error( "FAILURE: Unable to get size of CL_DEVICE_VERSION string!" ); - return -1; - } - - //Allocate storage to hold the version string - char *version_string = (char*) malloc(string_size); - if( NULL == version_string ) - { - log_error( "FAILURE: Unable to allocate memory to hold CL_DEVICE_VERSION string!" ); - return -1; - } - - // Get CL_DEVICE_VERSION string - if( (err = clGetDeviceInfo( device, CL_DEVICE_VERSION, string_size, version_string, NULL ) ) ) - { - log_error( "FAILURE: Unable to read CL_DEVICE_VERSION string!" ); - return -1; - } - - // easy out for 1.0 devices - const char *string_1_0 = "OpenCL 1.0 "; - if( 0 == strncmp( version_string, string_1_0, strlen(string_1_0)) ) - { - log_info( "WARNING: Allowing device to escape testing of difficult constant memory alignment case.\n\tDevice is not a OpenCL 1.1 device. CL_DEVICE_VERSION: \"%s\"\n", version_string ); - free(version_string); - return 0; - } - log_info( "Device version string: \"%s\"\n", version_string ); - free(version_string); - - // Everyone else is to be ground mercilessly under the wheels of progress - return test_kernel_memory_alignment( device, context, queue, n_elems, kConstant ); -} - -int test_kernel_memory_alignment_private(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems ) -{ - return test_kernel_memory_alignment( device, context, queue, n_elems, kPrivate ); -} - - diff --git a/test_conformance/compatibility/test_conformance/basic/test_local.c b/test_conformance/compatibility/test_conformance/basic/test_local.c deleted file mode 100644 index 1be5926a..00000000 --- a/test_conformance/compatibility/test_conformance/basic/test_local.c +++ /dev/null @@ -1,372 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - - -#include "procs.h" - -const char *barrier_with_localmem_kernel_code[] = { -"__kernel void compute_sum_with_localmem(__global int *a, int n, __local int *tmp_sum, __global int *sum)\n" -"{\n" -" int tid = get_local_id(0);\n" -" int lsize = get_local_size(0);\n" -" int i;\n" -"\n" -" tmp_sum[tid] = 0;\n" -" for (i=tid; i max_local_workgroup_size[0]) - kwgsize = max_local_workgroup_size[0]; - - // err = clSetKernelArgs(context, kernel, 4, NULL, values, sizes); - err = clSetKernelArg(kernel, 0, sizeof(streams[0]), &streams[0]); - err |= clSetKernelArg(kernel, 1, sizeof num_elements, &num_elements); - err |= clSetKernelArg(kernel, 2, wgsize * sizeof(cl_int), NULL); - err |= clSetKernelArg(kernel, 3, sizeof streams[1], &streams[1]); - if (err != CL_SUCCESS) - { - log_error("clSetKernelArgs failed\n"); - return -1; - } - - global_threads[0] = wgsize; - local_threads[0] = wgsize; - - // Adjust the local thread size to fit and be a nice multiple. - if (kwgsize < wgsize) { - log_info("Adjusting wgsize down from %lu to %lu.\n", wgsize, kwgsize); - local_threads[0] = kwgsize; - } - while (global_threads[0] % local_threads[0] != 0) - local_threads[0]--; - - err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, global_threads, local_threads, 0, NULL, NULL); - if (err != CL_SUCCESS) - { - log_error("clEnqueueNDRangeKernel failed\n"); - return -1; - } - - err = clEnqueueReadBuffer(queue, streams[1], CL_TRUE, 0, out_length, output_ptr, 0, NULL, NULL); - if (err != CL_SUCCESS) - { - log_error("clEnqueueReadBuffer failed\n"); - return -1; - } - - err = verify_sum(input_ptr, tmp_ptr, output_ptr, num_elements); - - // cleanup - clReleaseMemObject(streams[0]); - clReleaseMemObject(streams[1]); - clReleaseKernel(kernel); - clReleaseProgram(program); - free(input_ptr); - free(tmp_ptr); - free(output_ptr); - - return err; -} - -int test_local_kernel_def(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) -{ - cl_mem streams[2]; - cl_program program; - cl_kernel kernel; - - cl_int *input_ptr, *output_ptr, *tmp_ptr; - size_t global_threads[1], local_threads[1]; - size_t wgsize, kwgsize; - int err, i; - char *program_source = (char*)malloc(sizeof(char)*2048); - MTdata d = init_genrand( gRandomSeed ); - size_t max_local_workgroup_size[3]; - memset(program_source, 0, 2048); - - err = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_GROUP_SIZE, sizeof wgsize, &wgsize, NULL); - if (err) { - log_error("clGetDeviceInfo failed, %d\n\n", err); - return -1; - } - wgsize/=2; - if (wgsize < 1) - wgsize = 1; - - size_t in_length = sizeof(cl_int) * num_elements; - size_t out_length = sizeof(cl_int) * wgsize; - - input_ptr = (cl_int *)malloc(in_length); - output_ptr = (cl_int *)malloc(out_length); - tmp_ptr = (cl_int *)malloc(out_length); - - streams[0] = clCreateBuffer(context, CL_MEM_READ_WRITE, in_length, NULL, NULL); - if (!streams[0]) - { - log_error("clCreateBuffer failed\n"); - return -1; - } - streams[1] = clCreateBuffer(context, CL_MEM_READ_WRITE, out_length, NULL, NULL); - if (!streams[1]) - { - log_error("clCreateBuffer failed\n"); - return -1; - } - - for (i=0; i (localMemSize / (sizeof(cl_int)*sizeof(cl_int))) ) - { - wgsize = localMemSize / (sizeof(cl_int)*sizeof(cl_int)); - } - - sprintf(program_source, barrier_with_localmem_kernel_code[1], (int)(wgsize * sizeof(cl_int))); - - err = create_single_kernel_helper(context, &program, &kernel, 1, (const char**)&program_source, "compute_sum_with_localmem" ); - free(program_source); - if (err) - return -1; - - err = clGetKernelWorkGroupInfo(kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof kwgsize, &kwgsize, NULL); - test_error(err, "clGetKernelWorkGroupInfo failed for CL_KERNEL_WORK_GROUP_SIZE"); - - err = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(max_local_workgroup_size), max_local_workgroup_size, NULL); - test_error(err, "clGetDeviceInfo failed for CL_DEVICE_MAX_WORK_ITEM_SIZES"); - - // Pick the minimum of the device and the kernel - if (kwgsize > max_local_workgroup_size[0]) - kwgsize = max_local_workgroup_size[0]; - - // err = clSetKernelArgs(context, kernel, 4, NULL, values, sizes); - err = clSetKernelArg(kernel, 0, sizeof(streams[0]), &streams[0]); - err |= clSetKernelArg(kernel, 1, sizeof num_elements, &num_elements); - err |= clSetKernelArg(kernel, 2, sizeof streams[1], &streams[1]); - if (err != CL_SUCCESS) - { - log_error("clSetKernelArgs failed\n"); - return -1; - } - - global_threads[0] = wgsize; - local_threads[0] = wgsize; - - // Adjust the local thread size to fit and be a nice multiple. - if (kwgsize < wgsize) { - log_info("Adjusting wgsize down from %lu to %lu.\n", wgsize, kwgsize); - local_threads[0] = kwgsize; - } - while (global_threads[0] % local_threads[0] != 0) - local_threads[0]--; - - err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, global_threads, local_threads, 0, NULL, NULL); - if (err != CL_SUCCESS) - { - log_error("clEnqueueNDRangeKernel failed\n"); - return -1; - } - - err = clEnqueueReadBuffer(queue, streams[1], CL_TRUE, 0, out_length, output_ptr, 0, NULL, NULL); - if (err != CL_SUCCESS) - { - log_error("clEnqueueReadBuffer failed\n"); - return -1; - } - - err = verify_sum(input_ptr, tmp_ptr, output_ptr, num_elements); - - // cleanup - clReleaseMemObject(streams[0]); - clReleaseMemObject(streams[1]); - clReleaseKernel(kernel); - clReleaseProgram(program); - free(input_ptr); - free(tmp_ptr); - free(output_ptr); - - return err; -} - - - diff --git a/test_conformance/compatibility/test_conformance/basic/test_local_kernel_scope.cpp b/test_conformance/compatibility/test_conformance/basic/test_local_kernel_scope.cpp deleted file mode 100644 index a469751d..00000000 --- a/test_conformance/compatibility/test_conformance/basic/test_local_kernel_scope.cpp +++ /dev/null @@ -1,138 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - - -#include "procs.h" - -#define MAX_LOCAL_STORAGE_SIZE 256 -#define MAX_LOCAL_STORAGE_SIZE_STRING "256" - -const char *kernelSource[] = { - "__kernel void test( __global unsigned int * input, __global unsigned int *outMaxes )\n" - "{\n" - " __local unsigned int localStorage[ " MAX_LOCAL_STORAGE_SIZE_STRING " ];\n" - " unsigned int theValue = input[ get_global_id( 0 ) ];\n" - "\n" - " // If we just write linearly, there's no verification that the items in a group share local data\n" - " // So we write reverse-linearly, which requires items to read the local data written by at least one\n" - " // different item\n" - " localStorage[ get_local_size( 0 ) - get_local_id( 0 ) - 1 ] = theValue;\n" - "\n" - " // The barrier ensures that all local items have written to the local storage\n" - " barrier( CLK_LOCAL_MEM_FENCE );\n" - "\n" - " // Now we loop back through the local storage and look for the max value. We only do this if\n" - " // we're the first item in a group\n" - " unsigned int max = 0;\n" - " if( get_local_id( 0 ) == 0 )\n" - " {\n" - " for( size_t i = 0; i < get_local_size( 0 ); i++ )\n" - " {\n" - " if( localStorage[ i ] > max )\n" - " max = localStorage[ i ];\n" - " }\n" - " outMaxes[ get_group_id( 0 ) ] = max;\n" - " }\n" - "}\n" -}; - -int test_local_kernel_scope(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) -{ - cl_int error; - clProgramWrapper program; - clKernelWrapper kernel; - clMemWrapper streams[ 2 ]; - MTdata randSeed = init_genrand( gRandomSeed ); - - // Create a test kernel - error = create_single_kernel_helper( context, &program, &kernel, 1, kernelSource, "test" ); - test_error( error, "Unable to create test kernel" ); - - - // Determine an appropriate test size - size_t workGroupSize; - error = clGetKernelWorkGroupInfo( kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof( workGroupSize ), &workGroupSize, NULL ); - test_error( error, "Unable to obtain kernel work group size" ); - - // Make sure the work group size doesn't overrun our local storage size in the kernel - while( workGroupSize > MAX_LOCAL_STORAGE_SIZE ) - workGroupSize >>= 1; - - size_t testSize = workGroupSize; - while( testSize < 1024 ) - testSize += workGroupSize; - size_t numGroups = testSize / workGroupSize; - log_info( "\tTesting with %ld groups, %ld elements per group...\n", numGroups, workGroupSize ); - - // Create two buffers for operation - cl_uint *inputData = (cl_uint*)malloc( testSize * sizeof(cl_uint) ); - generate_random_data( kUInt, testSize, randSeed, inputData ); - free_mtdata( randSeed ); - streams[ 0 ] = clCreateBuffer( context, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, testSize * sizeof(cl_uint), inputData, &error ); - test_error( error, "Unable to create input buffer" ); - - cl_uint *outputData = (cl_uint*)malloc( numGroups *sizeof(cl_uint) ); - streams[ 1 ] = clCreateBuffer( context, CL_MEM_WRITE_ONLY, numGroups * sizeof(cl_uint), NULL, &error ); - test_error( error, "Unable to create output buffer" ); - - - // Set up the kernel args and run - error = clSetKernelArg( kernel, 0, sizeof( streams[ 0 ] ), &streams[ 0 ] ); - test_error( error, "Unable to set kernel arg" ); - error = clSetKernelArg( kernel, 1, sizeof( streams[ 1 ] ), &streams[ 1 ] ); - test_error( error, "Unable to set kernel arg" ); - - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, &testSize, &workGroupSize, 0, NULL, NULL ); - test_error( error, "Unable to enqueue kernel" ); - - - // Read results and verify - error = clEnqueueReadBuffer( queue, streams[ 1 ], CL_TRUE, 0, numGroups * sizeof(cl_uint), outputData, 0, NULL, NULL ); - test_error( error, "Unable to read output data" ); - - // MingW compiler seems to have a bug that otimizes the code below incorrectly. - // adding the volatile keyword to size_t decleration to avoid aggressive optimization by the compiler. - for( volatile size_t i = 0; i < numGroups; i++ ) - { - // Determine the max in our case - cl_uint localMax = 0; - for( volatile size_t j = 0; j < workGroupSize; j++ ) - { - if( inputData[ i * workGroupSize + j ] > localMax ) - localMax = inputData[ i * workGroupSize + j ]; - } - - if( outputData[ i ] != localMax ) - { - log_error( "ERROR: Local max validation failed! (expected %u, got %u for i=%lu)\n", localMax, outputData[ i ] , i ); - free(inputData); - free(outputData); - return -1; - } - } - - free(inputData); - free(outputData); - return 0; -} - - diff --git a/test_conformance/compatibility/test_conformance/basic/test_loop.c b/test_conformance/compatibility/test_conformance/basic/test_loop.c deleted file mode 100644 index a4f043b4..00000000 --- a/test_conformance/compatibility/test_conformance/basic/test_loop.c +++ /dev/null @@ -1,184 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - - -#include "procs.h" - -const char *loop_kernel_code = -"__kernel void test_loop(__global int *src, __global int *loopindx, __global int *loopcnt, __global int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -" int n = get_global_size(0);\n" -" int i, j;\n" -"\n" -" dst[tid] = 0;\n" -" for (i=0,j=loopindx[tid]; i= n)\n" -" j = 0;\n" -" dst[tid] += src[j];\n" -" }\n" -"\n" -"}\n"; - - -int -verify_loop(int *inptr, int *loopindx, int *loopcnt, int *outptr, int n) -{ - int r, i, j, k; - - for (i=0; i= n) - k = 0; - r += inptr[k]; - } - - if (r != outptr[i]) - { - log_error("LOOP test failed: %d found, expected %d\n", outptr[i], r); - return -1; - } - } - - log_info("LOOP test passed\n"); - return 0; -} - -int test_loop(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) -{ - cl_mem streams[4]; - cl_int *input_ptr, *loop_indx, *loop_cnt, *output_ptr; - cl_program program; - cl_kernel kernel; - size_t threads[1]; - int err, i; - - size_t length = sizeof(cl_int) * num_elements; - input_ptr = (cl_int*)malloc(length); - loop_indx = (cl_int*)malloc(length); - loop_cnt = (cl_int*)malloc(length); - output_ptr = (cl_int*)malloc(length); - - streams[0] = clCreateBuffer(context, CL_MEM_READ_WRITE, length, NULL, NULL); - if (!streams[0]) - { - log_error("clCreateBuffer failed\n"); - return -1; - } - streams[1] = clCreateBuffer(context, CL_MEM_READ_WRITE, length, NULL, NULL); - if (!streams[1]) - { - log_error("clCreateBuffer failed\n"); - return -1; - } - streams[2] = clCreateBuffer(context, CL_MEM_READ_WRITE, length, NULL, NULL); - if (!streams[2]) - { - log_error("clCreateBuffer failed\n"); - return -1; - } - streams[3] = clCreateBuffer(context, CL_MEM_READ_WRITE, length, NULL, NULL); - if (!streams[3]) - { - log_error("clCreateBuffer failed\n"); - return -1; - } - - MTdata d = init_genrand( gRandomSeed ); - for (i=0; i= " #value "\n"); \ -} \ -} - -#define TEST_VALUE_NEGATIVE( string_name, name, value ) \ -{ \ -if (name > value) { \ -log_error("FAILED: " string_name ": " #name " > " #value "\n"); \ -errors++;\ -} else { \ -log_info("\t" string_name ": " #name " <= " #value "\n"); \ -} \ -} - -#define TEST_VALUE_EQUAL_LITERAL( string_name, name, value ) \ -{ \ -if (name != value) { \ -log_error("FAILED: " string_name ": " #name " != " #value "\n"); \ -errors++;\ -} else { \ -log_info("\t" string_name ": " #name " = " #value "\n"); \ -} \ -} - -#define TEST_VALUE_EQUAL( string_name, name, value ) \ -{ \ -if (name != value) { \ -log_error("FAILED: " string_name ": " #name " != %a (%17.21g)\n", value, value); \ -errors++;\ -} else { \ -log_info("\t" string_name ": " #name " = %a (%17.21g)\n", value, value); \ -} \ -} - -int test_host_numeric_constants(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int errors = 0; - TEST_VALUE_EQUAL_LITERAL( "CL_CHAR_BIT", CL_CHAR_BIT, 8) - TEST_VALUE_EQUAL_LITERAL( "CL_SCHAR_MAX", CL_SCHAR_MAX, 127) - TEST_VALUE_EQUAL_LITERAL( "CL_SCHAR_MIN", CL_SCHAR_MIN, (-127-1)) - TEST_VALUE_EQUAL_LITERAL( "CL_CHAR_MAX", CL_CHAR_MAX, CL_SCHAR_MAX) - TEST_VALUE_EQUAL_LITERAL( "CL_CHAR_MIN", CL_CHAR_MIN, CL_SCHAR_MIN) - TEST_VALUE_EQUAL_LITERAL( "CL_UCHAR_MAX", CL_UCHAR_MAX, 255) - TEST_VALUE_EQUAL_LITERAL( "CL_SHRT_MAX", CL_SHRT_MAX, 32767) - TEST_VALUE_EQUAL_LITERAL( "CL_SHRT_MIN", CL_SHRT_MIN, (-32767-1)) - TEST_VALUE_EQUAL_LITERAL( "CL_USHRT_MAX", CL_USHRT_MAX, 65535) - TEST_VALUE_EQUAL_LITERAL( "CL_INT_MAX", CL_INT_MAX, 2147483647) - TEST_VALUE_EQUAL_LITERAL( "CL_INT_MIN", CL_INT_MIN, (-2147483647-1)) - TEST_VALUE_EQUAL_LITERAL( "CL_UINT_MAX", CL_UINT_MAX, 0xffffffffU) - TEST_VALUE_EQUAL_LITERAL( "CL_LONG_MAX", CL_LONG_MAX, ((cl_long) 0x7FFFFFFFFFFFFFFFLL)) - TEST_VALUE_EQUAL_LITERAL( "CL_LONG_MIN", CL_LONG_MIN, ((cl_long) -0x7FFFFFFFFFFFFFFFLL - 1LL)) - TEST_VALUE_EQUAL_LITERAL( "CL_ULONG_MAX", CL_ULONG_MAX, ((cl_ulong) 0xFFFFFFFFFFFFFFFFULL)) - - TEST_VALUE_EQUAL_LITERAL( "CL_FLT_DIG", CL_FLT_DIG, 6) - TEST_VALUE_EQUAL_LITERAL( "CL_FLT_MANT_DIG", CL_FLT_MANT_DIG, 24) - TEST_VALUE_EQUAL_LITERAL( "CL_FLT_MAX_10_EXP", CL_FLT_MAX_10_EXP, +38) - TEST_VALUE_EQUAL_LITERAL( "CL_FLT_MAX_EXP", CL_FLT_MAX_EXP, +128) - TEST_VALUE_EQUAL_LITERAL( "CL_FLT_MIN_10_EXP", CL_FLT_MIN_10_EXP, -37) - TEST_VALUE_EQUAL_LITERAL( "CL_FLT_MIN_EXP", CL_FLT_MIN_EXP, -125) - TEST_VALUE_EQUAL_LITERAL( "CL_FLT_RADIX", CL_FLT_RADIX, 2) - TEST_VALUE_EQUAL_LITERAL( "CL_FLT_MAX", CL_FLT_MAX, MAKE_HEX_FLOAT( 0x1.fffffep127f, 0x1fffffeL, 103)) - TEST_VALUE_EQUAL_LITERAL( "CL_FLT_MIN", CL_FLT_MIN, MAKE_HEX_FLOAT(0x1.0p-126f, 0x1L, -126)) - TEST_VALUE_EQUAL_LITERAL( "CL_FLT_EPSILON", CL_FLT_EPSILON, MAKE_HEX_FLOAT(0x1.0p-23f, 0x1L, -23)) - - TEST_VALUE_EQUAL_LITERAL( "CL_DBL_DIG", CL_DBL_DIG, 15) - TEST_VALUE_EQUAL_LITERAL( "CL_DBL_MANT_DIG", CL_DBL_MANT_DIG, 53) - TEST_VALUE_EQUAL_LITERAL( "CL_DBL_MAX_10_EXP", CL_DBL_MAX_10_EXP, +308) - TEST_VALUE_EQUAL_LITERAL( "CL_DBL_MAX_EXP", CL_DBL_MAX_EXP, +1024) - TEST_VALUE_EQUAL_LITERAL( "CL_DBL_MIN_10_EXP", CL_DBL_MIN_10_EXP, -307) - TEST_VALUE_EQUAL_LITERAL( "CL_DBL_MIN_EXP", CL_DBL_MIN_EXP, -1021) - TEST_VALUE_EQUAL_LITERAL( "CL_DBL_RADIX", CL_DBL_RADIX, 2) - TEST_VALUE_EQUAL( "CL_DBL_MAX", CL_DBL_MAX, MAKE_HEX_DOUBLE(0x1.fffffffffffffp1023, 0x1fffffffffffffLL, 971)) - TEST_VALUE_EQUAL( "CL_DBL_MIN", CL_DBL_MIN, MAKE_HEX_DOUBLE(0x1.0p-1022, 0x1LL, -1022)) - TEST_VALUE_EQUAL( "CL_DBL_EPSILON", CL_DBL_EPSILON, MAKE_HEX_DOUBLE(0x1.0p-52, 0x1LL, -52)) - - TEST_VALUE_EQUAL( "CL_M_E", CL_M_E, MAKE_HEX_DOUBLE(0x1.5bf0a8b145769p+1, 0x15bf0a8b145769LL, -51) ); - TEST_VALUE_EQUAL( "CL_M_LOG2E", CL_M_LOG2E, MAKE_HEX_DOUBLE(0x1.71547652b82fep+0, 0x171547652b82feLL, -52) ); - TEST_VALUE_EQUAL( "CL_M_LOG10E", CL_M_LOG10E, MAKE_HEX_DOUBLE(0x1.bcb7b1526e50ep-2, 0x1bcb7b1526e50eLL, -54) ); - TEST_VALUE_EQUAL( "CL_M_LN2", CL_M_LN2, MAKE_HEX_DOUBLE(0x1.62e42fefa39efp-1, 0x162e42fefa39efLL, -53) ); - TEST_VALUE_EQUAL( "CL_M_LN10", CL_M_LN10, MAKE_HEX_DOUBLE(0x1.26bb1bbb55516p+1, 0x126bb1bbb55516LL, -51) ); - TEST_VALUE_EQUAL( "CL_M_PI", CL_M_PI, MAKE_HEX_DOUBLE(0x1.921fb54442d18p+1, 0x1921fb54442d18LL, -51) ); - TEST_VALUE_EQUAL( "CL_M_PI_2", CL_M_PI_2, MAKE_HEX_DOUBLE(0x1.921fb54442d18p+0, 0x1921fb54442d18LL, -52) ); - TEST_VALUE_EQUAL( "CL_M_PI_4", CL_M_PI_4, MAKE_HEX_DOUBLE(0x1.921fb54442d18p-1, 0x1921fb54442d18LL, -53) ); - TEST_VALUE_EQUAL( "CL_M_1_PI", CL_M_1_PI, MAKE_HEX_DOUBLE(0x1.45f306dc9c883p-2, 0x145f306dc9c883LL, -54) ); - TEST_VALUE_EQUAL( "CL_M_2_PI", CL_M_2_PI, MAKE_HEX_DOUBLE(0x1.45f306dc9c883p-1, 0x145f306dc9c883LL, -53) ); - TEST_VALUE_EQUAL( "CL_M_2_SQRTPI", CL_M_2_SQRTPI, MAKE_HEX_DOUBLE(0x1.20dd750429b6dp+0, 0x120dd750429b6dLL, -52) ); - TEST_VALUE_EQUAL( "CL_M_SQRT2", CL_M_SQRT2, MAKE_HEX_DOUBLE(0x1.6a09e667f3bcdp+0, 0x16a09e667f3bcdLL, -52) ); - TEST_VALUE_EQUAL( "CL_M_SQRT1_2", CL_M_SQRT1_2, MAKE_HEX_DOUBLE(0x1.6a09e667f3bcdp-1, 0x16a09e667f3bcdLL, -53) ); - - TEST_VALUE_EQUAL( "CL_M_E_F", CL_M_E_F, MAKE_HEX_FLOAT(0x1.5bf0a8p+1f, 0x15bf0a8L, -23)); - TEST_VALUE_EQUAL( "CL_M_LOG2E_F", CL_M_LOG2E_F, MAKE_HEX_FLOAT(0x1.715476p+0f, 0x1715476L, -24)); - TEST_VALUE_EQUAL( "CL_M_LOG10E_F", CL_M_LOG10E_F, MAKE_HEX_FLOAT(0x1.bcb7b2p-2f, 0x1bcb7b2L, -26)); - TEST_VALUE_EQUAL( "CL_M_LN2_F", CL_M_LN2_F, MAKE_HEX_FLOAT(0x1.62e43p-1f, 0x162e43L, -21) ); - TEST_VALUE_EQUAL( "CL_M_LN10_F", CL_M_LN10_F, MAKE_HEX_FLOAT(0x1.26bb1cp+1f, 0x126bb1cL, -23)); - TEST_VALUE_EQUAL( "CL_M_PI_F", CL_M_PI_F, MAKE_HEX_FLOAT(0x1.921fb6p+1f, 0x1921fb6L, -23)); - TEST_VALUE_EQUAL( "CL_M_PI_2_F", CL_M_PI_2_F, MAKE_HEX_FLOAT(0x1.921fb6p+0f, 0x1921fb6L, -24)); - TEST_VALUE_EQUAL( "CL_M_PI_4_F", CL_M_PI_4_F, MAKE_HEX_FLOAT(0x1.921fb6p-1f, 0x1921fb6L, -25)); - TEST_VALUE_EQUAL( "CL_M_1_PI_F", CL_M_1_PI_F, MAKE_HEX_FLOAT(0x1.45f306p-2f, 0x145f306L, -26)); - TEST_VALUE_EQUAL( "CL_M_2_PI_F", CL_M_2_PI_F, MAKE_HEX_FLOAT(0x1.45f306p-1f, 0x145f306L, -25)); - TEST_VALUE_EQUAL( "CL_M_2_SQRTPI_F", CL_M_2_SQRTPI_F,MAKE_HEX_FLOAT(0x1.20dd76p+0f, 0x120dd76L, -24)); - TEST_VALUE_EQUAL( "CL_M_SQRT2_F", CL_M_SQRT2_F, MAKE_HEX_FLOAT(0x1.6a09e6p+0f, 0x16a09e6L, -24)); - TEST_VALUE_EQUAL( "CL_M_SQRT1_2_F", CL_M_SQRT1_2_F, MAKE_HEX_FLOAT(0x1.6a09e6p-1f, 0x16a09e6L, -25)); - - return errors; -} - - -const char *kernel_int_float[] = { - "__kernel void test( __global float *float_out, __global int *int_out, __global uint *uint_out) \n" - "{\n" - " int_out[0] = CHAR_BIT;\n" - " int_out[1] = SCHAR_MAX;\n" - " int_out[2] = SCHAR_MIN;\n" - " int_out[3] = CHAR_MAX;\n" - " int_out[4] = CHAR_MIN;\n" - " int_out[5] = UCHAR_MAX;\n" - " int_out[6] = SHRT_MAX;\n" - " int_out[7] = SHRT_MIN;\n" - " int_out[8] = USHRT_MAX;\n" - " int_out[9] = INT_MAX;\n" - " int_out[10] = INT_MIN;\n" - " uint_out[0] = UINT_MAX;\n" - - " int_out[11] = FLT_DIG;\n" - " int_out[12] = FLT_MANT_DIG;\n" - " int_out[13] = FLT_MAX_10_EXP;\n" - " int_out[14] = FLT_MAX_EXP;\n" - " int_out[15] = FLT_MIN_10_EXP;\n" - " int_out[16] = FLT_MIN_EXP;\n" - " int_out[17] = FLT_RADIX;\n" - "#ifdef __IMAGE_SUPPORT__\n" - " int_out[18] = __IMAGE_SUPPORT__;\n" - "#else\n" - " int_out[18] = 0xf00baa;\n" - "#endif\n" - " float_out[0] = FLT_MAX;\n" - " float_out[1] = FLT_MIN;\n" - " float_out[2] = FLT_EPSILON;\n" - " float_out[3] = M_E_F;\n" - " float_out[4] = M_LOG2E_F;\n" - " float_out[5] = M_LOG10E_F;\n" - " float_out[6] = M_LN2_F;\n" - " float_out[7] = M_LN10_F;\n" - " float_out[8] = M_PI_F;\n" - " float_out[9] = M_PI_2_F;\n" - " float_out[10] = M_PI_4_F;\n" - " float_out[11] = M_1_PI_F;\n" - " float_out[12] = M_2_PI_F;\n" - " float_out[13] = M_2_SQRTPI_F;\n" - " float_out[14] = M_SQRT2_F;\n" - " float_out[15] = M_SQRT1_2_F;\n" - "}\n" -}; - -const char *kernel_long[] = { - "__kernel void test(__global long *long_out, __global ulong *ulong_out) \n" - "{\n" - " long_out[0] = LONG_MAX;\n" - " long_out[1] = LONG_MIN;\n" - " ulong_out[0] = ULONG_MAX;\n" - "}\n" -}; - -const char *kernel_double[] = { - "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n" - "__kernel void test( __global double *double_out, __global long *long_out ) \n " - "{\n" - " long_out[0] = DBL_DIG;\n" - " long_out[1] = DBL_MANT_DIG;\n" - " long_out[2] = DBL_MAX_10_EXP;\n" - " long_out[3] = DBL_MAX_EXP;\n" - " long_out[4] = DBL_MIN_10_EXP;\n" - " long_out[5] = DBL_MIN_EXP;\n" - " long_out[6] = DBL_RADIX;\n" - " double_out[0] = DBL_MAX;\n" - " double_out[1] = DBL_MIN;\n" - " double_out[2] = DBL_EPSILON;\n" - " double_out[3] = M_E;\n" - " double_out[4] = M_LOG2E;\n" - " double_out[5] = M_LOG10E;\n" - " double_out[6] = M_LN2;\n" - " double_out[7] = M_LN10;\n" - " double_out[8] = M_PI;\n" - " double_out[9] = M_PI_2;\n" - " double_out[10] = M_PI_4;\n" - " double_out[11] = M_1_PI;\n" - " double_out[12] = M_2_PI;\n" - " double_out[13] = M_2_SQRTPI;\n" - " double_out[14] = M_SQRT2;\n" - " double_out[15] = M_SQRT1_2;\n" - "}\n" -}; - - -int test_kernel_numeric_constants(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error, errors = 0; - // clProgramWrapper program; - // clKernelWrapper kernel; - // clMemWrapper streams[3]; - cl_program program; - cl_kernel kernel; - cl_mem streams[3]; - - size_t threads[] = {1,1,1}; - cl_float float_out[16]; - cl_int int_out[19]; - cl_uint uint_out[1]; - cl_long long_out[7]; - cl_ulong ulong_out[1]; - cl_double double_out[16]; - - /** INTs and FLOATs **/ - - // Create the kernel - if( create_single_kernel_helper( context, &program, &kernel, 1, kernel_int_float, "test" ) != 0 ) - { - return -1; - } - - /* Create some I/O streams */ - streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(float_out), NULL, &error); - test_error( error, "Creating test array failed" ); - streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(int_out), NULL, &error); - test_error( error, "Creating test array failed" ); - streams[2] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(uint_out), NULL, &error); - test_error( error, "Creating test array failed" ); - - error = clSetKernelArg(kernel, 1, sizeof( streams[1] ), &streams[1]); - test_error( error, "Unable to set indexed kernel arguments" ); - error = clSetKernelArg(kernel, 0, sizeof( streams[0] ), &streams[0]); - test_error( error, "Unable to set indexed kernel arguments" ); - error = clSetKernelArg(kernel, 2, sizeof( streams[2] ), &streams[2]); - test_error( error, "Unable to set indexed kernel arguments" ); - - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, NULL, 0, NULL, NULL ); - test_error( error, "Kernel execution failed" ); - - error = clEnqueueReadBuffer( queue, streams[0], CL_TRUE, 0, sizeof(float_out), (void*)float_out, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - error = clEnqueueReadBuffer( queue, streams[1], CL_TRUE, 0, sizeof(int_out), (void*)int_out, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - error = clEnqueueReadBuffer( queue, streams[2], CL_TRUE, 0, sizeof(uint_out), (void*)uint_out, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - - TEST_VALUE_EQUAL_LITERAL( "CHAR_BIT", int_out[0], 8) - TEST_VALUE_EQUAL_LITERAL( "SCHAR_MAX", int_out[1], 127) - TEST_VALUE_EQUAL_LITERAL( "SCHAR_MIN", int_out[2], (-127-1)) - TEST_VALUE_EQUAL_LITERAL( "CHAR_MAX", int_out[3], CL_SCHAR_MAX) - TEST_VALUE_EQUAL_LITERAL( "CHAR_MIN", int_out[4], CL_SCHAR_MIN) - TEST_VALUE_EQUAL_LITERAL( "UCHAR_MAX", int_out[5], 255) - TEST_VALUE_EQUAL_LITERAL( "SHRT_MAX", int_out[6], 32767) - TEST_VALUE_EQUAL_LITERAL( "SHRT_MIN",int_out[7], (-32767-1)) - TEST_VALUE_EQUAL_LITERAL( "USHRT_MAX", int_out[8], 65535) - TEST_VALUE_EQUAL_LITERAL( "INT_MAX", int_out[9], 2147483647) - TEST_VALUE_EQUAL_LITERAL( "INT_MIN", int_out[10], (-2147483647-1)) - TEST_VALUE_EQUAL_LITERAL( "UINT_MAX", uint_out[0], 0xffffffffU) - - TEST_VALUE_EQUAL_LITERAL( "FLT_DIG", int_out[11], 6) - TEST_VALUE_EQUAL_LITERAL( "FLT_MANT_DIG", int_out[12], 24) - TEST_VALUE_EQUAL_LITERAL( "FLT_MAX_10_EXP", int_out[13], +38) - TEST_VALUE_EQUAL_LITERAL( "FLT_MAX_EXP", int_out[14], +128) - TEST_VALUE_EQUAL_LITERAL( "FLT_MIN_10_EXP", int_out[15], -37) - TEST_VALUE_EQUAL_LITERAL( "FLT_MIN_EXP", int_out[16], -125) - TEST_VALUE_EQUAL_LITERAL( "FLT_RADIX", int_out[17], 2) - TEST_VALUE_EQUAL( "FLT_MAX", float_out[0], MAKE_HEX_FLOAT(0x1.fffffep127f, 0x1fffffeL, 103)) - TEST_VALUE_EQUAL( "FLT_MIN", float_out[1], MAKE_HEX_FLOAT(0x1.0p-126f, 0x1L, -126)) - TEST_VALUE_EQUAL( "FLT_EPSILON", float_out[2], MAKE_HEX_FLOAT(0x1.0p-23f, 0x1L, -23)) - TEST_VALUE_EQUAL( "M_E_F", float_out[3], CL_M_E_F ) - TEST_VALUE_EQUAL( "M_LOG2E_F", float_out[4], CL_M_LOG2E_F ) - TEST_VALUE_EQUAL( "M_LOG10E_F", float_out[5], CL_M_LOG10E_F ) - TEST_VALUE_EQUAL( "M_LN2_F", float_out[6], CL_M_LN2_F ) - TEST_VALUE_EQUAL( "M_LN10_F", float_out[7], CL_M_LN10_F ) - TEST_VALUE_EQUAL( "M_PI_F", float_out[8], CL_M_PI_F ) - TEST_VALUE_EQUAL( "M_PI_2_F", float_out[9], CL_M_PI_2_F ) - TEST_VALUE_EQUAL( "M_PI_4_F", float_out[10], CL_M_PI_4_F ) - TEST_VALUE_EQUAL( "M_1_PI_F", float_out[11], CL_M_1_PI_F ) - TEST_VALUE_EQUAL( "M_2_PI_F", float_out[12], CL_M_2_PI_F ) - TEST_VALUE_EQUAL( "M_2_SQRTPI_F", float_out[13], CL_M_2_SQRTPI_F ) - TEST_VALUE_EQUAL( "M_SQRT2_F", float_out[14], CL_M_SQRT2_F ) - TEST_VALUE_EQUAL( "M_SQRT1_2_F", float_out[15], CL_M_SQRT1_2_F ) - - // We need to check these values against what we know is supported on the device - if( checkForImageSupport( deviceID ) == 0 ) - { // has images - // If images are supported, the constant should have been defined to the value 1 - if( int_out[18] == 0xf00baa ) - { - log_error( "FAILURE: __IMAGE_SUPPORT__ undefined even though images are supported\n" ); - return -1; - } - else if( int_out[18] != 1 ) - { - log_error( "FAILURE: __IMAGE_SUPPORT__ defined, but to the wrong value (defined as %d, spec states it should be 1)\n", int_out[18] ); - return -1; - } - } - else - { // no images - // If images aren't supported, the constant should be undefined - if( int_out[18] != 0xf00baa ) - { - log_error( "FAILURE: __IMAGE_SUPPORT__ defined to value %d even though images aren't supported", int_out[18] ); - return -1; - } - } - log_info( "\t__IMAGE_SUPPORT__: %d\n", int_out[18]); - - clReleaseMemObject(streams[0]); streams[0] = NULL; - clReleaseMemObject(streams[1]); streams[1] = NULL; - clReleaseMemObject(streams[2]); streams[2] = NULL; - clReleaseKernel(kernel); kernel = NULL; - clReleaseProgram(program); program = NULL; - - /** LONGs **/ - - if(!gHasLong) { - log_info("Longs not supported; skipping long tests.\n"); - } - else - { - // Create the kernel - if( create_single_kernel_helper( context, &program, &kernel, 1, kernel_long, "test" ) != 0 ) - { - return -1; - } - - streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(long_out), NULL, &error); - test_error( error, "Creating test array failed" ); - streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(ulong_out), NULL, &error); - test_error( error, "Creating test array failed" ); - - error = clSetKernelArg(kernel, 1, sizeof( streams[1] ), &streams[1]); - test_error( error, "Unable to set indexed kernel arguments" ); - error = clSetKernelArg(kernel, 0, sizeof( streams[0] ), &streams[0]); - test_error( error, "Unable to set indexed kernel arguments" ); - - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, NULL, 0, NULL, NULL ); - test_error( error, "Kernel execution failed" ); - - error = clEnqueueReadBuffer( queue, streams[0], CL_TRUE, 0, sizeof(long_out), &long_out, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - error = clEnqueueReadBuffer( queue, streams[1], CL_TRUE, 0, sizeof(ulong_out), &ulong_out, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - - TEST_VALUE_EQUAL_LITERAL( "LONG_MAX", long_out[0], ((cl_long) 0x7FFFFFFFFFFFFFFFLL)) - TEST_VALUE_EQUAL_LITERAL( "LONG_MIN", long_out[1], ((cl_long) -0x7FFFFFFFFFFFFFFFLL - 1LL)) - TEST_VALUE_EQUAL_LITERAL( "ULONG_MAX", ulong_out[0], ((cl_ulong) 0xFFFFFFFFFFFFFFFFULL)) - - clReleaseMemObject(streams[0]); streams[0] = NULL; - clReleaseMemObject(streams[1]); streams[1] = NULL; - clReleaseKernel(kernel); kernel = NULL; - clReleaseProgram(program); program = NULL; - } - - /** DOUBLEs **/ - - if(!is_extension_available(deviceID, "cl_khr_fp64")) { - log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); - } - else - { - // Create the kernel - if( create_single_kernel_helper( context, &program, &kernel, 1, kernel_double, "test" ) != 0 ) - { - return -1; - } - - streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(double_out), NULL, &error); - test_error( error, "Creating test array failed" ); - streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(long_out), NULL, &error); - test_error( error, "Creating test array failed" ); - - error = clSetKernelArg(kernel, 1, sizeof( streams[1] ), &streams[1]); - test_error( error, "Unable to set indexed kernel arguments" ); - error = clSetKernelArg(kernel, 0, sizeof( streams[0] ), &streams[0]); - test_error( error, "Unable to set indexed kernel arguments" ); - - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, NULL, 0, NULL, NULL ); - test_error( error, "Kernel execution failed" ); - - error = clEnqueueReadBuffer( queue, streams[0], CL_TRUE, 0, sizeof(double_out), &double_out, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - error = clEnqueueReadBuffer( queue, streams[1], CL_TRUE, 0, sizeof(long_out), &long_out, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - - TEST_VALUE_EQUAL_LITERAL( "DBL_DIG", long_out[0], 15) - TEST_VALUE_EQUAL_LITERAL( "DBL_MANT_DIG", long_out[1], 53) - TEST_VALUE_EQUAL_LITERAL( "DBL_MAX_10_EXP", long_out[2], +308) - TEST_VALUE_EQUAL_LITERAL( "DBL_MAX_EXP", long_out[3], +1024) - TEST_VALUE_EQUAL_LITERAL( "DBL_MIN_10_EXP", long_out[4], -307) - TEST_VALUE_EQUAL_LITERAL( "DBL_MIN_EXP", long_out[5], -1021) - TEST_VALUE_EQUAL_LITERAL( "DBL_RADIX", long_out[6], 2) - TEST_VALUE_EQUAL( "DBL_MAX", double_out[0], MAKE_HEX_DOUBLE(0x1.fffffffffffffp1023, 0x1fffffffffffffLL, 971)) - TEST_VALUE_EQUAL( "DBL_MIN", double_out[1], MAKE_HEX_DOUBLE(0x1.0p-1022, 0x1LL, -1022)) - TEST_VALUE_EQUAL( "DBL_EPSILON", double_out[2], MAKE_HEX_DOUBLE(0x1.0p-52, 0x1LL, -52)) - //TEST_VALUE_EQUAL( "M_E", double_out[3], CL_M_E ) - TEST_VALUE_EQUAL( "M_LOG2E", double_out[4], CL_M_LOG2E ) - TEST_VALUE_EQUAL( "M_LOG10E", double_out[5], CL_M_LOG10E ) - TEST_VALUE_EQUAL( "M_LN2", double_out[6], CL_M_LN2 ) - TEST_VALUE_EQUAL( "M_LN10", double_out[7], CL_M_LN10 ) - TEST_VALUE_EQUAL( "M_PI", double_out[8], CL_M_PI ) - TEST_VALUE_EQUAL( "M_PI_2", double_out[9], CL_M_PI_2 ) - TEST_VALUE_EQUAL( "M_PI_4", double_out[10], CL_M_PI_4 ) - TEST_VALUE_EQUAL( "M_1_PI", double_out[11], CL_M_1_PI ) - TEST_VALUE_EQUAL( "M_2_PI", double_out[12], CL_M_2_PI ) - TEST_VALUE_EQUAL( "M_2_SQRTPI", double_out[13], CL_M_2_SQRTPI ) - TEST_VALUE_EQUAL( "M_SQRT2", double_out[14], CL_M_SQRT2 ) - TEST_VALUE_EQUAL( "M_SQRT1_2", double_out[15], CL_M_SQRT1_2 ) - - clReleaseMemObject(streams[0]); streams[0] = NULL; - clReleaseMemObject(streams[1]); streams[1] = NULL; - clReleaseKernel(kernel); kernel = NULL; - clReleaseProgram(program); program = NULL; - } - - error = clFinish(queue); - test_error(error, "clFinish failed"); - - return errors; -} - - -const char *kernel_constant_limits[] = { - "__kernel void test( __global int *intOut, __global float *floatOut ) \n" - "{\n" - " intOut[0] = isinf( MAXFLOAT ) ? 1 : 0;\n" - " intOut[1] = isnormal( MAXFLOAT ) ? 1 : 0;\n" - " intOut[2] = isnan( MAXFLOAT ) ? 1 : 0;\n" - " intOut[3] = sizeof( MAXFLOAT );\n" - " intOut[4] = ( MAXFLOAT == FLT_MAX ) ? 1 : 0;\n" - // " intOut[5] = ( MAXFLOAT == CL_FLT_MAX ) ? 1 : 0;\n" - " intOut[6] = ( MAXFLOAT == MAXFLOAT ) ? 1 : 0;\n" - " intOut[7] = ( MAXFLOAT == 0x1.fffffep127f ) ? 1 : 0;\n" - " floatOut[0] = MAXFLOAT;\n" - "}\n" -}; - -const char *kernel_constant_extended_limits[] = { - "__kernel void test( __global int *intOut, __global float *floatOut ) \n" - "{\n" - " intOut[0] = ( INFINITY == HUGE_VALF ) ? 1 : 0;\n" - " intOut[1] = sizeof( INFINITY );\n" - " intOut[2] = isinf( INFINITY ) ? 1 : 0;\n" - " intOut[3] = isnormal( INFINITY ) ? 1 : 0;\n" - " intOut[4] = isnan( INFINITY ) ? 1 : 0;\n" - " intOut[5] = ( INFINITY > MAXFLOAT ) ? 1 : 0;\n" - " intOut[6] = ( -INFINITY < -MAXFLOAT ) ? 1 : 0;\n" - " intOut[7] = ( ( MAXFLOAT + MAXFLOAT ) == INFINITY ) ? 1 : 0;\n" - " intOut[8] = ( nextafter( MAXFLOAT, INFINITY ) == INFINITY ) ? 1 : 0;\n" - " intOut[9] = ( nextafter( -MAXFLOAT, -INFINITY ) == -INFINITY ) ? 1 : 0;\n" - " intOut[10] = ( INFINITY == INFINITY ) ? 1 : 0;\n" - " intOut[11] = ( as_uint( INFINITY ) == 0x7f800000 ) ? 1 : 0;\n" - " floatOut[0] = INFINITY;\n" - "\n" - " intOut[12] = sizeof( HUGE_VALF );\n" - " intOut[13] = ( HUGE_VALF == INFINITY ) ? 1 : 0;\n" - " floatOut[1] = HUGE_VALF;\n" - "\n" - " intOut[14] = ( NAN == NAN ) ? 1 : 0;\n" - " intOut[15] = ( NAN != NAN ) ? 1 : 0;\n" - " intOut[16] = isnan( NAN ) ? 1 : 0;\n" - " intOut[17] = isinf( NAN ) ? 1 : 0;\n" - " intOut[18] = isnormal( NAN ) ? 1 : 0;\n" - " intOut[19] = ( ( as_uint( NAN ) & 0x7fffffff ) > 0x7f800000 ) ? 1 : 0;\n" - " intOut[20] = sizeof( NAN );\n" - " floatOut[2] = NAN;\n" - "\n" - " intOut[21] = isnan( INFINITY / INFINITY ) ? 1 : 0;\n" - " intOut[22] = isnan( INFINITY - INFINITY ) ? 1 : 0;\n" - " intOut[23] = isnan( 0.f / 0.f ) ? 1 : 0;\n" - " intOut[24] = isnan( INFINITY * 0.f ) ? 1 : 0;\n" - " intOut[25] = ( INFINITY == NAN ); \n" - " intOut[26] = ( -INFINITY == NAN ); \n" - " intOut[27] = ( INFINITY > NAN ); \n" - " intOut[28] = ( -INFINITY < NAN ); \n" - " intOut[29] = ( INFINITY != NAN ); \n" - " intOut[30] = ( NAN > INFINITY ); \n" - " intOut[31] = ( NAN < -INFINITY ); \n" - - "}\n" -}; - -const char *kernel_constant_double_limits[] = { - "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n" - "__kernel void test( __global int *intOut, __global double *doubleOut ) \n" - "{\n" - " intOut[0] = sizeof( HUGE_VAL );\n" - " intOut[1] = ( HUGE_VAL == INFINITY ) ? 1 : 0;\n" - " intOut[2] = isinf( HUGE_VAL ) ? 1 : 0;\n" - " intOut[3] = isnormal( HUGE_VAL ) ? 1 : 0;\n" - " intOut[4] = isnan( HUGE_VAL ) ? 1 : 0;\n" - " intOut[5] = ( HUGE_VAL == HUGE_VALF ) ? 1 : 0;\n" - " intOut[6] = ( as_ulong( HUGE_VAL ) == 0x7ff0000000000000UL ) ? 1 : 0;\n" - " doubleOut[0] = HUGE_VAL;\n" - "}\n" -}; - -#define TEST_FLOAT_ASSERTION( a, msg, f ) if( !( a ) ) { log_error( "ERROR: Float constant failed requirement: %s (bitwise value is 0x%8.8x)\n", msg, *( (uint32_t *)&f ) ); return -1; } -#define TEST_DOUBLE_ASSERTION( a, msg, f ) if( !( a ) ) { log_error( "ERROR: Double constant failed requirement: %s (bitwise value is 0x%16.16llx)\n", msg, *( (uint64_t *)&f ) ); return -1; } - -int test_kernel_limit_constants(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - size_t threads[] = {1,1,1}; - clMemWrapper intStream, floatStream, doubleStream; - cl_int intOut[ 32 ]; - cl_float floatOut[ 3 ]; - cl_double doubleOut[ 1 ]; - - - /* Create some I/O streams */ - intStream = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(intOut), NULL, &error ); - test_error( error, "Creating test array failed" ); - floatStream = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(floatOut), NULL, &error ); - test_error( error, "Creating test array failed" ); - - // Stage 1: basic limits on MAXFLOAT - { - clProgramWrapper program; - clKernelWrapper kernel; - - if( create_single_kernel_helper( context, &program, &kernel, 1, kernel_constant_limits, "test" ) != 0 ) - { - return -1; - } - - error = clSetKernelArg( kernel, 0, sizeof( intStream ), &intStream ); - test_error( error, "Unable to set indexed kernel arguments" ); - error = clSetKernelArg( kernel, 1, sizeof( floatStream ), &floatStream ); - test_error( error, "Unable to set indexed kernel arguments" ); - - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, NULL, 0, NULL, NULL ); - test_error( error, "Kernel execution failed" ); - - error = clEnqueueReadBuffer( queue, intStream, CL_TRUE, 0, sizeof(intOut), intOut, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - error = clEnqueueReadBuffer( queue, floatStream, CL_TRUE, 0, sizeof(floatOut), floatOut, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - - // Test MAXFLOAT properties - TEST_FLOAT_ASSERTION( intOut[0] == 0, "isinf( MAXFLOAT ) = false", floatOut[0] ) - TEST_FLOAT_ASSERTION( intOut[1] == 1, "isnormal( MAXFLOAT ) = true", floatOut[0] ) - TEST_FLOAT_ASSERTION( intOut[2] == 0, "isnan( MAXFLOAT ) = false", floatOut[0] ) - TEST_FLOAT_ASSERTION( intOut[3] == 4, "sizeof( MAXFLOAT ) = 4", floatOut[0] ) - TEST_FLOAT_ASSERTION( intOut[4] == 1, "MAXFLOAT = FLT_MAX", floatOut[0] ) - TEST_FLOAT_ASSERTION( floatOut[0] == CL_FLT_MAX, "MAXFLOAT = CL_FLT_MAX", floatOut[0] ) - TEST_FLOAT_ASSERTION( intOut[6] == 1, "MAXFLOAT = MAXFLOAT", floatOut[0] ) - TEST_FLOAT_ASSERTION( floatOut[0] == MAKE_HEX_FLOAT( 0x1.fffffep127f, 0x1fffffeL, 103), "MAXFLOAT = 0x1.fffffep127f", floatOut[0] ) - } - - // Stage 2: INFINITY and NAN - char profileStr[128] = ""; - error = clGetDeviceInfo( deviceID, CL_DEVICE_PROFILE, sizeof( profileStr ), &profileStr, NULL ); - test_error( error, "Unable to run INFINITY/NAN tests (unable to get CL_DEVICE_PROFILE" ); - - bool testInfNan = true; - if( strcmp( profileStr, "EMBEDDED_PROFILE" ) == 0 ) - { - // We test if we're not an embedded profile, OR if the inf/nan flag in the config is set - cl_device_fp_config single = 0; - error = clGetDeviceInfo( deviceID, CL_DEVICE_SINGLE_FP_CONFIG, sizeof( single ), &single, NULL ); - test_error( error, "Unable to run INFINITY/NAN tests (unable to get FP_CONFIG bits)" ); - - if( ( single & CL_FP_INF_NAN ) == 0 ) - { - log_info( "Skipping INFINITY and NAN tests on embedded device (INF/NAN not supported on this device)" ); - testInfNan = false; - } - } - - if( testInfNan ) - { - clProgramWrapper program; - clKernelWrapper kernel; - - if( create_single_kernel_helper( context, &program, &kernel, 1, kernel_constant_extended_limits, "test" ) != 0 ) - { - return -1; - } - - error = clSetKernelArg( kernel, 0, sizeof( intStream ), &intStream ); - test_error( error, "Unable to set indexed kernel arguments" ); - error = clSetKernelArg( kernel, 1, sizeof( floatStream ), &floatStream ); - test_error( error, "Unable to set indexed kernel arguments" ); - - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, NULL, 0, NULL, NULL ); - test_error( error, "Kernel execution failed" ); - - error = clEnqueueReadBuffer( queue, intStream, CL_TRUE, 0, sizeof(intOut), intOut, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - error = clEnqueueReadBuffer( queue, floatStream, CL_TRUE, 0, sizeof(floatOut), floatOut, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - - TEST_FLOAT_ASSERTION( intOut[0] == 1, "INFINITY == HUGE_VALF", intOut[0] ) - TEST_FLOAT_ASSERTION( intOut[1] == 4, "sizeof( INFINITY ) == 4", intOut[1] ) - TEST_FLOAT_ASSERTION( intOut[2] == 1, "isinf( INFINITY ) == true", intOut[2] ) - TEST_FLOAT_ASSERTION( intOut[3] == 0, "isnormal( INFINITY ) == false", intOut[3] ) - TEST_FLOAT_ASSERTION( intOut[4] == 0, "isnan( INFINITY ) == false", intOut[4] ) - TEST_FLOAT_ASSERTION( intOut[5] == 1, "INFINITY > MAXFLOAT", intOut[5] ) - TEST_FLOAT_ASSERTION( intOut[6] == 1, "-INFINITY < -MAXFLOAT", intOut[6] ) - TEST_FLOAT_ASSERTION( intOut[7] == 1, "( MAXFLOAT + MAXFLOAT ) == INFINITY", intOut[7] ) - TEST_FLOAT_ASSERTION( intOut[8] == 1, "nextafter( MAXFLOAT, INFINITY ) == INFINITY", intOut[8] ) - TEST_FLOAT_ASSERTION( intOut[9] == 1, "nextafter( -MAXFLOAT, -INFINITY ) == -INFINITY", intOut[9] ) - TEST_FLOAT_ASSERTION( intOut[10] == 1, "INFINITY = INFINITY", intOut[10] ) - TEST_FLOAT_ASSERTION( intOut[11] == 1, "asuint( INFINITY ) == 0x7f800000", intOut[11] ) - TEST_FLOAT_ASSERTION( *( (uint32_t *)&floatOut[0] ) == 0x7f800000, "asuint( INFINITY ) == 0x7f800000", floatOut[0] ) - TEST_FLOAT_ASSERTION( floatOut[1] == INFINITY, "INFINITY == INFINITY", floatOut[1] ) - - TEST_FLOAT_ASSERTION( intOut[12] == 4, "sizeof( HUGE_VALF ) == 4", intOut[12] ) - TEST_FLOAT_ASSERTION( intOut[13] == 1, "HUGE_VALF == INFINITY", intOut[13] ) - TEST_FLOAT_ASSERTION( floatOut[1] == HUGE_VALF, "HUGE_VALF == HUGE_VALF", floatOut[1] ) - - TEST_FLOAT_ASSERTION( intOut[14] == 0, "(NAN == NAN) = false", intOut[14] ) - TEST_FLOAT_ASSERTION( intOut[15] == 1, "(NAN != NAN) = true", intOut[15] ) - TEST_FLOAT_ASSERTION( intOut[16] == 1, "isnan( NAN ) = true", intOut[16] ) - TEST_FLOAT_ASSERTION( intOut[17] == 0, "isinf( NAN ) = false", intOut[17] ) - TEST_FLOAT_ASSERTION( intOut[18] == 0, "isnormal( NAN ) = false", intOut[18] ) - TEST_FLOAT_ASSERTION( intOut[19] == 1, "( as_uint( NAN ) & 0x7fffffff ) > 0x7f800000", intOut[19] ) - TEST_FLOAT_ASSERTION( intOut[20] == 4, "sizeof( NAN ) = 4", intOut[20] ) - TEST_FLOAT_ASSERTION( ( *( (uint32_t *)&floatOut[2] ) & 0x7fffffff ) > 0x7f800000, "( as_uint( NAN ) & 0x7fffffff ) > 0x7f800000", floatOut[2] ) - - TEST_FLOAT_ASSERTION( intOut[ 21 ] == 1, "isnan( INFINITY / INFINITY ) = true", intOut[ 21 ] ) - TEST_FLOAT_ASSERTION( intOut[ 22 ] == 1, "isnan( INFINITY - INFINITY ) = true", intOut[ 22 ] ) - TEST_FLOAT_ASSERTION( intOut[ 23 ] == 1, "isnan( 0.f / 0.f ) = true", intOut[ 23 ] ) - TEST_FLOAT_ASSERTION( intOut[ 24 ] == 1, "isnan( INFINITY * 0.f ) = true", intOut[ 24 ] ) - TEST_FLOAT_ASSERTION( intOut[ 25 ] == 0, "( INFINITY == NAN ) = false", intOut[ 25 ] ) - TEST_FLOAT_ASSERTION( intOut[ 26 ] == 0, "(-INFINITY == NAN ) = false", intOut[ 26 ] ) - TEST_FLOAT_ASSERTION( intOut[ 27 ] == 0, "( INFINITY > NAN ) = false", intOut[ 27 ] ) - TEST_FLOAT_ASSERTION( intOut[ 28 ] == 0, "(-INFINITY < NAN ) = false", intOut[ 28 ] ) - TEST_FLOAT_ASSERTION( intOut[ 29 ] == 1, "( INFINITY != NAN ) = true", intOut[ 29 ] ) - TEST_FLOAT_ASSERTION( intOut[ 30 ] == 0, "( NAN < INFINITY ) = false", intOut[ 30 ] ) - TEST_FLOAT_ASSERTION( intOut[ 31 ] == 0, "( NAN > -INFINITY ) = false", intOut[ 31 ] ) - } - - // Stage 3: limits on HUGE_VAL (double) - if( !is_extension_available( deviceID, "cl_khr_fp64" ) ) - log_info( "Note: Skipping double HUGE_VAL tests (doubles unsupported on device)\n" ); - else - { - cl_device_fp_config config = 0; - error = clGetDeviceInfo( deviceID, CL_DEVICE_DOUBLE_FP_CONFIG, sizeof( config ), &config, NULL ); - test_error( error, "Unable to run INFINITY/NAN tests (unable to get double FP_CONFIG bits)" ); - - if( ( config & CL_FP_INF_NAN ) == 0 ) - log_info( "Skipping HUGE_VAL tests (INF/NAN not supported on this device)" ); - else - { - clProgramWrapper program; - clKernelWrapper kernel; - - if( create_single_kernel_helper( context, &program, &kernel, 1, kernel_constant_double_limits, "test" ) != 0 ) - { - return -1; - } - - doubleStream = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(doubleOut), NULL, &error ); - test_error( error, "Creating test array failed" ); - - error = clSetKernelArg( kernel, 0, sizeof( intStream ), &intStream ); - test_error( error, "Unable to set indexed kernel arguments" ); - error = clSetKernelArg( kernel, 1, sizeof( doubleStream ), &doubleStream ); - test_error( error, "Unable to set indexed kernel arguments" ); - - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, NULL, 0, NULL, NULL ); - test_error( error, "Kernel execution failed" ); - - error = clEnqueueReadBuffer( queue, intStream, CL_TRUE, 0, sizeof(intOut), intOut, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - error = clEnqueueReadBuffer( queue, doubleStream, CL_TRUE, 0, sizeof(doubleOut), doubleOut, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - - TEST_DOUBLE_ASSERTION( intOut[0] == 8, "sizeof( HUGE_VAL ) = 8", intOut[0] ) - TEST_DOUBLE_ASSERTION( intOut[1] == 1, "HUGE_VAL = INFINITY", intOut[1] ) - TEST_DOUBLE_ASSERTION( intOut[2] == 1, "isinf( HUGE_VAL ) = true", intOut[2] ) - TEST_DOUBLE_ASSERTION( intOut[3] == 0, "isnormal( HUGE_VAL ) = false", intOut[3] ) - TEST_DOUBLE_ASSERTION( intOut[4] == 0, "isnan( HUGE_VAL ) = false", intOut[4] ) - TEST_DOUBLE_ASSERTION( intOut[5] == 1, "HUGE_VAL = HUGE_VAL", intOut[5] ) - TEST_DOUBLE_ASSERTION( intOut[6] == 1, "as_ulong( HUGE_VAL ) = 0x7ff0000000000000UL", intOut[6] ) - TEST_DOUBLE_ASSERTION( *( (uint64_t *)&doubleOut[0] ) == 0x7ff0000000000000ULL, "as_ulong( HUGE_VAL ) = 0x7ff0000000000000UL", doubleOut[0] ) - } - } - - return 0; -} - - diff --git a/test_conformance/compatibility/test_conformance/basic/test_pointercast.c b/test_conformance/compatibility/test_conformance/basic/test_pointercast.c deleted file mode 100644 index 88a19aad..00000000 --- a/test_conformance/compatibility/test_conformance/basic/test_pointercast.c +++ /dev/null @@ -1,140 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - - -#include "procs.h" - -static const char *pointer_cast_kernel_code = -"__kernel void test_pointer_cast(__global unsigned char *src, __global unsigned int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -" __global unsigned int *p = (__global unsigned int *)src;\n" -"\n" -" dst[tid] = p[tid];\n" -"\n" -"}\n"; - - -int -verify_pointer_cast(unsigned char *inptr, unsigned int *outptr, int n) -{ - unsigned int *p = (unsigned int *)inptr; - int i; - cl_uint r; - - for (i=0; i - -// Test __FILE__, __LINE__, __OPENCL_VERSION__, __OPENCL_C_VERSION__, __ENDIAN_LITTLE__, __ROUNDING_MODE__, __IMAGE_SUPPORT__, __FAST_RELAXED_MATH__ -// __kernel_exec - -const char *preprocessor_test = { - "#line 2 \"%s\"\n" - "__kernel void test( __global int *results, __global char *outFileString, __global char *outRoundingString )\n" - "{\n" - - // Integer preprocessor macros - "#ifdef __IMAGE_SUPPORT__\n" - " results[0] = __IMAGE_SUPPORT__;\n" - "#else\n" - " results[0] = 0xf00baa;\n" - "#endif\n" - - "#ifdef __ENDIAN_LITTLE__\n" - " results[1] = __ENDIAN_LITTLE__;\n" - "#else\n" - " results[1] = 0xf00baa;\n" - "#endif\n" - - "#ifdef __OPENCL_VERSION__\n" - " results[2] = __OPENCL_VERSION__;\n" - "#else\n" - " results[2] = 0xf00baa;\n" - "#endif\n" - - "#ifdef __OPENCL_C_VERSION__\n" - " results[3] = __OPENCL_C_VERSION__;\n" - "#else\n" - " results[3] = 0xf00baa;\n" - "#endif\n" - - "#ifdef __LINE__\n" - " results[4] = __LINE__;\n" - "#else\n" - " results[4] = 0xf00baa;\n" - "#endif\n" - -#if 0 // Removed by Affie's request 2/24 - "#ifdef __FAST_RELAXED_MATH__\n" - " results[5] = __FAST_RELAXED_MATH__;\n" - "#else\n" - " results[5] = 0xf00baa;\n" - "#endif\n" -#endif - - "#ifdef __kernel_exec\n" - " results[6] = 1;\n" // By spec, we can only really evaluate that it is defined, not what it expands to - "#else\n" - " results[6] = 0xf00baa;\n" - "#endif\n" - - // String preprocessor macros. Technically, there are strings in OpenCL, but not really. - "#ifdef __FILE__\n" - " int i;\n" - " constant char *f = \"\" __FILE__;\n" - " for( i = 0; f[ i ] != 0 && i < 512; i++ )\n" - " outFileString[ i ] = f[ i ];\n" - " outFileString[ i ] = 0;\n" - "#else\n" - " outFileString[ 0 ] = 0;\n" - "#endif\n" - - "}\n" - }; - -int test_kernel_preprocessor_macros(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - clProgramWrapper program; - clKernelWrapper kernel; - clMemWrapper streams[ 3 ]; - - int error; - size_t threads[] = {1,1,1}; - - cl_int results[ 7 ]; - cl_char fileString[ 512 ] = "", roundingString[ 128 ] = ""; - char programSource[4096]; - char curFileName[512]; - char *programPtr = programSource; - int i = 0; - snprintf(curFileName, 512, "%s", __FILE__); -#ifdef _WIN32 - // Replace "\" with "\\" - while(curFileName[i] != '\0') { - if (curFileName[i] == '\\') { - int j = i + 1; - char prev = '\\'; - while (curFileName[j - 1] != '\0') { - char tmp = curFileName[j]; - curFileName[j] = prev; - prev = tmp; - j++; - } - i++; - } - i++; - } -#endif - sprintf(programSource,preprocessor_test,curFileName); - - // Create the kernel - if( create_single_kernel_helper( context, &program, &kernel, 1, (const char **)&programPtr, "test" ) != 0 ) - { - return -1; - } - - /* Create some I/O streams */ - streams[0] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(results), NULL, &error); - test_error( error, "Creating test array failed" ); - streams[1] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(fileString), NULL, &error); - test_error( error, "Creating test array failed" ); - streams[2] = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), sizeof(roundingString), NULL, &error); - test_error( error, "Creating test array failed" ); - - // Set up and run - for( int i = 0; i < 3; i++ ) - { - error = clSetKernelArg( kernel, i, sizeof( streams[i] ), &streams[i] ); - test_error( error, "Unable to set indexed kernel arguments" ); - } - - error = clEnqueueNDRangeKernel( queue, kernel, 1, NULL, threads, NULL, 0, NULL, NULL ); - test_error( error, "Kernel execution failed" ); - - error = clEnqueueReadBuffer( queue, streams[0], CL_TRUE, 0, sizeof(results), results, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - error = clEnqueueReadBuffer( queue, streams[1], CL_TRUE, 0, sizeof(fileString), fileString, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - error = clEnqueueReadBuffer( queue, streams[2], CL_TRUE, 0, sizeof(roundingString), roundingString, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - - - /////// Check the integer results - - // We need to check these values against what we know is supported on the device - if( checkForImageSupport( deviceID ) == 0 ) - { - // If images are supported, the constant should have been defined to the value 1 - if( results[ 0 ] == 0xf00baa ) - { - log_error( "ERROR: __IMAGE_SUPPORT__ undefined even though images are supported\n" ); - return -1; - } - else if( results[ 0 ] != 1 ) - { - log_error( "ERROR: __IMAGE_SUPPORT__ defined, but to the wrong value (defined as %d, spec states it should be 1)\n", (int)results[ 0 ] ); - return -1; - } - } - else - { - // If images aren't supported, the constant should be undefined - if( results[ 0 ] != 0xf00baa ) - { - log_error( "ERROR: __IMAGE_SUPPORT__ defined to value %d even though images aren't supported", (int)results[ 0 ] ); - return -1; - } - } - - // __ENDIAN_LITTLE__ is similar to __IMAGE_SUPPORT__: 1 if it's true, undefined if it isn't - cl_bool deviceIsLittleEndian; - error = clGetDeviceInfo( deviceID, CL_DEVICE_ENDIAN_LITTLE, sizeof( deviceIsLittleEndian ), &deviceIsLittleEndian, NULL ); - test_error( error, "Unable to get endian property of device to validate against" ); - - if( deviceIsLittleEndian ) - { - if( results[ 1 ] == 0xf00baa ) - { - log_error( "ERROR: __ENDIAN_LITTLE__ undefined even though the device is little endian\n" ); - return -1; - } - else if( results[ 1 ] != 1 ) - { - log_error( "ERROR: __ENDIAN_LITTLE__ defined, but to the wrong value (defined as %d, spec states it should be 1)\n", (int)results[ 1 ] ); - return -1; - } - } - else - { - if( results[ 1 ] != 0xf00baa ) - { - log_error( "ERROR: __ENDIAN_LITTLE__ defined to value %d even though the device is not little endian (should be undefined per spec)", (int)results[ 1 ] ); - return -1; - } - } - - // __OPENCL_VERSION__ - if( results[ 2 ] == 0xf00baa ) - { - log_error( "ERROR: Kernel preprocessor __OPENCL_VERSION__ undefined!" ); - return -1; - } - - // The OpenCL version reported by the macro reports the feature level supported by the compiler. Since - // this doesn't directly match any property we can query, we just check to see if it's a sane value - char versionBuffer[ 128 ]; - error = clGetDeviceInfo( deviceID, CL_DEVICE_VERSION, sizeof( versionBuffer ), versionBuffer, NULL ); - test_error( error, "Unable to get device's version to validate against" ); - - // We need to parse to get the version number to compare against - char *p1, *p2, *p3; - for( p1 = versionBuffer; ( *p1 != 0 ) && !isdigit( *p1 ); p1++ ) - ; - for( p2 = p1; ( *p2 != 0 ) && ( *p2 != '.' ); p2++ ) - ; - for( p3 = p2; ( *p3 != 0 ) && ( *p3 != ' ' ); p3++ ) - ; - - if( p2 == p3 ) - { - log_error( "ERROR: Unable to verify OpenCL version string (platform string is incorrect format)\n" ); - return -1; - } - *p2 = 0; - *p3 = 0; - int major = atoi( p1 ); - int minor = atoi( p2 + 1 ); - int realVersion = ( major * 100 ) + ( minor * 10 ); - if( ( results[ 2 ] < 100 ) || ( results[ 2 ] > realVersion ) ) - { - log_error( "ERROR: Kernel preprocessor __OPENCL_VERSION__ does not make sense w.r.t. device's version string! " - "(preprocessor states %d, real version is %d (%d.%d))\n", results[ 2 ], realVersion, major, minor ); - return -1; - } - - // __OPENCL_C_VERSION__ - if( results[ 3 ] == 0xf00baa ) - { - log_error( "ERROR: Kernel preprocessor __OPENCL_C_VERSION__ undefined!\n" ); - return -1; - } - - // The OpenCL C version reported by the macro reports the OpenCL C supported by the compiler for this OpenCL device. - char cVersionBuffer[ 128 ]; - error = clGetDeviceInfo( deviceID, CL_DEVICE_OPENCL_C_VERSION, sizeof( cVersionBuffer ), cVersionBuffer, NULL ); - test_error( error, "Unable to get device's OpenCL C version to validate against" ); - - // We need to parse to get the version number to compare against - for( p1 = cVersionBuffer; ( *p1 != 0 ) && !isdigit( *p1 ); p1++ ) - ; - for( p2 = p1; ( *p2 != 0 ) && ( *p2 != '.' ); p2++ ) - ; - for( p3 = p2; ( *p3 != 0 ) && ( *p3 != ' ' ); p3++ ) - ; - - if( p2 == p3 ) - { - log_error( "ERROR: Unable to verify OpenCL C version string (platform string is incorrect format)\n" ); - return -1; - } - *p2 = 0; - *p3 = 0; - major = atoi( p1 ); - minor = atoi( p2 + 1 ); - realVersion = ( major * 100 ) + ( minor * 10 ); - if( ( results[ 3 ] < 100 ) || ( results[ 3 ] > realVersion ) ) - { - log_error( "ERROR: Kernel preprocessor __OPENCL_C_VERSION__ does not make sense w.r.t. device's version string! " - "(preprocessor states %d, real version is %d (%d.%d))\n", results[ 2 ], realVersion, major, minor ); - return -1; - } - - // __LINE__ - if( results[ 4 ] == 0xf00baa ) - { - log_error( "ERROR: Kernel preprocessor __LINE__ undefined!" ); - return -1; - } - - // This is fun--we get to search for where __LINE__ actually is so we know what line it should define to! - // Note: it shows up twice, once for the #ifdef, and the other for the actual result output - const char *linePtr = strstr( preprocessor_test, "__LINE__" ); - if( linePtr == NULL ) - { - log_error( "ERROR: Nonsensical NULL pointer encountered!" ); - return -2; - } - linePtr = strstr( linePtr + strlen( "__LINE__" ), "__LINE__" ); - if( linePtr == NULL ) - { - log_error( "ERROR: Nonsensical NULL pointer encountered!" ); - return -2; - } - - // Now count how many carriage returns are before the string - const char *retPtr = strchr( preprocessor_test, '\n' ); - int retCount = 1; - for( ; ( retPtr < linePtr ) && ( retPtr != NULL ); retPtr = strchr( retPtr + 1, '\n' ) ) - retCount++; - - if( retCount != results[ 4 ] ) - { - log_error( "ERROR: Kernel preprocessor __LINE__ does not expand to the actual line number! (expanded to %d, but was on line %d)\n", - results[ 4 ], retCount ); - return -1; - } - -#if 0 // Removed by Affie's request 2/24 - // __FAST_RELAXED_MATH__ - // Since create_single_kernel_helper does NOT define -cl-fast-relaxed-math, this should be undefined - if( results[ 5 ] != 0xf00baa ) - { - log_error( "ERROR: Kernel preprocessor __FAST_RELAXED_MATH__ defined even though build option was not used (should be undefined)\n" ); - return -1; - } -#endif - - // __kernel_exec - // We can ONLY check to verify that it is defined - if( results[ 6 ] == 0xf00baa ) - { - log_error( "ERROR: Kernel preprocessor __kernel_exec must be defined\n" ); - return -1; - } - - //// String preprocessors - - // Since we provided the program directly, __FILE__ should compile to "". - if( fileString[ 0 ] == 0 ) - { - log_error( "ERROR: Kernel preprocessor __FILE__ undefined!\n" ); - return -1; - } - else if( strncmp( (char *)fileString, __FILE__, 512 ) != 0 ) - { - log_info( "WARNING: __FILE__ defined, but to an unexpected value (%s)\n\tShould be: \"%s\"", fileString, __FILE__ ); - return -1; - } - - -#if 0 // Removed by Affie's request 2/24 - // One more try through: try with -cl-fast-relaxed-math to make sure the appropriate preprocessor gets defined - clProgramWrapper programB = clCreateProgramWithSource( context, 1, preprocessor_test, NULL, &error ); - test_error( error, "Unable to create test program" ); - - // Try compiling - error = clBuildProgram( programB, 1, &deviceID, "-cl-fast-relaxed-math", NULL, NULL ); - test_error( error, "Unable to build program" ); - - // Create a kernel again to run against - clKernelWrapper kernelB = clCreateKernel( programB, "test", &error ); - test_error( error, "Unable to create testing kernel" ); - - // Set up and run - for( int i = 0; i < 3; i++ ) - { - error = clSetKernelArg( kernelB, i, sizeof( streams[i] ), &streams[i] ); - test_error( error, "Unable to set indexed kernel arguments" ); - } - - error = clEnqueueNDRangeKernel( queue, kernelB, 1, NULL, threads, NULL, 0, NULL, NULL ); - test_error( error, "Kernel execution failed" ); - - // Only need the one read - error = clEnqueueReadBuffer( queue, streams[0], CL_TRUE, 0, sizeof(results), results, 0, NULL, NULL ); - test_error( error, "Unable to get result data" ); - - // We only need to check the one result this time - if( results[ 5 ] == 0xf00baa ) - { - log_error( "ERROR: Kernel preprocessor __FAST_RELAXED_MATH__ not defined!\n" ); - return -1; - } - else if( results[ 5 ] != 1 ) - { - log_error( "ERROR: Kernel preprocessor __FAST_RELAXED_MATH__ not defined to 1 (was %d)\n", results[ 5 ] ); - return -1; - } -#endif - - return 0; -} - diff --git a/test_conformance/compatibility/test_conformance/basic/test_readimage.c b/test_conformance/compatibility/test_conformance/basic/test_readimage.c deleted file mode 100644 index e9de33c7..00000000 --- a/test_conformance/compatibility/test_conformance/basic/test_readimage.c +++ /dev/null @@ -1,244 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - - -#include "procs.h" - -static const char *bgra8888_kernel_code = -"\n" -"__kernel void test_bgra8888(read_only image2d_t srcimg, __global uchar4 *dst, sampler_t sampler)\n" -"{\n" -" int tid_x = get_global_id(0);\n" -" int tid_y = get_global_id(1);\n" -" int indx = tid_y * get_image_width(srcimg) + tid_x;\n" -" float4 color;\n" -"\n" -" color = read_imagef(srcimg, sampler, (int2)(tid_x, tid_y)) * 255.0f;\n" -" dst[indx] = convert_uchar4_rte(color.zyxw);\n" -"\n" -"}\n"; - - -static const char *rgba8888_kernel_code = -"\n" -"__kernel void test_rgba8888(read_only image2d_t srcimg, __global uchar4 *dst, sampler_t sampler)\n" -"{\n" -" int tid_x = get_global_id(0);\n" -" int tid_y = get_global_id(1);\n" -" int indx = tid_y * get_image_width(srcimg) + tid_x;\n" -" float4 color;\n" -"\n" -" color = read_imagef(srcimg, sampler, (int2)(tid_x, tid_y)) * 255.0f;\n" -" dst[indx] = convert_uchar4_rte(color);\n" -"\n" -"}\n"; - - -static unsigned char * -generate_8888_image(int w, int h, MTdata d) -{ - unsigned char *ptr = (unsigned char*)malloc(w * h * 4); - int i; - - for (i=0; i -#include -#include -#include - - -#include "procs.h" - -static const char *bgra8888_kernel_code = -"\n" -"__kernel void test_bgra8888(read_only image3d_t srcimg, __global float4 *dst, sampler_t sampler)\n" -"{\n" -" int tid_x = get_global_id(0);\n" -" int tid_y = get_global_id(1);\n" -" int tid_z = get_global_id(2);\n" -" int indx = (tid_z * get_image_height(srcimg) + tid_y) * get_image_width(srcimg) + tid_x;\n" -" float4 color;\n" -"\n" -" color = read_imagef(srcimg, sampler, (int4)(tid_x, tid_y, tid_z, 0));\n" -" dst[indx].x = color.z;\n" -" dst[indx].y = color.y;\n" -" dst[indx].z = color.x;\n" -" dst[indx].w = color.w;\n" -"\n" -"}\n"; - - -static const char *rgba8888_kernel_code = -"\n" -"__kernel void test_rgba8888(read_only image3d_t srcimg, __global float4 *dst, sampler_t sampler)\n" -"{\n" -" int tid_x = get_global_id(0);\n" -" int tid_y = get_global_id(1);\n" -" int tid_z = get_global_id(2);\n" -" int indx = (tid_z * get_image_height(srcimg) + tid_y) * get_image_width(srcimg) + tid_x;\n" -" float4 color;\n" -"\n" -" color = read_imagef(srcimg, sampler, (int4)(tid_x, tid_y, tid_z, 0));\n" -" //indx *= 4;\n" -" dst[indx].x = color.x;\n" -" dst[indx].y = color.y;\n" -" dst[indx].z = color.z;\n" -" dst[indx].w = color.w;\n" -"\n" -"}\n"; - - -static unsigned char * -generate_3d_image8(int w, int h, int d, MTdata data) -{ - unsigned char *ptr = (unsigned char*)malloc(w * h * d * 4); - int i; - - for (i=0; i -#include -#include -#include -#include "procs.h" - - - -cl_int get_type_size( cl_context context, cl_command_queue queue, const char *type, cl_ulong *size ) -{ - const char *sizeof_kernel_code[4] = - { - "", /* optional pragma string */ - "__kernel __attribute__((reqd_work_group_size(1,1,1))) void test_sizeof(__global uint *dst) \n" - "{\n" - " dst[0] = (uint) sizeof( ", type, " );\n" - "}\n" - }; - - cl_program p; - cl_kernel k; - cl_mem m; - cl_uint temp; - - - if (!strncmp(type, "double", 6)) - { - sizeof_kernel_code[0] = "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n"; - } - else if (!strncmp(type, "half", 4)) - { - sizeof_kernel_code[0] = "#pragma OPENCL EXTENSION cl_khr_fp16 : enable\n"; - } - - cl_int err = create_single_kernel_helper( context, &p, &k, 4, sizeof_kernel_code, "test_sizeof" ); - if( err ) - return err; - - m = clCreateBuffer( context, CL_MEM_WRITE_ONLY | CL_MEM_COPY_HOST_PTR, sizeof( cl_ulong ), size, &err ); - if( NULL == m ) - { - clReleaseProgram( p ); - clReleaseKernel( k ); - log_error("\nclCreateBuffer FAILED\n"); - return err; - } - - err = clSetKernelArg( k, 0, sizeof( cl_mem ), &m ); - if( err ) - { - clReleaseProgram( p ); - clReleaseKernel( k ); - clReleaseMemObject( m ); - log_error("\nclSetKernelArg FAILED\n"); - return err; - } - - err = clEnqueueTask( queue, k, 0, NULL, NULL ); - clReleaseProgram( p ); - clReleaseKernel( k ); - if( err ) - { - clReleaseMemObject( m ); - log_error( "\nclEnqueueTask FAILED\n" ); - return err; - } - - err = clEnqueueReadBuffer( queue, m, CL_TRUE, 0, sizeof( cl_uint ), &temp, 0, NULL, NULL ); - clReleaseMemObject( m ); - if( err ) - log_error( "\nclEnqueueReadBuffer FAILED\n" ); - - *size = (cl_ulong) temp; - - return err; -} - -typedef struct size_table -{ - const char *name; - cl_ulong size; - cl_ulong cl_size; -}size_table; - -const size_table scalar_table[] = -{ - // Fixed size entries from table 6.1 - { "char", 1, sizeof( cl_char ) }, - { "uchar", 1, sizeof( cl_uchar) }, - { "unsigned char", 1, sizeof( cl_uchar) }, - { "short", 2, sizeof( cl_short) }, - { "ushort", 2, sizeof( cl_ushort) }, - { "unsigned short", 2, sizeof( cl_ushort) }, - { "int", 4, sizeof( cl_int ) }, - { "uint", 4, sizeof( cl_uint) }, - { "unsigned int", 4, sizeof( cl_uint) }, - { "float", 4, sizeof( cl_float) }, - { "long", 8, sizeof( cl_long ) }, - { "ulong", 8, sizeof( cl_ulong) }, - { "unsigned long", 8, sizeof( cl_ulong) } -}; - -const size_table vector_table[] = -{ - // Fixed size entries from table 6.1 - { "char", 1, sizeof( cl_char ) }, - { "uchar", 1, sizeof( cl_uchar) }, - { "short", 2, sizeof( cl_short) }, - { "ushort", 2, sizeof( cl_ushort) }, - { "int", 4, sizeof( cl_int ) }, - { "uint", 4, sizeof( cl_uint) }, - { "float", 4, sizeof( cl_float) }, - { "long", 8, sizeof( cl_long ) }, - { "ulong", 8, sizeof( cl_ulong) } -}; - -const char *ptr_table[] = -{ - "global void*", - "size_t", - "sizeof(int)", // check return type of sizeof - "ptrdiff_t" -}; - -const char *other_types[] = -{ - "event_t", - "image2d_t", - "image3d_t", - "sampler_t" -}; - -static int IsPowerOfTwo( cl_ulong x ){ return 0 == (x & (x-1)); } - -int test_sizeof(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) -{ - size_t i, j; - cl_ulong test; - cl_uint ptr_size = CL_UINT_MAX; - cl_int err = CL_SUCCESS; - - // Check address space size - err = clGetDeviceInfo(device, CL_DEVICE_ADDRESS_BITS, sizeof(ptr_size), &ptr_size, NULL); - if( err || ptr_size > 64) - { - log_error( "FAILED: Unable to get CL_DEVICE_ADDRESS_BITS for device %p\n", device ); - return -1; - } - log_info( "\tCL_DEVICE_ADDRESS_BITS = %u\n", ptr_size ); - ptr_size /= 8; - - // Test standard scalar sizes - for( i = 0; i < sizeof( scalar_table ) / sizeof( scalar_table[0] ); i++ ) - { - if( ! gHasLong && - (0 == strcmp(scalar_table[i].name, "long") || - 0 == strcmp(scalar_table[i].name, "ulong") || - 0 == strcmp(scalar_table[i].name, "unsigned long"))) - { - log_info("\nLongs are not supported by this device. Skipping test.\t"); - continue; - } - - test = CL_ULONG_MAX; - err = get_type_size( context, queue, scalar_table[i].name, &test ); - if( err ) - return err; - if( test != scalar_table[i].size ) - { - log_error( "\nFAILED: Type %s has size %lld, but expected size %lld!\n", scalar_table[i].name, test, scalar_table[i].size ); - return -1; - } - if( test != scalar_table[i].cl_size ) - { - log_error( "\nFAILED: Type %s has size %lld, but cl_ size is %lld!\n", scalar_table[i].name, test, scalar_table[i].cl_size ); - return -2; - } - log_info( "%16s", scalar_table[i].name ); - } - log_info( "\n" ); - - // Test standard vector sizes - for( j = 2; j <= 16; j *= 2 ) - { - // For each vector size, iterate through types - for( i = 0; i < sizeof( vector_table ) / sizeof( vector_table[0] ); i++ ) - { - if( !gHasLong && - (0 == strcmp(vector_table[i].name, "long") || - 0 == strcmp(vector_table[i].name, "ulong"))) - { - log_info("\nLongs are not supported by this device. Skipping test.\t"); - continue; - } - - char name[32]; - sprintf( name, "%s%ld", vector_table[i].name, j ); - - test = CL_ULONG_MAX; - err = get_type_size( context, queue, name, &test ); - if( err ) - return err; - if( test != j * vector_table[i].size ) - { - log_error( "\nFAILED: Type %s has size %lld, but expected size %lld!\n", name, test, j * vector_table[i].size ); - return -1; - } - if( test != j * vector_table[i].cl_size ) - { - log_error( "\nFAILED: Type %s has size %lld, but cl_ size is %lld!\n", name, test, j * vector_table[i].cl_size ); - return -2; - } - log_info( "%16s", name ); - } - log_info( "\n" ); - } - - //Check that pointer sizes are correct - for( i = 0; i < sizeof( ptr_table ) / sizeof( ptr_table[0] ); i++ ) - { - test = CL_ULONG_MAX; - err = get_type_size( context, queue, ptr_table[i], &test ); - if( err ) - return err; - if( test != ptr_size ) - { - log_error( "\nFAILED: Type %s has size %lld, but expected size %u!\n", ptr_table[i], test, ptr_size ); - return -1; - } - log_info( "%16s", ptr_table[i] ); - } - - // Check that intptr_t is large enough - test = CL_ULONG_MAX; - err = get_type_size( context, queue, "intptr_t", &test ); - if( err ) - return err; - if( test < ptr_size ) - { - log_error( "\nFAILED: intptr_t has size %lld, but must be at least %u!\n", test, ptr_size ); - return -1; - } - if( ! IsPowerOfTwo( test ) ) - { - log_error( "\nFAILED: sizeof(intptr_t) is %lld, but must be a power of two!\n", test ); - return -2; - } - log_info( "%16s", "intptr_t" ); - - // Check that uintptr_t is large enough - test = CL_ULONG_MAX; - err = get_type_size( context, queue, "uintptr_t", &test ); - if( err ) - return err; - if( test < ptr_size ) - { - log_error( "\nFAILED: uintptr_t has size %lld, but must be at least %u!\n", test, ptr_size ); - return -1; - } - if( ! IsPowerOfTwo( test ) ) - { - log_error( "\nFAILED: sizeof(uintptr_t) is %lld, but must be a power of two!\n", test ); - return -2; - } - log_info( "%16s\n", "uintptr_t" ); - - //Check that other types are powers of two - for( i = 0; i < sizeof( other_types ) / sizeof( other_types[0] ); i++ ) - { - if( 0 == strcmp(other_types[i], "image2d_t") && - checkForImageSupport( device ) == CL_IMAGE_FORMAT_NOT_SUPPORTED) - { - log_info("\nimages are not supported by this device. Skipping test.\t"); - continue; - } - - if( gIsEmbedded && - 0 == strcmp(other_types[i], "image3d_t") && - checkFor3DImageSupport( device ) == CL_IMAGE_FORMAT_NOT_SUPPORTED) - { - log_info("\n3D images are not supported by this device. Skipping test.\t"); - continue; - } - - if( 0 == strcmp(other_types[i], "sampler_t") && - checkForImageSupport( device ) == CL_IMAGE_FORMAT_NOT_SUPPORTED) - { - log_info("\nimages are not supported by this device. Skipping test.\t"); - continue; - } - - test = CL_ULONG_MAX; - err = get_type_size( context, queue, other_types[i], &test ); - if( err ) - return err; - if( ! IsPowerOfTwo( test ) ) - { - log_error( "\nFAILED: Type %s has size %lld, which is not a power of two (section 6.1.5)!\n", other_types[i], test ); - return -1; - } - log_info( "%16s", other_types[i] ); - } - log_info( "\n" ); - - - //Check double - if( is_extension_available( device, "cl_khr_fp64" ) ) - { - log_info( "\tcl_khr_fp64:" ); - test = CL_ULONG_MAX; - err = get_type_size( context, queue, "double", &test ); - if( err ) - return err; - if( test != 8 ) - { - log_error( "\nFAILED: double has size %lld, but must be 8!\n", test ); - return -1; - } - log_info( "%16s", "double" ); - - // Test standard vector sizes - for( j = 2; j <= 16; j *= 2 ) - { - char name[32]; - sprintf( name, "double%ld", j ); - - test = CL_ULONG_MAX; - err = get_type_size( context, queue, name, &test ); - if( err ) - return err; - if( test != 8*j ) - { - log_error( "\nFAILED: %s has size %lld, but must be %ld!\n", name, test, 8 * j); - return -1; - } - log_info( "%16s", name ); - } - log_info( "\n" ); - } - - //Check half - if( is_extension_available( device, "cl_khr_fp16" ) ) - { - log_info( "\tcl_khr_fp16:" ); - test = CL_ULONG_MAX; - err = get_type_size( context, queue, "half", &test ); - if( err ) - return err; - if( test != 2 ) - { - log_error( "\nFAILED: half has size %lld, but must be 2!\n", test ); - return -1; - } - log_info( "%16s", "half" ); - - // Test standard vector sizes - for( j = 2; j <= 16; j *= 2 ) - { - char name[32]; - sprintf( name, "half%ld", j ); - - test = CL_ULONG_MAX; - err = get_type_size( context, queue, name, &test ); - if( err ) - return err; - if( test != 2*j ) - { - log_error( "\nFAILED: %s has size %lld, but must be %ld!\n", name, test, 2 * j); - return -1; - } - log_info( "%16s", name ); - } - log_info( "\n" ); - } - - return err; -} - - diff --git a/test_conformance/compatibility/test_conformance/basic/test_vec_type_hint.c b/test_conformance/compatibility/test_conformance/basic/test_vec_type_hint.c deleted file mode 100644 index d3b5fa76..00000000 --- a/test_conformance/compatibility/test_conformance/basic/test_vec_type_hint.c +++ /dev/null @@ -1,97 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - - -#include "procs.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" - - -static const char *sample_kernel = { - "%s\n" // optional pragma string - "__kernel __attribute__((vec_type_hint(%s%s))) void sample_test(__global int *src, __global int *dst)\n" - "{\n" - " int tid = get_global_id(0);\n" - " dst[tid] = src[tid];\n" - "\n" - "}\n" -}; - -int test_vec_type_hint(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - int vec_type_index, vec_size_index; - - ExplicitType vecType[] = { kChar, kUChar, kShort, kUShort, kInt, kUInt, kLong, kULong, kFloat, kDouble }; - const char *size_names[] = {"", "2", "4", "8", "16"}; - char *program_source; - - program_source = (char*)malloc(sizeof(char)*4096); - - for (vec_type_index=0; vec_type_index<10; vec_type_index++) { - if (vecType[vec_type_index] == kDouble) { - if (!is_extension_available(deviceID, "cl_khr_fp64")) { - log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); - continue; - } - log_info("Testing doubles.\n"); - } - - for (vec_size_index=0; vec_size_index<5; vec_size_index++) { - clProgramWrapper program; - clKernelWrapper kernel; - clMemWrapper in, out; - size_t global[] = {1,1,1}; - - log_info("Testing __attribute__((vec_type_hint(%s%s))...\n", get_explicit_type_name(vecType[vec_type_index]), size_names[vec_size_index]); - - program_source[0] = '\0'; - sprintf(program_source, sample_kernel, - (vecType[vec_type_index] == kDouble) ? "#pragma OPENCL EXTENSION cl_khr_fp64 : enable" : "", - get_explicit_type_name(vecType[vec_type_index]), size_names[vec_size_index]); - - error = create_single_kernel_helper( context, &program, &kernel, 1, (const char**)&program_source, "sample_test" ); - if( error != 0 ) - return error; - - in = clCreateBuffer(context, CL_MEM_READ_ONLY, sizeof(cl_int)*10, NULL, &error); - test_error(error, "clCreateBuffer failed"); - out = clCreateBuffer(context, CL_MEM_WRITE_ONLY, sizeof(cl_int)*10, NULL, &error); - test_error(error, "clCreateBuffer failed"); - - error = clSetKernelArg(kernel, 0, sizeof(in), &in); - test_error(error, "clSetKernelArg failed"); - error = clSetKernelArg(kernel, 1, sizeof(out), &out); - test_error(error, "clSetKernelArg failed"); - - error = clEnqueueNDRangeKernel(queue, kernel, 3, NULL, global, NULL, 0, NULL, NULL); - test_error(error, "clEnqueueNDRangeKernel failed"); - - error = clFinish(queue); - test_error(error, "clFinish failed"); - } - } - - free(program_source); - - return 0; -} diff --git a/test_conformance/compatibility/test_conformance/basic/test_vector_creation.cpp b/test_conformance/compatibility/test_conformance/basic/test_vector_creation.cpp deleted file mode 100644 index 9ab0103a..00000000 --- a/test_conformance/compatibility/test_conformance/basic/test_vector_creation.cpp +++ /dev/null @@ -1,406 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "procs.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/errorHelpers.h" - - - - -#define DEBUG 0 -#define DEPTH 16 -// Limit the maximum code size for any given kernel. -#define MAX_CODE_SIZE (1024*32) - -const int sizes[] = {1, 2, 3, 4, 8, 16, -1, -1, -1, -1}; -const char *size_names[] = {"", "2", "3", "4", "8", "16" , "!!a", "!!b", "!!c", "!!d"}; - -// Creates a kernel by enumerating all possible ways of building the vector out of vloads -// skip_to_results will skip results up to a given number. If the amount of code generated -// is greater than MAX_CODE_SIZE, this function will return the number of results used, -// which can then be used as the skip_to_result value to continue where it left off. -int create_kernel(ExplicitType type, int output_size, char *program, int *number_of_results, int skip_to_result) { - - int number_of_sizes; - - switch (output_size) { - case 1: - number_of_sizes = 1; - break; - case 2: - number_of_sizes = 2; - break; - case 3: - number_of_sizes = 3; - break; - case 4: - number_of_sizes = 4; - break; - case 8: - number_of_sizes = 5; - break; - case 16: - number_of_sizes = 6; - break; - default: - log_error("Invalid size: %d\n", output_size); - return -1; - } - - int total_results = 0; - int current_result = 0; - int total_vloads = 0; - int total_program_length = 0; - int aborted_due_to_size = 0; - - if (skip_to_result < 0) - skip_to_result = 0; - - // The line of code for the vector creation - char line[1024]; - // Keep track of what size vector we are using in each position so we can iterate through all fo them - int pos[DEPTH]; - int max_size = output_size; - if (DEBUG > 1) log_info("max_size: %d\n", max_size); - - program[0] = '\0'; - sprintf(program, "%s\n__kernel void test_vector_creation(__global %s *src, __global %s%s *result) {\n", - type == kDouble ? "#pragma OPENCL EXTENSION cl_khr_fp64 : enable" : "", - get_explicit_type_name(type), get_explicit_type_name(type), ( number_of_sizes == 3 ) ? "" : size_names[number_of_sizes-1]); - total_program_length += (int)strlen(program); - - char storePrefix[ 128 ], storeSuffix[ 128 ]; - - // Start out trying sizes 1,1,1,1,1... - for (int i=0; i 1) { - log_info("pos size[] = ["); - for (int k=0; k 1) log_info("vloads: %d, size_so_far:%d\n", vloads, size_so_far); - - // If they did not fit the required size exactly it is too long, so there is no point in checking any other combinations - // of the sizes to the right. Prune them from the search. - if (size_so_far != max_size) { - // Zero all the sizes to the right - for (int k=vloads+1; k=0; d--) { - pos[d]++; - if (pos[d] >= number_of_sizes) { - pos[d] = 0; - if (d == 0) { - // If we rolled over then we are done - done = 1; - break; - } - } else { - break; - } - } - // Go on to the next size since this one (and all others "under" it) didn't fit - continue; - } - - - // Generate the actual load line if we are building this part - line[0]= '\0'; - if (skip_to_result == 0 || total_results >= skip_to_result) { - if( number_of_sizes == 3 ) - { - sprintf( storePrefix, "vstore3( " ); - sprintf( storeSuffix, ", %d, result )", current_result ); - } - else - { - sprintf( storePrefix, "result[%d] = ", current_result ); - storeSuffix[ 0 ] = 0; - } - - sprintf(line, "\t%s(%s%d)(", storePrefix, get_explicit_type_name(type), output_size); - current_result++; - - int offset = 0; - for (int i=0; i MAX_CODE_SIZE) { - aborted_due_to_size = 1; - done = 1; - } - - - if (DEBUG) log_info("line is: %s", line); - - // If we did not use all of them, then we ignore any changes further to the right. - // We do this by causing those loops to skip on the next iteration. - if (vloads < DEPTH) { - if (DEBUG > 1) log_info("done with this depth\n"); - for (int k=vloads; k=0; d--) { - pos[d]++; - if (pos[d] >= number_of_sizes) { - pos[d] = 0; - if (d == 0) { - // If we rolled over at the far-left then we are done - done = 1; - break; - } - } else { - break; - } - } - if (done) - break; - - // Continue until we are done. - } - strcat(program, "}\n\n"); //log_info("%s\n", program); - total_program_length += 3; - if (DEBUG) log_info("\t\t(Program for vector type %s%s contains %d vector creations, of total program length %gkB, with a total of %d vloads.)\n", - get_explicit_type_name(type), size_names[number_of_sizes-1], total_results, total_program_length/1024.0, total_vloads); - *number_of_results = current_result; - if (aborted_due_to_size) - return total_results; - return 0; -} - - - - -int test_vector_creation(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - ExplicitType vecType[] = { kChar, kUChar, kShort, kUShort, kInt, kUInt, kLong, kULong, kFloat, kDouble }; - unsigned int vecSizes[] = { 1, 2, 3, 4, 8, 16}; - - char *program_source; - int error; - int total_errors = 0; - - cl_int input_data_int[16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; - cl_double input_data_double[16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; - void *input_data_converted; - void *output_data; - - int number_of_results;; - - input_data_converted = malloc(sizeof(cl_double)*16); - program_source = (char*)malloc(sizeof(char)*1024*1024*4); - - // Iterate over all the types - for (int type_index=0; type_index<10; type_index++) { - if(!gHasLong && ((vecType[type_index] == kLong) || (vecType[type_index] == kULong))) - { - log_info("Long/ULong data type not supported on this device\n"); - continue; - } - - clMemWrapper input; - - if (vecType[type_index] == kDouble) { - if (!is_extension_available(deviceID, "cl_khr_fp64")) { - log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); - continue; - } - log_info("Testing doubles.\n"); - } - - // Convert the data to the right format for the test. - memset(input_data_converted, 0xff, sizeof(cl_double)*16); - if (vecType[type_index] != kDouble) { - for (int j=0; j<16; j++) { - convert_explicit_value(&input_data_int[j], ((char*)input_data_converted)+get_explicit_type_size(vecType[type_index])*j, - kInt, 0, kRoundToEven, vecType[type_index]); - } - } else { - memcpy(input_data_converted, &input_data_double, sizeof(cl_double)*16); - } - - input = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, get_explicit_type_size(vecType[type_index])*16, - (vecType[type_index] != kDouble) ? input_data_converted : input_data_double, &error); - if (error) { - print_error(error, "clCreateBuffer failed"); - total_errors++; - continue; - } - - // Iterate over all the vector sizes. - for (int size_index=1; size_index< 5; size_index++) { - size_t global[] = {1,1,1}; - int number_generated = -1; - int previous_number_generated = 0; - - log_info("Testing %s%s...\n", get_explicit_type_name(vecType[type_index]), size_names[size_index]); - while (number_generated != 0) { - clMemWrapper output; - clKernelWrapper kernel; - clProgramWrapper program; - - number_generated = create_kernel(vecType[type_index], vecSizes[size_index], program_source, &number_of_results, number_generated); - if (number_generated != 0) { - if (previous_number_generated == 0) - log_info("Code size greater than %gkB; splitting test into multiple kernels.\n", MAX_CODE_SIZE/1024.0); - log_info("\tExecuting vector permutations %d to %d...\n", previous_number_generated, number_generated-1); - } - - error = create_single_kernel_helper(context, &program, &kernel, 1, (const char **)&program_source, "test_vector_creation"); - if (error) { - log_error("create_single_kernel_helper failed.\n"); - total_errors++; - break; - } - - output = clCreateBuffer(context, CL_MEM_WRITE_ONLY, - number_of_results*get_explicit_type_size(vecType[type_index])*vecSizes[size_index], - NULL, &error); - if (error) { - print_error(error, "clCreateBuffer failed"); - total_errors++; - break; - } - - error = clSetKernelArg(kernel, 0, sizeof(input), &input); - error |= clSetKernelArg(kernel, 1, sizeof(output), &output); - if (error) { - print_error(error, "clSetKernelArg failed"); - total_errors++; - break; - } - - error = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, global, NULL, 0, NULL, NULL); - if (error) { - print_error(error, "clEnqueueNDRangeKernel failed"); - total_errors++; - break; - } - - error = clFinish(queue); - if (error) { - print_error(error, "clFinish failed"); - total_errors++; - break; - } - - output_data = malloc(number_of_results*get_explicit_type_size(vecType[type_index])*vecSizes[size_index]); - if (output_data == NULL) { - log_error("Failed to allocate memory for output data.\n"); - total_errors++; - break; - } - memset(output_data, 0xff, number_of_results*get_explicit_type_size(vecType[type_index])*vecSizes[size_index]); - error = clEnqueueReadBuffer(queue, output, CL_TRUE, 0, - number_of_results*get_explicit_type_size(vecType[type_index])*vecSizes[size_index], - output_data, 0, NULL, NULL); - if (error) { - print_error(error, "clEnqueueReadBuffer failed"); - total_errors++; - free(output_data); - break; - } - - // Check the results - char *res = (char *)output_data; - char *exp = (char *)input_data_converted; - for (int i=0; i -#include -#include -#include - - -#include "procs.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" - -typedef struct work_item_data -{ - cl_uint workDim; - cl_uint globalSize[ 3 ]; - cl_uint globalID[ 3 ]; - cl_uint localSize[ 3 ]; - cl_uint localID[ 3 ]; - cl_uint numGroups[ 3 ]; - cl_uint groupID[ 3 ]; -}; - -static const char *workItemKernelCode = -"typedef struct {\n" -" uint workDim;\n" -" uint globalSize[ 3 ];\n" -" uint globalID[ 3 ];\n" -" uint localSize[ 3 ];\n" -" uint localID[ 3 ];\n" -" uint numGroups[ 3 ];\n" -" uint groupID[ 3 ];\n" -" } work_item_data;\n" -"\n" -"__kernel void sample_kernel( __global work_item_data *outData )\n" -"{\n" -" int id = get_global_id(0);\n" -" outData[ id ].workDim = (uint)get_work_dim();\n" -" for( uint i = 0; i < get_work_dim(); i++ )\n" -" {\n" -" outData[ id ].globalSize[ i ] = (uint)get_global_size( i );\n" -" outData[ id ].globalID[ i ] = (uint)get_global_id( i );\n" -" outData[ id ].localSize[ i ] = (uint)get_local_size( i );\n" -" outData[ id ].localID[ i ] = (uint)get_local_id( i );\n" -" outData[ id ].numGroups[ i ] = (uint)get_num_groups( i );\n" -" outData[ id ].groupID[ i ] = (uint)get_group_id( i );\n" -" }\n" -"}"; - -#define NUM_TESTS 1 - -int test_work_item_functions(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - - clProgramWrapper program; - clKernelWrapper kernel; - clMemWrapper outData; - work_item_data testData[ 10240 ]; - size_t threads[3], localThreads[3]; - MTdata d; - - - error = create_single_kernel_helper( context, &program, &kernel, 1, &workItemKernelCode, "sample_kernel" ); - test_error( error, "Unable to create testing kernel" ); - - outData = clCreateBuffer( context, CL_MEM_READ_WRITE, sizeof( testData ), NULL, &error ); - test_error( error, "Unable to create output buffer" ); - - error = clSetKernelArg( kernel, 0, sizeof( outData ), &outData ); - test_error( error, "Unable to set kernel arg" ); - - d = init_genrand( gRandomSeed ); - for( size_t dim = 1; dim <= 3; dim++ ) - { - for( int i = 0; i < NUM_TESTS; i++ ) - { - size_t numItems = 1; - for( size_t j = 0; j < dim; j++ ) - { - // All of our thread sizes should be within the max local sizes, since they're all <= 20 - threads[ j ] = (size_t)random_in_range( 1, 20, d ); - localThreads[ j ] = threads[ j ] / (size_t)random_in_range( 1, (int)threads[ j ], d ); - while( localThreads[ j ] > 1 && ( threads[ j ] % localThreads[ j ] != 0 ) ) - localThreads[ j ]--; - - numItems *= threads[ j ]; - - // Hack for now: localThreads > 1 are iffy - localThreads[ j ] = 1; - } - error = clEnqueueNDRangeKernel( queue, kernel, (cl_uint)dim, NULL, threads, localThreads, 0, NULL, NULL ); - test_error( error, "Unable to run kernel" ); - - error = clEnqueueReadBuffer( queue, outData, CL_TRUE, 0, sizeof( testData ), testData, 0, NULL, NULL ); - test_error( error, "Unable to read results" ); - - // Validate - for( size_t q = 0; q < threads[0]; q++ ) - { - // We can't really validate the actual value of each one, but we can validate that they're within a sane range - if( testData[ q ].workDim != (cl_uint)dim ) - { - log_error( "ERROR: get_work_dim() did not return proper value for %d dimensions (expected %d, got %d)\n", (int)dim, (int)dim, (int)testData[ q ].workDim ); - free_mtdata(d); - return -1; - } - for( size_t j = 0; j < dim; j++ ) - { - if( testData[ q ].globalSize[ j ] != (cl_uint)threads[ j ] ) - { - log_error( "ERROR: get_global_size(%d) did not return proper value for %d dimensions (expected %d, got %d)\n", - (int)j, (int)dim, (int)threads[ j ], (int)testData[ q ].globalSize[ j ] ); - free_mtdata(d); - return -1; - } - if( testData[ q ].globalID[ j ] < 0 || testData[ q ].globalID[ j ] >= (cl_uint)threads[ j ] ) - { - log_error( "ERROR: get_global_id(%d) did not return proper value for %d dimensions (max %d, got %d)\n", - (int)j, (int)dim, (int)threads[ j ], (int)testData[ q ].globalID[ j ] ); - free_mtdata(d); - return -1; - } - if( testData[ q ].localSize[ j ] != (cl_uint)localThreads[ j ] ) - { - log_error( "ERROR: get_local_size(%d) did not return proper value for %d dimensions (expected %d, got %d)\n", - (int)j, (int)dim, (int)localThreads[ j ], (int)testData[ q ].localSize[ j ] ); - free_mtdata(d); - return -1; - } - if( testData[ q ].localID[ j ] < 0 && testData[ q ].localID[ j ] >= (cl_uint)localThreads[ j ] ) - { - log_error( "ERROR: get_local_id(%d) did not return proper value for %d dimensions (max %d, got %d)\n", - (int)j, (int)dim, (int)localThreads[ j ], (int)testData[ q ].localID[ j ] ); - free_mtdata(d); - return -1; - } - size_t groupCount = ( threads[ j ] + localThreads[ j ] - 1 ) / localThreads[ j ]; - if( testData[ q ].numGroups[ j ] != (cl_uint)groupCount ) - { - log_error( "ERROR: get_num_groups(%d) did not return proper value for %d dimensions (expected %d with global dim %d and local dim %d, got %d)\n", - (int)j, (int)dim, (int)groupCount, (int)threads[ j ], (int)localThreads[ j ], (int)testData[ q ].numGroups[ j ] ); - free_mtdata(d); - return -1; - } - if( testData[ q ].groupID[ j ] < 0 || testData[ q ].groupID[ j ] >= (cl_uint)groupCount ) - { - log_error( "ERROR: get_group_id(%d) did not return proper value for %d dimensions (max %d, got %d)\n", - (int)j, (int)dim, (int)groupCount, (int)testData[ q ].groupID[ j ] ); - free_mtdata(d); - return -1; - } - } - } - } - } - - free_mtdata(d); - return 0; -} - - diff --git a/test_conformance/compatibility/test_conformance/basic/test_writeimage.c b/test_conformance/compatibility/test_conformance/basic/test_writeimage.c deleted file mode 100644 index 26489a26..00000000 --- a/test_conformance/compatibility/test_conformance/basic/test_writeimage.c +++ /dev/null @@ -1,300 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - - -#include "procs.h" - -static const char *bgra8888_write_kernel_code = -"\n" -"__kernel void test_bgra8888_write(__global unsigned char *src, write_only image2d_t dstimg)\n" -"{\n" -" int tid_x = get_global_id(0);\n" -" int tid_y = get_global_id(1);\n" -" int indx = tid_y * get_image_width(dstimg) + tid_x;\n" -" float4 color;\n" -"\n" -" indx *= 4;\n" -" color = (float4)((float)src[indx+2], (float)src[indx+1], (float)src[indx+0], (float)src[indx+3]);\n" -" color /= (float4)(255.0f, 255.0f, 255.0f, 255.0f);\n" -" write_imagef(dstimg, (int2)(tid_x, tid_y), color);\n" -"\n" -"}\n"; - - -static const char *rgba8888_write_kernel_code = -"\n" -"__kernel void test_rgba8888_write(__global unsigned char *src, write_only image2d_t dstimg)\n" -"{\n" -" int tid_x = get_global_id(0);\n" -" int tid_y = get_global_id(1);\n" -" int indx = tid_y * get_image_width(dstimg) + tid_x;\n" -" float4 color;\n" -"\n" -" indx *= 4;\n" -" color = (float4)((float)src[indx+0], (float)src[indx+1], (float)src[indx+2], (float)src[indx+3]);\n" -" color /= (float4)(255.0f, 255.0f, 255.0f, 255.0f);\n" -" write_imagef(dstimg, (int2)(tid_x, tid_y), color);\n" -"\n" -"}\n"; - - -static unsigned char * -generate_8888_image(int w, int h, MTdata d) -{ - cl_uchar *ptr = (cl_uchar *)malloc(w * h * 4); - int i; - - for (i=0; i -#include -#include -#include - - -#include "procs.h" - - -static const char *rgbaFFFF_write_kernel_code = -"__kernel void test_rgbaFFFF_write(__global float *src, write_only image2d_t dstimg)\n" -"{\n" -" int tid_x = get_global_id(0);\n" -" int tid_y = get_global_id(1);\n" -" int indx = tid_y * get_image_width(dstimg) + tid_x;\n" -" float4 color;\n" -"\n" -" indx *= 4;\n" -" color = (float4)(src[indx+0], src[indx+1], src[indx+2], src[indx+3]);\n" -" write_imagef(dstimg, (int2)(tid_x, tid_y), color);\n" -"\n" -"}\n"; - - -static float * -generate_float_image(int w, int h, MTdata d) -{ - float *ptr = (float*)malloc(w * h * 4 * sizeof(float)); - int i; - - for (i=0; i -#include -#include -#include - - -#include "procs.h" - -static const char *rgba16_write_kernel_code = -"__kernel void test_rgba16_write(__global unsigned short *src, write_only image2d_t dstimg)\n" -"{\n" -" int tid_x = get_global_id(0);\n" -" int tid_y = get_global_id(1);\n" -" int indx = tid_y * get_image_width(dstimg) + tid_x;\n" -" float4 color;\n" -"\n" -" indx *= 4;\n" -" color = (float4)((float)src[indx+0], (float)src[indx+1], (float)src[indx+2], (float)src[indx+3]);\n" -" color /= 65535.0f;\n" -" write_imagef(dstimg, (int2)(tid_x, tid_y), color);\n" -"\n" -"}\n"; - - -static unsigned short * -generate_16bit_image(int w, int h, MTdata d) -{ - cl_ushort *ptr = (cl_ushort*)malloc(w * h * 4 * sizeof(cl_ushort)); - int i; - - for (i=0; i MAX_ERR) - { - log_error("%s failed\n", string); - return -1; - } - } - - log_info("%s passed\n", string); - return 0; -} - -int test_writeimage_int16(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) -{ - cl_mem streams[3]; - cl_program program; - cl_kernel kernel[2]; - cl_image_format img_format; - cl_ushort *input_ptr, *output_ptr; - size_t threads[2]; - int img_width = 512; - int img_height = 512; - int i, err, any_err = 0; - size_t origin[3] = {0, 0, 0}; - size_t region[3] = {img_width, img_height, 1}; - size_t length = img_width * img_height * 4 * sizeof(cl_ushort); - - PASSIVE_REQUIRE_IMAGE_SUPPORT( device ) - - MTdata d = init_genrand( gRandomSeed ); - input_ptr = generate_16bit_image(img_width, img_height, d); - free_mtdata(d); d = NULL; - - output_ptr = (cl_ushort*)malloc(length); - - img_format.image_channel_order = CL_RGBA; - img_format.image_channel_data_type = CL_UNORM_INT16; - streams[0] = create_image_2d(context, CL_MEM_READ_WRITE, &img_format, img_width, img_height, 0, NULL, NULL); - if (!streams[0]) - { - log_error("create_image_2d failed\n"); - return -1; - } - - img_format.image_channel_order = CL_RGBA; - img_format.image_channel_data_type = CL_UNORM_INT16; - streams[1] = create_image_2d(context, CL_MEM_WRITE_ONLY, &img_format, img_width, img_height, 0, NULL, NULL); - if (!streams[1]) - { - log_error("create_image_2d failed\n"); - return -1; - } - streams[2] = clCreateBuffer(context, CL_MEM_READ_WRITE, length, NULL, NULL); - if (!streams[2]) - { - log_error("clCreateArray failed\n"); - return -1; - } - - err = clEnqueueWriteBuffer(queue, streams[2], CL_TRUE, 0, length, input_ptr, 0, NULL, NULL); - if (err != CL_SUCCESS) - { - log_error("clEnqueueWriteBuffer failed\n"); - return -1; - } - - err = create_single_kernel_helper(context, &program, &kernel[0], 1, &rgba16_write_kernel_code, "test_rgba16_write" ); - if (err) - return -1; - kernel[1] = clCreateKernel(program, "test_rgba16_write", NULL); - if (!kernel[1]) - { - log_error("clCreateKernel failed\n"); - return -1; - } - - err = clSetKernelArg(kernel[0], 0, sizeof streams[2], &streams[2]); - err |= clSetKernelArg(kernel[0], 1, sizeof streams[0], &streams[0]); - if (err != CL_SUCCESS) - { - log_error("clSetKernelArgs failed\n"); - return -1; - } - - err = clSetKernelArg(kernel[1], 0, sizeof streams[2], &streams[2]); - err |= clSetKernelArg(kernel[1], 1, sizeof streams[1], &streams[1]); - if (err != CL_SUCCESS) - { - log_error("clSetKernelArgs failed\n"); - return -1; - } - - threads[0] = (unsigned int)img_width; - threads[1] = (unsigned int)img_height; - - for (i=0; i<2; i++) - { - err = clEnqueueNDRangeKernel(queue, kernel[i], 2, NULL, threads, NULL, 0, NULL, NULL); - if (err != CL_SUCCESS) - { - log_error("clExecuteKernel failed\n"); - return -1; - } - - err = clEnqueueReadImage(queue, streams[i], CL_TRUE, origin, region, 0, 0, output_ptr, 0, NULL, NULL); - if (err != CL_SUCCESS) - { - log_error("clReadImage failed\n"); - return -1; - } - - err = verify_16bit_image((i == 0) ? "WRITE_IMAGE_RGBA_UNORM_INT16 test with memflags = CL_MEM_READ_WRITE" : - "WRITE_IMAGE_RGBA_UNORM_INT16 test with memflags = CL_MEM_WRITE_ONLY", - input_ptr, output_ptr, img_width, img_height); - any_err |= err; - } - - // cleanup - clReleaseMemObject(streams[0]); - clReleaseMemObject(streams[1]); - clReleaseMemObject(streams[2]); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseProgram(program); - free(input_ptr); - free(output_ptr); - - return any_err; -} - - diff --git a/test_conformance/compatibility/test_conformance/images/image_helpers.h b/test_conformance/compatibility/test_conformance/images/image_helpers.h deleted file mode 100644 index cd0eff6c..00000000 --- a/test_conformance/compatibility/test_conformance/images/image_helpers.h +++ /dev/null @@ -1,533 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef _image_helpers_h -#define _image_helpers_h - -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include -#include - -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/imageHelpers.h" -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/mt19937.h" -#include "../../test_common/harness/rounding_mode.h" -#include "../../test_common/harness/clImageHelper.h" - -extern int gTestCount; -extern int gTestFailure; -extern cl_device_type gDeviceType; - -// Number of iterations per image format to test if not testing max images, rounding, or small images -#define NUM_IMAGE_ITERATIONS 3 - -// Definition for our own sampler type, to mirror the cl_sampler internals -typedef struct { - cl_addressing_mode addressing_mode; - cl_filter_mode filter_mode; - bool normalized_coords; -} image_sampler_data; - -extern void print_read_header( cl_image_format *format, image_sampler_data *sampler, bool err = false, int t = 0 ); -extern void print_write_header( cl_image_format *format, bool err); -extern void print_header( cl_image_format *format, bool err ); -extern bool find_format( cl_image_format *formatList, unsigned int numFormats, cl_image_format *formatToFind ); -extern bool check_minimum_supported( cl_image_format *formatList, unsigned int numFormats, cl_mem_flags flags ); - -cl_channel_type get_channel_type_from_name( const char *name ); -cl_channel_order get_channel_order_from_name( const char *name ); -int random_in_range( int minV, int maxV, MTdata d ); -int random_log_in_range( int minV, int maxV, MTdata d ); - -typedef struct -{ - size_t width; - size_t height; - size_t depth; - size_t rowPitch; - size_t slicePitch; - size_t arraySize; - cl_image_format *format; - cl_mem buffer; - cl_mem_object_type type; -} image_descriptor; - -typedef struct -{ - float p[4]; -}FloatPixel; - -void get_max_sizes(size_t *numberOfSizes, const int maxNumberOfSizes, - size_t sizes[][3], size_t maxWidth, size_t maxHeight, size_t maxDepth, size_t maxArraySize, - const cl_ulong maxIndividualAllocSize, const cl_ulong maxTotalAllocSize, cl_mem_object_type image_type, cl_image_format *format); -extern size_t get_format_max_int( cl_image_format *format ); - -extern char * generate_random_image_data( image_descriptor *imageInfo, BufferOwningPtr &Owner, MTdata d ); - -extern int debug_find_vector_in_image( void *imagePtr, image_descriptor *imageInfo, - void *vectorToFind, size_t vectorSize, int *outX, int *outY, int *outZ ); - -extern int debug_find_pixel_in_image( void *imagePtr, image_descriptor *imageInfo, - unsigned int *valuesToFind, int *outX, int *outY, int *outZ ); -extern int debug_find_pixel_in_image( void *imagePtr, image_descriptor *imageInfo, - int *valuesToFind, int *outX, int *outY, int *outZ ); -extern int debug_find_pixel_in_image( void *imagePtr, image_descriptor *imageInfo, - float *valuesToFind, int *outX, int *outY, int *outZ ); - -extern void copy_image_data( image_descriptor *srcImageInfo, image_descriptor *dstImageInfo, void *imageValues, void *destImageValues, - const size_t sourcePos[], const size_t destPos[], const size_t regionSize[] ); - -int has_alpha(cl_image_format *format); - -inline float calculate_array_index( float coord, float extent ); - -template void read_image_pixel( void *imageData, image_descriptor *imageInfo, - int x, int y, int z, T *outData ) -{ - float convert_half_to_float( unsigned short halfValue ); - - if ( x < 0 || x >= (int)imageInfo->width - || ( imageInfo->height != 0 && ( y < 0 || y >= (int)imageInfo->height ) ) - || ( imageInfo->depth != 0 && ( z < 0 || z >= (int)imageInfo->depth ) ) - || ( imageInfo->arraySize != 0 && ( z < 0 || z >= (int)imageInfo->arraySize ) ) ) - { - // Border color - outData[ 0 ] = outData[ 1 ] = outData[ 2 ] = outData[ 3 ] = 0; - if (!has_alpha(imageInfo->format)) - outData[3] = 1; - return; - } - - cl_image_format *format = imageInfo->format; - - unsigned int i; - T tempData[ 4 ]; - - // Advance to the right spot - char *ptr = (char *)imageData; - size_t pixelSize = get_pixel_size( format ); - - ptr += z * imageInfo->slicePitch + y * imageInfo->rowPitch + x * pixelSize; - - // OpenCL only supports reading floats from certain formats - switch( format->image_channel_data_type ) - { - case CL_SNORM_INT8: - { - cl_char *dPtr = (cl_char *)ptr; - for( i = 0; i < get_format_channel_count( format ); i++ ) - tempData[ i ] = (T)dPtr[ i ]; - break; - } - - case CL_UNORM_INT8: - { - cl_uchar *dPtr = (cl_uchar *)ptr; - for( i = 0; i < get_format_channel_count( format ); i++ ) - tempData[ i ] = (T)dPtr[ i ]; - break; - } - - case CL_SIGNED_INT8: - { - cl_char *dPtr = (cl_char *)ptr; - for( i = 0; i < get_format_channel_count( format ); i++ ) - tempData[ i ] = (T)dPtr[ i ]; - break; - } - - case CL_UNSIGNED_INT8: - { - cl_uchar *dPtr = (cl_uchar*)ptr; - for( i = 0; i < get_format_channel_count( format ); i++ ) - tempData[ i ] = (T)dPtr[ i ]; - break; - } - - case CL_SNORM_INT16: - { - cl_short *dPtr = (cl_short *)ptr; - for( i = 0; i < get_format_channel_count( format ); i++ ) - tempData[ i ] = (T)dPtr[ i ]; - break; - } - - case CL_UNORM_INT16: - { - cl_ushort *dPtr = (cl_ushort *)ptr; - for( i = 0; i < get_format_channel_count( format ); i++ ) - tempData[ i ] = (T)dPtr[ i ]; - break; - } - - case CL_SIGNED_INT16: - { - cl_short *dPtr = (cl_short *)ptr; - for( i = 0; i < get_format_channel_count( format ); i++ ) - tempData[ i ] = (T)dPtr[ i ]; - break; - } - - case CL_UNSIGNED_INT16: - { - cl_ushort *dPtr = (cl_ushort *)ptr; - for( i = 0; i < get_format_channel_count( format ); i++ ) - tempData[ i ] = (T)dPtr[ i ]; - break; - } - - case CL_HALF_FLOAT: - { - cl_ushort *dPtr = (cl_ushort *)ptr; - for( i = 0; i < get_format_channel_count( format ); i++ ) - tempData[ i ] = (T)convert_half_to_float( dPtr[ i ] ); - break; - } - - case CL_SIGNED_INT32: - { - cl_int *dPtr = (cl_int *)ptr; - for( i = 0; i < get_format_channel_count( format ); i++ ) - tempData[ i ] = (T)dPtr[ i ]; - break; - } - - case CL_UNSIGNED_INT32: - { - cl_uint *dPtr = (cl_uint *)ptr; - for( i = 0; i < get_format_channel_count( format ); i++ ) - tempData[ i ] = (T)dPtr[ i ]; - break; - } - - case CL_UNORM_SHORT_565: - { - cl_ushort *dPtr = (cl_ushort*)ptr; - tempData[ 0 ] = (T)( dPtr[ 0 ] >> 11 ); - tempData[ 1 ] = (T)( ( dPtr[ 0 ] >> 5 ) & 63 ); - tempData[ 2 ] = (T)( dPtr[ 0 ] & 31 ); - break; - } - -#ifdef OBSOLETE_FORMAT - case CL_UNORM_SHORT_565_REV: - { - unsigned short *dPtr = (unsigned short *)ptr; - tempData[ 2 ] = (T)( dPtr[ 0 ] >> 11 ); - tempData[ 1 ] = (T)( ( dPtr[ 0 ] >> 5 ) & 63 ); - tempData[ 0 ] = (T)( dPtr[ 0 ] & 31 ); - break; - } - - case CL_UNORM_SHORT_555_REV: - { - unsigned short *dPtr = (unsigned short *)ptr; - tempData[ 2 ] = (T)( ( dPtr[ 0 ] >> 10 ) & 31 ); - tempData[ 1 ] = (T)( ( dPtr[ 0 ] >> 5 ) & 31 ); - tempData[ 0 ] = (T)( dPtr[ 0 ] & 31 ); - break; - } - - case CL_UNORM_INT_8888: - { - unsigned int *dPtr = (unsigned int *)ptr; - tempData[ 3 ] = (T)( dPtr[ 0 ] >> 24 ); - tempData[ 2 ] = (T)( ( dPtr[ 0 ] >> 16 ) & 0xff ); - tempData[ 1 ] = (T)( ( dPtr[ 0 ] >> 8 ) & 0xff ); - tempData[ 0 ] = (T)( dPtr[ 0 ] & 0xff ); - break; - } - case CL_UNORM_INT_8888_REV: - { - unsigned int *dPtr = (unsigned int *)ptr; - tempData[ 0 ] = (T)( dPtr[ 0 ] >> 24 ); - tempData[ 1 ] = (T)( ( dPtr[ 0 ] >> 16 ) & 0xff ); - tempData[ 2 ] = (T)( ( dPtr[ 0 ] >> 8 ) & 0xff ); - tempData[ 3 ] = (T)( dPtr[ 0 ] & 0xff ); - break; - } - - case CL_UNORM_INT_101010_REV: - { - unsigned int *dPtr = (unsigned int *)ptr; - tempData[ 2 ] = (T)( ( dPtr[ 0 ] >> 20 ) & 0x3ff ); - tempData[ 1 ] = (T)( ( dPtr[ 0 ] >> 10 ) & 0x3ff ); - tempData[ 0 ] = (T)( dPtr[ 0 ] & 0x3ff ); - break; - } -#endif - case CL_UNORM_SHORT_555: - { - cl_ushort *dPtr = (cl_ushort *)ptr; - tempData[ 0 ] = (T)( ( dPtr[ 0 ] >> 10 ) & 31 ); - tempData[ 1 ] = (T)( ( dPtr[ 0 ] >> 5 ) & 31 ); - tempData[ 2 ] = (T)( dPtr[ 0 ] & 31 ); - break; - } - - case CL_UNORM_INT_101010: - { - cl_uint *dPtr = (cl_uint *)ptr; - tempData[ 0 ] = (T)( ( dPtr[ 0 ] >> 20 ) & 0x3ff ); - tempData[ 1 ] = (T)( ( dPtr[ 0 ] >> 10 ) & 0x3ff ); - tempData[ 2 ] = (T)( dPtr[ 0 ] & 0x3ff ); - break; - } - - case CL_FLOAT: - { - cl_float *dPtr = (cl_float *)ptr; - for( i = 0; i < get_format_channel_count( format ); i++ ) - tempData[ i ] = (T)dPtr[ i ]; - break; - } -#ifdef CL_SFIXED14_APPLE - case CL_SFIXED14_APPLE: - { - cl_float *dPtr = (cl_float *)ptr; - for( i = 0; i < get_format_channel_count( format ); i++ ) - tempData[ i ] = (T)dPtr[ i ] + 0x4000; - break; - } -#endif - } - - - outData[ 0 ] = outData[ 1 ] = outData[ 2 ] = 0; - outData[ 3 ] = 1; - - if( format->image_channel_order == CL_A ) - { - outData[ 3 ] = tempData[ 0 ]; - } - else if( format->image_channel_order == CL_R ) - { - outData[ 0 ] = tempData[ 0 ]; - } - else if( format->image_channel_order == CL_Rx ) - { - outData[ 0 ] = tempData[ 0 ]; - } - else if( format->image_channel_order == CL_RA ) - { - outData[ 0 ] = tempData[ 0 ]; - outData[ 3 ] = tempData[ 1 ]; - } - else if( format->image_channel_order == CL_RG ) - { - outData[ 0 ] = tempData[ 0 ]; - outData[ 1 ] = tempData[ 1 ]; - } - else if( format->image_channel_order == CL_RGx ) - { - outData[ 0 ] = tempData[ 0 ]; - outData[ 1 ] = tempData[ 1 ]; - } - else if( format->image_channel_order == CL_RGB ) - { - outData[ 0 ] = tempData[ 0 ]; - outData[ 1 ] = tempData[ 1 ]; - outData[ 2 ] = tempData[ 2 ]; - } - else if( format->image_channel_order == CL_RGBx ) - { - outData[ 0 ] = tempData[ 0 ]; - outData[ 1 ] = tempData[ 1 ]; - outData[ 2 ] = tempData[ 2 ]; - } - else if( format->image_channel_order == CL_RGBA ) - { - outData[ 0 ] = tempData[ 0 ]; - outData[ 1 ] = tempData[ 1 ]; - outData[ 2 ] = tempData[ 2 ]; - outData[ 3 ] = tempData[ 3 ]; - } - else if( format->image_channel_order == CL_ARGB ) - { - outData[ 0 ] = tempData[ 1 ]; - outData[ 1 ] = tempData[ 2 ]; - outData[ 2 ] = tempData[ 3 ]; - outData[ 3 ] = tempData[ 0 ]; - } - else if( format->image_channel_order == CL_BGRA ) - { - outData[ 0 ] = tempData[ 2 ]; - outData[ 1 ] = tempData[ 1 ]; - outData[ 2 ] = tempData[ 0 ]; - outData[ 3 ] = tempData[ 3 ]; - } - else if( format->image_channel_order == CL_INTENSITY ) - { - outData[ 1 ] = tempData[ 0 ]; - outData[ 2 ] = tempData[ 0 ]; - outData[ 3 ] = tempData[ 0 ]; - } - else if( format->image_channel_order == CL_LUMINANCE ) - { - outData[ 1 ] = tempData[ 0 ]; - outData[ 2 ] = tempData[ 0 ]; - } -#ifdef CL_1RGB_APPLE - else if( format->image_channel_order == CL_1RGB_APPLE ) - { - outData[ 0 ] = tempData[ 1 ]; - outData[ 1 ] = tempData[ 2 ]; - outData[ 2 ] = tempData[ 3 ]; - outData[ 3 ] = 0xff; - } -#endif -#ifdef CL_BGR1_APPLE - else if( format->image_channel_order == CL_BGR1_APPLE ) - { - outData[ 0 ] = tempData[ 2 ]; - outData[ 1 ] = tempData[ 1 ]; - outData[ 2 ] = tempData[ 0 ]; - outData[ 3 ] = 0xff; - } -#endif - else - { - log_error("Invalid format:"); - print_header(format, true); - } -} - -// Stupid template rules -bool get_integer_coords( float x, float y, float z, - size_t width, size_t height, size_t depth, - image_sampler_data *imageSampler, image_descriptor *imageInfo, - int &outX, int &outY, int &outZ ); -bool get_integer_coords_offset( float x, float y, float z, - float xAddressOffset, float yAddressOffset, float zAddressOffset, - size_t width, size_t height, size_t depth, - image_sampler_data *imageSampler, image_descriptor *imageInfo, - int &outX, int &outY, int &outZ ); - - -template void sample_image_pixel_offset( void *imageData, image_descriptor *imageInfo, - float x, float y, float z, float xAddressOffset, float yAddressOffset, float zAddressOffset, - image_sampler_data *imageSampler, T *outData ) -{ - int iX, iY, iZ; - - float max_w = imageInfo->width; - float max_h; - float max_d; - - switch (imageInfo->type) { - case CL_MEM_OBJECT_IMAGE1D_ARRAY: - max_h = imageInfo->arraySize; - max_d = 0; - break; - case CL_MEM_OBJECT_IMAGE2D_ARRAY: - max_h = imageInfo->height; - max_d = imageInfo->arraySize; - break; - default: - max_h = imageInfo->height; - max_d = imageInfo->depth; - break; - } - - get_integer_coords_offset( x, y, z, xAddressOffset, yAddressOffset, zAddressOffset, max_w, max_h, max_d, imageSampler, imageInfo, iX, iY, iZ ); - - read_image_pixel( imageData, imageInfo, iX, iY, iZ, outData ); -} - - -template void sample_image_pixel( void *imageData, image_descriptor *imageInfo, - float x, float y, float z, image_sampler_data *imageSampler, T *outData ) -{ - return sample_image_pixel_offset(imageData, imageInfo, x, y, z, 0.0f, 0.0f, 0.0f, imageSampler, outData); -} - -FloatPixel sample_image_pixel_float( void *imageData, image_descriptor *imageInfo, - float x, float y, float z, image_sampler_data *imageSampler, float *outData, int verbose, int *containsDenorms ); - -FloatPixel sample_image_pixel_float_offset( void *imageData, image_descriptor *imageInfo, - float x, float y, float z, float xAddressOffset, float yAddressOffset, float zAddressOffset, - image_sampler_data *imageSampler, float *outData, int verbose, int *containsDenorms ); - - -extern void pack_image_pixel( unsigned int *srcVector, const cl_image_format *imageFormat, void *outData ); -extern void pack_image_pixel( int *srcVector, const cl_image_format *imageFormat, void *outData ); -extern void pack_image_pixel( float *srcVector, const cl_image_format *imageFormat, void *outData ); -extern void pack_image_pixel_error( const float *srcVector, const cl_image_format *imageFormat, const void *results, float *errors ); - -extern char *create_random_image_data( ExplicitType dataType, image_descriptor *imageInfo, BufferOwningPtr &P, MTdata d ); - -// deprecated -// extern bool clamp_image_coord( image_sampler_data *imageSampler, float value, size_t max, int &outValue ); - -extern void get_sampler_kernel_code( image_sampler_data *imageSampler, char *outLine ); -extern float get_max_absolute_error( cl_image_format *format, image_sampler_data *sampler); -extern float get_max_relative_error( cl_image_format *format, image_sampler_data *sampler, int is3D, int isLinearFilter ); - - -#define errMax( _x , _y ) ( (_x) != (_x) ? (_x) : (_x) > (_y) ? (_x) : (_y) ) - -static inline cl_uint abs_diff_uint( cl_uint x, cl_uint y ) -{ - return y > x ? y - x : x - y; -} - -static inline cl_uint abs_diff_int( cl_int x, cl_int y ) -{ - return (cl_uint) (y > x ? y - x : x - y); -} - -static inline cl_float relative_error( float test, float expected ) -{ - // 0-0/0 is 0 in this case, not NaN - if( test == 0.0f && expected == 0.0f ) - return 0.0f; - - return (test - expected) / expected; -} - -extern float random_float(float low, float high); - -class CoordWalker -{ -public: - CoordWalker( void * coords, bool useFloats, size_t vecSize ); - ~CoordWalker(); - - cl_float Get( size_t idx, size_t el ); - -protected: - cl_float * mFloatCoords; - cl_int * mIntCoords; - size_t mVecSize; -}; - -extern int DetectFloatToHalfRoundingMode( cl_command_queue ); // Returns CL_SUCCESS on success - -int inline is_half_nan( cl_ushort half ){ return (half & 0x7fff) > 0x7c00; } - -cl_ushort convert_float_to_half( cl_float f ); -cl_float convert_half_to_float( cl_ushort h ); - - -#endif // _image_helpers_h - - diff --git a/test_conformance/compiler/CMakeLists.txt b/test_conformance/compiler/CMakeLists.txt index 422c5c5c..1090db38 100644 --- a/test_conformance/compiler/CMakeLists.txt +++ b/test_conformance/compiler/CMakeLists.txt @@ -1,26 +1,33 @@ set(MODULE_NAME COMPILER) set(${MODULE_NAME}_SOURCES - main.c - test_build_helpers.c - test_compile.c - test_async_build.c + main.cpp + test_build_helpers.cpp + test_compile.cpp + test_async_build.cpp test_build_options.cpp - test_preprocessor.c - test_image_macro.c + test_preprocessor.cpp + test_image_macro.cpp test_compiler_defines_for_extensions.cpp - test_pragma_unroll.c - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/threadTesting.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/typeWrappers.cpp - ../../test_common/harness/mt19937.c - ../../test_common/harness/conversions.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/os_helpers.cpp - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c + test_pragma_unroll.cpp + test_unload_platform_compiler.cpp ) include(../CMakeCommon.txt) + +# Copy required CL include directories into the binary directory + +set(COMPILER_SOURCE_DIR ${CLConform_SOURCE_DIR}/test_conformance/compiler) +set(COMPILER_TARGET ${${MODULE_NAME}_OUT}) + +add_custom_command( + TARGET ${COMPILER_TARGET} + COMMAND ${CMAKE_COMMAND} -E copy_directory + "${COMPILER_SOURCE_DIR}/includeTestDirectory" + $/includeTestDirectory) + +add_custom_command( + TARGET ${COMPILER_TARGET} + COMMAND ${CMAKE_COMMAND} -E copy_directory + "${COMPILER_SOURCE_DIR}/secondIncludeTestDirectory" + $/secondIncludeTestDirectory) diff --git a/test_conformance/compiler/main.c b/test_conformance/compiler/main.c deleted file mode 100644 index b1973939..00000000 --- a/test_conformance/compiler/main.c +++ /dev/null @@ -1,99 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include "procs.h" -#include "../../test_common/harness/testHarness.h" - -#if !defined(_WIN32) -#include -#endif - -test_definition test_list[] = { - ADD_TEST( load_program_source ), - ADD_TEST( load_multistring_source ), - ADD_TEST( load_two_kernel_source ), - ADD_TEST( load_null_terminated_source ), - ADD_TEST( load_null_terminated_multi_line_source ), - ADD_TEST( load_null_terminated_partial_multi_line_source ), - ADD_TEST( load_discreet_length_source ), - ADD_TEST( get_program_source ), - ADD_TEST( get_program_build_info ), - ADD_TEST( get_program_info ), - - ADD_TEST( large_compile ), - ADD_TEST( async_build ), - - ADD_TEST( options_build_optimizations ), - ADD_TEST( options_build_macro ), - ADD_TEST( options_build_macro_existence ), - ADD_TEST( options_include_directory ), - ADD_TEST( options_denorm_cache ), - - ADD_TEST( preprocessor_define_udef ), - ADD_TEST( preprocessor_include ), - ADD_TEST( preprocessor_line_error ), - ADD_TEST( preprocessor_pragma ), - - ADD_TEST( compiler_defines_for_extensions ), - ADD_TEST( image_macro ), - - ADD_TEST( simple_compile_only ), - ADD_TEST( simple_static_compile_only ), - ADD_TEST( simple_extern_compile_only ), - ADD_TEST( simple_compile_with_callback ), - ADD_TEST( simple_embedded_header_compile ), - ADD_TEST( simple_link_only ), - ADD_TEST( two_file_regular_variable_access ), - ADD_TEST( two_file_regular_struct_access ), - ADD_TEST( two_file_regular_function_access ), - ADD_TEST( simple_link_with_callback ), - ADD_TEST( simple_embedded_header_link ), - ADD_TEST( execute_after_simple_compile_and_link ), - ADD_TEST( execute_after_simple_compile_and_link_no_device_info ), - ADD_TEST( execute_after_simple_compile_and_link_with_defines ), - ADD_TEST( execute_after_simple_compile_and_link_with_callbacks ), - ADD_TEST( execute_after_simple_library_with_link ), - ADD_TEST( execute_after_two_file_link ), - ADD_TEST( execute_after_embedded_header_link ), - ADD_TEST( execute_after_included_header_link ), - ADD_TEST( execute_after_serialize_reload_object ), - ADD_TEST( execute_after_serialize_reload_library ), - ADD_TEST( simple_library_only ), - ADD_TEST( simple_library_with_callback ), - ADD_TEST( simple_library_with_link ), - ADD_TEST( two_file_link ), - ADD_TEST( multi_file_libraries ), - ADD_TEST( multiple_files ), - ADD_TEST( multiple_libraries ), - ADD_TEST( multiple_files_multiple_libraries ), - ADD_TEST( multiple_embedded_headers ), - - ADD_TEST( program_binary_type ), - ADD_TEST( compile_and_link_status_options_log ), - - ADD_TEST( pragma_unroll ), -}; - -const int test_num = ARRAY_SIZE( test_list ); - -int main(int argc, const char *argv[]) -{ - return runTestHarness( argc, argv, test_num, test_list, false, false, 0 ); -} - diff --git a/test_conformance/compiler/main.cpp b/test_conformance/compiler/main.cpp new file mode 100644 index 00000000..45b7496d --- /dev/null +++ b/test_conformance/compiler/main.cpp @@ -0,0 +1,108 @@ +// +// Copyright (c) 2017 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "harness/compat.h" + +#include "harness/testHarness.h" +#include "procs.h" +#include +#include + +#if !defined(_WIN32) +#include +#endif + +test_definition test_list[] = { + ADD_TEST(load_program_source), + ADD_TEST(load_multistring_source), + ADD_TEST(load_two_kernel_source), + ADD_TEST(load_null_terminated_source), + ADD_TEST(load_null_terminated_multi_line_source), + ADD_TEST(load_null_terminated_partial_multi_line_source), + ADD_TEST(load_discreet_length_source), + ADD_TEST(get_program_source), + ADD_TEST(get_program_build_info), + ADD_TEST(get_program_info), + + ADD_TEST(large_compile), + ADD_TEST(async_build), + + ADD_TEST(options_build_optimizations), + ADD_TEST(options_build_macro), + ADD_TEST(options_build_macro_existence), + ADD_TEST(options_include_directory), + ADD_TEST(options_denorm_cache), + + ADD_TEST(preprocessor_define_udef), + ADD_TEST(preprocessor_include), + ADD_TEST(preprocessor_line_error), + ADD_TEST(preprocessor_pragma), + + ADD_TEST(compiler_defines_for_extensions), + ADD_TEST(image_macro), + + ADD_TEST(simple_compile_only), + ADD_TEST(simple_static_compile_only), + ADD_TEST(simple_extern_compile_only), + ADD_TEST(simple_compile_with_callback), + ADD_TEST(simple_embedded_header_compile), + ADD_TEST(simple_link_only), + ADD_TEST(two_file_regular_variable_access), + ADD_TEST(two_file_regular_struct_access), + ADD_TEST(two_file_regular_function_access), + ADD_TEST(simple_link_with_callback), + ADD_TEST(simple_embedded_header_link), + ADD_TEST(execute_after_simple_compile_and_link), + ADD_TEST(execute_after_simple_compile_and_link_no_device_info), + ADD_TEST(execute_after_simple_compile_and_link_with_defines), + ADD_TEST(execute_after_simple_compile_and_link_with_callbacks), + ADD_TEST(execute_after_simple_library_with_link), + ADD_TEST(execute_after_two_file_link), + ADD_TEST(execute_after_embedded_header_link), + ADD_TEST(execute_after_included_header_link), + ADD_TEST(execute_after_serialize_reload_object), + ADD_TEST(execute_after_serialize_reload_library), + ADD_TEST(simple_library_only), + ADD_TEST(simple_library_with_callback), + ADD_TEST(simple_library_with_link), + ADD_TEST(two_file_link), + ADD_TEST(multi_file_libraries), + ADD_TEST(multiple_files), + ADD_TEST(multiple_libraries), + ADD_TEST(multiple_files_multiple_libraries), + ADD_TEST(multiple_embedded_headers), + + ADD_TEST(program_binary_type), + ADD_TEST(compile_and_link_status_options_log), + + ADD_TEST_VERSION(pragma_unroll, Version(2, 0)), + + ADD_TEST(unload_valid), + ADD_TEST(unload_invalid), + ADD_TEST(unload_repeated), + ADD_TEST(unload_compile_unload_link), + ADD_TEST(unload_build_unload_create_kernel), + ADD_TEST(unload_link_different), + ADD_TEST(unload_build_threaded), + ADD_TEST(unload_build_info), + ADD_TEST(unload_program_binaries), +}; + +const int test_num = ARRAY_SIZE(test_list); + +int main(int argc, const char *argv[]) +{ + return runTestHarness(argc, argv, test_num, test_list, false, false, 0); +} diff --git a/test_conformance/compiler/procs.h b/test_conformance/compiler/procs.h index a3cc5710..05d8bd5b 100644 --- a/test_conformance/compiler/procs.h +++ b/test_conformance/compiler/procs.h @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -13,76 +13,227 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/mt19937.h" +#include "harness/conversions.h" +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" +#include "harness/mt19937.h" +#include "harness/typeWrappers.h" -extern int test_load_program_source(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_load_multistring_source(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_load_two_kernel_source(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_load_null_terminated_source(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_load_null_terminated_multi_line_source(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_load_null_terminated_partial_multi_line_source(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_load_discreet_length_source(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_get_program_source(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_get_program_build_info(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_get_program_info(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); +extern int test_load_program_source(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_load_multistring_source(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_load_two_kernel_source(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_load_null_terminated_source(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_load_null_terminated_multi_line_source(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_load_null_terminated_partial_multi_line_source( + cl_device_id deviceID, cl_context context, cl_command_queue queue, + int num_elements); +extern int test_load_discreet_length_source(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_get_program_source(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_get_program_build_info(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_get_program_info(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); -extern int test_large_compile(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_async_build(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); +extern int test_large_compile(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_async_build(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); -extern int test_options_build_optimizations(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_options_build_macro(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_options_build_macro_existence(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_options_include_directory(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_options_denorm_cache(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); +extern int test_options_build_optimizations(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_options_build_macro(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_options_build_macro_existence(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_options_include_directory(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_options_denorm_cache(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); -extern int test_preprocessor_define_udef(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_preprocessor_include(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_preprocessor_line_error(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_preprocessor_pragma(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); +extern int test_preprocessor_define_udef(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_preprocessor_include(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_preprocessor_line_error(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_preprocessor_pragma(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); -extern int test_compiler_defines_for_extensions(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems ); -extern int test_image_macro(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); +extern int test_compiler_defines_for_extensions(cl_device_id device, + cl_context context, + cl_command_queue queue, + int n_elems); +extern int test_image_macro(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); -extern int test_simple_compile_only(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_simple_static_compile_only(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_simple_extern_compile_only(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_simple_compile_with_callback(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_simple_embedded_header_compile(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); +extern int test_simple_compile_only(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_simple_static_compile_only(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_simple_extern_compile_only(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_simple_compile_with_callback(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_simple_embedded_header_compile(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); -extern int test_simple_link_only(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_two_file_regular_variable_access(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_two_file_regular_struct_access(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_two_file_regular_function_access(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); +extern int test_simple_link_only(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_two_file_regular_variable_access(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_two_file_regular_struct_access(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_two_file_regular_function_access(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); -extern int test_simple_link_with_callback(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_simple_embedded_header_link(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); +extern int test_simple_link_with_callback(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_simple_embedded_header_link(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); -extern int test_execute_after_simple_compile_and_link(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_execute_after_simple_compile_and_link_no_device_info(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_execute_after_simple_compile_and_link_with_defines(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_execute_after_simple_compile_and_link_with_callbacks(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_execute_after_simple_library_with_link(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_execute_after_two_file_link(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_execute_after_embedded_header_link(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_execute_after_included_header_link(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_execute_after_serialize_reload_object(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_execute_after_serialize_reload_library(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); +extern int test_execute_after_simple_compile_and_link(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_execute_after_simple_compile_and_link_no_device_info( + cl_device_id deviceID, cl_context context, cl_command_queue queue, + int num_elements); +extern int test_execute_after_simple_compile_and_link_with_defines( + cl_device_id deviceID, cl_context context, cl_command_queue queue, + int num_elements); +extern int test_execute_after_simple_compile_and_link_with_callbacks( + cl_device_id deviceID, cl_context context, cl_command_queue queue, + int num_elements); +extern int test_execute_after_simple_library_with_link(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_execute_after_two_file_link(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_execute_after_embedded_header_link(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_execute_after_included_header_link(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_execute_after_serialize_reload_object(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_execute_after_serialize_reload_library(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); -extern int test_simple_library_only(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_simple_library_with_callback(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_simple_library_with_link(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_two_file_link(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_multi_file_libraries(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_multiple_libraries(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_multiple_files(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_multiple_files_multiple_libraries(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_multiple_embedded_headers(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); +extern int test_simple_library_only(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_simple_library_with_callback(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_simple_library_with_link(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_two_file_link(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_multi_file_libraries(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_multiple_libraries(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_multiple_files(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_multiple_files_multiple_libraries(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_multiple_embedded_headers(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); -extern int test_program_binary_type(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_compile_and_link_status_options_log(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); +extern int test_program_binary_type(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_compile_and_link_status_options_log(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); -extern int test_pragma_unroll(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); +extern int test_pragma_unroll(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); + +extern int test_unload_valid(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_unload_invalid(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_unload_repeated(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_unload_compile_unload_link(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_unload_build_unload_create_kernel(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_unload_link_different(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_unload_build_threaded(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_unload_build_info(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_unload_program_binaries(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + int num_elements); diff --git a/test_conformance/compiler/testBase.h b/test_conformance/compiler/testBase.h index 5073b21f..5b49bfd7 100644 --- a/test_conformance/compiler/testBase.h +++ b/test_conformance/compiler/testBase.h @@ -16,7 +16,7 @@ #ifndef _testBase_h #define _testBase_h -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/compiler/test_async_build.c b/test_conformance/compiler/test_async_build.c deleted file mode 100644 index 30024228..00000000 --- a/test_conformance/compiler/test_async_build.c +++ /dev/null @@ -1,93 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "testBase.h" - -#if !defined(_WIN32) -#include -#endif - - -const char *sample_async_kernel[] = { -"__kernel void sample_test(__global float *src, __global int *dst)\n" -"{\n" -" int tid = get_global_id(0);\n" -"\n" -" dst[tid] = (int)src[tid];\n" -"\n" -"}\n" }; - -volatile int buildNotificationSent; - -void CL_CALLBACK test_notify_build_complete( cl_program program, void *userData ) -{ - if( userData == NULL || strcmp( (char *)userData, "userData" ) != 0 ) - { - log_error( "ERROR: User data passed in to build notify function was not correct!\n" ); - buildNotificationSent = -1; - } - else - buildNotificationSent = 1; - log_info( "\n <-- program successfully built\n" ); -} - -int test_async_build(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - int error; - cl_program program; - cl_build_status status; - - - buildNotificationSent = 0; - - /* First, test by doing the slow method of the individual calls */ - error = create_single_kernel_helper_create_program(context, &program, 1, sample_async_kernel); - test_error(error, "Unable to create program from source"); - - /* Compile the program */ - error = clBuildProgram( program, 1, &deviceID, NULL, test_notify_build_complete, (void *)"userData" ); - test_error( error, "Unable to build program source" ); - - /* Wait for build to complete (just keep polling, since we're just a test */ - if( ( error = clGetProgramBuildInfo( program, deviceID, CL_PROGRAM_BUILD_STATUS, sizeof( status ), &status, NULL ) ) != CL_SUCCESS ) - { - print_error( error, "Unable to get program build status" ); - return -1; - } - while( (int)status == CL_BUILD_IN_PROGRESS ) - { - log_info( "\n -- still waiting for build... (status is %d)", status ); - sleep( 1 ); - error = clGetProgramBuildInfo( program, deviceID, CL_PROGRAM_BUILD_STATUS, sizeof( status ), &status, NULL ); - test_error( error, "Unable to get program build status" ); - } - - if( status != CL_BUILD_SUCCESS ) - { - log_error( "ERROR: build failed! (status: %d)\n", (int)status ); - return -1; - } - - if( buildNotificationSent == 0 ) - { - log_error( "ERROR: Async build completed, but build notification was not sent!\n" ); - return -1; - } - - error = clReleaseProgram( program ); - test_error( error, "Unable to release program object" ); - - return 0; -} diff --git a/test_conformance/compiler/test_async_build.cpp b/test_conformance/compiler/test_async_build.cpp new file mode 100644 index 00000000..d1533624 --- /dev/null +++ b/test_conformance/compiler/test_async_build.cpp @@ -0,0 +1,160 @@ +// +// Copyright (c) 2017-2020 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "testBase.h" + +#if !defined(_WIN32) +#include +#endif + +#include +#include + +namespace { + +const char *sample_async_kernel[] = { + "__kernel void sample_test(__global float *src, __global int *dst)\n" + "{\n" + " size_t tid = get_global_id(0);\n" + "\n" + " dst[tid] = (int)src[tid];\n" + "\n" + "}\n" +}; + +const char *sample_async_kernel_error[] = { + "__kernel void sample_test(__global float *src, __global int *dst)\n" + "{\n" + " size_t tid = get_global_id(0);\n" + "\n" + " dst[tid] = badcodehere;\n" + "\n" + "}\n" +}; + +// Data passed to a program completion callback +struct TestData +{ + cl_device_id device; + cl_build_status expectedStatus; +}; + +std::atomic callbackResult; + +} + +void CL_CALLBACK test_notify_build_complete(cl_program program, void *userData) +{ + TestData *data = reinterpret_cast(userData); + + // Check user data is valid + if (data == nullptr) + { + log_error("ERROR: User data passed to callback was not valid!\n"); + callbackResult = -1; + return; + } + + // Get program build status + cl_build_status status; + cl_int err = + clGetProgramBuildInfo(program, data->device, CL_PROGRAM_BUILD_STATUS, + sizeof(cl_build_status), &status, NULL); + if (err != CL_SUCCESS) + { + log_info("ERROR: failed to get build status from callback\n"); + callbackResult = -1; + return; + } + + log_info("Program completion callback received build status %d\n", status); + + // Check program build status matches expectation + if (status != data->expectedStatus) + { + log_info("ERROR: build status %d != expected status %d\n", status, + data->expectedStatus); + callbackResult = -1; + } + else + { + callbackResult = 1; + } +} + +int test_async_build(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements) +{ + cl_int error; + + struct TestDef + { + const char **source; + cl_build_status expectedStatus; + }; + + TestDef testDefs[] = { { sample_async_kernel, CL_BUILD_SUCCESS }, + { sample_async_kernel_error, CL_BUILD_ERROR } }; + for (TestDef &testDef : testDefs) + { + log_info("\nTesting program that should produce status %d\n", + testDef.expectedStatus); + + // Create the program + clProgramWrapper program; + error = create_single_kernel_helper_create_program(context, &program, 1, + testDef.source); + test_error(error, "Unable to create program from source"); + + // Start an asynchronous build, registering the completion callback + TestData testData = { deviceID, testDef.expectedStatus }; + callbackResult = 0; + error = clBuildProgram(program, 1, &deviceID, NULL, + test_notify_build_complete, (void *)&testData); + // Allow implementations to return synchronous build failures. + // They still need to call the callback. + if (!(error == CL_BUILD_PROGRAM_FAILURE + && testDef.expectedStatus == CL_BUILD_ERROR)) + test_error(error, "Unable to start build"); + + // Wait for callback to fire + int timeout = 20; + while (callbackResult == 0) + { + if (timeout < 0) + { + log_error("Timeout while waiting for callback to fire.\n\n"); + return -1; + } + + log_info(" -- still waiting for callback...\n"); + sleep(1); + timeout--; + } + + // Check the callback result + if (callbackResult == 1) + { + log_error("Test passed.\n\n"); + } + else + { + log_error("Async build callback indicated test failure.\n\n"); + return -1; + } + } + + return 0; +} diff --git a/test_conformance/compiler/test_build_helpers.c b/test_conformance/compiler/test_build_helpers.cpp similarity index 84% rename from test_conformance/compiler/test_build_helpers.c rename to test_conformance/compiler/test_build_helpers.cpp index 35875e04..6cfdcf27 100644 --- a/test_conformance/compiler/test_build_helpers.c +++ b/test_conformance/compiler/test_build_helpers.cpp @@ -14,8 +14,8 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/parseParameters.h" +#include "harness/testHarness.h" +#include "harness/parseParameters.h" const char *sample_kernel_code_single_line[] = { "__kernel void sample_test(__global float *src, __global int *dst)\n" @@ -26,8 +26,6 @@ const char *sample_kernel_code_single_line[] = { "\n" "}\n" }; -size_t sample_single_line_lengths[1]; - const char *sample_kernel_code_multi_line[] = { "__kernel void sample_test(__global float *src, __global int *dst)", "{", @@ -37,8 +35,6 @@ const char *sample_kernel_code_multi_line[] = { "", "}" }; -size_t sample_multi_line_lengths[ 7 ]; - const char *sample_kernel_code_two_line[] = { "__kernel void sample_test(__global float *src, __global int *dst)\n" "{\n" @@ -55,7 +51,6 @@ const char *sample_kernel_code_two_line[] = { "\n" "}\n" }; -size_t sample_two_line_lengths[1]; const char *sample_kernel_code_bad_multi_line[] = { "__kernel void sample_test(__global float *src, __global int *dst)", @@ -66,8 +61,6 @@ const char *sample_kernel_code_bad_multi_line[] = { "", "}" }; -size_t sample_bad_multi_line_lengths[ 7 ]; - int test_load_program_source(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) { @@ -76,21 +69,24 @@ int test_load_program_source(cl_device_id deviceID, cl_context context, cl_comma size_t length; char *buffer; - /* Preprocess: calc the length of each source file line */ - sample_single_line_lengths[ 0 ] = strlen( sample_kernel_code_single_line[ 0 ] ); + /* Preprocess: calc the length of the source file line */ + size_t line_length = strlen(sample_kernel_code_single_line[0]); /* New OpenCL API only has one entry point, so go ahead and just try it */ - program = clCreateProgramWithSource( context, 1, sample_kernel_code_single_line, sample_single_line_lengths, &error); + program = clCreateProgramWithSource( + context, 1, sample_kernel_code_single_line, &line_length, &error); test_error( error, "Unable to create reference program" ); /* Now get the source and compare against our original */ - error = clGetProgramInfo( program, CL_PROGRAM_SOURCE, NULL, NULL, &length ); + error = clGetProgramInfo( program, CL_PROGRAM_SOURCE, 0, NULL, &length ); test_error( error, "Unable to get length of first program source" ); // Note: according to spec section 5.4.5, the length returned should include the null terminator - if( length != sample_single_line_lengths[0] + 1 ) + if (length != line_length + 1) { - log_error( "ERROR: Length of program (%ld) does not match reference length (%ld)!\n", length, sample_single_line_lengths[0] + 1 ); + log_error("ERROR: Length of program (%ld) does not match reference " + "length (%ld)!\n", + length, line_length + 1); return -1; } @@ -117,15 +113,19 @@ int test_load_multistring_source(cl_device_id deviceID, cl_context context, cl_c int i; + constexpr int num_lines = ARRAY_SIZE(sample_kernel_code_multi_line); /* Preprocess: calc the length of each source file line */ - for( i = 0; i < 7; i++ ) + size_t line_lengths[num_lines]; + for (i = 0; i < num_lines; i++) { - sample_multi_line_lengths[ i ] = strlen( sample_kernel_code_multi_line[ i ] ); + line_lengths[i] = strlen(sample_kernel_code_multi_line[i]); } /* Create another program using the macro function */ - program = clCreateProgramWithSource( context, 7, sample_kernel_code_multi_line, sample_multi_line_lengths, &error ); + program = clCreateProgramWithSource(context, num_lines, + sample_kernel_code_multi_line, + line_lengths, &error); if( program == NULL ) { log_error( "ERROR: Unable to create reference program!\n" ); @@ -150,15 +150,18 @@ int test_load_two_kernel_source(cl_device_id deviceID, cl_context context, cl_co int i; + constexpr int num_lines = ARRAY_SIZE(sample_kernel_code_two_line); /* Preprocess: calc the length of each source file line */ - for( i = 0; i < 2; i++ ) + size_t line_lengths[num_lines]; + for (i = 0; i < num_lines; i++) { - sample_two_line_lengths[ i ] = strlen( sample_kernel_code_two_line[ i ] ); + line_lengths[i] = strlen(sample_kernel_code_two_line[i]); } /* Now create a program using the macro function */ - program = clCreateProgramWithSource( context, 2, sample_kernel_code_two_line, sample_two_line_lengths, &error ); + program = clCreateProgramWithSource( + context, num_lines, sample_kernel_code_two_line, line_lengths, &error); if( program == NULL ) { log_error( "ERROR: Unable to create two-kernel program!\n" ); @@ -211,8 +214,11 @@ int test_load_null_terminated_multi_line_source(cl_device_id deviceID, cl_contex cl_program program; + int num_lines = ARRAY_SIZE(sample_kernel_code_multi_line); + /* Now create a program using the macro function */ - program = clCreateProgramWithSource( context, 7, sample_kernel_code_multi_line, NULL, &error ); + program = clCreateProgramWithSource( + context, num_lines, sample_kernel_code_multi_line, NULL, &error); if( program == NULL ) { log_error( "ERROR: Unable to create null-terminated program!" ); @@ -240,18 +246,23 @@ int test_load_discreet_length_source(cl_device_id deviceID, cl_context context, int i; + constexpr int num_lines = ARRAY_SIZE(sample_kernel_code_bad_multi_line); /* Preprocess: calc the length of each source file line */ - for( i = 0; i < 7; i++ ) + size_t line_lengths[num_lines]; + for (i = 0; i < num_lines; i++) { - sample_bad_multi_line_lengths[ i ] = strlen( sample_kernel_code_bad_multi_line[ i ] ); + line_lengths[i] = strlen(sample_kernel_code_bad_multi_line[i]); } /* Now force the length of the third line to skip the actual error */ - sample_bad_multi_line_lengths[2] -= strlen("thisisanerror"); + static_assert(num_lines >= 3, "expected at least 3 lines in source"); + line_lengths[2] -= strlen("thisisanerror"); /* Now create a program using the macro function */ - program = clCreateProgramWithSource( context, 7, sample_kernel_code_bad_multi_line, sample_bad_multi_line_lengths, &error ); + program = clCreateProgramWithSource(context, num_lines, + sample_kernel_code_bad_multi_line, + line_lengths, &error); if( program == NULL ) { log_error( "ERROR: Unable to create null-terminated program!" ); @@ -277,17 +288,23 @@ int test_load_null_terminated_partial_multi_line_source(cl_device_id deviceID, c cl_program program; int i; + constexpr int num_lines = ARRAY_SIZE(sample_kernel_code_multi_line); + /* Preprocess: calc the length of each source file line */ - for( i = 0; i < 7; i++ ) + size_t line_lengths[num_lines]; + for (i = 0; i < num_lines; i++) { if( i & 0x01 ) - sample_multi_line_lengths[ i ] = 0; /* Should force for null-termination on this line only */ + line_lengths[i] = + 0; /* Should force for null-termination on this line only */ else - sample_multi_line_lengths[ i ] = strlen( sample_kernel_code_multi_line[ i ] ); + line_lengths[i] = strlen(sample_kernel_code_multi_line[i]); } /* Now create a program using the macro function */ - program = clCreateProgramWithSource( context, 7, sample_kernel_code_multi_line, sample_multi_line_lengths, &error ); + program = clCreateProgramWithSource(context, num_lines, + sample_kernel_code_multi_line, + line_lengths, &error); if( program == NULL ) { log_error( "ERROR: Unable to create null-terminated program!" ); @@ -366,7 +383,7 @@ int test_get_program_info(cl_device_id deviceID, cl_context context, cl_command_ test_error( error, "Unable to get instance count" ); /* While we're at it, test the sizes of programInfo too */ - error = clGetProgramInfo( program, CL_PROGRAM_DEVICES, NULL, NULL, ¶mSize ); + error = clGetProgramInfo( program, CL_PROGRAM_DEVICES, 0, NULL, ¶mSize ); test_error( error, "Unable to get device param size" ); if( paramSize != sizeof( cl_device_id ) ) { @@ -374,7 +391,7 @@ int test_get_program_info(cl_device_id deviceID, cl_context context, cl_command_ return -1; } - error = clGetProgramInfo( program, CL_PROGRAM_CONTEXT, NULL, NULL, ¶mSize ); + error = clGetProgramInfo( program, CL_PROGRAM_CONTEXT, 0, NULL, ¶mSize ); test_error( error, "Unable to get context param size" ); if( paramSize != sizeof( cl_context ) ) { @@ -382,7 +399,7 @@ int test_get_program_info(cl_device_id deviceID, cl_context context, cl_command_ return -1; } - error = clGetProgramInfo( program, CL_PROGRAM_REFERENCE_COUNT, NULL, NULL, ¶mSize ); + error = clGetProgramInfo( program, CL_PROGRAM_REFERENCE_COUNT, 0, NULL, ¶mSize ); test_error( error, "Unable to get instance param size" ); if( paramSize != sizeof( cl_uint ) ) { @@ -390,7 +407,7 @@ int test_get_program_info(cl_device_id deviceID, cl_context context, cl_command_ return -1; } - error = clGetProgramInfo( program, CL_PROGRAM_NUM_DEVICES, NULL, NULL, ¶mSize ); + error = clGetProgramInfo( program, CL_PROGRAM_NUM_DEVICES, 0, NULL, ¶mSize ); test_error( error, "Unable to get device count param size" ); if( paramSize != sizeof( cl_uint ) ) { @@ -421,9 +438,9 @@ int test_get_program_source(cl_device_id deviceID, cl_context context, cl_comman } /* Try getting the length */ - error = clGetProgramInfo( program, CL_PROGRAM_SOURCE, NULL, NULL, &length ); + error = clGetProgramInfo( program, CL_PROGRAM_SOURCE, 0, NULL, &length ); test_error( error, "Unable to get program source length" ); - if (length != strlen(sample_kernel_code_single_line[0]) + 1 && !(gOfflineCompiler && gOfflineCompilerOutputType != kSource)) + if (length != strlen(sample_kernel_code_single_line[0]) + 1 && gCompilationMode == kOnline) { log_error( "ERROR: Length returned for program source is incorrect!\n" ); return -1; @@ -432,7 +449,7 @@ int test_get_program_source(cl_device_id deviceID, cl_context context, cl_comman /* Try normal source */ error = clGetProgramInfo( program, CL_PROGRAM_SOURCE, sizeof( buffer ), buffer, NULL ); test_error( error, "Unable to get program source" ); - if (strlen(buffer) != strlen(sample_kernel_code_single_line[0]) && !(gOfflineCompiler && gOfflineCompilerOutputType != kSource)) + if (strlen(buffer) != strlen(sample_kernel_code_single_line[0]) && gCompilationMode == kOnline) { log_error( "ERROR: Length of program source is incorrect!\n" ); return -1; @@ -441,12 +458,12 @@ int test_get_program_source(cl_device_id deviceID, cl_context context, cl_comman /* Try both at once */ error = clGetProgramInfo( program, CL_PROGRAM_SOURCE, sizeof( buffer ), buffer, &length ); test_error( error, "Unable to get program source" ); - if (strlen(buffer) != strlen(sample_kernel_code_single_line[0]) && !(gOfflineCompiler && gOfflineCompilerOutputType != kSource)) + if (strlen(buffer) != strlen(sample_kernel_code_single_line[0]) && gCompilationMode == kOnline) { log_error( "ERROR: Length of program source is incorrect!\n" ); return -1; } - if (length != strlen(sample_kernel_code_single_line[0]) + 1 && !(gOfflineCompiler && gOfflineCompilerOutputType != kSource)) + if (length != strlen(sample_kernel_code_single_line[0]) + 1 && gCompilationMode == kOnline) { log_error( "ERROR: Returned length of program source is incorrect!\n" ); return -1; @@ -556,7 +573,7 @@ int test_get_program_build_info(cl_device_id deviceID, cl_context context, cl_co return -1; } - error = clGetProgramBuildInfo( program, deviceID, CL_PROGRAM_BUILD_OPTIONS, NULL, NULL, &length ); + error = clGetProgramBuildInfo( program, deviceID, CL_PROGRAM_BUILD_OPTIONS, 0, NULL, &length ); test_error( error, "Unable to get program build options" ); buffer = (char*)malloc(length); diff --git a/test_conformance/compiler/test_build_options.cpp b/test_conformance/compiler/test_build_options.cpp index 0e2f7ae8..71f84c30 100644 --- a/test_conformance/compiler/test_build_options.cpp +++ b/test_conformance/compiler/test_build_options.cpp @@ -14,7 +14,7 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/os_helpers.h" +#include "harness/os_helpers.h" const char *preprocessor_test_kernel[] = { "__kernel void sample_test(__global int *dst)\n" diff --git a/test_conformance/compiler/test_compile.c b/test_conformance/compiler/test_compile.cpp similarity index 99% rename from test_conformance/compiler/test_compile.c rename to test_conformance/compiler/test_compile.cpp index dc0d0972..f3ee4312 100644 --- a/test_conformance/compiler/test_compile.c +++ b/test_conformance/compiler/test_compile.cpp @@ -20,9 +20,7 @@ #include #include #endif -#include "../../test_common/harness/conversions.h" - -extern cl_uint gRandomSeed; +#include "harness/conversions.h" #define MAX_LINE_SIZE_IN_PROGRAM 1024 #define MAX_LOG_SIZE_IN_PROGRAM 2048 diff --git a/test_conformance/compiler/test_compiler_defines_for_extensions.cpp b/test_conformance/compiler/test_compiler_defines_for_extensions.cpp index ca89c70e..43f3f965 100644 --- a/test_conformance/compiler/test_compiler_defines_for_extensions.cpp +++ b/test_conformance/compiler/test_compiler_defines_for_extensions.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -21,8 +21,6 @@ #endif - - const char *known_extensions[] = { "cl_khr_byte_addressable_store", "cl_khr_3d_image_writes", @@ -45,7 +43,8 @@ const char *known_extensions[] = { "cl_khr_srgb_image_writes", "cl_khr_subgroup_named_barrier", - //API-only extensions after this point. If you add above here, modify first_API_extension below. + // API-only extensions after this point. If you add above here, modify + // first_API_extension below. "cl_khr_icd", "cl_khr_gl_sharing", "cl_khr_gl_event", @@ -63,6 +62,8 @@ const char *known_extensions[] = { "cl_khr_priority_hints", "cl_khr_throttle_hints", "cl_khr_spirv_no_integer_wrap_decoration", + "cl_khr_extended_versioning", + "cl_khr_device_uuid", }; size_t num_known_extensions = sizeof(known_extensions)/sizeof(char*); @@ -332,7 +333,10 @@ int test_compiler_defines_for_extensions(cl_device_id device, cl_context context cl_program program; cl_kernel kernel; - error = create_single_kernel_helper(context, &program, &kernel, 1, (const char **)&kernel_code, "test"); + Version version = get_device_cl_version(device); + + error = create_single_kernel_helper(context, &program, &kernel, 1, + (const char **)&kernel_code, "test"); test_error(error, "create_single_kernel_helper failed"); data = (cl_int*)malloc(sizeof(cl_int)*(num_not_supported_extensions+num_of_supported_extensions)); diff --git a/test_conformance/compiler/test_image_macro.c b/test_conformance/compiler/test_image_macro.cpp similarity index 98% rename from test_conformance/compiler/test_image_macro.c rename to test_conformance/compiler/test_image_macro.cpp index f85f092f..8a5c6707 100644 --- a/test_conformance/compiler/test_image_macro.c +++ b/test_conformance/compiler/test_image_macro.cpp @@ -57,7 +57,7 @@ int test_image_macro(cl_device_id deviceID, cl_context context, cl_command_queue return status; } - if( (image_support == CL_TRUE) ) + if (image_support == CL_TRUE) { status = create_single_kernel_helper_create_program(context, &program, 1, (const char**)&image_supported_source); diff --git a/test_conformance/compiler/test_pragma_unroll.c b/test_conformance/compiler/test_pragma_unroll.cpp similarity index 96% rename from test_conformance/compiler/test_pragma_unroll.c rename to test_conformance/compiler/test_pragma_unroll.cpp index 3a5cbf90..67f4b938 100644 --- a/test_conformance/compiler/test_pragma_unroll.c +++ b/test_conformance/compiler/test_pragma_unroll.cpp @@ -258,9 +258,13 @@ int test_pragma_unroll(cl_device_id deviceID, cl_context context, cl_command_que for (size_t kernelIdx = 0; kernelIdx < KERNEL_NUM; ++kernelIdx) { clProgramWrapper program; clKernelWrapper kernel; - if( create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, (const char **)&pragma_unroll_kernels[kernelIdx], "pragma_unroll", "-cl-std=CL2.0" ) ) { - log_error("The program we attempted to compile was: \n%s\n", pragma_unroll_kernels[kernelIdx]); - return -1; + if (create_single_kernel_helper( + context, &program, &kernel, 1, + (const char **)&pragma_unroll_kernels[kernelIdx], "pragma_unroll")) + { + log_error("The program we attempted to compile was: \n%s\n", + pragma_unroll_kernels[kernelIdx]); + return -1; } clMemWrapper buffer = clCreateBuffer(context, CL_MEM_READ_WRITE, ELEMENT_NUM * sizeof(cl_uint), NULL, &error); diff --git a/test_conformance/compiler/test_preprocessor.c b/test_conformance/compiler/test_preprocessor.cpp similarity index 99% rename from test_conformance/compiler/test_preprocessor.c rename to test_conformance/compiler/test_preprocessor.cpp index 4f3277c6..7308950a 100644 --- a/test_conformance/compiler/test_preprocessor.c +++ b/test_conformance/compiler/test_preprocessor.cpp @@ -14,9 +14,7 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/os_helpers.h" - -extern cl_uint gRandomSeed; +#include "harness/os_helpers.h" const char *define_kernel_code[] = { " #define VALUE\n" diff --git a/test_conformance/compiler/test_unload_platform_compiler.cpp b/test_conformance/compiler/test_unload_platform_compiler.cpp new file mode 100644 index 00000000..e55bd93f --- /dev/null +++ b/test_conformance/compiler/test_unload_platform_compiler.cpp @@ -0,0 +1,965 @@ +// +// Copyright (c) 2020 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "testBase.h" +#include "test_unload_platform_compiler_resources.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace { + +class unload_test_failure : public std::runtime_error { +public: + using std::runtime_error::runtime_error; + + explicit unload_test_failure(const std::string &function, cl_int error) + : std::runtime_error(function + " == " + std::to_string(error)) + {} +}; + +class build_base { +public: + build_base(cl_context context, cl_device_id device) + : m_context{ context }, m_device{ device } + {} + virtual ~build_base() { reset(); } + build_base(const build_base &) = delete; + build_base &operator=(const build_base &) = delete; + + virtual void create() = 0; + + virtual void compile() + { + assert(nullptr != m_program); + + const cl_int err = clCompileProgram(m_program, 1, &m_device, nullptr, 0, + nullptr, nullptr, nullptr, nullptr); + if (CL_SUCCESS != err) + throw unload_test_failure("clCompileProgram()", err); + } + + virtual void link() + { + assert(nullptr != m_program); + + cl_int err = CL_INVALID_PLATFORM; + m_executable = clLinkProgram(m_context, 1, &m_device, nullptr, 1, + &m_program, nullptr, nullptr, &err); + if (CL_SUCCESS != err) + throw unload_test_failure("clLinkProgram()", err); + if (nullptr == m_executable) + throw unload_test_failure("clLinkProgram returned nullptr"); + } + + virtual void verify() + { + assert(nullptr != m_executable); + + cl_int err = CL_INVALID_VALUE; + + const clKernelWrapper kernel = + clCreateKernel(m_executable, "write_kernel", &err); + if (CL_SUCCESS != err) + throw unload_test_failure("clCreateKernel()", err); + + const clCommandQueueWrapper queue = + clCreateCommandQueue(m_context, m_device, 0, &err); + if (CL_SUCCESS != err) + throw unload_test_failure("clCreateCommandQueue()", err); + + const clMemWrapper buffer = clCreateBuffer( + m_context, CL_MEM_READ_WRITE, sizeof(cl_uint), nullptr, &err); + if (CL_SUCCESS != err) + throw unload_test_failure("clCreateBuffer()", err); + + cl_uint value = 0; + + err = clSetKernelArg(kernel, 0, sizeof(buffer), &buffer); + if (CL_SUCCESS != err) + throw unload_test_failure("clSetKernelArg()", err); + + static const size_t work_size = 1; + err = clEnqueueNDRangeKernel(queue, kernel, 1, nullptr, &work_size, + nullptr, 0, nullptr, nullptr); + if (CL_SUCCESS != err) + throw unload_test_failure("clEnqueueNDRangeKernel()", err); + + err = clEnqueueReadBuffer(queue, buffer, CL_BLOCKING, 0, + sizeof(cl_uint), &value, 0, nullptr, nullptr); + if (CL_SUCCESS != err) + throw unload_test_failure("clEnqueueReadBuffer()", err); + + err = clFinish(queue); + if (CL_SUCCESS != err) throw unload_test_failure("clFinish()", err); + + if (42 != value) + { + throw unload_test_failure("Kernel wrote " + std::to_string(value) + + ", expected 42"); + } + } + + void reset() + { + if (m_program) + { + clReleaseProgram(m_program); + m_program = nullptr; + } + if (m_executable) + { + clReleaseProgram(m_executable); + m_executable = nullptr; + } + } + + void build() + { + compile(); + link(); + } + +protected: + const cl_context m_context; + const cl_device_id m_device; + cl_program m_program{}; + cl_program m_executable{}; +}; + +/** + * @brief initializer_list type for constructing loops over build tests. + */ +using build_list = std::initializer_list>; + +class build_with_source : public build_base { +public: + using build_base::build_base; + + void create() final + { + assert(nullptr == m_program); + + static const char *sources[] = { write_kernel_source }; + + cl_int err = CL_INVALID_PLATFORM; + m_program = + clCreateProgramWithSource(m_context, 1, sources, nullptr, &err); + if (CL_SUCCESS != err) + throw unload_test_failure("clCreateProgramWithSource()", err); + if (nullptr == m_program) + throw unload_test_failure( + "clCreateProgramWithSource returned nullptr"); + } +}; + +class build_with_binary : public build_base { +public: + build_with_binary(const cl_context context, const cl_device_id device, + const std::vector &binary) + : build_base{ context, device }, m_binary{ binary } + {} + + build_with_binary(const cl_context context, const cl_device_id device) + : build_base{ context, device } + { + cl_int err = CL_INVALID_VALUE; + + /* Build the program from source */ + static const char *sources[] = { write_kernel_source }; + clProgramWrapper program = + clCreateProgramWithSource(m_context, 1, sources, nullptr, &err); + if (CL_SUCCESS != err) + throw unload_test_failure("clCreateProgramWithSource()", err); + + err = clCompileProgram(program, 1, &m_device, nullptr, 0, nullptr, + nullptr, nullptr, nullptr); + if (CL_SUCCESS != err) + throw unload_test_failure("clCompileProgram()", err); + + const clProgramWrapper executable = + clLinkProgram(m_context, 1, &m_device, nullptr, 1, &program, + nullptr, nullptr, &err); + if (CL_SUCCESS != err) + throw unload_test_failure("clLinkProgram()", err); + + size_t binary_size; + err = clGetProgramInfo(executable, CL_PROGRAM_BINARY_SIZES, + sizeof(binary_size), &binary_size, nullptr); + if (CL_SUCCESS != err) + throw unload_test_failure("clGetProgramInfo()", err); + + m_binary.resize(binary_size); + + /* Grab the program binary */ + unsigned char *binaries[] = { m_binary.data() }; + err = clGetProgramInfo(executable, CL_PROGRAM_BINARIES, + sizeof(unsigned char *), binaries, nullptr); + if (CL_SUCCESS != err) + throw unload_test_failure("clGetProgramInfo()", err); + } + + void create() final + { + assert(nullptr == m_executable); + + const unsigned char *binaries[] = { m_binary.data() }; + const size_t binary_sizes[] = { m_binary.size() }; + + cl_int err = CL_INVALID_PLATFORM; + m_executable = clCreateProgramWithBinary( + m_context, 1, &m_device, binary_sizes, binaries, nullptr, &err); + if (CL_SUCCESS != err) + throw unload_test_failure("clCreateProgramWithBinary()", err); + if (nullptr == m_executable) + throw unload_test_failure( + "clCreateProgramWithBinary returned nullptr"); + } + + void compile() final + { + assert(nullptr != m_executable); + + /* Program created from binary, there is nothing to do */ + } + + void link() final + { + assert(nullptr != m_executable); + + const cl_int err = clBuildProgram(m_executable, 1, &m_device, nullptr, + nullptr, nullptr); + if (CL_SUCCESS != err) + throw unload_test_failure("clBuildProgram()", err); + } + +private: + std::vector m_binary; +}; + +class build_with_il : public build_base { +public: + build_with_il(const cl_context context, const cl_platform_id platform, + const cl_device_id device) + : build_base{ context, device } + { + Version version = get_device_cl_version(device); + std::string sILVersion = get_device_il_version_string(device); + if ((version >= Version(2, 1) && version < Version(3, 0)) + || (version >= Version(3, 0) && sILVersion.length() != 1)) + { + m_CreateProgramWithIL = clCreateProgramWithIL; + m_enabled = true; + } + else if (is_extension_available(device, "cl_khr_il_program")) + { + m_CreateProgramWithIL = (decltype(m_CreateProgramWithIL)) + clGetExtensionFunctionAddressForPlatform( + platform, "clCreateProgramWithILKHR"); + if (nullptr == m_CreateProgramWithIL) + { + throw unload_test_failure("cl_khr_il_program supported, but " + "function address is nullptr"); + } + m_enabled = true; + } + else + { + /* Disable build_with_il if neither core nor extension functionality + * is available */ + m_enabled = false; + } + + cl_uint address_bits{}; + const cl_int err = + clGetDeviceInfo(device, CL_DEVICE_ADDRESS_BITS, sizeof(cl_uint), + &address_bits, nullptr); + if (CL_SUCCESS != err) + { + throw unload_test_failure("Failure getting device address bits"); + } + + switch (address_bits) + { + case 32: + m_spirv_binary = write_kernel_32_spv.data(); + m_spirv_size = write_kernel_32_spv.size(); + break; + case 64: + m_spirv_binary = write_kernel_64_spv.data(); + m_spirv_size = write_kernel_64_spv.size(); + break; + default: throw unload_test_failure("Invalid address bits"); + } + } + + void create() final + { + if (!m_enabled) return; + + assert(nullptr == m_program); + + cl_int err = CL_INVALID_PLATFORM; + m_program = m_CreateProgramWithIL(m_context, m_spirv_binary, + m_spirv_size, &err); + if (CL_SUCCESS != err) + throw unload_test_failure("clCreateProgramWithIL()", err); + if (nullptr == m_program) + throw unload_test_failure("clCreateProgramWithIL returned nullptr"); + } + + void compile() final + { + if (!m_enabled) return; + build_base::compile(); + } + + void link() final + { + if (!m_enabled) return; + build_base::link(); + } + + void verify() final + { + if (!m_enabled) return; + build_base::verify(); + } + +private: + void *m_spirv_binary; + size_t m_spirv_size; + bool m_enabled; + + using CreateProgramWithIL_fn = decltype(&clCreateProgramWithIL); + CreateProgramWithIL_fn m_CreateProgramWithIL; +}; +} + +static cl_platform_id device_platform(cl_device_id device) +{ + cl_platform_id platform; + const cl_int err = clGetDeviceInfo(device, CL_DEVICE_PLATFORM, + sizeof(platform), &platform, nullptr); + if (CL_SUCCESS != err) + { + log_error("Failure getting platform of tested device\n"); + return nullptr; + } + + return platform; +} + +static void unload_platform_compiler(const cl_platform_id platform) +{ + const cl_int err = clUnloadPlatformCompiler(platform); + if (CL_SUCCESS != err) + throw unload_test_failure("clUnloadPlatformCompiler()", err); +} + +/* Test calling the function with a valid platform */ +int test_unload_valid(cl_device_id device, cl_context, cl_command_queue, int) +{ + const cl_platform_id platform = device_platform(device); + const long int err = clUnloadPlatformCompiler(platform); + + if (CL_SUCCESS != err) + { + log_error("Test failure: clUnloadPlatformCompiler() == %ld\n", err); + return 1; + } + + return 0; +} + +/* Test calling the function with invalid platform */ +int test_unload_invalid(cl_device_id, cl_context, cl_command_queue, int) +{ + const long int err = clUnloadPlatformCompiler(nullptr); + + if (CL_INVALID_PLATFORM != err) + { + log_error("Test failure: clUnloadPlatformCompiler() == %ld\n", err); + return 1; + } + + return 0; +} + +/* Test calling the function multiple times in a row */ +int test_unload_repeated(cl_device_id device, cl_context context, + cl_command_queue, int) +{ + const cl_platform_id platform = device_platform(device); + try + { + build_with_source source(context, device); + build_with_binary binary(context, device); + build_with_il il(context, platform, device); + + for (build_base &test : build_list{ source, binary, il }) + { + unload_platform_compiler(platform); + unload_platform_compiler(platform); + + test.create(); + test.build(); + test.verify(); + } + } catch (const unload_test_failure &e) + { + log_error("Test failure: %s\n", e.what()); + return 1; + } + + return 0; +} + +/* Test calling the function between compilation and linking of programs */ +int test_unload_compile_unload_link(cl_device_id device, cl_context context, + cl_command_queue, int) +{ + const cl_platform_id platform = device_platform(device); + try + { + build_with_source source(context, device); + build_with_binary binary(context, device); + build_with_il il(context, platform, device); + + for (build_base &test : build_list{ source, binary, il }) + { + unload_platform_compiler(platform); + test.create(); + test.compile(); + unload_platform_compiler(platform); + test.link(); + test.verify(); + } + } catch (const unload_test_failure &e) + { + log_error("Test failure: %s\n", e.what()); + return 1; + } + + return 0; +} + +/* Test calling the function between program build and kernel creation */ +int test_unload_build_unload_create_kernel(cl_device_id device, + cl_context context, cl_command_queue, + int) +{ + const cl_platform_id platform = device_platform(device); + try + { + build_with_source source(context, device); + build_with_binary binary(context, device); + build_with_il il(context, platform, device); + + for (build_base &test : build_list{ source, binary, il }) + { + unload_platform_compiler(platform); + test.create(); + test.build(); + unload_platform_compiler(platform); + test.verify(); + } + } catch (const unload_test_failure &e) + { + log_error("Test failure: %s\n", e.what()); + return 1; + } + + return 0; +} + +/* Test linking together two programs that were built with a call to the unload + * function in between */ +int test_unload_link_different(cl_device_id device, cl_context context, + cl_command_queue, int) +{ + const cl_platform_id platform = device_platform(device); + + static const char *sources_1[] = { "unsigned int a() { return 42; }" }; + static const char *sources_2[] = { R"( + unsigned int a(); + kernel void test(global unsigned int *p) + { + *p = a(); + })" }; + + cl_int err = CL_INVALID_PLATFORM; + + /* Create and compile program 1 */ + const clProgramWrapper program_1 = + clCreateProgramWithSource(context, 1, sources_1, nullptr, &err); + if (CL_SUCCESS != err) + { + log_error("Test failure: clCreateProgramWithSource() == %ld\n", + static_cast(err)); + return 1; + } + + err = clCompileProgram(program_1, 1, &device, nullptr, 0, nullptr, nullptr, + nullptr, nullptr); + if (CL_SUCCESS != err) + { + log_error("Test failure: clCompileProgram() == %ld\n", + static_cast(err)); + return 1; + } + + /* Unload the platform compiler */ + err = clUnloadPlatformCompiler(platform); + if (CL_SUCCESS != err) + { + log_error("Test failure: clUnloadPlatformCompiler() == %ld\n", + static_cast(err)); + return 1; + } + + /* Create and compile program 2 with the new compiler context */ + const clProgramWrapper program_2 = + clCreateProgramWithSource(context, 1, sources_2, nullptr, &err); + if (CL_SUCCESS != err) + { + log_error("Test failure: clCreateProgramWithSource() == %ld\n", + static_cast(err)); + return 1; + } + + err = clCompileProgram(program_2, 1, &device, nullptr, 0, nullptr, nullptr, + nullptr, nullptr); + if (CL_SUCCESS != err) + { + log_error("Test failure: clCompileProgram() == %ld\n", + static_cast(err)); + return 1; + } + + /* Link the two programs into an executable program */ + const cl_program compiled_programs[] = { program_1, program_2 }; + + const clProgramWrapper executable = + clLinkProgram(context, 1, &device, nullptr, 2, compiled_programs, + nullptr, nullptr, &err); + if (CL_SUCCESS != err) + { + log_error("Test failure: clLinkProgram() == %ld\n", + static_cast(err)); + return 1; + } + + /* Verify execution of a kernel from the linked executable */ + const clKernelWrapper kernel = clCreateKernel(executable, "test", &err); + if (CL_SUCCESS != err) + { + log_error("Test failure: clCreateKernel() == %ld\n", + static_cast(err)); + return 1; + } + + const clCommandQueueWrapper queue = + clCreateCommandQueue(context, device, 0, &err); + if (CL_SUCCESS != err) + { + log_error("Test failure: clCreateCommandQueue() == %ld\n", + static_cast(err)); + return 1; + } + + const clMemWrapper buffer = clCreateBuffer(context, CL_MEM_READ_WRITE, + sizeof(cl_uint), nullptr, &err); + if (CL_SUCCESS != err) + { + log_error("Test failure: clCreateBuffer() == %ld\n", + static_cast(err)); + return 1; + } + + cl_uint value = 0; + + err = clSetKernelArg(kernel, 0, sizeof(buffer), &buffer); + if (CL_SUCCESS != err) + { + log_error("Test failure: clSetKernelArg() == %ld\n", + static_cast(err)); + return 1; + } + + static const size_t work_size = 1; + err = clEnqueueNDRangeKernel(queue, kernel, 1, nullptr, &work_size, nullptr, + 0, nullptr, nullptr); + if (CL_SUCCESS != err) + { + log_error("Test failure: clEnqueueNDRangeKernel() == %ld\n", + static_cast(err)); + return 1; + } + + err = clEnqueueReadBuffer(queue, buffer, CL_BLOCKING, 0, sizeof(cl_uint), + &value, 0, nullptr, nullptr); + if (CL_SUCCESS != err) + { + log_error("Test failure: clEnqueueReadBuffer() == %ld\n", + static_cast(err)); + return 1; + } + + err = clFinish(queue); + if (CL_SUCCESS != err) throw unload_test_failure("clFinish()", err); + + if (42 != value) + { + log_error("Test failure: Kernel wrote %lu, expected 42)\n", + static_cast(value)); + return 1; + } + + return 0; +} + +/* Test calling the function in a thread while others threads are building + * programs */ +int test_unload_build_threaded(cl_device_id device, cl_context context, + cl_command_queue, int) +{ + using clock = std::chrono::steady_clock; + + const cl_platform_id platform = device_platform(device); + + const auto end = clock::now() + std::chrono::seconds(5); + + const auto unload_thread = [&end, platform] { + bool success = true; + + /* Repeatedly unload the compiler */ + try + { + while (clock::now() < end) + { + unload_platform_compiler(platform); + } + } catch (const unload_test_failure &e) + { + log_error("Test failure: %s\n", e.what()); + success = false; + } + + return success; + }; + + const auto build_thread = [&end](build_base *build) { + bool success = true; + + try + { + while (clock::now() < end) + { + build->create(); + build->build(); + build->verify(); + build->reset(); + } + } catch (unload_test_failure &e) + { + log_error("Test failure: %s\n", e.what()); + success = false; + } + + return success; + }; + + build_with_source build_source(context, device); + build_with_binary build_binary(context, device); + build_with_il build_il(context, platform, device); + + /* Run all threads in parallel and wait for them to finish */ + std::future unload_result = + std::async(std::launch::async, unload_thread); + std::future build_source_result = + std::async(std::launch::async, build_thread, &build_source); + std::future build_binary_result = + std::async(std::launch::async, build_thread, &build_binary); + std::future build_il_result = + std::async(std::launch::async, build_thread, &build_il); + + bool success = true; + if (!unload_result.get()) + { + log_error("unload_thread failed\n"); + success = false; + } + if (!build_source_result.get()) + { + log_error("build_with_source failed\n"); + success = false; + } + if (!build_binary_result.get()) + { + log_error("build_with_binary failed\n"); + success = false; + } + if (!build_il_result.get()) + { + log_error("build_with_il failed\n"); + success = false; + } + + return success ? 0 : 1; +} + +/* Test grabbing program build information after calling the unload function */ +int test_unload_build_info(cl_device_id device, cl_context context, + cl_command_queue, int) +{ + const cl_platform_id platform = device_platform(device); + + static const char *sources[] = { write_kernel_source }; + + cl_int err = CL_INVALID_PLATFORM; + /* Create and build the initial program from source */ + const clProgramWrapper program = + clCreateProgramWithSource(context, 1, sources, nullptr, &err); + if (CL_SUCCESS != err) + { + log_error("Test failure: clCreateProgramWithSource() == %ld\n", + static_cast(err)); + return 1; + } + + static const std::string options("-Dtest"); + + err = + clBuildProgram(program, 1, &device, options.c_str(), nullptr, nullptr); + if (CL_SUCCESS != err) + { + log_error("Test failure: clCompileProgram() == %ld\n", + static_cast(err)); + return 1; + } + + /* Unload the compiler */ + err = clUnloadPlatformCompiler(platform); + if (CL_SUCCESS != err) + { + log_error("Test failure: clUnloadPlatformCompiler() == %ld\n", + static_cast(err)); + return 1; + } + + std::vector infos{ CL_PROGRAM_BUILD_STATUS, + CL_PROGRAM_BUILD_OPTIONS, + CL_PROGRAM_BUILD_LOG, + CL_PROGRAM_BINARY_TYPE }; + + if (get_device_cl_version(device) >= Version(2, 0)) + { + infos.push_back(CL_PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE); + } + + /* Try grabbing the infos after the compiler unload */ + for (cl_program_build_info info : infos) + { + size_t info_size = 0; + err = clGetProgramBuildInfo(program, device, info, 0, nullptr, + &info_size); + if (CL_SUCCESS != err) + { + log_error("Test failure: clGetProgramBuildInfo() == %ld\n", + static_cast(err)); + return 1; + } + + std::vector info_value(info_size); + + size_t written_size = 0; + err = clGetProgramBuildInfo(program, device, info, info_size, + &info_value[0], &written_size); + if (CL_SUCCESS != err) + { + log_error("Test failure: clGetProgramBuildInfo() == %ld\n", + static_cast(err)); + return 1; + } + else if (written_size != info_size) + { + log_error("Test failure: Written info value size (%zu) was " + "different from " + "queried size (%zu).\n", + written_size, info_size); + return 1; + } + + /* Verify the information we know the answer to */ + switch (info) + { + case CL_PROGRAM_BUILD_STATUS: { + constexpr size_t value_size = sizeof(cl_build_status); + if (value_size != info_size) + { + log_error("Test failure: Expected CL_PROGRAM_BUILD_STATUS " + "of size %zu, " + "but got %zu\n", + value_size, info_size); + return 1; + } + cl_build_status value; + memcpy(&value, &info_value[0], value_size); + if (CL_BUILD_SUCCESS != value) + { + log_error( + "Test failure: CL_PROGRAM_BUILD_STATUS did not return " + "CL_BUILD_SUCCESS (%ld), but %ld\n", + static_cast(CL_BUILD_SUCCESS), + static_cast(value)); + return 1; + } + } + break; + + case CL_PROGRAM_BUILD_OPTIONS: { + const size_t value_size = options.length() + 1; + if (value_size != info_size) + { + log_error("Test failure: Expected CL_PROGRAM_BUILD_OPTIONS " + "of size " + "%zu, but got %zu\n", + value_size, info_size); + return 1; + } + else if (options != &info_value[0]) + { + log_error("Test failure: CL_PROGRAM_BUILD_OPTIONS returned " + "\"%s\" " + "instead of \"%s\"\n", + &info_value[0], options.c_str()); + return 1; + } + } + break; + + case CL_PROGRAM_BINARY_TYPE: { + constexpr size_t value_size = sizeof(cl_program_binary_type); + if (value_size != info_size) + { + log_error("Test failure: Expected CL_PROGRAM_BINARY_TYPE " + "of size %zu, " + "but got %zu\n", + value_size, info_size); + return 1; + } + cl_program_binary_type value; + memcpy(&value, &info_value[0], value_size); + if (CL_PROGRAM_BINARY_TYPE_EXECUTABLE != value) + { + log_error( + "Test failure: CL_PROGRAM_BINARY_TYPE did not return " + "CL_PROGRAM_BINARY_TYPE_EXECUTABLE (%ld), but %ld\n", + static_cast( + CL_PROGRAM_BINARY_TYPE_EXECUTABLE), + static_cast(value)); + return 1; + } + } + break; + } + } + + return 0; +} + +/* Test calling the unload function between program building and fetching the + * program binaries */ +int test_unload_program_binaries(cl_device_id device, cl_context context, + cl_command_queue, int) +{ + const cl_platform_id platform = device_platform(device); + + static const char *sources[] = { write_kernel_source }; + + cl_int err = CL_INVALID_PLATFORM; + /* Create and build the initial program from source */ + const clProgramWrapper program = + clCreateProgramWithSource(context, 1, sources, nullptr, &err); + if (CL_SUCCESS != err) + { + log_error("Test failure: clCreateProgramWithSource() == %ld\n", + static_cast(err)); + return 1; + } + + err = clBuildProgram(program, 1, &device, nullptr, nullptr, nullptr); + if (CL_SUCCESS != err) + { + log_error("Test failure: clCompileProgram() == %ld\n", + static_cast(err)); + return 1; + } + + /* Unload the compiler */ + err = clUnloadPlatformCompiler(platform); + if (CL_SUCCESS != err) + { + log_error("Test failure: clUnloadPlatformCompiler() == %ld\n", + static_cast(err)); + return 1; + } + + /* Grab the built executable binary after the compiler unload */ + size_t binary_size; + err = clGetProgramInfo(program, CL_PROGRAM_BINARY_SIZES, + sizeof(binary_size), &binary_size, nullptr); + if (CL_SUCCESS != err) + { + log_error("Test failure: clGetProgramInfo() == %ld\n", + static_cast(err)); + return 1; + } + + std::vector binary(binary_size); + + unsigned char *binaries[] = { binary.data() }; + err = clGetProgramInfo(program, CL_PROGRAM_BINARIES, + sizeof(unsigned char *), binaries, nullptr); + if (CL_SUCCESS != err) + { + log_error("Test failure: clGetProgramInfo() == %ld\n", + static_cast(err)); + return 1; + } + + /* Create a new program from the binary and test its execution */ + try + { + build_with_binary build_binary(context, device, binary); + build_binary.create(); + build_binary.build(); + build_binary.verify(); + } catch (unload_test_failure &e) + { + log_error("Test failure: %s\n", e.what()); + return 1; + } + + return 0; +} diff --git a/test_conformance/compiler/test_unload_platform_compiler_resources.hpp b/test_conformance/compiler/test_unload_platform_compiler_resources.hpp new file mode 100644 index 00000000..82f87ffc --- /dev/null +++ b/test_conformance/compiler/test_unload_platform_compiler_resources.hpp @@ -0,0 +1,50 @@ +#include + +static const char write_kernel_source[] = R"( + kernel void write_kernel(global unsigned int *p) { + *p = 42; + })"; + +/* Assembled SPIR-V 1.0 binary from write_kernel.spvasm64 */ +static std::array write_kernel_64_spv{ + { 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, + 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x0e, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x0f, 0x00, 0x07, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, + 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, + 0x13, 0x00, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x21, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x37, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0xf8, 0x00, 0x02, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x05, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00 } +}; + +/* Assembled SPIR-V 1.0 binary from write_kernel.spvasm32 */ +static std::array write_kernel_32_spv{ + { 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, + 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x0e, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x0f, 0x00, 0x07, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, + 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, + 0x13, 0x00, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x21, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x37, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0xf8, 0x00, 0x02, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x05, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00 } +}; diff --git a/test_conformance/compiler/write_kernel.spvasm32 b/test_conformance/compiler/write_kernel.spvasm32 new file mode 100644 index 00000000..b6a3fc1f --- /dev/null +++ b/test_conformance/compiler/write_kernel.spvasm32 @@ -0,0 +1,24 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 11 +; Schema: 0 + OpCapability Addresses + OpCapability Kernel +; %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %6 "write_kernel" +; %10 = OpString "kernel_arg_type.write_kernel.uint*," +; OpSource OpenCL_C 200000 +; OpDecorate %7 FuncParamAttr NoCapture + %uint = OpTypeInt 32 0 + %uint_42 = OpConstant %uint 42 + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %5 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint + %6 = OpFunction %void None %5 + %7 = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %8 = OpLabel + OpStore %7 %uint_42 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/compiler/write_kernel.spvasm64 b/test_conformance/compiler/write_kernel.spvasm64 new file mode 100644 index 00000000..0923bc13 --- /dev/null +++ b/test_conformance/compiler/write_kernel.spvasm64 @@ -0,0 +1,24 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 11 +; Schema: 0 + OpCapability Addresses + OpCapability Kernel +; %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %6 "write_kernel" +; %10 = OpString "kernel_arg_type.write_kernel.uint*," +; OpSource OpenCL_C 200000 +; OpDecorate %7 FuncParamAttr NoCapture + %uint = OpTypeInt 32 0 + %uint_42 = OpConstant %uint 42 + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %5 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint + %6 = OpFunction %void None %5 + %7 = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %8 = OpLabel + OpStore %7 %uint_42 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/computeinfo/CMakeLists.txt b/test_conformance/computeinfo/CMakeLists.txt index 266ab6d6..9bdc9e49 100644 --- a/test_conformance/computeinfo/CMakeLists.txt +++ b/test_conformance/computeinfo/CMakeLists.txt @@ -1,13 +1,9 @@ set(MODULE_NAME computeinfo) set(${MODULE_NAME}_SOURCES - main.c - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/testHarness.c - ../../test_common/harness/crc32.c + main.cpp + device_uuid.cpp + extended_versioning.cpp ) include(../CMakeCommon.txt) diff --git a/test_conformance/computeinfo/device_uuid.cpp b/test_conformance/computeinfo/device_uuid.cpp new file mode 100644 index 00000000..1ef9dad2 --- /dev/null +++ b/test_conformance/computeinfo/device_uuid.cpp @@ -0,0 +1,211 @@ +// +// Copyright (c) 2020 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "harness/compat.h" + +#include +#include + +#include "harness/testHarness.h" +#include "harness/deviceInfo.h" + +using uuid = std::array; +using luid = std::array; + +template static void log_info_uuid(const T &id) +{ + for (const cl_uchar c : id) + { + log_info("%02x", static_cast(c)); + } +} + +template static void log_error_uuid(const T &id) +{ + for (const cl_uchar c : id) + { + log_error("%02x", static_cast(c)); + } +} + +static bool check_device_info_returns(const cl_int err, const size_t size, + const size_t expected_size) +{ + if (err != CL_SUCCESS) + { + print_error(err, "clGetDeviceInfo failed"); + return false; + } + else if (size != expected_size) + { + log_error("Invalid size written by clGetDeviceInfo (%zu != %zu)\n", + size, expected_size); + return false; + } + + return true; +} + +template +static bool get_uuid(const cl_device_id device, const cl_device_info info, + T &id, const bool twice = true) +{ + const size_t id_size = id.size() * sizeof(id[0]); + + size_t size_ret; + cl_int err = clGetDeviceInfo(device, info, id_size, id.data(), &size_ret); + if (!check_device_info_returns(err, size_ret, id_size)) + { + return false; + } + + /* Check that IDs are (at the very least) stable across two successive + * clGetDeviceInfo calls. Check conditionally, as it is undefined what the + * query for CL_DEVICE_LUID_KHR returns if CL_DEVICE_LUID_VALID_KHR returns + * false. */ + if (twice) + { + T id_2; + size_t size_ret_2; + err = clGetDeviceInfo(device, info, id_size, id_2.data(), &size_ret_2); + if (!check_device_info_returns(err, size_ret_2, id_size)) + { + return false; + } + + if (id != id_2) + { + log_error("Got different IDs from the same ID device info ("); + log_error_uuid(id); + log_error(" != "); + log_error_uuid(id_2); + log_error(")\n"); + return false; + } + } + + return true; +} + +int test_device_uuid(cl_device_id deviceID, cl_context context, + cl_command_queue ignoreQueue, int num_elements) +{ + if (!is_extension_available(deviceID, "cl_khr_device_uuid")) + { + log_info("cl_khr_device_uuid not supported. Skipping test...\n"); + return 0; + } + + int total_errors = 0; + + /* CL_DEVICE_UUID_KHR */ + uuid device_uuid; + bool success = get_uuid(deviceID, CL_DEVICE_UUID_KHR, device_uuid); + if (!success) + { + log_error("Error getting device UUID\n"); + ++total_errors; + } + else + { + log_info("\tDevice UUID: "); + log_info_uuid(device_uuid); + log_info("\n"); + } + + /* CL_DRIVER_UUID_KHR */ + uuid driver_uuid; + success = get_uuid(deviceID, CL_DRIVER_UUID_KHR, driver_uuid); + if (!success) + { + log_error("Error getting driver UUID\n"); + ++total_errors; + } + else + { + log_info("\tDriver UUID: "); + log_info_uuid(driver_uuid); + log_info("\n"); + } + + size_t size_ret{}; + + /* CL_DEVICE_LUID_VALID_KHR */ + cl_bool device_luid_valid{}; + cl_int err = clGetDeviceInfo(deviceID, CL_DEVICE_LUID_VALID_KHR, + sizeof(device_luid_valid), &device_luid_valid, + &size_ret); + if (!check_device_info_returns(err, size_ret, sizeof(device_luid_valid))) + { + log_error("Error getting device LUID validity\n"); + ++total_errors; + device_luid_valid = false; + } + else + { + log_info("\tDevice LUID validity is %s\n", + device_luid_valid ? "true" : "false"); + } + + /* CL_DEVICE_LUID_KHR */ + luid device_luid; + success = + get_uuid(deviceID, CL_DEVICE_LUID_KHR, device_luid, device_luid_valid); + if (!success) + { + log_error("Error getting device LUID\n"); + ++total_errors; + } + else + { + log_info("\tDevice LUID: "); + log_info_uuid(device_luid); + log_info("\n"); + } + + /* CL_DEVICE_NODE_MASK_KHR */ + cl_uint device_node_mask{}; + err = + clGetDeviceInfo(deviceID, CL_DEVICE_NODE_MASK_KHR, + sizeof(device_node_mask), &device_node_mask, &size_ret); + if (!check_device_info_returns(err, size_ret, sizeof(device_node_mask))) + { + log_error("Error getting device node mask\n"); + ++total_errors; + } + else + { + log_info("\tNode mask : %08lx\n", + static_cast(device_node_mask)); + + /* If the LUID is valid, there must be one and only one bit set in the + * node mask */ + if (device_luid_valid) + { + static constexpr size_t cl_uint_size_in_bits = 32; + const size_t bit_count = + std::bitset(device_node_mask).count(); + if (1 != bit_count) + { + log_error("Wrong amount of bits set in node mask (%zu != 1) " + "with valid LUID\n", + bit_count); + ++total_errors; + } + } + } + + return total_errors; +} diff --git a/test_conformance/computeinfo/extended_versioning.cpp b/test_conformance/computeinfo/extended_versioning.cpp new file mode 100644 index 00000000..841526cc --- /dev/null +++ b/test_conformance/computeinfo/extended_versioning.cpp @@ -0,0 +1,715 @@ +// +// Copyright (c) 2019-2020 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "harness/compat.h" + +#include +#include +#include +#include +#include +#include "harness/testHarness.h" +#include "harness/deviceInfo.h" + +using name_version_set = std::set; + +static bool operator<(const cl_name_version_khr& lhs, + const cl_name_version_khr& rhs) +{ + const int cmp = strcmp(lhs.name, rhs.name); + if (0 == cmp) + { + return lhs.version < rhs.version; + } + + return cmp < 0; +} + +static bool operator==(const cl_name_version_khr& lhs, + const cl_name_version_khr& rhs) +{ + return (0 == strcmp(lhs.name, rhs.name)) && (lhs.version == rhs.version); +} + +/* Parse major and minor version numbers out of version_string according to + * format, which is a scanf-format with two %u specifiers, then compare the + * version to the major and minor versions of version_numeric */ +static bool is_same_version(const char* const format, + const char* const version_string, + const cl_version_khr version_numeric) +{ + unsigned int string_major = 0; + unsigned int string_minor = 0; + const int matched = + sscanf(version_string, format, &string_major, &string_minor); + + if (2 != matched) + { + log_error("sscanf() fail on version string \"%s\", format=\"%s\"\n", + version_string, format); + return false; + } + + const unsigned int numeric_major = CL_VERSION_MAJOR_KHR(version_numeric); + const unsigned int numeric_minor = CL_VERSION_MINOR_KHR(version_numeric); + + return (string_major == numeric_major) && (string_minor == numeric_minor); +} + +static std::vector get_platform_string(cl_platform_id platform, + cl_platform_info name) +{ + size_t size{}; + cl_int err = clGetPlatformInfo(platform, name, 0, nullptr, &size); + if (err != CL_SUCCESS) + { + log_error("clGetPlatformInfo failed\n"); + return {}; + } + + std::vector result(size); + + err = clGetPlatformInfo(platform, name, size, result.data(), nullptr); + if (err != CL_SUCCESS) + { + log_error("clGetPlatformInfo failed\n"); + return {}; + } + + return result; +} + +static std::vector get_device_string(cl_device_id device, + cl_device_info name) +{ + size_t size{}; + cl_int err = clGetDeviceInfo(device, name, 0, nullptr, &size); + if (err != CL_SUCCESS) + { + log_error("clGetDeviceInfo failed\n"); + return {}; + } + + std::vector result(size); + + err = clGetDeviceInfo(device, name, size, result.data(), nullptr); + if (err != CL_SUCCESS) + { + log_error("clGetDeviceInfo failed\n"); + return {}; + } + + return result; +} + +/* Parse an extension string into a cl_name_version_khr set. Error out if we + * have an invalid extension string */ +static bool name_version_set_from_extension_string(char* const src, + name_version_set& dest) +{ + for (char* token = strtok(src, " "); nullptr != token; + token = strtok(nullptr, " ")) + { + if (CL_NAME_VERSION_MAX_NAME_SIZE_KHR <= strlen(token)) + { + log_error("Extension name is longer than allowed\n"); + return false; + } + + cl_name_version_khr name_version{}; + strncpy(name_version.name, token, CL_NAME_VERSION_MAX_NAME_SIZE_KHR); + + if (dest.find(name_version) != dest.cend()) + { + log_error("Duplicate extension in extension string\n"); + return false; + } + + dest.insert(name_version); + } + + return true; +} + +/* Parse a built-in kernels string into a cl_name_version_khr set. Error out if + * we have an invalid built-in kernels string */ +static bool name_version_set_from_built_in_kernel_string(char* const src, + name_version_set& dest) +{ + for (char* token = strtok(src, ";"); nullptr != token; + token = strtok(nullptr, ";")) + { + if (CL_NAME_VERSION_MAX_NAME_SIZE_KHR <= strlen(token)) + { + log_error("Kernel name is longer than allowed\n"); + return false; + } + + cl_name_version_khr name_version{}; + strncpy(name_version.name, token, CL_NAME_VERSION_MAX_NAME_SIZE_KHR); + + if (dest.find(name_version) != dest.cend()) + { + log_error("Duplicate kernel name in kernel string\n"); + return false; + } + + dest.insert(name_version); + } + + return true; +} + +/* Helper to log the names of elements of the set difference of two + * cl_name_version_khr sets */ +static void log_name_only_set_difference(const name_version_set& lhs, + const name_version_set& rhs) +{ + std::vector difference; + std::set_difference(lhs.cbegin(), lhs.cend(), rhs.cbegin(), rhs.cend(), + std::back_inserter(difference)); + + for (const cl_name_version_khr& il : difference) + { + log_info(" %s", il.name); + } +} + +/* Helper to log as IL versions the elements of the set difference of two + * cl_name_version_khr sets */ +static void log_il_set_difference(const name_version_set& lhs, + const name_version_set& rhs) +{ + std::vector difference; + std::set_difference(lhs.cbegin(), lhs.cend(), rhs.cbegin(), rhs.cend(), + std::back_inserter(difference)); + + for (const cl_name_version_khr& il : difference) + { + const unsigned int major = CL_VERSION_MAJOR_KHR(il.version); + const unsigned int minor = CL_VERSION_MINOR_KHR(il.version); + log_info(" %s_%u.%u", il.name, major, minor); + } +} + +/* Check that CL_PLATFORM_NUMERIC_VERSION_KHR returns the same version as + * CL_PLATFORM_VERSION */ +static int test_extended_versioning_platform_version(cl_platform_id platform) +{ + log_info("Platform versions:\n"); + + const std::vector version_string( + get_platform_string(platform, CL_PLATFORM_VERSION)); + if (version_string.empty()) + { + log_error("Could not get CL platform version string\n"); + return 1; + } + + cl_version_khr version_numeric{}; + cl_int err = + clGetPlatformInfo(platform, CL_PLATFORM_NUMERIC_VERSION_KHR, + sizeof(version_numeric), &version_numeric, nullptr); + if (err != CL_SUCCESS) + { + log_error("clGetPlatformInfo failed\n"); + return 1; + } + + if (!is_same_version("OpenCL %u.%u", version_string.data(), + version_numeric)) + { + log_error( + "Numeric platform version does not match the version string\n"); + return 1; + } + + log_info("\tMatched the platform version\n"); + + return 0; +} + +/* Check that CL_DEVICE{,_OPENCL_C}_NUMERIC_VERSION_KHR return the same versions + * as CL_DEVICE{,_OPENCL_C}_VERSION */ +static int test_extended_versioning_device_versions(cl_device_id deviceID) +{ + log_info("Device versions:\n"); + + static constexpr struct + { + cl_platform_info param_name_numeric; + cl_platform_info param_name_string; + const char* format; + } device_version_queries[]{ + { CL_DEVICE_NUMERIC_VERSION_KHR, CL_DEVICE_VERSION, "OpenCL %u.%u" }, + { CL_DEVICE_OPENCL_C_NUMERIC_VERSION_KHR, CL_DEVICE_OPENCL_C_VERSION, + "OpenCL C %u.%u" }, + }; + + for (const auto& query : device_version_queries) + { + const std::vector version_string( + get_device_string(deviceID, query.param_name_string)); + if (version_string.empty()) + { + log_error("Could not get CL platform version string\n"); + return 1; + } + + cl_version_khr version_numeric{}; + cl_int err = + clGetDeviceInfo(deviceID, query.param_name_numeric, + sizeof(version_numeric), &version_numeric, nullptr); + if (err != CL_SUCCESS) + { + log_error("clGetDeviceInfo failed\n"); + return 1; + } + + if (!is_same_version(query.format, version_string.data(), + version_numeric)) + { + log_error( + "Numeric device version does not match the version string\n"); + return 1; + } + } + + log_info("\tMatched the device OpenCL and OpenCL C versions\n"); + + return 0; +} + +/* Check that the platform extension string and name_version queries return the + * same set */ +static int test_extended_versioning_platform_extensions(cl_platform_id platform) +{ + log_info("Platform extensions:\n"); + std::vector extension_string{ get_platform_string( + platform, CL_PLATFORM_EXTENSIONS) }; + if (extension_string.empty()) + { + log_error("Could not get CL platform extensions string\n"); + return 1; + } + + size_t size{}; + cl_int err = clGetPlatformInfo( + platform, CL_PLATFORM_EXTENSIONS_WITH_VERSION_KHR, 0, nullptr, &size); + if (err != CL_SUCCESS) + { + log_error("clGetPlatformInfo failed\n"); + return 1; + } + + if ((size % sizeof(cl_name_version_khr)) != 0) + { + log_error("CL_PLATFORM_EXTENSIONS_WITH_VERSION_KHR return size not a " + "multiple of sizeof(cl_name_version_khr)\n"); + return 1; + } + + const size_t extension_name_vers_count = size / sizeof(cl_name_version_khr); + std::vector extension_name_vers( + extension_name_vers_count); + + err = clGetPlatformInfo(platform, CL_PLATFORM_EXTENSIONS_WITH_VERSION_KHR, + size, extension_name_vers.data(), nullptr); + if (err != CL_SUCCESS) + { + log_error("clGetPlatformInfo failed\n"); + return 1; + } + + name_version_set extension_name_vers_set; + for (const auto& extension : extension_name_vers) + { + /* Extension string doesn't have versions, so set it to all zeroes for + * matching */ + cl_name_version_khr name_version = extension; + name_version.version = CL_MAKE_VERSION_KHR(0, 0, 0); + + if (extension_name_vers_set.find(name_version) + != extension_name_vers_set.cend()) + { + log_error("Duplicate extension in extension name-version array\n"); + return 1; + } + + extension_name_vers_set.insert(name_version); + } + + name_version_set extension_string_set; + if (!name_version_set_from_extension_string(extension_string.data(), + extension_string_set)) + { + log_error("Failed to parse platform extension string\n"); + return 1; + } + + if (extension_string_set != extension_name_vers_set) + { + log_error("Platform extension mismatch\n"); + + log_info("\tExtensions only in numeric:"); + log_name_only_set_difference(extension_name_vers_set, + extension_string_set); + log_info("\n\tExtensions only in string:"); + log_name_only_set_difference(extension_string_set, + extension_name_vers_set); + log_info("\n"); + + return 1; + } + + log_info("\tMatched %zu extensions\n", extension_name_vers_set.size()); + + return 0; +} + +/* Check that the device extension string and name_version queries return the + * same set */ +static int test_extended_versioning_device_extensions(cl_device_id device) +{ + log_info("Device extensions:\n"); + std::vector extension_string{ get_device_string( + device, CL_DEVICE_EXTENSIONS) }; + if (extension_string.empty()) + { + log_error("Could not get CL device extensions string\n"); + return 1; + } + + size_t size{}; + cl_int err = clGetDeviceInfo(device, CL_DEVICE_EXTENSIONS_WITH_VERSION_KHR, + 0, nullptr, &size); + if (err != CL_SUCCESS) + { + log_error("clGetDeviceInfo failed\n"); + return 1; + } + + if ((size % sizeof(cl_name_version_khr)) != 0) + { + log_error("CL_DEVICE_EXTENSIONS_WITH_VERSION_KHR return size not a " + "multiple of sizeof(cl_name_version_khr)\n"); + return 1; + } + + const size_t extension_name_vers_count = size / sizeof(cl_name_version_khr); + std::vector extension_name_vers( + extension_name_vers_count); + + err = clGetDeviceInfo(device, CL_DEVICE_EXTENSIONS_WITH_VERSION_KHR, size, + extension_name_vers.data(), nullptr); + if (err != CL_SUCCESS) + { + log_error("clGetDeviceInfo failed\n"); + return 1; + } + + name_version_set extension_name_vers_set; + for (const auto& extension : extension_name_vers) + { + /* Extension string doesn't have versions, so set it to all zeroes for + * matching */ + cl_name_version_khr name_version = extension; + name_version.version = CL_MAKE_VERSION_KHR(0, 0, 0); + + if (extension_name_vers_set.find(name_version) + != extension_name_vers_set.cend()) + { + log_error("Duplicate extension in extension name-version array\n"); + return 1; + } + + extension_name_vers_set.insert(name_version); + } + + name_version_set extension_string_set; + if (!name_version_set_from_extension_string(extension_string.data(), + extension_string_set)) + { + log_error("Failed to parse device extension string\n"); + return 1; + } + + if (extension_string_set != extension_name_vers_set) + { + log_error("Device extension mismatch\n"); + + log_info("\tExtensions only in numeric:"); + log_name_only_set_difference(extension_name_vers_set, + extension_string_set); + log_info("\n\tExtensions only in string:"); + log_name_only_set_difference(extension_string_set, + extension_name_vers_set); + log_info("\n"); + + return 1; + } + + log_info("\tMatched %zu extensions\n", extension_name_vers_set.size()); + + return 0; +} + +/* Check that the device ILs string and numeric queries return the same set */ +static int test_extended_versioning_device_il(cl_device_id device) +{ + log_info("Device ILs:\n"); + + size_t size{}; + cl_int err = clGetDeviceInfo(device, CL_DEVICE_ILS_WITH_VERSION_KHR, 0, + nullptr, &size); + if (err != CL_SUCCESS) + { + log_error("clGetDeviceInfo failed\n"); + return 1; + } + + if ((size % sizeof(cl_name_version_khr)) != 0) + { + log_error("CL_DEVICE_ILS_WITH_VERSION_KHR return size not a multiple " + "of sizeof(cl_name_version_khr)\n"); + return 1; + } + + const size_t il_name_vers_count = size / sizeof(cl_name_version_khr); + std::vector il_name_vers(il_name_vers_count); + + err = clGetDeviceInfo(device, CL_DEVICE_ILS_WITH_VERSION_KHR, size, + il_name_vers.data(), nullptr); + if (err != CL_SUCCESS) + { + log_error("clGetDeviceInfo failed\n"); + return 1; + } + + const bool has_khr_il_program = + is_extension_available(device, "cl_khr_il_program"); + const bool has_core_il_program = + get_device_cl_version(device) > Version(2, 0); + + // IL query should return an empty list if the device does not support IL + // programs + if (!(has_khr_il_program || has_core_il_program)) + { + const bool success = il_name_vers.empty(); + if (!success) + { + log_error( + "No il_program support, but CL_DEVICE_ILS_WITH_VERSION_KHR " + "returned a non-empty list\n"); + return 1; + } + else + { + log_info( + "\tNo il_program support, and CL_DEVICE_ILS_WITH_VERSION_KHR " + "correctly returned the empty list\n"); + return 0; + } + } + + // Pick the core or extension version of the query parameter name + const cl_device_info il_version_param_name = + has_core_il_program ? CL_DEVICE_IL_VERSION : CL_DEVICE_IL_VERSION_KHR; + + std::vector il_string{ get_device_string(device, + il_version_param_name) }; + if (il_string.empty()) + { + log_error("Couldn't get device IL string\n"); + return 1; + } + + name_version_set il_string_set; + char* saveptr_outer = nullptr; + for (char* token = strtok_r(il_string.data(), " ", &saveptr_outer); + nullptr != token; token = strtok_r(nullptr, " ", &saveptr_outer)) + { + char* saveptr_inner = nullptr; + const char* const prefix = strtok_r(token, "_", &saveptr_inner); + const char* const version = strtok_r(nullptr, "", &saveptr_inner); + + unsigned major = 0; + unsigned minor = 0; + const int matched = sscanf(version, "%u.%u", &major, &minor); + if (2 != matched) + { + log_error("IL version string scan mismatch\n"); + return 1; + } + if (CL_NAME_VERSION_MAX_NAME_SIZE_KHR <= strlen(prefix)) + { + log_error("IL name longer than allowed\n"); + return 1; + } + + cl_name_version_khr name_version{}; + strncpy(name_version.name, prefix, CL_NAME_VERSION_MAX_NAME_SIZE_KHR); + name_version.version = CL_MAKE_VERSION_KHR(major, minor, 0); + + if (il_string_set.find(name_version) != il_string_set.end()) + { + log_error("Duplicate IL version in IL string\n"); + return 1; + } + + il_string_set.insert(name_version); + } + + name_version_set il_name_vers_set; + for (const auto& il : il_name_vers) + { + const unsigned major = CL_VERSION_MAJOR_KHR(il.version); + const unsigned minor = CL_VERSION_MINOR_KHR(il.version); + + cl_name_version_khr name_version = il; + name_version.version = CL_MAKE_VERSION_KHR(major, minor, 0); + + if (il_name_vers_set.find(name_version) != il_name_vers_set.cend()) + { + log_error("Duplicate IL in name-version array\n"); + return 1; + } + + il_name_vers_set.insert(name_version); + } + + if (il_string_set != il_name_vers_set) + { + log_error("Device IL mismatch\n"); + + log_info("\tILs only in numeric:"); + log_il_set_difference(il_name_vers_set, il_string_set); + log_info("\n\tILs only in string:"); + log_il_set_difference(il_string_set, il_name_vers_set); + log_info("\n"); + + return 1; + } + + log_info("\tMatched %zu ILs\n", il_name_vers_set.size()); + + return 0; +} + +static int test_extended_versioning_device_built_in_kernels(cl_device_id device) +{ + log_info("Device built-in kernels:\n"); + std::vector kernel_string{ get_device_string( + device, CL_DEVICE_BUILT_IN_KERNELS) }; + if (kernel_string.empty()) + { + log_error("Could not get CL device extensions string\n"); + return 1; + } + + size_t size{}; + cl_int err = clGetDeviceInfo( + device, CL_DEVICE_BUILT_IN_KERNELS_WITH_VERSION_KHR, 0, nullptr, &size); + if (err != CL_SUCCESS) + { + log_error("clGetDeviceInfo failed\n"); + return 1; + } + + if ((size % sizeof(cl_name_version_khr)) != 0) + { + log_error("CL_DEVICE_BUILT_IN_KERNELS_WITH_VERSION_KHR return size not " + "a multiple of sizeof(cl_name_version_khr)\n"); + return 1; + } + + const size_t kernel_name_vers_count = size / sizeof(cl_name_version_khr); + std::vector kernel_name_vers(kernel_name_vers_count); + + err = clGetDeviceInfo(device, CL_DEVICE_BUILT_IN_KERNELS_WITH_VERSION_KHR, + size, kernel_name_vers.data(), nullptr); + if (err != CL_SUCCESS) + { + log_error("clGetDeviceInfo failed\n"); + return 1; + } + + name_version_set kernel_name_vers_set; + for (const auto& kernel : kernel_name_vers) + { + cl_name_version_khr name_version = kernel; + name_version.version = CL_MAKE_VERSION_KHR(0, 0, 0); + + if (kernel_name_vers_set.find(name_version) + != kernel_name_vers_set.cend()) + { + log_error("Duplicate kernel in kernel name-version array\n"); + return 1; + } + + kernel_name_vers_set.insert(name_version); + } + + name_version_set kernel_string_set; + if (!name_version_set_from_built_in_kernel_string(kernel_string.data(), + kernel_string_set)) + { + log_error("Failed to parse device kernel string\n"); + return 1; + } + + if (kernel_string_set != kernel_name_vers_set) + { + log_error("Device kernel mismatch\n"); + + log_info("\tKernels only in numeric:"); + log_name_only_set_difference(kernel_name_vers_set, kernel_string_set); + log_info("\n\tKernels only in string:"); + log_name_only_set_difference(kernel_string_set, kernel_name_vers_set); + log_info("\n"); + + return 1; + } + + log_info("\tMatched %zu kernels\n", kernel_name_vers_set.size()); + + return 0; +} + +int test_extended_versioning(cl_device_id deviceID, cl_context context, + cl_command_queue ignoreQueue, int num_elements) +{ + if (!is_extension_available(deviceID, "cl_khr_extended_versioning")) + { + log_info( + "cl_khr_extended_versioning not supported. Skipping test...\n"); + return 0; + } + + cl_platform_id platform; + cl_int err = clGetDeviceInfo(deviceID, CL_DEVICE_PLATFORM, sizeof(platform), + &platform, nullptr); + test_error(err, "clGetDeviceInfo failed\n"); + + int total_errors = 0; + total_errors += test_extended_versioning_platform_version(platform); + total_errors += test_extended_versioning_platform_extensions(platform); + total_errors += test_extended_versioning_device_versions(deviceID); + total_errors += test_extended_versioning_device_extensions(deviceID); + total_errors += test_extended_versioning_device_il(deviceID); + total_errors += test_extended_versioning_device_built_in_kernels(deviceID); + + return total_errors; +} diff --git a/test_conformance/computeinfo/main.c b/test_conformance/computeinfo/main.c deleted file mode 100644 index 9232270c..00000000 --- a/test_conformance/computeinfo/main.c +++ /dev/null @@ -1,892 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" - -static int dump_supported_formats; - -typedef struct -{ - cl_device_type device_type; - const char* device_type_name; - unsigned num_devices; - cl_device_id* devices; - // more infos here -} device_info; - -device_info device_infos[] = -{ - {CL_DEVICE_TYPE_DEFAULT, "CL_DEVICE_TYPE_DEFAULT", -1, NULL}, - {CL_DEVICE_TYPE_CPU, "CL_DEVICE_TYPE_CPU", -1, NULL}, - {CL_DEVICE_TYPE_GPU, "CL_DEVICE_TYPE_GPU", -1, NULL}, - {CL_DEVICE_TYPE_ACCELERATOR, "CL_DEVICE_TYPE_ACCELERATOR", -1, NULL}, - {CL_DEVICE_TYPE_ALL, "CL_DEVICE_TYPE_ALL", -1, NULL}, -}; - -// config types -enum -{ - type_cl_device_type, - type_cl_device_fp_config, - type_cl_device_mem_cache_type, - type_cl_local_mem_type, - type_cl_device_exec_capabilities, - type_cl_command_queue_properties, - type_cl_device_id, - type_cl_device_affinity_domain, - type_cl_uint, - type_size_t, - type_size_t_arr, - type_cl_ulong, - type_string, - type_cl_device_svm_capabilities, -}; - -typedef union -{ - cl_device_type type; - cl_device_fp_config fp_config; - cl_device_mem_cache_type mem_cache_type; - cl_device_local_mem_type local_mem_type; - cl_device_exec_capabilities exec_capabilities; - cl_command_queue_properties queue_properties; - cl_device_id device_id; - cl_device_affinity_domain affinity_domain; - cl_int uint; - size_t sizet; - size_t sizet_arr[3]; - cl_ulong ull; - char string[1024]; - cl_device_svm_capabilities svmCapabilities; -} config_data; - -struct _version { - int major; - int minor; -}; -typedef struct _version version_t; - -struct _extensions { - int cl_khr_fp64; - int cl_khr_fp16; -}; -typedef struct _extensions extensions_t; - -// Compare two versions, return -1 (the first is lesser), 0 (equal), 1 (the first is greater). -int vercmp( version_t a, version_t b ) { - if ( a.major < b.major || a.major == b.major && a.minor < b.minor ) { - return -1; - } else if ( a.major == b.major && a.minor == b.minor ) { - return 0; - } else { - return 1; - } -} - -typedef struct -{ - version_t version; // Opcode is introduced in this version of OpenCL spec. - cl_device_info opcode; - const char* opcode_name; - int config_type; - config_data config; -} config_info; - -#define CONFIG_INFO( major, minor, opcode, type ) { { major, minor }, opcode, #opcode, type_ ## type, { 0 } } - -config_info image_buffer_config_infos[] = -{ -#ifdef CL_DEVICE_IMAGE_PITCH_ALIGNMENT - CONFIG_INFO( 1, 2, CL_DEVICE_IMAGE_PITCH_ALIGNMENT, cl_uint), - CONFIG_INFO( 1, 2, CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT, cl_uint), -#endif -}; - -config_info config_infos[] = -{ - // `CL_DEVICE_VERSION' must be the first item in the list! It's version must be 0, 0. - CONFIG_INFO( 0, 0, CL_DEVICE_VERSION, string), - // `CL_DEVICE_EXTENSIONS' must be the second! - CONFIG_INFO( 1, 1, CL_DEVICE_EXTENSIONS, string), - - CONFIG_INFO( 1, 1, CL_DEVICE_TYPE, cl_device_type), - CONFIG_INFO( 1, 1, CL_DEVICE_VENDOR_ID, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_MAX_COMPUTE_UNITS, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_MAX_WORK_ITEM_SIZES, size_t_arr), - CONFIG_INFO( 1, 1, CL_DEVICE_MAX_WORK_GROUP_SIZE, size_t), - CONFIG_INFO( 1, 1, CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_NATIVE_VECTOR_WIDTH_INT, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF, cl_uint), - - CONFIG_INFO( 1, 1, CL_DEVICE_MAX_CLOCK_FREQUENCY, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_ADDRESS_BITS, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_MAX_READ_IMAGE_ARGS, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_MAX_WRITE_IMAGE_ARGS, cl_uint), - CONFIG_INFO( 2, 0, CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_MAX_MEM_ALLOC_SIZE, cl_ulong), - CONFIG_INFO( 1, 1, CL_DEVICE_IMAGE2D_MAX_WIDTH, size_t), - CONFIG_INFO( 1, 1, CL_DEVICE_IMAGE2D_MAX_HEIGHT, size_t), - CONFIG_INFO( 1, 1, CL_DEVICE_IMAGE3D_MAX_WIDTH, size_t), - CONFIG_INFO( 1, 1, CL_DEVICE_IMAGE3D_MAX_HEIGHT, size_t), - CONFIG_INFO( 1, 1, CL_DEVICE_IMAGE3D_MAX_DEPTH, size_t), - CONFIG_INFO( 1, 2, CL_DEVICE_IMAGE_MAX_ARRAY_SIZE, size_t), - CONFIG_INFO( 1, 2, CL_DEVICE_IMAGE_MAX_BUFFER_SIZE, size_t), - CONFIG_INFO( 1, 1, CL_DEVICE_IMAGE_SUPPORT, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_MAX_PARAMETER_SIZE, size_t), - CONFIG_INFO( 1, 1, CL_DEVICE_MAX_SAMPLERS, cl_uint), - CONFIG_INFO( 2, 0, CL_DEVICE_IMAGE_PITCH_ALIGNMENT, cl_uint), - CONFIG_INFO( 2, 0, CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT, cl_uint), - - CONFIG_INFO( 1, 1, CL_DEVICE_MEM_BASE_ADDR_ALIGN, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_SINGLE_FP_CONFIG, cl_device_fp_config), - CONFIG_INFO( 1, 1, CL_DEVICE_DOUBLE_FP_CONFIG, cl_device_fp_config), - CONFIG_INFO( 1, 1, CL_DEVICE_GLOBAL_MEM_CACHE_TYPE, cl_device_mem_cache_type), - CONFIG_INFO( 1, 1, CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_GLOBAL_MEM_CACHE_SIZE, cl_ulong), - CONFIG_INFO( 1, 1, CL_DEVICE_GLOBAL_MEM_SIZE, cl_ulong), - - CONFIG_INFO( 1, 1, CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE, cl_ulong), - CONFIG_INFO( 1, 1, CL_DEVICE_MAX_CONSTANT_ARGS, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_LOCAL_MEM_TYPE, cl_local_mem_type), - CONFIG_INFO( 1, 1, CL_DEVICE_LOCAL_MEM_SIZE, cl_ulong), - CONFIG_INFO( 1, 1, CL_DEVICE_ERROR_CORRECTION_SUPPORT, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_HOST_UNIFIED_MEMORY, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_PROFILING_TIMER_RESOLUTION, size_t), - CONFIG_INFO( 1, 1, CL_DEVICE_ENDIAN_LITTLE, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_AVAILABLE, cl_uint), - CONFIG_INFO( 1, 1, CL_DEVICE_COMPILER_AVAILABLE, cl_uint), - CONFIG_INFO( 1, 2, CL_DEVICE_LINKER_AVAILABLE, cl_uint), - - CONFIG_INFO( 1, 2, CL_DEVICE_BUILT_IN_KERNELS, string), - - CONFIG_INFO( 1, 2, CL_DEVICE_PRINTF_BUFFER_SIZE, size_t), - CONFIG_INFO( 1, 2, CL_DEVICE_PREFERRED_INTEROP_USER_SYNC, cl_uint), - - CONFIG_INFO( 1, 2, CL_DEVICE_PARENT_DEVICE, cl_device_id), - CONFIG_INFO( 1, 2, CL_DEVICE_PARTITION_MAX_SUB_DEVICES, cl_uint), - CONFIG_INFO( 1, 2, CL_DEVICE_PARTITION_AFFINITY_DOMAIN, cl_device_affinity_domain), - CONFIG_INFO( 1, 2, CL_DEVICE_REFERENCE_COUNT, cl_uint), - - CONFIG_INFO( 1, 1, CL_DEVICE_EXECUTION_CAPABILITIES, cl_device_exec_capabilities), - CONFIG_INFO( 1, 1, CL_DEVICE_QUEUE_ON_HOST_PROPERTIES, cl_command_queue_properties), - CONFIG_INFO( 1, 1, CL_DEVICE_NAME, string), - CONFIG_INFO( 1, 1, CL_DEVICE_VENDOR, string), - CONFIG_INFO( 1, 1, CL_DRIVER_VERSION, string), - CONFIG_INFO( 1, 1, CL_DEVICE_PROFILE, string), - CONFIG_INFO( 1, 1, CL_DEVICE_VERSION, string), - CONFIG_INFO( 1, 1, CL_DEVICE_OPENCL_C_VERSION, string), - CONFIG_INFO( 1, 1, CL_DEVICE_EXTENSIONS, string), - - CONFIG_INFO( 2, 0, CL_DEVICE_MAX_PIPE_ARGS, cl_uint), - CONFIG_INFO( 2, 0, CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS, cl_uint), - CONFIG_INFO( 2, 0, CL_DEVICE_PIPE_MAX_PACKET_SIZE, cl_uint), - - CONFIG_INFO( 2, 0, CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE, size_t), - CONFIG_INFO( 2, 0, CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE, size_t), - - CONFIG_INFO( 2, 0, CL_DEVICE_QUEUE_ON_HOST_PROPERTIES, cl_command_queue_properties), - CONFIG_INFO( 2, 0, CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES, cl_command_queue_properties), - CONFIG_INFO( 2, 0, CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE, cl_uint), - CONFIG_INFO( 2, 0, CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE, cl_uint), - CONFIG_INFO( 2, 0, CL_DEVICE_MAX_ON_DEVICE_QUEUES, cl_uint), - CONFIG_INFO( 2, 0, CL_DEVICE_MAX_ON_DEVICE_EVENTS, cl_uint), - - CONFIG_INFO( 2, 0, CL_DEVICE_PREFERRED_PLATFORM_ATOMIC_ALIGNMENT, cl_uint), - CONFIG_INFO( 2, 0, CL_DEVICE_PREFERRED_GLOBAL_ATOMIC_ALIGNMENT, cl_uint), - CONFIG_INFO( 2, 0, CL_DEVICE_PREFERRED_LOCAL_ATOMIC_ALIGNMENT , cl_uint), - - CONFIG_INFO( 2, 0, CL_DEVICE_SVM_CAPABILITIES, cl_device_svm_capabilities), - - CONFIG_INFO( 2, 1, CL_DEVICE_IL_VERSION, string), - CONFIG_INFO( 2, 1, CL_DEVICE_MAX_NUM_SUB_GROUPS, cl_uint), - CONFIG_INFO( 2, 1, CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS, cl_uint), -}; - -#define ENTRY(T) { T, #T } -struct image_type_entry { - cl_mem_object_type val; - const char *str; -}; -static const struct image_type_entry image_types[] = { - ENTRY(CL_MEM_OBJECT_IMAGE1D), ENTRY(CL_MEM_OBJECT_IMAGE1D_BUFFER), - ENTRY(CL_MEM_OBJECT_IMAGE2D), ENTRY(CL_MEM_OBJECT_IMAGE3D), - ENTRY(CL_MEM_OBJECT_IMAGE1D_ARRAY), ENTRY(CL_MEM_OBJECT_IMAGE2D_ARRAY) -}; - -struct supported_flags_entry { - cl_mem_flags val; - const char *str; -}; - -static const struct supported_flags_entry supported_flags[] = { - ENTRY(CL_MEM_READ_ONLY), ENTRY(CL_MEM_WRITE_ONLY), - ENTRY(CL_MEM_READ_WRITE), ENTRY(CL_MEM_KERNEL_READ_AND_WRITE) -}; - -int getImageInfo(cl_device_id device) -{ - cl_context ctx; - cl_int err; - cl_uint i, num_supported; - cl_image_format *formats; - int num_errors; - int ii, ni = sizeof(image_types)/sizeof(image_types[0]); - int fi, nf = sizeof(supported_flags)/sizeof(supported_flags[0]); - - ctx = clCreateContext(NULL, 1, &device, notify_callback, NULL, &err); - if (!ctx) { - print_error(err, "Unable to create context from device"); - return 1; - } - - num_errors = 0; - for (ii=0; iiconfig_type) - { - case type_cl_device_type: - err = clGetDeviceInfo(device, info->opcode, sizeof(info->config.type), &info->config.type, &config_size_ret); - size_err = config_size_ret != sizeof(info->config.type); - break; - case type_cl_device_fp_config: - err = clGetDeviceInfo(device, info->opcode, sizeof(info->config.fp_config), &info->config.fp_config, &config_size_ret); - size_err = config_size_ret != sizeof(info->config.fp_config); - break; - case type_cl_device_mem_cache_type: - err = clGetDeviceInfo(device, info->opcode, sizeof(info->config.mem_cache_type), &info->config.mem_cache_type, &config_size_ret); - size_err = config_size_ret != sizeof(info->config.mem_cache_type); - break; - case type_cl_local_mem_type: - err = clGetDeviceInfo(device, info->opcode, sizeof(info->config.local_mem_type), &info->config.local_mem_type, &config_size_ret); - size_err = config_size_ret != sizeof(info->config.local_mem_type); - break; - case type_cl_device_exec_capabilities: - err = clGetDeviceInfo(device, info->opcode, sizeof(info->config.exec_capabilities), &info->config.exec_capabilities, &config_size_ret); - size_err = config_size_ret != sizeof(info->config.exec_capabilities); - break; - case type_cl_command_queue_properties: - err = clGetDeviceInfo(device, info->opcode, sizeof(info->config.queue_properties), &info->config.queue_properties, &config_size_ret); - size_err = config_size_ret != sizeof(info->config.queue_properties); - break; - case type_cl_device_id: - err = clGetDeviceInfo(device, info->opcode, sizeof(info->config.device_id), &info->config.device_id, &config_size_ret); - size_err = config_size_ret != sizeof(info->config.device_id); - break; - case type_cl_device_affinity_domain: - err = clGetDeviceInfo(device, info->opcode, sizeof(info->config.affinity_domain), &info->config.affinity_domain, &config_size_ret); - size_err = config_size_ret != sizeof(info->config.affinity_domain); - break; - case type_cl_uint: - err = clGetDeviceInfo(device, info->opcode, sizeof(info->config.uint), &info->config.uint, &config_size_ret); - size_err = config_size_ret != sizeof(info->config.uint); - break; - case type_size_t_arr: - err = clGetDeviceInfo(device, info->opcode, sizeof(info->config.sizet_arr), &info->config.sizet_arr, &config_size_ret); - size_err = config_size_ret != sizeof(info->config.sizet_arr); - break; - case type_size_t: - err = clGetDeviceInfo(device, info->opcode, sizeof(info->config.sizet), &info->config.sizet, &config_size_ret); - size_err = config_size_ret != sizeof(info->config.sizet); - break; - case type_cl_ulong: - err = clGetDeviceInfo(device, info->opcode, sizeof(info->config.ull), &info->config.ull, &config_size_ret); - size_err = config_size_ret != sizeof(info->config.ull); - break; - case type_string: - err = clGetDeviceInfo(device, info->opcode, sizeof(info->config.string), &info->config.string, &config_size_ret); - break; - case type_cl_device_svm_capabilities: - err = clGetDeviceInfo(device, info->opcode, sizeof(info->config.svmCapabilities), &info->config.svmCapabilities, &config_size_ret); - break; - default: - log_error("Unknown config type: %d\n", info->config_type); - break; - } - if (err || size_err) - log_error("\tFailed clGetDeviceInfo for %s.\n", info->opcode_name); - if(err) - print_error(err, "\t\tclGetDeviceInfo failed."); - if (size_err) - log_error("\t\tWrong size return from clGetDeviceInfo.\n"); - return err || size_err; -} - -void dumpConfigInfo(cl_device_id device, config_info* info) -{ - // We should not error if we find an unknown configuration since vendors - // may specify their own options beyond the list in the specification. - switch(info->config_type) - { - case type_cl_device_type: - log_info("\t%s == %s|%s|%s|%s\n", info->opcode_name, - (info->config.fp_config & CL_DEVICE_TYPE_CPU) ? "CL_DEVICE_TYPE_CPU":"", - (info->config.fp_config & CL_DEVICE_TYPE_GPU) ? "CL_DEVICE_TYPE_GPU":"", - (info->config.fp_config & CL_DEVICE_TYPE_ACCELERATOR) ? "CL_DEVICE_TYPE_ACCELERATOR":"", - (info->config.fp_config & CL_DEVICE_TYPE_DEFAULT) ? "CL_DEVICE_TYPE_DEFAULT":"" - ); - { - cl_device_type all_device_types = CL_DEVICE_TYPE_CPU | CL_DEVICE_TYPE_GPU | CL_DEVICE_TYPE_ACCELERATOR | CL_DEVICE_TYPE_DEFAULT; - if(info->config.fp_config & ~all_device_types) - { - log_info("WARNING: %s unknown bits found 0x%08llX", info->opcode_name, (info->config.fp_config & ~all_device_types)); - } - } - break; - case type_cl_device_fp_config: - log_info("\t%s == %s|%s|%s|%s|%s|%s|%s\n", info->opcode_name, - (info->config.fp_config & CL_FP_DENORM) ? "CL_FP_DENORM":"", - (info->config.fp_config & CL_FP_INF_NAN) ? "CL_FP_INF_NAN":"", - (info->config.fp_config & CL_FP_ROUND_TO_NEAREST) ? "CL_FP_ROUND_TO_NEAREST":"", - (info->config.fp_config & CL_FP_ROUND_TO_ZERO) ? "CL_FP_ROUND_TO_ZERO":"", - (info->config.fp_config & CL_FP_ROUND_TO_INF) ? "CL_FP_ROUND_TO_INF":"", - (info->config.fp_config & CL_FP_FMA) ? "CL_FP_FMA":"", - (info->config.fp_config & CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT) ? "CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT":"" - ); - { - cl_device_fp_config all_fp_config = CL_FP_DENORM | CL_FP_INF_NAN | CL_FP_ROUND_TO_NEAREST | - CL_FP_ROUND_TO_ZERO | CL_FP_ROUND_TO_INF | CL_FP_FMA | - CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT; - if(info->config.fp_config & ~all_fp_config) - log_info("WARNING: %s unknown bits found 0x%08llX", info->opcode_name, (info->config.fp_config & ~all_fp_config)); - } - break; - case type_cl_device_mem_cache_type: - switch(info->config.mem_cache_type) - { - case CL_NONE: - log_info("\t%s == CL_NONE\n", info->opcode_name); - break; - case CL_READ_ONLY_CACHE: - log_info("\t%s == CL_READ_ONLY_CACHE\n", info->opcode_name); - break; - case CL_READ_WRITE_CACHE: - log_info("\t%s == CL_READ_WRITE_CACHE\n", info->opcode_name); - break; - default: - log_error("ERROR: %s out of range, %d\n", info->opcode_name, info->config.mem_cache_type); - break; - } - break; - case type_cl_local_mem_type: - switch(info->config.local_mem_type) - { - case CL_NONE: - log_info("\t%s == CL_NONE\n", info->opcode_name); - break; - case CL_LOCAL: - log_info("\t%s == CL_LOCAL\n", info->opcode_name); - break; - case CL_GLOBAL: - log_info("\t%s == CL_GLOBAL\n", info->opcode_name); - break; - default: - log_info("WARNING: %s out of range, %d\n", info->opcode_name, info->config.local_mem_type); - break; - } - break; - case type_cl_device_exec_capabilities: - log_info("\t%s == %s|%s\n", info->opcode_name, - (info->config.exec_capabilities & CL_EXEC_KERNEL) ? "CL_EXEC_KERNEL":"", - (info->config.exec_capabilities & CL_EXEC_NATIVE_KERNEL) ? "CL_EXEC_NATIVE_KERNEL":"" ); - { - cl_device_exec_capabilities all_exec_cap = CL_EXEC_KERNEL | CL_EXEC_NATIVE_KERNEL; - if(info->config.exec_capabilities & ~all_exec_cap) - log_info("WARNING: %s unknown bits found 0x%08llX", info->opcode_name, (info->config.exec_capabilities & ~all_exec_cap)); - } - break; - case type_cl_command_queue_properties: - log_info("\t%s == %s|%s\n", info->opcode_name, - (info->config.queue_properties & CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE) ? "CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE":"", - (info->config.queue_properties & CL_QUEUE_PROFILING_ENABLE) ? "CL_QUEUE_PROFILING_ENABLE":""); - { - cl_command_queue_properties all_queue_properties = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_PROFILING_ENABLE; - if(info->config.queue_properties & ~all_queue_properties) - log_info("WARNING: %s unknown bits found 0x%08llX", info->opcode_name, (info->config.exec_capabilities & ~all_queue_properties)); - } - break; - case type_cl_device_id: - log_info("\t%s == %ld\n", info->opcode_name, (intptr_t)info->config.device_id); - break; - case type_cl_device_affinity_domain: - log_info("\t%s == %s|%s|%s|%s|%s|%s\n", info->opcode_name, - (info->config.affinity_domain & CL_DEVICE_AFFINITY_DOMAIN_NUMA) ? "CL_DEVICE_AFFINITY_DOMAIN_NUMA":"", - (info->config.affinity_domain & CL_DEVICE_AFFINITY_DOMAIN_L4_CACHE) ? "CL_DEVICE_AFFINITY_DOMAIN_L4_CACHE":"", - (info->config.affinity_domain & CL_DEVICE_AFFINITY_DOMAIN_L3_CACHE) ? "CL_DEVICE_AFFINITY_DOMAIN_L3_CACHE":"", - (info->config.affinity_domain & CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE) ? "CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE":"", - (info->config.affinity_domain & CL_DEVICE_AFFINITY_DOMAIN_L1_CACHE) ? "CL_DEVICE_AFFINITY_DOMAIN_L1_CACHE":"", - (info->config.affinity_domain & CL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE) ? "CL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE":"" - ); - { - cl_device_affinity_domain all_affinity_domain = CL_DEVICE_AFFINITY_DOMAIN_NUMA | - CL_DEVICE_AFFINITY_DOMAIN_L4_CACHE | - CL_DEVICE_AFFINITY_DOMAIN_L3_CACHE | - CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE | - CL_DEVICE_AFFINITY_DOMAIN_L1_CACHE | - CL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE; - if(info->config.affinity_domain & ~all_affinity_domain) - log_error("ERROR: %s unknown bits found 0x%08llX", info->opcode_name, (info->config.affinity_domain & ~all_affinity_domain)); - } - break; - case type_cl_uint: - log_info("\t%s == %u\n", info->opcode_name, info->config.uint); - break; - case type_size_t_arr: - log_info("\t%s == %d %d %d\n", info->opcode_name, info->config.sizet_arr[0], - info->config.sizet_arr[1], info->config.sizet_arr[2]); - break; - case type_size_t: - log_info("\t%s == %ld\n", info->opcode_name, info->config.sizet); - break; - case type_cl_ulong: - log_info("\t%s == %lld\n", info->opcode_name, info->config.ull); - break; - case type_string: - log_info("\t%s == \"%s\"\n", info->opcode_name, info->config.string); - break; - case type_cl_device_svm_capabilities: - log_info("\t%s == %s|%s|%s|%s\n", info->opcode_name, - (info->config.svmCapabilities & CL_DEVICE_SVM_COARSE_GRAIN_BUFFER) ? "CL_DEVICE_SVM_COARSE_GRAIN_BUFFER":"", - (info->config.svmCapabilities & CL_DEVICE_SVM_FINE_GRAIN_BUFFER) ? "CL_DEVICE_SVM_FINE_GRAIN_BUFFER":"", - (info->config.svmCapabilities & CL_DEVICE_SVM_FINE_GRAIN_SYSTEM) ? "CL_DEVICE_SVM_FINE_GRAIN_SYSTEM":"", - (info->config.svmCapabilities & CL_DEVICE_SVM_ATOMICS) ? "CL_DEVICE_SVM_ATOMICS":""); - { - cl_device_svm_capabilities all_svm_capabilities = CL_DEVICE_SVM_COARSE_GRAIN_BUFFER | - CL_DEVICE_SVM_FINE_GRAIN_BUFFER | - CL_DEVICE_SVM_FINE_GRAIN_SYSTEM | - CL_DEVICE_SVM_ATOMICS; - if(info->config.svmCapabilities & ~all_svm_capabilities) - log_info("WARNING: %s unknown bits found 0x%08llX", info->opcode_name, (info->config.svmCapabilities & ~all_svm_capabilities)); - } - break; - } -} - -void print_platform_string_selector( cl_platform_id platform, const char *selector_name, cl_platform_info selector ) -{ - // Currently all the selectors are strings - size_t size = 0; - char *value; - int err; - - if(( err = clGetPlatformInfo( platform, selector, 0, NULL, &size ))) - { - log_error( "FAILURE: Unable to get platform info size for %s.\n", selector_name ); - exit( -1 ); - } - - if( size == 0 ) - { - log_error( "FAILURE: The size of %s was returned to be zero.\n", selector_name ); - exit( -1 ); - } - - value = (char*) malloc( size ); - if( NULL == value ) - { - log_error( "Internal test failure: Unable to allocate %ld bytes\n", size ); - exit(-1); - } - - memset( value, -1, size ); - if(( err = clGetPlatformInfo( platform, selector, size, value, NULL ))) - { - log_error( "FAILURE: Unable to get platform info for %s.\n", selector_name ); - free( value ); - exit( -1 ); - } - - if( value[size-1] != '\0' ) - { - log_error( "FAILURE: platform info for %s is either not NUL terminated, or the size is wrong.\n", selector_name ); - free( value ); - exit( -1 ); - } - - log_info( "\t%s: %s\n", selector_name, value ); - free( value ); -} - -int parseVersion( char const * str, version_t * version ) -{ - int rc = -1; - version->major = 0; - version->minor = 0; - if ( strncmp( str, "OpenCL 1.2", 10 ) == 0 && ( str[ 10 ] == 0 || str[ 10 ] == ' ' ) ) { - version->major = 1; - version->minor = 2; - rc = 0; - } else if ( strncmp( str, "OpenCL 1.1", 10 ) == 0 && ( str[ 10 ] == 0 || str[ 10 ] == ' ' ) ) { - version->major = 1; - version->minor = 1; - rc = 0; - } else if ( strncmp( str, "OpenCL 2.0", 10 ) == 0 && ( str[ 10 ] == 0 || str[ 10 ] == ' ' ) ) { - version->major = 2; - version->minor = 0; - rc = 0; - } else if ( strncmp( str, "OpenCL 2.1", 10 ) == 0 && ( str[ 10 ] == 0 || str[ 10 ] == ' ' ) ) { - version->major = 2; - version->minor = 1; - rc = 0; - } else { - log_error( "ERROR: Unexpected version string: `%s'.\n", str ); - }; - return rc; -} - -int parseExtensions( char const * str, extensions_t * extensions ) -{ - char const * begin = NULL; - char const * space = NULL; - size_t length = 0; - - memset( extensions, 0, sizeof ( extensions_t ) ); - - begin = str; - while ( begin[ 0 ] != 0 ) { - space = strchr( begin, ' ' ); // Find space position. - if ( space != NULL ) { // Calculate length of word. - length = space - begin; - } else { - length = strlen( begin ); - } - if ( strncmp( begin, "cl_khr_fp64", length ) == 0 ) { - extensions->cl_khr_fp64 = 1; - } - if ( strncmp( begin, "cl_khr_fp16", length ) == 0 ) { - extensions->cl_khr_fp16 = 1; - } - begin += length; // Skip word. - if ( begin[ 0 ] == ' ' ) { // Skip space, if any. - begin += 1; - } - } - - return 0; -} - -int getConfigInfos( cl_device_id device ) -{ - int total_errors = 0; - unsigned onConfigInfo; - version_t version = { 0, 0 }; // Version of the device. Will get real value on the first loop iteration. - version_t const ver11 = { 1, 1 }; // Version 1.1. - extensions_t extensions = { 0 }; - int get; // Boolean flag: true = get property, false = skip it. - int err; - for ( onConfigInfo = 0; onConfigInfo < sizeof(config_infos) / sizeof(config_infos[0]); onConfigInfo++) { - config_info info = config_infos[ onConfigInfo ]; - // Get a property only if device version is equal or greater than property version. - get = ( vercmp( version, info.version ) >= 0 ); - if ( info.opcode == CL_DEVICE_DOUBLE_FP_CONFIG && vercmp( version, ver11 ) <= 0 ) { - // CL_DEVICE_DOUBLE_FP_CONFIG is a special case. It was introduced in OpenCL 1.1, but - // device is required to report it only if doubles are supported. So, before querying - // it on device version 1.1, we have to check doubles are sopported. - // In OpenCL 1.2 CL_DEVICE_DOUBLE_FP_CONFIG should be reported unconditionally. - get = extensions.cl_khr_fp64; - }; - if ( info.opcode == CL_DEVICE_HALF_FP_CONFIG ) { - // CL_DEVICE_HALF_FP_CONFIG should be reported only when cl_khr_fp16 extension is available - get = extensions.cl_khr_fp16; - }; - if ( get ) { - err = getConfigInfo(device, & info); - if ( ! err ) { - dumpConfigInfo(device, & info); - if ( info.opcode == CL_DEVICE_VERSION ) { - err = parseVersion( info.config.string, & version ); - if ( err ) { - total_errors++; - break; - } - } else if ( info.opcode == CL_DEVICE_EXTENSIONS ) { - err = parseExtensions( info.config.string, & extensions ); - if ( err ) { - total_errors++; - break; - } - } - } else { - total_errors++; - } - } else { - log_info( "\tSkipped: %s.\n", info.opcode_name ); - } - } - - if (is_extension_available(device, "cl_khr_image2d_from_buffer")){ - for ( onConfigInfo = 0; onConfigInfo < sizeof(image_buffer_config_infos) / sizeof(image_buffer_config_infos[0]); onConfigInfo++) { - config_info info = image_buffer_config_infos[ onConfigInfo ]; - get = ( vercmp( version, info.version ) >= 0 ); - if ( get ) { - err = getConfigInfo(device, & info); - if ( ! err ) { - dumpConfigInfo(device, & info); - } - else { - total_errors++; - } - } - } - } - - total_errors += getImageInfo(device); - - return total_errors; -} - - -int test_computeinfo( cl_device_id deviceID, cl_context context, cl_command_queue ignoreQueue, int num_elements ) -{ - int err; - int total_errors = 0; - cl_platform_id platform; - - err = clGetPlatformIDs(1, &platform, NULL); - test_error(err, "clGetPlatformIDs failed"); - if (err != CL_SUCCESS) { - total_errors++; - } - - // print platform info - log_info( "\nclGetPlatformInfo:\n------------------\n" ); - print_platform_string_selector( platform, "CL_PLATFORM_PROFILE", CL_PLATFORM_PROFILE ); - print_platform_string_selector( platform, "CL_PLATFORM_VERSION", CL_PLATFORM_VERSION ); - print_platform_string_selector( platform, "CL_PLATFORM_NAME", CL_PLATFORM_NAME ); - print_platform_string_selector( platform, "CL_PLATFORM_VENDOR", CL_PLATFORM_VENDOR ); - print_platform_string_selector( platform, "CL_PLATFORM_EXTENSIONS", CL_PLATFORM_EXTENSIONS ); - log_info( "\n" ); - - // Check to see if this test is being run on a specific device - char* device_type_env = getenv("CL_DEVICE_TYPE"); - char* device_index_env = getenv("CL_DEVICE_INDEX"); - - if (device_type_env || device_index_env) { - - cl_device_type device_type = CL_DEVICE_TYPE_DEFAULT; - size_t device_type_idx = 0; - size_t device_index = 0; - - // Check to see if a device type was specified. - if (device_type_env) { - if (!strcmp(device_type_env,"default") || !strcmp(device_type_env,"CL_DEVICE_TYPE_DEFAULT")) { - device_type = CL_DEVICE_TYPE_DEFAULT; - device_type_idx = 0; - } - else if (!strcmp(device_type_env,"cpu") || !strcmp(device_type_env,"CL_DEVICE_TYPE_CPU")) { - device_type = CL_DEVICE_TYPE_CPU; - device_type_idx = 1; - } - else if (!strcmp(device_type_env,"gpu") || !strcmp(device_type_env,"CL_DEVICE_TYPE_GPU")) { - device_type = CL_DEVICE_TYPE_GPU; - device_type_idx = 2; - } - else if (!strcmp(device_type_env,"accelerator") || !strcmp(device_type_env,"CL_DEVICE_TYPE_ACCELERATOR")) { - device_type = CL_DEVICE_TYPE_ACCELERATOR; - device_type_idx = 3; - } - else { - log_error("CL_DEVICE_TYPE=\"%s\" is invalid\n",device_type_env); - return -1; - } - } - - // Check to see if a device index was specified - if (device_index_env) - device_index = atoi(device_index_env); - - // Look up the device - cl_uint num_devices; - err = clGetDeviceIDs(platform, device_type, 0, NULL, &num_devices); - if (err) - { - log_error("No devices of type %s found.\n", device_type_env); - return -1; - } - - if (device_index >= num_devices) { - log_error("CL_DEVICE_INDEX=%d is greater than the number of matching devices %d\n",(unsigned)device_index,num_devices); - return -1; - } - - if (num_devices == 0) - { - log_error("No devices of type %s found.\n", device_type_env); - return -1; - } - - cl_device_id *devices = (cl_device_id *) malloc( num_devices * sizeof( cl_device_id ) ); - err = clGetDeviceIDs(platform, device_type, num_devices, devices, NULL); - if (err) - { - log_error("No devices of type %s found.\n", device_type_env); - free(devices); - return -1; - } - - cl_device_id device = devices[device_index]; - free(devices); - - log_info("%s Device %d of %d Info:\n", device_infos[device_type_idx].device_type_name, (unsigned)device_index+1, num_devices); - total_errors += getConfigInfos( device ); - log_info("\n"); - - } - - // Otherwise iterate over all of the devices in the platform - else { - //print device info - int onInfo; - for(onInfo = 0; onInfo < sizeof(device_infos) / sizeof(device_infos[0]); onInfo++) - { - log_info("Getting device IDs for %s devices\n", device_infos[onInfo].device_type_name); - err = clGetDeviceIDs(platform, device_infos[onInfo].device_type, 0, NULL, &device_infos[onInfo].num_devices); - if (err == CL_DEVICE_NOT_FOUND) - { - log_info("No devices of type %s found.\n", device_infos[onInfo].device_type_name); - continue; - } - test_error(err, "clGetDeviceIDs failed"); - - log_info("Found %d %s devices:\n", device_infos[onInfo].num_devices, device_infos[onInfo].device_type_name); - if(device_infos[onInfo].num_devices) - { - device_infos[onInfo].devices = (cl_device_id *)malloc(sizeof(cl_device_id) * device_infos[onInfo].num_devices); - err = clGetDeviceIDs(platform, device_infos[onInfo].device_type, device_infos[onInfo].num_devices, device_infos[onInfo].devices, NULL); - test_error(err, "clGetDeviceIDs failed"); - } - - int onDevice; - for(onDevice = 0; onDevice < device_infos[onInfo].num_devices; onDevice++) - { - log_info("%s Device %d of %d Info:\n", device_infos[onInfo].device_type_name, onDevice+1, device_infos[onInfo].num_devices); - total_errors += getConfigInfos( device_infos[onInfo].devices[onDevice] ); - log_info("\n"); - } - - if(device_infos[onInfo].num_devices) - { - free(device_infos[onInfo].devices); - } - } - } - - return total_errors; -} - -test_definition test_list[] = { - ADD_TEST( computeinfo ), -}; - -const int test_num = ARRAY_SIZE( test_list ); - -int main(int argc, const char** argv) -{ - const char** argList = (const char**)calloc( argc, sizeof(char*) ); - if( NULL == argList ) - { - log_error( "Failed to allocate memory for argList array.\n" ); - return 1; - } - - argList[0] = argv[0]; - size_t argCount = 1; - - for( int i = 1; i < argc; i++ ) - { - if( strcmp(argv[1], "-v") == 0) - { - dump_supported_formats = 1; - } - else - { - argList[argCount] = argv[i]; - argCount++; - } - } - - return runTestHarness( argCount, argList, test_num, test_list, false, true, 0 ); -} - diff --git a/test_conformance/computeinfo/main.cpp b/test_conformance/computeinfo/main.cpp new file mode 100644 index 00000000..19aadb7a --- /dev/null +++ b/test_conformance/computeinfo/main.cpp @@ -0,0 +1,1460 @@ +// +// Copyright (c) 2017-2019 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "harness/compat.h" + +#include +#include +#include +#include +#include "harness/testHarness.h" +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" + +static int dump_supported_formats; + +typedef struct +{ + cl_device_type device_type; + const char* device_type_name; + unsigned num_devices; + cl_device_id* devices; + // more infos here +} device_info; + +device_info device_infos[] = { + { CL_DEVICE_TYPE_DEFAULT, "CL_DEVICE_TYPE_DEFAULT", -1, NULL }, + { CL_DEVICE_TYPE_CPU, "CL_DEVICE_TYPE_CPU", -1, NULL }, + { CL_DEVICE_TYPE_GPU, "CL_DEVICE_TYPE_GPU", -1, NULL }, + { CL_DEVICE_TYPE_ACCELERATOR, "CL_DEVICE_TYPE_ACCELERATOR", -1, NULL }, + { CL_DEVICE_TYPE_ALL, "CL_DEVICE_TYPE_ALL", -1, NULL }, +}; + +// config types +enum +{ + type_cl_device_type, + type_cl_device_fp_config, + type_cl_device_mem_cache_type, + type_cl_local_mem_type, + type_cl_device_exec_capabilities, + type_cl_command_queue_properties, + type_cl_device_id, + type_cl_device_affinity_domain, + type_cl_uint, + type_size_t, + type_size_t_arr, + type_cl_ulong, + type_string, + type_cl_device_svm_capabilities, + type_cl_device_atomic_capabilities, + type_cl_device_device_enqueue_capabilities, + type_cl_name_version_array, + type_cl_name_version, +}; + +typedef union { + cl_device_type type; + cl_device_fp_config fp_config; + cl_device_mem_cache_type mem_cache_type; + cl_device_local_mem_type local_mem_type; + cl_device_exec_capabilities exec_capabilities; + cl_command_queue_properties queue_properties; + cl_device_id device_id; + cl_device_affinity_domain affinity_domain; + cl_int uint; + size_t sizet; + size_t sizet_arr[3]; + cl_ulong ull; + char* string; + cl_device_svm_capabilities svmCapabilities; + cl_device_atomic_capabilities atomicCapabilities; + cl_device_device_enqueue_capabilities deviceEnqueueCapabilities; + cl_name_version* cl_name_version_array; + cl_name_version cl_name_version_single; +} config_data; + +struct _version +{ + int major; + int minor; +}; +typedef struct _version version_t; + +struct _extensions +{ + int cl_khr_fp64; + int cl_khr_fp16; +}; +typedef struct _extensions extensions_t; + +// Compare two versions, return -1 (the first is lesser), 0 (equal), 1 (the +// first is greater). +int vercmp(version_t a, version_t b) +{ + if (a.major < b.major || (a.major == b.major && a.minor < b.minor)) + { + return -1; + } + else if (a.major == b.major && a.minor == b.minor) + { + return 0; + } + else + { + return 1; + } +} + +typedef struct +{ + version_t version; // Opcode is introduced in this version of OpenCL spec. + cl_device_info opcode; + const char* opcode_name; + int config_type; + config_data config; + size_t opcode_ret_size; +} config_info; + +#define CONFIG_INFO(major, minor, opcode, type) \ + { \ + { major, minor }, opcode, #opcode, type_##type, { 0 } \ + } + +config_info image_buffer_config_infos[] = { +#ifdef CL_DEVICE_IMAGE_PITCH_ALIGNMENT + CONFIG_INFO(1, 2, CL_DEVICE_IMAGE_PITCH_ALIGNMENT, cl_uint), + CONFIG_INFO(1, 2, CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT, cl_uint), +#endif +}; + +config_info config_infos[] = { + // `CL_DEVICE_VERSION' must be the first item in the list! It's version must + // be 0, 0. + CONFIG_INFO(0, 0, CL_DEVICE_VERSION, string), + // `CL_DEVICE_EXTENSIONS' must be the second! + CONFIG_INFO(1, 1, CL_DEVICE_EXTENSIONS, string), + + CONFIG_INFO(1, 1, CL_DEVICE_TYPE, cl_device_type), + CONFIG_INFO(1, 1, CL_DEVICE_VENDOR_ID, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_MAX_COMPUTE_UNITS, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_MAX_WORK_ITEM_SIZES, size_t_arr), + CONFIG_INFO(1, 1, CL_DEVICE_MAX_WORK_GROUP_SIZE, size_t), + CONFIG_INFO(1, 1, CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_NATIVE_VECTOR_WIDTH_INT, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF, cl_uint), + + CONFIG_INFO(1, 1, CL_DEVICE_MAX_CLOCK_FREQUENCY, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_ADDRESS_BITS, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_MAX_READ_IMAGE_ARGS, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_MAX_WRITE_IMAGE_ARGS, cl_uint), + CONFIG_INFO(2, 0, CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_MAX_MEM_ALLOC_SIZE, cl_ulong), + CONFIG_INFO(1, 1, CL_DEVICE_IMAGE2D_MAX_WIDTH, size_t), + CONFIG_INFO(1, 1, CL_DEVICE_IMAGE2D_MAX_HEIGHT, size_t), + CONFIG_INFO(1, 1, CL_DEVICE_IMAGE3D_MAX_WIDTH, size_t), + CONFIG_INFO(1, 1, CL_DEVICE_IMAGE3D_MAX_HEIGHT, size_t), + CONFIG_INFO(1, 1, CL_DEVICE_IMAGE3D_MAX_DEPTH, size_t), + CONFIG_INFO(1, 2, CL_DEVICE_IMAGE_MAX_ARRAY_SIZE, size_t), + CONFIG_INFO(1, 2, CL_DEVICE_IMAGE_MAX_BUFFER_SIZE, size_t), + CONFIG_INFO(1, 1, CL_DEVICE_IMAGE_SUPPORT, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_MAX_PARAMETER_SIZE, size_t), + CONFIG_INFO(1, 1, CL_DEVICE_MAX_SAMPLERS, cl_uint), + CONFIG_INFO(2, 0, CL_DEVICE_IMAGE_PITCH_ALIGNMENT, cl_uint), + CONFIG_INFO(2, 0, CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT, cl_uint), + + CONFIG_INFO(1, 1, CL_DEVICE_MEM_BASE_ADDR_ALIGN, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_SINGLE_FP_CONFIG, cl_device_fp_config), + CONFIG_INFO(1, 1, CL_DEVICE_DOUBLE_FP_CONFIG, cl_device_fp_config), + CONFIG_INFO(1, 1, CL_DEVICE_GLOBAL_MEM_CACHE_TYPE, + cl_device_mem_cache_type), + CONFIG_INFO(1, 1, CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_GLOBAL_MEM_CACHE_SIZE, cl_ulong), + CONFIG_INFO(1, 1, CL_DEVICE_GLOBAL_MEM_SIZE, cl_ulong), + + CONFIG_INFO(1, 1, CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE, cl_ulong), + CONFIG_INFO(1, 1, CL_DEVICE_MAX_CONSTANT_ARGS, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_LOCAL_MEM_TYPE, cl_local_mem_type), + CONFIG_INFO(1, 1, CL_DEVICE_LOCAL_MEM_SIZE, cl_ulong), + CONFIG_INFO(1, 1, CL_DEVICE_ERROR_CORRECTION_SUPPORT, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_HOST_UNIFIED_MEMORY, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_PROFILING_TIMER_RESOLUTION, size_t), + CONFIG_INFO(1, 1, CL_DEVICE_ENDIAN_LITTLE, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_AVAILABLE, cl_uint), + CONFIG_INFO(1, 1, CL_DEVICE_COMPILER_AVAILABLE, cl_uint), + CONFIG_INFO(1, 2, CL_DEVICE_LINKER_AVAILABLE, cl_uint), + + CONFIG_INFO(1, 2, CL_DEVICE_BUILT_IN_KERNELS, string), + + CONFIG_INFO(1, 2, CL_DEVICE_PRINTF_BUFFER_SIZE, size_t), + CONFIG_INFO(1, 2, CL_DEVICE_PREFERRED_INTEROP_USER_SYNC, cl_uint), + + CONFIG_INFO(1, 2, CL_DEVICE_PARENT_DEVICE, cl_device_id), + CONFIG_INFO(1, 2, CL_DEVICE_PARTITION_MAX_SUB_DEVICES, cl_uint), + CONFIG_INFO(1, 2, CL_DEVICE_PARTITION_AFFINITY_DOMAIN, + cl_device_affinity_domain), + CONFIG_INFO(1, 2, CL_DEVICE_REFERENCE_COUNT, cl_uint), + + CONFIG_INFO(1, 1, CL_DEVICE_EXECUTION_CAPABILITIES, + cl_device_exec_capabilities), + CONFIG_INFO(1, 1, CL_DEVICE_QUEUE_ON_HOST_PROPERTIES, + cl_command_queue_properties), + CONFIG_INFO(1, 1, CL_DEVICE_NAME, string), + CONFIG_INFO(1, 1, CL_DEVICE_VENDOR, string), + CONFIG_INFO(1, 1, CL_DRIVER_VERSION, string), + CONFIG_INFO(1, 1, CL_DEVICE_PROFILE, string), + CONFIG_INFO(1, 1, CL_DEVICE_OPENCL_C_VERSION, string), + + CONFIG_INFO(2, 0, CL_DEVICE_MAX_PIPE_ARGS, cl_uint), + CONFIG_INFO(2, 0, CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS, cl_uint), + CONFIG_INFO(2, 0, CL_DEVICE_PIPE_MAX_PACKET_SIZE, cl_uint), + + CONFIG_INFO(2, 0, CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE, size_t), + CONFIG_INFO(2, 0, CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE, size_t), + + CONFIG_INFO(2, 0, CL_DEVICE_QUEUE_ON_HOST_PROPERTIES, + cl_command_queue_properties), + CONFIG_INFO(2, 0, CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES, + cl_command_queue_properties), + CONFIG_INFO(2, 0, CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE, cl_uint), + CONFIG_INFO(2, 0, CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE, cl_uint), + CONFIG_INFO(2, 0, CL_DEVICE_MAX_ON_DEVICE_QUEUES, cl_uint), + CONFIG_INFO(2, 0, CL_DEVICE_MAX_ON_DEVICE_EVENTS, cl_uint), + + CONFIG_INFO(2, 0, CL_DEVICE_PREFERRED_PLATFORM_ATOMIC_ALIGNMENT, cl_uint), + CONFIG_INFO(2, 0, CL_DEVICE_PREFERRED_GLOBAL_ATOMIC_ALIGNMENT, cl_uint), + CONFIG_INFO(2, 0, CL_DEVICE_PREFERRED_LOCAL_ATOMIC_ALIGNMENT, cl_uint), + + CONFIG_INFO(2, 0, CL_DEVICE_SVM_CAPABILITIES, cl_device_svm_capabilities), + + CONFIG_INFO(2, 1, CL_DEVICE_IL_VERSION, string), + CONFIG_INFO(2, 1, CL_DEVICE_MAX_NUM_SUB_GROUPS, cl_uint), + CONFIG_INFO(2, 1, CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS, + cl_uint), + CONFIG_INFO(3, 0, CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES, + cl_device_atomic_capabilities), + CONFIG_INFO(3, 0, CL_DEVICE_ATOMIC_FENCE_CAPABILITIES, + cl_device_atomic_capabilities), + CONFIG_INFO(3, 0, CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT, cl_uint), + CONFIG_INFO(3, 0, CL_DEVICE_PREFERRED_WORK_GROUP_SIZE_MULTIPLE, size_t), + CONFIG_INFO(3, 0, CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT, + cl_uint), + CONFIG_INFO(3, 0, CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT, cl_uint), + CONFIG_INFO(3, 0, CL_DEVICE_OPENCL_C_FEATURES, cl_name_version_array), + CONFIG_INFO(3, 0, CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES, + cl_device_device_enqueue_capabilities), + CONFIG_INFO(3, 0, CL_DEVICE_PIPE_SUPPORT, cl_uint), + CONFIG_INFO(3, 0, CL_DEVICE_NUMERIC_VERSION, cl_name_version), + CONFIG_INFO(3, 0, CL_DEVICE_EXTENSIONS_WITH_VERSION, cl_name_version_array), + CONFIG_INFO(3, 0, CL_DEVICE_OPENCL_C_ALL_VERSIONS, cl_name_version_array), + CONFIG_INFO(3, 0, CL_DEVICE_ILS_WITH_VERSION, cl_name_version_array), + CONFIG_INFO(3, 0, CL_DEVICE_BUILT_IN_KERNELS_WITH_VERSION, + cl_name_version_array), +}; + +#define ENTRY(major, minor, T) \ + { \ + { major, minor }, T, #T \ + } +struct image_type_entry +{ + version_t + version; // Image type is introduced in this version of OpenCL spec. + cl_mem_object_type val; + const char* str; +}; +static const struct image_type_entry image_types[] = { + ENTRY(1, 2, CL_MEM_OBJECT_IMAGE1D), + ENTRY(1, 2, CL_MEM_OBJECT_IMAGE1D_BUFFER), + ENTRY(1, 0, CL_MEM_OBJECT_IMAGE2D), + ENTRY(1, 0, CL_MEM_OBJECT_IMAGE3D), + ENTRY(1, 2, CL_MEM_OBJECT_IMAGE1D_ARRAY), + ENTRY(1, 2, CL_MEM_OBJECT_IMAGE2D_ARRAY) +}; + +struct supported_flags_entry +{ + version_t + version; // Memory flag is introduced in this version of OpenCL spec. + cl_mem_flags val; + const char* str; +}; + +static const struct supported_flags_entry supported_flags[] = { + ENTRY(1, 0, CL_MEM_READ_ONLY), ENTRY(1, 0, CL_MEM_WRITE_ONLY), + ENTRY(1, 0, CL_MEM_READ_WRITE), ENTRY(2, 0, CL_MEM_KERNEL_READ_AND_WRITE) +}; + +int getImageInfo(cl_device_id device, const version_t& version) +{ + cl_context ctx; + cl_int err; + cl_uint i, num_supported; + cl_image_format* formats; + int num_errors; + int ii, ni = sizeof(image_types) / sizeof(image_types[0]); + int fi, nf = sizeof(supported_flags) / sizeof(supported_flags[0]); + + ctx = clCreateContext(NULL, 1, &device, notify_callback, NULL, &err); + if (!ctx) + { + print_error(err, "Unable to create context from device"); + return 1; + } + + num_errors = 0; + for (ii = 0; ii < ni; ++ii) + { + if (vercmp(version, image_types[ii].version) < 0) + { + continue; + } + + log_info("\t%s supported formats:\n", image_types[ii].str); + for (fi = 0; fi < nf; ++fi) + { + if (vercmp(version, supported_flags[fi].version) < 0) + { + continue; + } + + err = clGetSupportedImageFormats(ctx, supported_flags[fi].val, + image_types[ii].val, 5000, NULL, + &num_supported); + if (err != CL_SUCCESS) + { + print_error(err, "clGetSupportedImageFormats failed"); + ++num_errors; + continue; + } + + log_info("\t\t%s: %u supported formats\n", supported_flags[fi].str, + num_supported); + + if (num_supported == 0 || dump_supported_formats == 0) continue; + + formats = (cl_image_format*)malloc(num_supported + * sizeof(cl_image_format)); + if (formats == NULL) + { + log_error("malloc failed\n"); + clReleaseContext(ctx); + return num_errors + 1; + } + + err = clGetSupportedImageFormats(ctx, supported_flags[fi].val, + image_types[ii].val, num_supported, + formats, NULL); + if (err != CL_SUCCESS) + { + print_error(err, "clGetSupportedImageFormats failed"); + ++num_errors; + free(formats); + continue; + } + + for (i = 0; i < num_supported; ++i) + log_info( + "\t\t\t%s / %s\n", + GetChannelOrderName(formats[i].image_channel_order), + GetChannelTypeName(formats[i].image_channel_data_type)); + + free(formats); + } + } + + err = clReleaseContext(ctx); + if (err) + { + print_error(err, "Failed to release context\n"); + ++num_errors; + } + + return num_errors; +} +int getPlatformConfigInfo(cl_platform_id platform, config_info* info) +{ + int err = CL_SUCCESS; + int size_err = 0; + size_t config_size_set; + size_t config_size_ret; + switch (info->config_type) + { + case type_string: + err = clGetPlatformInfo(platform, info->opcode, 0, NULL, + &config_size_set); + info->config.string = NULL; + if (err == CL_SUCCESS && config_size_set > 0) + { + info->config.string = (char*)malloc(config_size_set); + err = clGetPlatformInfo(platform, info->opcode, config_size_set, + info->config.string, &config_size_ret); + size_err = config_size_set != config_size_ret; + } + break; + case type_cl_name_version_array: + err = clGetPlatformInfo(platform, info->opcode, 0, NULL, + &config_size_set); + info->config.cl_name_version_array = NULL; + if (err == CL_SUCCESS && config_size_set > 0) + { + info->config.cl_name_version_array = (cl_name_version*)malloc( + config_size_set * sizeof(cl_name_version)); + err = clGetPlatformInfo(platform, info->opcode, config_size_set, + info->config.cl_name_version_array, + &config_size_ret); + size_err = config_size_set != config_size_ret; + info->opcode_ret_size = config_size_ret; + } + break; + case type_cl_name_version: + err = clGetPlatformInfo(platform, info->opcode, 0, NULL, + &config_size_set); + if (err == CL_SUCCESS && config_size_set > 0) + { + err = clGetPlatformInfo(platform, info->opcode, config_size_set, + &info->config.cl_name_version_single, + &config_size_ret); + } + size_err = config_size_set != config_size_ret; + break; + default: + log_error("Unknown config type: %d\n", info->config_type); + break; + } + if (err || size_err) + log_error("\tFailed clGetPlatformInfo for %s.\n", info->opcode_name); + if (err) print_error(err, "\t\tclGetPlatformInfo failed."); + if (size_err) log_error("\t\tWrong size return from clGetPlatformInfo.\n"); + return err || size_err; +} + +int getConfigInfo(cl_device_id device, config_info* info) +{ + int err = CL_SUCCESS; + int size_err = 0; + size_t config_size_set; + size_t config_size_ret; + switch (info->config_type) + { + case type_cl_device_type: + err = + clGetDeviceInfo(device, info->opcode, sizeof(info->config.type), + &info->config.type, &config_size_ret); + size_err = config_size_ret != sizeof(info->config.type); + break; + case type_cl_device_fp_config: + err = clGetDeviceInfo(device, info->opcode, + sizeof(info->config.fp_config), + &info->config.fp_config, &config_size_ret); + size_err = config_size_ret != sizeof(info->config.fp_config); + break; + case type_cl_device_mem_cache_type: + err = clGetDeviceInfo( + device, info->opcode, sizeof(info->config.mem_cache_type), + &info->config.mem_cache_type, &config_size_ret); + size_err = config_size_ret != sizeof(info->config.mem_cache_type); + break; + case type_cl_local_mem_type: + err = clGetDeviceInfo( + device, info->opcode, sizeof(info->config.local_mem_type), + &info->config.local_mem_type, &config_size_ret); + size_err = config_size_ret != sizeof(info->config.local_mem_type); + break; + case type_cl_device_exec_capabilities: + err = clGetDeviceInfo( + device, info->opcode, sizeof(info->config.exec_capabilities), + &info->config.exec_capabilities, &config_size_ret); + size_err = + config_size_ret != sizeof(info->config.exec_capabilities); + break; + case type_cl_command_queue_properties: + err = clGetDeviceInfo( + device, info->opcode, sizeof(info->config.queue_properties), + &info->config.queue_properties, &config_size_ret); + size_err = config_size_ret != sizeof(info->config.queue_properties); + break; + case type_cl_device_id: + err = clGetDeviceInfo(device, info->opcode, + sizeof(info->config.device_id), + &info->config.device_id, &config_size_ret); + size_err = config_size_ret != sizeof(info->config.device_id); + break; + case type_cl_device_affinity_domain: + err = clGetDeviceInfo( + device, info->opcode, sizeof(info->config.affinity_domain), + &info->config.affinity_domain, &config_size_ret); + size_err = config_size_ret != sizeof(info->config.affinity_domain); + break; + case type_cl_uint: + err = + clGetDeviceInfo(device, info->opcode, sizeof(info->config.uint), + &info->config.uint, &config_size_ret); + size_err = config_size_ret != sizeof(info->config.uint); + break; + case type_size_t_arr: + err = clGetDeviceInfo(device, info->opcode, + sizeof(info->config.sizet_arr), + &info->config.sizet_arr, &config_size_ret); + size_err = config_size_ret != sizeof(info->config.sizet_arr); + break; + case type_size_t: + err = clGetDeviceInfo(device, info->opcode, + sizeof(info->config.sizet), + &info->config.sizet, &config_size_ret); + size_err = config_size_ret != sizeof(info->config.sizet); + break; + case type_cl_ulong: + err = + clGetDeviceInfo(device, info->opcode, sizeof(info->config.ull), + &info->config.ull, &config_size_ret); + size_err = config_size_ret != sizeof(info->config.ull); + break; + case type_string: + err = clGetDeviceInfo(device, info->opcode, 0, NULL, + &config_size_set); + info->config.string = NULL; + if (err == CL_SUCCESS && config_size_set > 0) + { + info->config.string = (char*)malloc(config_size_set); + err = clGetDeviceInfo(device, info->opcode, config_size_set, + info->config.string, &config_size_ret); + size_err = config_size_set != config_size_ret; + } + break; + case type_cl_device_svm_capabilities: + err = clGetDeviceInfo( + device, info->opcode, sizeof(info->config.svmCapabilities), + &info->config.svmCapabilities, &config_size_ret); + break; + case type_cl_device_device_enqueue_capabilities: + err = clGetDeviceInfo( + device, info->opcode, + sizeof(info->config.deviceEnqueueCapabilities), + &info->config.deviceEnqueueCapabilities, &config_size_ret); + break; + case type_cl_device_atomic_capabilities: + err = clGetDeviceInfo( + device, info->opcode, sizeof(info->config.atomicCapabilities), + &info->config.atomicCapabilities, &config_size_ret); + break; + case type_cl_name_version_array: + err = clGetDeviceInfo(device, info->opcode, 0, NULL, + &config_size_set); + info->config.cl_name_version_array = NULL; + if (err == CL_SUCCESS && config_size_set > 0) + { + info->config.cl_name_version_array = (cl_name_version*)malloc( + config_size_set * sizeof(cl_name_version)); + err = clGetDeviceInfo(device, info->opcode, config_size_set, + info->config.cl_name_version_array, + &config_size_ret); + size_err = config_size_set != config_size_ret; + info->opcode_ret_size = config_size_ret; + } + break; + case type_cl_name_version: + err = clGetDeviceInfo(device, info->opcode, 0, NULL, + &config_size_set); + if (err == CL_SUCCESS && config_size_set > 0) + { + err = clGetDeviceInfo(device, info->opcode, config_size_set, + &info->config.cl_name_version_single, + &config_size_ret); + } + size_err = config_size_set != config_size_ret; + break; + default: + log_error("Unknown config type: %d\n", info->config_type); + break; + } + if (err || size_err) + log_error("\tFailed clGetDeviceInfo for %s.\n", info->opcode_name); + if (err) print_error(err, "\t\tclGetDeviceInfo failed."); + if (size_err) log_error("\t\tWrong size return from clGetDeviceInfo.\n"); + return err || size_err; +} + +void dumpConfigInfo(config_info* info) +{ + // We should not error if we find an unknown configuration since vendors + // may specify their own options beyond the list in the specification. + switch (info->config_type) + { + case type_cl_device_type: + log_info("\t%s == %s|%s|%s|%s\n", info->opcode_name, + (info->config.fp_config & CL_DEVICE_TYPE_CPU) + ? "CL_DEVICE_TYPE_CPU" + : "", + (info->config.fp_config & CL_DEVICE_TYPE_GPU) + ? "CL_DEVICE_TYPE_GPU" + : "", + (info->config.fp_config & CL_DEVICE_TYPE_ACCELERATOR) + ? "CL_DEVICE_TYPE_ACCELERATOR" + : "", + (info->config.fp_config & CL_DEVICE_TYPE_DEFAULT) + ? "CL_DEVICE_TYPE_DEFAULT" + : ""); + { + cl_device_type all_device_types = CL_DEVICE_TYPE_CPU + | CL_DEVICE_TYPE_GPU | CL_DEVICE_TYPE_ACCELERATOR + | CL_DEVICE_TYPE_DEFAULT; + if (info->config.fp_config & ~all_device_types) + { + log_info("WARNING: %s unknown bits found 0x%08" PRIX64, + info->opcode_name, + (info->config.fp_config & ~all_device_types)); + } + } + break; + case type_cl_device_fp_config: + log_info( + "\t%s == %s|%s|%s|%s|%s|%s|%s\n", info->opcode_name, + (info->config.fp_config & CL_FP_DENORM) ? "CL_FP_DENORM" : "", + (info->config.fp_config & CL_FP_INF_NAN) ? "CL_FP_INF_NAN" : "", + (info->config.fp_config & CL_FP_ROUND_TO_NEAREST) + ? "CL_FP_ROUND_TO_NEAREST" + : "", + (info->config.fp_config & CL_FP_ROUND_TO_ZERO) + ? "CL_FP_ROUND_TO_ZERO" + : "", + (info->config.fp_config & CL_FP_ROUND_TO_INF) + ? "CL_FP_ROUND_TO_INF" + : "", + (info->config.fp_config & CL_FP_FMA) ? "CL_FP_FMA" : "", + (info->config.fp_config & CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT) + ? "CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT" + : ""); + { + cl_device_fp_config all_fp_config = CL_FP_DENORM | CL_FP_INF_NAN + | CL_FP_ROUND_TO_NEAREST | CL_FP_ROUND_TO_ZERO + | CL_FP_ROUND_TO_INF | CL_FP_FMA + | CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT; + if (info->config.fp_config & ~all_fp_config) + log_info("WARNING: %s unknown bits found 0x%08" PRIX64, + info->opcode_name, + (info->config.fp_config & ~all_fp_config)); + } + break; + case type_cl_device_mem_cache_type: + switch (info->config.mem_cache_type) + { + case CL_NONE: + log_info("\t%s == CL_NONE\n", info->opcode_name); + break; + case CL_READ_ONLY_CACHE: + log_info("\t%s == CL_READ_ONLY_CACHE\n", info->opcode_name); + break; + case CL_READ_WRITE_CACHE: + log_info("\t%s == CL_READ_WRITE_CACHE\n", + info->opcode_name); + break; + default: + log_error("ERROR: %s out of range, %d\n", info->opcode_name, + info->config.mem_cache_type); + break; + } + break; + case type_cl_local_mem_type: + switch (info->config.local_mem_type) + { + case CL_NONE: + log_info("\t%s == CL_NONE\n", info->opcode_name); + break; + case CL_LOCAL: + log_info("\t%s == CL_LOCAL\n", info->opcode_name); + break; + case CL_GLOBAL: + log_info("\t%s == CL_GLOBAL\n", info->opcode_name); + break; + default: + log_info("WARNING: %s out of range, %d\n", + info->opcode_name, info->config.local_mem_type); + break; + } + break; + case type_cl_device_exec_capabilities: + log_info("\t%s == %s|%s\n", info->opcode_name, + (info->config.exec_capabilities & CL_EXEC_KERNEL) + ? "CL_EXEC_KERNEL" + : "", + (info->config.exec_capabilities & CL_EXEC_NATIVE_KERNEL) + ? "CL_EXEC_NATIVE_KERNEL" + : ""); + { + cl_device_exec_capabilities all_exec_cap = + CL_EXEC_KERNEL | CL_EXEC_NATIVE_KERNEL; + if (info->config.exec_capabilities & ~all_exec_cap) + log_info("WARNING: %s unknown bits found 0x%08" PRIX64, + info->opcode_name, + (info->config.exec_capabilities & ~all_exec_cap)); + } + break; + case type_cl_command_queue_properties: + log_info("\t%s == %s|%s\n", info->opcode_name, + (info->config.queue_properties + & CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE) + ? "CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE" + : "", + (info->config.queue_properties & CL_QUEUE_PROFILING_ENABLE) + ? "CL_QUEUE_PROFILING_ENABLE" + : ""); + { + cl_command_queue_properties all_queue_properties = + CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE + | CL_QUEUE_PROFILING_ENABLE; + if (info->config.queue_properties & ~all_queue_properties) + log_info("WARNING: %s unknown bits found 0x%08" PRIX64, + info->opcode_name, + (info->config.exec_capabilities + & ~all_queue_properties)); + } + break; + case type_cl_device_id: + log_info("\t%s == %ld\n", info->opcode_name, + (intptr_t)info->config.device_id); + break; + case type_cl_device_affinity_domain: + log_info( + "\t%s == %s|%s|%s|%s|%s|%s\n", info->opcode_name, + (info->config.affinity_domain & CL_DEVICE_AFFINITY_DOMAIN_NUMA) + ? "CL_DEVICE_AFFINITY_DOMAIN_NUMA" + : "", + (info->config.affinity_domain + & CL_DEVICE_AFFINITY_DOMAIN_L4_CACHE) + ? "CL_DEVICE_AFFINITY_DOMAIN_L4_CACHE" + : "", + (info->config.affinity_domain + & CL_DEVICE_AFFINITY_DOMAIN_L3_CACHE) + ? "CL_DEVICE_AFFINITY_DOMAIN_L3_CACHE" + : "", + (info->config.affinity_domain + & CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE) + ? "CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE" + : "", + (info->config.affinity_domain + & CL_DEVICE_AFFINITY_DOMAIN_L1_CACHE) + ? "CL_DEVICE_AFFINITY_DOMAIN_L1_CACHE" + : "", + (info->config.affinity_domain + & CL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE) + ? "CL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE" + : ""); + { + cl_device_affinity_domain all_affinity_domain = + CL_DEVICE_AFFINITY_DOMAIN_NUMA + | CL_DEVICE_AFFINITY_DOMAIN_L4_CACHE + | CL_DEVICE_AFFINITY_DOMAIN_L3_CACHE + | CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE + | CL_DEVICE_AFFINITY_DOMAIN_L1_CACHE + | CL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE; + if (info->config.affinity_domain & ~all_affinity_domain) + log_error( + "ERROR: %s unknown bits found 0x%08" PRIX64, + info->opcode_name, + (info->config.affinity_domain & ~all_affinity_domain)); + } + break; + case type_cl_uint: + log_info("\t%s == %u\n", info->opcode_name, info->config.uint); + break; + case type_size_t_arr: + log_info("\t%s == %zu %zu %zu\n", info->opcode_name, + info->config.sizet_arr[0], info->config.sizet_arr[1], + info->config.sizet_arr[2]); + break; + case type_size_t: + log_info("\t%s == %zu\n", info->opcode_name, info->config.sizet); + break; + case type_cl_ulong: + log_info("\t%s == %" PRIu64 "\n", info->opcode_name, + info->config.ull); + break; + case type_string: + log_info("\t%s == \"%s\"\n", info->opcode_name, + info->config.string ? info->config.string : ""); + break; + case type_cl_device_svm_capabilities: + log_info( + "\t%s == %s|%s|%s|%s\n", info->opcode_name, + (info->config.svmCapabilities + & CL_DEVICE_SVM_COARSE_GRAIN_BUFFER) + ? "CL_DEVICE_SVM_COARSE_GRAIN_BUFFER" + : "", + (info->config.svmCapabilities & CL_DEVICE_SVM_FINE_GRAIN_BUFFER) + ? "CL_DEVICE_SVM_FINE_GRAIN_BUFFER" + : "", + (info->config.svmCapabilities & CL_DEVICE_SVM_FINE_GRAIN_SYSTEM) + ? "CL_DEVICE_SVM_FINE_GRAIN_SYSTEM" + : "", + (info->config.svmCapabilities & CL_DEVICE_SVM_ATOMICS) + ? "CL_DEVICE_SVM_ATOMICS" + : ""); + { + cl_device_svm_capabilities all_svm_capabilities = + CL_DEVICE_SVM_COARSE_GRAIN_BUFFER + | CL_DEVICE_SVM_FINE_GRAIN_BUFFER + | CL_DEVICE_SVM_FINE_GRAIN_SYSTEM | CL_DEVICE_SVM_ATOMICS; + if (info->config.svmCapabilities & ~all_svm_capabilities) + log_info( + "WARNING: %s unknown bits found 0x%08" PRIX64, + info->opcode_name, + (info->config.svmCapabilities & ~all_svm_capabilities)); + } + break; + case type_cl_device_device_enqueue_capabilities: + log_info("\t%s == %s|%s\n", info->opcode_name, + (info->config.deviceEnqueueCapabilities + & CL_DEVICE_QUEUE_SUPPORTED) + ? "CL_DEVICE_QUEUE_SUPPORTED" + : "", + (info->config.deviceEnqueueCapabilities + & CL_DEVICE_QUEUE_REPLACEABLE_DEFAULT) + ? "CL_DEVICE_QUEUE_REPLACEABLE_DEFAULT" + : ""); + { + cl_device_device_enqueue_capabilities + all_device_enqueue_capabilities = CL_DEVICE_QUEUE_SUPPORTED + | CL_DEVICE_QUEUE_REPLACEABLE_DEFAULT; + if (info->config.deviceEnqueueCapabilities + & ~all_device_enqueue_capabilities) + log_info("WARNING: %s unknown bits found 0x%08" PRIX64, + info->opcode_name, + (info->config.deviceEnqueueCapabilities + & ~all_device_enqueue_capabilities)); + } + break; + case type_cl_device_atomic_capabilities: + log_info("\t%s == %s|%s|%s|%s|%s|%s|%s\n", info->opcode_name, + (info->config.atomicCapabilities + & CL_DEVICE_ATOMIC_ORDER_RELAXED) + ? "CL_DEVICE_ATOMIC_ORDER_RELAXED" + : "", + (info->config.atomicCapabilities + & CL_DEVICE_ATOMIC_ORDER_ACQ_REL) + ? "CL_DEVICE_ATOMIC_ORDER_ACQ_REL" + : "", + (info->config.atomicCapabilities + & CL_DEVICE_ATOMIC_ORDER_SEQ_CST) + ? "CL_DEVICE_ATOMIC_ORDER_SEQ_CST" + : "", + (info->config.atomicCapabilities + & CL_DEVICE_ATOMIC_SCOPE_WORK_ITEM) + ? "CL_DEVICE_ATOMIC_SCOPE_WORK_ITEM" + : "", + (info->config.atomicCapabilities + & CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP) + ? "CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP" + : "", + (info->config.atomicCapabilities + & CL_DEVICE_ATOMIC_SCOPE_DEVICE) + ? "CL_DEVICE_ATOMIC_SCOPE_DEVICE" + : "", + (info->config.atomicCapabilities + & CL_DEVICE_ATOMIC_SCOPE_ALL_DEVICES) + ? "CL_DEVICE_ATOMIC_SCOPE_ALL_DEVICES" + : ""); + { + cl_device_atomic_capabilities all_atomic_capabilities = + CL_DEVICE_ATOMIC_ORDER_RELAXED + | CL_DEVICE_ATOMIC_ORDER_ACQ_REL + | CL_DEVICE_ATOMIC_ORDER_SEQ_CST + | CL_DEVICE_ATOMIC_SCOPE_WORK_ITEM + | CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP + | CL_DEVICE_ATOMIC_SCOPE_DEVICE + | CL_DEVICE_ATOMIC_SCOPE_ALL_DEVICES; + if (info->config.atomicCapabilities & ~all_atomic_capabilities) + log_info("WARNING: %s unknown bits found 0x%08" PRIX64, + info->opcode_name, + (info->config.atomicCapabilities + & ~all_atomic_capabilities)); + } + break; + case type_cl_name_version_array: { + int number_of_version_items = info->opcode_ret_size + / sizeof(*info->config.cl_name_version_array); + log_info("\t%s supported name and version:\n", info->opcode_name); + if (number_of_version_items == 0) + { + log_info("\t\t\"\"\n"); + } + else + { + for (int f = 0; f < number_of_version_items; f++) + { + cl_name_version new_version_item = + info->config.cl_name_version_array[f]; + cl_version new_version_major = + CL_VERSION_MAJOR_KHR(new_version_item.version); + cl_version new_version_minor = + CL_VERSION_MINOR_KHR(new_version_item.version); + cl_version new_version_patch = + CL_VERSION_PATCH_KHR(new_version_item.version); + log_info("\t\t\"%s\" %d.%d.%d\n", new_version_item.name, + CL_VERSION_MAJOR_KHR(new_version_item.version), + CL_VERSION_MINOR_KHR(new_version_item.version), + CL_VERSION_PATCH_KHR(new_version_item.version)); + } + } + break; + } + case type_cl_name_version: + log_info("\t%s == %d.%d.%d\n", info->opcode_name, + CL_VERSION_MAJOR_KHR( + info->config.cl_name_version_single.version), + CL_VERSION_MINOR_KHR( + info->config.cl_name_version_single.version), + CL_VERSION_PATCH_KHR( + info->config.cl_name_version_single.version)); + break; + } +} + +void print_platform_string_selector(cl_platform_id platform, + const char* selector_name, + cl_platform_info selector) +{ + // Currently all the selectors are strings + size_t size = 0; + char* value; + int err; + + if ((err = clGetPlatformInfo(platform, selector, 0, NULL, &size))) + { + log_error("FAILURE: Unable to get platform info size for %s.\n", + selector_name); + exit(-1); + } + + if (size == 0) + { + log_error("FAILURE: The size of %s was returned to be zero.\n", + selector_name); + exit(-1); + } + + value = (char*)malloc(size); + if (NULL == value) + { + log_error("Internal test failure: Unable to allocate %zu bytes\n", + size); + exit(-1); + } + + memset(value, -1, size); + if ((err = clGetPlatformInfo(platform, selector, size, value, NULL))) + { + log_error("FAILURE: Unable to get platform info for %s.\n", + selector_name); + free(value); + exit(-1); + } + + if (value[size - 1] != '\0') + { + log_error("FAILURE: platform info for %s is either not NUL terminated, " + "or the size is wrong.\n", + selector_name); + free(value); + exit(-1); + } + + log_info("\t%s: %s\n", selector_name, value); + free(value); +} + +int parseVersion(char const* str, version_t* version) +{ + int rc = -1; + version->major = 0; + version->minor = 0; + if (strncmp(str, "OpenCL 1.2", 10) == 0 && (str[10] == 0 || str[10] == ' ')) + { + version->major = 1; + version->minor = 2; + rc = 0; + } + else if (strncmp(str, "OpenCL 1.0", 10) == 0 + && (str[10] == 0 || str[10] == ' ')) + { + version->major = 1; + version->minor = 0; + rc = 0; + } + else if (strncmp(str, "OpenCL 1.1", 10) == 0 + && (str[10] == 0 || str[10] == ' ')) + { + version->major = 1; + version->minor = 1; + rc = 0; + } + else if (strncmp(str, "OpenCL 2.0", 10) == 0 + && (str[10] == 0 || str[10] == ' ')) + { + version->major = 2; + version->minor = 0; + rc = 0; + } + else if (strncmp(str, "OpenCL 2.1", 10) == 0 + && (str[10] == 0 || str[10] == ' ')) + { + version->major = 2; + version->minor = 1; + rc = 0; + } + else if (strncmp(str, "OpenCL 2.2", 10) == 0 + && (str[10] == 0 || str[10] == ' ')) + { + version->major = 2; + version->minor = 2; + rc = 0; + } + else if (strncmp(str, "OpenCL 3.0", 10) == 0 + && (str[10] == 0 || str[10] == ' ')) + { + version->major = 3; + version->minor = 0; + rc = 0; + } + else + { + log_error("ERROR: Unexpected version string: `%s'.\n", str); + }; + return rc; +} + +int parseExtensions(char const* str, extensions_t* extensions) +{ + char const* begin = NULL; + char const* space = NULL; + size_t length = 0; + + memset(extensions, 0, sizeof(extensions_t)); + + begin = str; + while (begin[0] != 0) + { + space = strchr(begin, ' '); // Find space position. + if (space != NULL) + { // Calculate length of word. + length = space - begin; + } + else + { + length = strlen(begin); + } + if (strncmp(begin, "cl_khr_fp64", length) == 0) + { + extensions->cl_khr_fp64 = 1; + } + if (strncmp(begin, "cl_khr_fp16", length) == 0) + { + extensions->cl_khr_fp16 = 1; + } + begin += length; // Skip word. + if (begin[0] == ' ') + { // Skip space, if any. + begin += 1; + } + } + + return 0; +} + +int getConfigInfos(cl_device_id device) +{ + int total_errors = 0; + unsigned onConfigInfo; + version_t version = { 0, 0 }; // Version of the device. Will get real value + // on the first loop iteration. + version_t const ver11 = { 1, 1 }; // Version 1.1. + extensions_t extensions = { 0 }; + int get; // Boolean flag: true = get property, false = skip it. + int err; + for (onConfigInfo = 0; + onConfigInfo < sizeof(config_infos) / sizeof(config_infos[0]); + onConfigInfo++) + { + config_info info = config_infos[onConfigInfo]; + // Get a property only if device version is equal or greater than + // property version. + get = (vercmp(version, info.version) >= 0); + if (info.opcode == CL_DEVICE_DOUBLE_FP_CONFIG + && vercmp(version, ver11) <= 0) + { + // CL_DEVICE_DOUBLE_FP_CONFIG is a special case. It was introduced + // in OpenCL 1.1, but device is required to report it only if + // doubles are supported. So, before querying it on device + // version 1.1, we have to check doubles are sopported. In + // OpenCL 1.2 CL_DEVICE_DOUBLE_FP_CONFIG should be reported + // unconditionally. + get = extensions.cl_khr_fp64; + }; + if (info.opcode == CL_DEVICE_HALF_FP_CONFIG) + { + // CL_DEVICE_HALF_FP_CONFIG should be reported only when cl_khr_fp16 + // extension is available + get = extensions.cl_khr_fp16; + }; + if (get) + { + err = getConfigInfo(device, &info); + if (!err) + { + dumpConfigInfo(&info); + if (info.opcode == CL_DEVICE_VERSION) + { + err = parseVersion(info.config.string, &version); + if (err) + { + total_errors++; + free(info.config.string); + break; + } + } + else if (info.opcode == CL_DEVICE_EXTENSIONS) + { + err = parseExtensions(info.config.string, &extensions); + if (err) + { + total_errors++; + free(info.config.string); + break; + } + } + if (info.config_type == type_string) + { + free(info.config.string); + } + if (info.config_type == type_cl_name_version_array) + { + free(info.config.cl_name_version_array); + } + } + else + { + total_errors++; + } + } + else + { + log_info("\tSkipped: %s.\n", info.opcode_name); + } + } + + if (is_extension_available(device, "cl_khr_image2d_from_buffer")) + { + for (onConfigInfo = 0; onConfigInfo < sizeof(image_buffer_config_infos) + / sizeof(image_buffer_config_infos[0]); + onConfigInfo++) + { + config_info info = image_buffer_config_infos[onConfigInfo]; + get = (vercmp(version, info.version) >= 0); + if (get) + { + err = getConfigInfo(device, &info); + if (!err) + { + dumpConfigInfo(&info); + } + else + { + total_errors++; + } + } + } + } + + total_errors += getImageInfo(device, version); + + return total_errors; +} + +config_info config_platform_infos[] = { + // CL_PLATFORM_VERSION has to be first defined with version 0 0. + CONFIG_INFO(0, 0, CL_PLATFORM_VERSION, string), + CONFIG_INFO(1, 1, CL_PLATFORM_PROFILE, string), + CONFIG_INFO(1, 1, CL_PLATFORM_NAME, string), + CONFIG_INFO(1, 1, CL_PLATFORM_VENDOR, string), + CONFIG_INFO(1, 1, CL_PLATFORM_EXTENSIONS, string), + CONFIG_INFO(3, 0, CL_PLATFORM_EXTENSIONS_WITH_VERSION, + cl_name_version_array), + CONFIG_INFO(3, 0, CL_PLATFORM_NUMERIC_VERSION, cl_name_version) +}; + +int getPlatformCapabilities(cl_platform_id platform) +{ + int total_errors = 0; + version_t version = { 0, 0 }; // Version of the device. Will get real value + // on the first loop iteration. + int err; + for (unsigned onConfigInfo = 0; onConfigInfo + < sizeof(config_platform_infos) / sizeof(config_platform_infos[0]); + onConfigInfo++) + { + config_info info = config_platform_infos[onConfigInfo]; + + if (vercmp(version, info.version) >= 0) + { + err = getPlatformConfigInfo(platform, &info); + if (!err) + { + dumpConfigInfo(&info); + if (info.opcode == CL_PLATFORM_VERSION) + { + err = parseVersion(info.config.string, &version); + if (err) + { + total_errors++; + free(info.config.string); + break; + } + } + if (info.config_type == type_string) + { + free(info.config.string); + } + if (info.config_type == type_cl_name_version_array) + { + free(info.config.cl_name_version_array); + } + } + else + { + total_errors++; + } + } + else + { + log_info("\tSkipped: %s.\n", info.opcode_name); + } + } + return total_errors; +} + +int test_computeinfo(cl_device_id deviceID, cl_context context, + cl_command_queue ignoreQueue, int num_elements) +{ + int err; + int total_errors = 0; + cl_platform_id platform; + + err = clGetPlatformIDs(1, &platform, NULL); + test_error(err, "clGetPlatformIDs failed"); + + // print platform info + log_info("\nclGetPlatformInfo:\n------------------\n"); + err = getPlatformCapabilities(platform); + test_error(err, "getPlatformCapabilities failed"); + log_info("\n"); + + // Check to see if this test is being run on a specific device + char* device_type_env = getenv("CL_DEVICE_TYPE"); + char* device_index_env = getenv("CL_DEVICE_INDEX"); + + if (device_type_env || device_index_env) + { + + cl_device_type device_type = CL_DEVICE_TYPE_DEFAULT; + size_t device_type_idx = 0; + size_t device_index = 0; + + // Check to see if a device type was specified. + if (device_type_env) + { + if (!strcmp(device_type_env, "default") + || !strcmp(device_type_env, "CL_DEVICE_TYPE_DEFAULT")) + { + device_type = CL_DEVICE_TYPE_DEFAULT; + device_type_idx = 0; + } + else if (!strcmp(device_type_env, "cpu") + || !strcmp(device_type_env, "CL_DEVICE_TYPE_CPU")) + { + device_type = CL_DEVICE_TYPE_CPU; + device_type_idx = 1; + } + else if (!strcmp(device_type_env, "gpu") + || !strcmp(device_type_env, "CL_DEVICE_TYPE_GPU")) + { + device_type = CL_DEVICE_TYPE_GPU; + device_type_idx = 2; + } + else if (!strcmp(device_type_env, "accelerator") + || !strcmp(device_type_env, "CL_DEVICE_TYPE_ACCELERATOR")) + { + device_type = CL_DEVICE_TYPE_ACCELERATOR; + device_type_idx = 3; + } + else + { + log_error("CL_DEVICE_TYPE=\"%s\" is invalid\n", + device_type_env); + return -1; + } + } + + // Check to see if a device index was specified + if (device_index_env) device_index = atoi(device_index_env); + + // Look up the device + cl_uint num_devices; + err = clGetDeviceIDs(platform, device_type, 0, NULL, &num_devices); + if (err) + { + log_error("No devices of type %s found.\n", device_type_env); + return -1; + } + + if (device_index >= num_devices) + { + log_error("CL_DEVICE_INDEX=%d is greater than the number of " + "matching devices %d\n", + (unsigned)device_index, num_devices); + return -1; + } + + if (num_devices == 0) + { + log_error("No devices of type %s found.\n", device_type_env); + return -1; + } + + cl_device_id* devices = + (cl_device_id*)malloc(num_devices * sizeof(cl_device_id)); + err = clGetDeviceIDs(platform, device_type, num_devices, devices, NULL); + if (err) + { + log_error("No devices of type %s found.\n", device_type_env); + free(devices); + return -1; + } + + cl_device_id device = devices[device_index]; + free(devices); + + log_info("%s Device %d of %d Info:\n", + device_infos[device_type_idx].device_type_name, + (unsigned)device_index + 1, num_devices); + total_errors += getConfigInfos(device); + log_info("\n"); + } + + // Otherwise iterate over all of the devices in the platform + else + { + // print device info + int onInfo; + for (onInfo = 0; + onInfo < sizeof(device_infos) / sizeof(device_infos[0]); onInfo++) + { + log_info("Getting device IDs for %s devices\n", + device_infos[onInfo].device_type_name); + err = clGetDeviceIDs(platform, device_infos[onInfo].device_type, 0, + NULL, &device_infos[onInfo].num_devices); + if (err == CL_DEVICE_NOT_FOUND) + { + log_info("No devices of type %s found.\n", + device_infos[onInfo].device_type_name); + continue; + } + test_error(err, "clGetDeviceIDs failed"); + + log_info("Found %d %s devices:\n", device_infos[onInfo].num_devices, + device_infos[onInfo].device_type_name); + if (device_infos[onInfo].num_devices) + { + device_infos[onInfo].devices = (cl_device_id*)malloc( + sizeof(cl_device_id) * device_infos[onInfo].num_devices); + err = clGetDeviceIDs(platform, device_infos[onInfo].device_type, + device_infos[onInfo].num_devices, + device_infos[onInfo].devices, NULL); + test_error(err, "clGetDeviceIDs failed"); + } + + int onDevice; + for (onDevice = 0; onDevice < device_infos[onInfo].num_devices; + onDevice++) + { + log_info("%s Device %d of %d Info:\n", + device_infos[onInfo].device_type_name, onDevice + 1, + device_infos[onInfo].num_devices); + total_errors += + getConfigInfos(device_infos[onInfo].devices[onDevice]); + log_info("\n"); + } + + if (device_infos[onInfo].num_devices) + { + free(device_infos[onInfo].devices); + } + } + } + + return total_errors; +} + +extern int test_extended_versioning(cl_device_id, cl_context, cl_command_queue, + int); +extern int test_device_uuid(cl_device_id, cl_context, cl_command_queue, int); + +test_definition test_list[] = { + ADD_TEST(computeinfo), + ADD_TEST(extended_versioning), + ADD_TEST(device_uuid), +}; + +const int test_num = ARRAY_SIZE(test_list); + +int main(int argc, const char** argv) +{ + const char** argList = (const char**)calloc(argc, sizeof(char*)); + if (NULL == argList) + { + log_error("Failed to allocate memory for argList array.\n"); + return 1; + } + + argList[0] = argv[0]; + size_t argCount = 1; + + for (int i = 1; i < argc; i++) + { + if (strcmp(argv[1], "-v") == 0) + { + dump_supported_formats = 1; + } + else + { + argList[argCount] = argv[i]; + argCount++; + } + } + + return runTestHarness(argCount, argList, test_num, test_list, false, true, + 0); +} diff --git a/test_conformance/contractions/CMakeLists.txt b/test_conformance/contractions/CMakeLists.txt index 5c7d86f7..7439f25a 100644 --- a/test_conformance/contractions/CMakeLists.txt +++ b/test_conformance/contractions/CMakeLists.txt @@ -1,16 +1,7 @@ set(MODULE_NAME CONTRACTIONS) set(${MODULE_NAME}_SOURCES - contractions.c - ../../test_common/harness/mt19937.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/mingw_compat.c - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/rounding_mode.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c + contractions.cpp ) include(../CMakeCommon.txt) diff --git a/test_conformance/contractions/contractions.c b/test_conformance/contractions/contractions.cpp similarity index 90% rename from test_conformance/contractions/contractions.c rename to test_conformance/contractions/contractions.cpp index e8e98d4c..dddebb40 100644 --- a/test_conformance/contractions/contractions.c +++ b/test_conformance/contractions/contractions.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -30,13 +30,13 @@ #include #include "errorHelpers.h" -#include "../../test_common/harness/compat.h" -#include "../../test_common/harness/mt19937.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/rounding_mode.h" -#include "../../test_common/harness/fpcontrol.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/parseParameters.h" +#include "harness/compat.h" +#include "harness/mt19937.h" +#include "harness/kernelHelpers.h" +#include "harness/rounding_mode.h" +#include "harness/fpcontrol.h" +#include "harness/testHarness.h" +#include "harness/parseParameters.h" #if defined( __APPLE__ ) #include #endif @@ -99,7 +99,6 @@ static size_t gArgCount; static int ParseArgs( int argc, const char **argv ); -static void PrintArch( void ); static void PrintUsage( void ); test_status InitCL( cl_device_id device ); static void ReleaseCL( void ); @@ -332,7 +331,7 @@ int main( int argc, const char **argv ) if( !error ) { - error = runTestHarnessWithCheck( gArgCount, gArgList, test_num, test_list, false, true, 0, InitCL ); + error = runTestHarnessWithCheck( gArgCount, gArgList, test_num, test_list, true, 0, InitCL ); } if( gQueue ) @@ -442,63 +441,6 @@ static int ParseArgs( int argc, const char **argv ) return 0; } -static void PrintArch( void ) -{ - vlog( "\nHost info:\n" ); - vlog( "\tsizeof( void*) = %ld\n", sizeof( void *) ); -#if defined( __ppc__ ) - vlog( "\tARCH:\tppc\n" ); -#elif defined( __ppc64__ ) - vlog( "\tARCH:\tppc64\n" ); -#elif defined( __PPC__ ) - vlog( "ARCH:\tppc\n" ); -#elif defined( __i386__ ) - vlog( "\tARCH:\ti386\n" ); -#elif defined( __x86_64__ ) - vlog( "\tARCH:\tx86_64\n" ); -#elif defined( __arm__ ) - vlog( "\tARCH:\tarm\n" ); -#elif defined( __aarch64__ ) - vlog( "\tARCH:\taarch64\n" ); -#else - vlog( "\tARCH:\tunknown\n" ); -#endif - -#if defined( __APPLE__ ) - int type = 0; - size_t typeSize = sizeof( type ); - sysctlbyname( "hw.cputype", &type, &typeSize, NULL, 0 ); - vlog( "\tcpu type:\t%d\n", type ); - typeSize = sizeof( type ); - sysctlbyname( "hw.cpusubtype", &type, &typeSize, NULL, 0 ); - vlog( "\tcpu subtype:\t%d\n", type ); - -#elif defined( __linux__ ) && !defined(__aarch64__) - int _sysctl(struct __sysctl_args *args ); -#define OSNAMESZ 100 - - struct __sysctl_args args; - char osname[OSNAMESZ]; - size_t osnamelth; - int name[] = { CTL_KERN, KERN_OSTYPE }; - memset(&args, 0, sizeof(struct __sysctl_args)); - args.name = name; - args.nlen = sizeof(name)/sizeof(name[0]); - args.oldval = osname; - args.oldlenp = &osnamelth; - - osnamelth = sizeof(osname); - - if (syscall(SYS__sysctl, &args) == -1) { - vlog( "_sysctl error\n" ); - } - else { - vlog("this machine is running %*s\n", osnamelth, osname); - } - -#endif -} - static void PrintUsage( void ) { vlog( "%s [-z]: \n", appName ); @@ -531,30 +473,7 @@ test_status InitCL( cl_device_id device ) gForceFTZ ^= 1; // check for cl_khr_fp64 - size_t extensions_size = 0; - if( (error = clGetDeviceInfo( device, CL_DEVICE_EXTENSIONS, 0, NULL, &extensions_size ))) - { - vlog_error( "clGetDeviceInfo(CL_DEVICE_EXTENSIONS) failed. %d\n", error ); - return TEST_FAIL; - } - if( extensions_size ) - { - char *extensions = (char*)malloc(extensions_size); - if( NULL == extensions ) - { - vlog_error( "ERROR: Unable to allocate %ld bytes to hold extensions string\n", extensions_size ); - return TEST_FAIL; - } - - if( (error = clGetDeviceInfo( device, CL_DEVICE_EXTENSIONS, extensions_size, extensions, NULL ))) - { - vlog_error( "clGetDeviceInfo(CL_DEVICE_EXTENSIONS) failed 2. %d\n", error ); - return TEST_FAIL; - } - - gHasDouble = NULL != strstr( extensions, "cl_khr_fp64" ); - free( extensions ); - } + gHasDouble = is_extension_available(device, "cl_khr_fp64" ); if(0 == (CL_FP_INF_NAN & floatCapabilities) ) gSkipNanInf = 1; @@ -570,7 +489,7 @@ test_status InitCL( cl_device_id device ) return TEST_FAIL; } - gQueue = clCreateCommandQueueWithProperties( gContext, device, 0, &error ); + gQueue = clCreateCommandQueue( gContext, device, 0, &error ); if( NULL == gQueue || error ) { vlog_error( "clCreateContext failed. %d\n", error ); @@ -657,56 +576,39 @@ test_status InitCL( cl_device_id device ) "}\n" "\n" }; - for( i = 0; i < sizeof( sizeNames ) / sizeof( sizeNames[0] ); i++ ) + for (i = 0; i < sizeof(sizeNames) / sizeof(sizeNames[0]); i++) { - size_t strCount = sizeof( kernels ) / sizeof( kernels[0] ); + size_t strCount = sizeof(kernels) / sizeof(kernels[0]); kernels[0] = ""; - for( j = 2; j < strCount; j += 2 ) - kernels[j] = sizeNames[i]; - - gProgram[i] = clCreateProgramWithSource(gContext, strCount, kernels, NULL, &error); - if( NULL == gProgram[i] ) + for (j = 2; j < strCount; j += 2) kernels[j] = sizeNames[i]; + error = create_single_kernel_helper(gContext, &gProgram[i], nullptr, + strCount, kernels, nullptr); + if (CL_SUCCESS != error || nullptr == gProgram[i]) { - vlog_error( "clCreateProgramWithSource failed\n" ); - return TEST_FAIL; - } - - if(( error = clBuildProgram(gProgram[i], 1, &device, NULL, NULL, NULL) )) - { - vlog_error( "clBuildProgramExecutable failed\n" ); - char build_log[2048] = ""; - - clGetProgramBuildInfo(gProgram[i], device, CL_PROGRAM_BUILD_LOG, sizeof(build_log), build_log, NULL); - vlog_error( "Log:\n%s\n", build_log ); + log_error("Error: Unable to create test program! (%s) (in %s:%d)\n", + IGetErrorString(error), __FILE__, __LINE__); return TEST_FAIL; } } - if( gHasDouble ) + if (gHasDouble) { kernels[0] = "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n"; - for( i = 0; i < sizeof( sizeNames_double ) / sizeof( sizeNames_double[0] ); i++ ) + for (i = 0; i < sizeof(sizeNames_double) / sizeof(sizeNames_double[0]); + i++) { - size_t strCount = sizeof( kernels ) / sizeof( kernels[0] ); + size_t strCount = sizeof(kernels) / sizeof(kernels[0]); - for( j = 2; j < strCount; j += 2 ) - kernels[j] = sizeNames_double[i]; - - gProgram_double[i] = clCreateProgramWithSource(gContext, strCount, kernels, NULL, &error); - if( NULL == gProgram_double[i] ) + for (j = 2; j < strCount; j += 2) kernels[j] = sizeNames_double[i]; + error = create_single_kernel_helper(gContext, &gProgram_double[i], + nullptr, strCount, kernels, + nullptr); + if (CL_SUCCESS != error || nullptr == gProgram_double[i]) { - vlog_error( "clCreateProgramWithSource failed\n" ); - return TEST_FAIL; - } - - if(( error = clBuildProgram(gProgram_double[i], 1, &device, NULL, NULL, NULL) )) - { - vlog_error( "clBuildProgramExecutable failed\n" ); - char build_log[2048] = ""; - - clGetProgramBuildInfo(gProgram_double[i], device, CL_PROGRAM_BUILD_LOG, sizeof(build_log), build_log, NULL); - vlog_error( "Log:\n%s\n", build_log ); + log_error( + "Error: Unable to create test program! (%s) (in %s:%d)\n", + IGetErrorString(error), __FILE__, __LINE__); return TEST_FAIL; } } diff --git a/test_conformance/conversions/CMakeLists.txt b/test_conformance/conversions/CMakeLists.txt index 0e90a1a9..8886ba0f 100644 --- a/test_conformance/conversions/CMakeLists.txt +++ b/test_conformance/conversions/CMakeLists.txt @@ -1,37 +1,12 @@ set(MODULE_NAME CONVERSIONS) -# VS2005 AMD64 WAR (basic_test_conversions.c causes internal compiler error) -if(MSVC) -set(CMAKE_C_FLAGS_RELEASE "/Od /Ob0") -set(CMAKE_CXX_FLAGS_RELEASE "/Od /Ob0") -else(MSVC) -set(CMAKE_C_FLAGS_RELEASE "-O0") -set(CMAKE_CXX_FLAGS_RELEASE "-O0") -endif(MSVC) - set (${MODULE_NAME}_SOURCES - Sleep.c test_conversions.c basic_test_conversions.c - ../../test_common/harness/ThreadPool.c - ../../test_common/harness/rounding_mode.c - ../../test_common/harness/mt19937.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/mingw_compat.c - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/crc32.c + Sleep.cpp test_conversions.cpp basic_test_conversions.cpp ) -if(ANDROID) - list(APPEND CONVERSIONS_SOURCES fplib.c) -endif(ANDROID) - -if(WIN32) -set_source_files_properties( - ${MODULE_NAME}_SOURCES - PROPERTIES LANGUAGE CXX) -endif(WIN32) +if("${CLConform_TARGET_ARCH}" STREQUAL "ARM") + list(APPEND ${MODULE_NAME}_SOURCES fplib.cpp) +endif() if(NOT CMAKE_CL_64 AND NOT MSVC AND NOT ANDROID) # -march is needed for CPU atomics, default arch on gcc is i386 @@ -41,10 +16,4 @@ set_source_files_properties( COMPILE_FLAGS -march=i686) endif(NOT CMAKE_CL_64 AND NOT MSVC AND NOT ANDROID) -if(NOT ANDROID) -set_source_files_properties( - Sleep.c test_conversions.c basic_test_conversions.c - COMPILE_FLAGS -msse2) -endif(NOT ANDROID) - include(../CMakeCommon.txt) diff --git a/test_conformance/conversions/Sleep.c b/test_conformance/conversions/Sleep.cpp similarity index 97% rename from test_conformance/conversions/Sleep.c rename to test_conformance/conversions/Sleep.cpp index 8ed6ef34..ff61f928 100644 --- a/test_conformance/conversions/Sleep.c +++ b/test_conformance/conversions/Sleep.cpp @@ -104,17 +104,9 @@ } #else /* not __APPLE__ */ -#if defined(__cplusplus) -extern "C" { -#endif - void PreventSleep( void ) {} void ResumeSleep( void ) {} -#if defined(__cplusplus) -} -#endif //__cplusplus - #endif diff --git a/test_conformance/conversions/Sleep.h b/test_conformance/conversions/Sleep.h index 195e886f..f983a32f 100644 --- a/test_conformance/conversions/Sleep.h +++ b/test_conformance/conversions/Sleep.h @@ -16,17 +16,9 @@ #ifndef SLEEP_H #define SLEEP_H -#if defined(__cplusplus) -extern "C" { -#endif - void PreventSleep( void ); void ResumeSleep( void ); -#if defined(__cplusplus) -} -#endif //__cplusplus - #endif /* SLEEP_H */ diff --git a/test_conformance/conversions/basic_test_conversions.c b/test_conformance/conversions/basic_test_conversions.cpp similarity index 99% rename from test_conformance/conversions/basic_test_conversions.c rename to test_conformance/conversions/basic_test_conversions.cpp index bfd31b27..d32694a1 100644 --- a/test_conformance/conversions/basic_test_conversions.c +++ b/test_conformance/conversions/basic_test_conversions.cpp @@ -13,13 +13,13 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include "basic_test_conversions.h" #include #include -#include "../../test_common/harness/mt19937.h" +#include "harness/mt19937.h" #if defined( __arm__ ) && defined( __GNUC__ ) #include "fplib.h" diff --git a/test_conformance/conversions/basic_test_conversions.h b/test_conformance/conversions/basic_test_conversions.h index ab8c68cd..3e672da9 100644 --- a/test_conformance/conversions/basic_test_conversions.h +++ b/test_conformance/conversions/basic_test_conversions.h @@ -16,14 +16,14 @@ #ifndef BASIC_TEST_CONVERSIONS_H #define BASIC_TEST_CONVERSIONS_H -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #if !defined(_WIN32) #include #endif -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/rounding_mode.h" +#include "harness/errorHelpers.h" +#include "harness/rounding_mode.h" #include #if defined( __APPLE__ ) @@ -32,7 +32,7 @@ #include #endif -#include "../../test_common/harness/mt19937.h" +#include "harness/mt19937.h" typedef void (*Convert)( void *dest, void *src, size_t ); diff --git a/test_conformance/conversions/fplib.c b/test_conformance/conversions/fplib.cpp similarity index 96% rename from test_conformance/conversions/fplib.c rename to test_conformance/conversions/fplib.cpp index a18b919c..37707b83 100644 --- a/test_conformance/conversions/fplib.c +++ b/test_conformance/conversions/fplib.cpp @@ -17,7 +17,9 @@ #include #include "fplib.h" +#if !defined(FLT_MANT_DIG) #define FLT_MANT_DIG 24 +#endif #define as_float(x) (*((float *)(&x))) #define as_long(x) (*((int64_t *)(&x))) @@ -145,6 +147,9 @@ float qcom_s64_2_f32(int64_t data, bool sat, roundingMode rnd) return as_float(result); } } + case qcomRoundingModeCount: { + break; // Avoid build error for unhandled enum value + } } return 0.0f; } @@ -216,6 +221,9 @@ float qcom_u64_2_f32(uint64_t data, bool sat, roundingMode rnd) uint32_t result = exponent | mantissa; return as_float(result); // for positive inputs return RTZ result } + case qcomRoundingModeCount: { + break; // Avoid build error for unhandled enum value + } } return 0.0f; } diff --git a/test_conformance/conversions/fplib.h b/test_conformance/conversions/fplib.h index 576e4afe..534550a3 100644 --- a/test_conformance/conversions/fplib.h +++ b/test_conformance/conversions/fplib.h @@ -14,6 +14,7 @@ // limitations under the License. // #include +#include typedef enum { diff --git a/test_conformance/conversions/test_conversions.c b/test_conformance/conversions/test_conversions.cpp similarity index 93% rename from test_conformance/conversions/test_conversions.c rename to test_conformance/conversions/test_conversions.cpp index 84a1b488..2af85558 100644 --- a/test_conformance/conversions/test_conversions.c +++ b/test_conformance/conversions/test_conversions.cpp @@ -13,13 +13,13 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" -#include "../../test_common/harness/rounding_mode.h" -#include "../../test_common/harness/ThreadPool.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/parseParameters.h" -#if !defined(_WIN32) && !defined(__ANDROID__) +#include "harness/compat.h" +#include "harness/rounding_mode.h" +#include "harness/ThreadPool.h" +#include "harness/testHarness.h" +#include "harness/kernelHelpers.h" +#include "harness/parseParameters.h" +#if defined(__APPLE__) #include #endif @@ -50,11 +50,9 @@ #include "Sleep.h" #include "basic_test_conversions.h" -#pragma STDC FENV_ACCESS ON - #if (defined(_WIN32) && defined (_MSC_VER)) // need for _controlfp_s and rouinding modes in RoundingMode -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" #endif #pragma mark - @@ -78,8 +76,6 @@ int argCount = 0; cl_context gContext = NULL; cl_command_queue gQueue = NULL; char appName[64] = "ctest"; -int gTestCount = 0; -int gFailCount = 0; int gStartTestNumber = -1; int gEndTestNumber = 0; #if defined( __APPLE__ ) @@ -116,7 +112,6 @@ static MTdata gMTdata; static int ParseArgs( int argc, const char **argv ); static void PrintUsage( void ); -static void PrintArch(void); test_status InitCL( cl_device_id device ); static int GetTestCase( const char *name, Type *outType, Type *inType, SaturationMode *sat, RoundingMode *round ); static int DoTest( cl_device_id device, Type outType, Type inType, SaturationMode sat, RoundingMode round, MTdata d ); @@ -319,18 +314,13 @@ int main (int argc, const char **argv ) gMTdata = init_genrand( seed ); const char* arg[] = {argv[0]}; - int ret = runTestHarnessWithCheck( 1, arg, test_num, test_list, false, true, 0, InitCL ); + int ret = runTestHarnessWithCheck( 1, arg, test_num, test_list, true, 0, InitCL ); free_mtdata( gMTdata ); - - error = clFinish(gQueue); - if (error) - vlog_error("clFinish failed: %d\n", error); - - if (gFailCount == 0 && gTestCount >= 0) { - vlog("PASSED %d of %d sub-tests.\n", gTestCount, gTestCount); - } else if (gFailCount > 0) { - vlog_error("FAILED %d of %d sub-tests.\n", gFailCount, gTestCount); + if (gQueue) + { + error = clFinish(gQueue); + if (error) vlog_error("clFinish failed: %d\n", error); } clReleaseMemObject(gInBuffer); @@ -535,69 +525,6 @@ static void PrintUsage( void ) vlog( "You may also pass the number of the test on which to start.\nA second number can be then passed to indicate how many tests to run\n\n" ); } -static void PrintArch( void ) -{ - vlog( "sizeof( void*) = %ld\n", sizeof( void *) ); -#if defined( __ppc__ ) - vlog( "ARCH:\tppc\n" ); -#elif defined( __ppc64__ ) - vlog( "ARCH:\tppc64\n" ); -#elif defined( __PPC__ ) - vlog( "ARCH:\tppc\n" ); -#elif defined( __i386__ ) - vlog( "ARCH:\ti386\n" ); -#elif defined( __x86_64__ ) - vlog( "ARCH:\tx86_64\n" ); -#elif defined( __arm__ ) - vlog( "ARCH:\tarm\n" ); -// Add 64 bit support -#elif defined(__aarch64__) - vlog( "ARCH:\taarch64\n" ); -#elif defined (_WIN32) - vlog( "ARCH:\tWindows\n" ); -#else -#error unknown arch -#endif - -#if defined( __APPLE__ ) - - int type = 0; - size_t typeSize = sizeof( type ); - sysctlbyname( "hw.cputype", &type, &typeSize, NULL, 0 ); - vlog( "cpu type:\t%d\n", type ); - typeSize = sizeof( type ); - sysctlbyname( "hw.cpusubtype", &type, &typeSize, NULL, 0 ); - vlog( "cpu subtype:\t%d\n", type ); - -#elif defined( __linux__ ) && !defined(__aarch64__) -#define OSNAMESZ 100 - int _sysctl(struct __sysctl_args *args ); - - struct __sysctl_args args; - char osname[OSNAMESZ]; - size_t osnamelth; - int name[] = { CTL_KERN, KERN_OSTYPE }; - memset(&args, 0, sizeof(struct __sysctl_args)); - args.name = name; - args.nlen = sizeof(name)/sizeof(name[0]); - args.oldval = osname; - args.oldlenp = &osnamelth; - - osnamelth = sizeof(osname); - - if (syscall(SYS__sysctl, &args) == -1) { - vlog( "_sysctl error\n" ); - } - else { - vlog("this machine is running %*s\n", osnamelth, osname); - } - -#endif -} - - - - static int GetTestCase( const char *name, Type *outType, Type *inType, SaturationMode *sat, RoundingMode *round ) { @@ -703,18 +630,22 @@ test_status InitCL( cl_device_id device ) gIsRTZ = 1; } - char extensions[2048] = ""; - if( (error = clGetDeviceInfo( device, CL_DEVICE_EXTENSIONS, sizeof( extensions ), extensions, NULL ) ) ) - { - vlog_error( "FAILURE: unable to get device info for CL_DEVICE_EXTENSIONS!" ); - return TEST_FAIL; - } - else if( strstr( extensions, "cl_khr_fp64" ) ) + else if(is_extension_available(device, "cl_khr_fp64")) { gHasDouble = 1; } gTestDouble &= gHasDouble; + //detect whether profile of the device is embedded + char profile[1024] = ""; + if( (error = clGetDeviceInfo( device, CL_DEVICE_PROFILE, sizeof(profile), profile, NULL ) ) ){} + else if( strstr(profile, "EMBEDDED_PROFILE" ) ) + { + gIsEmbedded = 1; + if( !is_extension_available(device, "cles_khr_int64" ) ) + gHasLong = 0; + } + gContext = clCreateContext( NULL, 1, &device, notify_callback, NULL, &error ); if( NULL == gContext || error ) @@ -723,7 +654,7 @@ test_status InitCL( cl_device_id device ) return TEST_FAIL; } - gQueue = clCreateCommandQueueWithProperties(gContext, device, 0, &error); + gQueue = clCreateCommandQueue(gContext, device, 0, &error); if( NULL == gQueue || error ) { vlog_error( "clCreateCommandQueue failed. (%d)\n", error ); @@ -761,40 +692,6 @@ test_status InitCL( cl_device_id device ) } } -#if defined( __APPLE__ ) - -#if defined( __i386__ ) || defined( __x86_64__ ) -#define kHasSSE3 0x00000008 -#define kHasSupplementalSSE3 0x00000100 -#define kHasSSE4_1 0x00000400 -#define kHasSSE4_2 0x00000800 - /* check our environment for a hint to disable SSE variants */ - { - const char *env = getenv( "CL_MAX_SSE" ); - if( env ) - { - extern int _cpu_capabilities; - int mask = 0; - if( 0 == strcasecmp( env, "SSE4.1" ) ) - mask = kHasSSE4_2; - else if( 0 == strcasecmp( env, "SSSE3" ) ) - mask = kHasSSE4_2 | kHasSSE4_1; - else if( 0 == strcasecmp( env, "SSE3" ) ) - mask = kHasSSE4_2 | kHasSSE4_1 | kHasSupplementalSSE3; - else if( 0 == strcasecmp( env, "SSE2" ) ) - mask = kHasSSE4_2 | kHasSSE4_1 | kHasSupplementalSSE3 | kHasSSE3; - else - { - vlog_error( "Error: Unknown CL_MAX_SSE setting: %s\n", env ); - return TEST_FAIL; - } - - vlog( "*** Environment: CL_MAX_SSE = %s ***\n", env ); - _cpu_capabilities &= ~mask; - } - } -#endif -#endif gMTdata = init_genrand( gRandomSeed ); diff --git a/test_conformance/d3d10/CMakeLists.txt b/test_conformance/d3d10/CMakeLists.txt index 2b1a0761..385ea86f 100644 --- a/test_conformance/d3d10/CMakeLists.txt +++ b/test_conformance/d3d10/CMakeLists.txt @@ -17,33 +17,21 @@ link_directories(${CL_LIB_DIR}, ${D3D10_LIB_DIR}) list(APPEND CLConform_LIBRARIES d3d10 dxgi) +set(MODULE_NAME D3D10) -set(D3D10_SOURCES +set(${MODULE_NAME}_SOURCES buffer.cpp texture2d.cpp texture3d.cpp misc.cpp main.cpp harness.cpp - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/threadTesting.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/mt19937.c - ../../test_common/harness/conversions.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c ) -add_executable(conformance_test_d3d10 - ${D3D10_SOURCES}) - set_source_files_properties( - ${D3D10_SOURCES} + ${MODULE_NAME}_SOURCES PROPERTIES LANGUAGE CXX) -TARGET_LINK_LIBRARIES(conformance_test_d3d10 - ${CLConform_LIBRARIES}) - +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +include(../CMakeCommon.txt) endif(WIN32) diff --git a/test_conformance/d3d10/harness.cpp b/test_conformance/d3d10/harness.cpp index 016d9e72..ffdfea5a 100644 --- a/test_conformance/d3d10/harness.cpp +++ b/test_conformance/d3d10/harness.cpp @@ -39,15 +39,18 @@ HarnessD3D10_ExtensionCheck() bool extensionPresent = false; cl_int result = CL_SUCCESS; cl_platform_id platform = NULL; - char extensions[1024]; + size_t set_size; HarnessD3D10_TestBegin("Extension query"); result = clGetPlatformIDs(1, &platform, NULL); - NonTestRequire(result == CL_SUCCESS, "Failed to get any platforms."); - result = clGetPlatformInfo(platform, CL_PLATFORM_EXTENSIONS, sizeof(extensions), extensions, NULL); - NonTestRequire(result == CL_SUCCESS, "Failed to list extensions."); - extensionPresent = strstr(extensions, "cl_khr_d3d10_sharing") ? true : false; + NonTestRequire(result == CL_SUCCESS, "Failed to get any platforms."); + result = clGetPlatformInfo(platform, CL_PLATFORM_EXTENSIONS, 0, NULL, &set_size); + NonTestRequire(result == CL_SUCCESS, "Failed to get size of extensions string."); + std::vector extensions(set_size); + result = clGetPlatformInfo(platform, CL_PLATFORM_EXTENSIONS, extensions.size(), extensions.data(), NULL); + NonTestRequire(result == CL_SUCCESS, "Failed to list extensions."); + extensionPresent = strstr(extensions.data(), "cl_khr_d3d10_sharing") ? true : false; if (!extensionPresent) { // platform is required to report the extension only if all devices support it @@ -59,11 +62,10 @@ HarnessD3D10_ExtensionCheck() NonTestRequire(result == CL_SUCCESS, "Failed to get devices count."); for (cl_uint i = 0; i < devicesCount; i++) { - clGetDeviceInfo(devices[i], CL_DEVICE_EXTENSIONS, sizeof(extensions), extensions, NULL); - NonTestRequire(result == CL_SUCCESS, "Failed to list extensions."); - extensionPresent = strstr(extensions, "cl_khr_d3d10_sharing") ? true : false; - if (extensionPresent) + if (is_extension_available(devices[i], "cl_khr_d3d10_sharing")) { + extensionPresent = true; break; + } } } diff --git a/test_conformance/d3d10/harness.h b/test_conformance/d3d10/harness.h index a17839b2..184e52cb 100644 --- a/test_conformance/d3d10/harness.h +++ b/test_conformance/d3d10/harness.h @@ -40,7 +40,7 @@ typedef unsigned char UINT8; #include #include #include "errorHelpers.h" -#include "../test_common/harness/kernelHelpers.h" +#include "kernelHelpers.h" // #define log_info(...) printf(__VA_ARGS__) // #define log_error(...) printf(__VA_ARGS__) diff --git a/test_conformance/d3d10/main.cpp b/test_conformance/d3d10/main.cpp index 7c862e81..9c574cca 100644 --- a/test_conformance/d3d10/main.cpp +++ b/test_conformance/d3d10/main.cpp @@ -17,8 +17,8 @@ #define _CRT_SECURE_NO_WARNINGS #include "harness.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/parseParameters.h" +#include "harness/testHarness.h" +#include "harness/parseParameters.h" int main(int argc, const char* argv[]) { @@ -209,7 +209,6 @@ void TestAdapterDevices(cl_platform_id platform, IDXGIAdapter* pAdapter, ID3D10D cl_int result; cl_uint num_devices = 0; cl_device_id* devices = NULL; - char extensions[8192]; devices = new cl_device_id[num_devices_expected]; NonTestRequire( @@ -234,8 +233,7 @@ void TestAdapterDevices(cl_platform_id platform, IDXGIAdapter* pAdapter, ID3D10D for (cl_uint i = 0; i < num_devices; ++i) { // make sure the device supports the extension - result = clGetDeviceInfo(devices[i], CL_DEVICE_EXTENSIONS, sizeof(extensions), extensions, NULL); NonTestRequire(result == CL_SUCCESS, "Failed to get extensions."); - if (strstr(extensions, "cl_khr_d3d10_sharing") == NULL) { + if (!is_extension_available(devices[i], "cl_khr_d3d10_sharing")) { TestPrint("Device does not support cl_khr_d3d10_sharing extension\n"); continue; } diff --git a/test_conformance/d3d11/CMakeLists.txt b/test_conformance/d3d11/CMakeLists.txt index e6673dd4..14a378d7 100644 --- a/test_conformance/d3d11/CMakeLists.txt +++ b/test_conformance/d3d11/CMakeLists.txt @@ -17,33 +17,21 @@ link_directories(${CL_LIB_DIR}, ${D3D11_LIB_DIR}) list(APPEND CLConform_LIBRARIES d3d11 dxgi) +set(MODULE_NAME D3D11) -set(D3D11_SOURCES +set(${MODULE_NAME}_SOURCES buffer.cpp texture2d.cpp texture3d.cpp misc.cpp main.cpp harness.cpp - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/threadTesting.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/mt19937.c - ../../test_common/harness/conversions.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c ) -add_executable(conformance_test_d3d11 - ${D3D11_SOURCES}) - set_source_files_properties( - ${D3D11_SOURCES} + ${MODULE_NAME}_SOURCES PROPERTIES LANGUAGE CXX) -TARGET_LINK_LIBRARIES(conformance_test_d3d11 - ${CLConform_LIBRARIES}) - +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +include(../CMakeCommon.txt) endif(WIN32) diff --git a/test_conformance/d3d11/harness.cpp b/test_conformance/d3d11/harness.cpp index 7d33b7f0..687c6da2 100644 --- a/test_conformance/d3d11/harness.cpp +++ b/test_conformance/d3d11/harness.cpp @@ -74,15 +74,7 @@ HarnessD3D11_ExtensionCheck() cl_uint num_devices_d3d11 = 0; // Number of devices supporting cl_khr_d3d11_sharing. for ( cl_uint i = 0; i < devices.size(); ++ i ) { - std::vector< char > buffer; - size_t size = 0; - result = clGetDeviceInfo( devices[ i ], CL_DEVICE_EXTENSIONS, 0, NULL, & size ); - NonTestRequire( result == CL_SUCCESS, "Failed to get size of extension string." ); - buffer.resize( size ); - result = clGetDeviceInfo( devices[ i ], CL_DEVICE_EXTENSIONS, buffer.size(), & buffer.front(), & size ); - NonTestRequire( result == CL_SUCCESS, "Failed to get extension string." ); - std::string extensions = std::string( " " ) + & buffer.front() + " "; - if ( extensions.find( " cl_khr_d3d11_sharing " ) != std::string::npos ) + if (is_extension_available(devices[i], "cl_khr_d3d11_sharing")) { ++ num_devices_d3d11; } diff --git a/test_conformance/d3d11/harness.h b/test_conformance/d3d11/harness.h index c1b66100..451ec23d 100644 --- a/test_conformance/d3d11/harness.h +++ b/test_conformance/d3d11/harness.h @@ -41,7 +41,7 @@ typedef unsigned char UINT8; #include #include #include "errorHelpers.h" -#include "../test_common/harness/kernelHelpers.h" +#include "kernelHelpers.h" // #define log_info(...) printf(__VA_ARGS__) // #define log_error(...) printf(__VA_ARGS__) diff --git a/test_conformance/d3d11/main.cpp b/test_conformance/d3d11/main.cpp index f477d7bb..24854f0d 100644 --- a/test_conformance/d3d11/main.cpp +++ b/test_conformance/d3d11/main.cpp @@ -19,8 +19,8 @@ #include #include #include "harness.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/parseParameters.h" +#include "harness/testHarness.h" +#include "harness/parseParameters.h" int main(int argc, const char* argv[]) { diff --git a/test_conformance/device_execution/CMakeLists.txt b/test_conformance/device_execution/CMakeLists.txt index 9ba35ca6..5e9e30e3 100644 --- a/test_conformance/device_execution/CMakeLists.txt +++ b/test_conformance/device_execution/CMakeLists.txt @@ -8,19 +8,13 @@ set(DEVICE_EXECUTION_SOURCES enqueue_multi_queue.cpp enqueue_ndrange.cpp enqueue_wg_size.cpp + enqueue_profiling.cpp execute_block.cpp host_multi_queue.cpp host_queue_order.cpp - main.c + main.cpp nested_blocks.cpp utils.cpp - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/mt19937.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c ) include(../CMakeCommon.txt) diff --git a/test_conformance/device_execution/device_info.cpp b/test_conformance/device_execution/device_info.cpp index fa37fe6b..b248c19c 100644 --- a/test_conformance/device_execution/device_info.cpp +++ b/test_conformance/device_execution/device_info.cpp @@ -15,8 +15,8 @@ // #include #include -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/testHarness.h" +#include "harness/typeWrappers.h" #include "procs.h" #include "utils.h" diff --git a/test_conformance/device_execution/device_queue.cpp b/test_conformance/device_execution/device_queue.cpp index 2a0e3961..e8a4b686 100644 --- a/test_conformance/device_execution/device_queue.cpp +++ b/test_conformance/device_execution/device_queue.cpp @@ -15,8 +15,8 @@ // #include #include -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/testHarness.h" +#include "harness/typeWrappers.h" #include diff --git a/test_conformance/device_execution/enqueue_block.cpp b/test_conformance/device_execution/enqueue_block.cpp index b3966e57..29a6cec1 100644 --- a/test_conformance/device_execution/enqueue_block.cpp +++ b/test_conformance/device_execution/enqueue_block.cpp @@ -15,8 +15,8 @@ // #include #include -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/testHarness.h" +#include "harness/typeWrappers.h" #include diff --git a/test_conformance/device_execution/enqueue_flags.cpp b/test_conformance/device_execution/enqueue_flags.cpp index cad996c6..53e8111c 100644 --- a/test_conformance/device_execution/enqueue_flags.cpp +++ b/test_conformance/device_execution/enqueue_flags.cpp @@ -15,8 +15,8 @@ // #include #include -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/testHarness.h" +#include "harness/typeWrappers.h" #include @@ -39,8 +39,6 @@ static const char* enqueue_flags_wait_kernel_simple[] = NL, " size_t lid = get_local_id(0);" NL, " size_t tid = get_global_id(0);" NL, "" - NL, " array[index * gs + tid] = array[(index - 1) * gs + tid] + 1;" - NL, "" NL, " if(tid == 0)" NL, " {" NL, " if((index + 1) < BITS_DEPTH)" @@ -52,6 +50,8 @@ static const char* enqueue_flags_wait_kernel_simple[] = NL, " }" NL, " }" NL, "" + NL, " array[index * gs + tid] = array[(index - 1) * gs + tid] + 1;" + NL, "" NL, " if((index + 1) == BITS_DEPTH)" NL, " {" NL, " barrier(CLK_GLOBAL_MEM_FENCE);" @@ -106,8 +106,6 @@ static const char* enqueue_flags_wait_kernel_event[] = NL, " size_t lid = get_local_id(0);" NL, " size_t tid = get_global_id(0);" NL, "" - NL, " array[index * gs + tid] = array[(index - 1) * gs + tid] + 1;" - NL, "" NL, " if(tid == 0)" NL, " {" NL, " if((index + 1) < BITS_DEPTH)" @@ -124,6 +122,8 @@ static const char* enqueue_flags_wait_kernel_event[] = NL, " }" NL, " }" NL, "" + NL, " array[index * gs + tid] = array[(index - 1) * gs + tid] + 1;" + NL, "" NL, " if((index + 1) == BITS_DEPTH)" NL, " {" NL, " barrier(CLK_GLOBAL_MEM_FENCE);" @@ -193,7 +193,6 @@ static const char* enqueue_flags_wait_kernel_local[] = NL, " val += sub_array[i];" NL, " val -= (tid == id)? 0: (id + index - 1);" NL, " }" - NL, " array[index * gs + tid] = val + 1;" NL, "" NL, " if(tid == 0)" NL, " {" @@ -206,6 +205,8 @@ static const char* enqueue_flags_wait_kernel_local[] = NL, " }" NL, " }" NL, "" + NL, " array[index * gs + tid] = val + 1;" + NL, "" NL, " if((index + 1) == BITS_DEPTH)" NL, " {" NL, " barrier(CLK_GLOBAL_MEM_FENCE);" @@ -269,7 +270,6 @@ static const char* enqueue_flags_wait_kernel_event_local[] = NL, " val += sub_array[i];" NL, " val -= (tid == id)? 0: (id + index - 1);" NL, " }" - NL, " array[index * gs + tid] = val + 1;" NL, "" NL, " if(tid == 0)" NL, " {" @@ -287,6 +287,8 @@ static const char* enqueue_flags_wait_kernel_event_local[] = NL, " }" NL, " }" NL, "" + NL, " array[index * gs + tid] = val + 1;" + NL, "" NL, " if((index + 1) == BITS_DEPTH)" NL, " {" NL, " barrier(CLK_GLOBAL_MEM_FENCE);" @@ -348,8 +350,6 @@ static const char* enqueue_flags_wait_work_group_simple[] = NL, " " NL, " if(gid == group_id)" NL, " {" - NL, " array[index * gs + tid] = array[(index - 1) * gs + tid] + 1;" - NL, " " NL, " if((index + 1) < BITS_DEPTH && lid == 0)" NL, " {" NL, " enqueue_kernel(get_default_queue(), CLK_ENQUEUE_FLAGS_WAIT_WORK_GROUP, ndrange_1D(gs, ls), " @@ -357,13 +357,15 @@ static const char* enqueue_flags_wait_work_group_simple[] = NL, " block_fn(array, index + 1, ls, res, gid);" NL, " });" NL, " }" + NL, " " + NL, " array[index * gs + tid] = array[(index - 1) * gs + tid] + 1;" NL, " }" NL, "" NL, " if((index + 1) == BITS_DEPTH)" NL, " {" NL, " barrier(CLK_GLOBAL_MEM_FENCE);" NL, "" - NL, " if(lid == 0)" + NL, " if(lid == 0 && gid == group_id)" NL, " {" NL, " res[gid] = 1;" NL, "" @@ -417,8 +419,6 @@ static const char* enqueue_flags_wait_work_group_event[] = NL, " " NL, " if(gid == group_id)" NL, " {" - NL, " array[index * gs + tid] = array[(index - 1) * gs + tid] + 1;" - NL, " " NL, " if((index + 1) < BITS_DEPTH && lid == 0)" NL, " {" NL, " clk_event_t block_evt;" @@ -431,6 +431,8 @@ static const char* enqueue_flags_wait_work_group_event[] = NL, " release_event(user_evt);" NL, " release_event(block_evt);" NL, " }" + NL, " " + NL, " array[index * gs + tid] = array[(index - 1) * gs + tid] + 1;" NL, " }" NL, "" NL, "" @@ -438,7 +440,7 @@ static const char* enqueue_flags_wait_work_group_event[] = NL, " {" NL, " barrier(CLK_GLOBAL_MEM_FENCE);" NL, "" - NL, " if(lid == 0)" + NL, " if(lid == 0 && gid == group_id)" NL, " {" NL, " res[gid] = 1;" NL, "" @@ -508,8 +510,6 @@ static const char* enqueue_flags_wait_work_group_local[] = NL, " " NL, " if(gid == group_id)" NL, " {" - NL, " array[index * gs + tid] = val + 1;" - NL, " " NL, " if((index + 1) < BITS_DEPTH && lid == 0)" NL, " {" NL, " enqueue_kernel(get_default_queue(), CLK_ENQUEUE_FLAGS_WAIT_WORK_GROUP, ndrange_1D(gs, ls), " @@ -517,6 +517,8 @@ static const char* enqueue_flags_wait_work_group_local[] = NL, " block_fn(array, index + 1, ls, res, sub_array, gid);" NL, " }, ls * sizeof(int));" NL, " }" + NL, " " + NL, " array[index * gs + tid] = val + 1;" NL, " }" NL, "" NL, "" @@ -524,7 +526,7 @@ static const char* enqueue_flags_wait_work_group_local[] = NL, " {" NL, " barrier(CLK_GLOBAL_MEM_FENCE);" NL, "" - NL, " if(lid == 0)" + NL, " if(lid == 0 && gid == group_id)" NL, " {" NL, " res[gid] = 1;" NL, "" @@ -589,8 +591,6 @@ static const char* enqueue_flags_wait_work_group_event_local[] = NL, "" NL, " if(gid == group_id)" NL, " {" - NL, " array[index * gs + tid] = val + 1;" - NL, " " NL, " if((index + 1) < BITS_DEPTH && lid == 0)" NL, " {" NL, " clk_event_t block_evt;" @@ -603,13 +603,15 @@ static const char* enqueue_flags_wait_work_group_event_local[] = NL, " release_event(user_evt);" NL, " release_event(block_evt);" NL, " }" + NL, " " + NL, " array[index * gs + tid] = val + 1;" NL, " }" NL, "" NL, " if((index + 1) == BITS_DEPTH)" NL, " {" NL, " barrier(CLK_GLOBAL_MEM_FENCE);" NL, "" - NL, " if(lid == 0)" + NL, " if(lid == 0 && gid == group_id)" NL, " {" NL, " res[gid] = 1;" NL, "" diff --git a/test_conformance/device_execution/enqueue_multi_queue.cpp b/test_conformance/device_execution/enqueue_multi_queue.cpp index 76d69168..5dacb73b 100644 --- a/test_conformance/device_execution/enqueue_multi_queue.cpp +++ b/test_conformance/device_execution/enqueue_multi_queue.cpp @@ -15,8 +15,8 @@ // #include #include -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/testHarness.h" +#include "harness/typeWrappers.h" #include diff --git a/test_conformance/device_execution/enqueue_ndrange.cpp b/test_conformance/device_execution/enqueue_ndrange.cpp index 0055b618..84ac339f 100644 --- a/test_conformance/device_execution/enqueue_ndrange.cpp +++ b/test_conformance/device_execution/enqueue_ndrange.cpp @@ -15,8 +15,8 @@ // #include #include -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/testHarness.h" +#include "harness/typeWrappers.h" #include diff --git a/test_conformance/device_execution/enqueue_profiling.cpp b/test_conformance/device_execution/enqueue_profiling.cpp new file mode 100644 index 00000000..75aeb4ec --- /dev/null +++ b/test_conformance/device_execution/enqueue_profiling.cpp @@ -0,0 +1,171 @@ +// +// Copyright (c) 2020 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include +#include +#include "harness/testHarness.h" +#include "harness/typeWrappers.h" + +#include + +#include "procs.h" +#include "utils.h" +#include + +static int max_nestingLevel = 10; + +static const char* enqueue_multi_level = R"( + void block_fn(__global int* res, int level) + { + queue_t def_q = get_default_queue(); + if(--level < 0) return; + void (^kernelBlock)(void) = ^{ block_fn(res, level); }; + ndrange_t ndrange = ndrange_1D(1); + int enq_res = enqueue_kernel(def_q, CLK_ENQUEUE_FLAGS_WAIT_KERNEL, ndrange, kernelBlock); + if(enq_res != CLK_SUCCESS) { (*res) = -1; return; } + else if(*res != -1) { (*res)++; } + } + kernel void enqueue_multi_level(__global int* res, int level) + { + *res = 0; + block_fn(res, level); + })"; + +int test_enqueue_profiling(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements) +{ + cl_int err_ret, res = 0; + clCommandQueueWrapper dev_queue; + clCommandQueueWrapper host_queue; + + cl_uint maxQueueSize = 0; + err_ret = clGetDeviceInfo(device, CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE, + sizeof(maxQueueSize), &maxQueueSize, 0); + test_error(err_ret, + "clGetDeviceInfo(CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE) failed"); + + cl_queue_properties dev_queue_prop_def[] = { + CL_QUEUE_PROPERTIES, + CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE + | CL_QUEUE_ON_DEVICE_DEFAULT | CL_QUEUE_PROFILING_ENABLE, + CL_QUEUE_SIZE, maxQueueSize, 0 + }; + + dev_queue = clCreateCommandQueueWithProperties( + context, device, dev_queue_prop_def, &err_ret); + test_error(err_ret, + "clCreateCommandQueueWithProperties(CL_QUEUE_DEVICE|CL_QUEUE_" + "DEFAULT) failed"); + + cl_queue_properties host_queue_prop_def[] = { CL_QUEUE_PROPERTIES, + CL_QUEUE_PROFILING_ENABLE, + 0 }; + + host_queue = clCreateCommandQueueWithProperties( + context, device, host_queue_prop_def, &err_ret); + test_error(err_ret, + "clCreateCommandQueueWithProperties(CL_QUEUE_DEVICE|CL_QUEUE_" + "DEFAULT) failed"); + + cl_int status; + size_t size = 1; + cl_int result = 0; + + clMemWrapper res_mem; + clProgramWrapper program; + clKernelWrapper kernel; + + cl_event kernel_event; + + err_ret = create_single_kernel_helper_with_build_options( + context, &program, &kernel, 1, &enqueue_multi_level, + "enqueue_multi_level", "-cl-std=CL2.0"); + if (check_error(err_ret, "Create single kernel failed")) return -1; + + res_mem = clCreateBuffer(context, CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR, + sizeof(result), &result, &err_ret); + test_error(err_ret, "clCreateBuffer() failed"); + + err_ret = clSetKernelArg(kernel, 0, sizeof(res_mem), &res_mem); + test_error(err_ret, "clSetKernelArg(0) failed"); + + for (int level = 0; level < max_nestingLevel; level++) + { + err_ret = clSetKernelArg(kernel, 1, sizeof(level), &level); + test_error(err_ret, "clSetKernelArg(1) failed"); + + err_ret = clEnqueueNDRangeKernel(host_queue, kernel, 1, NULL, &size, + &size, 0, NULL, &kernel_event); + test_error(err_ret, + "clEnqueueNDRangeKernel('enqueue_multi_level') failed"); + + err_ret = clEnqueueReadBuffer(host_queue, res_mem, CL_TRUE, 0, + sizeof(result), &result, 0, NULL, NULL); + test_error(err_ret, "clEnqueueReadBuffer() failed"); + + if (result != level) + { + log_error("Kernel execution should return the maximum nesting " + " level (got %d instead of %d)", + result, level); + return -1; + } + + err_ret = + clGetEventInfo(kernel_event, CL_EVENT_COMMAND_EXECUTION_STATUS, + sizeof(status), &status, NULL); + test_error(err_ret, "clGetEventInfo() failed"); + + if (check_error(status, "Kernel execution status %d", status)) + return status; + + cl_ulong end; + err_ret = clGetEventProfilingInfo( + kernel_event, CL_PROFILING_COMMAND_END, sizeof(end), &end, NULL); + test_error(err_ret, "clGetEventProfilingInfo() failed"); + + cl_ulong complete; + err_ret = + clGetEventProfilingInfo(kernel_event, CL_PROFILING_COMMAND_COMPLETE, + sizeof(complete), &complete, NULL); + test_error(err_ret, "clGetEventProfilingInfo() failed"); + + if (level == 0) + { + if (end != complete) + { + log_error("Profiling END should be the same as COMPLETE for " + "kernels without children"); + return -1; + } + } + else + { + if (end > complete) + { + log_error("Profiling END should be smaller than COMPLETE for " + "kernels with device side children"); + return -1; + } + } + + log_info("Profiling info for '%s' kernel is OK for level %d.\n", + "enqueue_multi_level", level); + + clReleaseEvent(kernel_event); + } + + return res; +} diff --git a/test_conformance/device_execution/enqueue_wg_size.cpp b/test_conformance/device_execution/enqueue_wg_size.cpp index e1da04ce..3b575484 100644 --- a/test_conformance/device_execution/enqueue_wg_size.cpp +++ b/test_conformance/device_execution/enqueue_wg_size.cpp @@ -15,8 +15,8 @@ // #include #include -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/testHarness.h" +#include "harness/typeWrappers.h" #include diff --git a/test_conformance/device_execution/execute_block.cpp b/test_conformance/device_execution/execute_block.cpp index 99589605..e5b13eff 100644 --- a/test_conformance/device_execution/execute_block.cpp +++ b/test_conformance/device_execution/execute_block.cpp @@ -15,8 +15,8 @@ // #include #include -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/testHarness.h" +#include "harness/typeWrappers.h" #include diff --git a/test_conformance/device_execution/host_multi_queue.cpp b/test_conformance/device_execution/host_multi_queue.cpp index 5b572d72..e9a675c3 100644 --- a/test_conformance/device_execution/host_multi_queue.cpp +++ b/test_conformance/device_execution/host_multi_queue.cpp @@ -15,8 +15,8 @@ // #include #include -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/testHarness.h" +#include "harness/typeWrappers.h" #include diff --git a/test_conformance/device_execution/host_queue_order.cpp b/test_conformance/device_execution/host_queue_order.cpp index 12577801..5dce1604 100644 --- a/test_conformance/device_execution/host_queue_order.cpp +++ b/test_conformance/device_execution/host_queue_order.cpp @@ -15,8 +15,8 @@ // #include #include -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/testHarness.h" +#include "harness/typeWrappers.h" #include @@ -37,7 +37,7 @@ static const char* enqueue_block_first_kernel[] = NL, " for(int i = 1 ; i < tid ; i++)" NL, " {" NL, " for(int j = 0 ; j < num ; j++)" - NL, " atomic_add(res+tid, convert_int_rte(sqrt((float)i*i) / i));" + NL, " atomic_add(res+tid, 1);" NL, " }" NL, "}" NL, "" @@ -178,6 +178,9 @@ int test_host_queue_order(cl_device_id device, cl_context context, cl_command_qu if((k = check_kernel_results(result, num)) >= 0 && check_error(-1, "'%s' results validation failed: [%d] returned %d expected 0", "test_host_queue_order", k, result[k])) res = -1; + clReleaseEvent(kernel_event); + clReleaseEvent(event1); + return res; } diff --git a/test_conformance/device_execution/main.c b/test_conformance/device_execution/main.cpp similarity index 56% rename from test_conformance/device_execution/main.c rename to test_conformance/device_execution/main.cpp index fb058277..a3d0d8d0 100644 --- a/test_conformance/device_execution/main.c +++ b/test_conformance/device_execution/main.cpp @@ -20,28 +20,50 @@ #include #endif -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/parseParameters.h" +#include "harness/testHarness.h" +#include "harness/parseParameters.h" #include "utils.h" #include "procs.h" std::string gKernelName; int gWimpyMode = 0; +test_status InitCL(cl_device_id device) { + auto version = get_device_cl_version(device); + auto expected_min_version = Version(2, 0); + if (version < expected_min_version) + { + version_expected_info("Test", "OpenCL", + expected_min_version.to_string().c_str(), + version.to_string().c_str()); + return TEST_SKIP; + } + + int error; + cl_uint max_queues_size; + error = clGetDeviceInfo(device, CL_DEVICE_MAX_ON_DEVICE_QUEUES, + sizeof(max_queues_size), &max_queues_size, NULL); + if (error != CL_SUCCESS) + { + print_error(error, "Unable to get max queues on device"); + return TEST_FAIL; + } + + if ((max_queues_size == 0) && (version >= Version(3, 0))) + { + return TEST_SKIP; + } + + return TEST_PASS; +} + test_definition test_list[] = { -#ifdef CL_VERSION_2_0 - ADD_TEST( device_info ), - ADD_TEST( device_queue ), - ADD_TEST( execute_block ), - ADD_TEST( enqueue_block ), - ADD_TEST( enqueue_nested_blocks ), - ADD_TEST( enqueue_wg_size ), - ADD_TEST( enqueue_flags ), - ADD_TEST( enqueue_multi_queue ), - ADD_TEST( host_multi_queue ), - ADD_TEST( enqueue_ndrange ), - ADD_TEST( host_queue_order ), -#endif + ADD_TEST(device_info), ADD_TEST(device_queue), + ADD_TEST(execute_block), ADD_TEST(enqueue_block), + ADD_TEST(enqueue_nested_blocks), ADD_TEST(enqueue_wg_size), + ADD_TEST(enqueue_flags), ADD_TEST(enqueue_multi_queue), + ADD_TEST(host_multi_queue), ADD_TEST(enqueue_ndrange), + ADD_TEST(host_queue_order), ADD_TEST(enqueue_profiling), }; const int test_num = ARRAY_SIZE( test_list ); @@ -76,5 +98,5 @@ int main(int argc, const char *argv[]) } } - return runTestHarnessWithCheck(argc, argv, test_num, test_list, false, false, 0, NULL); + return runTestHarnessWithCheck(argc, argv, test_num, test_list, false, 0, InitCL); } diff --git a/test_conformance/device_execution/nested_blocks.cpp b/test_conformance/device_execution/nested_blocks.cpp index fd075527..2f6076f4 100644 --- a/test_conformance/device_execution/nested_blocks.cpp +++ b/test_conformance/device_execution/nested_blocks.cpp @@ -15,8 +15,8 @@ // #include #include -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/testHarness.h" +#include "harness/typeWrappers.h" #include diff --git a/test_conformance/device_execution/procs.h b/test_conformance/device_execution/procs.h index 53b6be41..087dafc1 100644 --- a/test_conformance/device_execution/procs.h +++ b/test_conformance/device_execution/procs.h @@ -13,11 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/testHarness.h" - -#ifdef __cplusplus -extern "C" { -#endif +#include "harness/testHarness.h" extern int test_device_info(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements); extern int test_device_queue(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements); @@ -30,11 +26,9 @@ extern int test_enqueue_multi_queue(cl_device_id device, cl_context context, cl_ extern int test_host_multi_queue(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements); extern int test_enqueue_ndrange(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements); extern int test_host_queue_order(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements); +extern int test_enqueue_profiling(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements); extern int test_execution_stress(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements); -#ifdef __cplusplus -} -#endif - diff --git a/test_conformance/device_execution/utils.cpp b/test_conformance/device_execution/utils.cpp index b349b2d6..66a2211f 100644 --- a/test_conformance/device_execution/utils.cpp +++ b/test_conformance/device_execution/utils.cpp @@ -15,8 +15,8 @@ // #include #include -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/testHarness.h" +#include "harness/typeWrappers.h" #include "utils.h" diff --git a/test_conformance/device_execution/utils.h b/test_conformance/device_execution/utils.h index 02d7b6c7..9b30d95f 100644 --- a/test_conformance/device_execution/utils.h +++ b/test_conformance/device_execution/utils.h @@ -16,8 +16,8 @@ #ifndef _utils_h_ #define _utils_h_ -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/mt19937.h" +#include "harness/testHarness.h" +#include "harness/mt19937.h" #include diff --git a/test_conformance/device_partition/CMakeLists.txt b/test_conformance/device_partition/CMakeLists.txt index cb8f0c9f..920c1609 100644 --- a/test_conformance/device_partition/CMakeLists.txt +++ b/test_conformance/device_partition/CMakeLists.txt @@ -1,18 +1,7 @@ set(MODULE_NAME DEVICE_PARTITION) set(${MODULE_NAME}_SOURCES - main.c + main.cpp test_device_partition.cpp - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/threadTesting.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/genericThread.cpp - ../../test_common/harness/mt19937.c - ../../test_common/harness/conversions.c - ../../test_common/harness/typeWrappers.cpp - ../../test_common/harness/msvc9.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c ) include(../CMakeCommon.txt) diff --git a/test_conformance/device_partition/main.c b/test_conformance/device_partition/main.cpp similarity index 90% rename from test_conformance/device_partition/main.c rename to test_conformance/device_partition/main.cpp index 88217b0b..f5f081ea 100644 --- a/test_conformance/device_partition/main.c +++ b/test_conformance/device_partition/main.cpp @@ -13,13 +13,13 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include #include "procs.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/mt19937.h" +#include "harness/testHarness.h" +#include "harness/mt19937.h" #if !defined(_WIN32) #include diff --git a/test_conformance/device_partition/procs.h b/test_conformance/device_partition/procs.h index 7cfd4dc4..1e543daf 100644 --- a/test_conformance/device_partition/procs.h +++ b/test_conformance/device_partition/procs.h @@ -13,10 +13,10 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/mt19937.h" +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" +#include "harness/typeWrappers.h" +#include "harness/mt19937.h" extern int test_partition_all(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_partition_equally(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); diff --git a/test_conformance/device_partition/testBase.h b/test_conformance/device_partition/testBase.h index 5073b21f..5b49bfd7 100644 --- a/test_conformance/device_partition/testBase.h +++ b/test_conformance/device_partition/testBase.h @@ -16,7 +16,7 @@ #ifndef _testBase_h #define _testBase_h -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/device_partition/test_device_partition.cpp b/test_conformance/device_partition/test_device_partition.cpp index 468cd22b..b90fca85 100644 --- a/test_conformance/device_partition/test_device_partition.cpp +++ b/test_conformance/device_partition/test_device_partition.cpp @@ -14,9 +14,9 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/conversions.h" +#include "harness/typeWrappers.h" +#include "harness/testHarness.h" +#include "harness/conversions.h" #include diff --git a/test_conformance/device_timer/CMakeLists.txt b/test_conformance/device_timer/CMakeLists.txt index a0b24288..4af7c7f7 100644 --- a/test_conformance/device_timer/CMakeLists.txt +++ b/test_conformance/device_timer/CMakeLists.txt @@ -1,14 +1,8 @@ set(MODULE_NAME DEVICE_TIMER) set(${MODULE_NAME}_SOURCES - main.c - test_device_timer.c - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/msvc9.c - ../../test_common/harness/crc32.c + main.cpp + test_device_timer.cpp ) include(../CMakeCommon.txt) diff --git a/test_conformance/device_timer/main.c b/test_conformance/device_timer/main.c deleted file mode 100644 index a64ff268..00000000 --- a/test_conformance/device_timer/main.c +++ /dev/null @@ -1,39 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" -#include -#include -#include -#include "../../test_common/harness/testHarness.h" - -#if !defined(_WIN32) -#include -#endif - -#include "procs.h" - -test_definition test_list[] = { - ADD_TEST( timer_resolution_queries ), - ADD_TEST( device_and_host_timers ), -}; - -const int test_num = ARRAY_SIZE( test_list ); - -int main(int argc, const char *argv[]) -{ - return runTestHarness( argc, argv, test_num, test_list, false, false, 0 ); -} - diff --git a/test_conformance/device_timer/main.cpp b/test_conformance/device_timer/main.cpp new file mode 100644 index 00000000..1c460af8 --- /dev/null +++ b/test_conformance/device_timer/main.cpp @@ -0,0 +1,80 @@ +// +// Copyright (c) 2017 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "harness/compat.h" +#include +#include +#include +#include "harness/testHarness.h" + +#if !defined(_WIN32) +#include +#endif + +#include "procs.h" + +test_definition test_list[] = { + ADD_TEST( timer_resolution_queries ), + ADD_TEST( device_and_host_timers ), +}; + +test_status InitCL(cl_device_id device) +{ + auto version = get_device_cl_version(device); + auto expected_min_version = Version(2, 1); + cl_platform_id platform; + cl_ulong timer_res; + cl_int error; + + if (version < expected_min_version) + { + version_expected_info("Test", "OpenCL", + expected_min_version.to_string().c_str(), + version.to_string().c_str()); + return TEST_SKIP; + } + + error = clGetDeviceInfo(device, CL_DEVICE_PLATFORM, sizeof(platform), + &platform, NULL); + if (error != CL_SUCCESS) + { + print_error(error, "Unable to get device platform"); + return TEST_FAIL; + } + + error = clGetPlatformInfo(platform, CL_PLATFORM_HOST_TIMER_RESOLUTION, + sizeof(timer_res), &timer_res, NULL); + if (error != CL_SUCCESS) + { + print_error(error, "Unable to get host timer capabilities"); + return TEST_FAIL; + } + + if ((timer_res == 0) && (version >= Version(3, 0))) + { + return TEST_SKIP; + } + + return TEST_PASS; +} + + +const int test_num = ARRAY_SIZE( test_list ); + +int main(int argc, const char *argv[]) +{ + return runTestHarnessWithCheck( argc, argv, test_num, test_list, false, 0, InitCL ); +} + diff --git a/test_conformance/device_timer/test_device_timer.c b/test_conformance/device_timer/test_device_timer.cpp similarity index 98% rename from test_conformance/device_timer/test_device_timer.c rename to test_conformance/device_timer/test_device_timer.cpp index 7b171c02..c5943fad 100644 --- a/test_conformance/device_timer/test_device_timer.c +++ b/test_conformance/device_timer/test_device_timer.cpp @@ -15,8 +15,8 @@ // #include #include -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/compat.h" +#include "harness/errorHelpers.h" +#include "harness/compat.h" #if !defined(_WIN32) #include "unistd.h" // For "sleep" diff --git a/test_conformance/events/CMakeLists.txt b/test_conformance/events/CMakeLists.txt index 7cfb995a..d6a5a2fd 100644 --- a/test_conformance/events/CMakeLists.txt +++ b/test_conformance/events/CMakeLists.txt @@ -1,7 +1,7 @@ set(MODULE_NAME EVENTS) set(${MODULE_NAME}_SOURCES - main.c + main.cpp test_events.cpp test_event_dependencies.cpp test_waitlists.cpp @@ -9,18 +9,6 @@ set(${MODULE_NAME}_SOURCES test_userevents_multithreaded.cpp action_classes.cpp test_callbacks.cpp - ../../test_common/harness/genericThread.cpp - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/threadTesting.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/typeWrappers.cpp - ../../test_common/harness/mt19937.c - ../../test_common/harness/conversions.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/ThreadPool.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c ) include(../CMakeCommon.txt) diff --git a/test_conformance/events/main.c b/test_conformance/events/main.cpp similarity index 96% rename from test_conformance/events/main.c rename to test_conformance/events/main.cpp index d3cd162a..2aafb0e5 100644 --- a/test_conformance/events/main.c +++ b/test_conformance/events/main.cpp @@ -13,12 +13,12 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include #include "procs.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" #if !defined(_WIN32) #include #endif diff --git a/test_conformance/events/procs.h b/test_conformance/events/procs.h index 216daf77..f077c247 100644 --- a/test_conformance/events/procs.h +++ b/test_conformance/events/procs.h @@ -13,10 +13,10 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/clImageHelper.h" +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" +#include "harness/typeWrappers.h" +#include "harness/clImageHelper.h" extern float random_float(float low, float high); extern float calculate_ulperror(float a, float b); diff --git a/test_conformance/events/testBase.h b/test_conformance/events/testBase.h index 5073b21f..5b49bfd7 100644 --- a/test_conformance/events/testBase.h +++ b/test_conformance/events/testBase.h @@ -16,7 +16,7 @@ #ifndef _testBase_h #define _testBase_h -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/events/test_callbacks.cpp b/test_conformance/events/test_callbacks.cpp index 3286fd6e..2ffb9ca7 100644 --- a/test_conformance/events/test_callbacks.cpp +++ b/test_conformance/events/test_callbacks.cpp @@ -15,8 +15,8 @@ // #include "testBase.h" #include "action_classes.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/ThreadPool.h" +#include "harness/conversions.h" +#include "harness/ThreadPool.h" #if !defined (_MSC_VER) #include diff --git a/test_conformance/events/test_event_dependencies.cpp b/test_conformance/events/test_event_dependencies.cpp index c0b5c68a..0ab0f2ad 100644 --- a/test_conformance/events/test_event_dependencies.cpp +++ b/test_conformance/events/test_event_dependencies.cpp @@ -14,7 +14,7 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" const char *write_kernels[] = { "__kernel void write_up(__global int *dst, int length)\n" @@ -116,30 +116,30 @@ int test_event_enqueue_wait_for_events_run_test( cl_device_id deviceID, cl_conte } // If we are using two queues then create them - cl_queue_properties props[] = {CL_QUEUE_PROPERTIES, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, 0}; + cl_command_queue_properties props = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE; if (two_queues) { // Get a second queue if (two_devices) { - if( !checkDeviceForQueueSupport( two_device_ids[ 0 ], props[1] ) || - !checkDeviceForQueueSupport( two_device_ids[ 1 ], props[1] ) ) + if( !checkDeviceForQueueSupport( two_device_ids[ 0 ], props ) || + !checkDeviceForQueueSupport( two_device_ids[ 1 ], props ) ) { log_info( "WARNING: One or more device for multi-device test does not support out-of-order exec mode; skipping test.\n" ); return -1942; } - queueWrappers[0] = clCreateCommandQueueWithProperties(context_to_use, two_device_ids[0], &props[0], &error); + queueWrappers[0] = clCreateCommandQueue(context_to_use, two_device_ids[0], props, &error); test_error(error, "clCreateCommandQueue for first queue on first device failed."); - queueWrappers[1] = clCreateCommandQueueWithProperties(context_to_use, two_device_ids[1], &props[0], &error); + queueWrappers[1] = clCreateCommandQueue(context_to_use, two_device_ids[1], props, &error); test_error(error, "clCreateCommandQueue for second queue on second device failed."); } else { // Single device has already been checked for out-of-order exec support - queueWrappers[0] = clCreateCommandQueueWithProperties(context_to_use, deviceID, &props[0], &error); + queueWrappers[0] = clCreateCommandQueue(context_to_use, deviceID, props, &error); test_error(error, "clCreateCommandQueue for first queue failed."); - queueWrappers[1] = clCreateCommandQueueWithProperties(context_to_use, deviceID, &props[0], &error); + queueWrappers[1] = clCreateCommandQueue(context_to_use, deviceID, props, &error); test_error(error, "clCreateCommandQueue for second queue failed."); } // Ugly hack to make sure we only have the wrapper auto-release if they are different queues @@ -151,7 +151,7 @@ int test_event_enqueue_wait_for_events_run_test( cl_device_id deviceID, cl_conte { // (Note: single device has already been checked for out-of-order exec support) // Otherwise create one queue and have the second one be the same - queueWrappers[0] = clCreateCommandQueueWithProperties(context_to_use, deviceID, &props[0], &error); + queueWrappers[0] = clCreateCommandQueue(context_to_use, deviceID, props, &error); test_error(error, "clCreateCommandQueue for first queue failed."); queues[0] = queueWrappers[0]; queues[1] = (cl_command_queue)queues[0]; diff --git a/test_conformance/events/test_userevents.cpp b/test_conformance/events/test_userevents.cpp index 39dea376..0a4954f9 100644 --- a/test_conformance/events/test_userevents.cpp +++ b/test_conformance/events/test_userevents.cpp @@ -23,62 +23,11 @@ #include #include #include -#include "../../test_common/harness/kernelHelpers.h" - -/////////////////////////////////////////////////////////////////////////////// -// ATF performance framework. - -#if USE_ATF -#include -#define test_start() ATFTestStart() -#define log_perf(_number, _higherBetter, _numType, _format, ...) ATFLogPerformanceNumber(_number, _higherBetter, _numType, _format,##__VA_ARGS__) -#define log_info ATFLogInfo -#define log_error ATFLogError -#define log_no_atf -#define test_finish() ATFTestFinish() -#else -#define test_start() -#define log_perf(_number, _higherBetter, _numType, _format, ...) printf("Performance Number " _format " (in %s, %s): %g\n",##__VA_ARGS__, _numType, _higherBetter?"higher is better":"lower is better" , _number) -#define log_info(...) fprintf(stdout, ## __VA_ARGS__ ) -#define log_error(...) fprintf(stderr, ## __VA_ARGS__ ) -#define log_info_no_atf(...) log_info(## __VA_ARGS__ ) -#define test_finish() -#endif +#include "harness/kernelHelpers.h" /////////////////////////////////////////////////////////////////////////////// // CL error checking. -#define CL_DEVICE_TYPE_ENV_MUST_BE( bitfield_ )\ -{\ -cl_device_type device_type = CL_DEVICE_TYPE_DEFAULT;\ -const char* device_env = getenv("CL_DEVICE_TYPE");\ -if (device_env != NULL) {\ -if (!strcmp( device_env, "gpu" ) || !strcmp( device_env, "CL_DEVICE_TYPE_GPU" ))\ -device_type = CL_DEVICE_TYPE_GPU;\ -else if(!strcmp( device_env, "cpu" ) || !strcmp( device_env, "CL_DEVICE_TYPE_CPU" ))\ -device_type = CL_DEVICE_TYPE_CPU;\ -else if(!strcmp( device_env, "default" ) || !strcmp( device_env, "CL_DEVICE_TYPE_DEFAULT" ))\ -device_type = CL_DEVICE_TYPE_DEFAULT;\ -if (!(device_type & bitfield_)) {\ -log_error( "CL_DEVICE_TYPE environment variable \"%s\" must be \"%s\".", device_env, #bitfield_ );\ -abort();\ -}\ -}\ -}\ - -#define CL_DEVICE_TYPE_ENV( device_type_ )\ -{\ -const char* device_env = getenv("CL_DEVICE_TYPE");\ -if (device_env != NULL) {\ -if (!strcmp( device_env, "gpu" ) || !strcmp( device_env, "CL_DEVICE_TYPE_GPU" ))\ -device_type_ = CL_DEVICE_TYPE_GPU;\ -else if(!strcmp( device_env, "cpu" ) || !strcmp( device_env, "CL_DEVICE_TYPE_CPU" ))\ -device_type_ = CL_DEVICE_TYPE_CPU;\ -else if(!strcmp( device_env, "default" ) || !strcmp( device_env, "CL_DEVICE_TYPE_DEFAULT" ))\ -device_type_ = CL_DEVICE_TYPE_DEFAULT;\ -}\ -} - #if defined(_MSC_VER) #define CL_EXIT_ERROR(cmd,...) \ { \ @@ -258,36 +207,11 @@ int test_userevents( cl_device_id deviceID, cl_context context, cl_command_queue log_info("Unsuccessful user event case passed.\n"); } + clReleaseKernel(k0); + clReleaseProgram(program); + clReleaseMemObject(output); + return 0; } -#if 0 -int main(int argc, char** argv) -{ - - cl_int err; - - test_start(); - - cl_device_type device_type; - CL_DEVICE_TYPE_ENV( device_type ); - - cl_device_id device_id; - CL_EXIT_ERROR(clGetDeviceIDs(NULL, device_type, 1, &device_id, NULL),"GetDeviceIDs"); - - // Create a context. - cl_context context = clCreateContext(0, 1, &device_id, NULL, NULL, &err); - CL_EXIT_ERROR(err,"CreateContext"); - - // Create a command queue. - q = clCreateCommandQueueWithProperties(context,device_id,0,&err); - CL_EXIT_ERROR(err,"clCreateCommandQueue failed"); - - int ret = test_userevents( device_type, context, queue, 0 ); - - test_finish(); - - return ret; -} -#endif diff --git a/test_conformance/events/test_userevents_multithreaded.cpp b/test_conformance/events/test_userevents_multithreaded.cpp index 6c54e780..51ef2226 100644 --- a/test_conformance/events/test_userevents_multithreaded.cpp +++ b/test_conformance/events/test_userevents_multithreaded.cpp @@ -15,29 +15,20 @@ // #include "testBase.h" #include "action_classes.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/genericThread.h" +#include "harness/conversions.h" + +#include #if !defined (_MSC_VER) #include #endif // !_MSC_VER -class releaseEvent_thread : public genericThread +void trigger_user_event(cl_event *event) { - public: - releaseEvent_thread( cl_event *event ) : mEvent( event ) {} - - cl_event * mEvent; - - protected: - virtual void * IRun( void ) - { - usleep( 1000000 ); - log_info( "\tTriggering gate from separate thread...\n" ); - clSetUserEventStatus( *mEvent, CL_COMPLETE ); - return NULL; - } -}; + usleep(1000000); + log_info("\tTriggering gate from separate thread...\n"); + clSetUserEventStatus(*event, CL_COMPLETE); +} int test_userevents_multithreaded( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ) { @@ -66,14 +57,14 @@ int test_userevents_multithreaded( cl_device_id deviceID, cl_context context, cl } // Now, instead of releasing the gate, we spawn a separate thread to do so - releaseEvent_thread thread( &gateEvent ); log_info( "\tStarting trigger thread...\n" ); - thread.Start(); + std::thread thread(trigger_user_event, &gateEvent); log_info( "\tWaiting for actions...\n" ); error = clWaitForEvents( 3, &actionEvents[ 0 ] ); test_error( error, "Unable to wait for action events" ); + thread.join(); log_info( "\tActions completed.\n" ); // If we got here without error, we're good diff --git a/test_conformance/events/test_waitlists.cpp b/test_conformance/events/test_waitlists.cpp index fa5db3f2..e23cacf4 100644 --- a/test_conformance/events/test_waitlists.cpp +++ b/test_conformance/events/test_waitlists.cpp @@ -270,15 +270,15 @@ int test_waitlists( cl_device_id deviceID, cl_context context, cl_command_queue { cl_int error; int retVal = 0; - cl_queue_properties props[] = {CL_QUEUE_PROPERTIES, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, 0}; + cl_command_queue_properties props = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE; - if( !checkDeviceForQueueSupport( deviceID, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE ) ) + if( !checkDeviceForQueueSupport( deviceID, props ) ) { log_info( "WARNING: Device does not support out-of-order exec mode; skipping test.\n" ); return 0; } - clCommandQueueWrapper queue = clCreateCommandQueueWithProperties( context, deviceID, &props[0], &error ); + clCommandQueueWrapper queue = clCreateCommandQueue( context, deviceID, props, &error ); test_error(error, "Unable to create out-of-order queue"); log_info( "\n" ); diff --git a/test_conformance/generate_spirv_offline.py b/test_conformance/generate_spirv_offline.py new file mode 100755 index 00000000..3612319d --- /dev/null +++ b/test_conformance/generate_spirv_offline.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python + +from __future__ import print_function + +import sys +import os +import traceback + +if len(sys.argv) != 3: + print('Usage: "generate_spirv_offline.py "') + exit(1) + +compilation_cache_dir = sys.argv[1] +cl_device_info_filename = sys.argv[2] + +def generate_spirv(): + print("Generating SPIR-V files") + build_options = '' + + if os.path.exists(compilation_cache_dir): + for root, dirs, files in os.walk(compilation_cache_dir): + for file in files: + if file.endswith('.cl'): + options_file_name = file[:-2] + "options" + if os.path.exists(os.path.join(root, options_file_name)): + optFile = open (os.path.join(root, options_file_name), 'r') + build_options = optFile.readline().strip() + print(build_options) + source_filename = os.path.join(root, file) + output_filename = os.path.join(root, file[:-2]) + "spv" + + command_line = ("cl_offline_compiler" + + " --source=" + source_filename + + " --output=" + output_filename + + " --cl-device-info=" + cl_device_info_filename + + " --mode=spir-v -- " + + '"' + build_options + '"') + print(command_line) + os.system(command_line) + return 0 + +def main(): + try: + generate_spirv() + except Exception: + traceback.print_exc(file=sys.stdout) + sys.exit(0) + +if __name__ == "__main__": + main() + + + diff --git a/test_conformance/generic_address_space/CMakeLists.txt b/test_conformance/generic_address_space/CMakeLists.txt index 0e507359..e74bcf4a 100644 --- a/test_conformance/generic_address_space/CMakeLists.txt +++ b/test_conformance/generic_address_space/CMakeLists.txt @@ -5,13 +5,6 @@ set(${MODULE_NAME}_SOURCES basic_tests.cpp main.cpp stress_tests.cpp - ../../test_common/harness/testHarness.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/mt19937.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c ) include(../CMakeCommon.txt) diff --git a/test_conformance/generic_address_space/advanced_tests.cpp b/test_conformance/generic_address_space/advanced_tests.cpp index 05bd7ae9..b6df99a9 100644 --- a/test_conformance/generic_address_space/advanced_tests.cpp +++ b/test_conformance/generic_address_space/advanced_tests.cpp @@ -13,8 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/testHarness.h" +#include "harness/typeWrappers.h" #include "base.h" #include @@ -947,85 +947,52 @@ int test_generic_advanced_casting(cl_device_id deviceID, cl_context context, cl_ return test.Execute(deviceID, context, queue, num_elements); } -int test_generic_ptr_to_host_mem(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) { +int test_generic_ptr_to_host_mem_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) { cl_int result = CL_SUCCESS; - const std::string GLOBAL_KERNEL_FUNCTION = common::CONFORMANCE_VERIFY_FENCE + - NL - NL "bool helperFunction(uint *ptr, uint tid) {" - NL " if (!isFenceValid(get_fence(ptr)))" - NL " return false;" - NL - NL " if (*ptr != tid)" - NL " return false;" - NL - NL " return true;" - NL "}" - NL - NL "__kernel void testKernel(__global uint *results, __global uint *buf) {" - NL " uint tid = get_global_id(0);" - NL - NL " results[tid] = helperFunction(&buf[tid], tid);" - NL "}" - NL; - - const std::string LOCAL_KERNEL_FUNCTION = common::CONFORMANCE_VERIFY_FENCE + - NL - NL "bool helperFunction(uint *ptr, uint tid) {" - NL " if (!isFenceValid(get_fence(ptr)))" - NL " return false;" - NL - NL " if (*ptr != tid)" - NL " return false;" - NL - NL " return true;" - NL "}" - NL - NL "__kernel void testKernel(__global uint *results, __local uint *buf) {" - NL " uint tid = get_global_id(0);" - NL " if (get_local_id(0) == 0) {" - NL " for (uint i = 0; i < get_local_size(0); ++i) {" - NL " uint idx = get_local_size(0) * get_group_id(0) + i;" - NL " buf[idx] = idx;" - NL " }" - NL " }" - NL - NL " work_group_barrier(CLK_LOCAL_MEM_FENCE);" - NL " results[tid] = helperFunction(&buf[tid], tid);" - NL "}" - NL; - - CAdvancedTest test_global_ptr(GLOBAL_KERNEL_FUNCTION, ARG_TYPE_HOST_PTR); - result |= test_global_ptr.Execute(deviceID, context, queue, num_elements); - - CAdvancedTest test_local_ptr(LOCAL_KERNEL_FUNCTION, ARG_TYPE_HOST_LOCAL); - result |= test_local_ptr.Execute(deviceID, context, queue, num_elements / 64); - /* Test SVM capabilities and select matching tests */ cl_device_svm_capabilities caps; + auto version = get_device_cl_version(deviceID); + auto expected_min_version = Version(2, 0); cl_int error = clGetDeviceInfo(deviceID, CL_DEVICE_SVM_CAPABILITIES, sizeof(caps), &caps, NULL); test_error(error, "clGetDeviceInfo(CL_DEVICE_SVM_CAPABILITIES) failed"); + if ((version < expected_min_version) + || (version >= Version(3, 0) && caps == 0)) + return TEST_SKIPPED_ITSELF; + if (caps & CL_DEVICE_SVM_COARSE_GRAIN_BUFFER) { - CAdvancedTest test_global_svm_ptr(GLOBAL_KERNEL_FUNCTION, ARG_TYPE_COARSE_GRAINED_SVM); + CAdvancedTest test_global_svm_ptr(common::GLOBAL_KERNEL_FUNCTION, ARG_TYPE_COARSE_GRAINED_SVM); result |= test_global_svm_ptr.Execute(deviceID, context, queue, num_elements); } if (caps & CL_DEVICE_SVM_FINE_GRAIN_BUFFER) { - CAdvancedTest test_global_svm_ptr(GLOBAL_KERNEL_FUNCTION, ARG_TYPE_FINE_GRAINED_BUFFER_SVM); + CAdvancedTest test_global_svm_ptr(common::GLOBAL_KERNEL_FUNCTION, ARG_TYPE_FINE_GRAINED_BUFFER_SVM); result |= test_global_svm_ptr.Execute(deviceID, context, queue, num_elements); } if (caps & CL_DEVICE_SVM_FINE_GRAIN_SYSTEM) { - CAdvancedTest test_global_svm_ptr(GLOBAL_KERNEL_FUNCTION, ARG_TYPE_FINE_GRAINED_SYSTEM_SVM); + CAdvancedTest test_global_svm_ptr(common::GLOBAL_KERNEL_FUNCTION, ARG_TYPE_FINE_GRAINED_SYSTEM_SVM); result |= test_global_svm_ptr.Execute(deviceID, context, queue, num_elements); } if (caps & CL_DEVICE_SVM_ATOMICS) { - CAdvancedTest test_global_svm_ptr(GLOBAL_KERNEL_FUNCTION, ARG_TYPE_ATOMICS_SVM); + CAdvancedTest test_global_svm_ptr(common::GLOBAL_KERNEL_FUNCTION, ARG_TYPE_ATOMICS_SVM); result |= test_global_svm_ptr.Execute(deviceID, context, queue, num_elements); } return result; } + +int test_generic_ptr_to_host_mem(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) { + cl_int result = CL_SUCCESS; + + CAdvancedTest test_global_ptr(common::GLOBAL_KERNEL_FUNCTION, ARG_TYPE_HOST_PTR); + result |= test_global_ptr.Execute(deviceID, context, queue, num_elements); + + CAdvancedTest test_local_ptr(common::LOCAL_KERNEL_FUNCTION, ARG_TYPE_HOST_LOCAL); + result |= test_local_ptr.Execute(deviceID, context, queue, num_elements / 64); + + return result; +} diff --git a/test_conformance/generic_address_space/base.h b/test_conformance/generic_address_space/base.h index 5ea71055..a8fbabdd 100644 --- a/test_conformance/generic_address_space/base.h +++ b/test_conformance/generic_address_space/base.h @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" #include @@ -36,4 +36,49 @@ namespace common { NL " return false;" NL "}" NL; + + static std::string GLOBAL_KERNEL_FUNCTION = CONFORMANCE_VERIFY_FENCE + + NL + NL "bool helperFunction(uint *ptr, uint tid) {" + NL " if (!isFenceValid(get_fence(ptr)))" + NL " return false;" + NL + NL " if (*ptr != tid)" + NL " return false;" + NL + NL " return true;" + NL "}" + NL + NL "__kernel void testKernel(__global uint *results, __global uint *buf) {" + NL " uint tid = get_global_id(0);" + NL + NL " results[tid] = helperFunction(&buf[tid], tid);" + NL "}" + NL; + + static std::string LOCAL_KERNEL_FUNCTION = CONFORMANCE_VERIFY_FENCE + + NL + NL "bool helperFunction(uint *ptr, uint tid) {" + NL " if (!isFenceValid(get_fence(ptr)))" + NL " return false;" + NL + NL " if (*ptr != tid)" + NL " return false;" + NL + NL " return true;" + NL "}" + NL + NL "__kernel void testKernel(__global uint *results, __local uint *buf) {" + NL " uint tid = get_global_id(0);" + NL " if (get_local_id(0) == 0) {" + NL " for (uint i = 0; i < get_local_size(0); ++i) {" + NL " uint idx = get_local_size(0) * get_group_id(0) + i;" + NL " buf[idx] = idx;" + NL " }" + NL " }" + NL + NL " work_group_barrier(CLK_LOCAL_MEM_FENCE);" + NL " results[tid] = helperFunction(&buf[tid], tid);" + NL "}" + NL; } diff --git a/test_conformance/generic_address_space/basic_tests.cpp b/test_conformance/generic_address_space/basic_tests.cpp index 56552fac..0b81564d 100644 --- a/test_conformance/generic_address_space/basic_tests.cpp +++ b/test_conformance/generic_address_space/basic_tests.cpp @@ -13,8 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/testHarness.h" +#include "harness/typeWrappers.h" #include "base.h" #include diff --git a/test_conformance/generic_address_space/main.cpp b/test_conformance/generic_address_space/main.cpp index ab7247c2..01147583 100644 --- a/test_conformance/generic_address_space/main.cpp +++ b/test_conformance/generic_address_space/main.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" #include @@ -38,6 +38,7 @@ extern int test_generic_variable_gentype(cl_device_id deviceID, cl_context conte extern int test_builtin_functions(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_generic_advanced_casting(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_generic_ptr_to_host_mem(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); +extern int test_generic_ptr_to_host_mem_svm(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_max_number_of_params(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); test_definition test_list[] = { @@ -62,11 +63,46 @@ test_definition test_list[] = { ADD_TEST( builtin_functions ), ADD_TEST( generic_advanced_casting ), ADD_TEST( generic_ptr_to_host_mem ), + ADD_TEST( generic_ptr_to_host_mem_svm ), ADD_TEST( max_number_of_params ), }; const int test_num = ARRAY_SIZE( test_list ); +test_status InitCL(cl_device_id device) { + auto version = get_device_cl_version(device); + auto expected_min_version = Version(2, 0); + + if (version < expected_min_version) + { + version_expected_info("Test", "OpenCL", + expected_min_version.to_string().c_str(), + version.to_string().c_str()); + return TEST_SKIP; + } + + if (version >= Version(3, 0)) + { + cl_int error; + cl_bool support_generic; + + error = clGetDeviceInfo(device, CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT, + sizeof(support_generic), &support_generic, NULL); + if (error != CL_SUCCESS) + { + print_error(error, "Unable to get generic address space support"); + return TEST_FAIL; + } + + if (!support_generic) + { + return TEST_SKIP; + } + } + + return TEST_PASS; +} + /* Generic Address Space Tests for unnamed generic address space. This feature allows developers to create single generic functions @@ -75,5 +111,5 @@ const int test_num = ARRAY_SIZE( test_list ); int main(int argc, const char *argv[]) { - return runTestHarness(argc, argv, test_num, test_list, false, false, NULL); + return runTestHarnessWithCheck(argc, argv, test_num, test_list, false, false, InitCL); } diff --git a/test_conformance/generic_address_space/stress_tests.cpp b/test_conformance/generic_address_space/stress_tests.cpp index 58ceb514..4f94a5d0 100644 --- a/test_conformance/generic_address_space/stress_tests.cpp +++ b/test_conformance/generic_address_space/stress_tests.cpp @@ -13,9 +13,9 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/mt19937.h" +#include "harness/testHarness.h" +#include "harness/typeWrappers.h" +#include "harness/mt19937.h" #include "base.h" #include diff --git a/test_conformance/geometrics/CMakeLists.txt b/test_conformance/geometrics/CMakeLists.txt index b7fef328..3fee05fb 100644 --- a/test_conformance/geometrics/CMakeLists.txt +++ b/test_conformance/geometrics/CMakeLists.txt @@ -1,25 +1,10 @@ set(MODULE_NAME GEOMETRICS) set(${MODULE_NAME}_SOURCES - main.c + main.cpp test_geometrics_double.cpp test_geometrics.cpp - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/threadTesting.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/mt19937.c - ../../test_common/harness/conversions.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c ) -# VS2005 optimization WAR for geom_length) -if(MSVC) -set(CMAKE_C_FLAGS_RELEASE "/Od /Ob0") -set(CMAKE_CXX_FLAGS_RELEASE "/Od /Ob0") -endif(MSVC) - include(../CMakeCommon.txt) diff --git a/test_conformance/geometrics/main.c b/test_conformance/geometrics/main.cpp similarity index 92% rename from test_conformance/geometrics/main.c rename to test_conformance/geometrics/main.cpp index e12d655c..038999de 100644 --- a/test_conformance/geometrics/main.c +++ b/test_conformance/geometrics/main.cpp @@ -13,12 +13,12 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include #include "procs.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" #if !defined(_WIN32) #include #endif diff --git a/test_conformance/geometrics/procs.h b/test_conformance/geometrics/procs.h index cde575e4..44f6f892 100644 --- a/test_conformance/geometrics/procs.h +++ b/test_conformance/geometrics/procs.h @@ -13,10 +13,10 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/threadTesting.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" +#include "harness/threadTesting.h" +#include "harness/typeWrappers.h" extern int create_program_and_kernel(const char *source, const char *kernel_name, cl_program *program_ret, cl_kernel *kernel_ret); diff --git a/test_conformance/geometrics/testBase.h b/test_conformance/geometrics/testBase.h index 5073b21f..5b49bfd7 100644 --- a/test_conformance/geometrics/testBase.h +++ b/test_conformance/geometrics/testBase.h @@ -16,7 +16,7 @@ #ifndef _testBase_h #define _testBase_h -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/geometrics/test_geometrics.cpp b/test_conformance/geometrics/test_geometrics.cpp index ac16b2a4..2fcf31ce 100644 --- a/test_conformance/geometrics/test_geometrics.cpp +++ b/test_conformance/geometrics/test_geometrics.cpp @@ -13,13 +13,13 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include "testBase.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/errorHelpers.h" +#include "harness/testHarness.h" +#include "harness/typeWrappers.h" +#include "harness/conversions.h" +#include "harness/errorHelpers.h" #include const char *crossKernelSource = diff --git a/test_conformance/geometrics/test_geometrics_double.cpp b/test_conformance/geometrics/test_geometrics_double.cpp index 34bd1933..7dec7514 100644 --- a/test_conformance/geometrics/test_geometrics_double.cpp +++ b/test_conformance/geometrics/test_geometrics_double.cpp @@ -14,9 +14,9 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/errorHelpers.h" +#include "harness/typeWrappers.h" +#include "harness/conversions.h" +#include "harness/errorHelpers.h" const char *crossKernelSource_double = "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n" diff --git a/test_conformance/gl/CMakeLists.txt b/test_conformance/gl/CMakeLists.txt index c2da9167..dbabe605 100644 --- a/test_conformance/gl/CMakeLists.txt +++ b/test_conformance/gl/CMakeLists.txt @@ -1,10 +1,18 @@ +set (MODULE_NAME GL) + if(WIN32) -list(APPEND CLConform_LIBRARIES glut32 opengl32 glu32 ) +# Windows MSVC/Intel compiler hits: +# - dwonload free libraries package glew and glut/freeglut from the Internet +# - add x64/x86 binaries with glew and glut/freeglut libraries (.lib) to the directory lib/x64 or lib/x86. +# Include folder libs as cmake argument -DCLConform_GL_LIBRARIES_DIR=lib\x64 while solution generation +# - GL headers files should be added to project source directory and GL subdirectory +# - Add .dll files: glut glew to the test binary location. + list(APPEND CLConform_LIBRARIES opengl32 freeglut glew32) else(WIN32) -list(APPEND CLConform_LIBRARIES GL glut GLEW GLU) + list(APPEND CLConform_LIBRARIES GL glut GLEW GLU) endif(WIN32) -set (GL_SOURCES +set (${MODULE_NAME}_SOURCES main.cpp test_buffers.cpp test_image_methods.cpp @@ -23,56 +31,32 @@ set (GL_SOURCES test_fence_sync.cpp helpers.cpp ../../test_common/gl/helpers.cpp - ../../test_common/harness/genericThread.cpp - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/threadTesting.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/mt19937.c - ../../test_common/harness/conversions.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c - ../../test_common/harness/imageHelpers.cpp ) if (WIN32) - list (APPEND GL_SOURCES ../../test_common/gl/setup_win32.cpp) + list (APPEND ${MODULE_NAME}_SOURCES ../../test_common/gl/setup_win32.cpp) else(WIN32) - list (APPEND GL_SOURCES ../../test_common/gl/setup_x11.cpp) + list (APPEND ${MODULE_NAME}_SOURCES ../../test_common/gl/setup_x11.cpp) endif(WIN32) # Compiling GLEW along with the project if the compiler is MINGW. # The mingw linker was giving weird errors while linking to glew32.lib generated by # MSVC. if(MINGW) - list (APPEND GL_SOURCES GLEW/glew.c) + list (APPEND ${MODULE_NAME}_SOURCES GLEW/glew.c) set_source_files_properties( - ${GL_SOURCES} + ${${MODULE_NAME}_SOURCES} COMPILE_FLAGS -DGLEW_STATIC) include_directories("./GLEW/") endif(MINGW) -if (MSVC) - if(CMAKE_CL_64) - list(APPEND CLConform_LIBRARIES glew64) - else(CMAKE_CL_64) - list(APPEND CLConform_LIBRARIES glew32) - endif(CMAKE_CL_64) -endif(MSVC) - -add_executable(conformance_test_gl - ${GL_SOURCES} ${GLUT_SOURCES}) - set_source_files_properties( - ${GL_SOURCES} + ${${MODULE_NAME}_SOURCES} PROPERTIES LANGUAGE CXX) # Add the current folder to the include path, so that # test_common/gl/setup_x11.cpp can find testBase.h which is located in this # folder. -target_include_directories(conformance_test_gl - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -TARGET_LINK_LIBRARIES(conformance_test_gl - ${CLConform_LIBRARIES}) +include(../CMakeCommon.txt) \ No newline at end of file diff --git a/test_conformance/gl/GLEW/GL/eglew.h b/test_conformance/gl/GLEW/GL/eglew.h new file mode 100644 index 00000000..c38ec5c7 --- /dev/null +++ b/test_conformance/gl/GLEW/GL/eglew.h @@ -0,0 +1,2610 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2008-2017, Nigel Stewart +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** 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. +** * The name of the author 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. +*/ + +/* + * Mesa 3-D graphics library + * Version: 7.0 + * + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __eglew_h__ +#define __eglew_h__ +#define __EGLEW_H__ + +#ifdef __eglext_h_ +#error eglext.h included before eglew.h +#endif + +#if defined(__egl_h_) +#error egl.h included before eglew.h +#endif + +#define __eglext_h_ + +#define __egl_h_ + +#ifndef EGLAPIENTRY +#define EGLAPIENTRY GLEWAPIENTRY +#endif +#ifndef EGLAPI +#define EGLAPI extern +#endif + +/* EGL Types */ +#include + +#include +#include + +#include + +typedef int32_t EGLint; + +typedef unsigned int EGLBoolean; +typedef void *EGLDisplay; +typedef void *EGLConfig; +typedef void *EGLSurface; +typedef void *EGLContext; +typedef void (*__eglMustCastToProperFunctionPointerType)(void); + +typedef unsigned int EGLenum; +typedef void *EGLClientBuffer; + +typedef void *EGLSync; +typedef intptr_t EGLAttrib; +typedef khronos_utime_nanoseconds_t EGLTime; +typedef void *EGLImage; + +typedef void *EGLSyncKHR; +typedef intptr_t EGLAttribKHR; +typedef void *EGLLabelKHR; +typedef void *EGLObjectKHR; +typedef void (EGLAPIENTRY *EGLDEBUGPROCKHR)(EGLenum error,const char *command,EGLint messageType,EGLLabelKHR threadLabel,EGLLabelKHR objectLabel,const char* message); +typedef khronos_utime_nanoseconds_t EGLTimeKHR; +typedef void *EGLImageKHR; +typedef void *EGLStreamKHR; +typedef khronos_uint64_t EGLuint64KHR; +typedef int EGLNativeFileDescriptorKHR; +typedef khronos_ssize_t EGLsizeiANDROID; +typedef void (*EGLSetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, const void *value, EGLsizeiANDROID valueSize); +typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, void *value, EGLsizeiANDROID valueSize); +typedef void *EGLDeviceEXT; +typedef void *EGLOutputLayerEXT; +typedef void *EGLOutputPortEXT; +typedef void *EGLSyncNV; +typedef khronos_utime_nanoseconds_t EGLTimeNV; +typedef khronos_utime_nanoseconds_t EGLuint64NV; +typedef khronos_stime_nanoseconds_t EGLnsecsANDROID; + +struct EGLClientPixmapHI; + +#define EGL_DONT_CARE ((EGLint)-1) + +#define EGL_NO_CONTEXT ((EGLContext)0) +#define EGL_NO_DISPLAY ((EGLDisplay)0) +#define EGL_NO_IMAGE ((EGLImage)0) +#define EGL_NO_SURFACE ((EGLSurface)0) +#define EGL_NO_SYNC ((EGLSync)0) + +#define EGL_UNKNOWN ((EGLint)-1) + +#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0) + +EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress (const char *procname); +/* ---------------------------- EGL_VERSION_1_0 ---------------------------- */ + +#ifndef EGL_VERSION_1_0 +#define EGL_VERSION_1_0 1 + +#define EGL_FALSE 0 +#define EGL_PBUFFER_BIT 0x0001 +#define EGL_TRUE 1 +#define EGL_PIXMAP_BIT 0x0002 +#define EGL_WINDOW_BIT 0x0004 +#define EGL_SUCCESS 0x3000 +#define EGL_NOT_INITIALIZED 0x3001 +#define EGL_BAD_ACCESS 0x3002 +#define EGL_BAD_ALLOC 0x3003 +#define EGL_BAD_ATTRIBUTE 0x3004 +#define EGL_BAD_CONFIG 0x3005 +#define EGL_BAD_CONTEXT 0x3006 +#define EGL_BAD_CURRENT_SURFACE 0x3007 +#define EGL_BAD_DISPLAY 0x3008 +#define EGL_BAD_MATCH 0x3009 +#define EGL_BAD_NATIVE_PIXMAP 0x300A +#define EGL_BAD_NATIVE_WINDOW 0x300B +#define EGL_BAD_PARAMETER 0x300C +#define EGL_BAD_SURFACE 0x300D +#define EGL_BUFFER_SIZE 0x3020 +#define EGL_ALPHA_SIZE 0x3021 +#define EGL_BLUE_SIZE 0x3022 +#define EGL_GREEN_SIZE 0x3023 +#define EGL_RED_SIZE 0x3024 +#define EGL_DEPTH_SIZE 0x3025 +#define EGL_STENCIL_SIZE 0x3026 +#define EGL_CONFIG_CAVEAT 0x3027 +#define EGL_CONFIG_ID 0x3028 +#define EGL_LEVEL 0x3029 +#define EGL_MAX_PBUFFER_HEIGHT 0x302A +#define EGL_MAX_PBUFFER_PIXELS 0x302B +#define EGL_MAX_PBUFFER_WIDTH 0x302C +#define EGL_NATIVE_RENDERABLE 0x302D +#define EGL_NATIVE_VISUAL_ID 0x302E +#define EGL_NATIVE_VISUAL_TYPE 0x302F +#define EGL_SAMPLES 0x3031 +#define EGL_SAMPLE_BUFFERS 0x3032 +#define EGL_SURFACE_TYPE 0x3033 +#define EGL_TRANSPARENT_TYPE 0x3034 +#define EGL_TRANSPARENT_BLUE_VALUE 0x3035 +#define EGL_TRANSPARENT_GREEN_VALUE 0x3036 +#define EGL_TRANSPARENT_RED_VALUE 0x3037 +#define EGL_NONE 0x3038 +#define EGL_SLOW_CONFIG 0x3050 +#define EGL_NON_CONFORMANT_CONFIG 0x3051 +#define EGL_TRANSPARENT_RGB 0x3052 +#define EGL_VENDOR 0x3053 +#define EGL_VERSION 0x3054 +#define EGL_EXTENSIONS 0x3055 +#define EGL_HEIGHT 0x3056 +#define EGL_WIDTH 0x3057 +#define EGL_LARGEST_PBUFFER 0x3058 +#define EGL_DRAW 0x3059 +#define EGL_READ 0x305A +#define EGL_CORE_NATIVE_ENGINE 0x305B + +typedef EGLBoolean (EGLAPIENTRY * PFNEGLCHOOSECONFIGPROC) (EGLDisplay dpy, const EGLint * attrib_list, EGLConfig * configs, EGLint config_size, EGLint * num_config); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLCOPYBUFFERSPROC) (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target); +typedef EGLContext (EGLAPIENTRY * PFNEGLCREATECONTEXTPROC) (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint * attrib_list); +typedef EGLSurface (EGLAPIENTRY * PFNEGLCREATEPBUFFERSURFACEPROC) (EGLDisplay dpy, EGLConfig config, const EGLint * attrib_list); +typedef EGLSurface (EGLAPIENTRY * PFNEGLCREATEPIXMAPSURFACEPROC) (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint * attrib_list); +typedef EGLSurface (EGLAPIENTRY * PFNEGLCREATEWINDOWSURFACEPROC) (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint * attrib_list); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLDESTROYCONTEXTPROC) (EGLDisplay dpy, EGLContext ctx); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLDESTROYSURFACEPROC) (EGLDisplay dpy, EGLSurface surface); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLGETCONFIGATTRIBPROC) (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint * value); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLGETCONFIGSPROC) (EGLDisplay dpy, EGLConfig * configs, EGLint config_size, EGLint * num_config); +typedef EGLDisplay (EGLAPIENTRY * PFNEGLGETCURRENTDISPLAYPROC) ( void ); +typedef EGLSurface (EGLAPIENTRY * PFNEGLGETCURRENTSURFACEPROC) (EGLint readdraw); +typedef EGLDisplay (EGLAPIENTRY * PFNEGLGETDISPLAYPROC) (EGLNativeDisplayType display_id); +typedef EGLint (EGLAPIENTRY * PFNEGLGETERRORPROC) ( void ); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLINITIALIZEPROC) (EGLDisplay dpy, EGLint * major, EGLint * minor); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLMAKECURRENTPROC) (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLQUERYCONTEXTPROC) (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint * value); +typedef const char * (EGLAPIENTRY * PFNEGLQUERYSTRINGPROC) (EGLDisplay dpy, EGLint name); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLQUERYSURFACEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint * value); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLSWAPBUFFERSPROC) (EGLDisplay dpy, EGLSurface surface); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLTERMINATEPROC) (EGLDisplay dpy); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLWAITGLPROC) ( void ); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLWAITNATIVEPROC) (EGLint engine); + +#define eglChooseConfig EGLEW_GET_FUN(__eglewChooseConfig) +#define eglCopyBuffers EGLEW_GET_FUN(__eglewCopyBuffers) +#define eglCreateContext EGLEW_GET_FUN(__eglewCreateContext) +#define eglCreatePbufferSurface EGLEW_GET_FUN(__eglewCreatePbufferSurface) +#define eglCreatePixmapSurface EGLEW_GET_FUN(__eglewCreatePixmapSurface) +#define eglCreateWindowSurface EGLEW_GET_FUN(__eglewCreateWindowSurface) +#define eglDestroyContext EGLEW_GET_FUN(__eglewDestroyContext) +#define eglDestroySurface EGLEW_GET_FUN(__eglewDestroySurface) +#define eglGetConfigAttrib EGLEW_GET_FUN(__eglewGetConfigAttrib) +#define eglGetConfigs EGLEW_GET_FUN(__eglewGetConfigs) +#define eglGetCurrentDisplay EGLEW_GET_FUN(__eglewGetCurrentDisplay) +#define eglGetCurrentSurface EGLEW_GET_FUN(__eglewGetCurrentSurface) +#define eglGetDisplay EGLEW_GET_FUN(__eglewGetDisplay) +#define eglGetError EGLEW_GET_FUN(__eglewGetError) +#define eglInitialize EGLEW_GET_FUN(__eglewInitialize) +#define eglMakeCurrent EGLEW_GET_FUN(__eglewMakeCurrent) +#define eglQueryContext EGLEW_GET_FUN(__eglewQueryContext) +#define eglQueryString EGLEW_GET_FUN(__eglewQueryString) +#define eglQuerySurface EGLEW_GET_FUN(__eglewQuerySurface) +#define eglSwapBuffers EGLEW_GET_FUN(__eglewSwapBuffers) +#define eglTerminate EGLEW_GET_FUN(__eglewTerminate) +#define eglWaitGL EGLEW_GET_FUN(__eglewWaitGL) +#define eglWaitNative EGLEW_GET_FUN(__eglewWaitNative) + +#define EGLEW_VERSION_1_0 EGLEW_GET_VAR(__EGLEW_VERSION_1_0) + +#endif /* EGL_VERSION_1_0 */ + +/* ---------------------------- EGL_VERSION_1_1 ---------------------------- */ + +#ifndef EGL_VERSION_1_1 +#define EGL_VERSION_1_1 1 + +#define EGL_CONTEXT_LOST 0x300E +#define EGL_BIND_TO_TEXTURE_RGB 0x3039 +#define EGL_BIND_TO_TEXTURE_RGBA 0x303A +#define EGL_MIN_SWAP_INTERVAL 0x303B +#define EGL_MAX_SWAP_INTERVAL 0x303C +#define EGL_NO_TEXTURE 0x305C +#define EGL_TEXTURE_RGB 0x305D +#define EGL_TEXTURE_RGBA 0x305E +#define EGL_TEXTURE_2D 0x305F +#define EGL_TEXTURE_FORMAT 0x3080 +#define EGL_TEXTURE_TARGET 0x3081 +#define EGL_MIPMAP_TEXTURE 0x3082 +#define EGL_MIPMAP_LEVEL 0x3083 +#define EGL_BACK_BUFFER 0x3084 + +typedef EGLBoolean (EGLAPIENTRY * PFNEGLBINDTEXIMAGEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint buffer); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLRELEASETEXIMAGEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint buffer); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLSURFACEATTRIBPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLSWAPINTERVALPROC) (EGLDisplay dpy, EGLint interval); + +#define eglBindTexImage EGLEW_GET_FUN(__eglewBindTexImage) +#define eglReleaseTexImage EGLEW_GET_FUN(__eglewReleaseTexImage) +#define eglSurfaceAttrib EGLEW_GET_FUN(__eglewSurfaceAttrib) +#define eglSwapInterval EGLEW_GET_FUN(__eglewSwapInterval) + +#define EGLEW_VERSION_1_1 EGLEW_GET_VAR(__EGLEW_VERSION_1_1) + +#endif /* EGL_VERSION_1_1 */ + +/* ---------------------------- EGL_VERSION_1_2 ---------------------------- */ + +#ifndef EGL_VERSION_1_2 +#define EGL_VERSION_1_2 1 + +#define EGL_OPENGL_ES_BIT 0x0001 +#define EGL_OPENVG_BIT 0x0002 +#define EGL_LUMINANCE_SIZE 0x303D +#define EGL_ALPHA_MASK_SIZE 0x303E +#define EGL_COLOR_BUFFER_TYPE 0x303F +#define EGL_RENDERABLE_TYPE 0x3040 +#define EGL_SINGLE_BUFFER 0x3085 +#define EGL_RENDER_BUFFER 0x3086 +#define EGL_COLORSPACE 0x3087 +#define EGL_ALPHA_FORMAT 0x3088 +#define EGL_COLORSPACE_LINEAR 0x308A +#define EGL_ALPHA_FORMAT_NONPRE 0x308B +#define EGL_ALPHA_FORMAT_PRE 0x308C +#define EGL_CLIENT_APIS 0x308D +#define EGL_RGB_BUFFER 0x308E +#define EGL_LUMINANCE_BUFFER 0x308F +#define EGL_HORIZONTAL_RESOLUTION 0x3090 +#define EGL_VERTICAL_RESOLUTION 0x3091 +#define EGL_PIXEL_ASPECT_RATIO 0x3092 +#define EGL_SWAP_BEHAVIOR 0x3093 +#define EGL_BUFFER_PRESERVED 0x3094 +#define EGL_BUFFER_DESTROYED 0x3095 +#define EGL_OPENVG_IMAGE 0x3096 +#define EGL_CONTEXT_CLIENT_TYPE 0x3097 +#define EGL_OPENGL_ES_API 0x30A0 +#define EGL_OPENVG_API 0x30A1 +#define EGL_DISPLAY_SCALING 10000 + +typedef EGLBoolean (EGLAPIENTRY * PFNEGLBINDAPIPROC) (EGLenum api); +typedef EGLSurface (EGLAPIENTRY * PFNEGLCREATEPBUFFERFROMCLIENTBUFFERPROC) (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint * attrib_list); +typedef EGLenum (EGLAPIENTRY * PFNEGLQUERYAPIPROC) ( void ); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLRELEASETHREADPROC) ( void ); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLWAITCLIENTPROC) ( void ); + +#define eglBindAPI EGLEW_GET_FUN(__eglewBindAPI) +#define eglCreatePbufferFromClientBuffer EGLEW_GET_FUN(__eglewCreatePbufferFromClientBuffer) +#define eglQueryAPI EGLEW_GET_FUN(__eglewQueryAPI) +#define eglReleaseThread EGLEW_GET_FUN(__eglewReleaseThread) +#define eglWaitClient EGLEW_GET_FUN(__eglewWaitClient) + +#define EGLEW_VERSION_1_2 EGLEW_GET_VAR(__EGLEW_VERSION_1_2) + +#endif /* EGL_VERSION_1_2 */ + +/* ---------------------------- EGL_VERSION_1_3 ---------------------------- */ + +#ifndef EGL_VERSION_1_3 +#define EGL_VERSION_1_3 1 + +#define EGL_OPENGL_ES2_BIT 0x0004 +#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 +#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 +#define EGL_MATCH_NATIVE_PIXMAP 0x3041 +#define EGL_CONFORMANT 0x3042 +#define EGL_VG_COLORSPACE 0x3087 +#define EGL_VG_ALPHA_FORMAT 0x3088 +#define EGL_VG_COLORSPACE_LINEAR 0x308A +#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B +#define EGL_VG_ALPHA_FORMAT_PRE 0x308C +#define EGL_CONTEXT_CLIENT_VERSION 0x3098 + +#define EGLEW_VERSION_1_3 EGLEW_GET_VAR(__EGLEW_VERSION_1_3) + +#endif /* EGL_VERSION_1_3 */ + +/* ---------------------------- EGL_VERSION_1_4 ---------------------------- */ + +#ifndef EGL_VERSION_1_4 +#define EGL_VERSION_1_4 1 + +#define EGL_OPENGL_BIT 0x0008 +#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 +#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 +#define EGL_MULTISAMPLE_RESOLVE 0x3099 +#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A +#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B +#define EGL_OPENGL_API 0x30A2 + +typedef EGLContext (EGLAPIENTRY * PFNEGLGETCURRENTCONTEXTPROC) ( void ); + +#define eglGetCurrentContext EGLEW_GET_FUN(__eglewGetCurrentContext) + +#define EGLEW_VERSION_1_4 EGLEW_GET_VAR(__EGLEW_VERSION_1_4) + +#endif /* EGL_VERSION_1_4 */ + +/* ---------------------------- EGL_VERSION_1_5 ---------------------------- */ + +#ifndef EGL_VERSION_1_5 +#define EGL_VERSION_1_5 1 + +#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT 0x00000001 +#define EGL_SYNC_FLUSH_COMMANDS_BIT 0x0001 +#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define EGL_OPENGL_ES3_BIT 0x00000040 +#define EGL_GL_COLORSPACE_SRGB 0x3089 +#define EGL_GL_COLORSPACE_LINEAR 0x308A +#define EGL_CONTEXT_MAJOR_VERSION 0x3098 +#define EGL_CL_EVENT_HANDLE 0x309C +#define EGL_GL_COLORSPACE 0x309D +#define EGL_GL_TEXTURE_2D 0x30B1 +#define EGL_GL_TEXTURE_3D 0x30B2 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8 +#define EGL_GL_RENDERBUFFER 0x30B9 +#define EGL_GL_TEXTURE_LEVEL 0x30BC +#define EGL_GL_TEXTURE_ZOFFSET 0x30BD +#define EGL_IMAGE_PRESERVED 0x30D2 +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE 0x30F0 +#define EGL_SYNC_STATUS 0x30F1 +#define EGL_SIGNALED 0x30F2 +#define EGL_UNSIGNALED 0x30F3 +#define EGL_TIMEOUT_EXPIRED 0x30F5 +#define EGL_CONDITION_SATISFIED 0x30F6 +#define EGL_SYNC_TYPE 0x30F7 +#define EGL_SYNC_CONDITION 0x30F8 +#define EGL_SYNC_FENCE 0x30F9 +#define EGL_CONTEXT_MINOR_VERSION 0x30FB +#define EGL_CONTEXT_OPENGL_PROFILE_MASK 0x30FD +#define EGL_SYNC_CL_EVENT 0x30FE +#define EGL_SYNC_CL_EVENT_COMPLETE 0x30FF +#define EGL_CONTEXT_OPENGL_DEBUG 0x31B0 +#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE 0x31B1 +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS 0x31B2 +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD +#define EGL_NO_RESET_NOTIFICATION 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET 0x31BF +#define EGL_FOREVER 0xFFFFFFFFFFFFFFFF + +typedef EGLint (EGLAPIENTRY * PFNEGLCLIENTWAITSYNCPROC) (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout); +typedef EGLImage (EGLAPIENTRY * PFNEGLCREATEIMAGEPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib * attrib_list); +typedef EGLSurface (EGLAPIENTRY * PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC) (EGLDisplay dpy, EGLConfig config, void * native_pixmap, const EGLAttrib * attrib_list); +typedef EGLSurface (EGLAPIENTRY * PFNEGLCREATEPLATFORMWINDOWSURFACEPROC) (EGLDisplay dpy, EGLConfig config, void * native_window, const EGLAttrib * attrib_list); +typedef EGLSync (EGLAPIENTRY * PFNEGLCREATESYNCPROC) (EGLDisplay dpy, EGLenum type, const EGLAttrib * attrib_list); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLDESTROYIMAGEPROC) (EGLDisplay dpy, EGLImage image); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLDESTROYSYNCPROC) (EGLDisplay dpy, EGLSync sync); +typedef EGLDisplay (EGLAPIENTRY * PFNEGLGETPLATFORMDISPLAYPROC) (EGLenum platform, void * native_display, const EGLAttrib * attrib_list); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLGETSYNCATTRIBPROC) (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib * value); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLWAITSYNCPROC) (EGLDisplay dpy, EGLSync sync, EGLint flags); + +#define eglClientWaitSync EGLEW_GET_FUN(__eglewClientWaitSync) +#define eglCreateImage EGLEW_GET_FUN(__eglewCreateImage) +#define eglCreatePlatformPixmapSurface EGLEW_GET_FUN(__eglewCreatePlatformPixmapSurface) +#define eglCreatePlatformWindowSurface EGLEW_GET_FUN(__eglewCreatePlatformWindowSurface) +#define eglCreateSync EGLEW_GET_FUN(__eglewCreateSync) +#define eglDestroyImage EGLEW_GET_FUN(__eglewDestroyImage) +#define eglDestroySync EGLEW_GET_FUN(__eglewDestroySync) +#define eglGetPlatformDisplay EGLEW_GET_FUN(__eglewGetPlatformDisplay) +#define eglGetSyncAttrib EGLEW_GET_FUN(__eglewGetSyncAttrib) +#define eglWaitSync EGLEW_GET_FUN(__eglewWaitSync) + +#define EGLEW_VERSION_1_5 EGLEW_GET_VAR(__EGLEW_VERSION_1_5) + +#endif /* EGL_VERSION_1_5 */ + +/* ------------------------- EGL_ANDROID_blob_cache ------------------------ */ + +#ifndef EGL_ANDROID_blob_cache +#define EGL_ANDROID_blob_cache 1 + +typedef void (EGLAPIENTRY * PFNEGLSETBLOBCACHEFUNCSANDROIDPROC) (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get); + +#define eglSetBlobCacheFuncsANDROID EGLEW_GET_FUN(__eglewSetBlobCacheFuncsANDROID) + +#define EGLEW_ANDROID_blob_cache EGLEW_GET_VAR(__EGLEW_ANDROID_blob_cache) + +#endif /* EGL_ANDROID_blob_cache */ + +/* ---------------- EGL_ANDROID_create_native_client_buffer ---------------- */ + +#ifndef EGL_ANDROID_create_native_client_buffer +#define EGL_ANDROID_create_native_client_buffer 1 + +#define EGL_NATIVE_BUFFER_USAGE_PROTECTED_BIT_ANDROID 0x00000001 +#define EGL_NATIVE_BUFFER_USAGE_RENDERBUFFER_BIT_ANDROID 0x00000002 +#define EGL_NATIVE_BUFFER_USAGE_TEXTURE_BIT_ANDROID 0x00000004 +#define EGL_NATIVE_BUFFER_USAGE_ANDROID 0x3143 + +typedef EGLClientBuffer (EGLAPIENTRY * PFNEGLCREATENATIVECLIENTBUFFERANDROIDPROC) (const EGLint * attrib_list); + +#define eglCreateNativeClientBufferANDROID EGLEW_GET_FUN(__eglewCreateNativeClientBufferANDROID) + +#define EGLEW_ANDROID_create_native_client_buffer EGLEW_GET_VAR(__EGLEW_ANDROID_create_native_client_buffer) + +#endif /* EGL_ANDROID_create_native_client_buffer */ + +/* --------------------- EGL_ANDROID_framebuffer_target -------------------- */ + +#ifndef EGL_ANDROID_framebuffer_target +#define EGL_ANDROID_framebuffer_target 1 + +#define EGL_FRAMEBUFFER_TARGET_ANDROID 0x3147 + +#define EGLEW_ANDROID_framebuffer_target EGLEW_GET_VAR(__EGLEW_ANDROID_framebuffer_target) + +#endif /* EGL_ANDROID_framebuffer_target */ + +/* ----------------- EGL_ANDROID_front_buffer_auto_refresh ----------------- */ + +#ifndef EGL_ANDROID_front_buffer_auto_refresh +#define EGL_ANDROID_front_buffer_auto_refresh 1 + +#define EGL_FRONT_BUFFER_AUTO_REFRESH_ANDROID 0x314C + +#define EGLEW_ANDROID_front_buffer_auto_refresh EGLEW_GET_VAR(__EGLEW_ANDROID_front_buffer_auto_refresh) + +#endif /* EGL_ANDROID_front_buffer_auto_refresh */ + +/* -------------------- EGL_ANDROID_image_native_buffer -------------------- */ + +#ifndef EGL_ANDROID_image_native_buffer +#define EGL_ANDROID_image_native_buffer 1 + +#define EGL_NATIVE_BUFFER_ANDROID 0x3140 + +#define EGLEW_ANDROID_image_native_buffer EGLEW_GET_VAR(__EGLEW_ANDROID_image_native_buffer) + +#endif /* EGL_ANDROID_image_native_buffer */ + +/* --------------------- EGL_ANDROID_native_fence_sync --------------------- */ + +#ifndef EGL_ANDROID_native_fence_sync +#define EGL_ANDROID_native_fence_sync 1 + +#define EGL_SYNC_NATIVE_FENCE_ANDROID 0x3144 +#define EGL_SYNC_NATIVE_FENCE_FD_ANDROID 0x3145 +#define EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID 0x3146 + +typedef EGLint (EGLAPIENTRY * PFNEGLDUPNATIVEFENCEFDANDROIDPROC) (EGLDisplay dpy, EGLSyncKHR sync); + +#define eglDupNativeFenceFDANDROID EGLEW_GET_FUN(__eglewDupNativeFenceFDANDROID) + +#define EGLEW_ANDROID_native_fence_sync EGLEW_GET_VAR(__EGLEW_ANDROID_native_fence_sync) + +#endif /* EGL_ANDROID_native_fence_sync */ + +/* --------------------- EGL_ANDROID_presentation_time --------------------- */ + +#ifndef EGL_ANDROID_presentation_time +#define EGL_ANDROID_presentation_time 1 + +typedef EGLBoolean (EGLAPIENTRY * PFNEGLPRESENTATIONTIMEANDROIDPROC) (EGLDisplay dpy, EGLSurface surface, EGLnsecsANDROID time); + +#define eglPresentationTimeANDROID EGLEW_GET_FUN(__eglewPresentationTimeANDROID) + +#define EGLEW_ANDROID_presentation_time EGLEW_GET_VAR(__EGLEW_ANDROID_presentation_time) + +#endif /* EGL_ANDROID_presentation_time */ + +/* ------------------------- EGL_ANDROID_recordable ------------------------ */ + +#ifndef EGL_ANDROID_recordable +#define EGL_ANDROID_recordable 1 + +#define EGL_RECORDABLE_ANDROID 0x3142 + +#define EGLEW_ANDROID_recordable EGLEW_GET_VAR(__EGLEW_ANDROID_recordable) + +#endif /* EGL_ANDROID_recordable */ + +/* ---------------- EGL_ANGLE_d3d_share_handle_client_buffer --------------- */ + +#ifndef EGL_ANGLE_d3d_share_handle_client_buffer +#define EGL_ANGLE_d3d_share_handle_client_buffer 1 + +#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200 + +#define EGLEW_ANGLE_d3d_share_handle_client_buffer EGLEW_GET_VAR(__EGLEW_ANGLE_d3d_share_handle_client_buffer) + +#endif /* EGL_ANGLE_d3d_share_handle_client_buffer */ + +/* -------------------------- EGL_ANGLE_device_d3d ------------------------- */ + +#ifndef EGL_ANGLE_device_d3d +#define EGL_ANGLE_device_d3d 1 + +#define EGL_D3D9_DEVICE_ANGLE 0x33A0 +#define EGL_D3D11_DEVICE_ANGLE 0x33A1 + +#define EGLEW_ANGLE_device_d3d EGLEW_GET_VAR(__EGLEW_ANGLE_device_d3d) + +#endif /* EGL_ANGLE_device_d3d */ + +/* -------------------- EGL_ANGLE_query_surface_pointer -------------------- */ + +#ifndef EGL_ANGLE_query_surface_pointer +#define EGL_ANGLE_query_surface_pointer 1 + +typedef EGLBoolean (EGLAPIENTRY * PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void ** value); + +#define eglQuerySurfacePointerANGLE EGLEW_GET_FUN(__eglewQuerySurfacePointerANGLE) + +#define EGLEW_ANGLE_query_surface_pointer EGLEW_GET_VAR(__EGLEW_ANGLE_query_surface_pointer) + +#endif /* EGL_ANGLE_query_surface_pointer */ + +/* ------------- EGL_ANGLE_surface_d3d_texture_2d_share_handle ------------- */ + +#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle +#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1 + +#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200 + +#define EGLEW_ANGLE_surface_d3d_texture_2d_share_handle EGLEW_GET_VAR(__EGLEW_ANGLE_surface_d3d_texture_2d_share_handle) + +#endif /* EGL_ANGLE_surface_d3d_texture_2d_share_handle */ + +/* ---------------------- EGL_ANGLE_window_fixed_size ---------------------- */ + +#ifndef EGL_ANGLE_window_fixed_size +#define EGL_ANGLE_window_fixed_size 1 + +#define EGL_FIXED_SIZE_ANGLE 0x3201 + +#define EGLEW_ANGLE_window_fixed_size EGLEW_GET_VAR(__EGLEW_ANGLE_window_fixed_size) + +#endif /* EGL_ANGLE_window_fixed_size */ + +/* --------------------- EGL_ARM_implicit_external_sync -------------------- */ + +#ifndef EGL_ARM_implicit_external_sync +#define EGL_ARM_implicit_external_sync 1 + +#define EGL_SYNC_PRIOR_COMMANDS_IMPLICIT_EXTERNAL_ARM 0x328A + +#define EGLEW_ARM_implicit_external_sync EGLEW_GET_VAR(__EGLEW_ARM_implicit_external_sync) + +#endif /* EGL_ARM_implicit_external_sync */ + +/* ------------------- EGL_ARM_pixmap_multisample_discard ------------------ */ + +#ifndef EGL_ARM_pixmap_multisample_discard +#define EGL_ARM_pixmap_multisample_discard 1 + +#define EGL_DISCARD_SAMPLES_ARM 0x3286 + +#define EGLEW_ARM_pixmap_multisample_discard EGLEW_GET_VAR(__EGLEW_ARM_pixmap_multisample_discard) + +#endif /* EGL_ARM_pixmap_multisample_discard */ + +/* --------------------------- EGL_EXT_buffer_age -------------------------- */ + +#ifndef EGL_EXT_buffer_age +#define EGL_EXT_buffer_age 1 + +#define EGL_BUFFER_AGE_EXT 0x313D + +#define EGLEW_EXT_buffer_age EGLEW_GET_VAR(__EGLEW_EXT_buffer_age) + +#endif /* EGL_EXT_buffer_age */ + +/* ----------------------- EGL_EXT_client_extensions ----------------------- */ + +#ifndef EGL_EXT_client_extensions +#define EGL_EXT_client_extensions 1 + +#define EGLEW_EXT_client_extensions EGLEW_GET_VAR(__EGLEW_EXT_client_extensions) + +#endif /* EGL_EXT_client_extensions */ + +/* ------------------- EGL_EXT_create_context_robustness ------------------- */ + +#ifndef EGL_EXT_create_context_robustness +#define EGL_EXT_create_context_robustness 1 + +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138 +#define EGL_NO_RESET_NOTIFICATION_EXT 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET_EXT 0x31BF + +#define EGLEW_EXT_create_context_robustness EGLEW_GET_VAR(__EGLEW_EXT_create_context_robustness) + +#endif /* EGL_EXT_create_context_robustness */ + +/* -------------------------- EGL_EXT_device_base -------------------------- */ + +#ifndef EGL_EXT_device_base +#define EGL_EXT_device_base 1 + +#define EGL_BAD_DEVICE_EXT 0x322B +#define EGL_DEVICE_EXT 0x322C + +#define EGLEW_EXT_device_base EGLEW_GET_VAR(__EGLEW_EXT_device_base) + +#endif /* EGL_EXT_device_base */ + +/* --------------------------- EGL_EXT_device_drm -------------------------- */ + +#ifndef EGL_EXT_device_drm +#define EGL_EXT_device_drm 1 + +#define EGL_DRM_DEVICE_FILE_EXT 0x3233 + +#define EGLEW_EXT_device_drm EGLEW_GET_VAR(__EGLEW_EXT_device_drm) + +#endif /* EGL_EXT_device_drm */ + +/* ----------------------- EGL_EXT_device_enumeration ---------------------- */ + +#ifndef EGL_EXT_device_enumeration +#define EGL_EXT_device_enumeration 1 + +typedef EGLBoolean (EGLAPIENTRY * PFNEGLQUERYDEVICESEXTPROC) (EGLint max_devices, EGLDeviceEXT * devices, EGLint * num_devices); + +#define eglQueryDevicesEXT EGLEW_GET_FUN(__eglewQueryDevicesEXT) + +#define EGLEW_EXT_device_enumeration EGLEW_GET_VAR(__EGLEW_EXT_device_enumeration) + +#endif /* EGL_EXT_device_enumeration */ + +/* ------------------------- EGL_EXT_device_openwf ------------------------- */ + +#ifndef EGL_EXT_device_openwf +#define EGL_EXT_device_openwf 1 + +#define EGL_OPENWF_DEVICE_ID_EXT 0x3237 + +#define EGLEW_EXT_device_openwf EGLEW_GET_VAR(__EGLEW_EXT_device_openwf) + +#endif /* EGL_EXT_device_openwf */ + +/* -------------------------- EGL_EXT_device_query ------------------------- */ + +#ifndef EGL_EXT_device_query +#define EGL_EXT_device_query 1 + +#define EGL_BAD_DEVICE_EXT 0x322B +#define EGL_DEVICE_EXT 0x322C + +typedef EGLBoolean (EGLAPIENTRY * PFNEGLQUERYDEVICEATTRIBEXTPROC) (EGLDeviceEXT device, EGLint attribute, EGLAttrib * value); +typedef const char * (EGLAPIENTRY * PFNEGLQUERYDEVICESTRINGEXTPROC) (EGLDeviceEXT device, EGLint name); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLQUERYDISPLAYATTRIBEXTPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib * value); + +#define eglQueryDeviceAttribEXT EGLEW_GET_FUN(__eglewQueryDeviceAttribEXT) +#define eglQueryDeviceStringEXT EGLEW_GET_FUN(__eglewQueryDeviceStringEXT) +#define eglQueryDisplayAttribEXT EGLEW_GET_FUN(__eglewQueryDisplayAttribEXT) + +#define EGLEW_EXT_device_query EGLEW_GET_VAR(__EGLEW_EXT_device_query) + +#endif /* EGL_EXT_device_query */ + +/* ------------------ EGL_EXT_gl_colorspace_bt2020_linear ------------------ */ + +#ifndef EGL_EXT_gl_colorspace_bt2020_linear +#define EGL_EXT_gl_colorspace_bt2020_linear 1 + +#define EGL_GL_COLORSPACE_BT2020_LINEAR_EXT 0x333F + +#define EGLEW_EXT_gl_colorspace_bt2020_linear EGLEW_GET_VAR(__EGLEW_EXT_gl_colorspace_bt2020_linear) + +#endif /* EGL_EXT_gl_colorspace_bt2020_linear */ + +/* -------------------- EGL_EXT_gl_colorspace_bt2020_pq -------------------- */ + +#ifndef EGL_EXT_gl_colorspace_bt2020_pq +#define EGL_EXT_gl_colorspace_bt2020_pq 1 + +#define EGL_GL_COLORSPACE_BT2020_PQ_EXT 0x3340 + +#define EGLEW_EXT_gl_colorspace_bt2020_pq EGLEW_GET_VAR(__EGLEW_EXT_gl_colorspace_bt2020_pq) + +#endif /* EGL_EXT_gl_colorspace_bt2020_pq */ + +/* ------------------- EGL_EXT_gl_colorspace_scrgb_linear ------------------ */ + +#ifndef EGL_EXT_gl_colorspace_scrgb_linear +#define EGL_EXT_gl_colorspace_scrgb_linear 1 + +#define EGL_GL_COLORSPACE_SCRGB_LINEAR_EXT 0x3350 + +#define EGLEW_EXT_gl_colorspace_scrgb_linear EGLEW_GET_VAR(__EGLEW_EXT_gl_colorspace_scrgb_linear) + +#endif /* EGL_EXT_gl_colorspace_scrgb_linear */ + +/* ---------------------- EGL_EXT_image_dma_buf_import --------------------- */ + +#ifndef EGL_EXT_image_dma_buf_import +#define EGL_EXT_image_dma_buf_import 1 + +#define EGL_LINUX_DMA_BUF_EXT 0x3270 +#define EGL_LINUX_DRM_FOURCC_EXT 0x3271 +#define EGL_DMA_BUF_PLANE0_FD_EXT 0x3272 +#define EGL_DMA_BUF_PLANE0_OFFSET_EXT 0x3273 +#define EGL_DMA_BUF_PLANE0_PITCH_EXT 0x3274 +#define EGL_DMA_BUF_PLANE1_FD_EXT 0x3275 +#define EGL_DMA_BUF_PLANE1_OFFSET_EXT 0x3276 +#define EGL_DMA_BUF_PLANE1_PITCH_EXT 0x3277 +#define EGL_DMA_BUF_PLANE2_FD_EXT 0x3278 +#define EGL_DMA_BUF_PLANE2_OFFSET_EXT 0x3279 +#define EGL_DMA_BUF_PLANE2_PITCH_EXT 0x327A +#define EGL_YUV_COLOR_SPACE_HINT_EXT 0x327B +#define EGL_SAMPLE_RANGE_HINT_EXT 0x327C +#define EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT 0x327D +#define EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT 0x327E +#define EGL_ITU_REC601_EXT 0x327F +#define EGL_ITU_REC709_EXT 0x3280 +#define EGL_ITU_REC2020_EXT 0x3281 +#define EGL_YUV_FULL_RANGE_EXT 0x3282 +#define EGL_YUV_NARROW_RANGE_EXT 0x3283 +#define EGL_YUV_CHROMA_SITING_0_EXT 0x3284 +#define EGL_YUV_CHROMA_SITING_0_5_EXT 0x3285 + +#define EGLEW_EXT_image_dma_buf_import EGLEW_GET_VAR(__EGLEW_EXT_image_dma_buf_import) + +#endif /* EGL_EXT_image_dma_buf_import */ + +/* ----------------- EGL_EXT_image_dma_buf_import_modifiers ---------------- */ + +#ifndef EGL_EXT_image_dma_buf_import_modifiers +#define EGL_EXT_image_dma_buf_import_modifiers 1 + +#define EGL_DMA_BUF_PLANE3_FD_EXT 0x3440 +#define EGL_DMA_BUF_PLANE3_OFFSET_EXT 0x3441 +#define EGL_DMA_BUF_PLANE3_PITCH_EXT 0x3442 +#define EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT 0x3443 +#define EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT 0x3444 +#define EGL_DMA_BUF_PLANE1_MODIFIER_LO_EXT 0x3445 +#define EGL_DMA_BUF_PLANE1_MODIFIER_HI_EXT 0x3446 +#define EGL_DMA_BUF_PLANE2_MODIFIER_LO_EXT 0x3447 +#define EGL_DMA_BUF_PLANE2_MODIFIER_HI_EXT 0x3448 +#define EGL_DMA_BUF_PLANE3_MODIFIER_LO_EXT 0x3449 +#define EGL_DMA_BUF_PLANE3_MODIFIER_HI_EXT 0x344A + +typedef EGLBoolean (EGLAPIENTRY * PFNEGLQUERYDMABUFFORMATSEXTPROC) (EGLDisplay dpy, EGLint max_formats, EGLint *formats, EGLint *num_formats); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLQUERYDMABUFMODIFIERSEXTPROC) (EGLDisplay dpy, EGLint format, EGLint max_modifiers, EGLuint64KHR *modifiers, EGLBoolean *external_only, EGLint *num_modifiers); + +#define eglQueryDmaBufFormatsEXT EGLEW_GET_FUN(__eglewQueryDmaBufFormatsEXT) +#define eglQueryDmaBufModifiersEXT EGLEW_GET_FUN(__eglewQueryDmaBufModifiersEXT) + +#define EGLEW_EXT_image_dma_buf_import_modifiers EGLEW_GET_VAR(__EGLEW_EXT_image_dma_buf_import_modifiers) + +#endif /* EGL_EXT_image_dma_buf_import_modifiers */ + +/* ------------------------ EGL_EXT_multiview_window ----------------------- */ + +#ifndef EGL_EXT_multiview_window +#define EGL_EXT_multiview_window 1 + +#define EGL_MULTIVIEW_VIEW_COUNT_EXT 0x3134 + +#define EGLEW_EXT_multiview_window EGLEW_GET_VAR(__EGLEW_EXT_multiview_window) + +#endif /* EGL_EXT_multiview_window */ + +/* -------------------------- EGL_EXT_output_base -------------------------- */ + +#ifndef EGL_EXT_output_base +#define EGL_EXT_output_base 1 + +#define EGL_BAD_OUTPUT_LAYER_EXT 0x322D +#define EGL_BAD_OUTPUT_PORT_EXT 0x322E +#define EGL_SWAP_INTERVAL_EXT 0x322F + +typedef EGLBoolean (EGLAPIENTRY * PFNEGLGETOUTPUTLAYERSEXTPROC) (EGLDisplay dpy, const EGLAttrib * attrib_list, EGLOutputLayerEXT * layers, EGLint max_layers, EGLint * num_layers); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLGETOUTPUTPORTSEXTPROC) (EGLDisplay dpy, const EGLAttrib * attrib_list, EGLOutputPortEXT * ports, EGLint max_ports, EGLint * num_ports); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib value); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib * value); +typedef const char * (EGLAPIENTRY * PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib * value); +typedef const char * (EGLAPIENTRY * PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name); + +#define eglGetOutputLayersEXT EGLEW_GET_FUN(__eglewGetOutputLayersEXT) +#define eglGetOutputPortsEXT EGLEW_GET_FUN(__eglewGetOutputPortsEXT) +#define eglOutputLayerAttribEXT EGLEW_GET_FUN(__eglewOutputLayerAttribEXT) +#define eglOutputPortAttribEXT EGLEW_GET_FUN(__eglewOutputPortAttribEXT) +#define eglQueryOutputLayerAttribEXT EGLEW_GET_FUN(__eglewQueryOutputLayerAttribEXT) +#define eglQueryOutputLayerStringEXT EGLEW_GET_FUN(__eglewQueryOutputLayerStringEXT) +#define eglQueryOutputPortAttribEXT EGLEW_GET_FUN(__eglewQueryOutputPortAttribEXT) +#define eglQueryOutputPortStringEXT EGLEW_GET_FUN(__eglewQueryOutputPortStringEXT) + +#define EGLEW_EXT_output_base EGLEW_GET_VAR(__EGLEW_EXT_output_base) + +#endif /* EGL_EXT_output_base */ + +/* --------------------------- EGL_EXT_output_drm -------------------------- */ + +#ifndef EGL_EXT_output_drm +#define EGL_EXT_output_drm 1 + +#define EGL_DRM_CRTC_EXT 0x3234 +#define EGL_DRM_PLANE_EXT 0x3235 +#define EGL_DRM_CONNECTOR_EXT 0x3236 + +#define EGLEW_EXT_output_drm EGLEW_GET_VAR(__EGLEW_EXT_output_drm) + +#endif /* EGL_EXT_output_drm */ + +/* ------------------------- EGL_EXT_output_openwf ------------------------- */ + +#ifndef EGL_EXT_output_openwf +#define EGL_EXT_output_openwf 1 + +#define EGL_OPENWF_PIPELINE_ID_EXT 0x3238 +#define EGL_OPENWF_PORT_ID_EXT 0x3239 + +#define EGLEW_EXT_output_openwf EGLEW_GET_VAR(__EGLEW_EXT_output_openwf) + +#endif /* EGL_EXT_output_openwf */ + +/* ----------------------- EGL_EXT_pixel_format_float ---------------------- */ + +#ifndef EGL_EXT_pixel_format_float +#define EGL_EXT_pixel_format_float 1 + +#define EGL_COLOR_COMPONENT_TYPE_EXT 0x3339 +#define EGL_COLOR_COMPONENT_TYPE_FIXED_EXT 0x333A +#define EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT 0x333B + +#define EGLEW_EXT_pixel_format_float EGLEW_GET_VAR(__EGLEW_EXT_pixel_format_float) + +#endif /* EGL_EXT_pixel_format_float */ + +/* ------------------------- EGL_EXT_platform_base ------------------------- */ + +#ifndef EGL_EXT_platform_base +#define EGL_EXT_platform_base 1 + +typedef EGLSurface (EGLAPIENTRY * PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void * native_pixmap, const EGLint * attrib_list); +typedef EGLSurface (EGLAPIENTRY * PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void * native_window, const EGLint * attrib_list); +typedef EGLDisplay (EGLAPIENTRY * PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLenum platform, void * native_display, const EGLint * attrib_list); + +#define eglCreatePlatformPixmapSurfaceEXT EGLEW_GET_FUN(__eglewCreatePlatformPixmapSurfaceEXT) +#define eglCreatePlatformWindowSurfaceEXT EGLEW_GET_FUN(__eglewCreatePlatformWindowSurfaceEXT) +#define eglGetPlatformDisplayEXT EGLEW_GET_FUN(__eglewGetPlatformDisplayEXT) + +#define EGLEW_EXT_platform_base EGLEW_GET_VAR(__EGLEW_EXT_platform_base) + +#endif /* EGL_EXT_platform_base */ + +/* ------------------------ EGL_EXT_platform_device ------------------------ */ + +#ifndef EGL_EXT_platform_device +#define EGL_EXT_platform_device 1 + +#define EGL_PLATFORM_DEVICE_EXT 0x313F + +#define EGLEW_EXT_platform_device EGLEW_GET_VAR(__EGLEW_EXT_platform_device) + +#endif /* EGL_EXT_platform_device */ + +/* ------------------------ EGL_EXT_platform_wayland ----------------------- */ + +#ifndef EGL_EXT_platform_wayland +#define EGL_EXT_platform_wayland 1 + +#define EGL_PLATFORM_WAYLAND_EXT 0x31D8 + +#define EGLEW_EXT_platform_wayland EGLEW_GET_VAR(__EGLEW_EXT_platform_wayland) + +#endif /* EGL_EXT_platform_wayland */ + +/* -------------------------- EGL_EXT_platform_x11 ------------------------- */ + +#ifndef EGL_EXT_platform_x11 +#define EGL_EXT_platform_x11 1 + +#define EGL_PLATFORM_X11_EXT 0x31D5 +#define EGL_PLATFORM_X11_SCREEN_EXT 0x31D6 + +#define EGLEW_EXT_platform_x11 EGLEW_GET_VAR(__EGLEW_EXT_platform_x11) + +#endif /* EGL_EXT_platform_x11 */ + +/* ----------------------- EGL_EXT_protected_content ----------------------- */ + +#ifndef EGL_EXT_protected_content +#define EGL_EXT_protected_content 1 + +#define EGL_PROTECTED_CONTENT_EXT 0x32C0 + +#define EGLEW_EXT_protected_content EGLEW_GET_VAR(__EGLEW_EXT_protected_content) + +#endif /* EGL_EXT_protected_content */ + +/* ----------------------- EGL_EXT_protected_surface ----------------------- */ + +#ifndef EGL_EXT_protected_surface +#define EGL_EXT_protected_surface 1 + +#define EGL_PROTECTED_CONTENT_EXT 0x32C0 + +#define EGLEW_EXT_protected_surface EGLEW_GET_VAR(__EGLEW_EXT_protected_surface) + +#endif /* EGL_EXT_protected_surface */ + +/* ------------------- EGL_EXT_stream_consumer_egloutput ------------------- */ + +#ifndef EGL_EXT_stream_consumer_egloutput +#define EGL_EXT_stream_consumer_egloutput 1 + +typedef EGLBoolean (EGLAPIENTRY * PFNEGLSTREAMCONSUMEROUTPUTEXTPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer); + +#define eglStreamConsumerOutputEXT EGLEW_GET_FUN(__eglewStreamConsumerOutputEXT) + +#define EGLEW_EXT_stream_consumer_egloutput EGLEW_GET_VAR(__EGLEW_EXT_stream_consumer_egloutput) + +#endif /* EGL_EXT_stream_consumer_egloutput */ + +/* ------------------- EGL_EXT_surface_SMPTE2086_metadata ------------------ */ + +#ifndef EGL_EXT_surface_SMPTE2086_metadata +#define EGL_EXT_surface_SMPTE2086_metadata 1 + +#define EGL_SMPTE2086_DISPLAY_PRIMARY_RX_EXT 0x3341 +#define EGL_SMPTE2086_DISPLAY_PRIMARY_RY_EXT 0x3342 +#define EGL_SMPTE2086_DISPLAY_PRIMARY_GX_EXT 0x3343 +#define EGL_SMPTE2086_DISPLAY_PRIMARY_GY_EXT 0x3344 +#define EGL_SMPTE2086_DISPLAY_PRIMARY_BX_EXT 0x3345 +#define EGL_SMPTE2086_DISPLAY_PRIMARY_BY_EXT 0x3346 +#define EGL_SMPTE2086_WHITE_POINT_X_EXT 0x3347 +#define EGL_SMPTE2086_WHITE_POINT_Y_EXT 0x3348 +#define EGL_SMPTE2086_MAX_LUMINANCE_EXT 0x3349 +#define EGL_SMPTE2086_MIN_LUMINANCE_EXT 0x334A + +#define EGLEW_EXT_surface_SMPTE2086_metadata EGLEW_GET_VAR(__EGLEW_EXT_surface_SMPTE2086_metadata) + +#endif /* EGL_EXT_surface_SMPTE2086_metadata */ + +/* -------------------- EGL_EXT_swap_buffers_with_damage ------------------- */ + +#ifndef EGL_EXT_swap_buffers_with_damage +#define EGL_EXT_swap_buffers_with_damage 1 + +typedef EGLBoolean (EGLAPIENTRY * PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, EGLint * rects, EGLint n_rects); + +#define eglSwapBuffersWithDamageEXT EGLEW_GET_FUN(__eglewSwapBuffersWithDamageEXT) + +#define EGLEW_EXT_swap_buffers_with_damage EGLEW_GET_VAR(__EGLEW_EXT_swap_buffers_with_damage) + +#endif /* EGL_EXT_swap_buffers_with_damage */ + +/* -------------------------- EGL_EXT_yuv_surface -------------------------- */ + +#ifndef EGL_EXT_yuv_surface +#define EGL_EXT_yuv_surface 1 + +#define EGL_YUV_BUFFER_EXT 0x3300 +#define EGL_YUV_ORDER_EXT 0x3301 +#define EGL_YUV_ORDER_YUV_EXT 0x3302 +#define EGL_YUV_ORDER_YVU_EXT 0x3303 +#define EGL_YUV_ORDER_YUYV_EXT 0x3304 +#define EGL_YUV_ORDER_UYVY_EXT 0x3305 +#define EGL_YUV_ORDER_YVYU_EXT 0x3306 +#define EGL_YUV_ORDER_VYUY_EXT 0x3307 +#define EGL_YUV_ORDER_AYUV_EXT 0x3308 +#define EGL_YUV_CSC_STANDARD_EXT 0x330A +#define EGL_YUV_CSC_STANDARD_601_EXT 0x330B +#define EGL_YUV_CSC_STANDARD_709_EXT 0x330C +#define EGL_YUV_CSC_STANDARD_2020_EXT 0x330D +#define EGL_YUV_NUMBER_OF_PLANES_EXT 0x3311 +#define EGL_YUV_SUBSAMPLE_EXT 0x3312 +#define EGL_YUV_SUBSAMPLE_4_2_0_EXT 0x3313 +#define EGL_YUV_SUBSAMPLE_4_2_2_EXT 0x3314 +#define EGL_YUV_SUBSAMPLE_4_4_4_EXT 0x3315 +#define EGL_YUV_DEPTH_RANGE_EXT 0x3317 +#define EGL_YUV_DEPTH_RANGE_LIMITED_EXT 0x3318 +#define EGL_YUV_DEPTH_RANGE_FULL_EXT 0x3319 +#define EGL_YUV_PLANE_BPP_EXT 0x331A +#define EGL_YUV_PLANE_BPP_0_EXT 0x331B +#define EGL_YUV_PLANE_BPP_8_EXT 0x331C +#define EGL_YUV_PLANE_BPP_10_EXT 0x331D + +#define EGLEW_EXT_yuv_surface EGLEW_GET_VAR(__EGLEW_EXT_yuv_surface) + +#endif /* EGL_EXT_yuv_surface */ + +/* -------------------------- EGL_HI_clientpixmap -------------------------- */ + +#ifndef EGL_HI_clientpixmap +#define EGL_HI_clientpixmap 1 + +#define EGL_CLIENT_PIXMAP_POINTER_HI 0x8F74 + +typedef EGLSurface (EGLAPIENTRY * PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI * pixmap); + +#define eglCreatePixmapSurfaceHI EGLEW_GET_FUN(__eglewCreatePixmapSurfaceHI) + +#define EGLEW_HI_clientpixmap EGLEW_GET_VAR(__EGLEW_HI_clientpixmap) + +#endif /* EGL_HI_clientpixmap */ + +/* -------------------------- EGL_HI_colorformats -------------------------- */ + +#ifndef EGL_HI_colorformats +#define EGL_HI_colorformats 1 + +#define EGL_COLOR_FORMAT_HI 0x8F70 +#define EGL_COLOR_RGB_HI 0x8F71 +#define EGL_COLOR_RGBA_HI 0x8F72 +#define EGL_COLOR_ARGB_HI 0x8F73 + +#define EGLEW_HI_colorformats EGLEW_GET_VAR(__EGLEW_HI_colorformats) + +#endif /* EGL_HI_colorformats */ + +/* ------------------------ EGL_IMG_context_priority ----------------------- */ + +#ifndef EGL_IMG_context_priority +#define EGL_IMG_context_priority 1 + +#define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100 +#define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101 +#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102 +#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103 + +#define EGLEW_IMG_context_priority EGLEW_GET_VAR(__EGLEW_IMG_context_priority) + +#endif /* EGL_IMG_context_priority */ + +/* ---------------------- EGL_IMG_image_plane_attribs ---------------------- */ + +#ifndef EGL_IMG_image_plane_attribs +#define EGL_IMG_image_plane_attribs 1 + +#define EGL_NATIVE_BUFFER_MULTIPLANE_SEPARATE_IMG 0x3105 +#define EGL_NATIVE_BUFFER_PLANE_OFFSET_IMG 0x3106 + +#define EGLEW_IMG_image_plane_attribs EGLEW_GET_VAR(__EGLEW_IMG_image_plane_attribs) + +#endif /* EGL_IMG_image_plane_attribs */ + +/* ---------------------------- EGL_KHR_cl_event --------------------------- */ + +#ifndef EGL_KHR_cl_event +#define EGL_KHR_cl_event 1 + +#define EGL_CL_EVENT_HANDLE_KHR 0x309C +#define EGL_SYNC_CL_EVENT_KHR 0x30FE +#define EGL_SYNC_CL_EVENT_COMPLETE_KHR 0x30FF + +#define EGLEW_KHR_cl_event EGLEW_GET_VAR(__EGLEW_KHR_cl_event) + +#endif /* EGL_KHR_cl_event */ + +/* --------------------------- EGL_KHR_cl_event2 --------------------------- */ + +#ifndef EGL_KHR_cl_event2 +#define EGL_KHR_cl_event2 1 + +#define EGL_CL_EVENT_HANDLE_KHR 0x309C +#define EGL_SYNC_CL_EVENT_KHR 0x30FE +#define EGL_SYNC_CL_EVENT_COMPLETE_KHR 0x30FF + +typedef EGLSyncKHR (EGLAPIENTRY * PFNEGLCREATESYNC64KHRPROC) (EGLDisplay dpy, EGLenum type, const EGLAttribKHR * attrib_list); + +#define eglCreateSync64KHR EGLEW_GET_FUN(__eglewCreateSync64KHR) + +#define EGLEW_KHR_cl_event2 EGLEW_GET_VAR(__EGLEW_KHR_cl_event2) + +#endif /* EGL_KHR_cl_event2 */ + +/* ----------------- EGL_KHR_client_get_all_proc_addresses ----------------- */ + +#ifndef EGL_KHR_client_get_all_proc_addresses +#define EGL_KHR_client_get_all_proc_addresses 1 + +#define EGLEW_KHR_client_get_all_proc_addresses EGLEW_GET_VAR(__EGLEW_KHR_client_get_all_proc_addresses) + +#endif /* EGL_KHR_client_get_all_proc_addresses */ + +/* ------------------------- EGL_KHR_config_attribs ------------------------ */ + +#ifndef EGL_KHR_config_attribs +#define EGL_KHR_config_attribs 1 + +#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 +#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 +#define EGL_CONFORMANT_KHR 0x3042 + +#define EGLEW_KHR_config_attribs EGLEW_GET_VAR(__EGLEW_KHR_config_attribs) + +#endif /* EGL_KHR_config_attribs */ + +/* --------------------- EGL_KHR_context_flush_control --------------------- */ + +#ifndef EGL_KHR_context_flush_control +#define EGL_KHR_context_flush_control 1 + +#define EGL_CONTEXT_RELEASE_BEHAVIOR_NONE_KHR 0 +#define EGL_CONTEXT_RELEASE_BEHAVIOR_KHR 0x2097 +#define EGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR 0x2098 + +#define EGLEW_KHR_context_flush_control EGLEW_GET_VAR(__EGLEW_KHR_context_flush_control) + +#endif /* EGL_KHR_context_flush_control */ + +/* ------------------------- EGL_KHR_create_context ------------------------ */ + +#ifndef EGL_KHR_create_context +#define EGL_KHR_create_context 1 + +#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001 +#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001 +#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002 +#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002 +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004 +#define EGL_OPENGL_ES3_BIT 0x00000040 +#define EGL_OPENGL_ES3_BIT_KHR 0x00000040 +#define EGL_CONTEXT_MAJOR_VERSION_KHR 0x3098 +#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB +#define EGL_CONTEXT_FLAGS_KHR 0x30FC +#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD +#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF + +#define EGLEW_KHR_create_context EGLEW_GET_VAR(__EGLEW_KHR_create_context) + +#endif /* EGL_KHR_create_context */ + +/* -------------------- EGL_KHR_create_context_no_error -------------------- */ + +#ifndef EGL_KHR_create_context_no_error +#define EGL_KHR_create_context_no_error 1 + +#define EGL_CONTEXT_OPENGL_NO_ERROR_KHR 0x31B3 + +#define EGLEW_KHR_create_context_no_error EGLEW_GET_VAR(__EGLEW_KHR_create_context_no_error) + +#endif /* EGL_KHR_create_context_no_error */ + +/* ----------------------------- EGL_KHR_debug ----------------------------- */ + +#ifndef EGL_KHR_debug +#define EGL_KHR_debug 1 + +#define EGL_OBJECT_THREAD_KHR 0x33B0 +#define EGL_OBJECT_DISPLAY_KHR 0x33B1 +#define EGL_OBJECT_CONTEXT_KHR 0x33B2 +#define EGL_OBJECT_SURFACE_KHR 0x33B3 +#define EGL_OBJECT_IMAGE_KHR 0x33B4 +#define EGL_OBJECT_SYNC_KHR 0x33B5 +#define EGL_OBJECT_STREAM_KHR 0x33B6 +#define EGL_DEBUG_CALLBACK_KHR 0x33B8 +#define EGL_DEBUG_MSG_CRITICAL_KHR 0x33B9 +#define EGL_DEBUG_MSG_ERROR_KHR 0x33BA +#define EGL_DEBUG_MSG_WARN_KHR 0x33BB +#define EGL_DEBUG_MSG_INFO_KHR 0x33BC + +typedef EGLint (EGLAPIENTRY * PFNEGLDEBUGMESSAGECONTROLKHRPROC) (EGLDEBUGPROCKHR callback, const EGLAttrib * attrib_list); +typedef EGLint (EGLAPIENTRY * PFNEGLLABELOBJECTKHRPROC) (EGLDisplay display, EGLenum objectType, EGLObjectKHR object, EGLLabelKHR label); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLQUERYDEBUGKHRPROC) (EGLint attribute, EGLAttrib * value); + +#define eglDebugMessageControlKHR EGLEW_GET_FUN(__eglewDebugMessageControlKHR) +#define eglLabelObjectKHR EGLEW_GET_FUN(__eglewLabelObjectKHR) +#define eglQueryDebugKHR EGLEW_GET_FUN(__eglewQueryDebugKHR) + +#define EGLEW_KHR_debug EGLEW_GET_VAR(__EGLEW_KHR_debug) + +#endif /* EGL_KHR_debug */ + +/* --------------------------- EGL_KHR_fence_sync -------------------------- */ + +#ifndef EGL_KHR_fence_sync +#define EGL_KHR_fence_sync 1 + +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0 +#define EGL_SYNC_CONDITION_KHR 0x30F8 +#define EGL_SYNC_FENCE_KHR 0x30F9 + +#define EGLEW_KHR_fence_sync EGLEW_GET_VAR(__EGLEW_KHR_fence_sync) + +#endif /* EGL_KHR_fence_sync */ + +/* --------------------- EGL_KHR_get_all_proc_addresses -------------------- */ + +#ifndef EGL_KHR_get_all_proc_addresses +#define EGL_KHR_get_all_proc_addresses 1 + +#define EGLEW_KHR_get_all_proc_addresses EGLEW_GET_VAR(__EGLEW_KHR_get_all_proc_addresses) + +#endif /* EGL_KHR_get_all_proc_addresses */ + +/* ------------------------- EGL_KHR_gl_colorspace ------------------------- */ + +#ifndef EGL_KHR_gl_colorspace +#define EGL_KHR_gl_colorspace 1 + +#define EGL_GL_COLORSPACE_SRGB_KHR 0x3089 +#define EGL_GL_COLORSPACE_LINEAR_KHR 0x308A +#define EGL_GL_COLORSPACE_KHR 0x309D + +#define EGLEW_KHR_gl_colorspace EGLEW_GET_VAR(__EGLEW_KHR_gl_colorspace) + +#endif /* EGL_KHR_gl_colorspace */ + +/* --------------------- EGL_KHR_gl_renderbuffer_image --------------------- */ + +#ifndef EGL_KHR_gl_renderbuffer_image +#define EGL_KHR_gl_renderbuffer_image 1 + +#define EGL_GL_RENDERBUFFER_KHR 0x30B9 + +#define EGLEW_KHR_gl_renderbuffer_image EGLEW_GET_VAR(__EGLEW_KHR_gl_renderbuffer_image) + +#endif /* EGL_KHR_gl_renderbuffer_image */ + +/* ---------------------- EGL_KHR_gl_texture_2D_image ---------------------- */ + +#ifndef EGL_KHR_gl_texture_2D_image +#define EGL_KHR_gl_texture_2D_image 1 + +#define EGL_GL_TEXTURE_2D_KHR 0x30B1 +#define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC + +#define EGLEW_KHR_gl_texture_2D_image EGLEW_GET_VAR(__EGLEW_KHR_gl_texture_2D_image) + +#endif /* EGL_KHR_gl_texture_2D_image */ + +/* ---------------------- EGL_KHR_gl_texture_3D_image ---------------------- */ + +#ifndef EGL_KHR_gl_texture_3D_image +#define EGL_KHR_gl_texture_3D_image 1 + +#define EGL_GL_TEXTURE_3D_KHR 0x30B2 +#define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD + +#define EGLEW_KHR_gl_texture_3D_image EGLEW_GET_VAR(__EGLEW_KHR_gl_texture_3D_image) + +#endif /* EGL_KHR_gl_texture_3D_image */ + +/* -------------------- EGL_KHR_gl_texture_cubemap_image ------------------- */ + +#ifndef EGL_KHR_gl_texture_cubemap_image +#define EGL_KHR_gl_texture_cubemap_image 1 + +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 + +#define EGLEW_KHR_gl_texture_cubemap_image EGLEW_GET_VAR(__EGLEW_KHR_gl_texture_cubemap_image) + +#endif /* EGL_KHR_gl_texture_cubemap_image */ + +/* ----------------------------- EGL_KHR_image ----------------------------- */ + +#ifndef EGL_KHR_image +#define EGL_KHR_image 1 + +#define EGL_NATIVE_PIXMAP_KHR 0x30B0 + +typedef EGLImageKHR (EGLAPIENTRY * PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint * attrib_list); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image); + +#define eglCreateImageKHR EGLEW_GET_FUN(__eglewCreateImageKHR) +#define eglDestroyImageKHR EGLEW_GET_FUN(__eglewDestroyImageKHR) + +#define EGLEW_KHR_image EGLEW_GET_VAR(__EGLEW_KHR_image) + +#endif /* EGL_KHR_image */ + +/* --------------------------- EGL_KHR_image_base -------------------------- */ + +#ifndef EGL_KHR_image_base +#define EGL_KHR_image_base 1 + +#define EGL_IMAGE_PRESERVED_KHR 0x30D2 + +#define EGLEW_KHR_image_base EGLEW_GET_VAR(__EGLEW_KHR_image_base) + +#endif /* EGL_KHR_image_base */ + +/* -------------------------- EGL_KHR_image_pixmap ------------------------- */ + +#ifndef EGL_KHR_image_pixmap +#define EGL_KHR_image_pixmap 1 + +#define EGL_NATIVE_PIXMAP_KHR 0x30B0 + +#define EGLEW_KHR_image_pixmap EGLEW_GET_VAR(__EGLEW_KHR_image_pixmap) + +#endif /* EGL_KHR_image_pixmap */ + +/* -------------------------- EGL_KHR_lock_surface ------------------------- */ + +#ifndef EGL_KHR_lock_surface +#define EGL_KHR_lock_surface 1 + +#define EGL_READ_SURFACE_BIT_KHR 0x0001 +#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 +#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 +#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 +#define EGL_MATCH_FORMAT_KHR 0x3043 +#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 +#define EGL_FORMAT_RGB_565_KHR 0x30C1 +#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 +#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 +#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 +#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 +#define EGL_BITMAP_POINTER_KHR 0x30C6 +#define EGL_BITMAP_PITCH_KHR 0x30C7 +#define EGL_BITMAP_ORIGIN_KHR 0x30C8 +#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 +#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA +#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB +#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC +#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD +#define EGL_LOWER_LEFT_KHR 0x30CE +#define EGL_UPPER_LEFT_KHR 0x30CF + +typedef EGLBoolean (EGLAPIENTRY * PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint * attrib_list); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface); + +#define eglLockSurfaceKHR EGLEW_GET_FUN(__eglewLockSurfaceKHR) +#define eglUnlockSurfaceKHR EGLEW_GET_FUN(__eglewUnlockSurfaceKHR) + +#define EGLEW_KHR_lock_surface EGLEW_GET_VAR(__EGLEW_KHR_lock_surface) + +#endif /* EGL_KHR_lock_surface */ + +/* ------------------------- EGL_KHR_lock_surface2 ------------------------- */ + +#ifndef EGL_KHR_lock_surface2 +#define EGL_KHR_lock_surface2 1 + +#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110 + +#define EGLEW_KHR_lock_surface2 EGLEW_GET_VAR(__EGLEW_KHR_lock_surface2) + +#endif /* EGL_KHR_lock_surface2 */ + +/* ------------------------- EGL_KHR_lock_surface3 ------------------------- */ + +#ifndef EGL_KHR_lock_surface3 +#define EGL_KHR_lock_surface3 1 + +#define EGL_READ_SURFACE_BIT_KHR 0x0001 +#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 +#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 +#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 +#define EGL_MATCH_FORMAT_KHR 0x3043 +#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 +#define EGL_FORMAT_RGB_565_KHR 0x30C1 +#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 +#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 +#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 +#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 +#define EGL_BITMAP_POINTER_KHR 0x30C6 +#define EGL_BITMAP_PITCH_KHR 0x30C7 +#define EGL_BITMAP_ORIGIN_KHR 0x30C8 +#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 +#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA +#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB +#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC +#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD +#define EGL_LOWER_LEFT_KHR 0x30CE +#define EGL_UPPER_LEFT_KHR 0x30CF +#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110 + +typedef EGLBoolean (EGLAPIENTRY * PFNEGLQUERYSURFACE64KHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR * value); + +#define eglQuerySurface64KHR EGLEW_GET_FUN(__eglewQuerySurface64KHR) + +#define EGLEW_KHR_lock_surface3 EGLEW_GET_VAR(__EGLEW_KHR_lock_surface3) + +#endif /* EGL_KHR_lock_surface3 */ + +/* --------------------- EGL_KHR_mutable_render_buffer --------------------- */ + +#ifndef EGL_KHR_mutable_render_buffer +#define EGL_KHR_mutable_render_buffer 1 + +#define EGL_MUTABLE_RENDER_BUFFER_BIT_KHR 0x1000 + +#define EGLEW_KHR_mutable_render_buffer EGLEW_GET_VAR(__EGLEW_KHR_mutable_render_buffer) + +#endif /* EGL_KHR_mutable_render_buffer */ + +/* ----------------------- EGL_KHR_no_config_context ----------------------- */ + +#ifndef EGL_KHR_no_config_context +#define EGL_KHR_no_config_context 1 + +#define EGLEW_KHR_no_config_context EGLEW_GET_VAR(__EGLEW_KHR_no_config_context) + +#endif /* EGL_KHR_no_config_context */ + +/* ------------------------- EGL_KHR_partial_update ------------------------ */ + +#ifndef EGL_KHR_partial_update +#define EGL_KHR_partial_update 1 + +#define EGL_BUFFER_AGE_KHR 0x313D + +typedef EGLBoolean (EGLAPIENTRY * PFNEGLSETDAMAGEREGIONKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint * rects, EGLint n_rects); + +#define eglSetDamageRegionKHR EGLEW_GET_FUN(__eglewSetDamageRegionKHR) + +#define EGLEW_KHR_partial_update EGLEW_GET_VAR(__EGLEW_KHR_partial_update) + +#endif /* EGL_KHR_partial_update */ + +/* ------------------------ EGL_KHR_platform_android ----------------------- */ + +#ifndef EGL_KHR_platform_android +#define EGL_KHR_platform_android 1 + +#define EGL_PLATFORM_ANDROID_KHR 0x3141 + +#define EGLEW_KHR_platform_android EGLEW_GET_VAR(__EGLEW_KHR_platform_android) + +#endif /* EGL_KHR_platform_android */ + +/* -------------------------- EGL_KHR_platform_gbm ------------------------- */ + +#ifndef EGL_KHR_platform_gbm +#define EGL_KHR_platform_gbm 1 + +#define EGL_PLATFORM_GBM_KHR 0x31D7 + +#define EGLEW_KHR_platform_gbm EGLEW_GET_VAR(__EGLEW_KHR_platform_gbm) + +#endif /* EGL_KHR_platform_gbm */ + +/* ------------------------ EGL_KHR_platform_wayland ----------------------- */ + +#ifndef EGL_KHR_platform_wayland +#define EGL_KHR_platform_wayland 1 + +#define EGL_PLATFORM_WAYLAND_KHR 0x31D8 + +#define EGLEW_KHR_platform_wayland EGLEW_GET_VAR(__EGLEW_KHR_platform_wayland) + +#endif /* EGL_KHR_platform_wayland */ + +/* -------------------------- EGL_KHR_platform_x11 ------------------------- */ + +#ifndef EGL_KHR_platform_x11 +#define EGL_KHR_platform_x11 1 + +#define EGL_PLATFORM_X11_KHR 0x31D5 +#define EGL_PLATFORM_X11_SCREEN_KHR 0x31D6 + +#define EGLEW_KHR_platform_x11 EGLEW_GET_VAR(__EGLEW_KHR_platform_x11) + +#endif /* EGL_KHR_platform_x11 */ + +/* ------------------------- EGL_KHR_reusable_sync ------------------------- */ + +#ifndef EGL_KHR_reusable_sync +#define EGL_KHR_reusable_sync 1 + +#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 +#define EGL_SYNC_STATUS_KHR 0x30F1 +#define EGL_SIGNALED_KHR 0x30F2 +#define EGL_UNSIGNALED_KHR 0x30F3 +#define EGL_TIMEOUT_EXPIRED_KHR 0x30F5 +#define EGL_CONDITION_SATISFIED_KHR 0x30F6 +#define EGL_SYNC_TYPE_KHR 0x30F7 +#define EGL_SYNC_REUSABLE_KHR 0x30FA +#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFF + +typedef EGLint (EGLAPIENTRY * PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); +typedef EGLSyncKHR (EGLAPIENTRY * PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint * attrib_list); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint * value); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); + +#define eglClientWaitSyncKHR EGLEW_GET_FUN(__eglewClientWaitSyncKHR) +#define eglCreateSyncKHR EGLEW_GET_FUN(__eglewCreateSyncKHR) +#define eglDestroySyncKHR EGLEW_GET_FUN(__eglewDestroySyncKHR) +#define eglGetSyncAttribKHR EGLEW_GET_FUN(__eglewGetSyncAttribKHR) +#define eglSignalSyncKHR EGLEW_GET_FUN(__eglewSignalSyncKHR) + +#define EGLEW_KHR_reusable_sync EGLEW_GET_VAR(__EGLEW_KHR_reusable_sync) + +#endif /* EGL_KHR_reusable_sync */ + +/* ----------------------------- EGL_KHR_stream ---------------------------- */ + +#ifndef EGL_KHR_stream +#define EGL_KHR_stream 1 + +#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210 +#define EGL_PRODUCER_FRAME_KHR 0x3212 +#define EGL_CONSUMER_FRAME_KHR 0x3213 +#define EGL_STREAM_STATE_KHR 0x3214 +#define EGL_STREAM_STATE_CREATED_KHR 0x3215 +#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216 +#define EGL_STREAM_STATE_EMPTY_KHR 0x3217 +#define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218 +#define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219 +#define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A +#define EGL_BAD_STREAM_KHR 0x321B +#define EGL_BAD_STATE_KHR 0x321C + +typedef EGLStreamKHR (EGLAPIENTRY * PFNEGLCREATESTREAMKHRPROC) (EGLDisplay dpy, const EGLint * attrib_list); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLDESTROYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLQUERYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint * value); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLQUERYSTREAMU64KHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR * value); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); + +#define eglCreateStreamKHR EGLEW_GET_FUN(__eglewCreateStreamKHR) +#define eglDestroyStreamKHR EGLEW_GET_FUN(__eglewDestroyStreamKHR) +#define eglQueryStreamKHR EGLEW_GET_FUN(__eglewQueryStreamKHR) +#define eglQueryStreamu64KHR EGLEW_GET_FUN(__eglewQueryStreamu64KHR) +#define eglStreamAttribKHR EGLEW_GET_FUN(__eglewStreamAttribKHR) + +#define EGLEW_KHR_stream EGLEW_GET_VAR(__EGLEW_KHR_stream) + +#endif /* EGL_KHR_stream */ + +/* ------------------------- EGL_KHR_stream_attrib ------------------------- */ + +#ifndef EGL_KHR_stream_attrib +#define EGL_KHR_stream_attrib 1 + +#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210 +#define EGL_STREAM_STATE_KHR 0x3214 +#define EGL_STREAM_STATE_CREATED_KHR 0x3215 +#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216 + +typedef EGLStreamKHR (EGLAPIENTRY * PFNEGLCREATESTREAMATTRIBKHRPROC) (EGLDisplay dpy, const EGLAttrib * attrib_list); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLQUERYSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib * value); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLSETSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib value); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLSTREAMCONSUMERACQUIREATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib * attrib_list); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLSTREAMCONSUMERRELEASEATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib * attrib_list); + +#define eglCreateStreamAttribKHR EGLEW_GET_FUN(__eglewCreateStreamAttribKHR) +#define eglQueryStreamAttribKHR EGLEW_GET_FUN(__eglewQueryStreamAttribKHR) +#define eglSetStreamAttribKHR EGLEW_GET_FUN(__eglewSetStreamAttribKHR) +#define eglStreamConsumerAcquireAttribKHR EGLEW_GET_FUN(__eglewStreamConsumerAcquireAttribKHR) +#define eglStreamConsumerReleaseAttribKHR EGLEW_GET_FUN(__eglewStreamConsumerReleaseAttribKHR) + +#define EGLEW_KHR_stream_attrib EGLEW_GET_VAR(__EGLEW_KHR_stream_attrib) + +#endif /* EGL_KHR_stream_attrib */ + +/* ------------------- EGL_KHR_stream_consumer_gltexture ------------------- */ + +#ifndef EGL_KHR_stream_consumer_gltexture +#define EGL_KHR_stream_consumer_gltexture 1 + +#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E + +typedef EGLBoolean (EGLAPIENTRY * PFNEGLSTREAMCONSUMERACQUIREKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLSTREAMCONSUMERRELEASEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); + +#define eglStreamConsumerAcquireKHR EGLEW_GET_FUN(__eglewStreamConsumerAcquireKHR) +#define eglStreamConsumerGLTextureExternalKHR EGLEW_GET_FUN(__eglewStreamConsumerGLTextureExternalKHR) +#define eglStreamConsumerReleaseKHR EGLEW_GET_FUN(__eglewStreamConsumerReleaseKHR) + +#define EGLEW_KHR_stream_consumer_gltexture EGLEW_GET_VAR(__EGLEW_KHR_stream_consumer_gltexture) + +#endif /* EGL_KHR_stream_consumer_gltexture */ + +/* -------------------- EGL_KHR_stream_cross_process_fd -------------------- */ + +#ifndef EGL_KHR_stream_cross_process_fd +#define EGL_KHR_stream_cross_process_fd 1 + +typedef EGLStreamKHR (EGLAPIENTRY * PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); +typedef EGLNativeFileDescriptorKHR (EGLAPIENTRY * PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); + +#define eglCreateStreamFromFileDescriptorKHR EGLEW_GET_FUN(__eglewCreateStreamFromFileDescriptorKHR) +#define eglGetStreamFileDescriptorKHR EGLEW_GET_FUN(__eglewGetStreamFileDescriptorKHR) + +#define EGLEW_KHR_stream_cross_process_fd EGLEW_GET_VAR(__EGLEW_KHR_stream_cross_process_fd) + +#endif /* EGL_KHR_stream_cross_process_fd */ + +/* -------------------------- EGL_KHR_stream_fifo -------------------------- */ + +#ifndef EGL_KHR_stream_fifo +#define EGL_KHR_stream_fifo 1 + +#define EGL_STREAM_FIFO_LENGTH_KHR 0x31FC +#define EGL_STREAM_TIME_NOW_KHR 0x31FD +#define EGL_STREAM_TIME_CONSUMER_KHR 0x31FE +#define EGL_STREAM_TIME_PRODUCER_KHR 0x31FF + +typedef EGLBoolean (EGLAPIENTRY * PFNEGLQUERYSTREAMTIMEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR * value); + +#define eglQueryStreamTimeKHR EGLEW_GET_FUN(__eglewQueryStreamTimeKHR) + +#define EGLEW_KHR_stream_fifo EGLEW_GET_VAR(__EGLEW_KHR_stream_fifo) + +#endif /* EGL_KHR_stream_fifo */ + +/* ----------------- EGL_KHR_stream_producer_aldatalocator ----------------- */ + +#ifndef EGL_KHR_stream_producer_aldatalocator +#define EGL_KHR_stream_producer_aldatalocator 1 + +#define EGLEW_KHR_stream_producer_aldatalocator EGLEW_GET_VAR(__EGLEW_KHR_stream_producer_aldatalocator) + +#endif /* EGL_KHR_stream_producer_aldatalocator */ + +/* ------------------- EGL_KHR_stream_producer_eglsurface ------------------ */ + +#ifndef EGL_KHR_stream_producer_eglsurface +#define EGL_KHR_stream_producer_eglsurface 1 + +#define EGL_STREAM_BIT_KHR 0x0800 + +typedef EGLSurface (EGLAPIENTRY * PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC) (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint * attrib_list); + +#define eglCreateStreamProducerSurfaceKHR EGLEW_GET_FUN(__eglewCreateStreamProducerSurfaceKHR) + +#define EGLEW_KHR_stream_producer_eglsurface EGLEW_GET_VAR(__EGLEW_KHR_stream_producer_eglsurface) + +#endif /* EGL_KHR_stream_producer_eglsurface */ + +/* ---------------------- EGL_KHR_surfaceless_context ---------------------- */ + +#ifndef EGL_KHR_surfaceless_context +#define EGL_KHR_surfaceless_context 1 + +#define EGLEW_KHR_surfaceless_context EGLEW_GET_VAR(__EGLEW_KHR_surfaceless_context) + +#endif /* EGL_KHR_surfaceless_context */ + +/* -------------------- EGL_KHR_swap_buffers_with_damage ------------------- */ + +#ifndef EGL_KHR_swap_buffers_with_damage +#define EGL_KHR_swap_buffers_with_damage 1 + +typedef EGLBoolean (EGLAPIENTRY * PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint * rects, EGLint n_rects); + +#define eglSwapBuffersWithDamageKHR EGLEW_GET_FUN(__eglewSwapBuffersWithDamageKHR) + +#define EGLEW_KHR_swap_buffers_with_damage EGLEW_GET_VAR(__EGLEW_KHR_swap_buffers_with_damage) + +#endif /* EGL_KHR_swap_buffers_with_damage */ + +/* ------------------------ EGL_KHR_vg_parent_image ------------------------ */ + +#ifndef EGL_KHR_vg_parent_image +#define EGL_KHR_vg_parent_image 1 + +#define EGL_VG_PARENT_IMAGE_KHR 0x30BA + +#define EGLEW_KHR_vg_parent_image EGLEW_GET_VAR(__EGLEW_KHR_vg_parent_image) + +#endif /* EGL_KHR_vg_parent_image */ + +/* --------------------------- EGL_KHR_wait_sync --------------------------- */ + +#ifndef EGL_KHR_wait_sync +#define EGL_KHR_wait_sync 1 + +typedef EGLint (EGLAPIENTRY * PFNEGLWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags); + +#define eglWaitSyncKHR EGLEW_GET_FUN(__eglewWaitSyncKHR) + +#define EGLEW_KHR_wait_sync EGLEW_GET_VAR(__EGLEW_KHR_wait_sync) + +#endif /* EGL_KHR_wait_sync */ + +/* --------------------------- EGL_MESA_drm_image -------------------------- */ + +#ifndef EGL_MESA_drm_image +#define EGL_MESA_drm_image 1 + +#define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x00000001 +#define EGL_DRM_BUFFER_USE_SHARE_MESA 0x00000002 +#define EGL_DRM_BUFFER_FORMAT_MESA 0x31D0 +#define EGL_DRM_BUFFER_USE_MESA 0x31D1 +#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2 +#define EGL_DRM_BUFFER_MESA 0x31D3 +#define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4 + +typedef EGLImageKHR (EGLAPIENTRY * PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint * attrib_list); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint * name, EGLint * handle, EGLint * stride); + +#define eglCreateDRMImageMESA EGLEW_GET_FUN(__eglewCreateDRMImageMESA) +#define eglExportDRMImageMESA EGLEW_GET_FUN(__eglewExportDRMImageMESA) + +#define EGLEW_MESA_drm_image EGLEW_GET_VAR(__EGLEW_MESA_drm_image) + +#endif /* EGL_MESA_drm_image */ + +/* --------------------- EGL_MESA_image_dma_buf_export --------------------- */ + +#ifndef EGL_MESA_image_dma_buf_export +#define EGL_MESA_image_dma_buf_export 1 + +typedef EGLBoolean (EGLAPIENTRY * PFNEGLEXPORTDMABUFIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int * fds, EGLint * strides, EGLint * offsets); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int * fourcc, int * num_planes, EGLuint64KHR * modifiers); + +#define eglExportDMABUFImageMESA EGLEW_GET_FUN(__eglewExportDMABUFImageMESA) +#define eglExportDMABUFImageQueryMESA EGLEW_GET_FUN(__eglewExportDMABUFImageQueryMESA) + +#define EGLEW_MESA_image_dma_buf_export EGLEW_GET_VAR(__EGLEW_MESA_image_dma_buf_export) + +#endif /* EGL_MESA_image_dma_buf_export */ + +/* ------------------------- EGL_MESA_platform_gbm ------------------------- */ + +#ifndef EGL_MESA_platform_gbm +#define EGL_MESA_platform_gbm 1 + +#define EGL_PLATFORM_GBM_MESA 0x31D7 + +#define EGLEW_MESA_platform_gbm EGLEW_GET_VAR(__EGLEW_MESA_platform_gbm) + +#endif /* EGL_MESA_platform_gbm */ + +/* --------------------- EGL_MESA_platform_surfaceless --------------------- */ + +#ifndef EGL_MESA_platform_surfaceless +#define EGL_MESA_platform_surfaceless 1 + +#define EGL_PLATFORM_SURFACELESS_MESA 0x31DD + +#define EGLEW_MESA_platform_surfaceless EGLEW_GET_VAR(__EGLEW_MESA_platform_surfaceless) + +#endif /* EGL_MESA_platform_surfaceless */ + +/* -------------------------- EGL_NOK_swap_region -------------------------- */ + +#ifndef EGL_NOK_swap_region +#define EGL_NOK_swap_region 1 + +typedef EGLBoolean (EGLAPIENTRY * PFNEGLSWAPBUFFERSREGIONNOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint * rects); + +#define eglSwapBuffersRegionNOK EGLEW_GET_FUN(__eglewSwapBuffersRegionNOK) + +#define EGLEW_NOK_swap_region EGLEW_GET_VAR(__EGLEW_NOK_swap_region) + +#endif /* EGL_NOK_swap_region */ + +/* -------------------------- EGL_NOK_swap_region2 ------------------------- */ + +#ifndef EGL_NOK_swap_region2 +#define EGL_NOK_swap_region2 1 + +typedef EGLBoolean (EGLAPIENTRY * PFNEGLSWAPBUFFERSREGION2NOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint * rects); + +#define eglSwapBuffersRegion2NOK EGLEW_GET_FUN(__eglewSwapBuffersRegion2NOK) + +#define EGLEW_NOK_swap_region2 EGLEW_GET_VAR(__EGLEW_NOK_swap_region2) + +#endif /* EGL_NOK_swap_region2 */ + +/* ---------------------- EGL_NOK_texture_from_pixmap ---------------------- */ + +#ifndef EGL_NOK_texture_from_pixmap +#define EGL_NOK_texture_from_pixmap 1 + +#define EGL_Y_INVERTED_NOK 0x307F + +#define EGLEW_NOK_texture_from_pixmap EGLEW_GET_VAR(__EGLEW_NOK_texture_from_pixmap) + +#endif /* EGL_NOK_texture_from_pixmap */ + +/* ------------------------ EGL_NV_3dvision_surface ------------------------ */ + +#ifndef EGL_NV_3dvision_surface +#define EGL_NV_3dvision_surface 1 + +#define EGL_AUTO_STEREO_NV 0x3136 + +#define EGLEW_NV_3dvision_surface EGLEW_GET_VAR(__EGLEW_NV_3dvision_surface) + +#endif /* EGL_NV_3dvision_surface */ + +/* ------------------------- EGL_NV_coverage_sample ------------------------ */ + +#ifndef EGL_NV_coverage_sample +#define EGL_NV_coverage_sample 1 + +#define EGL_COVERAGE_BUFFERS_NV 0x30E0 +#define EGL_COVERAGE_SAMPLES_NV 0x30E1 + +#define EGLEW_NV_coverage_sample EGLEW_GET_VAR(__EGLEW_NV_coverage_sample) + +#endif /* EGL_NV_coverage_sample */ + +/* --------------------- EGL_NV_coverage_sample_resolve -------------------- */ + +#ifndef EGL_NV_coverage_sample_resolve +#define EGL_NV_coverage_sample_resolve 1 + +#define EGL_COVERAGE_SAMPLE_RESOLVE_NV 0x3131 +#define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV 0x3132 +#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133 + +#define EGLEW_NV_coverage_sample_resolve EGLEW_GET_VAR(__EGLEW_NV_coverage_sample_resolve) + +#endif /* EGL_NV_coverage_sample_resolve */ + +/* --------------------------- EGL_NV_cuda_event --------------------------- */ + +#ifndef EGL_NV_cuda_event +#define EGL_NV_cuda_event 1 + +#define EGL_CUDA_EVENT_HANDLE_NV 0x323B +#define EGL_SYNC_CUDA_EVENT_NV 0x323C +#define EGL_SYNC_CUDA_EVENT_COMPLETE_NV 0x323D + +#define EGLEW_NV_cuda_event EGLEW_GET_VAR(__EGLEW_NV_cuda_event) + +#endif /* EGL_NV_cuda_event */ + +/* ------------------------- EGL_NV_depth_nonlinear ------------------------ */ + +#ifndef EGL_NV_depth_nonlinear +#define EGL_NV_depth_nonlinear 1 + +#define EGL_DEPTH_ENCODING_NONE_NV 0 +#define EGL_DEPTH_ENCODING_NV 0x30E2 +#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3 + +#define EGLEW_NV_depth_nonlinear EGLEW_GET_VAR(__EGLEW_NV_depth_nonlinear) + +#endif /* EGL_NV_depth_nonlinear */ + +/* --------------------------- EGL_NV_device_cuda -------------------------- */ + +#ifndef EGL_NV_device_cuda +#define EGL_NV_device_cuda 1 + +#define EGL_CUDA_DEVICE_NV 0x323A + +#define EGLEW_NV_device_cuda EGLEW_GET_VAR(__EGLEW_NV_device_cuda) + +#endif /* EGL_NV_device_cuda */ + +/* -------------------------- EGL_NV_native_query -------------------------- */ + +#ifndef EGL_NV_native_query +#define EGL_NV_native_query 1 + +typedef EGLBoolean (EGLAPIENTRY * PFNEGLQUERYNATIVEDISPLAYNVPROC) (EGLDisplay dpy, EGLNativeDisplayType * display_id); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLQUERYNATIVEPIXMAPNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType * pixmap); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLQUERYNATIVEWINDOWNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType * window); + +#define eglQueryNativeDisplayNV EGLEW_GET_FUN(__eglewQueryNativeDisplayNV) +#define eglQueryNativePixmapNV EGLEW_GET_FUN(__eglewQueryNativePixmapNV) +#define eglQueryNativeWindowNV EGLEW_GET_FUN(__eglewQueryNativeWindowNV) + +#define EGLEW_NV_native_query EGLEW_GET_VAR(__EGLEW_NV_native_query) + +#endif /* EGL_NV_native_query */ + +/* ---------------------- EGL_NV_post_convert_rounding --------------------- */ + +#ifndef EGL_NV_post_convert_rounding +#define EGL_NV_post_convert_rounding 1 + +#define EGLEW_NV_post_convert_rounding EGLEW_GET_VAR(__EGLEW_NV_post_convert_rounding) + +#endif /* EGL_NV_post_convert_rounding */ + +/* ------------------------- EGL_NV_post_sub_buffer ------------------------ */ + +#ifndef EGL_NV_post_sub_buffer +#define EGL_NV_post_sub_buffer 1 + +#define EGL_POST_SUB_BUFFER_SUPPORTED_NV 0x30BE + +typedef EGLBoolean (EGLAPIENTRY * PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); + +#define eglPostSubBufferNV EGLEW_GET_FUN(__eglewPostSubBufferNV) + +#define EGLEW_NV_post_sub_buffer EGLEW_GET_VAR(__EGLEW_NV_post_sub_buffer) + +#endif /* EGL_NV_post_sub_buffer */ + +/* ------------------ EGL_NV_robustness_video_memory_purge ----------------- */ + +#ifndef EGL_NV_robustness_video_memory_purge +#define EGL_NV_robustness_video_memory_purge 1 + +#define EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x334C + +#define EGLEW_NV_robustness_video_memory_purge EGLEW_GET_VAR(__EGLEW_NV_robustness_video_memory_purge) + +#endif /* EGL_NV_robustness_video_memory_purge */ + +/* ------------------ EGL_NV_stream_consumer_gltexture_yuv ----------------- */ + +#ifndef EGL_NV_stream_consumer_gltexture_yuv +#define EGL_NV_stream_consumer_gltexture_yuv 1 + +#define EGL_YUV_BUFFER_EXT 0x3300 +#define EGL_YUV_NUMBER_OF_PLANES_EXT 0x3311 +#define EGL_YUV_PLANE0_TEXTURE_UNIT_NV 0x332C +#define EGL_YUV_PLANE1_TEXTURE_UNIT_NV 0x332D +#define EGL_YUV_PLANE2_TEXTURE_UNIT_NV 0x332E + +typedef EGLBoolean (EGLAPIENTRY * PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALATTRIBSNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLAttrib *attrib_list); + +#define eglStreamConsumerGLTextureExternalAttribsNV EGLEW_GET_FUN(__eglewStreamConsumerGLTextureExternalAttribsNV) + +#define EGLEW_NV_stream_consumer_gltexture_yuv EGLEW_GET_VAR(__EGLEW_NV_stream_consumer_gltexture_yuv) + +#endif /* EGL_NV_stream_consumer_gltexture_yuv */ + +/* ---------------------- EGL_NV_stream_cross_display ---------------------- */ + +#ifndef EGL_NV_stream_cross_display +#define EGL_NV_stream_cross_display 1 + +#define EGL_STREAM_CROSS_DISPLAY_NV 0x334E + +#define EGLEW_NV_stream_cross_display EGLEW_GET_VAR(__EGLEW_NV_stream_cross_display) + +#endif /* EGL_NV_stream_cross_display */ + +/* ----------------------- EGL_NV_stream_cross_object ---------------------- */ + +#ifndef EGL_NV_stream_cross_object +#define EGL_NV_stream_cross_object 1 + +#define EGL_STREAM_CROSS_OBJECT_NV 0x334D + +#define EGLEW_NV_stream_cross_object EGLEW_GET_VAR(__EGLEW_NV_stream_cross_object) + +#endif /* EGL_NV_stream_cross_object */ + +/* --------------------- EGL_NV_stream_cross_partition --------------------- */ + +#ifndef EGL_NV_stream_cross_partition +#define EGL_NV_stream_cross_partition 1 + +#define EGL_STREAM_CROSS_PARTITION_NV 0x323F + +#define EGLEW_NV_stream_cross_partition EGLEW_GET_VAR(__EGLEW_NV_stream_cross_partition) + +#endif /* EGL_NV_stream_cross_partition */ + +/* ---------------------- EGL_NV_stream_cross_process ---------------------- */ + +#ifndef EGL_NV_stream_cross_process +#define EGL_NV_stream_cross_process 1 + +#define EGL_STREAM_CROSS_PROCESS_NV 0x3245 + +#define EGLEW_NV_stream_cross_process EGLEW_GET_VAR(__EGLEW_NV_stream_cross_process) + +#endif /* EGL_NV_stream_cross_process */ + +/* ----------------------- EGL_NV_stream_cross_system ---------------------- */ + +#ifndef EGL_NV_stream_cross_system +#define EGL_NV_stream_cross_system 1 + +#define EGL_STREAM_CROSS_SYSTEM_NV 0x334F + +#define EGLEW_NV_stream_cross_system EGLEW_GET_VAR(__EGLEW_NV_stream_cross_system) + +#endif /* EGL_NV_stream_cross_system */ + +/* ------------------------ EGL_NV_stream_fifo_next ------------------------ */ + +#ifndef EGL_NV_stream_fifo_next +#define EGL_NV_stream_fifo_next 1 + +#define EGL_PENDING_FRAME_NV 0x3329 +#define EGL_STREAM_TIME_PENDING_NV 0x332A + +#define EGLEW_NV_stream_fifo_next EGLEW_GET_VAR(__EGLEW_NV_stream_fifo_next) + +#endif /* EGL_NV_stream_fifo_next */ + +/* --------------------- EGL_NV_stream_fifo_synchronous -------------------- */ + +#ifndef EGL_NV_stream_fifo_synchronous +#define EGL_NV_stream_fifo_synchronous 1 + +#define EGL_STREAM_FIFO_SYNCHRONOUS_NV 0x3336 + +#define EGLEW_NV_stream_fifo_synchronous EGLEW_GET_VAR(__EGLEW_NV_stream_fifo_synchronous) + +#endif /* EGL_NV_stream_fifo_synchronous */ + +/* ----------------------- EGL_NV_stream_frame_limits ---------------------- */ + +#ifndef EGL_NV_stream_frame_limits +#define EGL_NV_stream_frame_limits 1 + +#define EGL_PRODUCER_MAX_FRAME_HINT_NV 0x3337 +#define EGL_CONSUMER_MAX_FRAME_HINT_NV 0x3338 + +#define EGLEW_NV_stream_frame_limits EGLEW_GET_VAR(__EGLEW_NV_stream_frame_limits) + +#endif /* EGL_NV_stream_frame_limits */ + +/* ------------------------- EGL_NV_stream_metadata ------------------------ */ + +#ifndef EGL_NV_stream_metadata +#define EGL_NV_stream_metadata 1 + +#define EGL_MAX_STREAM_METADATA_BLOCKS_NV 0x3250 +#define EGL_MAX_STREAM_METADATA_BLOCK_SIZE_NV 0x3251 +#define EGL_MAX_STREAM_METADATA_TOTAL_SIZE_NV 0x3252 +#define EGL_PRODUCER_METADATA_NV 0x3253 +#define EGL_CONSUMER_METADATA_NV 0x3254 +#define EGL_METADATA0_SIZE_NV 0x3255 +#define EGL_METADATA1_SIZE_NV 0x3256 +#define EGL_METADATA2_SIZE_NV 0x3257 +#define EGL_METADATA3_SIZE_NV 0x3258 +#define EGL_METADATA0_TYPE_NV 0x3259 +#define EGL_METADATA1_TYPE_NV 0x325A +#define EGL_METADATA2_TYPE_NV 0x325B +#define EGL_METADATA3_TYPE_NV 0x325C +#define EGL_PENDING_METADATA_NV 0x3328 + +typedef EGLBoolean (EGLAPIENTRY * PFNEGLQUERYDISPLAYATTRIBNVPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib * value); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLQUERYSTREAMMETADATANVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum name, EGLint n, EGLint offset, EGLint size, void * data); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLSETSTREAMMETADATANVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLint n, EGLint offset, EGLint size, const void * data); + +#define eglQueryDisplayAttribNV EGLEW_GET_FUN(__eglewQueryDisplayAttribNV) +#define eglQueryStreamMetadataNV EGLEW_GET_FUN(__eglewQueryStreamMetadataNV) +#define eglSetStreamMetadataNV EGLEW_GET_FUN(__eglewSetStreamMetadataNV) + +#define EGLEW_NV_stream_metadata EGLEW_GET_VAR(__EGLEW_NV_stream_metadata) + +#endif /* EGL_NV_stream_metadata */ + +/* -------------------------- EGL_NV_stream_remote ------------------------- */ + +#ifndef EGL_NV_stream_remote +#define EGL_NV_stream_remote 1 + +#define EGL_STREAM_STATE_INITIALIZING_NV 0x3240 +#define EGL_STREAM_TYPE_NV 0x3241 +#define EGL_STREAM_PROTOCOL_NV 0x3242 +#define EGL_STREAM_ENDPOINT_NV 0x3243 +#define EGL_STREAM_LOCAL_NV 0x3244 +#define EGL_STREAM_PROTOCOL_FD_NV 0x3246 +#define EGL_STREAM_PRODUCER_NV 0x3247 +#define EGL_STREAM_CONSUMER_NV 0x3248 + +#define EGLEW_NV_stream_remote EGLEW_GET_VAR(__EGLEW_NV_stream_remote) + +#endif /* EGL_NV_stream_remote */ + +/* -------------------------- EGL_NV_stream_reset -------------------------- */ + +#ifndef EGL_NV_stream_reset +#define EGL_NV_stream_reset 1 + +#define EGL_SUPPORT_RESET_NV 0x3334 +#define EGL_SUPPORT_REUSE_NV 0x3335 + +typedef EGLBoolean (EGLAPIENTRY * PFNEGLRESETSTREAMNVPROC) (EGLDisplay dpy, EGLStreamKHR stream); + +#define eglResetStreamNV EGLEW_GET_FUN(__eglewResetStreamNV) + +#define EGLEW_NV_stream_reset EGLEW_GET_VAR(__EGLEW_NV_stream_reset) + +#endif /* EGL_NV_stream_reset */ + +/* -------------------------- EGL_NV_stream_socket ------------------------- */ + +#ifndef EGL_NV_stream_socket +#define EGL_NV_stream_socket 1 + +#define EGL_STREAM_PROTOCOL_SOCKET_NV 0x324B +#define EGL_SOCKET_HANDLE_NV 0x324C +#define EGL_SOCKET_TYPE_NV 0x324D + +#define EGLEW_NV_stream_socket EGLEW_GET_VAR(__EGLEW_NV_stream_socket) + +#endif /* EGL_NV_stream_socket */ + +/* ----------------------- EGL_NV_stream_socket_inet ----------------------- */ + +#ifndef EGL_NV_stream_socket_inet +#define EGL_NV_stream_socket_inet 1 + +#define EGL_SOCKET_TYPE_INET_NV 0x324F + +#define EGLEW_NV_stream_socket_inet EGLEW_GET_VAR(__EGLEW_NV_stream_socket_inet) + +#endif /* EGL_NV_stream_socket_inet */ + +/* ----------------------- EGL_NV_stream_socket_unix ----------------------- */ + +#ifndef EGL_NV_stream_socket_unix +#define EGL_NV_stream_socket_unix 1 + +#define EGL_SOCKET_TYPE_UNIX_NV 0x324E + +#define EGLEW_NV_stream_socket_unix EGLEW_GET_VAR(__EGLEW_NV_stream_socket_unix) + +#endif /* EGL_NV_stream_socket_unix */ + +/* --------------------------- EGL_NV_stream_sync -------------------------- */ + +#ifndef EGL_NV_stream_sync +#define EGL_NV_stream_sync 1 + +#define EGL_SYNC_TYPE_KHR 0x30F7 +#define EGL_SYNC_NEW_FRAME_NV 0x321F + +typedef EGLSyncKHR (EGLAPIENTRY * PFNEGLCREATESTREAMSYNCNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint * attrib_list); + +#define eglCreateStreamSyncNV EGLEW_GET_FUN(__eglewCreateStreamSyncNV) + +#define EGLEW_NV_stream_sync EGLEW_GET_VAR(__EGLEW_NV_stream_sync) + +#endif /* EGL_NV_stream_sync */ + +/* ------------------------------ EGL_NV_sync ------------------------------ */ + +#ifndef EGL_NV_sync +#define EGL_NV_sync 1 + +#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001 +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6 +#define EGL_SYNC_STATUS_NV 0x30E7 +#define EGL_SIGNALED_NV 0x30E8 +#define EGL_UNSIGNALED_NV 0x30E9 +#define EGL_ALREADY_SIGNALED_NV 0x30EA +#define EGL_TIMEOUT_EXPIRED_NV 0x30EB +#define EGL_CONDITION_SATISFIED_NV 0x30EC +#define EGL_SYNC_TYPE_NV 0x30ED +#define EGL_SYNC_CONDITION_NV 0x30EE +#define EGL_SYNC_FENCE_NV 0x30EF +#define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFF + +typedef EGLint (EGLAPIENTRY * PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); +typedef EGLSyncNV (EGLAPIENTRY * PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint * attrib_list); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLFENCENVPROC) (EGLSyncNV sync); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint * value); +typedef EGLBoolean (EGLAPIENTRY * PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode); + +#define eglClientWaitSyncNV EGLEW_GET_FUN(__eglewClientWaitSyncNV) +#define eglCreateFenceSyncNV EGLEW_GET_FUN(__eglewCreateFenceSyncNV) +#define eglDestroySyncNV EGLEW_GET_FUN(__eglewDestroySyncNV) +#define eglFenceNV EGLEW_GET_FUN(__eglewFenceNV) +#define eglGetSyncAttribNV EGLEW_GET_FUN(__eglewGetSyncAttribNV) +#define eglSignalSyncNV EGLEW_GET_FUN(__eglewSignalSyncNV) + +#define EGLEW_NV_sync EGLEW_GET_VAR(__EGLEW_NV_sync) + +#endif /* EGL_NV_sync */ + +/* --------------------------- EGL_NV_system_time -------------------------- */ + +#ifndef EGL_NV_system_time +#define EGL_NV_system_time 1 + +typedef EGLuint64NV (EGLAPIENTRY * PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) ( void ); +typedef EGLuint64NV (EGLAPIENTRY * PFNEGLGETSYSTEMTIMENVPROC) ( void ); + +#define eglGetSystemTimeFrequencyNV EGLEW_GET_FUN(__eglewGetSystemTimeFrequencyNV) +#define eglGetSystemTimeNV EGLEW_GET_FUN(__eglewGetSystemTimeNV) + +#define EGLEW_NV_system_time EGLEW_GET_VAR(__EGLEW_NV_system_time) + +#endif /* EGL_NV_system_time */ + +/* --------------------- EGL_TIZEN_image_native_buffer --------------------- */ + +#ifndef EGL_TIZEN_image_native_buffer +#define EGL_TIZEN_image_native_buffer 1 + +#define EGL_NATIVE_BUFFER_TIZEN 0x32A0 + +#define EGLEW_TIZEN_image_native_buffer EGLEW_GET_VAR(__EGLEW_TIZEN_image_native_buffer) + +#endif /* EGL_TIZEN_image_native_buffer */ + +/* --------------------- EGL_TIZEN_image_native_surface -------------------- */ + +#ifndef EGL_TIZEN_image_native_surface +#define EGL_TIZEN_image_native_surface 1 + +#define EGL_NATIVE_SURFACE_TIZEN 0x32A1 + +#define EGLEW_TIZEN_image_native_surface EGLEW_GET_VAR(__EGLEW_TIZEN_image_native_surface) + +#endif /* EGL_TIZEN_image_native_surface */ + +/* ------------------------------------------------------------------------- */ + +#define EGLEW_FUN_EXPORT GLEW_FUN_EXPORT +#define EGLEW_VAR_EXPORT GLEW_VAR_EXPORT + +EGLEW_FUN_EXPORT PFNEGLCHOOSECONFIGPROC __eglewChooseConfig; +EGLEW_FUN_EXPORT PFNEGLCOPYBUFFERSPROC __eglewCopyBuffers; +EGLEW_FUN_EXPORT PFNEGLCREATECONTEXTPROC __eglewCreateContext; +EGLEW_FUN_EXPORT PFNEGLCREATEPBUFFERSURFACEPROC __eglewCreatePbufferSurface; +EGLEW_FUN_EXPORT PFNEGLCREATEPIXMAPSURFACEPROC __eglewCreatePixmapSurface; +EGLEW_FUN_EXPORT PFNEGLCREATEWINDOWSURFACEPROC __eglewCreateWindowSurface; +EGLEW_FUN_EXPORT PFNEGLDESTROYCONTEXTPROC __eglewDestroyContext; +EGLEW_FUN_EXPORT PFNEGLDESTROYSURFACEPROC __eglewDestroySurface; +EGLEW_FUN_EXPORT PFNEGLGETCONFIGATTRIBPROC __eglewGetConfigAttrib; +EGLEW_FUN_EXPORT PFNEGLGETCONFIGSPROC __eglewGetConfigs; +EGLEW_FUN_EXPORT PFNEGLGETCURRENTDISPLAYPROC __eglewGetCurrentDisplay; +EGLEW_FUN_EXPORT PFNEGLGETCURRENTSURFACEPROC __eglewGetCurrentSurface; +EGLEW_FUN_EXPORT PFNEGLGETDISPLAYPROC __eglewGetDisplay; +EGLEW_FUN_EXPORT PFNEGLGETERRORPROC __eglewGetError; +EGLEW_FUN_EXPORT PFNEGLINITIALIZEPROC __eglewInitialize; +EGLEW_FUN_EXPORT PFNEGLMAKECURRENTPROC __eglewMakeCurrent; +EGLEW_FUN_EXPORT PFNEGLQUERYCONTEXTPROC __eglewQueryContext; +EGLEW_FUN_EXPORT PFNEGLQUERYSTRINGPROC __eglewQueryString; +EGLEW_FUN_EXPORT PFNEGLQUERYSURFACEPROC __eglewQuerySurface; +EGLEW_FUN_EXPORT PFNEGLSWAPBUFFERSPROC __eglewSwapBuffers; +EGLEW_FUN_EXPORT PFNEGLTERMINATEPROC __eglewTerminate; +EGLEW_FUN_EXPORT PFNEGLWAITGLPROC __eglewWaitGL; +EGLEW_FUN_EXPORT PFNEGLWAITNATIVEPROC __eglewWaitNative; + +EGLEW_FUN_EXPORT PFNEGLBINDTEXIMAGEPROC __eglewBindTexImage; +EGLEW_FUN_EXPORT PFNEGLRELEASETEXIMAGEPROC __eglewReleaseTexImage; +EGLEW_FUN_EXPORT PFNEGLSURFACEATTRIBPROC __eglewSurfaceAttrib; +EGLEW_FUN_EXPORT PFNEGLSWAPINTERVALPROC __eglewSwapInterval; + +EGLEW_FUN_EXPORT PFNEGLBINDAPIPROC __eglewBindAPI; +EGLEW_FUN_EXPORT PFNEGLCREATEPBUFFERFROMCLIENTBUFFERPROC __eglewCreatePbufferFromClientBuffer; +EGLEW_FUN_EXPORT PFNEGLQUERYAPIPROC __eglewQueryAPI; +EGLEW_FUN_EXPORT PFNEGLRELEASETHREADPROC __eglewReleaseThread; +EGLEW_FUN_EXPORT PFNEGLWAITCLIENTPROC __eglewWaitClient; + +EGLEW_FUN_EXPORT PFNEGLGETCURRENTCONTEXTPROC __eglewGetCurrentContext; + +EGLEW_FUN_EXPORT PFNEGLCLIENTWAITSYNCPROC __eglewClientWaitSync; +EGLEW_FUN_EXPORT PFNEGLCREATEIMAGEPROC __eglewCreateImage; +EGLEW_FUN_EXPORT PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC __eglewCreatePlatformPixmapSurface; +EGLEW_FUN_EXPORT PFNEGLCREATEPLATFORMWINDOWSURFACEPROC __eglewCreatePlatformWindowSurface; +EGLEW_FUN_EXPORT PFNEGLCREATESYNCPROC __eglewCreateSync; +EGLEW_FUN_EXPORT PFNEGLDESTROYIMAGEPROC __eglewDestroyImage; +EGLEW_FUN_EXPORT PFNEGLDESTROYSYNCPROC __eglewDestroySync; +EGLEW_FUN_EXPORT PFNEGLGETPLATFORMDISPLAYPROC __eglewGetPlatformDisplay; +EGLEW_FUN_EXPORT PFNEGLGETSYNCATTRIBPROC __eglewGetSyncAttrib; +EGLEW_FUN_EXPORT PFNEGLWAITSYNCPROC __eglewWaitSync; + +EGLEW_FUN_EXPORT PFNEGLSETBLOBCACHEFUNCSANDROIDPROC __eglewSetBlobCacheFuncsANDROID; + +EGLEW_FUN_EXPORT PFNEGLCREATENATIVECLIENTBUFFERANDROIDPROC __eglewCreateNativeClientBufferANDROID; + +EGLEW_FUN_EXPORT PFNEGLDUPNATIVEFENCEFDANDROIDPROC __eglewDupNativeFenceFDANDROID; + +EGLEW_FUN_EXPORT PFNEGLPRESENTATIONTIMEANDROIDPROC __eglewPresentationTimeANDROID; + +EGLEW_FUN_EXPORT PFNEGLQUERYSURFACEPOINTERANGLEPROC __eglewQuerySurfacePointerANGLE; + +EGLEW_FUN_EXPORT PFNEGLQUERYDEVICESEXTPROC __eglewQueryDevicesEXT; + +EGLEW_FUN_EXPORT PFNEGLQUERYDEVICEATTRIBEXTPROC __eglewQueryDeviceAttribEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYDEVICESTRINGEXTPROC __eglewQueryDeviceStringEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYDISPLAYATTRIBEXTPROC __eglewQueryDisplayAttribEXT; + +EGLEW_FUN_EXPORT PFNEGLQUERYDMABUFFORMATSEXTPROC __eglewQueryDmaBufFormatsEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYDMABUFMODIFIERSEXTPROC __eglewQueryDmaBufModifiersEXT; + +EGLEW_FUN_EXPORT PFNEGLGETOUTPUTLAYERSEXTPROC __eglewGetOutputLayersEXT; +EGLEW_FUN_EXPORT PFNEGLGETOUTPUTPORTSEXTPROC __eglewGetOutputPortsEXT; +EGLEW_FUN_EXPORT PFNEGLOUTPUTLAYERATTRIBEXTPROC __eglewOutputLayerAttribEXT; +EGLEW_FUN_EXPORT PFNEGLOUTPUTPORTATTRIBEXTPROC __eglewOutputPortAttribEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC __eglewQueryOutputLayerAttribEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC __eglewQueryOutputLayerStringEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC __eglewQueryOutputPortAttribEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC __eglewQueryOutputPortStringEXT; + +EGLEW_FUN_EXPORT PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC __eglewCreatePlatformPixmapSurfaceEXT; +EGLEW_FUN_EXPORT PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC __eglewCreatePlatformWindowSurfaceEXT; +EGLEW_FUN_EXPORT PFNEGLGETPLATFORMDISPLAYEXTPROC __eglewGetPlatformDisplayEXT; + +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMEROUTPUTEXTPROC __eglewStreamConsumerOutputEXT; + +EGLEW_FUN_EXPORT PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC __eglewSwapBuffersWithDamageEXT; + +EGLEW_FUN_EXPORT PFNEGLCREATEPIXMAPSURFACEHIPROC __eglewCreatePixmapSurfaceHI; + +EGLEW_FUN_EXPORT PFNEGLCREATESYNC64KHRPROC __eglewCreateSync64KHR; + +EGLEW_FUN_EXPORT PFNEGLDEBUGMESSAGECONTROLKHRPROC __eglewDebugMessageControlKHR; +EGLEW_FUN_EXPORT PFNEGLLABELOBJECTKHRPROC __eglewLabelObjectKHR; +EGLEW_FUN_EXPORT PFNEGLQUERYDEBUGKHRPROC __eglewQueryDebugKHR; + +EGLEW_FUN_EXPORT PFNEGLCREATEIMAGEKHRPROC __eglewCreateImageKHR; +EGLEW_FUN_EXPORT PFNEGLDESTROYIMAGEKHRPROC __eglewDestroyImageKHR; + +EGLEW_FUN_EXPORT PFNEGLLOCKSURFACEKHRPROC __eglewLockSurfaceKHR; +EGLEW_FUN_EXPORT PFNEGLUNLOCKSURFACEKHRPROC __eglewUnlockSurfaceKHR; + +EGLEW_FUN_EXPORT PFNEGLQUERYSURFACE64KHRPROC __eglewQuerySurface64KHR; + +EGLEW_FUN_EXPORT PFNEGLSETDAMAGEREGIONKHRPROC __eglewSetDamageRegionKHR; + +EGLEW_FUN_EXPORT PFNEGLCLIENTWAITSYNCKHRPROC __eglewClientWaitSyncKHR; +EGLEW_FUN_EXPORT PFNEGLCREATESYNCKHRPROC __eglewCreateSyncKHR; +EGLEW_FUN_EXPORT PFNEGLDESTROYSYNCKHRPROC __eglewDestroySyncKHR; +EGLEW_FUN_EXPORT PFNEGLGETSYNCATTRIBKHRPROC __eglewGetSyncAttribKHR; +EGLEW_FUN_EXPORT PFNEGLSIGNALSYNCKHRPROC __eglewSignalSyncKHR; + +EGLEW_FUN_EXPORT PFNEGLCREATESTREAMKHRPROC __eglewCreateStreamKHR; +EGLEW_FUN_EXPORT PFNEGLDESTROYSTREAMKHRPROC __eglewDestroyStreamKHR; +EGLEW_FUN_EXPORT PFNEGLQUERYSTREAMKHRPROC __eglewQueryStreamKHR; +EGLEW_FUN_EXPORT PFNEGLQUERYSTREAMU64KHRPROC __eglewQueryStreamu64KHR; +EGLEW_FUN_EXPORT PFNEGLSTREAMATTRIBKHRPROC __eglewStreamAttribKHR; + +EGLEW_FUN_EXPORT PFNEGLCREATESTREAMATTRIBKHRPROC __eglewCreateStreamAttribKHR; +EGLEW_FUN_EXPORT PFNEGLQUERYSTREAMATTRIBKHRPROC __eglewQueryStreamAttribKHR; +EGLEW_FUN_EXPORT PFNEGLSETSTREAMATTRIBKHRPROC __eglewSetStreamAttribKHR; +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMERACQUIREATTRIBKHRPROC __eglewStreamConsumerAcquireAttribKHR; +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMERRELEASEATTRIBKHRPROC __eglewStreamConsumerReleaseAttribKHR; + +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMERACQUIREKHRPROC __eglewStreamConsumerAcquireKHR; +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC __eglewStreamConsumerGLTextureExternalKHR; +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMERRELEASEKHRPROC __eglewStreamConsumerReleaseKHR; + +EGLEW_FUN_EXPORT PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC __eglewCreateStreamFromFileDescriptorKHR; +EGLEW_FUN_EXPORT PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC __eglewGetStreamFileDescriptorKHR; + +EGLEW_FUN_EXPORT PFNEGLQUERYSTREAMTIMEKHRPROC __eglewQueryStreamTimeKHR; + +EGLEW_FUN_EXPORT PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC __eglewCreateStreamProducerSurfaceKHR; + +EGLEW_FUN_EXPORT PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC __eglewSwapBuffersWithDamageKHR; + +EGLEW_FUN_EXPORT PFNEGLWAITSYNCKHRPROC __eglewWaitSyncKHR; + +EGLEW_FUN_EXPORT PFNEGLCREATEDRMIMAGEMESAPROC __eglewCreateDRMImageMESA; +EGLEW_FUN_EXPORT PFNEGLEXPORTDRMIMAGEMESAPROC __eglewExportDRMImageMESA; + +EGLEW_FUN_EXPORT PFNEGLEXPORTDMABUFIMAGEMESAPROC __eglewExportDMABUFImageMESA; +EGLEW_FUN_EXPORT PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC __eglewExportDMABUFImageQueryMESA; + +EGLEW_FUN_EXPORT PFNEGLSWAPBUFFERSREGIONNOKPROC __eglewSwapBuffersRegionNOK; + +EGLEW_FUN_EXPORT PFNEGLSWAPBUFFERSREGION2NOKPROC __eglewSwapBuffersRegion2NOK; + +EGLEW_FUN_EXPORT PFNEGLQUERYNATIVEDISPLAYNVPROC __eglewQueryNativeDisplayNV; +EGLEW_FUN_EXPORT PFNEGLQUERYNATIVEPIXMAPNVPROC __eglewQueryNativePixmapNV; +EGLEW_FUN_EXPORT PFNEGLQUERYNATIVEWINDOWNVPROC __eglewQueryNativeWindowNV; + +EGLEW_FUN_EXPORT PFNEGLPOSTSUBBUFFERNVPROC __eglewPostSubBufferNV; + +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALATTRIBSNVPROC __eglewStreamConsumerGLTextureExternalAttribsNV; + +EGLEW_FUN_EXPORT PFNEGLQUERYDISPLAYATTRIBNVPROC __eglewQueryDisplayAttribNV; +EGLEW_FUN_EXPORT PFNEGLQUERYSTREAMMETADATANVPROC __eglewQueryStreamMetadataNV; +EGLEW_FUN_EXPORT PFNEGLSETSTREAMMETADATANVPROC __eglewSetStreamMetadataNV; + +EGLEW_FUN_EXPORT PFNEGLRESETSTREAMNVPROC __eglewResetStreamNV; + +EGLEW_FUN_EXPORT PFNEGLCREATESTREAMSYNCNVPROC __eglewCreateStreamSyncNV; + +EGLEW_FUN_EXPORT PFNEGLCLIENTWAITSYNCNVPROC __eglewClientWaitSyncNV; +EGLEW_FUN_EXPORT PFNEGLCREATEFENCESYNCNVPROC __eglewCreateFenceSyncNV; +EGLEW_FUN_EXPORT PFNEGLDESTROYSYNCNVPROC __eglewDestroySyncNV; +EGLEW_FUN_EXPORT PFNEGLFENCENVPROC __eglewFenceNV; +EGLEW_FUN_EXPORT PFNEGLGETSYNCATTRIBNVPROC __eglewGetSyncAttribNV; +EGLEW_FUN_EXPORT PFNEGLSIGNALSYNCNVPROC __eglewSignalSyncNV; + +EGLEW_FUN_EXPORT PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC __eglewGetSystemTimeFrequencyNV; +EGLEW_FUN_EXPORT PFNEGLGETSYSTEMTIMENVPROC __eglewGetSystemTimeNV; +EGLEW_VAR_EXPORT GLboolean __EGLEW_VERSION_1_0; +EGLEW_VAR_EXPORT GLboolean __EGLEW_VERSION_1_1; +EGLEW_VAR_EXPORT GLboolean __EGLEW_VERSION_1_2; +EGLEW_VAR_EXPORT GLboolean __EGLEW_VERSION_1_3; +EGLEW_VAR_EXPORT GLboolean __EGLEW_VERSION_1_4; +EGLEW_VAR_EXPORT GLboolean __EGLEW_VERSION_1_5; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_blob_cache; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_create_native_client_buffer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_framebuffer_target; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_front_buffer_auto_refresh; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_image_native_buffer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_native_fence_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_presentation_time; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_recordable; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANGLE_d3d_share_handle_client_buffer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANGLE_device_d3d; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANGLE_query_surface_pointer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANGLE_surface_d3d_texture_2d_share_handle; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANGLE_window_fixed_size; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ARM_implicit_external_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ARM_pixmap_multisample_discard; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_buffer_age; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_client_extensions; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_create_context_robustness; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_device_base; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_device_drm; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_device_enumeration; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_device_openwf; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_device_query; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_gl_colorspace_bt2020_linear; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_gl_colorspace_bt2020_pq; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_gl_colorspace_scrgb_linear; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_image_dma_buf_import; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_image_dma_buf_import_modifiers; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_multiview_window; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_output_base; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_output_drm; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_output_openwf; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_pixel_format_float; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_platform_base; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_platform_device; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_platform_wayland; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_platform_x11; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_protected_content; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_protected_surface; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_stream_consumer_egloutput; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_surface_SMPTE2086_metadata; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_swap_buffers_with_damage; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_yuv_surface; +EGLEW_VAR_EXPORT GLboolean __EGLEW_HI_clientpixmap; +EGLEW_VAR_EXPORT GLboolean __EGLEW_HI_colorformats; +EGLEW_VAR_EXPORT GLboolean __EGLEW_IMG_context_priority; +EGLEW_VAR_EXPORT GLboolean __EGLEW_IMG_image_plane_attribs; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_cl_event; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_cl_event2; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_client_get_all_proc_addresses; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_config_attribs; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_context_flush_control; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_create_context; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_create_context_no_error; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_debug; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_fence_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_get_all_proc_addresses; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_gl_colorspace; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_gl_renderbuffer_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_gl_texture_2D_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_gl_texture_3D_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_gl_texture_cubemap_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_image_base; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_image_pixmap; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_lock_surface; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_lock_surface2; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_lock_surface3; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_mutable_render_buffer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_no_config_context; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_partial_update; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_platform_android; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_platform_gbm; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_platform_wayland; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_platform_x11; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_reusable_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream_attrib; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream_consumer_gltexture; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream_cross_process_fd; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream_fifo; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream_producer_aldatalocator; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream_producer_eglsurface; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_surfaceless_context; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_swap_buffers_with_damage; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_vg_parent_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_wait_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_MESA_drm_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_MESA_image_dma_buf_export; +EGLEW_VAR_EXPORT GLboolean __EGLEW_MESA_platform_gbm; +EGLEW_VAR_EXPORT GLboolean __EGLEW_MESA_platform_surfaceless; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NOK_swap_region; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NOK_swap_region2; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NOK_texture_from_pixmap; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_3dvision_surface; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_coverage_sample; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_coverage_sample_resolve; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_cuda_event; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_depth_nonlinear; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_device_cuda; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_native_query; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_post_convert_rounding; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_post_sub_buffer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_robustness_video_memory_purge; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_consumer_gltexture_yuv; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_cross_display; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_cross_object; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_cross_partition; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_cross_process; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_cross_system; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_fifo_next; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_fifo_synchronous; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_frame_limits; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_metadata; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_remote; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_reset; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_socket; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_socket_inet; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_socket_unix; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_system_time; +EGLEW_VAR_EXPORT GLboolean __EGLEW_TIZEN_image_native_buffer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_TIZEN_image_native_surface; +/* ------------------------------------------------------------------------ */ + +GLEWAPI GLenum GLEWAPIENTRY eglewInit (EGLDisplay display); +GLEWAPI GLboolean GLEWAPIENTRY eglewIsSupported (const char *name); + +#define EGLEW_GET_VAR(x) (*(const GLboolean*)&x) +#define EGLEW_GET_FUN(x) x + +GLEWAPI GLboolean GLEWAPIENTRY eglewGetExtension (const char *name); + +#endif /* __eglew_h__ */ diff --git a/test_conformance/gl/GLEW/GL/glew.h b/test_conformance/gl/GLEW/GL/glew.h index 13723b4e..ab48adf2 100644 --- a/test_conformance/gl/GLEW/GL/glew.h +++ b/test_conformance/gl/GLEW/GL/glew.h @@ -1,27 +1,28 @@ /* ** The OpenGL Extension Wrangler Library +** Copyright (C) 2008-2017, Nigel Stewart ** Copyright (C) 2002-2008, Milan Ikits ** Copyright (C) 2002-2008, Marcelo E. Magallon ** Copyright (C) 2002, Lev Povalahev ** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without +** +** 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, +** +** * 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 +** * 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. -** * The name of the author may be used to endorse or promote products +** * The name of the author 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 +** 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 +** 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) @@ -55,7 +56,7 @@ /* ** Copyright (c) 2007 The Khronos Group Inc. -** +** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the ** "Materials"), to deal in the Materials without restriction, including @@ -63,10 +64,10 @@ ** distribute, sublicense, and/or sell copies of the Materials, and to ** permit persons to whom the Materials are furnished to do so, subject to ** the following conditions: -** +** ** The above copyright notice and this permission notice shall be included ** in all copies or substantial portions of the Materials. -** +** ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -80,9 +81,18 @@ #define __glew_h__ #define __GLEW_H__ -#if defined(__gl_h_) || defined(__GL_H__) +#if defined(__gl_h_) || defined(__GL_H__) || defined(_GL_H) || defined(__X_GL_H) #error gl.h included before glew.h #endif +#if defined(__gl2_h_) +#error gl2.h included before glew.h +#endif +#if defined(__gltypes_h_) +#error gltypes.h included before glew.h +#endif +#if defined(__REGAL_H__) +#error Regal.h included before glew.h +#endif #if defined(__glext_h_) || defined(__GLEXT_H_) #error glext.h included before glew.h #endif @@ -91,7 +101,12 @@ #endif #define __gl_h_ +#define __gl2_h_ #define __GL_H__ +#define _GL_H +#define __gltypes_h_ +#define __REGAL_H__ +#define __X_GL_H #define __glext_h_ #define __GLEXT_H_ #define __gl_ATI_h_ @@ -103,26 +118,37 @@ * GL needs GLAPI and GLAPIENTRY, GLU needs APIENTRY, CALLBACK, and wchar_t * defined properly. */ -/* */ -#ifndef APIENTRY +/* and */ +#ifdef APIENTRY +# ifndef GLAPIENTRY +# define GLAPIENTRY APIENTRY +# endif +# ifndef GLEWAPIENTRY +# define GLEWAPIENTRY APIENTRY +# endif +#else #define GLEW_APIENTRY_DEFINED -# if defined(__MINGW32__) -# define APIENTRY __stdcall -# elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) +# if defined(__MINGW32__) || defined(__CYGWIN__) || (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) # define APIENTRY __stdcall +# ifndef GLAPIENTRY +# define GLAPIENTRY __stdcall +# endif +# ifndef GLEWAPIENTRY +# define GLEWAPIENTRY __stdcall +# endif # else # define APIENTRY # endif #endif #ifndef GLAPI -# if defined(__MINGW32__) +# if defined(__MINGW32__) || defined(__CYGWIN__) # define GLAPI extern # endif #endif /* */ #ifndef CALLBACK #define GLEW_CALLBACK_DEFINED -# if defined(__MINGW32__) +# if defined(__MINGW32__) || defined(__CYGWIN__) # define CALLBACK __attribute__ ((__stdcall__)) # elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) # define CALLBACK __stdcall @@ -148,7 +174,7 @@ typedef unsigned short wchar_t; # define _W64 # endif #endif -#if !defined(_PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T_) +#if !defined(_PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T_) && !defined(__MINGW64__) # ifdef _WIN64 typedef __int64 ptrdiff_t; # else @@ -159,21 +185,18 @@ typedef _W64 int ptrdiff_t; #endif #ifndef GLAPI -# if defined(__MINGW32__) +# if defined(__MINGW32__) || defined(__CYGWIN__) # define GLAPI extern # else # define GLAPI WINGDIAPI # endif #endif -#ifndef GLAPIENTRY -#define GLAPIENTRY APIENTRY -#endif - /* - * GLEW_STATIC needs to be set when using the static version. - * GLEW_BUILD is set when building the DLL version. + * GLEW_STATIC is defined for static library. + * GLEW_BUILD is defined for building the DLL library. */ + #ifdef GLEW_STATIC # define GLEWAPI extern #else @@ -196,26 +219,53 @@ typedef _W64 int ptrdiff_t; */ #include + +/* SGI MIPSPro doesn't like stdint.h in C++ mode */ +/* ID: 3376260 Solaris 9 has inttypes.h, but not stdint.h */ + +#if (defined(__sgi) || defined(__sun)) && !defined(__GNUC__) +#include +#else #include +#endif #define GLEW_APIENTRY_DEFINED #define APIENTRY -#define GLEWAPI extern + +/* + * GLEW_STATIC is defined for static library. + */ + +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# if defined(__GNUC__) && __GNUC__>=4 +# define GLEWAPI extern __attribute__ ((visibility("default"))) +# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# define GLEWAPI extern __global +# else +# define GLEWAPI extern +# endif +#endif /* */ #ifndef GLAPI #define GLAPI extern #endif + +#endif /* _WIN32 */ + #ifndef GLAPIENTRY #define GLAPIENTRY #endif -#endif /* _WIN32 */ - -#ifdef __cplusplus -extern "C" { +#ifndef GLEWAPIENTRY +#define GLEWAPIENTRY #endif +#define GLEW_VAR_EXPORT GLEWAPI +#define GLEW_FUN_EXPORT GLEWAPI + /* ----------------------------- GL_VERSION_1_1 ---------------------------- */ #ifndef GL_VERSION_1_1 @@ -237,28 +287,61 @@ typedef float GLclampf; typedef double GLdouble; typedef double GLclampd; typedef void GLvoid; -#if defined(_MSC_VER) -# if _MSC_VER < 1400 +#if defined(_MSC_VER) && _MSC_VER < 1400 typedef __int64 GLint64EXT; typedef unsigned __int64 GLuint64EXT; -# else +#elif defined(_MSC_VER) || defined(__BORLANDC__) typedef signed long long GLint64EXT; typedef unsigned long long GLuint64EXT; -# endif #else -# if defined(__MINGW32__) +# if defined(__MINGW32__) || defined(__CYGWIN__) #include # endif typedef int64_t GLint64EXT; typedef uint64_t GLuint64EXT; #endif +typedef GLint64EXT GLint64; +typedef GLuint64EXT GLuint64; +typedef struct __GLsync *GLsync; +typedef char GLchar; + +#define GL_ZERO 0 +#define GL_FALSE 0 +#define GL_LOGIC_OP 0x0BF1 +#define GL_NONE 0 +#define GL_TEXTURE_COMPONENTS 0x1003 +#define GL_NO_ERROR 0 +#define GL_POINTS 0x0000 +#define GL_CURRENT_BIT 0x00000001 +#define GL_TRUE 1 +#define GL_ONE 1 +#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_POINT_BIT 0x00000002 +#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 +#define GL_LINE_STRIP 0x0003 +#define GL_LINE_BIT 0x00000004 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_QUADS 0x0007 +#define GL_QUAD_STRIP 0x0008 +#define GL_POLYGON_BIT 0x00000008 +#define GL_POLYGON 0x0009 +#define GL_POLYGON_STIPPLE_BIT 0x00000010 +#define GL_PIXEL_MODE_BIT 0x00000020 +#define GL_LIGHTING_BIT 0x00000040 +#define GL_FOG_BIT 0x00000080 +#define GL_DEPTH_BUFFER_BIT 0x00000100 #define GL_ACCUM 0x0100 #define GL_LOAD 0x0101 #define GL_RETURN 0x0102 #define GL_MULT 0x0103 #define GL_ADD 0x0104 #define GL_NEVER 0x0200 +#define GL_ACCUM_BUFFER_BIT 0x00000200 #define GL_LESS 0x0201 #define GL_EQUAL 0x0202 #define GL_LEQUAL 0x0203 @@ -266,39 +349,6 @@ typedef uint64_t GLuint64EXT; #define GL_NOTEQUAL 0x0205 #define GL_GEQUAL 0x0206 #define GL_ALWAYS 0x0207 -#define GL_CURRENT_BIT 0x00000001 -#define GL_POINT_BIT 0x00000002 -#define GL_LINE_BIT 0x00000004 -#define GL_POLYGON_BIT 0x00000008 -#define GL_POLYGON_STIPPLE_BIT 0x00000010 -#define GL_PIXEL_MODE_BIT 0x00000020 -#define GL_LIGHTING_BIT 0x00000040 -#define GL_FOG_BIT 0x00000080 -#define GL_DEPTH_BUFFER_BIT 0x00000100 -#define GL_ACCUM_BUFFER_BIT 0x00000200 -#define GL_STENCIL_BUFFER_BIT 0x00000400 -#define GL_VIEWPORT_BIT 0x00000800 -#define GL_TRANSFORM_BIT 0x00001000 -#define GL_ENABLE_BIT 0x00002000 -#define GL_COLOR_BUFFER_BIT 0x00004000 -#define GL_HINT_BIT 0x00008000 -#define GL_EVAL_BIT 0x00010000 -#define GL_LIST_BIT 0x00020000 -#define GL_TEXTURE_BIT 0x00040000 -#define GL_SCISSOR_BIT 0x00080000 -#define GL_ALL_ATTRIB_BITS 0x000fffff -#define GL_POINTS 0x0000 -#define GL_LINES 0x0001 -#define GL_LINE_LOOP 0x0002 -#define GL_LINE_STRIP 0x0003 -#define GL_TRIANGLES 0x0004 -#define GL_TRIANGLE_STRIP 0x0005 -#define GL_TRIANGLE_FAN 0x0006 -#define GL_QUADS 0x0007 -#define GL_QUAD_STRIP 0x0008 -#define GL_POLYGON 0x0009 -#define GL_ZERO 0 -#define GL_ONE 1 #define GL_SRC_COLOR 0x0300 #define GL_ONE_MINUS_SRC_COLOR 0x0301 #define GL_SRC_ALPHA 0x0302 @@ -308,26 +358,7 @@ typedef uint64_t GLuint64EXT; #define GL_DST_COLOR 0x0306 #define GL_ONE_MINUS_DST_COLOR 0x0307 #define GL_SRC_ALPHA_SATURATE 0x0308 -#define GL_TRUE 1 -#define GL_FALSE 0 -#define GL_CLIP_PLANE0 0x3000 -#define GL_CLIP_PLANE1 0x3001 -#define GL_CLIP_PLANE2 0x3002 -#define GL_CLIP_PLANE3 0x3003 -#define GL_CLIP_PLANE4 0x3004 -#define GL_CLIP_PLANE5 0x3005 -#define GL_BYTE 0x1400 -#define GL_UNSIGNED_BYTE 0x1401 -#define GL_SHORT 0x1402 -#define GL_UNSIGNED_SHORT 0x1403 -#define GL_INT 0x1404 -#define GL_UNSIGNED_INT 0x1405 -#define GL_FLOAT 0x1406 -#define GL_2_BYTES 0x1407 -#define GL_3_BYTES 0x1408 -#define GL_4_BYTES 0x1409 -#define GL_DOUBLE 0x140A -#define GL_NONE 0 +#define GL_STENCIL_BUFFER_BIT 0x00000400 #define GL_FRONT_LEFT 0x0400 #define GL_FRONT_RIGHT 0x0401 #define GL_BACK_LEFT 0x0402 @@ -341,7 +372,6 @@ typedef uint64_t GLuint64EXT; #define GL_AUX1 0x040A #define GL_AUX2 0x040B #define GL_AUX3 0x040C -#define GL_NO_ERROR 0 #define GL_INVALID_ENUM 0x0500 #define GL_INVALID_VALUE 0x0501 #define GL_INVALID_OPERATION 0x0502 @@ -362,6 +392,7 @@ typedef uint64_t GLuint64EXT; #define GL_COPY_PIXEL_TOKEN 0x0706 #define GL_LINE_RESET_TOKEN 0x0707 #define GL_EXP 0x0800 +#define GL_VIEWPORT_BIT 0x00000800 #define GL_EXP2 0x0801 #define GL_CW 0x0900 #define GL_CCW 0x0901 @@ -578,6 +609,7 @@ typedef uint64_t GLuint64EXT; #define GL_SELECTION_BUFFER_POINTER 0x0DF3 #define GL_SELECTION_BUFFER_SIZE 0x0DF4 #define GL_TEXTURE_WIDTH 0x1000 +#define GL_TRANSFORM_BIT 0x00001000 #define GL_TEXTURE_HEIGHT 0x1001 #define GL_TEXTURE_INTERNAL_FORMAT 0x1003 #define GL_TEXTURE_BORDER_COLOR 0x1004 @@ -585,14 +617,6 @@ typedef uint64_t GLuint64EXT; #define GL_DONT_CARE 0x1100 #define GL_FASTEST 0x1101 #define GL_NICEST 0x1102 -#define GL_LIGHT0 0x4000 -#define GL_LIGHT1 0x4001 -#define GL_LIGHT2 0x4002 -#define GL_LIGHT3 0x4003 -#define GL_LIGHT4 0x4004 -#define GL_LIGHT5 0x4005 -#define GL_LIGHT6 0x4006 -#define GL_LIGHT7 0x4007 #define GL_AMBIENT 0x1200 #define GL_DIFFUSE 0x1201 #define GL_SPECULAR 0x1202 @@ -605,6 +629,17 @@ typedef uint64_t GLuint64EXT; #define GL_QUADRATIC_ATTENUATION 0x1209 #define GL_COMPILE 0x1300 #define GL_COMPILE_AND_EXECUTE 0x1301 +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_2_BYTES 0x1407 +#define GL_3_BYTES 0x1408 +#define GL_4_BYTES 0x1409 +#define GL_DOUBLE 0x140A #define GL_CLEAR 0x1500 #define GL_AND 0x1501 #define GL_AND_REVERSE 0x1502 @@ -660,6 +695,7 @@ typedef uint64_t GLuint64EXT; #define GL_VERSION 0x1F02 #define GL_EXTENSIONS 0x1F03 #define GL_S 0x2000 +#define GL_ENABLE_BIT 0x00002000 #define GL_T 0x2001 #define GL_R 0x2002 #define GL_Q 0x2003 @@ -686,14 +722,42 @@ typedef uint64_t GLuint64EXT; #define GL_TEXTURE_WRAP_T 0x2803 #define GL_CLAMP 0x2900 #define GL_REPEAT 0x2901 -#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 -#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 -#define GL_CLIENT_ALL_ATTRIB_BITS 0xffffffff -#define GL_POLYGON_OFFSET_FACTOR 0x8038 #define GL_POLYGON_OFFSET_UNITS 0x2A00 #define GL_POLYGON_OFFSET_POINT 0x2A01 #define GL_POLYGON_OFFSET_LINE 0x2A02 +#define GL_R3_G3_B2 0x2A10 +#define GL_V2F 0x2A20 +#define GL_V3F 0x2A21 +#define GL_C4UB_V2F 0x2A22 +#define GL_C4UB_V3F 0x2A23 +#define GL_C3F_V3F 0x2A24 +#define GL_N3F_V3F 0x2A25 +#define GL_C4F_N3F_V3F 0x2A26 +#define GL_T2F_V3F 0x2A27 +#define GL_T4F_V4F 0x2A28 +#define GL_T2F_C4UB_V3F 0x2A29 +#define GL_T2F_C3F_V3F 0x2A2A +#define GL_T2F_N3F_V3F 0x2A2B +#define GL_T2F_C4F_N3F_V3F 0x2A2C +#define GL_T4F_C4F_N3F_V4F 0x2A2D +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 +#define GL_LIGHT0 0x4000 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 +#define GL_HINT_BIT 0x00008000 #define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 #define GL_ALPHA4 0x803B #define GL_ALPHA8 0x803C #define GL_ALPHA12 0x803D @@ -713,7 +777,6 @@ typedef uint64_t GLuint64EXT; #define GL_INTENSITY8 0x804B #define GL_INTENSITY12 0x804C #define GL_INTENSITY16 0x804D -#define GL_R3_G3_B2 0x2A10 #define GL_RGB4 0x804F #define GL_RGB5 0x8050 #define GL_RGB8 0x8051 @@ -765,28 +828,18 @@ typedef uint64_t GLuint64EXT; #define GL_INDEX_ARRAY_POINTER 0x8091 #define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 #define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 -#define GL_V2F 0x2A20 -#define GL_V3F 0x2A21 -#define GL_C4UB_V2F 0x2A22 -#define GL_C4UB_V3F 0x2A23 -#define GL_C3F_V3F 0x2A24 -#define GL_N3F_V3F 0x2A25 -#define GL_C4F_N3F_V3F 0x2A26 -#define GL_T2F_V3F 0x2A27 -#define GL_T4F_V4F 0x2A28 -#define GL_T2F_C4UB_V3F 0x2A29 -#define GL_T2F_C3F_V3F 0x2A2A -#define GL_T2F_N3F_V3F 0x2A2B -#define GL_T2F_C4F_N3F_V3F 0x2A2C -#define GL_T4F_C4F_N3F_V4F 0x2A2D -#define GL_LOGIC_OP GL_INDEX_LOGIC_OP -#define GL_TEXTURE_COMPONENTS GL_TEXTURE_INTERNAL_FORMAT #define GL_COLOR_INDEX1_EXT 0x80E2 #define GL_COLOR_INDEX2_EXT 0x80E3 #define GL_COLOR_INDEX4_EXT 0x80E4 #define GL_COLOR_INDEX8_EXT 0x80E5 #define GL_COLOR_INDEX12_EXT 0x80E6 #define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_EVAL_BIT 0x00010000 +#define GL_LIST_BIT 0x00020000 +#define GL_TEXTURE_BIT 0x00040000 +#define GL_SCISSOR_BIT 0x00080000 +#define GL_ALL_ATTRIB_BITS 0x000fffff +#define GL_CLIENT_ALL_ATTRIB_BITS 0xffffffff GLAPI void GLAPIENTRY glAccum (GLenum op, GLfloat value); GLAPI void GLAPIENTRY glAlphaFunc (GLenum func, GLclampf ref); @@ -797,7 +850,7 @@ GLAPI void GLAPIENTRY glBindTexture (GLenum target, GLuint texture); GLAPI void GLAPIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); GLAPI void GLAPIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); GLAPI void GLAPIENTRY glCallList (GLuint list); -GLAPI void GLAPIENTRY glCallLists (GLsizei n, GLenum type, const GLvoid *lists); +GLAPI void GLAPIENTRY glCallLists (GLsizei n, GLenum type, const void *lists); GLAPI void GLAPIENTRY glClear (GLbitfield mask); GLAPI void GLAPIENTRY glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); GLAPI void GLAPIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); @@ -839,7 +892,7 @@ GLAPI void GLAPIENTRY glColor4us (GLushort red, GLushort green, GLushort blue, G GLAPI void GLAPIENTRY glColor4usv (const GLushort *v); GLAPI void GLAPIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); GLAPI void GLAPIENTRY glColorMaterial (GLenum face, GLenum mode); -GLAPI void GLAPIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); GLAPI void GLAPIENTRY glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); GLAPI void GLAPIENTRY glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); GLAPI void GLAPIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); @@ -855,10 +908,10 @@ GLAPI void GLAPIENTRY glDisable (GLenum cap); GLAPI void GLAPIENTRY glDisableClientState (GLenum array); GLAPI void GLAPIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); GLAPI void GLAPIENTRY glDrawBuffer (GLenum mode); -GLAPI void GLAPIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); -GLAPI void GLAPIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices); +GLAPI void GLAPIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); GLAPI void GLAPIENTRY glEdgeFlag (GLboolean flag); -GLAPI void GLAPIENTRY glEdgeFlagPointer (GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glEdgeFlagPointer (GLsizei stride, const void *pointer); GLAPI void GLAPIENTRY glEdgeFlagv (const GLboolean *flag); GLAPI void GLAPIENTRY glEnable (GLenum cap); GLAPI void GLAPIENTRY glEnableClientState (GLenum array); @@ -903,7 +956,7 @@ GLAPI void GLAPIENTRY glGetMaterialiv (GLenum face, GLenum pname, GLint *params) GLAPI void GLAPIENTRY glGetPixelMapfv (GLenum map, GLfloat *values); GLAPI void GLAPIENTRY glGetPixelMapuiv (GLenum map, GLuint *values); GLAPI void GLAPIENTRY glGetPixelMapusv (GLenum map, GLushort *values); -GLAPI void GLAPIENTRY glGetPointerv (GLenum pname, GLvoid* *params); +GLAPI void GLAPIENTRY glGetPointerv (GLenum pname, void* *params); GLAPI void GLAPIENTRY glGetPolygonStipple (GLubyte *mask); GLAPI const GLubyte * GLAPIENTRY glGetString (GLenum name); GLAPI void GLAPIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params); @@ -911,14 +964,14 @@ GLAPI void GLAPIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params) GLAPI void GLAPIENTRY glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params); GLAPI void GLAPIENTRY glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params); GLAPI void GLAPIENTRY glGetTexGeniv (GLenum coord, GLenum pname, GLint *params); -GLAPI void GLAPIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void GLAPIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, void *pixels); GLAPI void GLAPIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params); GLAPI void GLAPIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params); GLAPI void GLAPIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); GLAPI void GLAPIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); GLAPI void GLAPIENTRY glHint (GLenum target, GLenum mode); GLAPI void GLAPIENTRY glIndexMask (GLuint mask); -GLAPI void GLAPIENTRY glIndexPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glIndexPointer (GLenum type, GLsizei stride, const void *pointer); GLAPI void GLAPIENTRY glIndexd (GLdouble c); GLAPI void GLAPIENTRY glIndexdv (const GLdouble *c); GLAPI void GLAPIENTRY glIndexf (GLfloat c); @@ -930,7 +983,7 @@ GLAPI void GLAPIENTRY glIndexsv (const GLshort *c); GLAPI void GLAPIENTRY glIndexub (GLubyte c); GLAPI void GLAPIENTRY glIndexubv (const GLubyte *c); GLAPI void GLAPIENTRY glInitNames (void); -GLAPI void GLAPIENTRY glInterleavedArrays (GLenum format, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glInterleavedArrays (GLenum format, GLsizei stride, const void *pointer); GLAPI GLboolean GLAPIENTRY glIsEnabled (GLenum cap); GLAPI GLboolean GLAPIENTRY glIsList (GLuint list); GLAPI GLboolean GLAPIENTRY glIsTexture (GLuint texture); @@ -976,7 +1029,7 @@ GLAPI void GLAPIENTRY glNormal3i (GLint nx, GLint ny, GLint nz); GLAPI void GLAPIENTRY glNormal3iv (const GLint *v); GLAPI void GLAPIENTRY glNormal3s (GLshort nx, GLshort ny, GLshort nz); GLAPI void GLAPIENTRY glNormal3sv (const GLshort *v); -GLAPI void GLAPIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glNormalPointer (GLenum type, GLsizei stride, const void *pointer); GLAPI void GLAPIENTRY glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); GLAPI void GLAPIENTRY glPassThrough (GLfloat token); GLAPI void GLAPIENTRY glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat *values); @@ -1025,7 +1078,7 @@ GLAPI void GLAPIENTRY glRasterPos4iv (const GLint *v); GLAPI void GLAPIENTRY glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w); GLAPI void GLAPIENTRY glRasterPos4sv (const GLshort *v); GLAPI void GLAPIENTRY glReadBuffer (GLenum mode); -GLAPI void GLAPIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void GLAPIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels); GLAPI void GLAPIENTRY glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); GLAPI void GLAPIENTRY glRectdv (const GLdouble *v1, const GLdouble *v2); GLAPI void GLAPIENTRY glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); @@ -1077,7 +1130,7 @@ GLAPI void GLAPIENTRY glTexCoord4i (GLint s, GLint t, GLint r, GLint q); GLAPI void GLAPIENTRY glTexCoord4iv (const GLint *v); GLAPI void GLAPIENTRY glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q); GLAPI void GLAPIENTRY glTexCoord4sv (const GLshort *v); -GLAPI void GLAPIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); GLAPI void GLAPIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param); GLAPI void GLAPIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params); GLAPI void GLAPIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param); @@ -1088,14 +1141,14 @@ GLAPI void GLAPIENTRY glTexGenf (GLenum coord, GLenum pname, GLfloat param); GLAPI void GLAPIENTRY glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params); GLAPI void GLAPIENTRY glTexGeni (GLenum coord, GLenum pname, GLint param); GLAPI void GLAPIENTRY glTexGeniv (GLenum coord, GLenum pname, const GLint *params); -GLAPI void GLAPIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void GLAPIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void GLAPIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); GLAPI void GLAPIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); GLAPI void GLAPIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); GLAPI void GLAPIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); GLAPI void GLAPIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); -GLAPI void GLAPIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void GLAPIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +GLAPI void GLAPIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); GLAPI void GLAPIENTRY glTranslated (GLdouble x, GLdouble y, GLdouble z); GLAPI void GLAPIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z); GLAPI void GLAPIENTRY glVertex2d (GLdouble x, GLdouble y); @@ -1122,7 +1175,7 @@ GLAPI void GLAPIENTRY glVertex4i (GLint x, GLint y, GLint z, GLint w); GLAPI void GLAPIENTRY glVertex4iv (const GLint *v); GLAPI void GLAPIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w); GLAPI void GLAPIENTRY glVertex4sv (const GLshort *v); -GLAPI void GLAPIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); #define GLEW_VERSION_1_1 GLEW_GET_VAR(__GLEW_VERSION_1_1) @@ -1131,11 +1184,22 @@ GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei heigh /* ---------------------------------- GLU ---------------------------------- */ +#ifndef GLEW_NO_GLU +# ifdef __APPLE__ +# include +# if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) +# define GLEW_NO_GLU +# endif +# endif +#endif + +#ifndef GLEW_NO_GLU /* this is where we can safely include GLU */ -#if defined(__APPLE__) && defined(__MACH__) -#include -#else -#include +# if defined(__APPLE__) && defined(__MACH__) +# include +# else +# include +# endif #endif /* ----------------------------- GL_VERSION_1_2 ---------------------------- */ @@ -1181,14 +1245,13 @@ GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei heigh #define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 #define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 #define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 #define GL_ALIASED_POINT_SIZE_RANGE 0x846D #define GL_ALIASED_LINE_WIDTH_RANGE 0x846E typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); #define glCopyTexSubImage3D GLEW_GET_FUN(__glewCopyTexSubImage3D) #define glDrawRangeElements GLEW_GET_FUN(__glewDrawRangeElements) @@ -1199,6 +1262,15 @@ typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, #endif /* GL_VERSION_1_2 */ +/* ---------------------------- GL_VERSION_1_2_1 --------------------------- */ + +#ifndef GL_VERSION_1_2_1 +#define GL_VERSION_1_2_1 1 + +#define GLEW_VERSION_1_2_1 GLEW_GET_VAR(__GLEW_VERSION_1_2_1) + +#endif /* GL_VERSION_1_2_1 */ + /* ----------------------------- GL_VERSION_1_3 ---------------------------- */ #ifndef GL_VERSION_1_3 @@ -1303,13 +1375,13 @@ typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLvoid *img); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, void *img); typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); @@ -1447,17 +1519,17 @@ typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean i typedef void (GLAPIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode); typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const void *pointer); typedef void (GLAPIENTRY * PFNGLFOGCOORDDPROC) (GLdouble coord); typedef void (GLAPIENTRY * PFNGLFOGCOORDDVPROC) (const GLdouble *coord); typedef void (GLAPIENTRY * PFNGLFOGCOORDFPROC) (GLfloat coord); typedef void (GLAPIENTRY * PFNGLFOGCOORDFVPROC) (const GLfloat *coord); -typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); -typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const* indices, GLsizei drawcount); typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVPROC) (GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVPROC) (GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); @@ -1474,7 +1546,7 @@ typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVPROC) (const GLdouble *p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); @@ -1549,18 +1621,18 @@ typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVPROC) (const GLshort *p); #ifndef GL_VERSION_1_5 #define GL_VERSION_1_5 1 -#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE +#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE #define GL_FOG_COORD GL_FOG_COORDINATE #define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY -#define GL_SRC0_RGB GL_SOURCE0_RGB -#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER -#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE -#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA -#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE -#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE -#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA -#define GL_SRC1_RGB GL_SOURCE1_RGB #define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING +#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER +#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE +#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE +#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE +#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA +#define GL_SRC0_RGB GL_SOURCE0_RGB +#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA +#define GL_SRC1_RGB GL_SOURCE1_RGB #define GL_SRC2_ALPHA GL_SOURCE2_ALPHA #define GL_SRC2_RGB GL_SOURCE2_RGB #define GL_BUFFER_SIZE 0x8764 @@ -1600,27 +1672,27 @@ typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVPROC) (const GLshort *p); #define GL_DYNAMIC_COPY 0x88EA #define GL_SAMPLES_PASSED 0x8914 -typedef ptrdiff_t GLsizeiptr; typedef ptrdiff_t GLintptr; +typedef ptrdiff_t GLsizeiptr; typedef void (GLAPIENTRY * PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); typedef void (GLAPIENTRY * PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); -typedef void (GLAPIENTRY * PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage); -typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void* data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void* data); typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint* buffers); typedef void (GLAPIENTRY * PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint* ids); typedef void (GLAPIENTRY * PFNGLENDQUERYPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLGENBUFFERSPROC) (GLsizei n, GLuint* buffers); typedef void (GLAPIENTRY * PFNGLGENQUERIESPROC) (GLsizei n, GLuint* ids); typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid** params); -typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid* data); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, void** params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, void* data); typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint* params); typedef void (GLAPIENTRY * PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERPROC) (GLuint buffer); typedef GLboolean (GLAPIENTRY * PFNGLISQUERYPROC) (GLuint id); -typedef GLvoid* (GLAPIENTRY * PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef void* (GLAPIENTRY * PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERPROC) (GLenum target); #define glBeginQuery GLEW_GET_FUN(__glewBeginQuery) @@ -1737,20 +1809,18 @@ typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERPROC) (GLenum target); #define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 #define GL_STENCIL_BACK_WRITEMASK 0x8CA5 -typedef char GLchar; - typedef void (GLAPIENTRY * PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar* name); -typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum, GLenum); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); typedef void (GLAPIENTRY * PFNGLCOMPILESHADERPROC) (GLuint shader); typedef GLuint (GLAPIENTRY * PFNGLCREATEPROGRAMPROC) (void); typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROC) (GLenum type); typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPROC) (GLuint program); typedef void (GLAPIENTRY * PFNGLDELETESHADERPROC) (GLuint shader); typedef void (GLAPIENTRY * PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum* bufs); -typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); typedef void (GLAPIENTRY * PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders); @@ -1758,21 +1828,21 @@ typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const G typedef void (GLAPIENTRY * PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog); typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint* param); typedef void (GLAPIENTRY * PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog); -typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEPROC) (GLint obj, GLsizei maxLength, GLsizei* length, GLchar* source); +typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEPROC) (GLuint obj, GLsizei maxLength, GLsizei* length, GLchar* source); typedef void (GLAPIENTRY * PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint* param); typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar* name); typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint, GLenum, GLvoid*); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVPROC) (GLuint, GLenum, GLdouble*); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVPROC) (GLuint, GLenum, GLfloat*); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVPROC) (GLuint, GLenum, GLint*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPROC) (GLuint program); typedef GLboolean (GLAPIENTRY * PFNGLISSHADERPROC) (GLuint shader); typedef void (GLAPIENTRY * PFNGLLINKPROGRAMPROC) (GLuint program); -typedef void (GLAPIENTRY * PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar** strings, const GLint* lengths); +typedef void (GLAPIENTRY * PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const* string, const GLint* length); typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -typedef void (GLAPIENTRY * PFNGLSTENCILMASKSEPARATEPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); typedef void (GLAPIENTRY * PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); typedef void (GLAPIENTRY * PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat* value); @@ -1831,7 +1901,7 @@ typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshor typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer); #define glAttachShader GLEW_GET_FUN(__glewAttachShader) #define glBindAttribLocation GLEW_GET_FUN(__glewBindAttribLocation) @@ -1983,14 +2053,14 @@ typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei #ifndef GL_VERSION_3_0 #define GL_VERSION_3_0 1 -#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES -#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5 -#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1 -#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3 -#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB #define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0 -#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4 +#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1 #define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2 +#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3 +#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4 +#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5 +#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB +#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES #define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS #define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 #define GL_MAJOR_VERSION 0x821B @@ -1999,8 +2069,6 @@ typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei #define GL_CONTEXT_FLAGS 0x821E #define GL_DEPTH_BUFFER 0x8223 #define GL_STENCIL_BUFFER 0x8224 -#define GL_COMPRESSED_RED 0x8225 -#define GL_COMPRESSED_RG 0x8226 #define GL_RGBA32F 0x8814 #define GL_RGB32F 0x8815 #define GL_RGBA16F 0x881A @@ -2020,7 +2088,6 @@ typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei #define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 #define GL_TEXTURE_INTENSITY_TYPE 0x8C15 #define GL_TEXTURE_DEPTH_TYPE 0x8C16 -#define GL_UNSIGNED_NORMALIZED 0x8C17 #define GL_TEXTURE_1D_ARRAY 0x8C18 #define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 #define GL_TEXTURE_2D_ARRAY 0x8C1A @@ -2092,69 +2159,64 @@ typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei #define GL_QUERY_BY_REGION_WAIT 0x8E15 #define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 -typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERPROC) (GLuint, GLenum); -typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum); -typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEPROC) (GLenum, GLuint, GLuint); -typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEPROC) (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr); -typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONPROC) (GLuint, GLuint, const GLchar*); -typedef void (GLAPIENTRY * PFNGLCLAMPCOLORPROC) (GLenum, GLenum); -typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFIPROC) (GLenum, GLint, GLfloat, GLint); -typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFVPROC) (GLenum, GLint, const GLfloat*); -typedef void (GLAPIENTRY * PFNGLCLEARBUFFERIVPROC) (GLenum, GLint, const GLint*); -typedef void (GLAPIENTRY * PFNGLCLEARBUFFERUIVPROC) (GLenum, GLint, const GLuint*); -typedef void (GLAPIENTRY * PFNGLCOLORMASKIPROC) (GLuint, GLboolean, GLboolean, GLboolean, GLboolean); -typedef void (GLAPIENTRY * PFNGLDISABLEIPROC) (GLenum, GLuint); -typedef void (GLAPIENTRY * PFNGLENABLEIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode); +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint colorNumber, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawBuffer, GLfloat depth, GLint stencil); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawBuffer, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawBuffer, const GLint* value); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawBuffer, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLCOLORMASKIPROC) (GLuint buf, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +typedef void (GLAPIENTRY * PFNGLDISABLEIPROC) (GLenum cap, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEIPROC) (GLenum cap, GLuint index); typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERPROC) (void); typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKPROC) (void); -typedef void (GLAPIENTRY * PFNGLGETBOOLEANI_VPROC) (GLenum, GLuint, GLboolean*); -typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONPROC) (GLuint, const GLchar*); -typedef void (GLAPIENTRY * PFNGLGETINTEGERI_VPROC) (GLenum, GLuint, GLint*); -typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGIPROC) (GLenum, GLuint); -typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVPROC) (GLenum, GLenum, GLint*); -typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVPROC) (GLenum, GLenum, GLuint*); -typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint, GLuint, GLint*); -typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVPROC) (GLuint, GLint, GLuint*); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVPROC) (GLuint, GLenum, GLint*); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint, GLenum, GLuint*); -typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDIPROC) (GLenum, GLuint); -typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVPROC) (GLenum, GLenum, const GLint*); -typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVPROC) (GLenum, GLenum, const GLuint*); -typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint, GLsizei, const GLint*, GLenum); -typedef void (GLAPIENTRY * PFNGLUNIFORM1UIPROC) (GLint, GLuint); -typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVPROC) (GLint, GLsizei, const GLuint*); -typedef void (GLAPIENTRY * PFNGLUNIFORM2UIPROC) (GLint, GLuint, GLuint); -typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVPROC) (GLint, GLsizei, const GLuint*); -typedef void (GLAPIENTRY * PFNGLUNIFORM3UIPROC) (GLint, GLuint, GLuint, GLuint); -typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVPROC) (GLint, GLsizei, const GLuint*); -typedef void (GLAPIENTRY * PFNGLUNIFORM4UIPROC) (GLint, GLuint, GLuint, GLuint, GLuint); -typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVPROC) (GLint, GLsizei, const GLuint*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IPROC) (GLuint, GLint); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVPROC) (GLuint, const GLint*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIPROC) (GLuint, GLuint); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVPROC) (GLuint, const GLuint*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IPROC) (GLuint, GLint, GLint); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVPROC) (GLuint, const GLint*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIPROC) (GLuint, GLuint, GLuint); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVPROC) (GLuint, const GLuint*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IPROC) (GLuint, GLint, GLint, GLint); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVPROC) (GLuint, const GLint*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIPROC) (GLuint, GLuint, GLuint, GLuint); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVPROC) (GLuint, const GLuint*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVPROC) (GLuint, const GLbyte*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IPROC) (GLuint, GLint, GLint, GLint, GLint); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVPROC) (GLuint, const GLint*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVPROC) (GLuint, const GLshort*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVPROC) (GLuint, const GLubyte*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIPROC) (GLuint, GLuint, GLuint, GLuint, GLuint); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVPROC) (GLuint, const GLuint*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVPROC) (GLuint, const GLushort*); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint, GLint, GLenum, GLsizei, const GLvoid*); +typedef void (GLAPIENTRY * PFNGLGETBOOLEANI_VPROC) (GLenum pname, GLuint index, GLboolean* data); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar* name); +typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDIPROC) (GLenum cap, GLuint index); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void*pointer); #define glBeginConditionalRender GLEW_GET_FUN(__glewBeginConditionalRender) #define glBeginTransformFeedback GLEW_GET_FUN(__glewBeginTransformFeedback) -#define glBindBufferBase GLEW_GET_FUN(__glewBindBufferBase) -#define glBindBufferRange GLEW_GET_FUN(__glewBindBufferRange) #define glBindFragDataLocation GLEW_GET_FUN(__glewBindFragDataLocation) #define glClampColor GLEW_GET_FUN(__glewClampColor) #define glClearBufferfi GLEW_GET_FUN(__glewClearBufferfi) @@ -2168,7 +2230,6 @@ typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint, GLint, GLenum #define glEndTransformFeedback GLEW_GET_FUN(__glewEndTransformFeedback) #define glGetBooleani_v GLEW_GET_FUN(__glewGetBooleani_v) #define glGetFragDataLocation GLEW_GET_FUN(__glewGetFragDataLocation) -#define glGetIntegeri_v GLEW_GET_FUN(__glewGetIntegeri_v) #define glGetStringi GLEW_GET_FUN(__glewGetStringi) #define glGetTexParameterIiv GLEW_GET_FUN(__glewGetTexParameterIiv) #define glGetTexParameterIuiv GLEW_GET_FUN(__glewGetTexParameterIuiv) @@ -2214,6 +2275,263 @@ typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint, GLint, GLenum #endif /* GL_VERSION_3_0 */ +/* ----------------------------- GL_VERSION_3_1 ---------------------------- */ + +#ifndef GL_VERSION_3_1 +#define GL_VERSION_3_1 1 + +#define GL_TEXTURE_RECTANGLE 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 +#define GL_SAMPLER_2D_RECT 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 +#define GL_TEXTURE_BUFFER 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT 0x8C2E +#define GL_SAMPLER_BUFFER 0x8DC2 +#define GL_INT_SAMPLER_2D_RECT 0x8DCD +#define GL_INT_SAMPLER_BUFFER 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_PRIMITIVE_RESTART 0x8F9D +#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E +#define GL_BUFFER_ACCESS_FLAGS 0x911F +#define GL_BUFFER_MAP_LENGTH 0x9120 +#define GL_BUFFER_MAP_OFFSET 0x9121 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalFormat, GLuint buffer); + +#define glDrawArraysInstanced GLEW_GET_FUN(__glewDrawArraysInstanced) +#define glDrawElementsInstanced GLEW_GET_FUN(__glewDrawElementsInstanced) +#define glPrimitiveRestartIndex GLEW_GET_FUN(__glewPrimitiveRestartIndex) +#define glTexBuffer GLEW_GET_FUN(__glewTexBuffer) + +#define GLEW_VERSION_3_1 GLEW_GET_VAR(__GLEW_VERSION_3_1) + +#endif /* GL_VERSION_3_1 */ + +/* ----------------------------- GL_VERSION_3_2 ---------------------------- */ + +#ifndef GL_VERSION_3_2 +#define GL_VERSION_3_2 1 + +#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 +#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define GL_LINES_ADJACENCY 0x000A +#define GL_LINE_STRIP_ADJACENCY 0x000B +#define GL_TRIANGLES_ADJACENCY 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D +#define GL_PROGRAM_POINT_SIZE 0x8642 +#define GL_GEOMETRY_VERTICES_OUT 0x8916 +#define GL_GEOMETRY_INPUT_TYPE 0x8917 +#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 +#define GL_GEOMETRY_SHADER 0x8DD9 +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 +#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 +#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 +#define GL_CONTEXT_PROFILE_MASK 0x9126 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum value, GLint64 * data); +typedef void (GLAPIENTRY * PFNGLGETINTEGER64I_VPROC) (GLenum pname, GLuint index, GLint64 * data); + +#define glFramebufferTexture GLEW_GET_FUN(__glewFramebufferTexture) +#define glGetBufferParameteri64v GLEW_GET_FUN(__glewGetBufferParameteri64v) +#define glGetInteger64i_v GLEW_GET_FUN(__glewGetInteger64i_v) + +#define GLEW_VERSION_3_2 GLEW_GET_VAR(__GLEW_VERSION_3_2) + +#endif /* GL_VERSION_3_2 */ + +/* ----------------------------- GL_VERSION_3_3 ---------------------------- */ + +#ifndef GL_VERSION_3_3 +#define GL_VERSION_3_3 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE +#define GL_RGB10_A2UI 0x906F + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); + +#define glVertexAttribDivisor GLEW_GET_FUN(__glewVertexAttribDivisor) + +#define GLEW_VERSION_3_3 GLEW_GET_VAR(__GLEW_VERSION_3_3) + +#endif /* GL_VERSION_3_3 */ + +/* ----------------------------- GL_VERSION_4_0 ---------------------------- */ + +#ifndef GL_VERSION_4_0 +#define GL_VERSION_4_0 1 + +#define GL_SAMPLE_SHADING 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F +#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS 0x8F9F +#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGPROC) (GLclampf value); + +#define glBlendEquationSeparatei GLEW_GET_FUN(__glewBlendEquationSeparatei) +#define glBlendEquationi GLEW_GET_FUN(__glewBlendEquationi) +#define glBlendFuncSeparatei GLEW_GET_FUN(__glewBlendFuncSeparatei) +#define glBlendFunci GLEW_GET_FUN(__glewBlendFunci) +#define glMinSampleShading GLEW_GET_FUN(__glewMinSampleShading) + +#define GLEW_VERSION_4_0 GLEW_GET_VAR(__GLEW_VERSION_4_0) + +#endif /* GL_VERSION_4_0 */ + +/* ----------------------------- GL_VERSION_4_1 ---------------------------- */ + +#ifndef GL_VERSION_4_1 +#define GL_VERSION_4_1 1 + +#define GLEW_VERSION_4_1 GLEW_GET_VAR(__GLEW_VERSION_4_1) + +#endif /* GL_VERSION_4_1 */ + +/* ----------------------------- GL_VERSION_4_2 ---------------------------- */ + +#ifndef GL_VERSION_4_2 +#define GL_VERSION_4_2 1 + +#define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23 +#define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24 +#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F +#define GL_COPY_READ_BUFFER_BINDING 0x8F36 +#define GL_COPY_WRITE_BUFFER_BINDING 0x8F37 + +#define GLEW_VERSION_4_2 GLEW_GET_VAR(__GLEW_VERSION_4_2) + +#endif /* GL_VERSION_4_2 */ + +/* ----------------------------- GL_VERSION_4_3 ---------------------------- */ + +#ifndef GL_VERSION_4_3 +#define GL_VERSION_4_3 1 + +#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9 +#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E + +#define GLEW_VERSION_4_3 GLEW_GET_VAR(__GLEW_VERSION_4_3) + +#endif /* GL_VERSION_4_3 */ + +/* ----------------------------- GL_VERSION_4_4 ---------------------------- */ + +#ifndef GL_VERSION_4_4 +#define GL_VERSION_4_4 1 + +#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221 +#define GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5 +#define GL_TEXTURE_BUFFER_BINDING 0x8C2A + +#define GLEW_VERSION_4_4 GLEW_GET_VAR(__GLEW_VERSION_4_4) + +#endif /* GL_VERSION_4_4 */ + +/* ----------------------------- GL_VERSION_4_5 ---------------------------- */ + +#ifndef GL_VERSION_4_5 +#define GL_VERSION_4_5 1 + +#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT 0x00000004 + +typedef GLenum (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUSPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETNCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLsizei bufSize, GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLGETNTEXIMAGEPROC) (GLenum tex, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMDVPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); + +#define glGetGraphicsResetStatus GLEW_GET_FUN(__glewGetGraphicsResetStatus) +#define glGetnCompressedTexImage GLEW_GET_FUN(__glewGetnCompressedTexImage) +#define glGetnTexImage GLEW_GET_FUN(__glewGetnTexImage) +#define glGetnUniformdv GLEW_GET_FUN(__glewGetnUniformdv) + +#define GLEW_VERSION_4_5 GLEW_GET_VAR(__GLEW_VERSION_4_5) + +#endif /* GL_VERSION_4_5 */ + +/* ----------------------------- GL_VERSION_4_6 ---------------------------- */ + +#ifndef GL_VERSION_4_6 +#define GL_VERSION_4_6 1 + +#define GL_CONTEXT_FLAG_NO_ERROR_BIT 0x00000008 +#define GL_PARAMETER_BUFFER 0x80EE +#define GL_PARAMETER_BUFFER_BINDING 0x80EF +#define GL_TRANSFORM_FEEDBACK_OVERFLOW 0x82EC +#define GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW 0x82ED +#define GL_VERTICES_SUBMITTED 0x82EE +#define GL_PRIMITIVES_SUBMITTED 0x82EF +#define GL_VERTEX_SHADER_INVOCATIONS 0x82F0 +#define GL_TESS_CONTROL_SHADER_PATCHES 0x82F1 +#define GL_TESS_EVALUATION_SHADER_INVOCATIONS 0x82F2 +#define GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED 0x82F3 +#define GL_FRAGMENT_SHADER_INVOCATIONS 0x82F4 +#define GL_COMPUTE_SHADER_INVOCATIONS 0x82F5 +#define GL_CLIPPING_INPUT_PRIMITIVES 0x82F6 +#define GL_CLIPPING_OUTPUT_PRIMITIVES 0x82F7 +#define GL_TEXTURE_MAX_ANISOTROPY 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY 0x84FF +#define GL_POLYGON_OFFSET_CLAMP 0x8E1B +#define GL_SHADER_BINARY_FORMAT_SPIR_V 0x9551 +#define GL_SPIR_V_BINARY 0x9552 +#define GL_SPIR_V_EXTENSIONS 0x9553 +#define GL_NUM_SPIR_V_EXTENSIONS 0x9554 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC) (GLenum mode, const GLvoid *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLSPECIALIZESHADERPROC) (GLuint shader, const GLchar *pEntryPoint, GLuint numSpecializationConstants, const GLuint *pConstantIndex, const GLuint *pConstantValue); + +#define glMultiDrawArraysIndirectCount GLEW_GET_FUN(__glewMultiDrawArraysIndirectCount) +#define glMultiDrawElementsIndirectCount GLEW_GET_FUN(__glewMultiDrawElementsIndirectCount) +#define glSpecializeShader GLEW_GET_FUN(__glewSpecializeShader) + +#define GLEW_VERSION_4_6 GLEW_GET_VAR(__GLEW_VERSION_4_6) + +#endif /* GL_VERSION_4_6 */ + /* -------------------------- GL_3DFX_multisample -------------------------- */ #ifndef GL_3DFX_multisample @@ -2253,6 +2571,766 @@ typedef void (GLAPIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); #endif /* GL_3DFX_texture_compression_FXT1 */ +/* ----------------------- GL_AMD_blend_minmax_factor ---------------------- */ + +#ifndef GL_AMD_blend_minmax_factor +#define GL_AMD_blend_minmax_factor 1 + +#define GL_FACTOR_MIN_AMD 0x901C +#define GL_FACTOR_MAX_AMD 0x901D + +#define GLEW_AMD_blend_minmax_factor GLEW_GET_VAR(__GLEW_AMD_blend_minmax_factor) + +#endif /* GL_AMD_blend_minmax_factor */ + +/* --------------------- GL_AMD_compressed_3DC_texture --------------------- */ + +#ifndef GL_AMD_compressed_3DC_texture +#define GL_AMD_compressed_3DC_texture 1 + +#define GL_3DC_X_AMD 0x87F9 +#define GL_3DC_XY_AMD 0x87FA + +#define GLEW_AMD_compressed_3DC_texture GLEW_GET_VAR(__GLEW_AMD_compressed_3DC_texture) + +#endif /* GL_AMD_compressed_3DC_texture */ + +/* --------------------- GL_AMD_compressed_ATC_texture --------------------- */ + +#ifndef GL_AMD_compressed_ATC_texture +#define GL_AMD_compressed_ATC_texture 1 + +#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE +#define GL_ATC_RGB_AMD 0x8C92 +#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93 + +#define GLEW_AMD_compressed_ATC_texture GLEW_GET_VAR(__GLEW_AMD_compressed_ATC_texture) + +#endif /* GL_AMD_compressed_ATC_texture */ + +/* ----------------------- GL_AMD_conservative_depth ----------------------- */ + +#ifndef GL_AMD_conservative_depth +#define GL_AMD_conservative_depth 1 + +#define GLEW_AMD_conservative_depth GLEW_GET_VAR(__GLEW_AMD_conservative_depth) + +#endif /* GL_AMD_conservative_depth */ + +/* -------------------------- GL_AMD_debug_output -------------------------- */ + +#ifndef GL_AMD_debug_output +#define GL_AMD_debug_output 1 + +#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 +#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 +#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 +#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A +#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B +#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C +#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D +#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E +#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F +#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 + +typedef void (GLAPIENTRY *GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, void* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, void *userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum* categories, GLuint* severities, GLuint* ids, GLsizei* lengths, GLchar* message); + +#define glDebugMessageCallbackAMD GLEW_GET_FUN(__glewDebugMessageCallbackAMD) +#define glDebugMessageEnableAMD GLEW_GET_FUN(__glewDebugMessageEnableAMD) +#define glDebugMessageInsertAMD GLEW_GET_FUN(__glewDebugMessageInsertAMD) +#define glGetDebugMessageLogAMD GLEW_GET_FUN(__glewGetDebugMessageLogAMD) + +#define GLEW_AMD_debug_output GLEW_GET_VAR(__GLEW_AMD_debug_output) + +#endif /* GL_AMD_debug_output */ + +/* ---------------------- GL_AMD_depth_clamp_separate ---------------------- */ + +#ifndef GL_AMD_depth_clamp_separate +#define GL_AMD_depth_clamp_separate 1 + +#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E +#define GL_DEPTH_CLAMP_FAR_AMD 0x901F + +#define GLEW_AMD_depth_clamp_separate GLEW_GET_VAR(__GLEW_AMD_depth_clamp_separate) + +#endif /* GL_AMD_depth_clamp_separate */ + +/* ----------------------- GL_AMD_draw_buffers_blend ----------------------- */ + +#ifndef GL_AMD_draw_buffers_blend +#define GL_AMD_draw_buffers_blend 1 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); + +#define glBlendEquationIndexedAMD GLEW_GET_FUN(__glewBlendEquationIndexedAMD) +#define glBlendEquationSeparateIndexedAMD GLEW_GET_FUN(__glewBlendEquationSeparateIndexedAMD) +#define glBlendFuncIndexedAMD GLEW_GET_FUN(__glewBlendFuncIndexedAMD) +#define glBlendFuncSeparateIndexedAMD GLEW_GET_FUN(__glewBlendFuncSeparateIndexedAMD) + +#define GLEW_AMD_draw_buffers_blend GLEW_GET_VAR(__GLEW_AMD_draw_buffers_blend) + +#endif /* GL_AMD_draw_buffers_blend */ + +/* ------------------ GL_AMD_framebuffer_sample_positions ------------------ */ + +#ifndef GL_AMD_framebuffer_sample_positions +#define GL_AMD_framebuffer_sample_positions 1 + +#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F +#define GL_PIXELS_PER_SAMPLE_PATTERN_X_AMD 0x91AE +#define GL_PIXELS_PER_SAMPLE_PATTERN_Y_AMD 0x91AF +#define GL_ALL_PIXELS_AMD 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC) (GLenum target, GLuint numsamples, GLuint pixelindex, const GLfloat* values); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERFVAMDPROC) (GLenum target, GLenum pname, GLuint numsamples, GLuint pixelindex, GLsizei size, GLfloat* values); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERFVAMDPROC) (GLuint framebuffer, GLenum pname, GLuint numsamples, GLuint pixelindex, GLsizei size, GLfloat* values); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC) (GLuint framebuffer, GLuint numsamples, GLuint pixelindex, const GLfloat* values); + +#define glFramebufferSamplePositionsfvAMD GLEW_GET_FUN(__glewFramebufferSamplePositionsfvAMD) +#define glGetFramebufferParameterfvAMD GLEW_GET_FUN(__glewGetFramebufferParameterfvAMD) +#define glGetNamedFramebufferParameterfvAMD GLEW_GET_FUN(__glewGetNamedFramebufferParameterfvAMD) +#define glNamedFramebufferSamplePositionsfvAMD GLEW_GET_FUN(__glewNamedFramebufferSamplePositionsfvAMD) + +#define GLEW_AMD_framebuffer_sample_positions GLEW_GET_VAR(__GLEW_AMD_framebuffer_sample_positions) + +#endif /* GL_AMD_framebuffer_sample_positions */ + +/* --------------------------- GL_AMD_gcn_shader --------------------------- */ + +#ifndef GL_AMD_gcn_shader +#define GL_AMD_gcn_shader 1 + +#define GLEW_AMD_gcn_shader GLEW_GET_VAR(__GLEW_AMD_gcn_shader) + +#endif /* GL_AMD_gcn_shader */ + +/* ---------------------- GL_AMD_gpu_shader_half_float --------------------- */ + +#ifndef GL_AMD_gpu_shader_half_float +#define GL_AMD_gpu_shader_half_float 1 + +#define GL_FLOAT16_NV 0x8FF8 +#define GL_FLOAT16_VEC2_NV 0x8FF9 +#define GL_FLOAT16_VEC3_NV 0x8FFA +#define GL_FLOAT16_VEC4_NV 0x8FFB +#define GL_FLOAT16_MAT2_AMD 0x91C5 +#define GL_FLOAT16_MAT3_AMD 0x91C6 +#define GL_FLOAT16_MAT4_AMD 0x91C7 +#define GL_FLOAT16_MAT2x3_AMD 0x91C8 +#define GL_FLOAT16_MAT2x4_AMD 0x91C9 +#define GL_FLOAT16_MAT3x2_AMD 0x91CA +#define GL_FLOAT16_MAT3x4_AMD 0x91CB +#define GL_FLOAT16_MAT4x2_AMD 0x91CC +#define GL_FLOAT16_MAT4x3_AMD 0x91CD + +#define GLEW_AMD_gpu_shader_half_float GLEW_GET_VAR(__GLEW_AMD_gpu_shader_half_float) + +#endif /* GL_AMD_gpu_shader_half_float */ + +/* ------------------------ GL_AMD_gpu_shader_int16 ------------------------ */ + +#ifndef GL_AMD_gpu_shader_int16 +#define GL_AMD_gpu_shader_int16 1 + +#define GLEW_AMD_gpu_shader_int16 GLEW_GET_VAR(__GLEW_AMD_gpu_shader_int16) + +#endif /* GL_AMD_gpu_shader_int16 */ + +/* ------------------------ GL_AMD_gpu_shader_int64 ------------------------ */ + +#ifndef GL_AMD_gpu_shader_int64 +#define GL_AMD_gpu_shader_int64 1 + +#define GLEW_AMD_gpu_shader_int64 GLEW_GET_VAR(__GLEW_AMD_gpu_shader_int64) + +#endif /* GL_AMD_gpu_shader_int64 */ + +/* ---------------------- GL_AMD_interleaved_elements ---------------------- */ + +#ifndef GL_AMD_interleaved_elements +#define GL_AMD_interleaved_elements 1 + +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_RG8UI 0x8238 +#define GL_RG16UI 0x823A +#define GL_RGBA8UI 0x8D7C +#define GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4 +#define GL_VERTEX_ID_SWIZZLE_AMD 0x91A5 + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPARAMETERIAMDPROC) (GLuint index, GLenum pname, GLint param); + +#define glVertexAttribParameteriAMD GLEW_GET_FUN(__glewVertexAttribParameteriAMD) + +#define GLEW_AMD_interleaved_elements GLEW_GET_VAR(__GLEW_AMD_interleaved_elements) + +#endif /* GL_AMD_interleaved_elements */ + +/* ----------------------- GL_AMD_multi_draw_indirect ---------------------- */ + +#ifndef GL_AMD_multi_draw_indirect +#define GL_AMD_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); + +#define glMultiDrawArraysIndirectAMD GLEW_GET_FUN(__glewMultiDrawArraysIndirectAMD) +#define glMultiDrawElementsIndirectAMD GLEW_GET_FUN(__glewMultiDrawElementsIndirectAMD) + +#define GLEW_AMD_multi_draw_indirect GLEW_GET_VAR(__GLEW_AMD_multi_draw_indirect) + +#endif /* GL_AMD_multi_draw_indirect */ + +/* ------------------------- GL_AMD_name_gen_delete ------------------------ */ + +#ifndef GL_AMD_name_gen_delete +#define GL_AMD_name_gen_delete 1 + +#define GL_DATA_BUFFER_AMD 0x9151 +#define GL_PERFORMANCE_MONITOR_AMD 0x9152 +#define GL_QUERY_OBJECT_AMD 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 +#define GL_SAMPLER_OBJECT_AMD 0x9155 + +typedef void (GLAPIENTRY * PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint* names); +typedef void (GLAPIENTRY * PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint* names); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name); + +#define glDeleteNamesAMD GLEW_GET_FUN(__glewDeleteNamesAMD) +#define glGenNamesAMD GLEW_GET_FUN(__glewGenNamesAMD) +#define glIsNameAMD GLEW_GET_FUN(__glewIsNameAMD) + +#define GLEW_AMD_name_gen_delete GLEW_GET_VAR(__GLEW_AMD_name_gen_delete) + +#endif /* GL_AMD_name_gen_delete */ + +/* ---------------------- GL_AMD_occlusion_query_event --------------------- */ + +#ifndef GL_AMD_occlusion_query_event +#define GL_AMD_occlusion_query_event 1 + +#define GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD 0x00000001 +#define GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD 0x00000002 +#define GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD 0x00000004 +#define GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD 0x00000008 +#define GL_OCCLUSION_QUERY_EVENT_MASK_AMD 0x874F +#define GL_QUERY_ALL_EVENT_BITS_AMD 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLQUERYOBJECTPARAMETERUIAMDPROC) (GLenum target, GLuint id, GLenum pname, GLuint param); + +#define glQueryObjectParameteruiAMD GLEW_GET_FUN(__glewQueryObjectParameteruiAMD) + +#define GLEW_AMD_occlusion_query_event GLEW_GET_VAR(__GLEW_AMD_occlusion_query_event) + +#endif /* GL_AMD_occlusion_query_event */ + +/* ----------------------- GL_AMD_performance_monitor ---------------------- */ + +#ifndef GL_AMD_performance_monitor +#define GL_AMD_performance_monitor 1 + +#define GL_COUNTER_TYPE_AMD 0x8BC0 +#define GL_COUNTER_RANGE_AMD 0x8BC1 +#define GL_UNSIGNED_INT64_AMD 0x8BC2 +#define GL_PERCENTAGE_AMD 0x8BC3 +#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 +#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 +#define GL_PERFMON_RESULT_AMD 0x8BC6 + +typedef void (GLAPIENTRY * PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GLAPIENTRY * PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); +typedef void (GLAPIENTRY * PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GLAPIENTRY * PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint *bytesWritten); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar *counterString); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint* numCounters, GLint *maxActiveCounters, GLsizei countersSize, GLuint *counters); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei* length, GLchar *groupString); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint* numGroups, GLsizei groupsSize, GLuint *groups); +typedef void (GLAPIENTRY * PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* counterList); + +#define glBeginPerfMonitorAMD GLEW_GET_FUN(__glewBeginPerfMonitorAMD) +#define glDeletePerfMonitorsAMD GLEW_GET_FUN(__glewDeletePerfMonitorsAMD) +#define glEndPerfMonitorAMD GLEW_GET_FUN(__glewEndPerfMonitorAMD) +#define glGenPerfMonitorsAMD GLEW_GET_FUN(__glewGenPerfMonitorsAMD) +#define glGetPerfMonitorCounterDataAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterDataAMD) +#define glGetPerfMonitorCounterInfoAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterInfoAMD) +#define glGetPerfMonitorCounterStringAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterStringAMD) +#define glGetPerfMonitorCountersAMD GLEW_GET_FUN(__glewGetPerfMonitorCountersAMD) +#define glGetPerfMonitorGroupStringAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupStringAMD) +#define glGetPerfMonitorGroupsAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupsAMD) +#define glSelectPerfMonitorCountersAMD GLEW_GET_FUN(__glewSelectPerfMonitorCountersAMD) + +#define GLEW_AMD_performance_monitor GLEW_GET_VAR(__GLEW_AMD_performance_monitor) + +#endif /* GL_AMD_performance_monitor */ + +/* -------------------------- GL_AMD_pinned_memory ------------------------- */ + +#ifndef GL_AMD_pinned_memory +#define GL_AMD_pinned_memory 1 + +#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 + +#define GLEW_AMD_pinned_memory GLEW_GET_VAR(__GLEW_AMD_pinned_memory) + +#endif /* GL_AMD_pinned_memory */ + +/* ----------------------- GL_AMD_program_binary_Z400 ---------------------- */ + +#ifndef GL_AMD_program_binary_Z400 +#define GL_AMD_program_binary_Z400 1 + +#define GL_Z400_BINARY_AMD 0x8740 + +#define GLEW_AMD_program_binary_Z400 GLEW_GET_VAR(__GLEW_AMD_program_binary_Z400) + +#endif /* GL_AMD_program_binary_Z400 */ + +/* ----------------------- GL_AMD_query_buffer_object ---------------------- */ + +#ifndef GL_AMD_query_buffer_object +#define GL_AMD_query_buffer_object 1 + +#define GL_QUERY_BUFFER_AMD 0x9192 +#define GL_QUERY_BUFFER_BINDING_AMD 0x9193 +#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 + +#define GLEW_AMD_query_buffer_object GLEW_GET_VAR(__GLEW_AMD_query_buffer_object) + +#endif /* GL_AMD_query_buffer_object */ + +/* ------------------------ GL_AMD_sample_positions ------------------------ */ + +#ifndef GL_AMD_sample_positions +#define GL_AMD_sample_positions 1 + +#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F + +typedef void (GLAPIENTRY * PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat* val); + +#define glSetMultisamplefvAMD GLEW_GET_FUN(__glewSetMultisamplefvAMD) + +#define GLEW_AMD_sample_positions GLEW_GET_VAR(__GLEW_AMD_sample_positions) + +#endif /* GL_AMD_sample_positions */ + +/* ------------------ GL_AMD_seamless_cubemap_per_texture ------------------ */ + +#ifndef GL_AMD_seamless_cubemap_per_texture +#define GL_AMD_seamless_cubemap_per_texture 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F + +#define GLEW_AMD_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_AMD_seamless_cubemap_per_texture) + +#endif /* GL_AMD_seamless_cubemap_per_texture */ + +/* -------------------- GL_AMD_shader_atomic_counter_ops ------------------- */ + +#ifndef GL_AMD_shader_atomic_counter_ops +#define GL_AMD_shader_atomic_counter_ops 1 + +#define GLEW_AMD_shader_atomic_counter_ops GLEW_GET_VAR(__GLEW_AMD_shader_atomic_counter_ops) + +#endif /* GL_AMD_shader_atomic_counter_ops */ + +/* -------------------------- GL_AMD_shader_ballot ------------------------- */ + +#ifndef GL_AMD_shader_ballot +#define GL_AMD_shader_ballot 1 + +#define GLEW_AMD_shader_ballot GLEW_GET_VAR(__GLEW_AMD_shader_ballot) + +#endif /* GL_AMD_shader_ballot */ + +/* ---------------- GL_AMD_shader_explicit_vertex_parameter ---------------- */ + +#ifndef GL_AMD_shader_explicit_vertex_parameter +#define GL_AMD_shader_explicit_vertex_parameter 1 + +#define GLEW_AMD_shader_explicit_vertex_parameter GLEW_GET_VAR(__GLEW_AMD_shader_explicit_vertex_parameter) + +#endif /* GL_AMD_shader_explicit_vertex_parameter */ + +/* ---------------------- GL_AMD_shader_stencil_export --------------------- */ + +#ifndef GL_AMD_shader_stencil_export +#define GL_AMD_shader_stencil_export 1 + +#define GLEW_AMD_shader_stencil_export GLEW_GET_VAR(__GLEW_AMD_shader_stencil_export) + +#endif /* GL_AMD_shader_stencil_export */ + +/* ------------------- GL_AMD_shader_stencil_value_export ------------------ */ + +#ifndef GL_AMD_shader_stencil_value_export +#define GL_AMD_shader_stencil_value_export 1 + +#define GLEW_AMD_shader_stencil_value_export GLEW_GET_VAR(__GLEW_AMD_shader_stencil_value_export) + +#endif /* GL_AMD_shader_stencil_value_export */ + +/* ---------------------- GL_AMD_shader_trinary_minmax --------------------- */ + +#ifndef GL_AMD_shader_trinary_minmax +#define GL_AMD_shader_trinary_minmax 1 + +#define GLEW_AMD_shader_trinary_minmax GLEW_GET_VAR(__GLEW_AMD_shader_trinary_minmax) + +#endif /* GL_AMD_shader_trinary_minmax */ + +/* ------------------------- GL_AMD_sparse_texture ------------------------- */ + +#ifndef GL_AMD_sparse_texture +#define GL_AMD_sparse_texture 1 + +#define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001 +#define GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A +#define GL_MIN_SPARSE_LEVEL_AMD 0x919B +#define GL_MIN_LOD_WARNING_AMD 0x919C + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGESPARSEAMDPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGESPARSEAMDPROC) (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); + +#define glTexStorageSparseAMD GLEW_GET_FUN(__glewTexStorageSparseAMD) +#define glTextureStorageSparseAMD GLEW_GET_FUN(__glewTextureStorageSparseAMD) + +#define GLEW_AMD_sparse_texture GLEW_GET_VAR(__GLEW_AMD_sparse_texture) + +#endif /* GL_AMD_sparse_texture */ + +/* ------------------- GL_AMD_stencil_operation_extended ------------------- */ + +#ifndef GL_AMD_stencil_operation_extended +#define GL_AMD_stencil_operation_extended 1 + +#define GL_SET_AMD 0x874A +#define GL_REPLACE_VALUE_AMD 0x874B +#define GL_STENCIL_OP_VALUE_AMD 0x874C +#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D + +typedef void (GLAPIENTRY * PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value); + +#define glStencilOpValueAMD GLEW_GET_FUN(__glewStencilOpValueAMD) + +#define GLEW_AMD_stencil_operation_extended GLEW_GET_VAR(__GLEW_AMD_stencil_operation_extended) + +#endif /* GL_AMD_stencil_operation_extended */ + +/* --------------------- GL_AMD_texture_gather_bias_lod -------------------- */ + +#ifndef GL_AMD_texture_gather_bias_lod +#define GL_AMD_texture_gather_bias_lod 1 + +#define GLEW_AMD_texture_gather_bias_lod GLEW_GET_VAR(__GLEW_AMD_texture_gather_bias_lod) + +#endif /* GL_AMD_texture_gather_bias_lod */ + +/* ------------------------ GL_AMD_texture_texture4 ------------------------ */ + +#ifndef GL_AMD_texture_texture4 +#define GL_AMD_texture_texture4 1 + +#define GLEW_AMD_texture_texture4 GLEW_GET_VAR(__GLEW_AMD_texture_texture4) + +#endif /* GL_AMD_texture_texture4 */ + +/* --------------- GL_AMD_transform_feedback3_lines_triangles -------------- */ + +#ifndef GL_AMD_transform_feedback3_lines_triangles +#define GL_AMD_transform_feedback3_lines_triangles 1 + +#define GLEW_AMD_transform_feedback3_lines_triangles GLEW_GET_VAR(__GLEW_AMD_transform_feedback3_lines_triangles) + +#endif /* GL_AMD_transform_feedback3_lines_triangles */ + +/* ----------------------- GL_AMD_transform_feedback4 ---------------------- */ + +#ifndef GL_AMD_transform_feedback4 +#define GL_AMD_transform_feedback4 1 + +#define GL_STREAM_RASTERIZATION_AMD 0x91A0 + +#define GLEW_AMD_transform_feedback4 GLEW_GET_VAR(__GLEW_AMD_transform_feedback4) + +#endif /* GL_AMD_transform_feedback4 */ + +/* ----------------------- GL_AMD_vertex_shader_layer ---------------------- */ + +#ifndef GL_AMD_vertex_shader_layer +#define GL_AMD_vertex_shader_layer 1 + +#define GLEW_AMD_vertex_shader_layer GLEW_GET_VAR(__GLEW_AMD_vertex_shader_layer) + +#endif /* GL_AMD_vertex_shader_layer */ + +/* -------------------- GL_AMD_vertex_shader_tessellator ------------------- */ + +#ifndef GL_AMD_vertex_shader_tessellator +#define GL_AMD_vertex_shader_tessellator 1 + +#define GL_SAMPLER_BUFFER_AMD 0x9001 +#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 +#define GL_TESSELLATION_MODE_AMD 0x9004 +#define GL_TESSELLATION_FACTOR_AMD 0x9005 +#define GL_DISCRETE_AMD 0x9006 +#define GL_CONTINUOUS_AMD 0x9007 + +typedef void (GLAPIENTRY * PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); +typedef void (GLAPIENTRY * PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); + +#define glTessellationFactorAMD GLEW_GET_FUN(__glewTessellationFactorAMD) +#define glTessellationModeAMD GLEW_GET_FUN(__glewTessellationModeAMD) + +#define GLEW_AMD_vertex_shader_tessellator GLEW_GET_VAR(__GLEW_AMD_vertex_shader_tessellator) + +#endif /* GL_AMD_vertex_shader_tessellator */ + +/* ------------------ GL_AMD_vertex_shader_viewport_index ------------------ */ + +#ifndef GL_AMD_vertex_shader_viewport_index +#define GL_AMD_vertex_shader_viewport_index 1 + +#define GLEW_AMD_vertex_shader_viewport_index GLEW_GET_VAR(__GLEW_AMD_vertex_shader_viewport_index) + +#endif /* GL_AMD_vertex_shader_viewport_index */ + +/* -------------------- GL_ANDROID_extension_pack_es31a -------------------- */ + +#ifndef GL_ANDROID_extension_pack_es31a +#define GL_ANDROID_extension_pack_es31a 1 + +#define GLEW_ANDROID_extension_pack_es31a GLEW_GET_VAR(__GLEW_ANDROID_extension_pack_es31a) + +#endif /* GL_ANDROID_extension_pack_es31a */ + +/* ------------------------- GL_ANGLE_depth_texture ------------------------ */ + +#ifndef GL_ANGLE_depth_texture +#define GL_ANGLE_depth_texture 1 + +#define GLEW_ANGLE_depth_texture GLEW_GET_VAR(__GLEW_ANGLE_depth_texture) + +#endif /* GL_ANGLE_depth_texture */ + +/* ----------------------- GL_ANGLE_framebuffer_blit ----------------------- */ + +#ifndef GL_ANGLE_framebuffer_blit +#define GL_ANGLE_framebuffer_blit 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6 +#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA + +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + +#define glBlitFramebufferANGLE GLEW_GET_FUN(__glewBlitFramebufferANGLE) + +#define GLEW_ANGLE_framebuffer_blit GLEW_GET_VAR(__GLEW_ANGLE_framebuffer_blit) + +#endif /* GL_ANGLE_framebuffer_blit */ + +/* -------------------- GL_ANGLE_framebuffer_multisample ------------------- */ + +#ifndef GL_ANGLE_framebuffer_multisample +#define GL_ANGLE_framebuffer_multisample 1 + +#define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56 +#define GL_MAX_SAMPLES_ANGLE 0x8D57 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleANGLE GLEW_GET_FUN(__glewRenderbufferStorageMultisampleANGLE) + +#define GLEW_ANGLE_framebuffer_multisample GLEW_GET_VAR(__GLEW_ANGLE_framebuffer_multisample) + +#endif /* GL_ANGLE_framebuffer_multisample */ + +/* ----------------------- GL_ANGLE_instanced_arrays ----------------------- */ + +#ifndef GL_ANGLE_instanced_arrays +#define GL_ANGLE_instanced_arrays 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor); + +#define glDrawArraysInstancedANGLE GLEW_GET_FUN(__glewDrawArraysInstancedANGLE) +#define glDrawElementsInstancedANGLE GLEW_GET_FUN(__glewDrawElementsInstancedANGLE) +#define glVertexAttribDivisorANGLE GLEW_GET_FUN(__glewVertexAttribDivisorANGLE) + +#define GLEW_ANGLE_instanced_arrays GLEW_GET_VAR(__GLEW_ANGLE_instanced_arrays) + +#endif /* GL_ANGLE_instanced_arrays */ + +/* -------------------- GL_ANGLE_pack_reverse_row_order -------------------- */ + +#ifndef GL_ANGLE_pack_reverse_row_order +#define GL_ANGLE_pack_reverse_row_order 1 + +#define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4 + +#define GLEW_ANGLE_pack_reverse_row_order GLEW_GET_VAR(__GLEW_ANGLE_pack_reverse_row_order) + +#endif /* GL_ANGLE_pack_reverse_row_order */ + +/* ------------------------ GL_ANGLE_program_binary ------------------------ */ + +#ifndef GL_ANGLE_program_binary +#define GL_ANGLE_program_binary 1 + +#define GL_PROGRAM_BINARY_ANGLE 0x93A6 + +#define GLEW_ANGLE_program_binary GLEW_GET_VAR(__GLEW_ANGLE_program_binary) + +#endif /* GL_ANGLE_program_binary */ + +/* ------------------- GL_ANGLE_texture_compression_dxt1 ------------------- */ + +#ifndef GL_ANGLE_texture_compression_dxt1 +#define GL_ANGLE_texture_compression_dxt1 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 + +#define GLEW_ANGLE_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt1) + +#endif /* GL_ANGLE_texture_compression_dxt1 */ + +/* ------------------- GL_ANGLE_texture_compression_dxt3 ------------------- */ + +#ifndef GL_ANGLE_texture_compression_dxt3 +#define GL_ANGLE_texture_compression_dxt3 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 + +#define GLEW_ANGLE_texture_compression_dxt3 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt3) + +#endif /* GL_ANGLE_texture_compression_dxt3 */ + +/* ------------------- GL_ANGLE_texture_compression_dxt5 ------------------- */ + +#ifndef GL_ANGLE_texture_compression_dxt5 +#define GL_ANGLE_texture_compression_dxt5 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 + +#define GLEW_ANGLE_texture_compression_dxt5 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt5) + +#endif /* GL_ANGLE_texture_compression_dxt5 */ + +/* ------------------------- GL_ANGLE_texture_usage ------------------------ */ + +#ifndef GL_ANGLE_texture_usage +#define GL_ANGLE_texture_usage 1 + +#define GL_TEXTURE_USAGE_ANGLE 0x93A2 +#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3 + +#define GLEW_ANGLE_texture_usage GLEW_GET_VAR(__GLEW_ANGLE_texture_usage) + +#endif /* GL_ANGLE_texture_usage */ + +/* -------------------------- GL_ANGLE_timer_query ------------------------- */ + +#ifndef GL_ANGLE_timer_query +#define GL_ANGLE_timer_query 1 + +#define GL_QUERY_COUNTER_BITS_ANGLE 0x8864 +#define GL_CURRENT_QUERY_ANGLE 0x8865 +#define GL_QUERY_RESULT_ANGLE 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ANGLE 0x8867 +#define GL_TIME_ELAPSED_ANGLE 0x88BF +#define GL_TIMESTAMP_ANGLE 0x8E28 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYANGLEPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESANGLEPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYANGLEPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENQUERIESANGLEPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VANGLEPROC) (GLuint id, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVANGLEPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VANGLEPROC) (GLuint id, GLenum pname, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVANGLEPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVANGLEPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYANGLEPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERANGLEPROC) (GLuint id, GLenum target); + +#define glBeginQueryANGLE GLEW_GET_FUN(__glewBeginQueryANGLE) +#define glDeleteQueriesANGLE GLEW_GET_FUN(__glewDeleteQueriesANGLE) +#define glEndQueryANGLE GLEW_GET_FUN(__glewEndQueryANGLE) +#define glGenQueriesANGLE GLEW_GET_FUN(__glewGenQueriesANGLE) +#define glGetQueryObjecti64vANGLE GLEW_GET_FUN(__glewGetQueryObjecti64vANGLE) +#define glGetQueryObjectivANGLE GLEW_GET_FUN(__glewGetQueryObjectivANGLE) +#define glGetQueryObjectui64vANGLE GLEW_GET_FUN(__glewGetQueryObjectui64vANGLE) +#define glGetQueryObjectuivANGLE GLEW_GET_FUN(__glewGetQueryObjectuivANGLE) +#define glGetQueryivANGLE GLEW_GET_FUN(__glewGetQueryivANGLE) +#define glIsQueryANGLE GLEW_GET_FUN(__glewIsQueryANGLE) +#define glQueryCounterANGLE GLEW_GET_FUN(__glewQueryCounterANGLE) + +#define GLEW_ANGLE_timer_query GLEW_GET_VAR(__GLEW_ANGLE_timer_query) + +#endif /* GL_ANGLE_timer_query */ + +/* ------------------- GL_ANGLE_translated_shader_source ------------------- */ + +#ifndef GL_ANGLE_translated_shader_source +#define GL_ANGLE_translated_shader_source 1 + +#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0 + +typedef void (GLAPIENTRY * PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source); + +#define glGetTranslatedShaderSourceANGLE GLEW_GET_FUN(__glewGetTranslatedShaderSourceANGLE) + +#define GLEW_ANGLE_translated_shader_source GLEW_GET_VAR(__GLEW_ANGLE_translated_shader_source) + +#endif /* GL_ANGLE_translated_shader_source */ + +/* ----------------------- GL_APPLE_aux_depth_stencil ---------------------- */ + +#ifndef GL_APPLE_aux_depth_stencil +#define GL_APPLE_aux_depth_stencil 1 + +#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 + +#define GLEW_APPLE_aux_depth_stencil GLEW_GET_VAR(__GLEW_APPLE_aux_depth_stencil) + +#endif /* GL_APPLE_aux_depth_stencil */ + /* ------------------------ GL_APPLE_client_storage ------------------------ */ #ifndef GL_APPLE_client_storage @@ -2264,18 +3342,59 @@ typedef void (GLAPIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); #endif /* GL_APPLE_client_storage */ +/* ------------------------- GL_APPLE_clip_distance ------------------------ */ + +#ifndef GL_APPLE_clip_distance +#define GL_APPLE_clip_distance 1 + +#define GL_MAX_CLIP_DISTANCES_APPLE 0x0D32 +#define GL_CLIP_DISTANCE0_APPLE 0x3000 +#define GL_CLIP_DISTANCE1_APPLE 0x3001 +#define GL_CLIP_DISTANCE2_APPLE 0x3002 +#define GL_CLIP_DISTANCE3_APPLE 0x3003 +#define GL_CLIP_DISTANCE4_APPLE 0x3004 +#define GL_CLIP_DISTANCE5_APPLE 0x3005 +#define GL_CLIP_DISTANCE6_APPLE 0x3006 +#define GL_CLIP_DISTANCE7_APPLE 0x3007 + +#define GLEW_APPLE_clip_distance GLEW_GET_VAR(__GLEW_APPLE_clip_distance) + +#endif /* GL_APPLE_clip_distance */ + +/* ------------------- GL_APPLE_color_buffer_packed_float ------------------ */ + +#ifndef GL_APPLE_color_buffer_packed_float +#define GL_APPLE_color_buffer_packed_float 1 + +#define GLEW_APPLE_color_buffer_packed_float GLEW_GET_VAR(__GLEW_APPLE_color_buffer_packed_float) + +#endif /* GL_APPLE_color_buffer_packed_float */ + +/* ---------------------- GL_APPLE_copy_texture_levels --------------------- */ + +#ifndef GL_APPLE_copy_texture_levels +#define GL_APPLE_copy_texture_levels 1 + +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); + +#define glCopyTextureLevelsAPPLE GLEW_GET_FUN(__glewCopyTextureLevelsAPPLE) + +#define GLEW_APPLE_copy_texture_levels GLEW_GET_VAR(__GLEW_APPLE_copy_texture_levels) + +#endif /* GL_APPLE_copy_texture_levels */ + /* ------------------------- GL_APPLE_element_array ------------------------ */ #ifndef GL_APPLE_element_array #define GL_APPLE_element_array 1 -#define GL_ELEMENT_ARRAY_APPLE 0x8768 -#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769 -#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A +#define GL_ELEMENT_ARRAY_APPLE 0x8A0C +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); -typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const void* pointer); +typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const void *pointer); typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); typedef void (GLAPIENTRY * PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint* first, const GLsizei *count, GLsizei primcount); @@ -2361,6 +3480,53 @@ typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, #endif /* GL_APPLE_flush_buffer_range */ +/* -------------------- GL_APPLE_framebuffer_multisample ------------------- */ + +#ifndef GL_APPLE_framebuffer_multisample +#define GL_APPLE_framebuffer_multisample 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6 +#define GL_READ_FRAMEBUFFER_APPLE 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA +#define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56 +#define GL_MAX_SAMPLES_APPLE 0x8D57 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void); + +#define glRenderbufferStorageMultisampleAPPLE GLEW_GET_FUN(__glewRenderbufferStorageMultisampleAPPLE) +#define glResolveMultisampleFramebufferAPPLE GLEW_GET_FUN(__glewResolveMultisampleFramebufferAPPLE) + +#define GLEW_APPLE_framebuffer_multisample GLEW_GET_VAR(__GLEW_APPLE_framebuffer_multisample) + +#endif /* GL_APPLE_framebuffer_multisample */ + +/* ----------------------- GL_APPLE_object_purgeable ----------------------- */ + +#ifndef GL_APPLE_object_purgeable +#define GL_APPLE_object_purgeable 1 + +#define GL_BUFFER_OBJECT_APPLE 0x85B3 +#define GL_RELEASED_APPLE 0x8A19 +#define GL_VOLATILE_APPLE 0x8A1A +#define GL_RETAINED_APPLE 0x8A1B +#define GL_UNDEFINED_APPLE 0x8A1C +#define GL_PURGEABLE_APPLE 0x8A1D + +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint* params); +typedef GLenum (GLAPIENTRY * PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); +typedef GLenum (GLAPIENTRY * PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); + +#define glGetObjectParameterivAPPLE GLEW_GET_FUN(__glewGetObjectParameterivAPPLE) +#define glObjectPurgeableAPPLE GLEW_GET_FUN(__glewObjectPurgeableAPPLE) +#define glObjectUnpurgeableAPPLE GLEW_GET_FUN(__glewObjectUnpurgeableAPPLE) + +#define GLEW_APPLE_object_purgeable GLEW_GET_VAR(__GLEW_APPLE_object_purgeable) + +#endif /* GL_APPLE_object_purgeable */ + /* ------------------------- GL_APPLE_pixel_buffer ------------------------- */ #ifndef GL_APPLE_pixel_buffer @@ -2372,6 +3538,32 @@ typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, #endif /* GL_APPLE_pixel_buffer */ +/* ---------------------------- GL_APPLE_rgb_422 --------------------------- */ + +#ifndef GL_APPLE_rgb_422 +#define GL_APPLE_rgb_422 1 + +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#define GL_RGB_422_APPLE 0x8A1F +#define GL_RGB_RAW_422_APPLE 0x8A51 + +#define GLEW_APPLE_rgb_422 GLEW_GET_VAR(__GLEW_APPLE_rgb_422) + +#endif /* GL_APPLE_rgb_422 */ + +/* --------------------------- GL_APPLE_row_bytes -------------------------- */ + +#ifndef GL_APPLE_row_bytes +#define GL_APPLE_row_bytes 1 + +#define GL_PACK_ROW_BYTES_APPLE 0x8A15 +#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 + +#define GLEW_APPLE_row_bytes GLEW_GET_VAR(__GLEW_APPLE_row_bytes) + +#endif /* GL_APPLE_row_bytes */ + /* ------------------------ GL_APPLE_specular_vector ----------------------- */ #ifndef GL_APPLE_specular_vector @@ -2383,6 +3575,94 @@ typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, #endif /* GL_APPLE_specular_vector */ +/* ----------------------------- GL_APPLE_sync ----------------------------- */ + +#ifndef GL_APPLE_sync +#define GL_APPLE_sync 1 + +#define GL_SYNC_FLUSH_COMMANDS_BIT_APPLE 0x00000001 +#define GL_SYNC_OBJECT_APPLE 0x8A53 +#define GL_MAX_SERVER_WAIT_TIMEOUT_APPLE 0x9111 +#define GL_OBJECT_TYPE_APPLE 0x9112 +#define GL_SYNC_CONDITION_APPLE 0x9113 +#define GL_SYNC_STATUS_APPLE 0x9114 +#define GL_SYNC_FLAGS_APPLE 0x9115 +#define GL_SYNC_FENCE_APPLE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE 0x9117 +#define GL_UNSIGNALED_APPLE 0x9118 +#define GL_SIGNALED_APPLE 0x9119 +#define GL_ALREADY_SIGNALED_APPLE 0x911A +#define GL_TIMEOUT_EXPIRED_APPLE 0x911B +#define GL_CONDITION_SATISFIED_APPLE 0x911C +#define GL_WAIT_FAILED_APPLE 0x911D +#define GL_TIMEOUT_IGNORED_APPLE 0xFFFFFFFFFFFFFFFFull + +typedef GLenum (GLAPIENTRY * PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync GLsync, GLbitfield flags, GLuint64 timeout); +typedef void (GLAPIENTRY * PFNGLDELETESYNCAPPLEPROC) (GLsync GLsync); +typedef GLsync (GLAPIENTRY * PFNGLFENCESYNCAPPLEPROC) (GLenum condition, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETSYNCIVAPPLEPROC) (GLsync GLsync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values); +typedef GLboolean (GLAPIENTRY * PFNGLISSYNCAPPLEPROC) (GLsync GLsync); +typedef void (GLAPIENTRY * PFNGLWAITSYNCAPPLEPROC) (GLsync GLsync, GLbitfield flags, GLuint64 timeout); + +#define glClientWaitSyncAPPLE GLEW_GET_FUN(__glewClientWaitSyncAPPLE) +#define glDeleteSyncAPPLE GLEW_GET_FUN(__glewDeleteSyncAPPLE) +#define glFenceSyncAPPLE GLEW_GET_FUN(__glewFenceSyncAPPLE) +#define glGetInteger64vAPPLE GLEW_GET_FUN(__glewGetInteger64vAPPLE) +#define glGetSyncivAPPLE GLEW_GET_FUN(__glewGetSyncivAPPLE) +#define glIsSyncAPPLE GLEW_GET_FUN(__glewIsSyncAPPLE) +#define glWaitSyncAPPLE GLEW_GET_FUN(__glewWaitSyncAPPLE) + +#define GLEW_APPLE_sync GLEW_GET_VAR(__GLEW_APPLE_sync) + +#endif /* GL_APPLE_sync */ + +/* -------------------- GL_APPLE_texture_2D_limited_npot ------------------- */ + +#ifndef GL_APPLE_texture_2D_limited_npot +#define GL_APPLE_texture_2D_limited_npot 1 + +#define GLEW_APPLE_texture_2D_limited_npot GLEW_GET_VAR(__GLEW_APPLE_texture_2D_limited_npot) + +#endif /* GL_APPLE_texture_2D_limited_npot */ + +/* -------------------- GL_APPLE_texture_format_BGRA8888 ------------------- */ + +#ifndef GL_APPLE_texture_format_BGRA8888 +#define GL_APPLE_texture_format_BGRA8888 1 + +#define GL_BGRA_EXT 0x80E1 +#define GL_BGRA8_EXT 0x93A1 + +#define GLEW_APPLE_texture_format_BGRA8888 GLEW_GET_VAR(__GLEW_APPLE_texture_format_BGRA8888) + +#endif /* GL_APPLE_texture_format_BGRA8888 */ + +/* ----------------------- GL_APPLE_texture_max_level ---------------------- */ + +#ifndef GL_APPLE_texture_max_level +#define GL_APPLE_texture_max_level 1 + +#define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D + +#define GLEW_APPLE_texture_max_level GLEW_GET_VAR(__GLEW_APPLE_texture_max_level) + +#endif /* GL_APPLE_texture_max_level */ + +/* --------------------- GL_APPLE_texture_packed_float --------------------- */ + +#ifndef GL_APPLE_texture_packed_float +#define GL_APPLE_texture_packed_float 1 + +#define GL_R11F_G11F_B10F_APPLE 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_APPLE 0x8C3B +#define GL_RGB9_E5_APPLE 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV_APPLE 0x8C3E + +#define GLEW_APPLE_texture_packed_float GLEW_GET_VAR(__GLEW_APPLE_texture_packed_float) + +#endif /* GL_APPLE_texture_packed_float */ + /* ------------------------- GL_APPLE_texture_range ------------------------ */ #ifndef GL_APPLE_texture_range @@ -2395,8 +3675,8 @@ typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, #define GL_STORAGE_CACHED_APPLE 0x85BE #define GL_STORAGE_SHARED_APPLE 0x85BF -typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid **params); -typedef void (GLAPIENTRY * PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, void **params); +typedef void (GLAPIENTRY * PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, void *pointer); #define glGetTexParameterPointervAPPLE GLEW_GET_FUN(__glewGetTexParameterPointervAPPLE) #define glTextureRangeAPPLE GLEW_GET_FUN(__glewTextureRangeAPPLE) @@ -2447,12 +3727,13 @@ typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); #define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F #define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE 0x8520 #define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CLIENT_APPLE 0x85B4 #define GL_STORAGE_CACHED_APPLE 0x85BE #define GL_STORAGE_SHARED_APPLE 0x85BF -typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void* pointer); +typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void* pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); #define glFlushVertexArrayRangeAPPLE GLEW_GET_FUN(__glewFlushVertexArrayRangeAPPLE) #define glVertexArrayParameteriAPPLE GLEW_GET_FUN(__glewVertexArrayParameteriAPPLE) @@ -2462,19 +3743,336 @@ typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void #endif /* GL_APPLE_vertex_array_range */ +/* ------------------- GL_APPLE_vertex_program_evaluators ------------------ */ + +#ifndef GL_APPLE_vertex_program_evaluators +#define GL_APPLE_vertex_program_evaluators 1 + +#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 +#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 +#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 +#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 +#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 +#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 +#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 +#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 +#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 +#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 + +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat* points); + +#define glDisableVertexAttribAPPLE GLEW_GET_FUN(__glewDisableVertexAttribAPPLE) +#define glEnableVertexAttribAPPLE GLEW_GET_FUN(__glewEnableVertexAttribAPPLE) +#define glIsVertexAttribEnabledAPPLE GLEW_GET_FUN(__glewIsVertexAttribEnabledAPPLE) +#define glMapVertexAttrib1dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1dAPPLE) +#define glMapVertexAttrib1fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1fAPPLE) +#define glMapVertexAttrib2dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2dAPPLE) +#define glMapVertexAttrib2fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2fAPPLE) + +#define GLEW_APPLE_vertex_program_evaluators GLEW_GET_VAR(__GLEW_APPLE_vertex_program_evaluators) + +#endif /* GL_APPLE_vertex_program_evaluators */ + /* --------------------------- GL_APPLE_ycbcr_422 -------------------------- */ #ifndef GL_APPLE_ycbcr_422 #define GL_APPLE_ycbcr_422 1 #define GL_YCBCR_422_APPLE 0x85B9 -#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB #define GLEW_APPLE_ycbcr_422 GLEW_GET_VAR(__GLEW_APPLE_ycbcr_422) #endif /* GL_APPLE_ycbcr_422 */ +/* ------------------------ GL_ARB_ES2_compatibility ----------------------- */ + +#ifndef GL_ARB_ES2_compatibility +#define GL_ARB_ES2_compatibility 1 + +#define GL_FIXED 0x140C +#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B +#define GL_RGB565 0x8D62 +#define GL_LOW_FLOAT 0x8DF0 +#define GL_MEDIUM_FLOAT 0x8DF1 +#define GL_HIGH_FLOAT 0x8DF2 +#define GL_LOW_INT 0x8DF3 +#define GL_MEDIUM_INT 0x8DF4 +#define GL_HIGH_INT 0x8DF5 +#define GL_SHADER_BINARY_FORMATS 0x8DF8 +#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 +#define GL_SHADER_COMPILER 0x8DFA +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD + +typedef int GLfixed; + +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFPROC) (GLclampf d); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFPROC) (GLclampf n, GLclampf f); +typedef void (GLAPIENTRY * PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint* range, GLint *precision); +typedef void (GLAPIENTRY * PFNGLRELEASESHADERCOMPILERPROC) (void); +typedef void (GLAPIENTRY * PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint* shaders, GLenum binaryformat, const void*binary, GLsizei length); + +#define glClearDepthf GLEW_GET_FUN(__glewClearDepthf) +#define glDepthRangef GLEW_GET_FUN(__glewDepthRangef) +#define glGetShaderPrecisionFormat GLEW_GET_FUN(__glewGetShaderPrecisionFormat) +#define glReleaseShaderCompiler GLEW_GET_FUN(__glewReleaseShaderCompiler) +#define glShaderBinary GLEW_GET_FUN(__glewShaderBinary) + +#define GLEW_ARB_ES2_compatibility GLEW_GET_VAR(__GLEW_ARB_ES2_compatibility) + +#endif /* GL_ARB_ES2_compatibility */ + +/* ----------------------- GL_ARB_ES3_1_compatibility ---------------------- */ + +#ifndef GL_ARB_ES3_1_compatibility +#define GL_ARB_ES3_1_compatibility 1 + +typedef void (GLAPIENTRY * PFNGLMEMORYBARRIERBYREGIONPROC) (GLbitfield barriers); + +#define glMemoryBarrierByRegion GLEW_GET_FUN(__glewMemoryBarrierByRegion) + +#define GLEW_ARB_ES3_1_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_1_compatibility) + +#endif /* GL_ARB_ES3_1_compatibility */ + +/* ----------------------- GL_ARB_ES3_2_compatibility ---------------------- */ + +#ifndef GL_ARB_ES3_2_compatibility +#define GL_ARB_ES3_2_compatibility 1 + +#define GL_PRIMITIVE_BOUNDING_BOX_ARB 0x92BE +#define GL_MULTISAMPLE_LINE_WIDTH_RANGE_ARB 0x9381 +#define GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB 0x9382 + +typedef void (GLAPIENTRY * PFNGLPRIMITIVEBOUNDINGBOXARBPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); + +#define glPrimitiveBoundingBoxARB GLEW_GET_FUN(__glewPrimitiveBoundingBoxARB) + +#define GLEW_ARB_ES3_2_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_2_compatibility) + +#endif /* GL_ARB_ES3_2_compatibility */ + +/* ------------------------ GL_ARB_ES3_compatibility ----------------------- */ + +#ifndef GL_ARB_ES3_compatibility +#define GL_ARB_ES3_compatibility 1 + +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF +#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 +#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A +#define GL_MAX_ELEMENT_INDEX 0x8D6B +#define GL_COMPRESSED_R11_EAC 0x9270 +#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 +#define GL_COMPRESSED_RG11_EAC 0x9272 +#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 +#define GL_COMPRESSED_RGB8_ETC2 0x9274 +#define GL_COMPRESSED_SRGB8_ETC2 0x9275 +#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 +#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 +#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 +#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 + +#define GLEW_ARB_ES3_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_compatibility) + +#endif /* GL_ARB_ES3_compatibility */ + +/* ------------------------ GL_ARB_arrays_of_arrays ------------------------ */ + +#ifndef GL_ARB_arrays_of_arrays +#define GL_ARB_arrays_of_arrays 1 + +#define GLEW_ARB_arrays_of_arrays GLEW_GET_VAR(__GLEW_ARB_arrays_of_arrays) + +#endif /* GL_ARB_arrays_of_arrays */ + +/* -------------------------- GL_ARB_base_instance ------------------------- */ + +#ifndef GL_ARB_base_instance +#define GL_ARB_base_instance 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLint basevertex, GLuint baseinstance); + +#define glDrawArraysInstancedBaseInstance GLEW_GET_FUN(__glewDrawArraysInstancedBaseInstance) +#define glDrawElementsInstancedBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseInstance) +#define glDrawElementsInstancedBaseVertexBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexBaseInstance) + +#define GLEW_ARB_base_instance GLEW_GET_VAR(__GLEW_ARB_base_instance) + +#endif /* GL_ARB_base_instance */ + +/* ------------------------ GL_ARB_bindless_texture ------------------------ */ + +#ifndef GL_ARB_bindless_texture +#define GL_ARB_bindless_texture 1 + +#define GL_UNSIGNED_INT64_ARB 0x140F + +typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLEARBPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLEARBPROC) (GLuint texture); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLEARBPROC) (GLuint texture, GLuint sampler); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VARBPROC) (GLuint index, GLenum pname, GLuint64EXT* params); +typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64ARBPROC) (GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64ARBPROC) (GLuint index, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VARBPROC) (GLuint index, const GLuint64EXT* v); + +#define glGetImageHandleARB GLEW_GET_FUN(__glewGetImageHandleARB) +#define glGetTextureHandleARB GLEW_GET_FUN(__glewGetTextureHandleARB) +#define glGetTextureSamplerHandleARB GLEW_GET_FUN(__glewGetTextureSamplerHandleARB) +#define glGetVertexAttribLui64vARB GLEW_GET_FUN(__glewGetVertexAttribLui64vARB) +#define glIsImageHandleResidentARB GLEW_GET_FUN(__glewIsImageHandleResidentARB) +#define glIsTextureHandleResidentARB GLEW_GET_FUN(__glewIsTextureHandleResidentARB) +#define glMakeImageHandleNonResidentARB GLEW_GET_FUN(__glewMakeImageHandleNonResidentARB) +#define glMakeImageHandleResidentARB GLEW_GET_FUN(__glewMakeImageHandleResidentARB) +#define glMakeTextureHandleNonResidentARB GLEW_GET_FUN(__glewMakeTextureHandleNonResidentARB) +#define glMakeTextureHandleResidentARB GLEW_GET_FUN(__glewMakeTextureHandleResidentARB) +#define glProgramUniformHandleui64ARB GLEW_GET_FUN(__glewProgramUniformHandleui64ARB) +#define glProgramUniformHandleui64vARB GLEW_GET_FUN(__glewProgramUniformHandleui64vARB) +#define glUniformHandleui64ARB GLEW_GET_FUN(__glewUniformHandleui64ARB) +#define glUniformHandleui64vARB GLEW_GET_FUN(__glewUniformHandleui64vARB) +#define glVertexAttribL1ui64ARB GLEW_GET_FUN(__glewVertexAttribL1ui64ARB) +#define glVertexAttribL1ui64vARB GLEW_GET_FUN(__glewVertexAttribL1ui64vARB) + +#define GLEW_ARB_bindless_texture GLEW_GET_VAR(__GLEW_ARB_bindless_texture) + +#endif /* GL_ARB_bindless_texture */ + +/* ----------------------- GL_ARB_blend_func_extended ---------------------- */ + +#ifndef GL_ARB_blend_func_extended +#define GL_ARB_blend_func_extended 1 + +#define GL_SRC1_COLOR 0x88F9 +#define GL_ONE_MINUS_SRC1_COLOR 0x88FA +#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB +#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC + +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar * name); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar * name); + +#define glBindFragDataLocationIndexed GLEW_GET_FUN(__glewBindFragDataLocationIndexed) +#define glGetFragDataIndex GLEW_GET_FUN(__glewGetFragDataIndex) + +#define GLEW_ARB_blend_func_extended GLEW_GET_VAR(__GLEW_ARB_blend_func_extended) + +#endif /* GL_ARB_blend_func_extended */ + +/* ------------------------- GL_ARB_buffer_storage ------------------------- */ + +#ifndef GL_ARB_buffer_storage +#define GL_ARB_buffer_storage 1 + +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_PERSISTENT_BIT 0x00000040 +#define GL_MAP_COHERENT_BIT 0x00000080 +#define GL_DYNAMIC_STORAGE_BIT 0x0100 +#define GL_CLIENT_STORAGE_BIT 0x0200 +#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000 +#define GL_BUFFER_IMMUTABLE_STORAGE 0x821F +#define GL_BUFFER_STORAGE_FLAGS 0x8220 + +typedef void (GLAPIENTRY * PFNGLBUFFERSTORAGEPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); + +#define glBufferStorage GLEW_GET_FUN(__glewBufferStorage) + +#define GLEW_ARB_buffer_storage GLEW_GET_VAR(__GLEW_ARB_buffer_storage) + +#endif /* GL_ARB_buffer_storage */ + +/* ---------------------------- GL_ARB_cl_event ---------------------------- */ + +#ifndef GL_ARB_cl_event +#define GL_ARB_cl_event 1 + +#define GL_SYNC_CL_EVENT_ARB 0x8240 +#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 + +typedef struct _cl_context *cl_context; +typedef struct _cl_event *cl_event; + +typedef GLsync (GLAPIENTRY * PFNGLCREATESYNCFROMCLEVENTARBPROC) (cl_context context, cl_event event, GLbitfield flags); + +#define glCreateSyncFromCLeventARB GLEW_GET_FUN(__glewCreateSyncFromCLeventARB) + +#define GLEW_ARB_cl_event GLEW_GET_VAR(__GLEW_ARB_cl_event) + +#endif /* GL_ARB_cl_event */ + +/* ----------------------- GL_ARB_clear_buffer_object ---------------------- */ + +#ifndef GL_ARB_clear_buffer_object +#define GL_ARB_clear_buffer_object 1 + +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); + +#define glClearBufferData GLEW_GET_FUN(__glewClearBufferData) +#define glClearBufferSubData GLEW_GET_FUN(__glewClearBufferSubData) +#define glClearNamedBufferDataEXT GLEW_GET_FUN(__glewClearNamedBufferDataEXT) +#define glClearNamedBufferSubDataEXT GLEW_GET_FUN(__glewClearNamedBufferSubDataEXT) + +#define GLEW_ARB_clear_buffer_object GLEW_GET_VAR(__GLEW_ARB_clear_buffer_object) + +#endif /* GL_ARB_clear_buffer_object */ + +/* -------------------------- GL_ARB_clear_texture ------------------------- */ + +#ifndef GL_ARB_clear_texture +#define GL_ARB_clear_texture 1 + +#define GL_CLEAR_TEXTURE 0x9365 + +typedef void (GLAPIENTRY * PFNGLCLEARTEXIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARTEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); + +#define glClearTexImage GLEW_GET_FUN(__glewClearTexImage) +#define glClearTexSubImage GLEW_GET_FUN(__glewClearTexSubImage) + +#define GLEW_ARB_clear_texture GLEW_GET_VAR(__GLEW_ARB_clear_texture) + +#endif /* GL_ARB_clear_texture */ + +/* -------------------------- GL_ARB_clip_control -------------------------- */ + +#ifndef GL_ARB_clip_control +#define GL_ARB_clip_control 1 + +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_CLIP_ORIGIN 0x935C +#define GL_CLIP_DEPTH_MODE 0x935D +#define GL_NEGATIVE_ONE_TO_ONE 0x935E +#define GL_ZERO_TO_ONE 0x935F + +typedef void (GLAPIENTRY * PFNGLCLIPCONTROLPROC) (GLenum origin, GLenum depth); + +#define glClipControl GLEW_GET_FUN(__glewClipControl) + +#define GLEW_ARB_clip_control GLEW_GET_VAR(__GLEW_ARB_clip_control) + +#endif /* GL_ARB_clip_control */ + /* ----------------------- GL_ARB_color_buffer_float ----------------------- */ #ifndef GL_ARB_color_buffer_float @@ -2494,6 +4092,193 @@ typedef void (GLAPIENTRY * PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp) #endif /* GL_ARB_color_buffer_float */ +/* -------------------------- GL_ARB_compatibility ------------------------- */ + +#ifndef GL_ARB_compatibility +#define GL_ARB_compatibility 1 + +#define GLEW_ARB_compatibility GLEW_GET_VAR(__GLEW_ARB_compatibility) + +#endif /* GL_ARB_compatibility */ + +/* ---------------- GL_ARB_compressed_texture_pixel_storage ---------------- */ + +#ifndef GL_ARB_compressed_texture_pixel_storage +#define GL_ARB_compressed_texture_pixel_storage 1 + +#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 +#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 +#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 +#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A +#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B +#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C +#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D +#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E + +#define GLEW_ARB_compressed_texture_pixel_storage GLEW_GET_VAR(__GLEW_ARB_compressed_texture_pixel_storage) + +#endif /* GL_ARB_compressed_texture_pixel_storage */ + +/* ------------------------- GL_ARB_compute_shader ------------------------- */ + +#ifndef GL_ARB_compute_shader +#define GL_ARB_compute_shader 1 + +#define GL_COMPUTE_SHADER_BIT 0x00000020 +#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 +#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 +#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 +#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 +#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 +#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267 +#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB +#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED +#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE +#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF +#define GL_COMPUTE_SHADER 0x91B9 +#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB +#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC +#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD +#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE +#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF + +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); + +#define glDispatchCompute GLEW_GET_FUN(__glewDispatchCompute) +#define glDispatchComputeIndirect GLEW_GET_FUN(__glewDispatchComputeIndirect) + +#define GLEW_ARB_compute_shader GLEW_GET_VAR(__GLEW_ARB_compute_shader) + +#endif /* GL_ARB_compute_shader */ + +/* ------------------- GL_ARB_compute_variable_group_size ------------------ */ + +#ifndef GL_ARB_compute_variable_group_size +#define GL_ARB_compute_variable_group_size 1 + +#define GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB 0x90EB +#define GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB 0x91BF +#define GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB 0x9344 +#define GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB 0x9345 + +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); + +#define glDispatchComputeGroupSizeARB GLEW_GET_FUN(__glewDispatchComputeGroupSizeARB) + +#define GLEW_ARB_compute_variable_group_size GLEW_GET_VAR(__GLEW_ARB_compute_variable_group_size) + +#endif /* GL_ARB_compute_variable_group_size */ + +/* ------------------- GL_ARB_conditional_render_inverted ------------------ */ + +#ifndef GL_ARB_conditional_render_inverted +#define GL_ARB_conditional_render_inverted 1 + +#define GL_QUERY_WAIT_INVERTED 0x8E17 +#define GL_QUERY_NO_WAIT_INVERTED 0x8E18 +#define GL_QUERY_BY_REGION_WAIT_INVERTED 0x8E19 +#define GL_QUERY_BY_REGION_NO_WAIT_INVERTED 0x8E1A + +#define GLEW_ARB_conditional_render_inverted GLEW_GET_VAR(__GLEW_ARB_conditional_render_inverted) + +#endif /* GL_ARB_conditional_render_inverted */ + +/* ----------------------- GL_ARB_conservative_depth ----------------------- */ + +#ifndef GL_ARB_conservative_depth +#define GL_ARB_conservative_depth 1 + +#define GLEW_ARB_conservative_depth GLEW_GET_VAR(__GLEW_ARB_conservative_depth) + +#endif /* GL_ARB_conservative_depth */ + +/* --------------------------- GL_ARB_copy_buffer -------------------------- */ + +#ifndef GL_ARB_copy_buffer +#define GL_ARB_copy_buffer 1 + +#define GL_COPY_READ_BUFFER 0x8F36 +#define GL_COPY_WRITE_BUFFER 0x8F37 + +typedef void (GLAPIENTRY * PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size); + +#define glCopyBufferSubData GLEW_GET_FUN(__glewCopyBufferSubData) + +#define GLEW_ARB_copy_buffer GLEW_GET_VAR(__GLEW_ARB_copy_buffer) + +#endif /* GL_ARB_copy_buffer */ + +/* --------------------------- GL_ARB_copy_image --------------------------- */ + +#ifndef GL_ARB_copy_image +#define GL_ARB_copy_image 1 + +typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); + +#define glCopyImageSubData GLEW_GET_FUN(__glewCopyImageSubData) + +#define GLEW_ARB_copy_image GLEW_GET_VAR(__GLEW_ARB_copy_image) + +#endif /* GL_ARB_copy_image */ + +/* -------------------------- GL_ARB_cull_distance ------------------------- */ + +#ifndef GL_ARB_cull_distance +#define GL_ARB_cull_distance 1 + +#define GL_MAX_CULL_DISTANCES 0x82F9 +#define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES 0x82FA + +#define GLEW_ARB_cull_distance GLEW_GET_VAR(__GLEW_ARB_cull_distance) + +#endif /* GL_ARB_cull_distance */ + +/* -------------------------- GL_ARB_debug_output -------------------------- */ + +#ifndef GL_ARB_debug_output +#define GL_ARB_debug_output 1 + +#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 +#define GL_DEBUG_SOURCE_API_ARB 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A +#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B +#define GL_DEBUG_TYPE_ERROR_ARB 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E +#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 +#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 +#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 + +typedef void (GLAPIENTRY *GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const void *userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); + +#define glDebugMessageCallbackARB GLEW_GET_FUN(__glewDebugMessageCallbackARB) +#define glDebugMessageControlARB GLEW_GET_FUN(__glewDebugMessageControlARB) +#define glDebugMessageInsertARB GLEW_GET_FUN(__glewDebugMessageInsertARB) +#define glGetDebugMessageLogARB GLEW_GET_FUN(__glewGetDebugMessageLogARB) + +#define GLEW_ARB_debug_output GLEW_GET_VAR(__GLEW_ARB_debug_output) + +#endif /* GL_ARB_debug_output */ + /* ----------------------- GL_ARB_depth_buffer_float ----------------------- */ #ifndef GL_ARB_depth_buffer_float @@ -2507,6 +4292,17 @@ typedef void (GLAPIENTRY * PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp) #endif /* GL_ARB_depth_buffer_float */ +/* --------------------------- GL_ARB_depth_clamp -------------------------- */ + +#ifndef GL_ARB_depth_clamp +#define GL_ARB_depth_clamp 1 + +#define GL_DEPTH_CLAMP 0x864F + +#define GLEW_ARB_depth_clamp GLEW_GET_VAR(__GLEW_ARB_depth_clamp) + +#endif /* GL_ARB_depth_clamp */ + /* -------------------------- GL_ARB_depth_texture ------------------------- */ #ifndef GL_ARB_depth_texture @@ -2522,6 +4318,223 @@ typedef void (GLAPIENTRY * PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp) #endif /* GL_ARB_depth_texture */ +/* ----------------------- GL_ARB_derivative_control ----------------------- */ + +#ifndef GL_ARB_derivative_control +#define GL_ARB_derivative_control 1 + +#define GLEW_ARB_derivative_control GLEW_GET_VAR(__GLEW_ARB_derivative_control) + +#endif /* GL_ARB_derivative_control */ + +/* ----------------------- GL_ARB_direct_state_access ---------------------- */ + +#ifndef GL_ARB_direct_state_access +#define GL_ARB_direct_state_access 1 + +#define GL_TEXTURE_TARGET 0x1006 +#define GL_QUERY_TARGET 0x82EA + +typedef void (GLAPIENTRY * PFNGLBINDTEXTUREUNITPROC) (GLuint unit, GLuint texture); +typedef void (GLAPIENTRY * PFNGLBLITNAMEDFRAMEBUFFERPROC) (GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef GLenum (GLAPIENTRY * PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC) (GLuint framebuffer, GLenum target); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERDATAPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERFIPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERFVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint* value); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOPYNAMEDBUFFERSUBDATAPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCREATEBUFFERSPROC) (GLsizei n, GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLCREATEFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLCREATEPROGRAMPIPELINESPROC) (GLsizei n, GLuint* pipelines); +typedef void (GLAPIENTRY * PFNGLCREATEQUERIESPROC) (GLenum target, GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLCREATERENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLCREATESAMPLERSPROC) (GLsizei n, GLuint* samplers); +typedef void (GLAPIENTRY * PFNGLCREATETEXTURESPROC) (GLenum target, GLsizei n, GLuint* textures); +typedef void (GLAPIENTRY * PFNGLCREATETRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLCREATEVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLGENERATETEXTUREMIPMAPPROC) (GLuint texture); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLsizei bufSize, void *pixels); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERI64VPROC) (GLuint buffer, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERIVPROC) (GLuint buffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPOINTERVPROC) (GLuint buffer, GLenum pname, void** params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC) (GLuint framebuffer, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC) (GLuint renderbuffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTI64VPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTIVPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTUI64VPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTUIVPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERFVPROC) (GLuint texture, GLint level, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERIVPROC) (GLuint texture, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKI64_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint64* param); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKI_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKIVPROC) (GLuint xfb, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINDEXED64IVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint64* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINDEXEDIVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYIVPROC) (GLuint vaobj, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum* attachments); +typedef void (GLAPIENTRY * PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERPROC) (GLuint buffer, GLenum access); +typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERDATAPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC) (GLuint framebuffer, GLsizei n, const GLenum* bufs); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC) (GLuint framebuffer, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERPROC) (GLuint texture, GLenum internalformat, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERRANGEPROC) (GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFPROC) (GLuint texture, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, const GLfloat* param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIPROC) (GLuint texture, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, const GLint* param); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE1DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC) (GLuint xfb, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC) (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFERPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBBINDINGPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBIFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBLFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYBINDINGDIVISORPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYELEMENTBUFFERPROC) (GLuint vaobj, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXBUFFERPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXBUFFERSPROC) (GLuint vaobj, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizei *strides); + +#define glBindTextureUnit GLEW_GET_FUN(__glewBindTextureUnit) +#define glBlitNamedFramebuffer GLEW_GET_FUN(__glewBlitNamedFramebuffer) +#define glCheckNamedFramebufferStatus GLEW_GET_FUN(__glewCheckNamedFramebufferStatus) +#define glClearNamedBufferData GLEW_GET_FUN(__glewClearNamedBufferData) +#define glClearNamedBufferSubData GLEW_GET_FUN(__glewClearNamedBufferSubData) +#define glClearNamedFramebufferfi GLEW_GET_FUN(__glewClearNamedFramebufferfi) +#define glClearNamedFramebufferfv GLEW_GET_FUN(__glewClearNamedFramebufferfv) +#define glClearNamedFramebufferiv GLEW_GET_FUN(__glewClearNamedFramebufferiv) +#define glClearNamedFramebufferuiv GLEW_GET_FUN(__glewClearNamedFramebufferuiv) +#define glCompressedTextureSubImage1D GLEW_GET_FUN(__glewCompressedTextureSubImage1D) +#define glCompressedTextureSubImage2D GLEW_GET_FUN(__glewCompressedTextureSubImage2D) +#define glCompressedTextureSubImage3D GLEW_GET_FUN(__glewCompressedTextureSubImage3D) +#define glCopyNamedBufferSubData GLEW_GET_FUN(__glewCopyNamedBufferSubData) +#define glCopyTextureSubImage1D GLEW_GET_FUN(__glewCopyTextureSubImage1D) +#define glCopyTextureSubImage2D GLEW_GET_FUN(__glewCopyTextureSubImage2D) +#define glCopyTextureSubImage3D GLEW_GET_FUN(__glewCopyTextureSubImage3D) +#define glCreateBuffers GLEW_GET_FUN(__glewCreateBuffers) +#define glCreateFramebuffers GLEW_GET_FUN(__glewCreateFramebuffers) +#define glCreateProgramPipelines GLEW_GET_FUN(__glewCreateProgramPipelines) +#define glCreateQueries GLEW_GET_FUN(__glewCreateQueries) +#define glCreateRenderbuffers GLEW_GET_FUN(__glewCreateRenderbuffers) +#define glCreateSamplers GLEW_GET_FUN(__glewCreateSamplers) +#define glCreateTextures GLEW_GET_FUN(__glewCreateTextures) +#define glCreateTransformFeedbacks GLEW_GET_FUN(__glewCreateTransformFeedbacks) +#define glCreateVertexArrays GLEW_GET_FUN(__glewCreateVertexArrays) +#define glDisableVertexArrayAttrib GLEW_GET_FUN(__glewDisableVertexArrayAttrib) +#define glEnableVertexArrayAttrib GLEW_GET_FUN(__glewEnableVertexArrayAttrib) +#define glFlushMappedNamedBufferRange GLEW_GET_FUN(__glewFlushMappedNamedBufferRange) +#define glGenerateTextureMipmap GLEW_GET_FUN(__glewGenerateTextureMipmap) +#define glGetCompressedTextureImage GLEW_GET_FUN(__glewGetCompressedTextureImage) +#define glGetNamedBufferParameteri64v GLEW_GET_FUN(__glewGetNamedBufferParameteri64v) +#define glGetNamedBufferParameteriv GLEW_GET_FUN(__glewGetNamedBufferParameteriv) +#define glGetNamedBufferPointerv GLEW_GET_FUN(__glewGetNamedBufferPointerv) +#define glGetNamedBufferSubData GLEW_GET_FUN(__glewGetNamedBufferSubData) +#define glGetNamedFramebufferAttachmentParameteriv GLEW_GET_FUN(__glewGetNamedFramebufferAttachmentParameteriv) +#define glGetNamedFramebufferParameteriv GLEW_GET_FUN(__glewGetNamedFramebufferParameteriv) +#define glGetNamedRenderbufferParameteriv GLEW_GET_FUN(__glewGetNamedRenderbufferParameteriv) +#define glGetQueryBufferObjecti64v GLEW_GET_FUN(__glewGetQueryBufferObjecti64v) +#define glGetQueryBufferObjectiv GLEW_GET_FUN(__glewGetQueryBufferObjectiv) +#define glGetQueryBufferObjectui64v GLEW_GET_FUN(__glewGetQueryBufferObjectui64v) +#define glGetQueryBufferObjectuiv GLEW_GET_FUN(__glewGetQueryBufferObjectuiv) +#define glGetTextureImage GLEW_GET_FUN(__glewGetTextureImage) +#define glGetTextureLevelParameterfv GLEW_GET_FUN(__glewGetTextureLevelParameterfv) +#define glGetTextureLevelParameteriv GLEW_GET_FUN(__glewGetTextureLevelParameteriv) +#define glGetTextureParameterIiv GLEW_GET_FUN(__glewGetTextureParameterIiv) +#define glGetTextureParameterIuiv GLEW_GET_FUN(__glewGetTextureParameterIuiv) +#define glGetTextureParameterfv GLEW_GET_FUN(__glewGetTextureParameterfv) +#define glGetTextureParameteriv GLEW_GET_FUN(__glewGetTextureParameteriv) +#define glGetTransformFeedbacki64_v GLEW_GET_FUN(__glewGetTransformFeedbacki64_v) +#define glGetTransformFeedbacki_v GLEW_GET_FUN(__glewGetTransformFeedbacki_v) +#define glGetTransformFeedbackiv GLEW_GET_FUN(__glewGetTransformFeedbackiv) +#define glGetVertexArrayIndexed64iv GLEW_GET_FUN(__glewGetVertexArrayIndexed64iv) +#define glGetVertexArrayIndexediv GLEW_GET_FUN(__glewGetVertexArrayIndexediv) +#define glGetVertexArrayiv GLEW_GET_FUN(__glewGetVertexArrayiv) +#define glInvalidateNamedFramebufferData GLEW_GET_FUN(__glewInvalidateNamedFramebufferData) +#define glInvalidateNamedFramebufferSubData GLEW_GET_FUN(__glewInvalidateNamedFramebufferSubData) +#define glMapNamedBuffer GLEW_GET_FUN(__glewMapNamedBuffer) +#define glMapNamedBufferRange GLEW_GET_FUN(__glewMapNamedBufferRange) +#define glNamedBufferData GLEW_GET_FUN(__glewNamedBufferData) +#define glNamedBufferStorage GLEW_GET_FUN(__glewNamedBufferStorage) +#define glNamedBufferSubData GLEW_GET_FUN(__glewNamedBufferSubData) +#define glNamedFramebufferDrawBuffer GLEW_GET_FUN(__glewNamedFramebufferDrawBuffer) +#define glNamedFramebufferDrawBuffers GLEW_GET_FUN(__glewNamedFramebufferDrawBuffers) +#define glNamedFramebufferParameteri GLEW_GET_FUN(__glewNamedFramebufferParameteri) +#define glNamedFramebufferReadBuffer GLEW_GET_FUN(__glewNamedFramebufferReadBuffer) +#define glNamedFramebufferRenderbuffer GLEW_GET_FUN(__glewNamedFramebufferRenderbuffer) +#define glNamedFramebufferTexture GLEW_GET_FUN(__glewNamedFramebufferTexture) +#define glNamedFramebufferTextureLayer GLEW_GET_FUN(__glewNamedFramebufferTextureLayer) +#define glNamedRenderbufferStorage GLEW_GET_FUN(__glewNamedRenderbufferStorage) +#define glNamedRenderbufferStorageMultisample GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisample) +#define glTextureBuffer GLEW_GET_FUN(__glewTextureBuffer) +#define glTextureBufferRange GLEW_GET_FUN(__glewTextureBufferRange) +#define glTextureParameterIiv GLEW_GET_FUN(__glewTextureParameterIiv) +#define glTextureParameterIuiv GLEW_GET_FUN(__glewTextureParameterIuiv) +#define glTextureParameterf GLEW_GET_FUN(__glewTextureParameterf) +#define glTextureParameterfv GLEW_GET_FUN(__glewTextureParameterfv) +#define glTextureParameteri GLEW_GET_FUN(__glewTextureParameteri) +#define glTextureParameteriv GLEW_GET_FUN(__glewTextureParameteriv) +#define glTextureStorage1D GLEW_GET_FUN(__glewTextureStorage1D) +#define glTextureStorage2D GLEW_GET_FUN(__glewTextureStorage2D) +#define glTextureStorage2DMultisample GLEW_GET_FUN(__glewTextureStorage2DMultisample) +#define glTextureStorage3D GLEW_GET_FUN(__glewTextureStorage3D) +#define glTextureStorage3DMultisample GLEW_GET_FUN(__glewTextureStorage3DMultisample) +#define glTextureSubImage1D GLEW_GET_FUN(__glewTextureSubImage1D) +#define glTextureSubImage2D GLEW_GET_FUN(__glewTextureSubImage2D) +#define glTextureSubImage3D GLEW_GET_FUN(__glewTextureSubImage3D) +#define glTransformFeedbackBufferBase GLEW_GET_FUN(__glewTransformFeedbackBufferBase) +#define glTransformFeedbackBufferRange GLEW_GET_FUN(__glewTransformFeedbackBufferRange) +#define glUnmapNamedBuffer GLEW_GET_FUN(__glewUnmapNamedBuffer) +#define glVertexArrayAttribBinding GLEW_GET_FUN(__glewVertexArrayAttribBinding) +#define glVertexArrayAttribFormat GLEW_GET_FUN(__glewVertexArrayAttribFormat) +#define glVertexArrayAttribIFormat GLEW_GET_FUN(__glewVertexArrayAttribIFormat) +#define glVertexArrayAttribLFormat GLEW_GET_FUN(__glewVertexArrayAttribLFormat) +#define glVertexArrayBindingDivisor GLEW_GET_FUN(__glewVertexArrayBindingDivisor) +#define glVertexArrayElementBuffer GLEW_GET_FUN(__glewVertexArrayElementBuffer) +#define glVertexArrayVertexBuffer GLEW_GET_FUN(__glewVertexArrayVertexBuffer) +#define glVertexArrayVertexBuffers GLEW_GET_FUN(__glewVertexArrayVertexBuffers) + +#define GLEW_ARB_direct_state_access GLEW_GET_VAR(__GLEW_ARB_direct_state_access) + +#endif /* GL_ARB_direct_state_access */ + /* -------------------------- GL_ARB_draw_buffers -------------------------- */ #ifndef GL_ARB_draw_buffers @@ -2553,21 +4566,122 @@ typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum* bu #endif /* GL_ARB_draw_buffers */ +/* ----------------------- GL_ARB_draw_buffers_blend ----------------------- */ + +#ifndef GL_ARB_draw_buffers_blend +#define GL_ARB_draw_buffers_blend 1 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst); + +#define glBlendEquationSeparateiARB GLEW_GET_FUN(__glewBlendEquationSeparateiARB) +#define glBlendEquationiARB GLEW_GET_FUN(__glewBlendEquationiARB) +#define glBlendFuncSeparateiARB GLEW_GET_FUN(__glewBlendFuncSeparateiARB) +#define glBlendFunciARB GLEW_GET_FUN(__glewBlendFunciARB) + +#define GLEW_ARB_draw_buffers_blend GLEW_GET_VAR(__GLEW_ARB_draw_buffers_blend) + +#endif /* GL_ARB_draw_buffers_blend */ + +/* -------------------- GL_ARB_draw_elements_base_vertex ------------------- */ + +#ifndef GL_ARB_draw_elements_base_vertex +#define GL_ARB_draw_elements_base_vertex 1 + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, void *indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, void *indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei* count, GLenum type, void**indices, GLsizei primcount, GLint *basevertex); + +#define glDrawElementsBaseVertex GLEW_GET_FUN(__glewDrawElementsBaseVertex) +#define glDrawElementsInstancedBaseVertex GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertex) +#define glDrawRangeElementsBaseVertex GLEW_GET_FUN(__glewDrawRangeElementsBaseVertex) +#define glMultiDrawElementsBaseVertex GLEW_GET_FUN(__glewMultiDrawElementsBaseVertex) + +#define GLEW_ARB_draw_elements_base_vertex GLEW_GET_VAR(__GLEW_ARB_draw_elements_base_vertex) + +#endif /* GL_ARB_draw_elements_base_vertex */ + +/* -------------------------- GL_ARB_draw_indirect ------------------------- */ + +#ifndef GL_ARB_draw_indirect +#define GL_ARB_draw_indirect 1 + +#define GL_DRAW_INDIRECT_BUFFER 0x8F3F +#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect); + +#define glDrawArraysIndirect GLEW_GET_FUN(__glewDrawArraysIndirect) +#define glDrawElementsIndirect GLEW_GET_FUN(__glewDrawElementsIndirect) + +#define GLEW_ARB_draw_indirect GLEW_GET_VAR(__GLEW_ARB_draw_indirect) + +#endif /* GL_ARB_draw_indirect */ + /* ------------------------- GL_ARB_draw_instanced ------------------------- */ #ifndef GL_ARB_draw_instanced #define GL_ARB_draw_instanced 1 -typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); - -#define glDrawArraysInstancedARB GLEW_GET_FUN(__glewDrawArraysInstancedARB) -#define glDrawElementsInstancedARB GLEW_GET_FUN(__glewDrawElementsInstancedARB) - #define GLEW_ARB_draw_instanced GLEW_GET_VAR(__GLEW_ARB_draw_instanced) #endif /* GL_ARB_draw_instanced */ +/* ------------------------ GL_ARB_enhanced_layouts ------------------------ */ + +#ifndef GL_ARB_enhanced_layouts +#define GL_ARB_enhanced_layouts 1 + +#define GL_LOCATION_COMPONENT 0x934A +#define GL_TRANSFORM_FEEDBACK_BUFFER_INDEX 0x934B +#define GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE 0x934C + +#define GLEW_ARB_enhanced_layouts GLEW_GET_VAR(__GLEW_ARB_enhanced_layouts) + +#endif /* GL_ARB_enhanced_layouts */ + +/* -------------------- GL_ARB_explicit_attrib_location -------------------- */ + +#ifndef GL_ARB_explicit_attrib_location +#define GL_ARB_explicit_attrib_location 1 + +#define GLEW_ARB_explicit_attrib_location GLEW_GET_VAR(__GLEW_ARB_explicit_attrib_location) + +#endif /* GL_ARB_explicit_attrib_location */ + +/* -------------------- GL_ARB_explicit_uniform_location ------------------- */ + +#ifndef GL_ARB_explicit_uniform_location +#define GL_ARB_explicit_uniform_location 1 + +#define GL_MAX_UNIFORM_LOCATIONS 0x826E + +#define GLEW_ARB_explicit_uniform_location GLEW_GET_VAR(__GLEW_ARB_explicit_uniform_location) + +#endif /* GL_ARB_explicit_uniform_location */ + +/* ------------------- GL_ARB_fragment_coord_conventions ------------------- */ + +#ifndef GL_ARB_fragment_coord_conventions +#define GL_ARB_fragment_coord_conventions 1 + +#define GLEW_ARB_fragment_coord_conventions GLEW_GET_VAR(__GLEW_ARB_fragment_coord_conventions) + +#endif /* GL_ARB_fragment_coord_conventions */ + +/* --------------------- GL_ARB_fragment_layer_viewport -------------------- */ + +#ifndef GL_ARB_fragment_layer_viewport +#define GL_ARB_fragment_layer_viewport 1 + +#define GLEW_ARB_fragment_layer_viewport GLEW_GET_VAR(__GLEW_ARB_fragment_layer_viewport) + +#endif /* GL_ARB_fragment_layer_viewport */ + /* ------------------------ GL_ARB_fragment_program ------------------------ */ #ifndef GL_ARB_fragment_program @@ -2615,6 +4729,44 @@ typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsi #endif /* GL_ARB_fragment_shader */ +/* -------------------- GL_ARB_fragment_shader_interlock ------------------- */ + +#ifndef GL_ARB_fragment_shader_interlock +#define GL_ARB_fragment_shader_interlock 1 + +#define GLEW_ARB_fragment_shader_interlock GLEW_GET_VAR(__GLEW_ARB_fragment_shader_interlock) + +#endif /* GL_ARB_fragment_shader_interlock */ + +/* ------------------- GL_ARB_framebuffer_no_attachments ------------------- */ + +#ifndef GL_ARB_framebuffer_no_attachments +#define GL_ARB_framebuffer_no_attachments 1 + +#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 +#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 +#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 +#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 +#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 +#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315 +#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 +#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317 +#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param); + +#define glFramebufferParameteri GLEW_GET_FUN(__glewFramebufferParameteri) +#define glGetFramebufferParameteriv GLEW_GET_FUN(__glewGetFramebufferParameteriv) +#define glGetNamedFramebufferParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferParameterivEXT) +#define glNamedFramebufferParameteriEXT GLEW_GET_FUN(__glewNamedFramebufferParameteriEXT) + +#define GLEW_ARB_framebuffer_no_attachments GLEW_GET_VAR(__GLEW_ARB_framebuffer_no_attachments) + +#endif /* GL_ARB_framebuffer_no_attachments */ + /* ----------------------- GL_ARB_framebuffer_object ----------------------- */ #ifndef GL_ARB_framebuffer_object @@ -2702,10 +4854,10 @@ typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint* framebuffers); typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint* renderbuffers); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURLAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer); typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers); typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers); typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPPROC) (GLenum target); @@ -2723,10 +4875,10 @@ typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum targ #define glDeleteFramebuffers GLEW_GET_FUN(__glewDeleteFramebuffers) #define glDeleteRenderbuffers GLEW_GET_FUN(__glewDeleteRenderbuffers) #define glFramebufferRenderbuffer GLEW_GET_FUN(__glewFramebufferRenderbuffer) -#define glFramebufferTexturLayer GLEW_GET_FUN(__glewFramebufferTexturLayer) #define glFramebufferTexture1D GLEW_GET_FUN(__glewFramebufferTexture1D) #define glFramebufferTexture2D GLEW_GET_FUN(__glewFramebufferTexture2D) #define glFramebufferTexture3D GLEW_GET_FUN(__glewFramebufferTexture3D) +#define glFramebufferTextureLayer GLEW_GET_FUN(__glewFramebufferTextureLayer) #define glGenFramebuffers GLEW_GET_FUN(__glewGenFramebuffers) #define glGenRenderbuffers GLEW_GET_FUN(__glewGenRenderbuffers) #define glGenerateMipmap GLEW_GET_FUN(__glewGenerateMipmap) @@ -2791,6 +4943,227 @@ typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenu #endif /* GL_ARB_geometry_shader4 */ +/* ----------------------- GL_ARB_get_program_binary ----------------------- */ + +#ifndef GL_ARB_get_program_binary +#define GL_ARB_get_program_binary 1 + +#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 +#define GL_PROGRAM_BINARY_LENGTH 0x8741 +#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE +#define GL_PROGRAM_BINARY_FORMATS 0x87FF + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLenum *binaryFormat, void*binary); +typedef void (GLAPIENTRY * PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); + +#define glGetProgramBinary GLEW_GET_FUN(__glewGetProgramBinary) +#define glProgramBinary GLEW_GET_FUN(__glewProgramBinary) +#define glProgramParameteri GLEW_GET_FUN(__glewProgramParameteri) + +#define GLEW_ARB_get_program_binary GLEW_GET_VAR(__GLEW_ARB_get_program_binary) + +#endif /* GL_ARB_get_program_binary */ + +/* ---------------------- GL_ARB_get_texture_sub_image --------------------- */ + +#ifndef GL_ARB_get_texture_sub_image +#define GL_ARB_get_texture_sub_image 1 + +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void *pixels); +typedef void (GLAPIENTRY * PFNGLGETTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void *pixels); + +#define glGetCompressedTextureSubImage GLEW_GET_FUN(__glewGetCompressedTextureSubImage) +#define glGetTextureSubImage GLEW_GET_FUN(__glewGetTextureSubImage) + +#define GLEW_ARB_get_texture_sub_image GLEW_GET_VAR(__GLEW_ARB_get_texture_sub_image) + +#endif /* GL_ARB_get_texture_sub_image */ + +/* ---------------------------- GL_ARB_gl_spirv ---------------------------- */ + +#ifndef GL_ARB_gl_spirv +#define GL_ARB_gl_spirv 1 + +#define GL_SHADER_BINARY_FORMAT_SPIR_V_ARB 0x9551 +#define GL_SPIR_V_BINARY_ARB 0x9552 + +typedef void (GLAPIENTRY * PFNGLSPECIALIZESHADERARBPROC) (GLuint shader, const GLchar* pEntryPoint, GLuint numSpecializationConstants, const GLuint* pConstantIndex, const GLuint* pConstantValue); + +#define glSpecializeShaderARB GLEW_GET_FUN(__glewSpecializeShaderARB) + +#define GLEW_ARB_gl_spirv GLEW_GET_VAR(__GLEW_ARB_gl_spirv) + +#endif /* GL_ARB_gl_spirv */ + +/* --------------------------- GL_ARB_gpu_shader5 -------------------------- */ + +#ifndef GL_ARB_gpu_shader5 +#define GL_ARB_gpu_shader5 1 + +#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C +#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D +#define GL_MAX_VERTEX_STREAMS 0x8E71 + +#define GLEW_ARB_gpu_shader5 GLEW_GET_VAR(__GLEW_ARB_gpu_shader5) + +#endif /* GL_ARB_gpu_shader5 */ + +/* ------------------------- GL_ARB_gpu_shader_fp64 ------------------------ */ + +#ifndef GL_ARB_gpu_shader_fp64 +#define GL_ARB_gpu_shader_fp64 1 + +#define GL_DOUBLE_MAT2 0x8F46 +#define GL_DOUBLE_MAT3 0x8F47 +#define GL_DOUBLE_MAT4 0x8F48 +#define GL_DOUBLE_MAT2x3 0x8F49 +#define GL_DOUBLE_MAT2x4 0x8F4A +#define GL_DOUBLE_MAT3x2 0x8F4B +#define GL_DOUBLE_MAT3x4 0x8F4C +#define GL_DOUBLE_MAT4x2 0x8F4D +#define GL_DOUBLE_MAT4x3 0x8F4E +#define GL_DOUBLE_VEC2 0x8FFC +#define GL_DOUBLE_VEC3 0x8FFD +#define GL_DOUBLE_VEC4 0x8FFE + +typedef void (GLAPIENTRY * PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); + +#define glGetUniformdv GLEW_GET_FUN(__glewGetUniformdv) +#define glUniform1d GLEW_GET_FUN(__glewUniform1d) +#define glUniform1dv GLEW_GET_FUN(__glewUniform1dv) +#define glUniform2d GLEW_GET_FUN(__glewUniform2d) +#define glUniform2dv GLEW_GET_FUN(__glewUniform2dv) +#define glUniform3d GLEW_GET_FUN(__glewUniform3d) +#define glUniform3dv GLEW_GET_FUN(__glewUniform3dv) +#define glUniform4d GLEW_GET_FUN(__glewUniform4d) +#define glUniform4dv GLEW_GET_FUN(__glewUniform4dv) +#define glUniformMatrix2dv GLEW_GET_FUN(__glewUniformMatrix2dv) +#define glUniformMatrix2x3dv GLEW_GET_FUN(__glewUniformMatrix2x3dv) +#define glUniformMatrix2x4dv GLEW_GET_FUN(__glewUniformMatrix2x4dv) +#define glUniformMatrix3dv GLEW_GET_FUN(__glewUniformMatrix3dv) +#define glUniformMatrix3x2dv GLEW_GET_FUN(__glewUniformMatrix3x2dv) +#define glUniformMatrix3x4dv GLEW_GET_FUN(__glewUniformMatrix3x4dv) +#define glUniformMatrix4dv GLEW_GET_FUN(__glewUniformMatrix4dv) +#define glUniformMatrix4x2dv GLEW_GET_FUN(__glewUniformMatrix4x2dv) +#define glUniformMatrix4x3dv GLEW_GET_FUN(__glewUniformMatrix4x3dv) + +#define GLEW_ARB_gpu_shader_fp64 GLEW_GET_VAR(__GLEW_ARB_gpu_shader_fp64) + +#endif /* GL_ARB_gpu_shader_fp64 */ + +/* ------------------------ GL_ARB_gpu_shader_int64 ------------------------ */ + +#ifndef GL_ARB_gpu_shader_int64 +#define GL_ARB_gpu_shader_int64 1 + +#define GL_INT64_ARB 0x140E +#define GL_UNSIGNED_INT64_ARB 0x140F +#define GL_INT64_VEC2_ARB 0x8FE9 +#define GL_INT64_VEC3_ARB 0x8FEA +#define GL_INT64_VEC4_ARB 0x8FEB +#define GL_UNSIGNED_INT64_VEC2_ARB 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_ARB 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_ARB 0x8FF7 + +typedef void (GLAPIENTRY * PFNGLGETUNIFORMI64VARBPROC) (GLuint program, GLint location, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUI64VARBPROC) (GLuint program, GLint location, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMI64VARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUI64VARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64ARBPROC) (GLuint program, GLint location, GLint64 x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64ARBPROC) (GLuint program, GLint location, GLuint64 x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64ARBPROC) (GLint location, GLint64 x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64ARBPROC) (GLint location, GLuint64 x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64ARBPROC) (GLint location, GLint64 x, GLint64 y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64ARBPROC) (GLint location, GLint64 x, GLint64 y, GLint64 z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y, GLuint64 z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64ARBPROC) (GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); + +#define glGetUniformi64vARB GLEW_GET_FUN(__glewGetUniformi64vARB) +#define glGetUniformui64vARB GLEW_GET_FUN(__glewGetUniformui64vARB) +#define glGetnUniformi64vARB GLEW_GET_FUN(__glewGetnUniformi64vARB) +#define glGetnUniformui64vARB GLEW_GET_FUN(__glewGetnUniformui64vARB) +#define glProgramUniform1i64ARB GLEW_GET_FUN(__glewProgramUniform1i64ARB) +#define glProgramUniform1i64vARB GLEW_GET_FUN(__glewProgramUniform1i64vARB) +#define glProgramUniform1ui64ARB GLEW_GET_FUN(__glewProgramUniform1ui64ARB) +#define glProgramUniform1ui64vARB GLEW_GET_FUN(__glewProgramUniform1ui64vARB) +#define glProgramUniform2i64ARB GLEW_GET_FUN(__glewProgramUniform2i64ARB) +#define glProgramUniform2i64vARB GLEW_GET_FUN(__glewProgramUniform2i64vARB) +#define glProgramUniform2ui64ARB GLEW_GET_FUN(__glewProgramUniform2ui64ARB) +#define glProgramUniform2ui64vARB GLEW_GET_FUN(__glewProgramUniform2ui64vARB) +#define glProgramUniform3i64ARB GLEW_GET_FUN(__glewProgramUniform3i64ARB) +#define glProgramUniform3i64vARB GLEW_GET_FUN(__glewProgramUniform3i64vARB) +#define glProgramUniform3ui64ARB GLEW_GET_FUN(__glewProgramUniform3ui64ARB) +#define glProgramUniform3ui64vARB GLEW_GET_FUN(__glewProgramUniform3ui64vARB) +#define glProgramUniform4i64ARB GLEW_GET_FUN(__glewProgramUniform4i64ARB) +#define glProgramUniform4i64vARB GLEW_GET_FUN(__glewProgramUniform4i64vARB) +#define glProgramUniform4ui64ARB GLEW_GET_FUN(__glewProgramUniform4ui64ARB) +#define glProgramUniform4ui64vARB GLEW_GET_FUN(__glewProgramUniform4ui64vARB) +#define glUniform1i64ARB GLEW_GET_FUN(__glewUniform1i64ARB) +#define glUniform1i64vARB GLEW_GET_FUN(__glewUniform1i64vARB) +#define glUniform1ui64ARB GLEW_GET_FUN(__glewUniform1ui64ARB) +#define glUniform1ui64vARB GLEW_GET_FUN(__glewUniform1ui64vARB) +#define glUniform2i64ARB GLEW_GET_FUN(__glewUniform2i64ARB) +#define glUniform2i64vARB GLEW_GET_FUN(__glewUniform2i64vARB) +#define glUniform2ui64ARB GLEW_GET_FUN(__glewUniform2ui64ARB) +#define glUniform2ui64vARB GLEW_GET_FUN(__glewUniform2ui64vARB) +#define glUniform3i64ARB GLEW_GET_FUN(__glewUniform3i64ARB) +#define glUniform3i64vARB GLEW_GET_FUN(__glewUniform3i64vARB) +#define glUniform3ui64ARB GLEW_GET_FUN(__glewUniform3ui64ARB) +#define glUniform3ui64vARB GLEW_GET_FUN(__glewUniform3ui64vARB) +#define glUniform4i64ARB GLEW_GET_FUN(__glewUniform4i64ARB) +#define glUniform4i64vARB GLEW_GET_FUN(__glewUniform4i64vARB) +#define glUniform4ui64ARB GLEW_GET_FUN(__glewUniform4ui64ARB) +#define glUniform4ui64vARB GLEW_GET_FUN(__glewUniform4ui64vARB) + +#define GLEW_ARB_gpu_shader_int64 GLEW_GET_VAR(__GLEW_ARB_gpu_shader_int64) + +#endif /* GL_ARB_gpu_shader_int64 */ + /* ------------------------ GL_ARB_half_float_pixel ------------------------ */ #ifndef GL_ARB_half_float_pixel @@ -2896,12 +5269,12 @@ typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenu #define GL_REPLICATE_BORDER 0x8153 #define GL_CONVOLUTION_BORDER_COLOR 0x8154 -typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -typedef void (GLAPIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); @@ -2910,24 +5283,24 @@ typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei s typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, void *table); typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, void *image); typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GLAPIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum types, void *values); typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); typedef void (GLAPIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); typedef void (GLAPIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLRESETMINMAXPROC) (GLenum target); -typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); #define glColorSubTable GLEW_GET_FUN(__glewColorSubTable) #define glColorTable GLEW_GET_FUN(__glewColorTable) @@ -2966,6 +5339,24 @@ typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum in #endif /* GL_ARB_imaging */ +/* ----------------------- GL_ARB_indirect_parameters ---------------------- */ + +#ifndef GL_ARB_indirect_parameters +#define GL_ARB_indirect_parameters 1 + +#define GL_PARAMETER_BUFFER_ARB 0x80EE +#define GL_PARAMETER_BUFFER_BINDING_ARB 0x80EF + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC) (GLenum mode, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC) (GLenum mode, GLenum type, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); + +#define glMultiDrawArraysIndirectCountARB GLEW_GET_FUN(__glewMultiDrawArraysIndirectCountARB) +#define glMultiDrawElementsIndirectCountARB GLEW_GET_FUN(__glewMultiDrawElementsIndirectCountARB) + +#define GLEW_ARB_indirect_parameters GLEW_GET_VAR(__GLEW_ARB_indirect_parameters) + +#endif /* GL_ARB_indirect_parameters */ + /* ------------------------ GL_ARB_instanced_arrays ------------------------ */ #ifndef GL_ARB_instanced_arrays @@ -2973,14 +5364,180 @@ typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum in #define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); +#define glDrawArraysInstancedARB GLEW_GET_FUN(__glewDrawArraysInstancedARB) +#define glDrawElementsInstancedARB GLEW_GET_FUN(__glewDrawElementsInstancedARB) #define glVertexAttribDivisorARB GLEW_GET_FUN(__glewVertexAttribDivisorARB) #define GLEW_ARB_instanced_arrays GLEW_GET_VAR(__GLEW_ARB_instanced_arrays) #endif /* GL_ARB_instanced_arrays */ +/* ---------------------- GL_ARB_internalformat_query ---------------------- */ + +#ifndef GL_ARB_internalformat_query +#define GL_ARB_internalformat_query 1 + +#define GL_NUM_SAMPLE_COUNTS 0x9380 + +typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params); + +#define glGetInternalformativ GLEW_GET_FUN(__glewGetInternalformativ) + +#define GLEW_ARB_internalformat_query GLEW_GET_VAR(__GLEW_ARB_internalformat_query) + +#endif /* GL_ARB_internalformat_query */ + +/* ---------------------- GL_ARB_internalformat_query2 --------------------- */ + +#ifndef GL_ARB_internalformat_query2 +#define GL_ARB_internalformat_query2 1 + +#define GL_INTERNALFORMAT_SUPPORTED 0x826F +#define GL_INTERNALFORMAT_PREFERRED 0x8270 +#define GL_INTERNALFORMAT_RED_SIZE 0x8271 +#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272 +#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273 +#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 +#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 +#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 +#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277 +#define GL_INTERNALFORMAT_RED_TYPE 0x8278 +#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279 +#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A +#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B +#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C +#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D +#define GL_MAX_WIDTH 0x827E +#define GL_MAX_HEIGHT 0x827F +#define GL_MAX_DEPTH 0x8280 +#define GL_MAX_LAYERS 0x8281 +#define GL_MAX_COMBINED_DIMENSIONS 0x8282 +#define GL_COLOR_COMPONENTS 0x8283 +#define GL_DEPTH_COMPONENTS 0x8284 +#define GL_STENCIL_COMPONENTS 0x8285 +#define GL_COLOR_RENDERABLE 0x8286 +#define GL_DEPTH_RENDERABLE 0x8287 +#define GL_STENCIL_RENDERABLE 0x8288 +#define GL_FRAMEBUFFER_RENDERABLE 0x8289 +#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A +#define GL_FRAMEBUFFER_BLEND 0x828B +#define GL_READ_PIXELS 0x828C +#define GL_READ_PIXELS_FORMAT 0x828D +#define GL_READ_PIXELS_TYPE 0x828E +#define GL_TEXTURE_IMAGE_FORMAT 0x828F +#define GL_TEXTURE_IMAGE_TYPE 0x8290 +#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 +#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292 +#define GL_MIPMAP 0x8293 +#define GL_MANUAL_GENERATE_MIPMAP 0x8294 +#define GL_AUTO_GENERATE_MIPMAP 0x8295 +#define GL_COLOR_ENCODING 0x8296 +#define GL_SRGB_READ 0x8297 +#define GL_SRGB_WRITE 0x8298 +#define GL_SRGB_DECODE_ARB 0x8299 +#define GL_FILTER 0x829A +#define GL_VERTEX_TEXTURE 0x829B +#define GL_TESS_CONTROL_TEXTURE 0x829C +#define GL_TESS_EVALUATION_TEXTURE 0x829D +#define GL_GEOMETRY_TEXTURE 0x829E +#define GL_FRAGMENT_TEXTURE 0x829F +#define GL_COMPUTE_TEXTURE 0x82A0 +#define GL_TEXTURE_SHADOW 0x82A1 +#define GL_TEXTURE_GATHER 0x82A2 +#define GL_TEXTURE_GATHER_SHADOW 0x82A3 +#define GL_SHADER_IMAGE_LOAD 0x82A4 +#define GL_SHADER_IMAGE_STORE 0x82A5 +#define GL_SHADER_IMAGE_ATOMIC 0x82A6 +#define GL_IMAGE_TEXEL_SIZE 0x82A7 +#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 +#define GL_IMAGE_PIXEL_FORMAT 0x82A9 +#define GL_IMAGE_PIXEL_TYPE 0x82AA +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF +#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 +#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 +#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 +#define GL_CLEAR_BUFFER 0x82B4 +#define GL_TEXTURE_VIEW 0x82B5 +#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6 +#define GL_FULL_SUPPORT 0x82B7 +#define GL_CAVEAT_SUPPORT 0x82B8 +#define GL_IMAGE_CLASS_4_X_32 0x82B9 +#define GL_IMAGE_CLASS_2_X_32 0x82BA +#define GL_IMAGE_CLASS_1_X_32 0x82BB +#define GL_IMAGE_CLASS_4_X_16 0x82BC +#define GL_IMAGE_CLASS_2_X_16 0x82BD +#define GL_IMAGE_CLASS_1_X_16 0x82BE +#define GL_IMAGE_CLASS_4_X_8 0x82BF +#define GL_IMAGE_CLASS_2_X_8 0x82C0 +#define GL_IMAGE_CLASS_1_X_8 0x82C1 +#define GL_IMAGE_CLASS_11_11_10 0x82C2 +#define GL_IMAGE_CLASS_10_10_10_2 0x82C3 +#define GL_VIEW_CLASS_128_BITS 0x82C4 +#define GL_VIEW_CLASS_96_BITS 0x82C5 +#define GL_VIEW_CLASS_64_BITS 0x82C6 +#define GL_VIEW_CLASS_48_BITS 0x82C7 +#define GL_VIEW_CLASS_32_BITS 0x82C8 +#define GL_VIEW_CLASS_24_BITS 0x82C9 +#define GL_VIEW_CLASS_16_BITS 0x82CA +#define GL_VIEW_CLASS_8_BITS 0x82CB +#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC +#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD +#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE +#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF +#define GL_VIEW_CLASS_RGTC1_RED 0x82D0 +#define GL_VIEW_CLASS_RGTC2_RG 0x82D1 +#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2 +#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 + +typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64* params); + +#define glGetInternalformati64v GLEW_GET_FUN(__glewGetInternalformati64v) + +#define GLEW_ARB_internalformat_query2 GLEW_GET_VAR(__GLEW_ARB_internalformat_query2) + +#endif /* GL_ARB_internalformat_query2 */ + +/* ----------------------- GL_ARB_invalidate_subdata ----------------------- */ + +#ifndef GL_ARB_invalidate_subdata +#define GL_ARB_invalidate_subdata 1 + +typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments); +typedef void (GLAPIENTRY * PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); + +#define glInvalidateBufferData GLEW_GET_FUN(__glewInvalidateBufferData) +#define glInvalidateBufferSubData GLEW_GET_FUN(__glewInvalidateBufferSubData) +#define glInvalidateFramebuffer GLEW_GET_FUN(__glewInvalidateFramebuffer) +#define glInvalidateSubFramebuffer GLEW_GET_FUN(__glewInvalidateSubFramebuffer) +#define glInvalidateTexImage GLEW_GET_FUN(__glewInvalidateTexImage) +#define glInvalidateTexSubImage GLEW_GET_FUN(__glewInvalidateTexSubImage) + +#define GLEW_ARB_invalidate_subdata GLEW_GET_VAR(__GLEW_ARB_invalidate_subdata) + +#endif /* GL_ARB_invalidate_subdata */ + +/* ---------------------- GL_ARB_map_buffer_alignment ---------------------- */ + +#ifndef GL_ARB_map_buffer_alignment +#define GL_ARB_map_buffer_alignment 1 + +#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC + +#define GLEW_ARB_map_buffer_alignment GLEW_GET_VAR(__GLEW_ARB_map_buffer_alignment) + +#endif /* GL_ARB_map_buffer_alignment */ + /* ------------------------ GL_ARB_map_buffer_range ------------------------ */ #ifndef GL_ARB_map_buffer_range @@ -2994,7 +5551,7 @@ typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuin #define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); -typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void * (GLAPIENTRY * PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); #define glFlushMappedBufferRange GLEW_GET_FUN(__glewFlushMappedBufferRange) #define glMapBufferRange GLEW_GET_FUN(__glewMapBufferRange) @@ -3020,7 +5577,7 @@ typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr #define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 typedef void (GLAPIENTRY * PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); -typedef void (GLAPIENTRY * PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, void *pointer); typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUBVARBPROC) (GLint size, GLubyte *indices); typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUIVARBPROC) (GLint size, GLuint *indices); typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUSVARBPROC) (GLint size, GLushort *indices); @@ -3035,6 +5592,44 @@ typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUSVARBPROC) (GLint size, GLushort *in #endif /* GL_ARB_matrix_palette */ +/* --------------------------- GL_ARB_multi_bind --------------------------- */ + +#ifndef GL_ARB_multi_bind +#define GL_ARB_multi_bind 1 + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERSBASEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERSRANGEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizeiptr *sizes); +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTURESPROC) (GLuint first, GLsizei count, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLBINDSAMPLERSPROC) (GLuint first, GLsizei count, const GLuint* samplers); +typedef void (GLAPIENTRY * PFNGLBINDTEXTURESPROC) (GLuint first, GLsizei count, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERSPROC) (GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizei *strides); + +#define glBindBuffersBase GLEW_GET_FUN(__glewBindBuffersBase) +#define glBindBuffersRange GLEW_GET_FUN(__glewBindBuffersRange) +#define glBindImageTextures GLEW_GET_FUN(__glewBindImageTextures) +#define glBindSamplers GLEW_GET_FUN(__glewBindSamplers) +#define glBindTextures GLEW_GET_FUN(__glewBindTextures) +#define glBindVertexBuffers GLEW_GET_FUN(__glewBindVertexBuffers) + +#define GLEW_ARB_multi_bind GLEW_GET_VAR(__GLEW_ARB_multi_bind) + +#endif /* GL_ARB_multi_bind */ + +/* ----------------------- GL_ARB_multi_draw_indirect ---------------------- */ + +#ifndef GL_ARB_multi_draw_indirect +#define GL_ARB_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); + +#define glMultiDrawArraysIndirect GLEW_GET_FUN(__glewMultiDrawArraysIndirect) +#define glMultiDrawElementsIndirect GLEW_GET_FUN(__glewMultiDrawElementsIndirect) + +#define GLEW_ARB_multi_draw_indirect GLEW_GET_VAR(__GLEW_ARB_multi_draw_indirect) + +#endif /* GL_ARB_multi_draw_indirect */ + /* --------------------------- GL_ARB_multisample -------------------------- */ #ifndef GL_ARB_multisample @@ -3206,6 +5801,54 @@ typedef GLboolean (GLAPIENTRY * PFNGLISQUERYARBPROC) (GLuint id); #endif /* GL_ARB_occlusion_query */ +/* ------------------------ GL_ARB_occlusion_query2 ------------------------ */ + +#ifndef GL_ARB_occlusion_query2 +#define GL_ARB_occlusion_query2 1 + +#define GL_ANY_SAMPLES_PASSED 0x8C2F + +#define GLEW_ARB_occlusion_query2 GLEW_GET_VAR(__GLEW_ARB_occlusion_query2) + +#endif /* GL_ARB_occlusion_query2 */ + +/* --------------------- GL_ARB_parallel_shader_compile -------------------- */ + +#ifndef GL_ARB_parallel_shader_compile +#define GL_ARB_parallel_shader_compile 1 + +#define GL_MAX_SHADER_COMPILER_THREADS_ARB 0x91B0 +#define GL_COMPLETION_STATUS_ARB 0x91B1 + +typedef void (GLAPIENTRY * PFNGLMAXSHADERCOMPILERTHREADSARBPROC) (GLuint count); + +#define glMaxShaderCompilerThreadsARB GLEW_GET_FUN(__glewMaxShaderCompilerThreadsARB) + +#define GLEW_ARB_parallel_shader_compile GLEW_GET_VAR(__GLEW_ARB_parallel_shader_compile) + +#endif /* GL_ARB_parallel_shader_compile */ + +/* -------------------- GL_ARB_pipeline_statistics_query ------------------- */ + +#ifndef GL_ARB_pipeline_statistics_query +#define GL_ARB_pipeline_statistics_query 1 + +#define GL_VERTICES_SUBMITTED_ARB 0x82EE +#define GL_PRIMITIVES_SUBMITTED_ARB 0x82EF +#define GL_VERTEX_SHADER_INVOCATIONS_ARB 0x82F0 +#define GL_TESS_CONTROL_SHADER_PATCHES_ARB 0x82F1 +#define GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB 0x82F2 +#define GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB 0x82F3 +#define GL_FRAGMENT_SHADER_INVOCATIONS_ARB 0x82F4 +#define GL_COMPUTE_SHADER_INVOCATIONS_ARB 0x82F5 +#define GL_CLIPPING_INPUT_PRIMITIVES_ARB 0x82F6 +#define GL_CLIPPING_OUTPUT_PRIMITIVES_ARB 0x82F7 +#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F + +#define GLEW_ARB_pipeline_statistics_query GLEW_GET_VAR(__GLEW_ARB_pipeline_statistics_query) + +#endif /* GL_ARB_pipeline_statistics_query */ + /* ----------------------- GL_ARB_pixel_buffer_object ---------------------- */ #ifndef GL_ARB_pixel_buffer_object @@ -3231,7 +5874,7 @@ typedef GLboolean (GLAPIENTRY * PFNGLISQUERYARBPROC) (GLuint id); #define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat* params); #define glPointParameterfARB GLEW_GET_FUN(__glewPointParameterfARB) #define glPointParameterfvARB GLEW_GET_FUN(__glewPointParameterfvARB) @@ -3252,6 +5895,649 @@ typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, GLfloat* #endif /* GL_ARB_point_sprite */ +/* ---------------------- GL_ARB_polygon_offset_clamp ---------------------- */ + +#ifndef GL_ARB_polygon_offset_clamp +#define GL_ARB_polygon_offset_clamp 1 + +#define GL_POLYGON_OFFSET_CLAMP 0x8E1B + +typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETCLAMPPROC) (GLfloat factor, GLfloat units, GLfloat clamp); + +#define glPolygonOffsetClamp GLEW_GET_FUN(__glewPolygonOffsetClamp) + +#define GLEW_ARB_polygon_offset_clamp GLEW_GET_VAR(__GLEW_ARB_polygon_offset_clamp) + +#endif /* GL_ARB_polygon_offset_clamp */ + +/* ----------------------- GL_ARB_post_depth_coverage ---------------------- */ + +#ifndef GL_ARB_post_depth_coverage +#define GL_ARB_post_depth_coverage 1 + +#define GLEW_ARB_post_depth_coverage GLEW_GET_VAR(__GLEW_ARB_post_depth_coverage) + +#endif /* GL_ARB_post_depth_coverage */ + +/* --------------------- GL_ARB_program_interface_query -------------------- */ + +#ifndef GL_ARB_program_interface_query +#define GL_ARB_program_interface_query 1 + +#define GL_UNIFORM 0x92E1 +#define GL_UNIFORM_BLOCK 0x92E2 +#define GL_PROGRAM_INPUT 0x92E3 +#define GL_PROGRAM_OUTPUT 0x92E4 +#define GL_BUFFER_VARIABLE 0x92E5 +#define GL_SHADER_STORAGE_BLOCK 0x92E6 +#define GL_IS_PER_PATCH 0x92E7 +#define GL_VERTEX_SUBROUTINE 0x92E8 +#define GL_TESS_CONTROL_SUBROUTINE 0x92E9 +#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA +#define GL_GEOMETRY_SUBROUTINE 0x92EB +#define GL_FRAGMENT_SUBROUTINE 0x92EC +#define GL_COMPUTE_SUBROUTINE 0x92ED +#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE +#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF +#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 +#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 +#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 +#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 +#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 +#define GL_ACTIVE_RESOURCES 0x92F5 +#define GL_MAX_NAME_LENGTH 0x92F6 +#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 +#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 +#define GL_NAME_LENGTH 0x92F9 +#define GL_TYPE 0x92FA +#define GL_ARRAY_SIZE 0x92FB +#define GL_OFFSET 0x92FC +#define GL_BLOCK_INDEX 0x92FD +#define GL_ARRAY_STRIDE 0x92FE +#define GL_MATRIX_STRIDE 0x92FF +#define GL_IS_ROW_MAJOR 0x9300 +#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 +#define GL_BUFFER_BINDING 0x9302 +#define GL_BUFFER_DATA_SIZE 0x9303 +#define GL_NUM_ACTIVE_VARIABLES 0x9304 +#define GL_ACTIVE_VARIABLES 0x9305 +#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306 +#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 +#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 +#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 +#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A +#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B +#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C +#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D +#define GL_LOCATION 0x930E +#define GL_LOCATION_INDEX 0x930F + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint* params); +typedef GLuint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLint *params); + +#define glGetProgramInterfaceiv GLEW_GET_FUN(__glewGetProgramInterfaceiv) +#define glGetProgramResourceIndex GLEW_GET_FUN(__glewGetProgramResourceIndex) +#define glGetProgramResourceLocation GLEW_GET_FUN(__glewGetProgramResourceLocation) +#define glGetProgramResourceLocationIndex GLEW_GET_FUN(__glewGetProgramResourceLocationIndex) +#define glGetProgramResourceName GLEW_GET_FUN(__glewGetProgramResourceName) +#define glGetProgramResourceiv GLEW_GET_FUN(__glewGetProgramResourceiv) + +#define GLEW_ARB_program_interface_query GLEW_GET_VAR(__GLEW_ARB_program_interface_query) + +#endif /* GL_ARB_program_interface_query */ + +/* ------------------------ GL_ARB_provoking_vertex ------------------------ */ + +#ifndef GL_ARB_provoking_vertex +#define GL_ARB_provoking_vertex 1 + +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F + +typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXPROC) (GLenum mode); + +#define glProvokingVertex GLEW_GET_FUN(__glewProvokingVertex) + +#define GLEW_ARB_provoking_vertex GLEW_GET_VAR(__GLEW_ARB_provoking_vertex) + +#endif /* GL_ARB_provoking_vertex */ + +/* ----------------------- GL_ARB_query_buffer_object ---------------------- */ + +#ifndef GL_ARB_query_buffer_object +#define GL_ARB_query_buffer_object 1 + +#define GL_QUERY_BUFFER_BARRIER_BIT 0x00008000 +#define GL_QUERY_BUFFER 0x9192 +#define GL_QUERY_BUFFER_BINDING 0x9193 +#define GL_QUERY_RESULT_NO_WAIT 0x9194 + +#define GLEW_ARB_query_buffer_object GLEW_GET_VAR(__GLEW_ARB_query_buffer_object) + +#endif /* GL_ARB_query_buffer_object */ + +/* ------------------ GL_ARB_robust_buffer_access_behavior ----------------- */ + +#ifndef GL_ARB_robust_buffer_access_behavior +#define GL_ARB_robust_buffer_access_behavior 1 + +#define GLEW_ARB_robust_buffer_access_behavior GLEW_GET_VAR(__GLEW_ARB_robust_buffer_access_behavior) + +#endif /* GL_ARB_robust_buffer_access_behavior */ + +/* --------------------------- GL_ARB_robustness --------------------------- */ + +#ifndef GL_ARB_robustness +#define GL_ARB_robustness 1 + +#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 +#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 +#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 + +typedef GLenum (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* table); +typedef void (GLAPIENTRY * PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void* img); +typedef void (GLAPIENTRY * PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* image); +typedef void (GLAPIENTRY * PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); +typedef void (GLAPIENTRY * PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble* v); +typedef void (GLAPIENTRY * PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat* v); +typedef void (GLAPIENTRY * PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint* v); +typedef void (GLAPIENTRY * PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort* values); +typedef void (GLAPIENTRY * PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte* pattern); +typedef void (GLAPIENTRY * PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void* row, GLsizei columnBufSize, void*column, void*span); +typedef void (GLAPIENTRY * PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* img); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint* params); +typedef void (GLAPIENTRY * PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data); + +#define glGetGraphicsResetStatusARB GLEW_GET_FUN(__glewGetGraphicsResetStatusARB) +#define glGetnColorTableARB GLEW_GET_FUN(__glewGetnColorTableARB) +#define glGetnCompressedTexImageARB GLEW_GET_FUN(__glewGetnCompressedTexImageARB) +#define glGetnConvolutionFilterARB GLEW_GET_FUN(__glewGetnConvolutionFilterARB) +#define glGetnHistogramARB GLEW_GET_FUN(__glewGetnHistogramARB) +#define glGetnMapdvARB GLEW_GET_FUN(__glewGetnMapdvARB) +#define glGetnMapfvARB GLEW_GET_FUN(__glewGetnMapfvARB) +#define glGetnMapivARB GLEW_GET_FUN(__glewGetnMapivARB) +#define glGetnMinmaxARB GLEW_GET_FUN(__glewGetnMinmaxARB) +#define glGetnPixelMapfvARB GLEW_GET_FUN(__glewGetnPixelMapfvARB) +#define glGetnPixelMapuivARB GLEW_GET_FUN(__glewGetnPixelMapuivARB) +#define glGetnPixelMapusvARB GLEW_GET_FUN(__glewGetnPixelMapusvARB) +#define glGetnPolygonStippleARB GLEW_GET_FUN(__glewGetnPolygonStippleARB) +#define glGetnSeparableFilterARB GLEW_GET_FUN(__glewGetnSeparableFilterARB) +#define glGetnTexImageARB GLEW_GET_FUN(__glewGetnTexImageARB) +#define glGetnUniformdvARB GLEW_GET_FUN(__glewGetnUniformdvARB) +#define glGetnUniformfvARB GLEW_GET_FUN(__glewGetnUniformfvARB) +#define glGetnUniformivARB GLEW_GET_FUN(__glewGetnUniformivARB) +#define glGetnUniformuivARB GLEW_GET_FUN(__glewGetnUniformuivARB) +#define glReadnPixelsARB GLEW_GET_FUN(__glewReadnPixelsARB) + +#define GLEW_ARB_robustness GLEW_GET_VAR(__GLEW_ARB_robustness) + +#endif /* GL_ARB_robustness */ + +/* ---------------- GL_ARB_robustness_application_isolation ---------------- */ + +#ifndef GL_ARB_robustness_application_isolation +#define GL_ARB_robustness_application_isolation 1 + +#define GLEW_ARB_robustness_application_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_application_isolation) + +#endif /* GL_ARB_robustness_application_isolation */ + +/* ---------------- GL_ARB_robustness_share_group_isolation ---------------- */ + +#ifndef GL_ARB_robustness_share_group_isolation +#define GL_ARB_robustness_share_group_isolation 1 + +#define GLEW_ARB_robustness_share_group_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_share_group_isolation) + +#endif /* GL_ARB_robustness_share_group_isolation */ + +/* ------------------------ GL_ARB_sample_locations ------------------------ */ + +#ifndef GL_ARB_sample_locations +#define GL_ARB_sample_locations 1 + +#define GL_SAMPLE_LOCATION_ARB 0x8E50 +#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB 0x933D +#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB 0x933E +#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB 0x933F +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB 0x9340 +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_ARB 0x9341 +#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB 0x9342 +#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB 0x9343 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); + +#define glFramebufferSampleLocationsfvARB GLEW_GET_FUN(__glewFramebufferSampleLocationsfvARB) +#define glNamedFramebufferSampleLocationsfvARB GLEW_GET_FUN(__glewNamedFramebufferSampleLocationsfvARB) + +#define GLEW_ARB_sample_locations GLEW_GET_VAR(__GLEW_ARB_sample_locations) + +#endif /* GL_ARB_sample_locations */ + +/* ------------------------- GL_ARB_sample_shading ------------------------- */ + +#ifndef GL_ARB_sample_shading +#define GL_ARB_sample_shading 1 + +#define GL_SAMPLE_SHADING_ARB 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 + +typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGARBPROC) (GLclampf value); + +#define glMinSampleShadingARB GLEW_GET_FUN(__glewMinSampleShadingARB) + +#define GLEW_ARB_sample_shading GLEW_GET_VAR(__GLEW_ARB_sample_shading) + +#endif /* GL_ARB_sample_shading */ + +/* ------------------------- GL_ARB_sampler_objects ------------------------ */ + +#ifndef GL_ARB_sampler_objects +#define GL_ARB_sampler_objects 1 + +#define GL_SAMPLER_BINDING 0x8919 + +typedef void (GLAPIENTRY * PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); +typedef void (GLAPIENTRY * PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint * samplers); +typedef void (GLAPIENTRY * PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint* samplers); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISSAMPLERPROC) (GLuint sampler); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint* params); + +#define glBindSampler GLEW_GET_FUN(__glewBindSampler) +#define glDeleteSamplers GLEW_GET_FUN(__glewDeleteSamplers) +#define glGenSamplers GLEW_GET_FUN(__glewGenSamplers) +#define glGetSamplerParameterIiv GLEW_GET_FUN(__glewGetSamplerParameterIiv) +#define glGetSamplerParameterIuiv GLEW_GET_FUN(__glewGetSamplerParameterIuiv) +#define glGetSamplerParameterfv GLEW_GET_FUN(__glewGetSamplerParameterfv) +#define glGetSamplerParameteriv GLEW_GET_FUN(__glewGetSamplerParameteriv) +#define glIsSampler GLEW_GET_FUN(__glewIsSampler) +#define glSamplerParameterIiv GLEW_GET_FUN(__glewSamplerParameterIiv) +#define glSamplerParameterIuiv GLEW_GET_FUN(__glewSamplerParameterIuiv) +#define glSamplerParameterf GLEW_GET_FUN(__glewSamplerParameterf) +#define glSamplerParameterfv GLEW_GET_FUN(__glewSamplerParameterfv) +#define glSamplerParameteri GLEW_GET_FUN(__glewSamplerParameteri) +#define glSamplerParameteriv GLEW_GET_FUN(__glewSamplerParameteriv) + +#define GLEW_ARB_sampler_objects GLEW_GET_VAR(__GLEW_ARB_sampler_objects) + +#endif /* GL_ARB_sampler_objects */ + +/* ------------------------ GL_ARB_seamless_cube_map ----------------------- */ + +#ifndef GL_ARB_seamless_cube_map +#define GL_ARB_seamless_cube_map 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F + +#define GLEW_ARB_seamless_cube_map GLEW_GET_VAR(__GLEW_ARB_seamless_cube_map) + +#endif /* GL_ARB_seamless_cube_map */ + +/* ------------------ GL_ARB_seamless_cubemap_per_texture ------------------ */ + +#ifndef GL_ARB_seamless_cubemap_per_texture +#define GL_ARB_seamless_cubemap_per_texture 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F + +#define GLEW_ARB_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_ARB_seamless_cubemap_per_texture) + +#endif /* GL_ARB_seamless_cubemap_per_texture */ + +/* --------------------- GL_ARB_separate_shader_objects -------------------- */ + +#ifndef GL_ARB_separate_shader_objects +#define GL_ARB_separate_shader_objects 1 + +#define GL_VERTEX_SHADER_BIT 0x00000001 +#define GL_FRAGMENT_SHADER_BIT 0x00000002 +#define GL_GEOMETRY_SHADER_BIT 0x00000004 +#define GL_TESS_CONTROL_SHADER_BIT 0x00000008 +#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 +#define GL_PROGRAM_SEPARABLE 0x8258 +#define GL_ACTIVE_PROGRAM 0x8259 +#define GL_PROGRAM_PIPELINE_BINDING 0x825A +#define GL_ALL_SHADER_BITS 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar * const * strings); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint* pipelines); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint* pipelines); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar *infoLog); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint x, GLuint y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); + +#define glActiveShaderProgram GLEW_GET_FUN(__glewActiveShaderProgram) +#define glBindProgramPipeline GLEW_GET_FUN(__glewBindProgramPipeline) +#define glCreateShaderProgramv GLEW_GET_FUN(__glewCreateShaderProgramv) +#define glDeleteProgramPipelines GLEW_GET_FUN(__glewDeleteProgramPipelines) +#define glGenProgramPipelines GLEW_GET_FUN(__glewGenProgramPipelines) +#define glGetProgramPipelineInfoLog GLEW_GET_FUN(__glewGetProgramPipelineInfoLog) +#define glGetProgramPipelineiv GLEW_GET_FUN(__glewGetProgramPipelineiv) +#define glIsProgramPipeline GLEW_GET_FUN(__glewIsProgramPipeline) +#define glProgramUniform1d GLEW_GET_FUN(__glewProgramUniform1d) +#define glProgramUniform1dv GLEW_GET_FUN(__glewProgramUniform1dv) +#define glProgramUniform1f GLEW_GET_FUN(__glewProgramUniform1f) +#define glProgramUniform1fv GLEW_GET_FUN(__glewProgramUniform1fv) +#define glProgramUniform1i GLEW_GET_FUN(__glewProgramUniform1i) +#define glProgramUniform1iv GLEW_GET_FUN(__glewProgramUniform1iv) +#define glProgramUniform1ui GLEW_GET_FUN(__glewProgramUniform1ui) +#define glProgramUniform1uiv GLEW_GET_FUN(__glewProgramUniform1uiv) +#define glProgramUniform2d GLEW_GET_FUN(__glewProgramUniform2d) +#define glProgramUniform2dv GLEW_GET_FUN(__glewProgramUniform2dv) +#define glProgramUniform2f GLEW_GET_FUN(__glewProgramUniform2f) +#define glProgramUniform2fv GLEW_GET_FUN(__glewProgramUniform2fv) +#define glProgramUniform2i GLEW_GET_FUN(__glewProgramUniform2i) +#define glProgramUniform2iv GLEW_GET_FUN(__glewProgramUniform2iv) +#define glProgramUniform2ui GLEW_GET_FUN(__glewProgramUniform2ui) +#define glProgramUniform2uiv GLEW_GET_FUN(__glewProgramUniform2uiv) +#define glProgramUniform3d GLEW_GET_FUN(__glewProgramUniform3d) +#define glProgramUniform3dv GLEW_GET_FUN(__glewProgramUniform3dv) +#define glProgramUniform3f GLEW_GET_FUN(__glewProgramUniform3f) +#define glProgramUniform3fv GLEW_GET_FUN(__glewProgramUniform3fv) +#define glProgramUniform3i GLEW_GET_FUN(__glewProgramUniform3i) +#define glProgramUniform3iv GLEW_GET_FUN(__glewProgramUniform3iv) +#define glProgramUniform3ui GLEW_GET_FUN(__glewProgramUniform3ui) +#define glProgramUniform3uiv GLEW_GET_FUN(__glewProgramUniform3uiv) +#define glProgramUniform4d GLEW_GET_FUN(__glewProgramUniform4d) +#define glProgramUniform4dv GLEW_GET_FUN(__glewProgramUniform4dv) +#define glProgramUniform4f GLEW_GET_FUN(__glewProgramUniform4f) +#define glProgramUniform4fv GLEW_GET_FUN(__glewProgramUniform4fv) +#define glProgramUniform4i GLEW_GET_FUN(__glewProgramUniform4i) +#define glProgramUniform4iv GLEW_GET_FUN(__glewProgramUniform4iv) +#define glProgramUniform4ui GLEW_GET_FUN(__glewProgramUniform4ui) +#define glProgramUniform4uiv GLEW_GET_FUN(__glewProgramUniform4uiv) +#define glProgramUniformMatrix2dv GLEW_GET_FUN(__glewProgramUniformMatrix2dv) +#define glProgramUniformMatrix2fv GLEW_GET_FUN(__glewProgramUniformMatrix2fv) +#define glProgramUniformMatrix2x3dv GLEW_GET_FUN(__glewProgramUniformMatrix2x3dv) +#define glProgramUniformMatrix2x3fv GLEW_GET_FUN(__glewProgramUniformMatrix2x3fv) +#define glProgramUniformMatrix2x4dv GLEW_GET_FUN(__glewProgramUniformMatrix2x4dv) +#define glProgramUniformMatrix2x4fv GLEW_GET_FUN(__glewProgramUniformMatrix2x4fv) +#define glProgramUniformMatrix3dv GLEW_GET_FUN(__glewProgramUniformMatrix3dv) +#define glProgramUniformMatrix3fv GLEW_GET_FUN(__glewProgramUniformMatrix3fv) +#define glProgramUniformMatrix3x2dv GLEW_GET_FUN(__glewProgramUniformMatrix3x2dv) +#define glProgramUniformMatrix3x2fv GLEW_GET_FUN(__glewProgramUniformMatrix3x2fv) +#define glProgramUniformMatrix3x4dv GLEW_GET_FUN(__glewProgramUniformMatrix3x4dv) +#define glProgramUniformMatrix3x4fv GLEW_GET_FUN(__glewProgramUniformMatrix3x4fv) +#define glProgramUniformMatrix4dv GLEW_GET_FUN(__glewProgramUniformMatrix4dv) +#define glProgramUniformMatrix4fv GLEW_GET_FUN(__glewProgramUniformMatrix4fv) +#define glProgramUniformMatrix4x2dv GLEW_GET_FUN(__glewProgramUniformMatrix4x2dv) +#define glProgramUniformMatrix4x2fv GLEW_GET_FUN(__glewProgramUniformMatrix4x2fv) +#define glProgramUniformMatrix4x3dv GLEW_GET_FUN(__glewProgramUniformMatrix4x3dv) +#define glProgramUniformMatrix4x3fv GLEW_GET_FUN(__glewProgramUniformMatrix4x3fv) +#define glUseProgramStages GLEW_GET_FUN(__glewUseProgramStages) +#define glValidateProgramPipeline GLEW_GET_FUN(__glewValidateProgramPipeline) + +#define GLEW_ARB_separate_shader_objects GLEW_GET_VAR(__GLEW_ARB_separate_shader_objects) + +#endif /* GL_ARB_separate_shader_objects */ + +/* -------------------- GL_ARB_shader_atomic_counter_ops ------------------- */ + +#ifndef GL_ARB_shader_atomic_counter_ops +#define GL_ARB_shader_atomic_counter_ops 1 + +#define GLEW_ARB_shader_atomic_counter_ops GLEW_GET_VAR(__GLEW_ARB_shader_atomic_counter_ops) + +#endif /* GL_ARB_shader_atomic_counter_ops */ + +/* --------------------- GL_ARB_shader_atomic_counters --------------------- */ + +#ifndef GL_ARB_shader_atomic_counters +#define GL_ARB_shader_atomic_counters 1 + +#define GL_ATOMIC_COUNTER_BUFFER 0x92C0 +#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 +#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 +#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 +#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB +#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF +#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 +#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 +#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 +#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 +#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 +#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 +#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 +#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA +#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB +#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC + +typedef void (GLAPIENTRY * PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint* params); + +#define glGetActiveAtomicCounterBufferiv GLEW_GET_FUN(__glewGetActiveAtomicCounterBufferiv) + +#define GLEW_ARB_shader_atomic_counters GLEW_GET_VAR(__GLEW_ARB_shader_atomic_counters) + +#endif /* GL_ARB_shader_atomic_counters */ + +/* -------------------------- GL_ARB_shader_ballot ------------------------- */ + +#ifndef GL_ARB_shader_ballot +#define GL_ARB_shader_ballot 1 + +#define GLEW_ARB_shader_ballot GLEW_GET_VAR(__GLEW_ARB_shader_ballot) + +#endif /* GL_ARB_shader_ballot */ + +/* ----------------------- GL_ARB_shader_bit_encoding ---------------------- */ + +#ifndef GL_ARB_shader_bit_encoding +#define GL_ARB_shader_bit_encoding 1 + +#define GLEW_ARB_shader_bit_encoding GLEW_GET_VAR(__GLEW_ARB_shader_bit_encoding) + +#endif /* GL_ARB_shader_bit_encoding */ + +/* -------------------------- GL_ARB_shader_clock -------------------------- */ + +#ifndef GL_ARB_shader_clock +#define GL_ARB_shader_clock 1 + +#define GLEW_ARB_shader_clock GLEW_GET_VAR(__GLEW_ARB_shader_clock) + +#endif /* GL_ARB_shader_clock */ + +/* --------------------- GL_ARB_shader_draw_parameters --------------------- */ + +#ifndef GL_ARB_shader_draw_parameters +#define GL_ARB_shader_draw_parameters 1 + +#define GLEW_ARB_shader_draw_parameters GLEW_GET_VAR(__GLEW_ARB_shader_draw_parameters) + +#endif /* GL_ARB_shader_draw_parameters */ + +/* ------------------------ GL_ARB_shader_group_vote ----------------------- */ + +#ifndef GL_ARB_shader_group_vote +#define GL_ARB_shader_group_vote 1 + +#define GLEW_ARB_shader_group_vote GLEW_GET_VAR(__GLEW_ARB_shader_group_vote) + +#endif /* GL_ARB_shader_group_vote */ + +/* --------------------- GL_ARB_shader_image_load_store -------------------- */ + +#ifndef GL_ARB_shader_image_load_store +#define GL_ARB_shader_image_load_store 1 + +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 +#define GL_COMMAND_BARRIER_BIT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 +#define GL_MAX_IMAGE_UNITS 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 +#define GL_IMAGE_BINDING_NAME 0x8F3A +#define GL_IMAGE_BINDING_LEVEL 0x8F3B +#define GL_IMAGE_BINDING_LAYERED 0x8F3C +#define GL_IMAGE_BINDING_LAYER 0x8F3D +#define GL_IMAGE_BINDING_ACCESS 0x8F3E +#define GL_IMAGE_1D 0x904C +#define GL_IMAGE_2D 0x904D +#define GL_IMAGE_3D 0x904E +#define GL_IMAGE_2D_RECT 0x904F +#define GL_IMAGE_CUBE 0x9050 +#define GL_IMAGE_BUFFER 0x9051 +#define GL_IMAGE_1D_ARRAY 0x9052 +#define GL_IMAGE_2D_ARRAY 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 +#define GL_INT_IMAGE_1D 0x9057 +#define GL_INT_IMAGE_2D 0x9058 +#define GL_INT_IMAGE_3D 0x9059 +#define GL_INT_IMAGE_2D_RECT 0x905A +#define GL_INT_IMAGE_CUBE 0x905B +#define GL_INT_IMAGE_BUFFER 0x905C +#define GL_INT_IMAGE_1D_ARRAY 0x905D +#define GL_INT_IMAGE_2D_ARRAY 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C +#define GL_MAX_IMAGE_SAMPLES 0x906D +#define GL_IMAGE_BINDING_FORMAT 0x906E +#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 +#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA +#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB +#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD +#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE +#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF +#define GL_ALL_BARRIER_BITS 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); +typedef void (GLAPIENTRY * PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); + +#define glBindImageTexture GLEW_GET_FUN(__glewBindImageTexture) +#define glMemoryBarrier GLEW_GET_FUN(__glewMemoryBarrier) + +#define GLEW_ARB_shader_image_load_store GLEW_GET_VAR(__GLEW_ARB_shader_image_load_store) + +#endif /* GL_ARB_shader_image_load_store */ + +/* ------------------------ GL_ARB_shader_image_size ----------------------- */ + +#ifndef GL_ARB_shader_image_size +#define GL_ARB_shader_image_size 1 + +#define GLEW_ARB_shader_image_size GLEW_GET_VAR(__GLEW_ARB_shader_image_size) + +#endif /* GL_ARB_shader_image_size */ + /* ------------------------- GL_ARB_shader_objects ------------------------- */ #ifndef GL_ARB_shader_objects @@ -3379,6 +6665,118 @@ typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj) #endif /* GL_ARB_shader_objects */ +/* ------------------------ GL_ARB_shader_precision ------------------------ */ + +#ifndef GL_ARB_shader_precision +#define GL_ARB_shader_precision 1 + +#define GLEW_ARB_shader_precision GLEW_GET_VAR(__GLEW_ARB_shader_precision) + +#endif /* GL_ARB_shader_precision */ + +/* ---------------------- GL_ARB_shader_stencil_export --------------------- */ + +#ifndef GL_ARB_shader_stencil_export +#define GL_ARB_shader_stencil_export 1 + +#define GLEW_ARB_shader_stencil_export GLEW_GET_VAR(__GLEW_ARB_shader_stencil_export) + +#endif /* GL_ARB_shader_stencil_export */ + +/* ------------------ GL_ARB_shader_storage_buffer_object ------------------ */ + +#ifndef GL_ARB_shader_storage_buffer_object +#define GL_ARB_shader_storage_buffer_object 1 + +#define GL_SHADER_STORAGE_BARRIER_BIT 0x2000 +#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 +#define GL_SHADER_STORAGE_BUFFER 0x90D2 +#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 +#define GL_SHADER_STORAGE_BUFFER_START 0x90D4 +#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 +#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 +#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 +#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 +#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 +#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA +#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB +#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC +#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD +#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE +#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF + +typedef void (GLAPIENTRY * PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); + +#define glShaderStorageBlockBinding GLEW_GET_FUN(__glewShaderStorageBlockBinding) + +#define GLEW_ARB_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_ARB_shader_storage_buffer_object) + +#endif /* GL_ARB_shader_storage_buffer_object */ + +/* ------------------------ GL_ARB_shader_subroutine ----------------------- */ + +#ifndef GL_ARB_shader_subroutine +#define GL_ARB_shader_subroutine 1 + +#define GL_ACTIVE_SUBROUTINES 0x8DE5 +#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 +#define GL_MAX_SUBROUTINES 0x8DE7 +#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 +#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 +#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A +#define GL_COMPATIBLE_SUBROUTINES 0x8E4B + +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint* values); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint* values); +typedef GLuint (GLAPIENTRY * PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint* params); +typedef void (GLAPIENTRY * PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint* indices); + +#define glGetActiveSubroutineName GLEW_GET_FUN(__glewGetActiveSubroutineName) +#define glGetActiveSubroutineUniformName GLEW_GET_FUN(__glewGetActiveSubroutineUniformName) +#define glGetActiveSubroutineUniformiv GLEW_GET_FUN(__glewGetActiveSubroutineUniformiv) +#define glGetProgramStageiv GLEW_GET_FUN(__glewGetProgramStageiv) +#define glGetSubroutineIndex GLEW_GET_FUN(__glewGetSubroutineIndex) +#define glGetSubroutineUniformLocation GLEW_GET_FUN(__glewGetSubroutineUniformLocation) +#define glGetUniformSubroutineuiv GLEW_GET_FUN(__glewGetUniformSubroutineuiv) +#define glUniformSubroutinesuiv GLEW_GET_FUN(__glewUniformSubroutinesuiv) + +#define GLEW_ARB_shader_subroutine GLEW_GET_VAR(__GLEW_ARB_shader_subroutine) + +#endif /* GL_ARB_shader_subroutine */ + +/* ------------------ GL_ARB_shader_texture_image_samples ------------------ */ + +#ifndef GL_ARB_shader_texture_image_samples +#define GL_ARB_shader_texture_image_samples 1 + +#define GLEW_ARB_shader_texture_image_samples GLEW_GET_VAR(__GLEW_ARB_shader_texture_image_samples) + +#endif /* GL_ARB_shader_texture_image_samples */ + +/* ----------------------- GL_ARB_shader_texture_lod ----------------------- */ + +#ifndef GL_ARB_shader_texture_lod +#define GL_ARB_shader_texture_lod 1 + +#define GLEW_ARB_shader_texture_lod GLEW_GET_VAR(__GLEW_ARB_shader_texture_lod) + +#endif /* GL_ARB_shader_texture_lod */ + +/* ------------------- GL_ARB_shader_viewport_layer_array ------------------ */ + +#ifndef GL_ARB_shader_viewport_layer_array +#define GL_ARB_shader_viewport_layer_array 1 + +#define GLEW_ARB_shader_viewport_layer_array GLEW_GET_VAR(__GLEW_ARB_shader_viewport_layer_array) + +#endif /* GL_ARB_shader_viewport_layer_array */ + /* ---------------------- GL_ARB_shading_language_100 ---------------------- */ #ifndef GL_ARB_shading_language_100 @@ -3390,6 +6788,51 @@ typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj) #endif /* GL_ARB_shading_language_100 */ +/* -------------------- GL_ARB_shading_language_420pack -------------------- */ + +#ifndef GL_ARB_shading_language_420pack +#define GL_ARB_shading_language_420pack 1 + +#define GLEW_ARB_shading_language_420pack GLEW_GET_VAR(__GLEW_ARB_shading_language_420pack) + +#endif /* GL_ARB_shading_language_420pack */ + +/* -------------------- GL_ARB_shading_language_include -------------------- */ + +#ifndef GL_ARB_shading_language_include +#define GL_ARB_shading_language_include 1 + +#define GL_SHADER_INCLUDE_ARB 0x8DAE +#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 +#define GL_NAMED_STRING_TYPE_ARB 0x8DEA + +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar* const *path, const GLint *length); +typedef void (GLAPIENTRY * PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name, GLsizei bufSize, GLint *stringlen, GLchar *string); +typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar* name, GLenum pname, GLint *params); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar* name, GLint stringlen, const GLchar *string); + +#define glCompileShaderIncludeARB GLEW_GET_FUN(__glewCompileShaderIncludeARB) +#define glDeleteNamedStringARB GLEW_GET_FUN(__glewDeleteNamedStringARB) +#define glGetNamedStringARB GLEW_GET_FUN(__glewGetNamedStringARB) +#define glGetNamedStringivARB GLEW_GET_FUN(__glewGetNamedStringivARB) +#define glIsNamedStringARB GLEW_GET_FUN(__glewIsNamedStringARB) +#define glNamedStringARB GLEW_GET_FUN(__glewNamedStringARB) + +#define GLEW_ARB_shading_language_include GLEW_GET_VAR(__GLEW_ARB_shading_language_include) + +#endif /* GL_ARB_shading_language_include */ + +/* -------------------- GL_ARB_shading_language_packing -------------------- */ + +#ifndef GL_ARB_shading_language_packing +#define GL_ARB_shading_language_packing 1 + +#define GLEW_ARB_shading_language_packing GLEW_GET_VAR(__GLEW_ARB_shading_language_packing) + +#endif /* GL_ARB_shading_language_packing */ + /* ----------------------------- GL_ARB_shadow ----------------------------- */ #ifndef GL_ARB_shadow @@ -3414,6 +6857,190 @@ typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj) #endif /* GL_ARB_shadow_ambient */ +/* -------------------------- GL_ARB_sparse_buffer ------------------------- */ + +#ifndef GL_ARB_sparse_buffer +#define GL_ARB_sparse_buffer 1 + +#define GL_SPARSE_STORAGE_BIT_ARB 0x0400 +#define GL_SPARSE_BUFFER_PAGE_SIZE_ARB 0x82F8 + +typedef void (GLAPIENTRY * PFNGLBUFFERPAGECOMMITMENTARBPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLboolean commit); + +#define glBufferPageCommitmentARB GLEW_GET_FUN(__glewBufferPageCommitmentARB) + +#define GLEW_ARB_sparse_buffer GLEW_GET_VAR(__GLEW_ARB_sparse_buffer) + +#endif /* GL_ARB_sparse_buffer */ + +/* ------------------------- GL_ARB_sparse_texture ------------------------- */ + +#ifndef GL_ARB_sparse_texture +#define GL_ARB_sparse_texture 1 + +#define GL_VIRTUAL_PAGE_SIZE_X_ARB 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_ARB 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_ARB 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_ARB 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB 0x919A +#define GL_TEXTURE_SPARSE_ARB 0x91A6 +#define GL_VIRTUAL_PAGE_SIZE_INDEX_ARB 0x91A7 +#define GL_NUM_VIRTUAL_PAGE_SIZES_ARB 0x91A8 +#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB 0x91A9 +#define GL_NUM_SPARSE_LEVELS_ARB 0x91AA + +typedef void (GLAPIENTRY * PFNGLTEXPAGECOMMITMENTARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); + +#define glTexPageCommitmentARB GLEW_GET_FUN(__glewTexPageCommitmentARB) + +#define GLEW_ARB_sparse_texture GLEW_GET_VAR(__GLEW_ARB_sparse_texture) + +#endif /* GL_ARB_sparse_texture */ + +/* ------------------------- GL_ARB_sparse_texture2 ------------------------ */ + +#ifndef GL_ARB_sparse_texture2 +#define GL_ARB_sparse_texture2 1 + +#define GLEW_ARB_sparse_texture2 GLEW_GET_VAR(__GLEW_ARB_sparse_texture2) + +#endif /* GL_ARB_sparse_texture2 */ + +/* ---------------------- GL_ARB_sparse_texture_clamp ---------------------- */ + +#ifndef GL_ARB_sparse_texture_clamp +#define GL_ARB_sparse_texture_clamp 1 + +#define GLEW_ARB_sparse_texture_clamp GLEW_GET_VAR(__GLEW_ARB_sparse_texture_clamp) + +#endif /* GL_ARB_sparse_texture_clamp */ + +/* ------------------------ GL_ARB_spirv_extensions ------------------------ */ + +#ifndef GL_ARB_spirv_extensions +#define GL_ARB_spirv_extensions 1 + +#define GL_SPIR_V_EXTENSIONS 0x9553 +#define GL_NUM_SPIR_V_EXTENSIONS 0x9554 + +#define GLEW_ARB_spirv_extensions GLEW_GET_VAR(__GLEW_ARB_spirv_extensions) + +#endif /* GL_ARB_spirv_extensions */ + +/* ------------------------ GL_ARB_stencil_texturing ----------------------- */ + +#ifndef GL_ARB_stencil_texturing +#define GL_ARB_stencil_texturing 1 + +#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA + +#define GLEW_ARB_stencil_texturing GLEW_GET_VAR(__GLEW_ARB_stencil_texturing) + +#endif /* GL_ARB_stencil_texturing */ + +/* ------------------------------ GL_ARB_sync ------------------------------ */ + +#ifndef GL_ARB_sync +#define GL_ARB_sync 1 + +#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 +#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 +#define GL_OBJECT_TYPE 0x9112 +#define GL_SYNC_CONDITION 0x9113 +#define GL_SYNC_STATUS 0x9114 +#define GL_SYNC_FLAGS 0x9115 +#define GL_SYNC_FENCE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 +#define GL_UNSIGNALED 0x9118 +#define GL_SIGNALED 0x9119 +#define GL_ALREADY_SIGNALED 0x911A +#define GL_TIMEOUT_EXPIRED 0x911B +#define GL_CONDITION_SATISFIED 0x911C +#define GL_WAIT_FAILED 0x911D +#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull + +typedef GLenum (GLAPIENTRY * PFNGLCLIENTWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); +typedef void (GLAPIENTRY * PFNGLDELETESYNCPROC) (GLsync GLsync); +typedef GLsync (GLAPIENTRY * PFNGLFENCESYNCPROC) (GLenum condition,GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETSYNCIVPROC) (GLsync GLsync,GLenum pname,GLsizei bufSize,GLsizei* length, GLint *values); +typedef GLboolean (GLAPIENTRY * PFNGLISSYNCPROC) (GLsync GLsync); +typedef void (GLAPIENTRY * PFNGLWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); + +#define glClientWaitSync GLEW_GET_FUN(__glewClientWaitSync) +#define glDeleteSync GLEW_GET_FUN(__glewDeleteSync) +#define glFenceSync GLEW_GET_FUN(__glewFenceSync) +#define glGetInteger64v GLEW_GET_FUN(__glewGetInteger64v) +#define glGetSynciv GLEW_GET_FUN(__glewGetSynciv) +#define glIsSync GLEW_GET_FUN(__glewIsSync) +#define glWaitSync GLEW_GET_FUN(__glewWaitSync) + +#define GLEW_ARB_sync GLEW_GET_VAR(__GLEW_ARB_sync) + +#endif /* GL_ARB_sync */ + +/* ----------------------- GL_ARB_tessellation_shader ---------------------- */ + +#ifndef GL_ARB_tessellation_shader +#define GL_ARB_tessellation_shader 1 + +#define GL_PATCHES 0xE +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 +#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C +#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D +#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E +#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F +#define GL_PATCH_VERTICES 0x8E72 +#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 +#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 +#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 +#define GL_TESS_GEN_MODE 0x8E76 +#define GL_TESS_GEN_SPACING 0x8E77 +#define GL_TESS_GEN_VERTEX_ORDER 0x8E78 +#define GL_TESS_GEN_POINT_MODE 0x8E79 +#define GL_ISOLINES 0x8E7A +#define GL_FRACTIONAL_ODD 0x8E7B +#define GL_FRACTIONAL_EVEN 0x8E7C +#define GL_MAX_PATCH_VERTICES 0x8E7D +#define GL_MAX_TESS_GEN_LEVEL 0x8E7E +#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F +#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 +#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 +#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 +#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 +#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 +#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 +#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 +#define GL_TESS_EVALUATION_SHADER 0x8E87 +#define GL_TESS_CONTROL_SHADER 0x8E88 +#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 +#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A + +typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat* values); +typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value); + +#define glPatchParameterfv GLEW_GET_FUN(__glewPatchParameterfv) +#define glPatchParameteri GLEW_GET_FUN(__glewPatchParameteri) + +#define GLEW_ARB_tessellation_shader GLEW_GET_VAR(__GLEW_ARB_tessellation_shader) + +#endif /* GL_ARB_tessellation_shader */ + +/* ------------------------- GL_ARB_texture_barrier ------------------------ */ + +#ifndef GL_ARB_texture_barrier +#define GL_ARB_texture_barrier 1 + +typedef void (GLAPIENTRY * PFNGLTEXTUREBARRIERPROC) (void); + +#define glTextureBarrier GLEW_GET_FUN(__glewTextureBarrier) + +#define GLEW_ARB_texture_barrier GLEW_GET_VAR(__GLEW_ARB_texture_barrier) + +#endif /* GL_ARB_texture_barrier */ + /* ---------------------- GL_ARB_texture_border_clamp ---------------------- */ #ifndef GL_ARB_texture_border_clamp @@ -3444,6 +7071,34 @@ typedef void (GLAPIENTRY * PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum interna #endif /* GL_ARB_texture_buffer_object */ +/* ------------------- GL_ARB_texture_buffer_object_rgb32 ------------------ */ + +#ifndef GL_ARB_texture_buffer_object_rgb32 +#define GL_ARB_texture_buffer_object_rgb32 1 + +#define GLEW_ARB_texture_buffer_object_rgb32 GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object_rgb32) + +#endif /* GL_ARB_texture_buffer_object_rgb32 */ + +/* ---------------------- GL_ARB_texture_buffer_range ---------------------- */ + +#ifndef GL_ARB_texture_buffer_range +#define GL_ARB_texture_buffer_range 1 + +#define GL_TEXTURE_BUFFER_OFFSET 0x919D +#define GL_TEXTURE_BUFFER_SIZE 0x919E +#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F + +typedef void (GLAPIENTRY * PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); + +#define glTexBufferRange GLEW_GET_FUN(__glewTexBufferRange) +#define glTextureBufferRangeEXT GLEW_GET_FUN(__glewTextureBufferRangeEXT) + +#define GLEW_ARB_texture_buffer_range GLEW_GET_VAR(__GLEW_ARB_texture_buffer_range) + +#endif /* GL_ARB_texture_buffer_range */ + /* ----------------------- GL_ARB_texture_compression ---------------------- */ #ifndef GL_ARB_texture_compression @@ -3461,13 +7116,13 @@ typedef void (GLAPIENTRY * PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum interna #define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 #define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, void* img); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, void *img); #define glCompressedTexImage1DARB GLEW_GET_FUN(__glewCompressedTexImage1DARB) #define glCompressedTexImage2DARB GLEW_GET_FUN(__glewCompressedTexImage2DARB) @@ -3481,6 +7136,20 @@ typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GL #endif /* GL_ARB_texture_compression */ +/* -------------------- GL_ARB_texture_compression_bptc -------------------- */ + +#ifndef GL_ARB_texture_compression_bptc +#define GL_ARB_texture_compression_bptc 1 + +#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F + +#define GLEW_ARB_texture_compression_bptc GLEW_GET_VAR(__GLEW_ARB_texture_compression_bptc) + +#endif /* GL_ARB_texture_compression_bptc */ + /* -------------------- GL_ARB_texture_compression_rgtc -------------------- */ #ifndef GL_ARB_texture_compression_rgtc @@ -3517,6 +7186,23 @@ typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GL #endif /* GL_ARB_texture_cube_map */ +/* --------------------- GL_ARB_texture_cube_map_array --------------------- */ + +#ifndef GL_ARB_texture_cube_map_array +#define GL_ARB_texture_cube_map_array 1 + +#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F + +#define GLEW_ARB_texture_cube_map_array GLEW_GET_VAR(__GLEW_ARB_texture_cube_map_array) + +#endif /* GL_ARB_texture_cube_map_array */ + /* ------------------------- GL_ARB_texture_env_add ------------------------ */ #ifndef GL_ARB_texture_env_add @@ -3579,6 +7265,30 @@ typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GL #endif /* GL_ARB_texture_env_dot3 */ +/* ------------------- GL_ARB_texture_filter_anisotropic ------------------- */ + +#ifndef GL_ARB_texture_filter_anisotropic +#define GL_ARB_texture_filter_anisotropic 1 + +#define GL_TEXTURE_MAX_ANISOTROPY 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY 0x84FF + +#define GLEW_ARB_texture_filter_anisotropic GLEW_GET_VAR(__GLEW_ARB_texture_filter_anisotropic) + +#endif /* GL_ARB_texture_filter_anisotropic */ + +/* ---------------------- GL_ARB_texture_filter_minmax --------------------- */ + +#ifndef GL_ARB_texture_filter_minmax +#define GL_ARB_texture_filter_minmax 1 + +#define GL_TEXTURE_REDUCTION_MODE_ARB 0x9366 +#define GL_WEIGHTED_AVERAGE_ARB 0x9367 + +#define GLEW_ARB_texture_filter_minmax GLEW_GET_VAR(__GLEW_ARB_texture_filter_minmax) + +#endif /* GL_ARB_texture_filter_minmax */ + /* -------------------------- GL_ARB_texture_float ------------------------- */ #ifndef GL_ARB_texture_float @@ -3609,6 +7319,30 @@ typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GL #endif /* GL_ARB_texture_float */ +/* ------------------------- GL_ARB_texture_gather ------------------------- */ + +#ifndef GL_ARB_texture_gather +#define GL_ARB_texture_gather 1 + +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F +#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F + +#define GLEW_ARB_texture_gather GLEW_GET_VAR(__GLEW_ARB_texture_gather) + +#endif /* GL_ARB_texture_gather */ + +/* ------------------ GL_ARB_texture_mirror_clamp_to_edge ------------------ */ + +#ifndef GL_ARB_texture_mirror_clamp_to_edge +#define GL_ARB_texture_mirror_clamp_to_edge 1 + +#define GL_MIRROR_CLAMP_TO_EDGE 0x8743 + +#define GLEW_ARB_texture_mirror_clamp_to_edge GLEW_GET_VAR(__GLEW_ARB_texture_mirror_clamp_to_edge) + +#endif /* GL_ARB_texture_mirror_clamp_to_edge */ + /* --------------------- GL_ARB_texture_mirrored_repeat -------------------- */ #ifndef GL_ARB_texture_mirrored_repeat @@ -3620,6 +7354,47 @@ typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GL #endif /* GL_ARB_texture_mirrored_repeat */ +/* ----------------------- GL_ARB_texture_multisample ---------------------- */ + +#ifndef GL_ARB_texture_multisample +#define GL_ARB_texture_multisample 1 + +#define GL_SAMPLE_POSITION 0x8E50 +#define GL_SAMPLE_MASK 0x8E51 +#define GL_SAMPLE_MASK_VALUE 0x8E52 +#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 +#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 +#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 +#define GL_TEXTURE_SAMPLES 0x9106 +#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 +#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 +#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A +#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B +#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D +#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E +#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F +#define GL_MAX_INTEGER_SAMPLES 0x9110 + +typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat* val); +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); + +#define glGetMultisamplefv GLEW_GET_FUN(__glewGetMultisamplefv) +#define glSampleMaski GLEW_GET_FUN(__glewSampleMaski) +#define glTexImage2DMultisample GLEW_GET_FUN(__glewTexImage2DMultisample) +#define glTexImage3DMultisample GLEW_GET_FUN(__glewTexImage3DMultisample) + +#define GLEW_ARB_texture_multisample GLEW_GET_VAR(__GLEW_ARB_texture_multisample) + +#endif /* GL_ARB_texture_multisample */ + /* -------------------- GL_ARB_texture_non_power_of_two -------------------- */ #ifndef GL_ARB_texture_non_power_of_two @@ -3629,6 +7404,24 @@ typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GL #endif /* GL_ARB_texture_non_power_of_two */ +/* ---------------------- GL_ARB_texture_query_levels ---------------------- */ + +#ifndef GL_ARB_texture_query_levels +#define GL_ARB_texture_query_levels 1 + +#define GLEW_ARB_texture_query_levels GLEW_GET_VAR(__GLEW_ARB_texture_query_levels) + +#endif /* GL_ARB_texture_query_levels */ + +/* ------------------------ GL_ARB_texture_query_lod ----------------------- */ + +#ifndef GL_ARB_texture_query_lod +#define GL_ARB_texture_query_lod 1 + +#define GLEW_ARB_texture_query_lod GLEW_GET_VAR(__GLEW_ARB_texture_query_lod) + +#endif /* GL_ARB_texture_query_lod */ + /* ------------------------ GL_ARB_texture_rectangle ----------------------- */ #ifndef GL_ARB_texture_rectangle @@ -3650,7 +7443,8 @@ typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GL #ifndef GL_ARB_texture_rg #define GL_ARB_texture_rg 1 -#define GL_RED 0x1903 +#define GL_COMPRESSED_RED 0x8225 +#define GL_COMPRESSED_RG 0x8226 #define GL_RG 0x8227 #define GL_RG_INTEGER 0x8228 #define GL_R8 0x8229 @@ -3678,6 +7472,200 @@ typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GL #endif /* GL_ARB_texture_rg */ +/* ----------------------- GL_ARB_texture_rgb10_a2ui ----------------------- */ + +#ifndef GL_ARB_texture_rgb10_a2ui +#define GL_ARB_texture_rgb10_a2ui 1 + +#define GL_RGB10_A2UI 0x906F + +#define GLEW_ARB_texture_rgb10_a2ui GLEW_GET_VAR(__GLEW_ARB_texture_rgb10_a2ui) + +#endif /* GL_ARB_texture_rgb10_a2ui */ + +/* ------------------------ GL_ARB_texture_stencil8 ------------------------ */ + +#ifndef GL_ARB_texture_stencil8 +#define GL_ARB_texture_stencil8 1 + +#define GL_STENCIL_INDEX 0x1901 +#define GL_STENCIL_INDEX8 0x8D48 + +#define GLEW_ARB_texture_stencil8 GLEW_GET_VAR(__GLEW_ARB_texture_stencil8) + +#endif /* GL_ARB_texture_stencil8 */ + +/* ------------------------- GL_ARB_texture_storage ------------------------ */ + +#ifndef GL_ARB_texture_storage +#define GL_ARB_texture_storage 1 + +#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); + +#define glTexStorage1D GLEW_GET_FUN(__glewTexStorage1D) +#define glTexStorage2D GLEW_GET_FUN(__glewTexStorage2D) +#define glTexStorage3D GLEW_GET_FUN(__glewTexStorage3D) + +#define GLEW_ARB_texture_storage GLEW_GET_VAR(__GLEW_ARB_texture_storage) + +#endif /* GL_ARB_texture_storage */ + +/* ------------------- GL_ARB_texture_storage_multisample ------------------ */ + +#ifndef GL_ARB_texture_storage_multisample +#define GL_ARB_texture_storage_multisample 1 + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); + +#define glTexStorage2DMultisample GLEW_GET_FUN(__glewTexStorage2DMultisample) +#define glTexStorage3DMultisample GLEW_GET_FUN(__glewTexStorage3DMultisample) +#define glTextureStorage2DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage2DMultisampleEXT) +#define glTextureStorage3DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage3DMultisampleEXT) + +#define GLEW_ARB_texture_storage_multisample GLEW_GET_VAR(__GLEW_ARB_texture_storage_multisample) + +#endif /* GL_ARB_texture_storage_multisample */ + +/* ------------------------- GL_ARB_texture_swizzle ------------------------ */ + +#ifndef GL_ARB_texture_swizzle +#define GL_ARB_texture_swizzle 1 + +#define GL_TEXTURE_SWIZZLE_R 0x8E42 +#define GL_TEXTURE_SWIZZLE_G 0x8E43 +#define GL_TEXTURE_SWIZZLE_B 0x8E44 +#define GL_TEXTURE_SWIZZLE_A 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 + +#define GLEW_ARB_texture_swizzle GLEW_GET_VAR(__GLEW_ARB_texture_swizzle) + +#endif /* GL_ARB_texture_swizzle */ + +/* -------------------------- GL_ARB_texture_view -------------------------- */ + +#ifndef GL_ARB_texture_view +#define GL_ARB_texture_view 1 + +#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB +#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC +#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD +#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF + +typedef void (GLAPIENTRY * PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); + +#define glTextureView GLEW_GET_FUN(__glewTextureView) + +#define GLEW_ARB_texture_view GLEW_GET_VAR(__GLEW_ARB_texture_view) + +#endif /* GL_ARB_texture_view */ + +/* --------------------------- GL_ARB_timer_query -------------------------- */ + +#ifndef GL_ARB_timer_query +#define GL_ARB_timer_query 1 + +#define GL_TIME_ELAPSED 0x88BF +#define GL_TIMESTAMP 0x8E28 + +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); + +#define glGetQueryObjecti64v GLEW_GET_FUN(__glewGetQueryObjecti64v) +#define glGetQueryObjectui64v GLEW_GET_FUN(__glewGetQueryObjectui64v) +#define glQueryCounter GLEW_GET_FUN(__glewQueryCounter) + +#define GLEW_ARB_timer_query GLEW_GET_VAR(__GLEW_ARB_timer_query) + +#endif /* GL_ARB_timer_query */ + +/* ----------------------- GL_ARB_transform_feedback2 ---------------------- */ + +#ifndef GL_ARB_transform_feedback2 +#define GL_ARB_transform_feedback2 1 + +#define GL_TRANSFORM_FEEDBACK 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 + +typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id); +typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint* ids); +typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); +typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); + +#define glBindTransformFeedback GLEW_GET_FUN(__glewBindTransformFeedback) +#define glDeleteTransformFeedbacks GLEW_GET_FUN(__glewDeleteTransformFeedbacks) +#define glDrawTransformFeedback GLEW_GET_FUN(__glewDrawTransformFeedback) +#define glGenTransformFeedbacks GLEW_GET_FUN(__glewGenTransformFeedbacks) +#define glIsTransformFeedback GLEW_GET_FUN(__glewIsTransformFeedback) +#define glPauseTransformFeedback GLEW_GET_FUN(__glewPauseTransformFeedback) +#define glResumeTransformFeedback GLEW_GET_FUN(__glewResumeTransformFeedback) + +#define GLEW_ARB_transform_feedback2 GLEW_GET_VAR(__GLEW_ARB_transform_feedback2) + +#endif /* GL_ARB_transform_feedback2 */ + +/* ----------------------- GL_ARB_transform_feedback3 ---------------------- */ + +#ifndef GL_ARB_transform_feedback3 +#define GL_ARB_transform_feedback3 1 + +#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 +#define GL_MAX_VERTEX_STREAMS 0x8E71 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream); +typedef void (GLAPIENTRY * PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); + +#define glBeginQueryIndexed GLEW_GET_FUN(__glewBeginQueryIndexed) +#define glDrawTransformFeedbackStream GLEW_GET_FUN(__glewDrawTransformFeedbackStream) +#define glEndQueryIndexed GLEW_GET_FUN(__glewEndQueryIndexed) +#define glGetQueryIndexediv GLEW_GET_FUN(__glewGetQueryIndexediv) + +#define GLEW_ARB_transform_feedback3 GLEW_GET_VAR(__GLEW_ARB_transform_feedback3) + +#endif /* GL_ARB_transform_feedback3 */ + +/* ------------------ GL_ARB_transform_feedback_instanced ------------------ */ + +#ifndef GL_ARB_transform_feedback_instanced +#define GL_ARB_transform_feedback_instanced 1 + +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei primcount); + +#define glDrawTransformFeedbackInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackInstanced) +#define glDrawTransformFeedbackStreamInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackStreamInstanced) + +#define GLEW_ARB_transform_feedback_instanced GLEW_GET_VAR(__GLEW_ARB_transform_feedback_instanced) + +#endif /* GL_ARB_transform_feedback_instanced */ + +/* ---------------- GL_ARB_transform_feedback_overflow_query --------------- */ + +#ifndef GL_ARB_transform_feedback_overflow_query +#define GL_ARB_transform_feedback_overflow_query 1 + +#define GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB 0x82EC +#define GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB 0x82ED + +#define GLEW_ARB_transform_feedback_overflow_query GLEW_GET_VAR(__GLEW_ARB_transform_feedback_overflow_query) + +#endif /* GL_ARB_transform_feedback_overflow_query */ + /* ------------------------ GL_ARB_transpose_matrix ------------------------ */ #ifndef GL_ARB_transpose_matrix @@ -3702,6 +7690,82 @@ typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); #endif /* GL_ARB_transpose_matrix */ +/* ---------------------- GL_ARB_uniform_buffer_object --------------------- */ + +#ifndef GL_ARB_uniform_buffer_object +#define GL_ARB_uniform_buffer_object 1 + +#define GL_UNIFORM_BUFFER 0x8A11 +#define GL_UNIFORM_BUFFER_BINDING 0x8A28 +#define GL_UNIFORM_BUFFER_START 0x8A29 +#define GL_UNIFORM_BUFFER_SIZE 0x8A2A +#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C +#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D +#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E +#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F +#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 +#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 +#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 +#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 +#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 +#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 +#define GL_UNIFORM_TYPE 0x8A37 +#define GL_UNIFORM_SIZE 0x8A38 +#define GL_UNIFORM_NAME_LENGTH 0x8A39 +#define GL_UNIFORM_BLOCK_INDEX 0x8A3A +#define GL_UNIFORM_OFFSET 0x8A3B +#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C +#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D +#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E +#define GL_UNIFORM_BLOCK_BINDING 0x8A3F +#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 +#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 +#define GL_INVALID_INDEX 0xFFFFFFFFu + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformName); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint* data); +typedef GLuint (GLAPIENTRY * PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar* uniformBlockName); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar* const * uniformNames, GLuint* uniformIndices); +typedef void (GLAPIENTRY * PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); + +#define glBindBufferBase GLEW_GET_FUN(__glewBindBufferBase) +#define glBindBufferRange GLEW_GET_FUN(__glewBindBufferRange) +#define glGetActiveUniformBlockName GLEW_GET_FUN(__glewGetActiveUniformBlockName) +#define glGetActiveUniformBlockiv GLEW_GET_FUN(__glewGetActiveUniformBlockiv) +#define glGetActiveUniformName GLEW_GET_FUN(__glewGetActiveUniformName) +#define glGetActiveUniformsiv GLEW_GET_FUN(__glewGetActiveUniformsiv) +#define glGetIntegeri_v GLEW_GET_FUN(__glewGetIntegeri_v) +#define glGetUniformBlockIndex GLEW_GET_FUN(__glewGetUniformBlockIndex) +#define glGetUniformIndices GLEW_GET_FUN(__glewGetUniformIndices) +#define glUniformBlockBinding GLEW_GET_FUN(__glewUniformBlockBinding) + +#define GLEW_ARB_uniform_buffer_object GLEW_GET_VAR(__GLEW_ARB_uniform_buffer_object) + +#endif /* GL_ARB_uniform_buffer_object */ + +/* ------------------------ GL_ARB_vertex_array_bgra ----------------------- */ + +#ifndef GL_ARB_vertex_array_bgra +#define GL_ARB_vertex_array_bgra 1 + +#define GL_BGRA 0x80E1 + +#define GLEW_ARB_vertex_array_bgra GLEW_GET_VAR(__GLEW_ARB_vertex_array_bgra) + +#endif /* GL_ARB_vertex_array_bgra */ + /* ----------------------- GL_ARB_vertex_array_object ---------------------- */ #ifndef GL_ARB_vertex_array_object @@ -3723,6 +7787,81 @@ typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYPROC) (GLuint array); #endif /* GL_ARB_vertex_array_object */ +/* ----------------------- GL_ARB_vertex_attrib_64bit ---------------------- */ + +#ifndef GL_ARB_vertex_attrib_64bit +#define GL_ARB_vertex_attrib_64bit 1 + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); + +#define glGetVertexAttribLdv GLEW_GET_FUN(__glewGetVertexAttribLdv) +#define glVertexAttribL1d GLEW_GET_FUN(__glewVertexAttribL1d) +#define glVertexAttribL1dv GLEW_GET_FUN(__glewVertexAttribL1dv) +#define glVertexAttribL2d GLEW_GET_FUN(__glewVertexAttribL2d) +#define glVertexAttribL2dv GLEW_GET_FUN(__glewVertexAttribL2dv) +#define glVertexAttribL3d GLEW_GET_FUN(__glewVertexAttribL3d) +#define glVertexAttribL3dv GLEW_GET_FUN(__glewVertexAttribL3dv) +#define glVertexAttribL4d GLEW_GET_FUN(__glewVertexAttribL4d) +#define glVertexAttribL4dv GLEW_GET_FUN(__glewVertexAttribL4dv) +#define glVertexAttribLPointer GLEW_GET_FUN(__glewVertexAttribLPointer) + +#define GLEW_ARB_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_64bit) + +#endif /* GL_ARB_vertex_attrib_64bit */ + +/* ---------------------- GL_ARB_vertex_attrib_binding --------------------- */ + +#ifndef GL_ARB_vertex_attrib_binding +#define GL_ARB_vertex_attrib_binding 1 + +#define GL_VERTEX_ATTRIB_BINDING 0x82D4 +#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 +#define GL_VERTEX_BINDING_DIVISOR 0x82D6 +#define GL_VERTEX_BINDING_OFFSET 0x82D7 +#define GL_VERTEX_BINDING_STRIDE 0x82D8 +#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 +#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA +#define GL_VERTEX_BINDING_BUFFER 0x8F4F + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor); + +#define glBindVertexBuffer GLEW_GET_FUN(__glewBindVertexBuffer) +#define glVertexArrayBindVertexBufferEXT GLEW_GET_FUN(__glewVertexArrayBindVertexBufferEXT) +#define glVertexArrayVertexAttribBindingEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribBindingEXT) +#define glVertexArrayVertexAttribFormatEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribFormatEXT) +#define glVertexArrayVertexAttribIFormatEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribIFormatEXT) +#define glVertexArrayVertexAttribLFormatEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribLFormatEXT) +#define glVertexArrayVertexBindingDivisorEXT GLEW_GET_FUN(__glewVertexArrayVertexBindingDivisorEXT) +#define glVertexAttribBinding GLEW_GET_FUN(__glewVertexAttribBinding) +#define glVertexAttribFormat GLEW_GET_FUN(__glewVertexAttribFormat) +#define glVertexAttribIFormat GLEW_GET_FUN(__glewVertexAttribIFormat) +#define glVertexAttribLFormat GLEW_GET_FUN(__glewVertexAttribLFormat) +#define glVertexBindingDivisor GLEW_GET_FUN(__glewVertexBindingDivisor) + +#define GLEW_ARB_vertex_attrib_binding GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_binding) + +#endif /* GL_ARB_vertex_attrib_binding */ + /* -------------------------- GL_ARB_vertex_blend -------------------------- */ #ifndef GL_ARB_vertex_blend @@ -3772,7 +7911,7 @@ typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYPROC) (GLuint array); #define GL_MODELVIEW31_ARB 0x873F typedef void (GLAPIENTRY * PFNGLVERTEXBLENDARBPROC) (GLint count); -typedef void (GLAPIENTRY * PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, void *pointer); typedef void (GLAPIENTRY * PFNGLWEIGHTBVARBPROC) (GLint size, GLbyte *weights); typedef void (GLAPIENTRY * PFNGLWEIGHTDVARBPROC) (GLint size, GLdouble *weights); typedef void (GLAPIENTRY * PFNGLWEIGHTFVARBPROC) (GLint size, GLfloat *weights); @@ -3834,19 +7973,19 @@ typedef void (GLAPIENTRY * PFNGLWEIGHTUSVARBPROC) (GLint size, GLushort *weights #define GL_DYNAMIC_READ_ARB 0x88E9 #define GL_DYNAMIC_COPY_ARB 0x88EA -typedef ptrdiff_t GLsizeiptrARB; typedef ptrdiff_t GLintptrARB; +typedef ptrdiff_t GLsizeiptrARB; typedef void (GLAPIENTRY * PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); -typedef void (GLAPIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid* data, GLenum usage); -typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data); typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint* buffers); typedef void (GLAPIENTRY * PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint* buffers); typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid** params); -typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid* data); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, void** params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data); typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERARBPROC) (GLuint buffer); -typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); +typedef void * (GLAPIENTRY * PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERARBPROC) (GLenum target); #define glBindBufferARB GLEW_GET_FUN(__glewBindBufferARB) @@ -3959,9 +8098,9 @@ typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, void* string); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, void *string); typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, void** pointer); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint* params); @@ -3974,7 +8113,7 @@ typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void* string); +typedef void (GLAPIENTRY * PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void *string); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); @@ -4011,7 +8150,7 @@ typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLs typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); #define glBindProgramARB GLEW_GET_FUN(__glewBindProgramARB) #define glDeleteProgramsARB GLEW_GET_FUN(__glewDeleteProgramsARB) @@ -4105,6 +8244,152 @@ typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programO #endif /* GL_ARB_vertex_shader */ +/* ------------------- GL_ARB_vertex_type_10f_11f_11f_rev ------------------ */ + +#ifndef GL_ARB_vertex_type_10f_11f_11f_rev +#define GL_ARB_vertex_type_10f_11f_11f_rev 1 + +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B + +#define GLEW_ARB_vertex_type_10f_11f_11f_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_10f_11f_11f_rev) + +#endif /* GL_ARB_vertex_type_10f_11f_11f_rev */ + +/* ------------------- GL_ARB_vertex_type_2_10_10_10_rev ------------------- */ + +#ifndef GL_ARB_vertex_type_2_10_10_10_rev +#define GL_ARB_vertex_type_2_10_10_10_rev 1 + +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_INT_2_10_10_10_REV 0x8D9F + +typedef void (GLAPIENTRY * PFNGLCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLCOLORP4UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint* value); + +#define glColorP3ui GLEW_GET_FUN(__glewColorP3ui) +#define glColorP3uiv GLEW_GET_FUN(__glewColorP3uiv) +#define glColorP4ui GLEW_GET_FUN(__glewColorP4ui) +#define glColorP4uiv GLEW_GET_FUN(__glewColorP4uiv) +#define glMultiTexCoordP1ui GLEW_GET_FUN(__glewMultiTexCoordP1ui) +#define glMultiTexCoordP1uiv GLEW_GET_FUN(__glewMultiTexCoordP1uiv) +#define glMultiTexCoordP2ui GLEW_GET_FUN(__glewMultiTexCoordP2ui) +#define glMultiTexCoordP2uiv GLEW_GET_FUN(__glewMultiTexCoordP2uiv) +#define glMultiTexCoordP3ui GLEW_GET_FUN(__glewMultiTexCoordP3ui) +#define glMultiTexCoordP3uiv GLEW_GET_FUN(__glewMultiTexCoordP3uiv) +#define glMultiTexCoordP4ui GLEW_GET_FUN(__glewMultiTexCoordP4ui) +#define glMultiTexCoordP4uiv GLEW_GET_FUN(__glewMultiTexCoordP4uiv) +#define glNormalP3ui GLEW_GET_FUN(__glewNormalP3ui) +#define glNormalP3uiv GLEW_GET_FUN(__glewNormalP3uiv) +#define glSecondaryColorP3ui GLEW_GET_FUN(__glewSecondaryColorP3ui) +#define glSecondaryColorP3uiv GLEW_GET_FUN(__glewSecondaryColorP3uiv) +#define glTexCoordP1ui GLEW_GET_FUN(__glewTexCoordP1ui) +#define glTexCoordP1uiv GLEW_GET_FUN(__glewTexCoordP1uiv) +#define glTexCoordP2ui GLEW_GET_FUN(__glewTexCoordP2ui) +#define glTexCoordP2uiv GLEW_GET_FUN(__glewTexCoordP2uiv) +#define glTexCoordP3ui GLEW_GET_FUN(__glewTexCoordP3ui) +#define glTexCoordP3uiv GLEW_GET_FUN(__glewTexCoordP3uiv) +#define glTexCoordP4ui GLEW_GET_FUN(__glewTexCoordP4ui) +#define glTexCoordP4uiv GLEW_GET_FUN(__glewTexCoordP4uiv) +#define glVertexAttribP1ui GLEW_GET_FUN(__glewVertexAttribP1ui) +#define glVertexAttribP1uiv GLEW_GET_FUN(__glewVertexAttribP1uiv) +#define glVertexAttribP2ui GLEW_GET_FUN(__glewVertexAttribP2ui) +#define glVertexAttribP2uiv GLEW_GET_FUN(__glewVertexAttribP2uiv) +#define glVertexAttribP3ui GLEW_GET_FUN(__glewVertexAttribP3ui) +#define glVertexAttribP3uiv GLEW_GET_FUN(__glewVertexAttribP3uiv) +#define glVertexAttribP4ui GLEW_GET_FUN(__glewVertexAttribP4ui) +#define glVertexAttribP4uiv GLEW_GET_FUN(__glewVertexAttribP4uiv) +#define glVertexP2ui GLEW_GET_FUN(__glewVertexP2ui) +#define glVertexP2uiv GLEW_GET_FUN(__glewVertexP2uiv) +#define glVertexP3ui GLEW_GET_FUN(__glewVertexP3ui) +#define glVertexP3uiv GLEW_GET_FUN(__glewVertexP3uiv) +#define glVertexP4ui GLEW_GET_FUN(__glewVertexP4ui) +#define glVertexP4uiv GLEW_GET_FUN(__glewVertexP4uiv) + +#define GLEW_ARB_vertex_type_2_10_10_10_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_2_10_10_10_rev) + +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ + +/* ------------------------- GL_ARB_viewport_array ------------------------- */ + +#ifndef GL_ARB_viewport_array +#define GL_ARB_viewport_array 1 + +#define GL_DEPTH_RANGE 0x0B70 +#define GL_VIEWPORT 0x0BA2 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_MAX_VIEWPORTS 0x825B +#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C +#define GL_VIEWPORT_BOUNDS_RANGE 0x825D +#define GL_LAYER_PROVOKING_VERTEX 0x825E +#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F +#define GL_UNDEFINED_VERTEX 0x8260 +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F + +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLclampd * v); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLclampd n, GLclampd f); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble* data); +typedef void (GLAPIENTRY * PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat* data); +typedef void (GLAPIENTRY * PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint * v); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat * v); + +#define glDepthRangeArrayv GLEW_GET_FUN(__glewDepthRangeArrayv) +#define glDepthRangeIndexed GLEW_GET_FUN(__glewDepthRangeIndexed) +#define glGetDoublei_v GLEW_GET_FUN(__glewGetDoublei_v) +#define glGetFloati_v GLEW_GET_FUN(__glewGetFloati_v) +#define glScissorArrayv GLEW_GET_FUN(__glewScissorArrayv) +#define glScissorIndexed GLEW_GET_FUN(__glewScissorIndexed) +#define glScissorIndexedv GLEW_GET_FUN(__glewScissorIndexedv) +#define glViewportArrayv GLEW_GET_FUN(__glewViewportArrayv) +#define glViewportIndexedf GLEW_GET_FUN(__glewViewportIndexedf) +#define glViewportIndexedfv GLEW_GET_FUN(__glewViewportIndexedfv) + +#define GLEW_ARB_viewport_array GLEW_GET_VAR(__GLEW_ARB_viewport_array) + +#endif /* GL_ARB_viewport_array */ + /* --------------------------- GL_ARB_window_pos --------------------------- */ #ifndef GL_ARB_window_pos @@ -4148,6 +8433,60 @@ typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVARBPROC) (const GLshort* p); #endif /* GL_ARB_window_pos */ +/* ----------------------- GL_ARM_mali_program_binary ---------------------- */ + +#ifndef GL_ARM_mali_program_binary +#define GL_ARM_mali_program_binary 1 + +#define GL_MALI_PROGRAM_BINARY_ARM 0x8F61 + +#define GLEW_ARM_mali_program_binary GLEW_GET_VAR(__GLEW_ARM_mali_program_binary) + +#endif /* GL_ARM_mali_program_binary */ + +/* ----------------------- GL_ARM_mali_shader_binary ----------------------- */ + +#ifndef GL_ARM_mali_shader_binary +#define GL_ARM_mali_shader_binary 1 + +#define GL_MALI_SHADER_BINARY_ARM 0x8F60 + +#define GLEW_ARM_mali_shader_binary GLEW_GET_VAR(__GLEW_ARM_mali_shader_binary) + +#endif /* GL_ARM_mali_shader_binary */ + +/* ------------------------------ GL_ARM_rgba8 ----------------------------- */ + +#ifndef GL_ARM_rgba8 +#define GL_ARM_rgba8 1 + +#define GL_RGBA8_OES 0x8058 + +#define GLEW_ARM_rgba8 GLEW_GET_VAR(__GLEW_ARM_rgba8) + +#endif /* GL_ARM_rgba8 */ + +/* -------------------- GL_ARM_shader_framebuffer_fetch -------------------- */ + +#ifndef GL_ARM_shader_framebuffer_fetch +#define GL_ARM_shader_framebuffer_fetch 1 + +#define GL_FETCH_PER_SAMPLE_ARM 0x8F65 +#define GL_FRAGMENT_SHADER_FRAMEBUFFER_FETCH_MRT_ARM 0x8F66 + +#define GLEW_ARM_shader_framebuffer_fetch GLEW_GET_VAR(__GLEW_ARM_shader_framebuffer_fetch) + +#endif /* GL_ARM_shader_framebuffer_fetch */ + +/* ------------- GL_ARM_shader_framebuffer_fetch_depth_stencil ------------- */ + +#ifndef GL_ARM_shader_framebuffer_fetch_depth_stencil +#define GL_ARM_shader_framebuffer_fetch_depth_stencil 1 + +#define GLEW_ARM_shader_framebuffer_fetch_depth_stencil GLEW_GET_VAR(__GLEW_ARM_shader_framebuffer_fetch_depth_stencil) + +#endif /* GL_ARM_shader_framebuffer_fetch_depth_stencil */ + /* ------------------------- GL_ATIX_point_sprites ------------------------- */ #ifndef GL_ATIX_point_sprites @@ -4243,7 +8582,7 @@ typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum* bu typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); -typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERATIPROC) (GLenum type, const void* pointer); +typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERATIPROC) (GLenum type, const void *pointer); #define glDrawElementArrayATI GLEW_GET_FUN(__glewDrawElementArrayATI) #define glDrawRangeElementArrayATI GLEW_GET_FUN(__glewDrawRangeElementArrayATI) @@ -4286,13 +8625,13 @@ typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint #ifndef GL_ATI_fragment_shader #define GL_ATI_fragment_shader 1 -#define GL_RED_BIT_ATI 0x00000001 #define GL_2X_BIT_ATI 0x00000001 +#define GL_RED_BIT_ATI 0x00000001 #define GL_4X_BIT_ATI 0x00000002 -#define GL_GREEN_BIT_ATI 0x00000002 #define GL_COMP_BIT_ATI 0x00000002 -#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_GREEN_BIT_ATI 0x00000002 #define GL_8X_BIT_ATI 0x00000004 +#define GL_BLUE_BIT_ATI 0x00000004 #define GL_NEGATE_BIT_ATI 0x00000004 #define GL_BIAS_BIT_ATI 0x00000008 #define GL_HALF_BIT_ATI 0x00000008 @@ -4380,7 +8719,7 @@ typedef void (GLAPIENTRY * PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, c #ifndef GL_ATI_map_object_buffer #define GL_ATI_map_object_buffer 1 -typedef void* (GLAPIENTRY * PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void * (GLAPIENTRY * PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); typedef void (GLAPIENTRY * PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); #define glMapObjectBufferATI GLEW_GET_FUN(__glewMapObjectBufferATI) @@ -4390,6 +8729,19 @@ typedef void (GLAPIENTRY * PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); #endif /* GL_ATI_map_object_buffer */ +/* ----------------------------- GL_ATI_meminfo ---------------------------- */ + +#ifndef GL_ATI_meminfo +#define GL_ATI_meminfo 1 + +#define GL_VBO_FREE_MEMORY_ATI 0x87FB +#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC +#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD + +#define GLEW_ATI_meminfo GLEW_GET_VAR(__GLEW_ATI_meminfo) + +#endif /* GL_ATI_meminfo */ + /* -------------------------- GL_ATI_pn_triangles -------------------------- */ #ifndef GL_ATI_pn_triangles @@ -4408,8 +8760,8 @@ typedef void (GLAPIENTRY * PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); typedef void (GLAPIENTRY * PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); -#define glPNTrianglesfATI GLEW_GET_FUN(__glPNTrianglewesfATI) -#define glPNTrianglesiATI GLEW_GET_FUN(__glPNTrianglewesiATI) +#define glPNTrianglesfATI GLEW_GET_FUN(__glewPNTrianglesfATI) +#define glPNTrianglesiATI GLEW_GET_FUN(__glewPNTrianglesiATI) #define GLEW_ATI_pn_triangles GLEW_GET_VAR(__GLEW_ATI_pn_triangles) @@ -4536,8 +8888,8 @@ typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); -typedef GLuint (GLAPIENTRY * PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const void* pointer, GLenum usage); -typedef void (GLAPIENTRY * PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const void* pointer, GLenum preserve); +typedef GLuint (GLAPIENTRY * PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const void *pointer, GLenum usage); +typedef void (GLAPIENTRY * PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const void *pointer, GLenum preserve); typedef void (GLAPIENTRY * PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); #define glArrayObjectATI GLEW_GET_FUN(__glewArrayObjectATI) @@ -4592,41 +8944,49 @@ typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, G typedef void (GLAPIENTRY * PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte x, GLbyte y, GLbyte z); -typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); -typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *v); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); -typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); #define glClientActiveVertexStreamATI GLEW_GET_FUN(__glewClientActiveVertexStreamATI) #define glNormalStream3bATI GLEW_GET_FUN(__glewNormalStream3bATI) @@ -4641,6 +9001,14 @@ typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GL #define glNormalStream3svATI GLEW_GET_FUN(__glewNormalStream3svATI) #define glVertexBlendEnvfATI GLEW_GET_FUN(__glewVertexBlendEnvfATI) #define glVertexBlendEnviATI GLEW_GET_FUN(__glewVertexBlendEnviATI) +#define glVertexStream1dATI GLEW_GET_FUN(__glewVertexStream1dATI) +#define glVertexStream1dvATI GLEW_GET_FUN(__glewVertexStream1dvATI) +#define glVertexStream1fATI GLEW_GET_FUN(__glewVertexStream1fATI) +#define glVertexStream1fvATI GLEW_GET_FUN(__glewVertexStream1fvATI) +#define glVertexStream1iATI GLEW_GET_FUN(__glewVertexStream1iATI) +#define glVertexStream1ivATI GLEW_GET_FUN(__glewVertexStream1ivATI) +#define glVertexStream1sATI GLEW_GET_FUN(__glewVertexStream1sATI) +#define glVertexStream1svATI GLEW_GET_FUN(__glewVertexStream1svATI) #define glVertexStream2dATI GLEW_GET_FUN(__glewVertexStream2dATI) #define glVertexStream2dvATI GLEW_GET_FUN(__glewVertexStream2dvATI) #define glVertexStream2fATI GLEW_GET_FUN(__glewVertexStream2fATI) @@ -4670,6 +9038,27 @@ typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GL #endif /* GL_ATI_vertex_streams */ +/* -------------------- GL_EGL_KHR_context_flush_control ------------------- */ + +#ifndef GL_EGL_KHR_context_flush_control +#define GL_EGL_KHR_context_flush_control 1 + +#define GLEW_EGL_KHR_context_flush_control GLEW_GET_VAR(__GLEW_EGL_KHR_context_flush_control) + +#endif /* GL_EGL_KHR_context_flush_control */ + +/* ---------------- GL_EGL_NV_robustness_video_memory_purge ---------------- */ + +#ifndef GL_EGL_NV_robustness_video_memory_purge +#define GL_EGL_NV_robustness_video_memory_purge 1 + +#define GL_EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x334C +#define GL_PURGED_CONTEXT_RESET_NV 0x92BB + +#define GLEW_EGL_NV_robustness_video_memory_purge GLEW_GET_VAR(__GLEW_EGL_NV_robustness_video_memory_purge) + +#endif /* GL_EGL_NV_robustness_video_memory_purge */ + /* --------------------------- GL_EXT_422_pixels --------------------------- */ #ifndef GL_EXT_422_pixels @@ -4696,6 +9085,26 @@ typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GL #endif /* GL_EXT_Cg_shader */ +/* ------------------------- GL_EXT_EGL_image_array ------------------------ */ + +#ifndef GL_EXT_EGL_image_array +#define GL_EXT_EGL_image_array 1 + +#define GLEW_EXT_EGL_image_array GLEW_GET_VAR(__GLEW_EXT_EGL_image_array) + +#endif /* GL_EXT_EGL_image_array */ + +/* --------------------------- GL_EXT_YUV_target --------------------------- */ + +#ifndef GL_EXT_YUV_target +#define GL_EXT_YUV_target 1 + +#define GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT 0x8BE7 + +#define GLEW_EXT_YUV_target GLEW_GET_VAR(__GLEW_EXT_YUV_target) + +#endif /* GL_EXT_YUV_target */ + /* ------------------------------ GL_EXT_abgr ------------------------------ */ #ifndef GL_EXT_abgr @@ -4707,6 +9116,23 @@ typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GL #endif /* GL_EXT_abgr */ +/* -------------------------- GL_EXT_base_instance ------------------------- */ + +#ifndef GL_EXT_base_instance +#define GL_EXT_base_instance 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEEXTPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); + +#define glDrawArraysInstancedBaseInstanceEXT GLEW_GET_FUN(__glewDrawArraysInstancedBaseInstanceEXT) +#define glDrawElementsInstancedBaseInstanceEXT GLEW_GET_FUN(__glewDrawElementsInstancedBaseInstanceEXT) +#define glDrawElementsInstancedBaseVertexBaseInstanceEXT GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexBaseInstanceEXT) + +#define GLEW_EXT_base_instance GLEW_GET_VAR(__GLEW_EXT_base_instance) + +#endif /* GL_EXT_base_instance */ + /* ------------------------------ GL_EXT_bgra ------------------------------ */ #ifndef GL_EXT_bgra @@ -4778,6 +9204,31 @@ typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, G #endif /* GL_EXT_blend_equation_separate */ +/* ----------------------- GL_EXT_blend_func_extended ---------------------- */ + +#ifndef GL_EXT_blend_func_extended +#define GL_EXT_blend_func_extended 1 + +#define GL_SRC_ALPHA_SATURATE_EXT 0x0308 +#define GL_SRC1_ALPHA_EXT 0x8589 +#define GL_SRC1_COLOR_EXT 0x88F9 +#define GL_ONE_MINUS_SRC1_COLOR_EXT 0x88FA +#define GL_ONE_MINUS_SRC1_ALPHA_EXT 0x88FB +#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS_EXT 0x88FC +#define GL_LOCATION_INDEX_EXT 0x930F + +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONINDEXEDEXTPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar * name); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATAINDEXEXTPROC) (GLuint program, const GLchar * name); +typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONINDEXEXTPROC) (GLuint program, GLenum programInterface, const GLchar* name); + +#define glBindFragDataLocationIndexedEXT GLEW_GET_FUN(__glewBindFragDataLocationIndexedEXT) +#define glGetFragDataIndexEXT GLEW_GET_FUN(__glewGetFragDataIndexEXT) +#define glGetProgramResourceLocationIndexEXT GLEW_GET_FUN(__glewGetProgramResourceLocationIndexEXT) + +#define GLEW_EXT_blend_func_extended GLEW_GET_VAR(__GLEW_EXT_blend_func_extended) + +#endif /* GL_EXT_blend_func_extended */ + /* ----------------------- GL_EXT_blend_func_separate ---------------------- */ #ifndef GL_EXT_blend_func_separate @@ -4835,6 +9286,67 @@ typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); #endif /* GL_EXT_blend_subtract */ +/* ------------------------- GL_EXT_buffer_storage ------------------------- */ + +#ifndef GL_EXT_buffer_storage +#define GL_EXT_buffer_storage 1 + +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_PERSISTENT_BIT_EXT 0x0040 +#define GL_MAP_COHERENT_BIT_EXT 0x0080 +#define GL_DYNAMIC_STORAGE_BIT_EXT 0x0100 +#define GL_CLIENT_STORAGE_BIT_EXT 0x0200 +#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT_EXT 0x00004000 +#define GL_BUFFER_IMMUTABLE_STORAGE_EXT 0x821F +#define GL_BUFFER_STORAGE_FLAGS_EXT 0x8220 + +typedef void (GLAPIENTRY * PFNGLBUFFERSTORAGEEXTPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); + +#define glBufferStorageEXT GLEW_GET_FUN(__glewBufferStorageEXT) +#define glNamedBufferStorageEXT GLEW_GET_FUN(__glewNamedBufferStorageEXT) + +#define GLEW_EXT_buffer_storage GLEW_GET_VAR(__GLEW_EXT_buffer_storage) + +#endif /* GL_EXT_buffer_storage */ + +/* -------------------------- GL_EXT_clear_texture ------------------------- */ + +#ifndef GL_EXT_clear_texture +#define GL_EXT_clear_texture 1 + +typedef void (GLAPIENTRY * PFNGLCLEARTEXIMAGEEXTPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARTEXSUBIMAGEEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); + +#define glClearTexImageEXT GLEW_GET_FUN(__glewClearTexImageEXT) +#define glClearTexSubImageEXT GLEW_GET_FUN(__glewClearTexSubImageEXT) + +#define GLEW_EXT_clear_texture GLEW_GET_VAR(__GLEW_EXT_clear_texture) + +#endif /* GL_EXT_clear_texture */ + +/* ----------------------- GL_EXT_clip_cull_distance ----------------------- */ + +#ifndef GL_EXT_clip_cull_distance +#define GL_EXT_clip_cull_distance 1 + +#define GL_MAX_CLIP_DISTANCES_EXT 0x0D32 +#define GL_CLIP_DISTANCE0_EXT 0x3000 +#define GL_CLIP_DISTANCE1_EXT 0x3001 +#define GL_CLIP_DISTANCE2_EXT 0x3002 +#define GL_CLIP_DISTANCE3_EXT 0x3003 +#define GL_CLIP_DISTANCE4_EXT 0x3004 +#define GL_CLIP_DISTANCE5_EXT 0x3005 +#define GL_CLIP_DISTANCE6_EXT 0x3006 +#define GL_CLIP_DISTANCE7_EXT 0x3007 +#define GL_MAX_CULL_DISTANCES_EXT 0x82F9 +#define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES_EXT 0x82FA + +#define GLEW_EXT_clip_cull_distance GLEW_GET_VAR(__GLEW_EXT_clip_cull_distance) + +#endif /* GL_EXT_clip_cull_distance */ + /* ------------------------ GL_EXT_clip_volume_hint ------------------------ */ #ifndef GL_EXT_clip_volume_hint @@ -4860,12 +9372,37 @@ typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); #endif /* GL_EXT_cmyka */ +/* ----------------------- GL_EXT_color_buffer_float ----------------------- */ + +#ifndef GL_EXT_color_buffer_float +#define GL_EXT_color_buffer_float 1 + +#define GLEW_EXT_color_buffer_float GLEW_GET_VAR(__GLEW_EXT_color_buffer_float) + +#endif /* GL_EXT_color_buffer_float */ + +/* --------------------- GL_EXT_color_buffer_half_float -------------------- */ + +#ifndef GL_EXT_color_buffer_half_float +#define GL_EXT_color_buffer_half_float 1 + +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT 0x8211 +#define GL_R16F_EXT 0x822D +#define GL_RG16F_EXT 0x822F +#define GL_RGBA16F_EXT 0x881A +#define GL_RGB16F_EXT 0x881B +#define GL_UNSIGNED_NORMALIZED_EXT 0x8C17 + +#define GLEW_EXT_color_buffer_half_float GLEW_GET_VAR(__GLEW_EXT_color_buffer_half_float) + +#endif /* GL_EXT_color_buffer_half_float */ + /* ------------------------- GL_EXT_color_subtable ------------------------- */ #ifndef GL_EXT_color_subtable #define GL_EXT_color_subtable 1 -typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void* data); +typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); #define glColorSubTableEXT GLEW_GET_FUN(__glewColorSubTableEXT) @@ -4893,6 +9430,24 @@ typedef void (GLAPIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); #endif /* GL_EXT_compiled_vertex_array */ +/* ---------------- GL_EXT_compressed_ETC1_RGB8_sub_texture ---------------- */ + +#ifndef GL_EXT_compressed_ETC1_RGB8_sub_texture +#define GL_EXT_compressed_ETC1_RGB8_sub_texture 1 + +#define GLEW_EXT_compressed_ETC1_RGB8_sub_texture GLEW_GET_VAR(__GLEW_EXT_compressed_ETC1_RGB8_sub_texture) + +#endif /* GL_EXT_compressed_ETC1_RGB8_sub_texture */ + +/* ----------------------- GL_EXT_conservative_depth ----------------------- */ + +#ifndef GL_EXT_conservative_depth +#define GL_EXT_conservative_depth 1 + +#define GLEW_EXT_conservative_depth GLEW_GET_VAR(__GLEW_EXT_conservative_depth) + +#endif /* GL_EXT_conservative_depth */ + /* --------------------------- GL_EXT_convolution -------------------------- */ #ifndef GL_EXT_convolution @@ -4919,19 +9474,19 @@ typedef void (GLAPIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); #define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 #define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* image); -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void* image); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *image); typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void* row, void* column, void* span); -typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* row, const void* column); +typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); +typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); #define glConvolutionFilter1DEXT GLEW_GET_FUN(__glewConvolutionFilter1DEXT) #define glConvolutionFilter2DEXT GLEW_GET_FUN(__glewConvolutionFilter2DEXT) @@ -4971,8 +9526,8 @@ typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum #define GL_MAP1_BINORMAL_EXT 0x8446 #define GL_MAP2_BINORMAL_EXT 0x8447 -typedef void (GLAPIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, void* pointer); -typedef void (GLAPIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, void* pointer); +typedef void (GLAPIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, void *pointer); +typedef void (GLAPIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, void *pointer); #define glBinormalPointerEXT GLEW_GET_FUN(__glewBinormalPointerEXT) #define glTangentPointerEXT GLEW_GET_FUN(__glewTangentPointerEXT) @@ -4981,6 +9536,19 @@ typedef void (GLAPIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei str #endif /* GL_EXT_coordinate_frame */ +/* --------------------------- GL_EXT_copy_image --------------------------- */ + +#ifndef GL_EXT_copy_image +#define GL_EXT_copy_image 1 + +typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATAEXTPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); + +#define glCopyImageSubDataEXT GLEW_GET_FUN(__glewCopyImageSubDataEXT) + +#define GLEW_EXT_copy_image GLEW_GET_VAR(__GLEW_EXT_copy_image) + +#endif /* GL_EXT_copy_image */ + /* -------------------------- GL_EXT_copy_texture -------------------------- */ #ifndef GL_EXT_copy_texture @@ -5007,6 +9575,10 @@ typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint #ifndef GL_EXT_cull_vertex #define GL_EXT_cull_vertex 1 +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC + typedef void (GLAPIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble* params); typedef void (GLAPIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat* params); @@ -5017,6 +9589,45 @@ typedef void (GLAPIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat* #endif /* GL_EXT_cull_vertex */ +/* --------------------------- GL_EXT_debug_label -------------------------- */ + +#ifndef GL_EXT_debug_label +#define GL_EXT_debug_label 1 + +#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F +#define GL_PROGRAM_OBJECT_EXT 0x8B40 +#define GL_SHADER_OBJECT_EXT 0x8B48 +#define GL_BUFFER_OBJECT_EXT 0x9151 +#define GL_QUERY_OBJECT_EXT 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 + +typedef void (GLAPIENTRY * PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei* length, GLchar *label); +typedef void (GLAPIENTRY * PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar* label); + +#define glGetObjectLabelEXT GLEW_GET_FUN(__glewGetObjectLabelEXT) +#define glLabelObjectEXT GLEW_GET_FUN(__glewLabelObjectEXT) + +#define GLEW_EXT_debug_label GLEW_GET_VAR(__GLEW_EXT_debug_label) + +#endif /* GL_EXT_debug_label */ + +/* -------------------------- GL_EXT_debug_marker -------------------------- */ + +#ifndef GL_EXT_debug_marker +#define GL_EXT_debug_marker 1 + +typedef void (GLAPIENTRY * PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar* marker); +typedef void (GLAPIENTRY * PFNGLPOPGROUPMARKEREXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar* marker); + +#define glInsertEventMarkerEXT GLEW_GET_FUN(__glewInsertEventMarkerEXT) +#define glPopGroupMarkerEXT GLEW_GET_FUN(__glewPopGroupMarkerEXT) +#define glPushGroupMarkerEXT GLEW_GET_FUN(__glewPushGroupMarkerEXT) + +#define GLEW_EXT_debug_marker GLEW_GET_VAR(__GLEW_EXT_debug_marker) + +#endif /* GL_EXT_debug_marker */ + /* ------------------------ GL_EXT_depth_bounds_test ----------------------- */ #ifndef GL_EXT_depth_bounds_test @@ -5045,18 +9656,18 @@ typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zma typedef void (GLAPIENTRY * PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); typedef GLenum (GLAPIENTRY * PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); typedef void (GLAPIENTRY * PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); @@ -5068,23 +9679,32 @@ typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, G typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum* bufs); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); typedef void (GLAPIENTRY * PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); typedef void (GLAPIENTRY * PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); -typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, void* img); -typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, void* img); -typedef void (GLAPIENTRY * PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum pname, GLuint index, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum pname, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, void *img); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, void *img); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* param); typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void* pixels); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); @@ -5093,24 +9713,30 @@ typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void** params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void* data); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, void* string); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, void *string); typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum pname, GLuint index, GLvoid** params); -typedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void* pixels); +typedef void (GLAPIENTRY * PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, void** params); +typedef void (GLAPIENTRY * PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, void** params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint* params); typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); -typedef GLvoid * (GLAPIENTRY * PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERVEXTPROC) (GLuint vaobj, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, void** param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, void** param); +typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); +typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); typedef void (GLAPIENTRY * PFNGLMATRIXFRUSTUMEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); typedef void (GLAPIENTRY * PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum matrixMode); typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); @@ -5131,7 +9757,7 @@ typedef void (GLAPIENTRY * PFNGLMATRIXSCALEFEXTPROC) (GLenum matrixMode, GLfloat typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void* pointer); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void *pointer); typedef void (GLAPIENTRY * PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); @@ -5142,9 +9768,9 @@ typedef void (GLAPIENTRY * PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coo typedef void (GLAPIENTRY * PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint* params); typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); @@ -5152,11 +9778,12 @@ typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLe typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* param); typedef void (GLAPIENTRY * PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); -typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const void* data, GLenum usage); -typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void* data); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +typedef void (GLAPIENTRY * PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); @@ -5175,7 +9802,7 @@ typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint* params); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint* params); -typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const void* string); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const void *string); typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); @@ -5214,9 +9841,9 @@ typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint progra typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); -typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint* params); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); @@ -5224,10 +9851,22 @@ typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLen typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* param); typedef void (GLAPIENTRY * PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); -typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYINDEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYNORMALOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC) (GLuint vaobj, GLuint index, GLuint divisor); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); #define glBindMultiTextureEXT GLEW_GET_FUN(__glewBindMultiTextureEXT) #define glCheckNamedFramebufferStatusEXT GLEW_GET_FUN(__glewCheckNamedFramebufferStatusEXT) @@ -5255,7 +9894,14 @@ typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); #define glCopyTextureSubImage2DEXT GLEW_GET_FUN(__glewCopyTextureSubImage2DEXT) #define glCopyTextureSubImage3DEXT GLEW_GET_FUN(__glewCopyTextureSubImage3DEXT) #define glDisableClientStateIndexedEXT GLEW_GET_FUN(__glewDisableClientStateIndexedEXT) +#define glDisableClientStateiEXT GLEW_GET_FUN(__glewDisableClientStateiEXT) +#define glDisableVertexArrayAttribEXT GLEW_GET_FUN(__glewDisableVertexArrayAttribEXT) +#define glDisableVertexArrayEXT GLEW_GET_FUN(__glewDisableVertexArrayEXT) #define glEnableClientStateIndexedEXT GLEW_GET_FUN(__glewEnableClientStateIndexedEXT) +#define glEnableClientStateiEXT GLEW_GET_FUN(__glewEnableClientStateiEXT) +#define glEnableVertexArrayAttribEXT GLEW_GET_FUN(__glewEnableVertexArrayAttribEXT) +#define glEnableVertexArrayEXT GLEW_GET_FUN(__glewEnableVertexArrayEXT) +#define glFlushMappedNamedBufferRangeEXT GLEW_GET_FUN(__glewFlushMappedNamedBufferRangeEXT) #define glFramebufferDrawBufferEXT GLEW_GET_FUN(__glewFramebufferDrawBufferEXT) #define glFramebufferDrawBuffersEXT GLEW_GET_FUN(__glewFramebufferDrawBuffersEXT) #define glFramebufferReadBufferEXT GLEW_GET_FUN(__glewFramebufferReadBufferEXT) @@ -5264,7 +9910,9 @@ typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); #define glGetCompressedMultiTexImageEXT GLEW_GET_FUN(__glewGetCompressedMultiTexImageEXT) #define glGetCompressedTextureImageEXT GLEW_GET_FUN(__glewGetCompressedTextureImageEXT) #define glGetDoubleIndexedvEXT GLEW_GET_FUN(__glewGetDoubleIndexedvEXT) +#define glGetDoublei_vEXT GLEW_GET_FUN(__glewGetDoublei_vEXT) #define glGetFloatIndexedvEXT GLEW_GET_FUN(__glewGetFloatIndexedvEXT) +#define glGetFloati_vEXT GLEW_GET_FUN(__glewGetFloati_vEXT) #define glGetFramebufferParameterivEXT GLEW_GET_FUN(__glewGetFramebufferParameterivEXT) #define glGetMultiTexEnvfvEXT GLEW_GET_FUN(__glewGetMultiTexEnvfvEXT) #define glGetMultiTexEnvivEXT GLEW_GET_FUN(__glewGetMultiTexEnvivEXT) @@ -5290,6 +9938,7 @@ typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); #define glGetNamedProgramivEXT GLEW_GET_FUN(__glewGetNamedProgramivEXT) #define glGetNamedRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetNamedRenderbufferParameterivEXT) #define glGetPointerIndexedvEXT GLEW_GET_FUN(__glewGetPointerIndexedvEXT) +#define glGetPointeri_vEXT GLEW_GET_FUN(__glewGetPointeri_vEXT) #define glGetTextureImageEXT GLEW_GET_FUN(__glewGetTextureImageEXT) #define glGetTextureLevelParameterfvEXT GLEW_GET_FUN(__glewGetTextureLevelParameterfvEXT) #define glGetTextureLevelParameterivEXT GLEW_GET_FUN(__glewGetTextureLevelParameterivEXT) @@ -5297,7 +9946,12 @@ typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); #define glGetTextureParameterIuivEXT GLEW_GET_FUN(__glewGetTextureParameterIuivEXT) #define glGetTextureParameterfvEXT GLEW_GET_FUN(__glewGetTextureParameterfvEXT) #define glGetTextureParameterivEXT GLEW_GET_FUN(__glewGetTextureParameterivEXT) +#define glGetVertexArrayIntegeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayIntegeri_vEXT) +#define glGetVertexArrayIntegervEXT GLEW_GET_FUN(__glewGetVertexArrayIntegervEXT) +#define glGetVertexArrayPointeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayPointeri_vEXT) +#define glGetVertexArrayPointervEXT GLEW_GET_FUN(__glewGetVertexArrayPointervEXT) #define glMapNamedBufferEXT GLEW_GET_FUN(__glewMapNamedBufferEXT) +#define glMapNamedBufferRangeEXT GLEW_GET_FUN(__glewMapNamedBufferRangeEXT) #define glMatrixFrustumEXT GLEW_GET_FUN(__glewMatrixFrustumEXT) #define glMatrixLoadIdentityEXT GLEW_GET_FUN(__glewMatrixLoadIdentityEXT) #define glMatrixLoadTransposedEXT GLEW_GET_FUN(__glewMatrixLoadTransposedEXT) @@ -5344,6 +9998,7 @@ typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); #define glMultiTexSubImage3DEXT GLEW_GET_FUN(__glewMultiTexSubImage3DEXT) #define glNamedBufferDataEXT GLEW_GET_FUN(__glewNamedBufferDataEXT) #define glNamedBufferSubDataEXT GLEW_GET_FUN(__glewNamedBufferSubDataEXT) +#define glNamedCopyBufferSubDataEXT GLEW_GET_FUN(__glewNamedCopyBufferSubDataEXT) #define glNamedFramebufferRenderbufferEXT GLEW_GET_FUN(__glewNamedFramebufferRenderbufferEXT) #define glNamedFramebufferTexture1DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture1DEXT) #define glNamedFramebufferTexture2DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture2DEXT) @@ -5415,11 +10070,88 @@ typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); #define glTextureSubImage2DEXT GLEW_GET_FUN(__glewTextureSubImage2DEXT) #define glTextureSubImage3DEXT GLEW_GET_FUN(__glewTextureSubImage3DEXT) #define glUnmapNamedBufferEXT GLEW_GET_FUN(__glewUnmapNamedBufferEXT) +#define glVertexArrayColorOffsetEXT GLEW_GET_FUN(__glewVertexArrayColorOffsetEXT) +#define glVertexArrayEdgeFlagOffsetEXT GLEW_GET_FUN(__glewVertexArrayEdgeFlagOffsetEXT) +#define glVertexArrayFogCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayFogCoordOffsetEXT) +#define glVertexArrayIndexOffsetEXT GLEW_GET_FUN(__glewVertexArrayIndexOffsetEXT) +#define glVertexArrayMultiTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayMultiTexCoordOffsetEXT) +#define glVertexArrayNormalOffsetEXT GLEW_GET_FUN(__glewVertexArrayNormalOffsetEXT) +#define glVertexArraySecondaryColorOffsetEXT GLEW_GET_FUN(__glewVertexArraySecondaryColorOffsetEXT) +#define glVertexArrayTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayTexCoordOffsetEXT) +#define glVertexArrayVertexAttribDivisorEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribDivisorEXT) +#define glVertexArrayVertexAttribIOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribIOffsetEXT) +#define glVertexArrayVertexAttribOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribOffsetEXT) +#define glVertexArrayVertexOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexOffsetEXT) #define GLEW_EXT_direct_state_access GLEW_GET_VAR(__GLEW_EXT_direct_state_access) #endif /* GL_EXT_direct_state_access */ +/* ----------------------- GL_EXT_discard_framebuffer ---------------------- */ + +#ifndef GL_EXT_discard_framebuffer +#define GL_EXT_discard_framebuffer 1 + +#define GL_COLOR_EXT 0x1800 +#define GL_DEPTH_EXT 0x1801 +#define GL_STENCIL_EXT 0x1802 + +typedef void (GLAPIENTRY * PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments); + +#define glDiscardFramebufferEXT GLEW_GET_FUN(__glewDiscardFramebufferEXT) + +#define GLEW_EXT_discard_framebuffer GLEW_GET_VAR(__GLEW_EXT_discard_framebuffer) + +#endif /* GL_EXT_discard_framebuffer */ + +/* -------------------------- GL_EXT_draw_buffers -------------------------- */ + +#ifndef GL_EXT_draw_buffers +#define GL_EXT_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_EXT 0x8824 +#define GL_DRAW_BUFFER0_EXT 0x8825 +#define GL_DRAW_BUFFER1_EXT 0x8826 +#define GL_DRAW_BUFFER2_EXT 0x8827 +#define GL_DRAW_BUFFER3_EXT 0x8828 +#define GL_DRAW_BUFFER4_EXT 0x8829 +#define GL_DRAW_BUFFER5_EXT 0x882A +#define GL_DRAW_BUFFER6_EXT 0x882B +#define GL_DRAW_BUFFER7_EXT 0x882C +#define GL_DRAW_BUFFER8_EXT 0x882D +#define GL_DRAW_BUFFER9_EXT 0x882E +#define GL_DRAW_BUFFER10_EXT 0x882F +#define GL_DRAW_BUFFER11_EXT 0x8830 +#define GL_DRAW_BUFFER12_EXT 0x8831 +#define GL_DRAW_BUFFER13_EXT 0x8832 +#define GL_DRAW_BUFFER14_EXT 0x8833 +#define GL_DRAW_BUFFER15_EXT 0x8834 +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSEXTPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersEXT GLEW_GET_FUN(__glewDrawBuffersEXT) + +#define GLEW_EXT_draw_buffers GLEW_GET_VAR(__GLEW_EXT_draw_buffers) + +#endif /* GL_EXT_draw_buffers */ + /* -------------------------- GL_EXT_draw_buffers2 ------------------------- */ #ifndef GL_EXT_draw_buffers2 @@ -5443,13 +10175,59 @@ typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GL #endif /* GL_EXT_draw_buffers2 */ +/* ---------------------- GL_EXT_draw_buffers_indexed ---------------------- */ + +#ifndef GL_EXT_draw_buffers_indexed +#define GL_EXT_draw_buffers_indexed 1 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIEXTPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIEXTPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIEXTPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCIEXTPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GLAPIENTRY * PFNGLCOLORMASKIEXTPROC) (GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (GLAPIENTRY * PFNGLDISABLEIEXTPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEIEXTPROC) (GLenum target, GLuint index); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDIEXTPROC) (GLenum target, GLuint index); + +#define glBlendEquationSeparateiEXT GLEW_GET_FUN(__glewBlendEquationSeparateiEXT) +#define glBlendEquationiEXT GLEW_GET_FUN(__glewBlendEquationiEXT) +#define glBlendFuncSeparateiEXT GLEW_GET_FUN(__glewBlendFuncSeparateiEXT) +#define glBlendFunciEXT GLEW_GET_FUN(__glewBlendFunciEXT) +#define glColorMaskiEXT GLEW_GET_FUN(__glewColorMaskiEXT) +#define glDisableiEXT GLEW_GET_FUN(__glewDisableiEXT) +#define glEnableiEXT GLEW_GET_FUN(__glewEnableiEXT) +#define glIsEnablediEXT GLEW_GET_FUN(__glewIsEnablediEXT) + +#define GLEW_EXT_draw_buffers_indexed GLEW_GET_VAR(__GLEW_EXT_draw_buffers_indexed) + +#endif /* GL_EXT_draw_buffers_indexed */ + +/* -------------------- GL_EXT_draw_elements_base_vertex ------------------- */ + +#ifndef GL_EXT_draw_elements_base_vertex +#define GL_EXT_draw_elements_base_vertex 1 + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSBASEVERTEXEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, const GLsizei* count, GLenum type, const void *const *indices, GLsizei primcount, const GLint *basevertex); + +#define glDrawElementsBaseVertexEXT GLEW_GET_FUN(__glewDrawElementsBaseVertexEXT) +#define glDrawElementsInstancedBaseVertexEXT GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexEXT) +#define glDrawRangeElementsBaseVertexEXT GLEW_GET_FUN(__glewDrawRangeElementsBaseVertexEXT) +#define glMultiDrawElementsBaseVertexEXT GLEW_GET_FUN(__glewMultiDrawElementsBaseVertexEXT) + +#define GLEW_EXT_draw_elements_base_vertex GLEW_GET_VAR(__GLEW_EXT_draw_elements_base_vertex) + +#endif /* GL_EXT_draw_elements_base_vertex */ + /* ------------------------- GL_EXT_draw_instanced ------------------------- */ #ifndef GL_EXT_draw_instanced #define GL_EXT_draw_instanced 1 typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); -typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); #define glDrawArraysInstancedEXT GLEW_GET_FUN(__glewDrawArraysInstancedEXT) #define glDrawElementsInstancedEXT GLEW_GET_FUN(__glewDrawElementsInstancedEXT) @@ -5463,10 +10241,10 @@ typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsi #ifndef GL_EXT_draw_range_elements #define GL_EXT_draw_range_elements 1 -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 -typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); #define glDrawRangeElementsEXT GLEW_GET_FUN(__glewDrawRangeElementsEXT) @@ -5474,6 +10252,32 @@ typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint s #endif /* GL_EXT_draw_range_elements */ +/* ------------------------- GL_EXT_external_buffer ------------------------ */ + +#ifndef GL_EXT_external_buffer +#define GL_EXT_external_buffer 1 + +typedef void* GLeglClientBufferEXT; + +typedef void (GLAPIENTRY * PFNGLBUFFERSTORAGEEXTERNALEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEEXTERNALEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); + +#define glBufferStorageExternalEXT GLEW_GET_FUN(__glewBufferStorageExternalEXT) +#define glNamedBufferStorageExternalEXT GLEW_GET_FUN(__glewNamedBufferStorageExternalEXT) + +#define GLEW_EXT_external_buffer GLEW_GET_VAR(__GLEW_EXT_external_buffer) + +#endif /* GL_EXT_external_buffer */ + +/* --------------------------- GL_EXT_float_blend -------------------------- */ + +#ifndef GL_EXT_float_blend +#define GL_EXT_float_blend 1 + +#define GLEW_EXT_float_blend GLEW_GET_VAR(__GLEW_EXT_float_blend) + +#endif /* GL_EXT_float_blend */ + /* ---------------------------- GL_EXT_fog_coord --------------------------- */ #ifndef GL_EXT_fog_coord @@ -5488,7 +10292,7 @@ typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint s #define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 #define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 -typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); typedef void (GLAPIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord); typedef void (GLAPIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); typedef void (GLAPIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord); @@ -5504,6 +10308,15 @@ typedef void (GLAPIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); #endif /* GL_EXT_fog_coord */ +/* --------------------------- GL_EXT_frag_depth --------------------------- */ + +#ifndef GL_EXT_frag_depth +#define GL_EXT_frag_depth 1 + +#define GLEW_EXT_frag_depth GLEW_GET_VAR(__GLEW_EXT_frag_depth) + +#endif /* GL_EXT_frag_depth */ + /* ------------------------ GL_EXT_fragment_lighting ----------------------- */ #ifndef GL_EXT_fragment_lighting @@ -5601,6 +10414,18 @@ typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum t #endif /* GL_EXT_framebuffer_multisample */ +/* --------------- GL_EXT_framebuffer_multisample_blit_scaled -------------- */ + +#ifndef GL_EXT_framebuffer_multisample_blit_scaled +#define GL_EXT_framebuffer_multisample_blit_scaled 1 + +#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA +#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB + +#define GLEW_EXT_framebuffer_multisample_blit_scaled GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample_blit_scaled) + +#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ + /* ----------------------- GL_EXT_framebuffer_object ----------------------- */ #ifndef GL_EXT_framebuffer_object @@ -5710,6 +10535,92 @@ typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLen #endif /* GL_EXT_framebuffer_sRGB */ +/* ----------------------- GL_EXT_geometry_point_size ---------------------- */ + +#ifndef GL_EXT_geometry_point_size +#define GL_EXT_geometry_point_size 1 + +#define GL_GEOMETRY_SHADER_BIT_EXT 0x00000004 +#define GL_LINES_ADJACENCY_EXT 0xA +#define GL_LINE_STRIP_ADJACENCY_EXT 0xB +#define GL_TRIANGLES_ADJACENCY_EXT 0xC +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD +#define GL_LAYER_PROVOKING_VERTEX_EXT 0x825E +#define GL_UNDEFINED_VERTEX_EXT 0x8260 +#define GL_GEOMETRY_SHADER_INVOCATIONS_EXT 0x887F +#define GL_GEOMETRY_LINKED_VERTICES_OUT_EXT 0x8916 +#define GL_GEOMETRY_LINKED_INPUT_TYPE_EXT 0x8917 +#define GL_GEOMETRY_LINKED_OUTPUT_TYPE_EXT 0x8918 +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT 0x8A2C +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8A32 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 +#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS_EXT 0x8E5A +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS_EXT 0x90CD +#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_EXT 0x90D7 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS_EXT 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_EXT 0x9124 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_EXT 0x92CF +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS_EXT 0x92D5 +#define GL_REFERENCED_BY_GEOMETRY_SHADER_EXT 0x9309 +#define GL_FRAMEBUFFER_DEFAULT_LAYERS_EXT 0x9312 +#define GL_MAX_FRAMEBUFFER_LAYERS_EXT 0x9317 + +#define GLEW_EXT_geometry_point_size GLEW_GET_VAR(__GLEW_EXT_geometry_point_size) + +#endif /* GL_EXT_geometry_point_size */ + +/* ------------------------- GL_EXT_geometry_shader ------------------------ */ + +#ifndef GL_EXT_geometry_shader +#define GL_EXT_geometry_shader 1 + +#define GL_GEOMETRY_SHADER_BIT_EXT 0x00000004 +#define GL_LINES_ADJACENCY_EXT 0xA +#define GL_LINE_STRIP_ADJACENCY_EXT 0xB +#define GL_TRIANGLES_ADJACENCY_EXT 0xC +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD +#define GL_LAYER_PROVOKING_VERTEX_EXT 0x825E +#define GL_UNDEFINED_VERTEX_EXT 0x8260 +#define GL_GEOMETRY_SHADER_INVOCATIONS_EXT 0x887F +#define GL_GEOMETRY_LINKED_VERTICES_OUT_EXT 0x8916 +#define GL_GEOMETRY_LINKED_INPUT_TYPE_EXT 0x8917 +#define GL_GEOMETRY_LINKED_OUTPUT_TYPE_EXT 0x8918 +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT 0x8A2C +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8A32 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 +#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS_EXT 0x8E5A +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS_EXT 0x90CD +#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_EXT 0x90D7 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS_EXT 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_EXT 0x9124 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_EXT 0x92CF +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS_EXT 0x92D5 +#define GL_REFERENCED_BY_GEOMETRY_SHADER_EXT 0x9309 +#define GL_FRAMEBUFFER_DEFAULT_LAYERS_EXT 0x9312 +#define GL_MAX_FRAMEBUFFER_LAYERS_EXT 0x9317 + +#define GLEW_EXT_geometry_shader GLEW_GET_VAR(__GLEW_EXT_geometry_shader) + +#endif /* GL_EXT_geometry_shader */ + /* ------------------------ GL_EXT_geometry_shader4 ------------------------ */ #ifndef GL_EXT_geometry_shader4 @@ -5738,12 +10649,10 @@ typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLen typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); #define glFramebufferTextureEXT GLEW_GET_FUN(__glewFramebufferTextureEXT) #define glFramebufferTextureFaceEXT GLEW_GET_FUN(__glewFramebufferTextureFaceEXT) -#define glFramebufferTextureLayerEXT GLEW_GET_FUN(__glewFramebufferTextureLayerEXT) #define glProgramParameteriEXT GLEW_GET_FUN(__glewProgramParameteriEXT) #define GLEW_EXT_geometry_shader4 GLEW_GET_VAR(__GLEW_EXT_geometry_shader4) @@ -5830,7 +10739,7 @@ typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const G typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); #define glBindFragDataLocationEXT GLEW_GET_FUN(__glewBindFragDataLocationEXT) #define glGetFragDataLocationEXT GLEW_GET_FUN(__glewGetFragDataLocationEXT) @@ -5871,6 +10780,15 @@ typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLin #endif /* GL_EXT_gpu_shader4 */ +/* --------------------------- GL_EXT_gpu_shader5 -------------------------- */ + +#ifndef GL_EXT_gpu_shader5 +#define GL_EXT_gpu_shader5 1 + +#define GLEW_EXT_gpu_shader5 GLEW_GET_VAR(__GLEW_EXT_gpu_shader5) + +#endif /* GL_EXT_gpu_shader5 */ + /* ---------------------------- GL_EXT_histogram --------------------------- */ #ifndef GL_EXT_histogram @@ -5890,10 +10808,10 @@ typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLin #define GL_MINMAX_FORMAT_EXT 0x802F #define GL_MINMAX_SINK_EXT 0x8030 -typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void* values); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void* values); +typedef void (GLAPIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); @@ -5960,6 +10878,21 @@ typedef void (GLAPIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode) #endif /* GL_EXT_index_texture */ +/* ------------------------ GL_EXT_instanced_arrays ------------------------ */ + +#ifndef GL_EXT_instanced_arrays +#define GL_EXT_instanced_arrays 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_EXT 0x88FE + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISOREXTPROC) (GLuint index, GLuint divisor); + +#define glVertexAttribDivisorEXT GLEW_GET_FUN(__glewVertexAttribDivisorEXT) + +#define GLEW_EXT_instanced_arrays GLEW_GET_VAR(__GLEW_EXT_instanced_arrays) + +#endif /* GL_EXT_instanced_arrays */ + /* -------------------------- GL_EXT_light_texture ------------------------- */ #ifndef GL_EXT_light_texture @@ -5974,7 +10907,6 @@ typedef void (GLAPIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode) #define GL_TEXTURE_LIGHT_EXT 0x8350 #define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 #define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 -#define GL_FRAGMENT_DEPTH_EXT 0x8452 typedef void (GLAPIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); typedef void (GLAPIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); @@ -5988,6 +10920,138 @@ typedef void (GLAPIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mod #endif /* GL_EXT_light_texture */ +/* ------------------------ GL_EXT_map_buffer_range ------------------------ */ + +#ifndef GL_EXT_map_buffer_range +#define GL_EXT_map_buffer_range 1 + +#define GL_MAP_READ_BIT_EXT 0x0001 +#define GL_MAP_WRITE_BIT_EXT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT_EXT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT_EXT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT_EXT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT_EXT 0x0020 + +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +typedef void * (GLAPIENTRY * PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); + +#define glFlushMappedBufferRangeEXT GLEW_GET_FUN(__glewFlushMappedBufferRangeEXT) +#define glMapBufferRangeEXT GLEW_GET_FUN(__glewMapBufferRangeEXT) + +#define GLEW_EXT_map_buffer_range GLEW_GET_VAR(__GLEW_EXT_map_buffer_range) + +#endif /* GL_EXT_map_buffer_range */ + +/* -------------------------- GL_EXT_memory_object ------------------------- */ + +#ifndef GL_EXT_memory_object +#define GL_EXT_memory_object 1 + +#define GL_UUID_SIZE_EXT 16 +#define GL_TEXTURE_TILING_EXT 0x9580 +#define GL_DEDICATED_MEMORY_OBJECT_EXT 0x9581 +#define GL_NUM_TILING_TYPES_EXT 0x9582 +#define GL_TILING_TYPES_EXT 0x9583 +#define GL_OPTIMAL_TILING_EXT 0x9584 +#define GL_LINEAR_TILING_EXT 0x9585 +#define GL_LAYOUT_GENERAL_EXT 0x958D +#define GL_LAYOUT_COLOR_ATTACHMENT_EXT 0x958E +#define GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT 0x958F +#define GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT 0x9590 +#define GL_LAYOUT_SHADER_READ_ONLY_EXT 0x9591 +#define GL_LAYOUT_TRANSFER_SRC_EXT 0x9592 +#define GL_LAYOUT_TRANSFER_DST_EXT 0x9593 +#define GL_NUM_DEVICE_UUIDS_EXT 0x9596 +#define GL_DEVICE_UUID_EXT 0x9597 +#define GL_DRIVER_UUID_EXT 0x9598 +#define GL_PROTECTED_MEMORY_OBJECT_EXT 0x959B + +typedef void (GLAPIENTRY * PFNGLBUFFERSTORAGEMEMEXTPROC) (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLCREATEMEMORYOBJECTSEXTPROC) (GLsizei n, GLuint* memoryObjects); +typedef void (GLAPIENTRY * PFNGLDELETEMEMORYOBJECTSEXTPROC) (GLsizei n, const GLuint* memoryObjects); +typedef void (GLAPIENTRY * PFNGLGETMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETUNSIGNEDBYTEI_VEXTPROC) (GLenum target, GLuint index, GLubyte* data); +typedef void (GLAPIENTRY * PFNGLGETUNSIGNEDBYTEVEXTPROC) (GLenum pname, GLubyte* data); +typedef GLboolean (GLAPIENTRY * PFNGLISMEMORYOBJECTEXTPROC) (GLuint memoryObject); +typedef void (GLAPIENTRY * PFNGLMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEMEMEXTPROC) (GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGEMEM1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGEMEM2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGEMEM2DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGEMEM3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGEMEM3DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGEMEM1DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGEMEM2DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGEMEM2DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGEMEM3DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGEMEM3DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); + +#define glBufferStorageMemEXT GLEW_GET_FUN(__glewBufferStorageMemEXT) +#define glCreateMemoryObjectsEXT GLEW_GET_FUN(__glewCreateMemoryObjectsEXT) +#define glDeleteMemoryObjectsEXT GLEW_GET_FUN(__glewDeleteMemoryObjectsEXT) +#define glGetMemoryObjectParameterivEXT GLEW_GET_FUN(__glewGetMemoryObjectParameterivEXT) +#define glGetUnsignedBytei_vEXT GLEW_GET_FUN(__glewGetUnsignedBytei_vEXT) +#define glGetUnsignedBytevEXT GLEW_GET_FUN(__glewGetUnsignedBytevEXT) +#define glIsMemoryObjectEXT GLEW_GET_FUN(__glewIsMemoryObjectEXT) +#define glMemoryObjectParameterivEXT GLEW_GET_FUN(__glewMemoryObjectParameterivEXT) +#define glNamedBufferStorageMemEXT GLEW_GET_FUN(__glewNamedBufferStorageMemEXT) +#define glTexStorageMem1DEXT GLEW_GET_FUN(__glewTexStorageMem1DEXT) +#define glTexStorageMem2DEXT GLEW_GET_FUN(__glewTexStorageMem2DEXT) +#define glTexStorageMem2DMultisampleEXT GLEW_GET_FUN(__glewTexStorageMem2DMultisampleEXT) +#define glTexStorageMem3DEXT GLEW_GET_FUN(__glewTexStorageMem3DEXT) +#define glTexStorageMem3DMultisampleEXT GLEW_GET_FUN(__glewTexStorageMem3DMultisampleEXT) +#define glTextureStorageMem1DEXT GLEW_GET_FUN(__glewTextureStorageMem1DEXT) +#define glTextureStorageMem2DEXT GLEW_GET_FUN(__glewTextureStorageMem2DEXT) +#define glTextureStorageMem2DMultisampleEXT GLEW_GET_FUN(__glewTextureStorageMem2DMultisampleEXT) +#define glTextureStorageMem3DEXT GLEW_GET_FUN(__glewTextureStorageMem3DEXT) +#define glTextureStorageMem3DMultisampleEXT GLEW_GET_FUN(__glewTextureStorageMem3DMultisampleEXT) + +#define GLEW_EXT_memory_object GLEW_GET_VAR(__GLEW_EXT_memory_object) + +#endif /* GL_EXT_memory_object */ + +/* ------------------------ GL_EXT_memory_object_fd ------------------------ */ + +#ifndef GL_EXT_memory_object_fd +#define GL_EXT_memory_object_fd 1 + +#define GL_HANDLE_TYPE_OPAQUE_FD_EXT 0x9586 + +typedef void (GLAPIENTRY * PFNGLIMPORTMEMORYFDEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, GLint fd); + +#define glImportMemoryFdEXT GLEW_GET_FUN(__glewImportMemoryFdEXT) + +#define GLEW_EXT_memory_object_fd GLEW_GET_VAR(__GLEW_EXT_memory_object_fd) + +#endif /* GL_EXT_memory_object_fd */ + +/* ----------------------- GL_EXT_memory_object_win32 ---------------------- */ + +#ifndef GL_EXT_memory_object_win32 +#define GL_EXT_memory_object_win32 1 + +#define GL_LUID_SIZE_EXT 8 +#define GL_HANDLE_TYPE_OPAQUE_WIN32_EXT 0x9587 +#define GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT 0x9588 +#define GL_HANDLE_TYPE_D3D12_TILEPOOL_EXT 0x9589 +#define GL_HANDLE_TYPE_D3D12_RESOURCE_EXT 0x958A +#define GL_HANDLE_TYPE_D3D11_IMAGE_EXT 0x958B +#define GL_HANDLE_TYPE_D3D11_IMAGE_KMT_EXT 0x958C +#define GL_HANDLE_TYPE_D3D12_FENCE_EXT 0x9594 +#define GL_D3D12_FENCE_VALUE_EXT 0x9595 +#define GL_DEVICE_LUID_EXT 0x9599 +#define GL_DEVICE_NODE_MASK_EXT 0x959A + +typedef void (GLAPIENTRY * PFNGLIMPORTMEMORYWIN32HANDLEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, void *handle); +typedef void (GLAPIENTRY * PFNGLIMPORTMEMORYWIN32NAMEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, const void *name); + +#define glImportMemoryWin32HandleEXT GLEW_GET_FUN(__glewImportMemoryWin32HandleEXT) +#define glImportMemoryWin32NameEXT GLEW_GET_FUN(__glewImportMemoryWin32NameEXT) + +#define GLEW_EXT_memory_object_win32 GLEW_GET_VAR(__GLEW_EXT_memory_object_win32) + +#endif /* GL_EXT_memory_object_win32 */ + /* ------------------------- GL_EXT_misc_attribute ------------------------- */ #ifndef GL_EXT_misc_attribute @@ -6002,8 +11066,8 @@ typedef void (GLAPIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mod #ifndef GL_EXT_multi_draw_arrays #define GL_EXT_multi_draw_arrays 1 -typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint* first, GLsizei *count, GLsizei primcount); -typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, GLsizei* count, GLenum type, const GLvoid **indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, GLsizei* count, GLenum type, const void *const *indices, GLsizei primcount); #define glMultiDrawArraysEXT GLEW_GET_FUN(__glewMultiDrawArraysEXT) #define glMultiDrawElementsEXT GLEW_GET_FUN(__glewMultiDrawElementsEXT) @@ -6012,6 +11076,30 @@ typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, GLsizei* #endif /* GL_EXT_multi_draw_arrays */ +/* ----------------------- GL_EXT_multi_draw_indirect ---------------------- */ + +#ifndef GL_EXT_multi_draw_indirect +#define GL_EXT_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTEXTPROC) (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTEXTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); + +#define glMultiDrawArraysIndirectEXT GLEW_GET_FUN(__glewMultiDrawArraysIndirectEXT) +#define glMultiDrawElementsIndirectEXT GLEW_GET_FUN(__glewMultiDrawElementsIndirectEXT) + +#define GLEW_EXT_multi_draw_indirect GLEW_GET_VAR(__GLEW_EXT_multi_draw_indirect) + +#endif /* GL_EXT_multi_draw_indirect */ + +/* ------------------------ GL_EXT_multiple_textures ----------------------- */ + +#ifndef GL_EXT_multiple_textures +#define GL_EXT_multiple_textures 1 + +#define GLEW_EXT_multiple_textures GLEW_GET_VAR(__GLEW_EXT_multiple_textures) + +#endif /* GL_EXT_multiple_textures */ + /* --------------------------- GL_EXT_multisample -------------------------- */ #ifndef GL_EXT_multisample @@ -6045,6 +11133,68 @@ typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); #endif /* GL_EXT_multisample */ +/* -------------------- GL_EXT_multisample_compatibility ------------------- */ + +#ifndef GL_EXT_multisample_compatibility +#define GL_EXT_multisample_compatibility 1 + +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F + +#define GLEW_EXT_multisample_compatibility GLEW_GET_VAR(__GLEW_EXT_multisample_compatibility) + +#endif /* GL_EXT_multisample_compatibility */ + +/* ----------------- GL_EXT_multisampled_render_to_texture ----------------- */ + +#ifndef GL_EXT_multisampled_render_to_texture +#define GL_EXT_multisampled_render_to_texture 1 + +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); + +#define glFramebufferTexture2DMultisampleEXT GLEW_GET_FUN(__glewFramebufferTexture2DMultisampleEXT) + +#define GLEW_EXT_multisampled_render_to_texture GLEW_GET_VAR(__GLEW_EXT_multisampled_render_to_texture) + +#endif /* GL_EXT_multisampled_render_to_texture */ + +/* ----------------- GL_EXT_multisampled_render_to_texture2 ---------------- */ + +#ifndef GL_EXT_multisampled_render_to_texture2 +#define GL_EXT_multisampled_render_to_texture2 1 + +#define GLEW_EXT_multisampled_render_to_texture2 GLEW_GET_VAR(__GLEW_EXT_multisampled_render_to_texture2) + +#endif /* GL_EXT_multisampled_render_to_texture2 */ + +/* --------------------- GL_EXT_multiview_draw_buffers --------------------- */ + +#ifndef GL_EXT_multiview_draw_buffers +#define GL_EXT_multiview_draw_buffers 1 + +#define GL_DRAW_BUFFER_EXT 0x0C01 +#define GL_READ_BUFFER_EXT 0x0C02 +#define GL_COLOR_ATTACHMENT_EXT 0x90F0 +#define GL_MULTIVIEW_EXT 0x90F1 +#define GL_MAX_MULTIVIEW_BUFFERS_EXT 0x90F2 + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSINDEXEDEXTPROC) (GLint n, const GLenum* location, const GLint *indices); +typedef void (GLAPIENTRY * PFNGLGETINTEGERI_VEXTPROC) (GLenum target, GLuint index, GLint* data); +typedef void (GLAPIENTRY * PFNGLREADBUFFERINDEXEDEXTPROC) (GLenum src, GLint index); + +#define glDrawBuffersIndexedEXT GLEW_GET_FUN(__glewDrawBuffersIndexedEXT) +#define glGetIntegeri_vEXT GLEW_GET_FUN(__glewGetIntegeri_vEXT) +#define glReadBufferIndexedEXT GLEW_GET_FUN(__glewReadBufferIndexedEXT) + +#define GLEW_EXT_multiview_draw_buffers GLEW_GET_VAR(__GLEW_EXT_multiview_draw_buffers) + +#endif /* GL_EXT_multiview_draw_buffers */ + /* ---------------------- GL_EXT_packed_depth_stencil ---------------------- */ #ifndef GL_EXT_packed_depth_stencil @@ -6096,8 +11246,6 @@ typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); #define GL_TEXTURE_2D 0x0DE1 #define GL_PROXY_TEXTURE_1D 0x8063 #define GL_PROXY_TEXTURE_2D 0x8064 -#define GL_TEXTURE_3D_EXT 0x806F -#define GL_PROXY_TEXTURE_3D_EXT 0x8070 #define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 #define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 #define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA @@ -6116,8 +11264,8 @@ typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); #define GL_TEXTURE_CUBE_MAP_ARB 0x8513 #define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B -typedef void (GLAPIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void* data); -typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, void* data); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, void *data); typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); @@ -6197,7 +11345,7 @@ typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target #define GL_DISTANCE_ATTENUATION_EXT 0x8129 typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat* params); #define glPointParameterfEXT GLEW_GET_FUN(__glewPointParameterfEXT) #define glPointParameterfvEXT GLEW_GET_FUN(__glewPointParameterfvEXT) @@ -6223,6 +11371,127 @@ typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat b #endif /* GL_EXT_polygon_offset */ +/* ---------------------- GL_EXT_polygon_offset_clamp ---------------------- */ + +#ifndef GL_EXT_polygon_offset_clamp +#define GL_EXT_polygon_offset_clamp 1 + +#define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B + +typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETCLAMPEXTPROC) (GLfloat factor, GLfloat units, GLfloat clamp); + +#define glPolygonOffsetClampEXT GLEW_GET_FUN(__glewPolygonOffsetClampEXT) + +#define GLEW_EXT_polygon_offset_clamp GLEW_GET_VAR(__GLEW_EXT_polygon_offset_clamp) + +#endif /* GL_EXT_polygon_offset_clamp */ + +/* ----------------------- GL_EXT_post_depth_coverage ---------------------- */ + +#ifndef GL_EXT_post_depth_coverage +#define GL_EXT_post_depth_coverage 1 + +#define GLEW_EXT_post_depth_coverage GLEW_GET_VAR(__GLEW_EXT_post_depth_coverage) + +#endif /* GL_EXT_post_depth_coverage */ + +/* ------------------------ GL_EXT_provoking_vertex ------------------------ */ + +#ifndef GL_EXT_provoking_vertex +#define GL_EXT_provoking_vertex 1 + +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_PROVOKING_VERTEX_EXT 0x8E4F + +typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); + +#define glProvokingVertexEXT GLEW_GET_FUN(__glewProvokingVertexEXT) + +#define GLEW_EXT_provoking_vertex GLEW_GET_VAR(__GLEW_EXT_provoking_vertex) + +#endif /* GL_EXT_provoking_vertex */ + +/* --------------------------- GL_EXT_pvrtc_sRGB --------------------------- */ + +#ifndef GL_EXT_pvrtc_sRGB +#define GL_EXT_pvrtc_sRGB 1 + +#define GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT 0x8A54 +#define GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT 0x8A55 +#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT 0x8A56 +#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT 0x8A57 + +#define GLEW_EXT_pvrtc_sRGB GLEW_GET_VAR(__GLEW_EXT_pvrtc_sRGB) + +#endif /* GL_EXT_pvrtc_sRGB */ + +/* ----------------------- GL_EXT_raster_multisample ----------------------- */ + +#ifndef GL_EXT_raster_multisample +#define GL_EXT_raster_multisample 1 + +#define GL_COLOR_SAMPLES_NV 0x8E20 +#define GL_RASTER_MULTISAMPLE_EXT 0x9327 +#define GL_RASTER_SAMPLES_EXT 0x9328 +#define GL_MAX_RASTER_SAMPLES_EXT 0x9329 +#define GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A +#define GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B +#define GL_EFFECTIVE_RASTER_SAMPLES_EXT 0x932C +#define GL_DEPTH_SAMPLES_NV 0x932D +#define GL_STENCIL_SAMPLES_NV 0x932E +#define GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F +#define GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330 +#define GL_COVERAGE_MODULATION_TABLE_NV 0x9331 +#define GL_COVERAGE_MODULATION_NV 0x9332 +#define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 + +typedef void (GLAPIENTRY * PFNGLCOVERAGEMODULATIONNVPROC) (GLenum components); +typedef void (GLAPIENTRY * PFNGLCOVERAGEMODULATIONTABLENVPROC) (GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufsize, GLfloat* v); +typedef void (GLAPIENTRY * PFNGLRASTERSAMPLESEXTPROC) (GLuint samples, GLboolean fixedsamplelocations); + +#define glCoverageModulationNV GLEW_GET_FUN(__glewCoverageModulationNV) +#define glCoverageModulationTableNV GLEW_GET_FUN(__glewCoverageModulationTableNV) +#define glGetCoverageModulationTableNV GLEW_GET_FUN(__glewGetCoverageModulationTableNV) +#define glRasterSamplesEXT GLEW_GET_FUN(__glewRasterSamplesEXT) + +#define GLEW_EXT_raster_multisample GLEW_GET_VAR(__GLEW_EXT_raster_multisample) + +#endif /* GL_EXT_raster_multisample */ + +/* ------------------------ GL_EXT_read_format_bgra ------------------------ */ + +#ifndef GL_EXT_read_format_bgra +#define GL_EXT_read_format_bgra 1 + +#define GL_BGRA_EXT 0x80E1 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366 + +#define GLEW_EXT_read_format_bgra GLEW_GET_VAR(__GLEW_EXT_read_format_bgra) + +#endif /* GL_EXT_read_format_bgra */ + +/* -------------------------- GL_EXT_render_snorm -------------------------- */ + +#ifndef GL_EXT_render_snorm +#define GL_EXT_render_snorm 1 + +#define GL_BYTE 0x1400 +#define GL_SHORT 0x1402 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM_EXT 0x8F98 +#define GL_RG16_SNORM_EXT 0x8F99 +#define GL_RGBA16_SNORM_EXT 0x8F9B + +#define GLEW_EXT_render_snorm GLEW_GET_VAR(__GLEW_EXT_render_snorm) + +#endif /* GL_EXT_render_snorm */ + /* ------------------------- GL_EXT_rescale_normal ------------------------- */ #ifndef GL_EXT_rescale_normal @@ -6234,6 +11503,31 @@ typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat b #endif /* GL_EXT_rescale_normal */ +/* ------------------------------ GL_EXT_sRGB ------------------------------ */ + +#ifndef GL_EXT_sRGB +#define GL_EXT_sRGB 1 + +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210 +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 + +#define GLEW_EXT_sRGB GLEW_GET_VAR(__GLEW_EXT_sRGB) + +#endif /* GL_EXT_sRGB */ + +/* ----------------------- GL_EXT_sRGB_write_control ----------------------- */ + +#ifndef GL_EXT_sRGB_write_control +#define GL_EXT_sRGB_write_control 1 + +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 + +#define GLEW_EXT_sRGB_write_control GLEW_GET_VAR(__GLEW_EXT_sRGB_write_control) + +#endif /* GL_EXT_sRGB_write_control */ + /* -------------------------- GL_EXT_scene_marker -------------------------- */ #ifndef GL_EXT_scene_marker @@ -6278,7 +11572,7 @@ typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint gr typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); #define glSecondaryColor3bEXT GLEW_GET_FUN(__glewSecondaryColor3bEXT) #define glSecondaryColor3bvEXT GLEW_GET_FUN(__glewSecondaryColor3bvEXT) @@ -6302,6 +11596,78 @@ typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenu #endif /* GL_EXT_secondary_color */ +/* ---------------------------- GL_EXT_semaphore --------------------------- */ + +#ifndef GL_EXT_semaphore +#define GL_EXT_semaphore 1 + +typedef void (GLAPIENTRY * PFNGLDELETESEMAPHORESEXTPROC) (GLsizei n, const GLuint* semaphores); +typedef void (GLAPIENTRY * PFNGLGENSEMAPHORESEXTPROC) (GLsizei n, GLuint* semaphores); +typedef void (GLAPIENTRY * PFNGLGETSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, GLuint64* params); +typedef GLboolean (GLAPIENTRY * PFNGLISSEMAPHOREEXTPROC) (GLuint semaphore); +typedef void (GLAPIENTRY * PFNGLSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, const GLuint64* params); +typedef void (GLAPIENTRY * PFNGLSIGNALSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint* buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts); +typedef void (GLAPIENTRY * PFNGLWAITSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint* buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts); + +#define glDeleteSemaphoresEXT GLEW_GET_FUN(__glewDeleteSemaphoresEXT) +#define glGenSemaphoresEXT GLEW_GET_FUN(__glewGenSemaphoresEXT) +#define glGetSemaphoreParameterui64vEXT GLEW_GET_FUN(__glewGetSemaphoreParameterui64vEXT) +#define glIsSemaphoreEXT GLEW_GET_FUN(__glewIsSemaphoreEXT) +#define glSemaphoreParameterui64vEXT GLEW_GET_FUN(__glewSemaphoreParameterui64vEXT) +#define glSignalSemaphoreEXT GLEW_GET_FUN(__glewSignalSemaphoreEXT) +#define glWaitSemaphoreEXT GLEW_GET_FUN(__glewWaitSemaphoreEXT) + +#define GLEW_EXT_semaphore GLEW_GET_VAR(__GLEW_EXT_semaphore) + +#endif /* GL_EXT_semaphore */ + +/* -------------------------- GL_EXT_semaphore_fd -------------------------- */ + +#ifndef GL_EXT_semaphore_fd +#define GL_EXT_semaphore_fd 1 + +typedef void (GLAPIENTRY * PFNGLIMPORTSEMAPHOREFDEXTPROC) (GLuint semaphore, GLenum handleType, GLint fd); + +#define glImportSemaphoreFdEXT GLEW_GET_FUN(__glewImportSemaphoreFdEXT) + +#define GLEW_EXT_semaphore_fd GLEW_GET_VAR(__GLEW_EXT_semaphore_fd) + +#endif /* GL_EXT_semaphore_fd */ + +/* ------------------------- GL_EXT_semaphore_win32 ------------------------ */ + +#ifndef GL_EXT_semaphore_win32 +#define GL_EXT_semaphore_win32 1 + +typedef void (GLAPIENTRY * PFNGLIMPORTSEMAPHOREWIN32HANDLEEXTPROC) (GLuint semaphore, GLenum handleType, void *handle); +typedef void (GLAPIENTRY * PFNGLIMPORTSEMAPHOREWIN32NAMEEXTPROC) (GLuint semaphore, GLenum handleType, const void *name); + +#define glImportSemaphoreWin32HandleEXT GLEW_GET_FUN(__glewImportSemaphoreWin32HandleEXT) +#define glImportSemaphoreWin32NameEXT GLEW_GET_FUN(__glewImportSemaphoreWin32NameEXT) + +#define GLEW_EXT_semaphore_win32 GLEW_GET_VAR(__GLEW_EXT_semaphore_win32) + +#endif /* GL_EXT_semaphore_win32 */ + +/* --------------------- GL_EXT_separate_shader_objects -------------------- */ + +#ifndef GL_EXT_separate_shader_objects +#define GL_EXT_separate_shader_objects 1 + +#define GL_ACTIVE_PROGRAM_EXT 0x8B8D + +typedef void (GLAPIENTRY * PFNGLACTIVEPROGRAMEXTPROC) (GLuint program); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar* string); +typedef void (GLAPIENTRY * PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program); + +#define glActiveProgramEXT GLEW_GET_FUN(__glewActiveProgramEXT) +#define glCreateShaderProgramEXT GLEW_GET_FUN(__glewCreateShaderProgramEXT) +#define glUseShaderProgramEXT GLEW_GET_FUN(__glewUseShaderProgramEXT) + +#define GLEW_EXT_separate_shader_objects GLEW_GET_VAR(__GLEW_EXT_separate_shader_objects) + +#endif /* GL_EXT_separate_shader_objects */ + /* --------------------- GL_EXT_separate_specular_color -------------------- */ #ifndef GL_EXT_separate_specular_color @@ -6315,6 +11681,185 @@ typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenu #endif /* GL_EXT_separate_specular_color */ +/* -------------------- GL_EXT_shader_framebuffer_fetch -------------------- */ + +#ifndef GL_EXT_shader_framebuffer_fetch +#define GL_EXT_shader_framebuffer_fetch 1 + +#define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52 + +#define GLEW_EXT_shader_framebuffer_fetch GLEW_GET_VAR(__GLEW_EXT_shader_framebuffer_fetch) + +#endif /* GL_EXT_shader_framebuffer_fetch */ + +/* ------------------------ GL_EXT_shader_group_vote ----------------------- */ + +#ifndef GL_EXT_shader_group_vote +#define GL_EXT_shader_group_vote 1 + +#define GLEW_EXT_shader_group_vote GLEW_GET_VAR(__GLEW_EXT_shader_group_vote) + +#endif /* GL_EXT_shader_group_vote */ + +/* ------------------- GL_EXT_shader_image_load_formatted ------------------ */ + +#ifndef GL_EXT_shader_image_load_formatted +#define GL_EXT_shader_image_load_formatted 1 + +#define GLEW_EXT_shader_image_load_formatted GLEW_GET_VAR(__GLEW_EXT_shader_image_load_formatted) + +#endif /* GL_EXT_shader_image_load_formatted */ + +/* --------------------- GL_EXT_shader_image_load_store -------------------- */ + +#ifndef GL_EXT_shader_image_load_store +#define GL_EXT_shader_image_load_store 1 + +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 +#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 +#define GL_MAX_IMAGE_UNITS_EXT 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 +#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A +#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B +#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C +#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D +#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E +#define GL_IMAGE_1D_EXT 0x904C +#define GL_IMAGE_2D_EXT 0x904D +#define GL_IMAGE_3D_EXT 0x904E +#define GL_IMAGE_2D_RECT_EXT 0x904F +#define GL_IMAGE_CUBE_EXT 0x9050 +#define GL_IMAGE_BUFFER_EXT 0x9051 +#define GL_IMAGE_1D_ARRAY_EXT 0x9052 +#define GL_IMAGE_2D_ARRAY_EXT 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 +#define GL_INT_IMAGE_1D_EXT 0x9057 +#define GL_INT_IMAGE_2D_EXT 0x9058 +#define GL_INT_IMAGE_3D_EXT 0x9059 +#define GL_INT_IMAGE_2D_RECT_EXT 0x905A +#define GL_INT_IMAGE_CUBE_EXT 0x905B +#define GL_INT_IMAGE_BUFFER_EXT 0x905C +#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D +#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C +#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D +#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E +#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); +typedef void (GLAPIENTRY * PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers); + +#define glBindImageTextureEXT GLEW_GET_FUN(__glewBindImageTextureEXT) +#define glMemoryBarrierEXT GLEW_GET_FUN(__glewMemoryBarrierEXT) + +#define GLEW_EXT_shader_image_load_store GLEW_GET_VAR(__GLEW_EXT_shader_image_load_store) + +#endif /* GL_EXT_shader_image_load_store */ + +/* ------------------- GL_EXT_shader_implicit_conversions ------------------ */ + +#ifndef GL_EXT_shader_implicit_conversions +#define GL_EXT_shader_implicit_conversions 1 + +#define GLEW_EXT_shader_implicit_conversions GLEW_GET_VAR(__GLEW_EXT_shader_implicit_conversions) + +#endif /* GL_EXT_shader_implicit_conversions */ + +/* ----------------------- GL_EXT_shader_integer_mix ----------------------- */ + +#ifndef GL_EXT_shader_integer_mix +#define GL_EXT_shader_integer_mix 1 + +#define GLEW_EXT_shader_integer_mix GLEW_GET_VAR(__GLEW_EXT_shader_integer_mix) + +#endif /* GL_EXT_shader_integer_mix */ + +/* ------------------------ GL_EXT_shader_io_blocks ------------------------ */ + +#ifndef GL_EXT_shader_io_blocks +#define GL_EXT_shader_io_blocks 1 + +#define GLEW_EXT_shader_io_blocks GLEW_GET_VAR(__GLEW_EXT_shader_io_blocks) + +#endif /* GL_EXT_shader_io_blocks */ + +/* ------------- GL_EXT_shader_non_constant_global_initializers ------------ */ + +#ifndef GL_EXT_shader_non_constant_global_initializers +#define GL_EXT_shader_non_constant_global_initializers 1 + +#define GLEW_EXT_shader_non_constant_global_initializers GLEW_GET_VAR(__GLEW_EXT_shader_non_constant_global_initializers) + +#endif /* GL_EXT_shader_non_constant_global_initializers */ + +/* ------------------- GL_EXT_shader_pixel_local_storage ------------------- */ + +#ifndef GL_EXT_shader_pixel_local_storage +#define GL_EXT_shader_pixel_local_storage 1 + +#define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT 0x8F63 +#define GL_SHADER_PIXEL_LOCAL_STORAGE_EXT 0x8F64 +#define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_SIZE_EXT 0x8F67 + +#define GLEW_EXT_shader_pixel_local_storage GLEW_GET_VAR(__GLEW_EXT_shader_pixel_local_storage) + +#endif /* GL_EXT_shader_pixel_local_storage */ + +/* ------------------- GL_EXT_shader_pixel_local_storage2 ------------------ */ + +#ifndef GL_EXT_shader_pixel_local_storage2 +#define GL_EXT_shader_pixel_local_storage2 1 + +#define GL_MAX_SHADER_COMBINED_LOCAL_STORAGE_FAST_SIZE_EXT 0x9650 +#define GL_MAX_SHADER_COMBINED_LOCAL_STORAGE_SIZE_EXT 0x9651 +#define GL_FRAMEBUFFER_INCOMPLETE_INSUFFICIENT_SHADER_COMBINED_LOCAL_STORAGE_EXT 0x9652 + +typedef void (GLAPIENTRY * PFNGLCLEARPIXELLOCALSTORAGEUIEXTPROC) (GLsizei offset, GLsizei n, const GLuint* values); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC) (GLuint target, GLsizei size); +typedef GLsizei (GLAPIENTRY * PFNGLGETFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC) (GLuint target); + +#define glClearPixelLocalStorageuiEXT GLEW_GET_FUN(__glewClearPixelLocalStorageuiEXT) +#define glFramebufferPixelLocalStorageSizeEXT GLEW_GET_FUN(__glewFramebufferPixelLocalStorageSizeEXT) +#define glGetFramebufferPixelLocalStorageSizeEXT GLEW_GET_FUN(__glewGetFramebufferPixelLocalStorageSizeEXT) + +#define GLEW_EXT_shader_pixel_local_storage2 GLEW_GET_VAR(__GLEW_EXT_shader_pixel_local_storage2) + +#endif /* GL_EXT_shader_pixel_local_storage2 */ + +/* ----------------------- GL_EXT_shader_texture_lod ----------------------- */ + +#ifndef GL_EXT_shader_texture_lod +#define GL_EXT_shader_texture_lod 1 + +#define GLEW_EXT_shader_texture_lod GLEW_GET_VAR(__GLEW_EXT_shader_texture_lod) + +#endif /* GL_EXT_shader_texture_lod */ + /* -------------------------- GL_EXT_shadow_funcs -------------------------- */ #ifndef GL_EXT_shadow_funcs @@ -6324,6 +11869,20 @@ typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenu #endif /* GL_EXT_shadow_funcs */ +/* ------------------------- GL_EXT_shadow_samplers ------------------------ */ + +#ifndef GL_EXT_shadow_samplers +#define GL_EXT_shadow_samplers 1 + +#define GL_TEXTURE_COMPARE_MODE_EXT 0x884C +#define GL_TEXTURE_COMPARE_FUNC_EXT 0x884D +#define GL_COMPARE_REF_TO_TEXTURE_EXT 0x884E +#define GL_SAMPLER_2D_SHADOW_EXT 0x8B62 + +#define GLEW_EXT_shadow_samplers GLEW_GET_VAR(__GLEW_EXT_shadow_samplers) + +#endif /* GL_EXT_shadow_samplers */ + /* --------------------- GL_EXT_shared_texture_palette --------------------- */ #ifndef GL_EXT_shared_texture_palette @@ -6335,6 +11894,47 @@ typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenu #endif /* GL_EXT_shared_texture_palette */ +/* ------------------------- GL_EXT_sparse_texture ------------------------- */ + +#ifndef GL_EXT_sparse_texture +#define GL_EXT_sparse_texture 1 + +#define GL_TEXTURE_2D 0x0DE1 +#define GL_TEXTURE_3D 0x806F +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_TEXTURE_CUBE_MAP_ARRAY_OES 0x9009 +#define GL_VIRTUAL_PAGE_SIZE_X_EXT 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_EXT 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_EXT 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_EXT 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_EXT 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_EXT 0x919A +#define GL_TEXTURE_SPARSE_EXT 0x91A6 +#define GL_VIRTUAL_PAGE_SIZE_INDEX_EXT 0x91A7 +#define GL_NUM_VIRTUAL_PAGE_SIZES_EXT 0x91A8 +#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_EXT 0x91A9 +#define GL_NUM_SPARSE_LEVELS_EXT 0x91AA + +typedef void (GLAPIENTRY * PFNGLTEXPAGECOMMITMENTEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); +typedef void (GLAPIENTRY * PFNGLTEXTUREPAGECOMMITMENTEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); + +#define glTexPageCommitmentEXT GLEW_GET_FUN(__glewTexPageCommitmentEXT) +#define glTexturePageCommitmentEXT GLEW_GET_FUN(__glewTexturePageCommitmentEXT) + +#define GLEW_EXT_sparse_texture GLEW_GET_VAR(__GLEW_EXT_sparse_texture) + +#endif /* GL_EXT_sparse_texture */ + +/* ------------------------- GL_EXT_sparse_texture2 ------------------------ */ + +#ifndef GL_EXT_sparse_texture2 +#define GL_EXT_sparse_texture2 1 + +#define GLEW_EXT_sparse_texture2 GLEW_GET_VAR(__GLEW_EXT_sparse_texture2) + +#endif /* GL_EXT_sparse_texture2 */ + /* ------------------------ GL_EXT_stencil_clear_tag ----------------------- */ #ifndef GL_EXT_stencil_clear_tag @@ -6380,9 +11980,9 @@ typedef void (GLAPIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); #ifndef GL_EXT_subtexture #define GL_EXT_subtexture 1 -typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); #define glTexSubImage1DEXT GLEW_GET_FUN(__glewTexSubImage1DEXT) #define glTexSubImage2DEXT GLEW_GET_FUN(__glewTexSubImage2DEXT) @@ -6459,7 +12059,7 @@ typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint leve #define GL_TEXTURE_WRAP_R_EXT 0x8072 #define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 -typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); #define glTexImage3DEXT GLEW_GET_FUN(__glewTexImage3DEXT) @@ -6481,6 +12081,10 @@ typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, #define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C #define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); + +#define glFramebufferTextureLayerEXT GLEW_GET_FUN(__glewFramebufferTextureLayerEXT) + #define GLEW_EXT_texture_array GLEW_GET_VAR(__GLEW_EXT_texture_array) #endif /* GL_EXT_texture_array */ @@ -6504,14 +12108,47 @@ typedef void (GLAPIENTRY * PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum interna #endif /* GL_EXT_texture_buffer_object */ +/* -------------- GL_EXT_texture_compression_astc_decode_mode -------------- */ + +#ifndef GL_EXT_texture_compression_astc_decode_mode +#define GL_EXT_texture_compression_astc_decode_mode 1 + +#define GL_TEXTURE_ASTC_DECODE_PRECISION_EXT 0x8F69 + +#define GLEW_EXT_texture_compression_astc_decode_mode GLEW_GET_VAR(__GLEW_EXT_texture_compression_astc_decode_mode) + +#endif /* GL_EXT_texture_compression_astc_decode_mode */ + +/* ----------- GL_EXT_texture_compression_astc_decode_mode_rgb9e5 ---------- */ + +#ifndef GL_EXT_texture_compression_astc_decode_mode_rgb9e5 +#define GL_EXT_texture_compression_astc_decode_mode_rgb9e5 1 + +#define GL_TEXTURE_ASTC_DECODE_PRECISION_EXT 0x8F69 + +#define GLEW_EXT_texture_compression_astc_decode_mode_rgb9e5 GLEW_GET_VAR(__GLEW_EXT_texture_compression_astc_decode_mode_rgb9e5) + +#endif /* GL_EXT_texture_compression_astc_decode_mode_rgb9e5 */ + +/* -------------------- GL_EXT_texture_compression_bptc -------------------- */ + +#ifndef GL_EXT_texture_compression_bptc +#define GL_EXT_texture_compression_bptc 1 + +#define GL_COMPRESSED_RGBA_BPTC_UNORM_EXT 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT 0x8E8F + +#define GLEW_EXT_texture_compression_bptc GLEW_GET_VAR(__GLEW_EXT_texture_compression_bptc) + +#endif /* GL_EXT_texture_compression_bptc */ + /* -------------------- GL_EXT_texture_compression_dxt1 -------------------- */ #ifndef GL_EXT_texture_compression_dxt1 #define GL_EXT_texture_compression_dxt1 1 -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 - #define GLEW_EXT_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_EXT_texture_compression_dxt1) #endif /* GL_EXT_texture_compression_dxt1 */ @@ -6580,6 +12217,25 @@ typedef void (GLAPIENTRY * PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum interna #endif /* GL_EXT_texture_cube_map */ +/* --------------------- GL_EXT_texture_cube_map_array --------------------- */ + +#ifndef GL_EXT_texture_cube_map_array +#define GL_EXT_texture_cube_map_array 1 + +#define GL_TEXTURE_CUBE_MAP_ARRAY_EXT 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_EXT 0x900A +#define GL_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_EXT 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900F +#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 +#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A + +#define GLEW_EXT_texture_cube_map_array GLEW_GET_VAR(__GLEW_EXT_texture_cube_map_array) + +#endif /* GL_EXT_texture_cube_map_array */ + /* ----------------------- GL_EXT_texture_edge_clamp ----------------------- */ #ifndef GL_EXT_texture_edge_clamp @@ -6596,18 +12252,6 @@ typedef void (GLAPIENTRY * PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum interna #ifndef GL_EXT_texture_env #define GL_EXT_texture_env 1 -#define GL_TEXTURE_ENV0_EXT 0 -#define GL_ENV_BLEND_EXT 0 -#define GL_TEXTURE_ENV_SHIFT_EXT 0 -#define GL_ENV_REPLACE_EXT 0 -#define GL_ENV_ADD_EXT 0 -#define GL_ENV_SUBTRACT_EXT 0 -#define GL_TEXTURE_ENV_MODE_ALPHA_EXT 0 -#define GL_ENV_REVERSE_SUBTRACT_EXT 0 -#define GL_ENV_REVERSE_BLEND_EXT 0 -#define GL_ENV_COPY_EXT 0 -#define GL_ENV_MODULATE_EXT 0 - #define GLEW_EXT_texture_env GLEW_GET_VAR(__GLEW_EXT_texture_env) #endif /* GL_EXT_texture_env */ @@ -6676,6 +12320,29 @@ typedef void (GLAPIENTRY * PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum interna #endif /* GL_EXT_texture_filter_anisotropic */ +/* ---------------------- GL_EXT_texture_filter_minmax --------------------- */ + +#ifndef GL_EXT_texture_filter_minmax +#define GL_EXT_texture_filter_minmax 1 + +#define GL_TEXTURE_REDUCTION_MODE_EXT 0x9366 +#define GL_WEIGHTED_AVERAGE_EXT 0x9367 + +#define GLEW_EXT_texture_filter_minmax GLEW_GET_VAR(__GLEW_EXT_texture_filter_minmax) + +#endif /* GL_EXT_texture_filter_minmax */ + +/* --------------------- GL_EXT_texture_format_BGRA8888 -------------------- */ + +#ifndef GL_EXT_texture_format_BGRA8888 +#define GL_EXT_texture_format_BGRA8888 1 + +#define GL_BGRA_EXT 0x80E1 + +#define GLEW_EXT_texture_format_BGRA8888 GLEW_GET_VAR(__GLEW_EXT_texture_format_BGRA8888) + +#endif /* GL_EXT_texture_format_BGRA8888 */ + /* ------------------------- GL_EXT_texture_integer ------------------------ */ #ifndef GL_EXT_texture_integer @@ -6773,6 +12440,24 @@ typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum #endif /* GL_EXT_texture_mirror_clamp */ +/* ------------------------- GL_EXT_texture_norm16 ------------------------- */ + +#ifndef GL_EXT_texture_norm16 +#define GL_EXT_texture_norm16 1 + +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA16_EXT 0x805B +#define GL_R16_EXT 0x822A +#define GL_RG16_EXT 0x822C +#define GL_R16_SNORM_EXT 0x8F98 +#define GL_RG16_SNORM_EXT 0x8F99 +#define GL_RGB16_SNORM_EXT 0x8F9A +#define GL_RGBA16_SNORM_EXT 0x8F9B + +#define GLEW_EXT_texture_norm16 GLEW_GET_VAR(__GLEW_EXT_texture_norm16) + +#endif /* GL_EXT_texture_norm16 */ + /* ------------------------- GL_EXT_texture_object ------------------------- */ #ifndef GL_EXT_texture_object @@ -6832,6 +12517,20 @@ typedef void (GLAPIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); #endif /* GL_EXT_texture_rectangle */ +/* --------------------------- GL_EXT_texture_rg --------------------------- */ + +#ifndef GL_EXT_texture_rg +#define GL_EXT_texture_rg 1 + +#define GL_RED_EXT 0x1903 +#define GL_RG_EXT 0x8227 +#define GL_R8_EXT 0x8229 +#define GL_RG8_EXT 0x822B + +#define GLEW_EXT_texture_rg GLEW_GET_VAR(__GLEW_EXT_texture_rg) + +#endif /* GL_EXT_texture_rg */ + /* -------------------------- GL_EXT_texture_sRGB -------------------------- */ #ifndef GL_EXT_texture_sRGB @@ -6858,6 +12557,41 @@ typedef void (GLAPIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); #endif /* GL_EXT_texture_sRGB */ +/* ------------------------- GL_EXT_texture_sRGB_R8 ------------------------ */ + +#ifndef GL_EXT_texture_sRGB_R8 +#define GL_EXT_texture_sRGB_R8 1 + +#define GL_SR8_EXT 0x8FBD + +#define GLEW_EXT_texture_sRGB_R8 GLEW_GET_VAR(__GLEW_EXT_texture_sRGB_R8) + +#endif /* GL_EXT_texture_sRGB_R8 */ + +/* ------------------------ GL_EXT_texture_sRGB_RG8 ------------------------ */ + +#ifndef GL_EXT_texture_sRGB_RG8 +#define GL_EXT_texture_sRGB_RG8 1 + +#define GL_SRG8_EXT 0x8FBE + +#define GLEW_EXT_texture_sRGB_RG8 GLEW_GET_VAR(__GLEW_EXT_texture_sRGB_RG8) + +#endif /* GL_EXT_texture_sRGB_RG8 */ + +/* ----------------------- GL_EXT_texture_sRGB_decode ---------------------- */ + +#ifndef GL_EXT_texture_sRGB_decode +#define GL_EXT_texture_sRGB_decode 1 + +#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 +#define GL_DECODE_EXT 0x8A49 +#define GL_SKIP_DECODE_EXT 0x8A4A + +#define GLEW_EXT_texture_sRGB_decode GLEW_GET_VAR(__GLEW_EXT_texture_sRGB_decode) + +#endif /* GL_EXT_texture_sRGB_decode */ + /* --------------------- GL_EXT_texture_shared_exponent -------------------- */ #ifndef GL_EXT_texture_shared_exponent @@ -6871,6 +12605,89 @@ typedef void (GLAPIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); #endif /* GL_EXT_texture_shared_exponent */ +/* -------------------------- GL_EXT_texture_snorm ------------------------- */ + +#ifndef GL_EXT_texture_snorm +#define GL_EXT_texture_snorm 1 + +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_ALPHA_SNORM 0x9010 +#define GL_LUMINANCE_SNORM 0x9011 +#define GL_LUMINANCE_ALPHA_SNORM 0x9012 +#define GL_INTENSITY_SNORM 0x9013 +#define GL_ALPHA8_SNORM 0x9014 +#define GL_LUMINANCE8_SNORM 0x9015 +#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 +#define GL_INTENSITY8_SNORM 0x9017 +#define GL_ALPHA16_SNORM 0x9018 +#define GL_LUMINANCE16_SNORM 0x9019 +#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A +#define GL_INTENSITY16_SNORM 0x901B + +#define GLEW_EXT_texture_snorm GLEW_GET_VAR(__GLEW_EXT_texture_snorm) + +#endif /* GL_EXT_texture_snorm */ + +/* ------------------------- GL_EXT_texture_storage ------------------------ */ + +#ifndef GL_EXT_texture_storage +#define GL_EXT_texture_storage 1 + +#define GL_ALPHA8_EXT 0x803C +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_R8_EXT 0x8229 +#define GL_RG8_EXT 0x822B +#define GL_R16F_EXT 0x822D +#define GL_R32F_EXT 0x822E +#define GL_RG16F_EXT 0x822F +#define GL_RG32F_EXT 0x8230 +#define GL_RGBA32F_EXT 0x8814 +#define GL_RGB32F_EXT 0x8815 +#define GL_ALPHA32F_EXT 0x8816 +#define GL_LUMINANCE32F_EXT 0x8818 +#define GL_LUMINANCE_ALPHA32F_EXT 0x8819 +#define GL_RGBA16F_EXT 0x881A +#define GL_RGB16F_EXT 0x881B +#define GL_ALPHA16F_EXT 0x881C +#define GL_LUMINANCE16F_EXT 0x881E +#define GL_LUMINANCE_ALPHA16F_EXT 0x881F +#define GL_RGB_RAW_422_APPLE 0x8A51 +#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F +#define GL_BGRA8_EXT 0x93A1 + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); + +#define glTexStorage1DEXT GLEW_GET_FUN(__glewTexStorage1DEXT) +#define glTexStorage2DEXT GLEW_GET_FUN(__glewTexStorage2DEXT) +#define glTexStorage3DEXT GLEW_GET_FUN(__glewTexStorage3DEXT) +#define glTextureStorage1DEXT GLEW_GET_FUN(__glewTextureStorage1DEXT) +#define glTextureStorage2DEXT GLEW_GET_FUN(__glewTextureStorage2DEXT) +#define glTextureStorage3DEXT GLEW_GET_FUN(__glewTextureStorage3DEXT) + +#define GLEW_EXT_texture_storage GLEW_GET_VAR(__GLEW_EXT_texture_storage) + +#endif /* GL_EXT_texture_storage */ + /* ------------------------- GL_EXT_texture_swizzle ------------------------ */ #ifndef GL_EXT_texture_swizzle @@ -6886,6 +12703,36 @@ typedef void (GLAPIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); #endif /* GL_EXT_texture_swizzle */ +/* ------------------- GL_EXT_texture_type_2_10_10_10_REV ------------------ */ + +#ifndef GL_EXT_texture_type_2_10_10_10_REV +#define GL_EXT_texture_type_2_10_10_10_REV 1 + +#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368 + +#define GLEW_EXT_texture_type_2_10_10_10_REV GLEW_GET_VAR(__GLEW_EXT_texture_type_2_10_10_10_REV) + +#endif /* GL_EXT_texture_type_2_10_10_10_REV */ + +/* -------------------------- GL_EXT_texture_view -------------------------- */ + +#ifndef GL_EXT_texture_view +#define GL_EXT_texture_view 1 + +#define GL_TEXTURE_VIEW_MIN_LEVEL_EXT 0x82DB +#define GL_TEXTURE_VIEW_NUM_LEVELS_EXT 0x82DC +#define GL_TEXTURE_VIEW_MIN_LAYER_EXT 0x82DD +#define GL_TEXTURE_VIEW_NUM_LAYERS_EXT 0x82DE +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF + +typedef void (GLAPIENTRY * PFNGLTEXTUREVIEWEXTPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); + +#define glTextureViewEXT GLEW_GET_FUN(__glewTextureViewEXT) + +#define GLEW_EXT_texture_view GLEW_GET_VAR(__GLEW_EXT_texture_view) + +#endif /* GL_EXT_texture_view */ + /* --------------------------- GL_EXT_timer_query -------------------------- */ #ifndef GL_EXT_timer_query @@ -6929,8 +12776,8 @@ typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint in typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); -typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei *size, GLenum *type, char *name); -typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const char ** varyings, GLenum bufferMode); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar * const* varyings, GLenum bufferMode); #define glBeginTransformFeedbackEXT GLEW_GET_FUN(__glewBeginTransformFeedbackEXT) #define glBindBufferBaseEXT GLEW_GET_FUN(__glewBindBufferBaseEXT) @@ -6944,6 +12791,19 @@ typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint progra #endif /* GL_EXT_transform_feedback */ +/* ------------------------- GL_EXT_unpack_subimage ------------------------ */ + +#ifndef GL_EXT_unpack_subimage +#define GL_EXT_unpack_subimage 1 + +#define GL_UNPACK_ROW_LENGTH_EXT 0x0CF2 +#define GL_UNPACK_SKIP_ROWS_EXT 0x0CF3 +#define GL_UNPACK_SKIP_PIXELS_EXT 0x0CF4 + +#define GLEW_EXT_unpack_subimage GLEW_GET_VAR(__GLEW_EXT_unpack_subimage) + +#endif /* GL_EXT_unpack_subimage */ + /* -------------------------- GL_EXT_vertex_array -------------------------- */ #ifndef GL_EXT_vertex_array @@ -6984,20 +12844,18 @@ typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint progra #define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 typedef void (GLAPIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i); -typedef void (GLAPIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); +typedef void (GLAPIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); typedef void (GLAPIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean* pointer); -typedef void (GLAPIENTRY * PFNGLGETPOINTERVEXTPROC) (GLenum pname, void** params); -typedef void (GLAPIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void* pointer); -typedef void (GLAPIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void* pointer); -typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); -typedef void (GLAPIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); +typedef void (GLAPIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); #define glArrayElementEXT GLEW_GET_FUN(__glewArrayElementEXT) #define glColorPointerEXT GLEW_GET_FUN(__glewColorPointerEXT) #define glDrawArraysEXT GLEW_GET_FUN(__glewDrawArraysEXT) #define glEdgeFlagPointerEXT GLEW_GET_FUN(__glewEdgeFlagPointerEXT) -#define glGetPointervEXT GLEW_GET_FUN(__glewGetPointervEXT) #define glIndexPointerEXT GLEW_GET_FUN(__glewIndexPointerEXT) #define glNormalPointerEXT GLEW_GET_FUN(__glewNormalPointerEXT) #define glTexCoordPointerEXT GLEW_GET_FUN(__glewTexCoordPointerEXT) @@ -7018,6 +12876,69 @@ typedef void (GLAPIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, #endif /* GL_EXT_vertex_array_bgra */ +/* ----------------------- GL_EXT_vertex_array_setXXX ---------------------- */ + +#ifndef GL_EXT_vertex_array_setXXX +#define GL_EXT_vertex_array_setXXX 1 + +typedef void (GLAPIENTRY * PFNGLBINDARRAYSETEXTPROC) (const void *arrayset); +typedef const void * (GLAPIENTRY * PFNGLCREATEARRAYSETEXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLDELETEARRAYSETSEXTPROC) (GLsizei n, const void *arrayset[]); + +#define glBindArraySetEXT GLEW_GET_FUN(__glewBindArraySetEXT) +#define glCreateArraySetExt GLEW_GET_FUN(__glewCreateArraySetExt) +#define glDeleteArraySetsEXT GLEW_GET_FUN(__glewDeleteArraySetsEXT) + +#define GLEW_EXT_vertex_array_setXXX GLEW_GET_VAR(__GLEW_EXT_vertex_array_setXXX) + +#endif /* GL_EXT_vertex_array_setXXX */ + +/* ----------------------- GL_EXT_vertex_attrib_64bit ---------------------- */ + +#ifndef GL_EXT_vertex_attrib_64bit +#define GL_EXT_vertex_attrib_64bit 1 + +#define GL_DOUBLE_MAT2_EXT 0x8F46 +#define GL_DOUBLE_MAT3_EXT 0x8F47 +#define GL_DOUBLE_MAT4_EXT 0x8F48 +#define GL_DOUBLE_MAT2x3_EXT 0x8F49 +#define GL_DOUBLE_MAT2x4_EXT 0x8F4A +#define GL_DOUBLE_MAT3x2_EXT 0x8F4B +#define GL_DOUBLE_MAT3x4_EXT 0x8F4C +#define GL_DOUBLE_MAT4x2_EXT 0x8F4D +#define GL_DOUBLE_MAT4x3_EXT 0x8F4E +#define GL_DOUBLE_VEC2_EXT 0x8FFC +#define GL_DOUBLE_VEC3_EXT 0x8FFD +#define GL_DOUBLE_VEC4_EXT 0x8FFE + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); + +#define glGetVertexAttribLdvEXT GLEW_GET_FUN(__glewGetVertexAttribLdvEXT) +#define glVertexArrayVertexAttribLOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribLOffsetEXT) +#define glVertexAttribL1dEXT GLEW_GET_FUN(__glewVertexAttribL1dEXT) +#define glVertexAttribL1dvEXT GLEW_GET_FUN(__glewVertexAttribL1dvEXT) +#define glVertexAttribL2dEXT GLEW_GET_FUN(__glewVertexAttribL2dEXT) +#define glVertexAttribL2dvEXT GLEW_GET_FUN(__glewVertexAttribL2dvEXT) +#define glVertexAttribL3dEXT GLEW_GET_FUN(__glewVertexAttribL3dEXT) +#define glVertexAttribL3dvEXT GLEW_GET_FUN(__glewVertexAttribL3dvEXT) +#define glVertexAttribL4dEXT GLEW_GET_FUN(__glewVertexAttribL4dEXT) +#define glVertexAttribL4dvEXT GLEW_GET_FUN(__glewVertexAttribL4dvEXT) +#define glVertexAttribLPointerEXT GLEW_GET_FUN(__glewVertexAttribLPointerEXT) + +#define GLEW_EXT_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_EXT_vertex_attrib_64bit) + +#endif /* GL_EXT_vertex_attrib_64bit */ + /* -------------------------- GL_EXT_vertex_shader ------------------------- */ #ifndef GL_EXT_vertex_shader @@ -7157,16 +13078,16 @@ typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLe typedef void (GLAPIENTRY * PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); typedef void (GLAPIENTRY * PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); typedef void (GLAPIENTRY * PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (GLAPIENTRY * PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid **data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, void **data); typedef void (GLAPIENTRY * PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); typedef GLboolean (GLAPIENTRY * PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); -typedef void (GLAPIENTRY * PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr); -typedef void (GLAPIENTRY * PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, void *addr); +typedef void (GLAPIENTRY * PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, void *addr); typedef void (GLAPIENTRY * PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); typedef void (GLAPIENTRY * PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); typedef void (GLAPIENTRY * PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); typedef void (GLAPIENTRY * PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -typedef void (GLAPIENTRY * PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, void *addr); typedef void (GLAPIENTRY * PFNGLVARIANTBVEXTPROC) (GLuint id, GLbyte *addr); typedef void (GLAPIENTRY * PFNGLVARIANTDVEXTPROC) (GLuint id, GLdouble *addr); typedef void (GLAPIENTRY * PFNGLVARIANTFVEXTPROC) (GLuint id, GLfloat *addr); @@ -7243,7 +13164,7 @@ typedef void (GLAPIENTRY * PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum #define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F #define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 -typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, void* pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, void *pointer); typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (GLfloat* weight); @@ -7255,6 +13176,56 @@ typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (GLfloat* weight); #endif /* GL_EXT_vertex_weighting */ +/* ------------------------ GL_EXT_win32_keyed_mutex ----------------------- */ + +#ifndef GL_EXT_win32_keyed_mutex +#define GL_EXT_win32_keyed_mutex 1 + +typedef GLboolean (GLAPIENTRY * PFNGLACQUIREKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key, GLuint timeout); +typedef GLboolean (GLAPIENTRY * PFNGLRELEASEKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key); + +#define glAcquireKeyedMutexWin32EXT GLEW_GET_FUN(__glewAcquireKeyedMutexWin32EXT) +#define glReleaseKeyedMutexWin32EXT GLEW_GET_FUN(__glewReleaseKeyedMutexWin32EXT) + +#define GLEW_EXT_win32_keyed_mutex GLEW_GET_VAR(__GLEW_EXT_win32_keyed_mutex) + +#endif /* GL_EXT_win32_keyed_mutex */ + +/* ------------------------ GL_EXT_window_rectangles ----------------------- */ + +#ifndef GL_EXT_window_rectangles +#define GL_EXT_window_rectangles 1 + +#define GL_INCLUSIVE_EXT 0x8F10 +#define GL_EXCLUSIVE_EXT 0x8F11 +#define GL_WINDOW_RECTANGLE_EXT 0x8F12 +#define GL_WINDOW_RECTANGLE_MODE_EXT 0x8F13 +#define GL_MAX_WINDOW_RECTANGLES_EXT 0x8F14 +#define GL_NUM_WINDOW_RECTANGLES_EXT 0x8F15 + +typedef void (GLAPIENTRY * PFNGLWINDOWRECTANGLESEXTPROC) (GLenum mode, GLsizei count, const GLint box[]); + +#define glWindowRectanglesEXT GLEW_GET_FUN(__glewWindowRectanglesEXT) + +#define GLEW_EXT_window_rectangles GLEW_GET_VAR(__GLEW_EXT_window_rectangles) + +#endif /* GL_EXT_window_rectangles */ + +/* ------------------------- GL_EXT_x11_sync_object ------------------------ */ + +#ifndef GL_EXT_x11_sync_object +#define GL_EXT_x11_sync_object 1 + +#define GL_SYNC_X11_FENCE_EXT 0x90E1 + +typedef GLsync (GLAPIENTRY * PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); + +#define glImportSyncEXT GLEW_GET_FUN(__glewImportSyncEXT) + +#define GLEW_EXT_x11_sync_object GLEW_GET_VAR(__GLEW_EXT_x11_sync_object) + +#endif /* GL_EXT_x11_sync_object */ + /* ---------------------- GL_GREMEDY_frame_terminator ---------------------- */ #ifndef GL_GREMEDY_frame_terminator @@ -7273,7 +13244,7 @@ typedef void (GLAPIENTRY * PFNGLFRAMETERMINATORGREMEDYPROC) (void); #ifndef GL_GREMEDY_string_marker #define GL_GREMEDY_string_marker 1 -typedef void (GLAPIENTRY * PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const void* string); +typedef void (GLAPIENTRY * PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const void *string); #define glStringMarkerGREMEDY GLEW_GET_FUN(__glewStringMarkerGREMEDY) @@ -7318,9 +13289,6 @@ typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, #ifndef GL_HP_occlusion_test #define GL_HP_occlusion_test 1 -#define GL_OCCLUSION_TEST_HP 0x8165 -#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 - #define GLEW_HP_occlusion_test GLEW_GET_VAR(__GLEW_HP_occlusion_test) #endif /* GL_HP_occlusion_test */ @@ -7351,7 +13319,7 @@ typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, #define GL_IBM_multimode_draw_arrays 1 typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum* mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); -typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum* mode, const GLsizei *count, GLenum type, const GLvoid * const *indices, GLsizei primcount, GLint modestride); +typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum* mode, const GLsizei *count, GLenum type, const void *const *indices, GLsizei primcount, GLint modestride); #define glMultiModeDrawArraysIBM GLEW_GET_FUN(__glewMultiModeDrawArraysIBM) #define glMultiModeDrawElementsIBM GLEW_GET_FUN(__glewMultiModeDrawElementsIBM) @@ -7416,14 +13384,14 @@ typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum* mod #define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 #define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 -typedef void (GLAPIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean ** pointer, GLint ptrstride); -typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); -typedef void (GLAPIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); -typedef void (GLAPIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); -typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); -typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); #define glColorPointerListIBM GLEW_GET_FUN(__glewColorPointerListIBM) #define glEdgeFlagPointerListIBM GLEW_GET_FUN(__glewEdgeFlagPointerListIBM) @@ -7467,6 +13435,57 @@ typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum ty #endif /* GL_INGR_interlace_read */ +/* ------------------ GL_INTEL_conservative_rasterization ------------------ */ + +#ifndef GL_INTEL_conservative_rasterization +#define GL_INTEL_conservative_rasterization 1 + +#define GL_CONSERVATIVE_RASTERIZATION_INTEL 0x83FE + +#define GLEW_INTEL_conservative_rasterization GLEW_GET_VAR(__GLEW_INTEL_conservative_rasterization) + +#endif /* GL_INTEL_conservative_rasterization */ + +/* ------------------- GL_INTEL_fragment_shader_ordering ------------------- */ + +#ifndef GL_INTEL_fragment_shader_ordering +#define GL_INTEL_fragment_shader_ordering 1 + +#define GLEW_INTEL_fragment_shader_ordering GLEW_GET_VAR(__GLEW_INTEL_fragment_shader_ordering) + +#endif /* GL_INTEL_fragment_shader_ordering */ + +/* ----------------------- GL_INTEL_framebuffer_CMAA ----------------------- */ + +#ifndef GL_INTEL_framebuffer_CMAA +#define GL_INTEL_framebuffer_CMAA 1 + +#define GLEW_INTEL_framebuffer_CMAA GLEW_GET_VAR(__GLEW_INTEL_framebuffer_CMAA) + +#endif /* GL_INTEL_framebuffer_CMAA */ + +/* -------------------------- GL_INTEL_map_texture ------------------------- */ + +#ifndef GL_INTEL_map_texture +#define GL_INTEL_map_texture 1 + +#define GL_LAYOUT_DEFAULT_INTEL 0 +#define GL_LAYOUT_LINEAR_INTEL 1 +#define GL_LAYOUT_LINEAR_CPU_CACHED_INTEL 2 +#define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF + +typedef void * (GLAPIENTRY * PFNGLMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level, GLbitfield access, GLint* stride, GLenum *layout); +typedef void (GLAPIENTRY * PFNGLSYNCTEXTUREINTELPROC) (GLuint texture); +typedef void (GLAPIENTRY * PFNGLUNMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level); + +#define glMapTexture2DINTEL GLEW_GET_FUN(__glewMapTexture2DINTEL) +#define glSyncTextureINTEL GLEW_GET_FUN(__glewSyncTextureINTEL) +#define glUnmapTexture2DINTEL GLEW_GET_FUN(__glewUnmapTexture2DINTEL) + +#define GLEW_INTEL_map_texture GLEW_GET_VAR(__GLEW_INTEL_map_texture) + +#endif /* GL_INTEL_map_texture */ + /* ------------------------ GL_INTEL_parallel_arrays ----------------------- */ #ifndef GL_INTEL_parallel_arrays @@ -7492,6 +13511,58 @@ typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum typ #endif /* GL_INTEL_parallel_arrays */ +/* ----------------------- GL_INTEL_performance_query ---------------------- */ + +#ifndef GL_INTEL_performance_query +#define GL_INTEL_performance_query 1 + +#define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x0000 +#define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x0001 +#define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9 +#define GL_PERFQUERY_FLUSH_INTEL 0x83FA +#define GL_PERFQUERY_WAIT_INTEL 0x83FB +#define GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0 +#define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1 +#define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2 +#define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3 +#define GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4 +#define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5 +#define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8 +#define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9 +#define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA +#define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB +#define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC +#define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD +#define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE +#define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF +#define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500 + +typedef void (GLAPIENTRY * PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (GLAPIENTRY * PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint* queryHandle); +typedef void (GLAPIENTRY * PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (GLAPIENTRY * PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (GLAPIENTRY * PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint* queryId); +typedef void (GLAPIENTRY * PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint* nextQueryId); +typedef void (GLAPIENTRY * PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar* counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); +typedef void (GLAPIENTRY * PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten); +typedef void (GLAPIENTRY * PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar* queryName, GLuint *queryId); +typedef void (GLAPIENTRY * PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar* queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); + +#define glBeginPerfQueryINTEL GLEW_GET_FUN(__glewBeginPerfQueryINTEL) +#define glCreatePerfQueryINTEL GLEW_GET_FUN(__glewCreatePerfQueryINTEL) +#define glDeletePerfQueryINTEL GLEW_GET_FUN(__glewDeletePerfQueryINTEL) +#define glEndPerfQueryINTEL GLEW_GET_FUN(__glewEndPerfQueryINTEL) +#define glGetFirstPerfQueryIdINTEL GLEW_GET_FUN(__glewGetFirstPerfQueryIdINTEL) +#define glGetNextPerfQueryIdINTEL GLEW_GET_FUN(__glewGetNextPerfQueryIdINTEL) +#define glGetPerfCounterInfoINTEL GLEW_GET_FUN(__glewGetPerfCounterInfoINTEL) +#define glGetPerfQueryDataINTEL GLEW_GET_FUN(__glewGetPerfQueryDataINTEL) +#define glGetPerfQueryIdByNameINTEL GLEW_GET_FUN(__glewGetPerfQueryIdByNameINTEL) +#define glGetPerfQueryInfoINTEL GLEW_GET_FUN(__glewGetPerfQueryInfoINTEL) + +#define GLEW_INTEL_performance_query GLEW_GET_VAR(__GLEW_INTEL_performance_query) + +#endif /* GL_INTEL_performance_query */ + /* ------------------------ GL_INTEL_texture_scissor ----------------------- */ #ifndef GL_INTEL_texture_scissor @@ -7507,6 +13578,277 @@ typedef void (GLAPIENTRY * PFNGLTEXSCISSORINTELPROC) (GLenum target, GLclampf tl #endif /* GL_INTEL_texture_scissor */ +/* --------------------- GL_KHR_blend_equation_advanced -------------------- */ + +#ifndef GL_KHR_blend_equation_advanced +#define GL_KHR_blend_equation_advanced 1 + +#define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285 +#define GL_MULTIPLY_KHR 0x9294 +#define GL_SCREEN_KHR 0x9295 +#define GL_OVERLAY_KHR 0x9296 +#define GL_DARKEN_KHR 0x9297 +#define GL_LIGHTEN_KHR 0x9298 +#define GL_COLORDODGE_KHR 0x9299 +#define GL_COLORBURN_KHR 0x929A +#define GL_HARDLIGHT_KHR 0x929B +#define GL_SOFTLIGHT_KHR 0x929C +#define GL_DIFFERENCE_KHR 0x929E +#define GL_EXCLUSION_KHR 0x92A0 +#define GL_HSL_HUE_KHR 0x92AD +#define GL_HSL_SATURATION_KHR 0x92AE +#define GL_HSL_COLOR_KHR 0x92AF +#define GL_HSL_LUMINOSITY_KHR 0x92B0 + +typedef void (GLAPIENTRY * PFNGLBLENDBARRIERKHRPROC) (void); + +#define glBlendBarrierKHR GLEW_GET_FUN(__glewBlendBarrierKHR) + +#define GLEW_KHR_blend_equation_advanced GLEW_GET_VAR(__GLEW_KHR_blend_equation_advanced) + +#endif /* GL_KHR_blend_equation_advanced */ + +/* ---------------- GL_KHR_blend_equation_advanced_coherent ---------------- */ + +#ifndef GL_KHR_blend_equation_advanced_coherent +#define GL_KHR_blend_equation_advanced_coherent 1 + +#define GLEW_KHR_blend_equation_advanced_coherent GLEW_GET_VAR(__GLEW_KHR_blend_equation_advanced_coherent) + +#endif /* GL_KHR_blend_equation_advanced_coherent */ + +/* ---------------------- GL_KHR_context_flush_control --------------------- */ + +#ifndef GL_KHR_context_flush_control +#define GL_KHR_context_flush_control 1 + +#define GLEW_KHR_context_flush_control GLEW_GET_VAR(__GLEW_KHR_context_flush_control) + +#endif /* GL_KHR_context_flush_control */ + +/* ------------------------------ GL_KHR_debug ----------------------------- */ + +#ifndef GL_KHR_debug +#define GL_KHR_debug 1 + +#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245 +#define GL_DEBUG_SOURCE_API 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION 0x824A +#define GL_DEBUG_SOURCE_OTHER 0x824B +#define GL_DEBUG_TYPE_ERROR 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E +#define GL_DEBUG_TYPE_PORTABILITY 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 +#define GL_DEBUG_TYPE_OTHER 0x8251 +#define GL_DEBUG_TYPE_MARKER 0x8268 +#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 +#define GL_DEBUG_TYPE_POP_GROUP 0x826A +#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B +#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C +#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D +#define GL_BUFFER 0x82E0 +#define GL_SHADER 0x82E1 +#define GL_PROGRAM 0x82E2 +#define GL_QUERY 0x82E3 +#define GL_PROGRAM_PIPELINE 0x82E4 +#define GL_SAMPLER 0x82E6 +#define GL_DISPLAY_LIST 0x82E7 +#define GL_MAX_LABEL_LENGTH 0x82E8 +#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES 0x9145 +#define GL_DEBUG_SEVERITY_HIGH 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 +#define GL_DEBUG_SEVERITY_LOW 0x9148 +#define GL_DEBUG_OUTPUT 0x92E0 + +typedef void (GLAPIENTRY *GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); +typedef void (GLAPIENTRY * PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar *label); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPTRLABELPROC) (void* ptr, GLsizei bufSize, GLsizei* length, GLchar *label); +typedef void (GLAPIENTRY * PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar* label); +typedef void (GLAPIENTRY * PFNGLOBJECTPTRLABELPROC) (void* ptr, GLsizei length, const GLchar* label); +typedef void (GLAPIENTRY * PFNGLPOPDEBUGGROUPPROC) (void); +typedef void (GLAPIENTRY * PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar * message); + +#define glDebugMessageCallback GLEW_GET_FUN(__glewDebugMessageCallback) +#define glDebugMessageControl GLEW_GET_FUN(__glewDebugMessageControl) +#define glDebugMessageInsert GLEW_GET_FUN(__glewDebugMessageInsert) +#define glGetDebugMessageLog GLEW_GET_FUN(__glewGetDebugMessageLog) +#define glGetObjectLabel GLEW_GET_FUN(__glewGetObjectLabel) +#define glGetObjectPtrLabel GLEW_GET_FUN(__glewGetObjectPtrLabel) +#define glObjectLabel GLEW_GET_FUN(__glewObjectLabel) +#define glObjectPtrLabel GLEW_GET_FUN(__glewObjectPtrLabel) +#define glPopDebugGroup GLEW_GET_FUN(__glewPopDebugGroup) +#define glPushDebugGroup GLEW_GET_FUN(__glewPushDebugGroup) + +#define GLEW_KHR_debug GLEW_GET_VAR(__GLEW_KHR_debug) + +#endif /* GL_KHR_debug */ + +/* ---------------------------- GL_KHR_no_error ---------------------------- */ + +#ifndef GL_KHR_no_error +#define GL_KHR_no_error 1 + +#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 + +#define GLEW_KHR_no_error GLEW_GET_VAR(__GLEW_KHR_no_error) + +#endif /* GL_KHR_no_error */ + +/* --------------------- GL_KHR_parallel_shader_compile -------------------- */ + +#ifndef GL_KHR_parallel_shader_compile +#define GL_KHR_parallel_shader_compile 1 + +#define GL_MAX_SHADER_COMPILER_THREADS_KHR 0x91B0 +#define GL_COMPLETION_STATUS_KHR 0x91B1 + +typedef void (GLAPIENTRY * PFNGLMAXSHADERCOMPILERTHREADSKHRPROC) (GLuint count); + +#define glMaxShaderCompilerThreadsKHR GLEW_GET_FUN(__glewMaxShaderCompilerThreadsKHR) + +#define GLEW_KHR_parallel_shader_compile GLEW_GET_VAR(__GLEW_KHR_parallel_shader_compile) + +#endif /* GL_KHR_parallel_shader_compile */ + +/* ------------------ GL_KHR_robust_buffer_access_behavior ----------------- */ + +#ifndef GL_KHR_robust_buffer_access_behavior +#define GL_KHR_robust_buffer_access_behavior 1 + +#define GLEW_KHR_robust_buffer_access_behavior GLEW_GET_VAR(__GLEW_KHR_robust_buffer_access_behavior) + +#endif /* GL_KHR_robust_buffer_access_behavior */ + +/* --------------------------- GL_KHR_robustness --------------------------- */ + +#ifndef GL_KHR_robustness +#define GL_KHR_robustness 1 + +#define GL_CONTEXT_LOST 0x0507 +#define GL_LOSE_CONTEXT_ON_RESET 0x8252 +#define GL_GUILTY_CONTEXT_RESET 0x8253 +#define GL_INNOCENT_CONTEXT_RESET 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET 0x8255 +#define GL_RESET_NOTIFICATION_STRATEGY 0x8256 +#define GL_NO_RESET_NOTIFICATION 0x8261 +#define GL_CONTEXT_ROBUST_ACCESS 0x90F3 + +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMFVPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint* params); +typedef void (GLAPIENTRY * PFNGLREADNPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); + +#define glGetnUniformfv GLEW_GET_FUN(__glewGetnUniformfv) +#define glGetnUniformiv GLEW_GET_FUN(__glewGetnUniformiv) +#define glGetnUniformuiv GLEW_GET_FUN(__glewGetnUniformuiv) +#define glReadnPixels GLEW_GET_FUN(__glewReadnPixels) + +#define GLEW_KHR_robustness GLEW_GET_VAR(__GLEW_KHR_robustness) + +#endif /* GL_KHR_robustness */ + +/* ------------------ GL_KHR_texture_compression_astc_hdr ------------------ */ + +#ifndef GL_KHR_texture_compression_astc_hdr +#define GL_KHR_texture_compression_astc_hdr 1 + +#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 +#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 +#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 +#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 +#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 +#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 +#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 +#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 +#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 +#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 +#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA +#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB +#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC +#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD + +#define GLEW_KHR_texture_compression_astc_hdr GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_hdr) + +#endif /* GL_KHR_texture_compression_astc_hdr */ + +/* ------------------ GL_KHR_texture_compression_astc_ldr ------------------ */ + +#ifndef GL_KHR_texture_compression_astc_ldr +#define GL_KHR_texture_compression_astc_ldr 1 + +#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 +#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 +#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 +#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 +#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 +#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 +#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 +#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 +#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 +#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 +#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA +#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB +#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC +#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD + +#define GLEW_KHR_texture_compression_astc_ldr GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_ldr) + +#endif /* GL_KHR_texture_compression_astc_ldr */ + +/* --------------- GL_KHR_texture_compression_astc_sliced_3d --------------- */ + +#ifndef GL_KHR_texture_compression_astc_sliced_3d +#define GL_KHR_texture_compression_astc_sliced_3d 1 + +#define GLEW_KHR_texture_compression_astc_sliced_3d GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_sliced_3d) + +#endif /* GL_KHR_texture_compression_astc_sliced_3d */ + /* -------------------------- GL_KTX_buffer_region ------------------------- */ #ifndef GL_KTX_buffer_region @@ -7517,17 +13859,17 @@ typedef void (GLAPIENTRY * PFNGLTEXSCISSORINTELPROC) (GLenum target, GLclampf tl #define GL_KTX_Z_REGION 0x2 #define GL_KTX_STENCIL_REGION 0x3 -typedef GLuint (GLAPIENTRY * PFNGLBUFFERREGIONENABLEDEXTPROC) (void); -typedef void (GLAPIENTRY * PFNGLDELETEBUFFERREGIONEXTPROC) (GLenum region); -typedef void (GLAPIENTRY * PFNGLDRAWBUFFERREGIONEXTPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest); -typedef GLuint (GLAPIENTRY * PFNGLNEWBUFFERREGIONEXTPROC) (GLenum region); -typedef void (GLAPIENTRY * PFNGLREADBUFFERREGIONEXTPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height); +typedef GLuint (GLAPIENTRY * PFNGLBUFFERREGIONENABLEDPROC) (void); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERREGIONPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest); +typedef GLuint (GLAPIENTRY * PFNGLNEWBUFFERREGIONPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLREADBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height); -#define glBufferRegionEnabledEXT GLEW_GET_FUN(__glewBufferRegionEnabledEXT) -#define glDeleteBufferRegionEXT GLEW_GET_FUN(__glewDeleteBufferRegionEXT) -#define glDrawBufferRegionEXT GLEW_GET_FUN(__glewDrawBufferRegionEXT) -#define glNewBufferRegionEXT GLEW_GET_FUN(__glewNewBufferRegionEXT) -#define glReadBufferRegionEXT GLEW_GET_FUN(__glewReadBufferRegionEXT) +#define glBufferRegionEnabled GLEW_GET_FUN(__glewBufferRegionEnabled) +#define glDeleteBufferRegion GLEW_GET_FUN(__glewDeleteBufferRegion) +#define glDrawBufferRegion GLEW_GET_FUN(__glewDrawBufferRegion) +#define glNewBufferRegion GLEW_GET_FUN(__glewNewBufferRegion) +#define glReadBufferRegion GLEW_GET_FUN(__glewReadBufferRegion) #define GLEW_KTX_buffer_region GLEW_GET_VAR(__GLEW_KTX_buffer_region) @@ -7573,6 +13915,15 @@ typedef void (GLAPIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void); #endif /* GL_MESA_resize_buffers */ +/* -------------------- GL_MESA_shader_integer_functions ------------------- */ + +#ifndef GL_MESA_shader_integer_functions +#define GL_MESA_shader_integer_functions 1 + +#define GLEW_MESA_shader_integer_functions GLEW_GET_VAR(__GLEW_MESA_shader_integer_functions) + +#endif /* GL_MESA_shader_integer_functions */ + /* --------------------------- GL_MESA_window_pos -------------------------- */ #ifndef GL_MESA_window_pos @@ -7645,6 +13996,281 @@ typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort* p); #endif /* GL_MESA_ycbcr_texture */ +/* ----------- GL_NVX_blend_equation_advanced_multi_draw_buffers ----------- */ + +#ifndef GL_NVX_blend_equation_advanced_multi_draw_buffers +#define GL_NVX_blend_equation_advanced_multi_draw_buffers 1 + +#define GLEW_NVX_blend_equation_advanced_multi_draw_buffers GLEW_GET_VAR(__GLEW_NVX_blend_equation_advanced_multi_draw_buffers) + +#endif /* GL_NVX_blend_equation_advanced_multi_draw_buffers */ + +/* ----------------------- GL_NVX_conditional_render ----------------------- */ + +#ifndef GL_NVX_conditional_render +#define GL_NVX_conditional_render 1 + +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVXPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVXPROC) (void); + +#define glBeginConditionalRenderNVX GLEW_GET_FUN(__glewBeginConditionalRenderNVX) +#define glEndConditionalRenderNVX GLEW_GET_FUN(__glewEndConditionalRenderNVX) + +#define GLEW_NVX_conditional_render GLEW_GET_VAR(__GLEW_NVX_conditional_render) + +#endif /* GL_NVX_conditional_render */ + +/* ------------------------- GL_NVX_gpu_memory_info ------------------------ */ + +#ifndef GL_NVX_gpu_memory_info +#define GL_NVX_gpu_memory_info 1 + +#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 +#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 +#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 +#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A +#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B + +#define GLEW_NVX_gpu_memory_info GLEW_GET_VAR(__GLEW_NVX_gpu_memory_info) + +#endif /* GL_NVX_gpu_memory_info */ + +/* ---------------------- GL_NVX_linked_gpu_multicast ---------------------- */ + +#ifndef GL_NVX_linked_gpu_multicast +#define GL_NVX_linked_gpu_multicast 1 + +#define GL_LGPU_SEPARATE_STORAGE_BIT_NVX 0x0800 +#define GL_MAX_LGPU_GPUS_NVX 0x92BA + +typedef void (GLAPIENTRY * PFNGLLGPUCOPYIMAGESUBDATANVXPROC) (GLuint sourceGpu, GLbitfield destinationGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GLAPIENTRY * PFNGLLGPUINTERLOCKNVXPROC) (void); +typedef void (GLAPIENTRY * PFNGLLGPUNAMEDBUFFERSUBDATANVXPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); + +#define glLGPUCopyImageSubDataNVX GLEW_GET_FUN(__glewLGPUCopyImageSubDataNVX) +#define glLGPUInterlockNVX GLEW_GET_FUN(__glewLGPUInterlockNVX) +#define glLGPUNamedBufferSubDataNVX GLEW_GET_FUN(__glewLGPUNamedBufferSubDataNVX) + +#define GLEW_NVX_linked_gpu_multicast GLEW_GET_VAR(__GLEW_NVX_linked_gpu_multicast) + +#endif /* GL_NVX_linked_gpu_multicast */ + +/* ------------------------ GL_NV_3dvision_settings ------------------------ */ + +#ifndef GL_NV_3dvision_settings +#define GL_NV_3dvision_settings 1 + +#define GL_3DVISION_STEREO_NV 0x90F4 +#define GL_STEREO_SEPARATION_NV 0x90F5 +#define GL_STEREO_CONVERGENCE_NV 0x90F6 +#define GL_STEREO_CUTOFF_NV 0x90F7 +#define GL_STEREO_PROJECTION_NV 0x90F8 +#define GL_STEREO_PROJECTION_PERSPECTIVE_NV 0x90F9 +#define GL_STEREO_PROJECTION_ORTHO_NV 0x90FA + +typedef void (GLAPIENTRY * PFNGLSTEREOPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLSTEREOPARAMETERINVPROC) (GLenum pname, GLint param); + +#define glStereoParameterfNV GLEW_GET_FUN(__glewStereoParameterfNV) +#define glStereoParameteriNV GLEW_GET_FUN(__glewStereoParameteriNV) + +#define GLEW_NV_3dvision_settings GLEW_GET_VAR(__GLEW_NV_3dvision_settings) + +#endif /* GL_NV_3dvision_settings */ + +/* ------------------- GL_NV_EGL_stream_consumer_external ------------------ */ + +#ifndef GL_NV_EGL_stream_consumer_external +#define GL_NV_EGL_stream_consumer_external 1 + +#define GL_TEXTURE_EXTERNAL_OES 0x8D65 +#define GL_SAMPLER_EXTERNAL_OES 0x8D66 +#define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67 +#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68 + +#define GLEW_NV_EGL_stream_consumer_external GLEW_GET_VAR(__GLEW_NV_EGL_stream_consumer_external) + +#endif /* GL_NV_EGL_stream_consumer_external */ + +/* ----------------- GL_NV_alpha_to_coverage_dither_control ---------------- */ + +#ifndef GL_NV_alpha_to_coverage_dither_control +#define GL_NV_alpha_to_coverage_dither_control 1 + +#define GL_ALPHA_TO_COVERAGE_DITHER_MODE_NV 0x92BF +#define GL_ALPHA_TO_COVERAGE_DITHER_DEFAULT_NV 0x934D +#define GL_ALPHA_TO_COVERAGE_DITHER_ENABLE_NV 0x934E +#define GL_ALPHA_TO_COVERAGE_DITHER_DISABLE_NV 0x934F + +#define GLEW_NV_alpha_to_coverage_dither_control GLEW_GET_VAR(__GLEW_NV_alpha_to_coverage_dither_control) + +#endif /* GL_NV_alpha_to_coverage_dither_control */ + +/* ------------------------------- GL_NV_bgr ------------------------------- */ + +#ifndef GL_NV_bgr +#define GL_NV_bgr 1 + +#define GL_BGR_NV 0x80E0 + +#define GLEW_NV_bgr GLEW_GET_VAR(__GLEW_NV_bgr) + +#endif /* GL_NV_bgr */ + +/* ------------------- GL_NV_bindless_multi_draw_indirect ------------------ */ + +#ifndef GL_NV_bindless_multi_draw_indirect +#define GL_NV_bindless_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); + +#define glMultiDrawArraysIndirectBindlessNV GLEW_GET_FUN(__glewMultiDrawArraysIndirectBindlessNV) +#define glMultiDrawElementsIndirectBindlessNV GLEW_GET_FUN(__glewMultiDrawElementsIndirectBindlessNV) + +#define GLEW_NV_bindless_multi_draw_indirect GLEW_GET_VAR(__GLEW_NV_bindless_multi_draw_indirect) + +#endif /* GL_NV_bindless_multi_draw_indirect */ + +/* ---------------- GL_NV_bindless_multi_draw_indirect_count --------------- */ + +#ifndef GL_NV_bindless_multi_draw_indirect_count +#define GL_NV_bindless_multi_draw_indirect_count 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, const void *indirect, GLintptr drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, GLenum type, const void *indirect, GLintptr drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); + +#define glMultiDrawArraysIndirectBindlessCountNV GLEW_GET_FUN(__glewMultiDrawArraysIndirectBindlessCountNV) +#define glMultiDrawElementsIndirectBindlessCountNV GLEW_GET_FUN(__glewMultiDrawElementsIndirectBindlessCountNV) + +#define GLEW_NV_bindless_multi_draw_indirect_count GLEW_GET_VAR(__GLEW_NV_bindless_multi_draw_indirect_count) + +#endif /* GL_NV_bindless_multi_draw_indirect_count */ + +/* ------------------------- GL_NV_bindless_texture ------------------------ */ + +#ifndef GL_NV_bindless_texture +#define GL_NV_bindless_texture 1 + +typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); +typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64* value); + +#define glGetImageHandleNV GLEW_GET_FUN(__glewGetImageHandleNV) +#define glGetTextureHandleNV GLEW_GET_FUN(__glewGetTextureHandleNV) +#define glGetTextureSamplerHandleNV GLEW_GET_FUN(__glewGetTextureSamplerHandleNV) +#define glIsImageHandleResidentNV GLEW_GET_FUN(__glewIsImageHandleResidentNV) +#define glIsTextureHandleResidentNV GLEW_GET_FUN(__glewIsTextureHandleResidentNV) +#define glMakeImageHandleNonResidentNV GLEW_GET_FUN(__glewMakeImageHandleNonResidentNV) +#define glMakeImageHandleResidentNV GLEW_GET_FUN(__glewMakeImageHandleResidentNV) +#define glMakeTextureHandleNonResidentNV GLEW_GET_FUN(__glewMakeTextureHandleNonResidentNV) +#define glMakeTextureHandleResidentNV GLEW_GET_FUN(__glewMakeTextureHandleResidentNV) +#define glProgramUniformHandleui64NV GLEW_GET_FUN(__glewProgramUniformHandleui64NV) +#define glProgramUniformHandleui64vNV GLEW_GET_FUN(__glewProgramUniformHandleui64vNV) +#define glUniformHandleui64NV GLEW_GET_FUN(__glewUniformHandleui64NV) +#define glUniformHandleui64vNV GLEW_GET_FUN(__glewUniformHandleui64vNV) + +#define GLEW_NV_bindless_texture GLEW_GET_VAR(__GLEW_NV_bindless_texture) + +#endif /* GL_NV_bindless_texture */ + +/* --------------------- GL_NV_blend_equation_advanced --------------------- */ + +#ifndef GL_NV_blend_equation_advanced +#define GL_NV_blend_equation_advanced 1 + +#define GL_XOR_NV 0x1506 +#define GL_RED_NV 0x1903 +#define GL_GREEN_NV 0x1904 +#define GL_BLUE_NV 0x1905 +#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 +#define GL_BLEND_OVERLAP_NV 0x9281 +#define GL_UNCORRELATED_NV 0x9282 +#define GL_DISJOINT_NV 0x9283 +#define GL_CONJOINT_NV 0x9284 +#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 +#define GL_SRC_NV 0x9286 +#define GL_DST_NV 0x9287 +#define GL_SRC_OVER_NV 0x9288 +#define GL_DST_OVER_NV 0x9289 +#define GL_SRC_IN_NV 0x928A +#define GL_DST_IN_NV 0x928B +#define GL_SRC_OUT_NV 0x928C +#define GL_DST_OUT_NV 0x928D +#define GL_SRC_ATOP_NV 0x928E +#define GL_DST_ATOP_NV 0x928F +#define GL_PLUS_NV 0x9291 +#define GL_PLUS_DARKER_NV 0x9292 +#define GL_MULTIPLY_NV 0x9294 +#define GL_SCREEN_NV 0x9295 +#define GL_OVERLAY_NV 0x9296 +#define GL_DARKEN_NV 0x9297 +#define GL_LIGHTEN_NV 0x9298 +#define GL_COLORDODGE_NV 0x9299 +#define GL_COLORBURN_NV 0x929A +#define GL_HARDLIGHT_NV 0x929B +#define GL_SOFTLIGHT_NV 0x929C +#define GL_DIFFERENCE_NV 0x929E +#define GL_MINUS_NV 0x929F +#define GL_EXCLUSION_NV 0x92A0 +#define GL_CONTRAST_NV 0x92A1 +#define GL_INVERT_RGB_NV 0x92A3 +#define GL_LINEARDODGE_NV 0x92A4 +#define GL_LINEARBURN_NV 0x92A5 +#define GL_VIVIDLIGHT_NV 0x92A6 +#define GL_LINEARLIGHT_NV 0x92A7 +#define GL_PINLIGHT_NV 0x92A8 +#define GL_HARDMIX_NV 0x92A9 +#define GL_HSL_HUE_NV 0x92AD +#define GL_HSL_SATURATION_NV 0x92AE +#define GL_HSL_COLOR_NV 0x92AF +#define GL_HSL_LUMINOSITY_NV 0x92B0 +#define GL_PLUS_CLAMPED_NV 0x92B1 +#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2 +#define GL_MINUS_CLAMPED_NV 0x92B3 +#define GL_INVERT_OVG_NV 0x92B4 + +typedef void (GLAPIENTRY * PFNGLBLENDBARRIERNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value); + +#define glBlendBarrierNV GLEW_GET_FUN(__glewBlendBarrierNV) +#define glBlendParameteriNV GLEW_GET_FUN(__glewBlendParameteriNV) + +#define GLEW_NV_blend_equation_advanced GLEW_GET_VAR(__GLEW_NV_blend_equation_advanced) + +#endif /* GL_NV_blend_equation_advanced */ + +/* ----------------- GL_NV_blend_equation_advanced_coherent ---------------- */ + +#ifndef GL_NV_blend_equation_advanced_coherent +#define GL_NV_blend_equation_advanced_coherent 1 + +#define GLEW_NV_blend_equation_advanced_coherent GLEW_GET_VAR(__GLEW_NV_blend_equation_advanced_coherent) + +#endif /* GL_NV_blend_equation_advanced_coherent */ + +/* ----------------------- GL_NV_blend_minmax_factor ----------------------- */ + +#ifndef GL_NV_blend_minmax_factor +#define GL_NV_blend_minmax_factor 1 + +#define GL_FACTOR_MIN_AMD 0x901C +#define GL_FACTOR_MAX_AMD 0x901D + +#define GLEW_NV_blend_minmax_factor GLEW_GET_VAR(__GLEW_NV_blend_minmax_factor) + +#endif /* GL_NV_blend_minmax_factor */ + /* --------------------------- GL_NV_blend_square -------------------------- */ #ifndef GL_NV_blend_square @@ -7654,6 +14280,100 @@ typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort* p); #endif /* GL_NV_blend_square */ +/* ----------------------- GL_NV_clip_space_w_scaling ---------------------- */ + +#ifndef GL_NV_clip_space_w_scaling +#define GL_NV_clip_space_w_scaling 1 + +#define GL_VIEWPORT_POSITION_W_SCALE_NV 0x937C +#define GL_VIEWPORT_POSITION_W_SCALE_X_COEFF_NV 0x937D +#define GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV 0x937E + +typedef void (GLAPIENTRY * PFNGLVIEWPORTPOSITIONWSCALENVPROC) (GLuint index, GLfloat xcoeff, GLfloat ycoeff); + +#define glViewportPositionWScaleNV GLEW_GET_FUN(__glewViewportPositionWScaleNV) + +#define GLEW_NV_clip_space_w_scaling GLEW_GET_VAR(__GLEW_NV_clip_space_w_scaling) + +#endif /* GL_NV_clip_space_w_scaling */ + +/* --------------------------- GL_NV_command_list -------------------------- */ + +#ifndef GL_NV_command_list +#define GL_NV_command_list 1 + +#define GL_TERMINATE_SEQUENCE_COMMAND_NV 0x0000 +#define GL_NOP_COMMAND_NV 0x0001 +#define GL_DRAW_ELEMENTS_COMMAND_NV 0x0002 +#define GL_DRAW_ARRAYS_COMMAND_NV 0x0003 +#define GL_DRAW_ELEMENTS_STRIP_COMMAND_NV 0x0004 +#define GL_DRAW_ARRAYS_STRIP_COMMAND_NV 0x0005 +#define GL_DRAW_ELEMENTS_INSTANCED_COMMAND_NV 0x0006 +#define GL_DRAW_ARRAYS_INSTANCED_COMMAND_NV 0x0007 +#define GL_ELEMENT_ADDRESS_COMMAND_NV 0x0008 +#define GL_ATTRIBUTE_ADDRESS_COMMAND_NV 0x0009 +#define GL_UNIFORM_ADDRESS_COMMAND_NV 0x000a +#define GL_BLEND_COLOR_COMMAND_NV 0x000b +#define GL_STENCIL_REF_COMMAND_NV 0x000c +#define GL_LINE_WIDTH_COMMAND_NV 0x000d +#define GL_POLYGON_OFFSET_COMMAND_NV 0x000e +#define GL_ALPHA_REF_COMMAND_NV 0x000f +#define GL_VIEWPORT_COMMAND_NV 0x0010 +#define GL_SCISSOR_COMMAND_NV 0x0011 +#define GL_FRONT_FACE_COMMAND_NV 0x0012 + +typedef void (GLAPIENTRY * PFNGLCALLCOMMANDLISTNVPROC) (GLuint list); +typedef void (GLAPIENTRY * PFNGLCOMMANDLISTSEGMENTSNVPROC) (GLuint list, GLuint segments); +typedef void (GLAPIENTRY * PFNGLCOMPILECOMMANDLISTNVPROC) (GLuint list); +typedef void (GLAPIENTRY * PFNGLCREATECOMMANDLISTSNVPROC) (GLsizei n, GLuint* lists); +typedef void (GLAPIENTRY * PFNGLCREATESTATESNVPROC) (GLsizei n, GLuint* states); +typedef void (GLAPIENTRY * PFNGLDELETECOMMANDLISTSNVPROC) (GLsizei n, const GLuint* lists); +typedef void (GLAPIENTRY * PFNGLDELETESTATESNVPROC) (GLsizei n, const GLuint* states); +typedef void (GLAPIENTRY * PFNGLDRAWCOMMANDSADDRESSNVPROC) (GLenum primitiveMode, const GLuint64* indirects, const GLsizei* sizes, GLuint count); +typedef void (GLAPIENTRY * PFNGLDRAWCOMMANDSNVPROC) (GLenum primitiveMode, GLuint buffer, const GLintptr* indirects, const GLsizei* sizes, GLuint count); +typedef void (GLAPIENTRY * PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC) (const GLuint64* indirects, const GLsizei* sizes, const GLuint* states, const GLuint* fbos, GLuint count); +typedef void (GLAPIENTRY * PFNGLDRAWCOMMANDSSTATESNVPROC) (GLuint buffer, const GLintptr* indirects, const GLsizei* sizes, const GLuint* states, const GLuint* fbos, GLuint count); +typedef GLuint (GLAPIENTRY * PFNGLGETCOMMANDHEADERNVPROC) (GLenum tokenID, GLuint size); +typedef GLushort (GLAPIENTRY * PFNGLGETSTAGEINDEXNVPROC) (GLenum shadertype); +typedef GLboolean (GLAPIENTRY * PFNGLISCOMMANDLISTNVPROC) (GLuint list); +typedef GLboolean (GLAPIENTRY * PFNGLISSTATENVPROC) (GLuint state); +typedef void (GLAPIENTRY * PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC) (GLuint list, GLuint segment, const void** indirects, const GLsizei* sizes, const GLuint* states, const GLuint* fbos, GLuint count); +typedef void (GLAPIENTRY * PFNGLSTATECAPTURENVPROC) (GLuint state, GLenum mode); + +#define glCallCommandListNV GLEW_GET_FUN(__glewCallCommandListNV) +#define glCommandListSegmentsNV GLEW_GET_FUN(__glewCommandListSegmentsNV) +#define glCompileCommandListNV GLEW_GET_FUN(__glewCompileCommandListNV) +#define glCreateCommandListsNV GLEW_GET_FUN(__glewCreateCommandListsNV) +#define glCreateStatesNV GLEW_GET_FUN(__glewCreateStatesNV) +#define glDeleteCommandListsNV GLEW_GET_FUN(__glewDeleteCommandListsNV) +#define glDeleteStatesNV GLEW_GET_FUN(__glewDeleteStatesNV) +#define glDrawCommandsAddressNV GLEW_GET_FUN(__glewDrawCommandsAddressNV) +#define glDrawCommandsNV GLEW_GET_FUN(__glewDrawCommandsNV) +#define glDrawCommandsStatesAddressNV GLEW_GET_FUN(__glewDrawCommandsStatesAddressNV) +#define glDrawCommandsStatesNV GLEW_GET_FUN(__glewDrawCommandsStatesNV) +#define glGetCommandHeaderNV GLEW_GET_FUN(__glewGetCommandHeaderNV) +#define glGetStageIndexNV GLEW_GET_FUN(__glewGetStageIndexNV) +#define glIsCommandListNV GLEW_GET_FUN(__glewIsCommandListNV) +#define glIsStateNV GLEW_GET_FUN(__glewIsStateNV) +#define glListDrawCommandsStatesClientNV GLEW_GET_FUN(__glewListDrawCommandsStatesClientNV) +#define glStateCaptureNV GLEW_GET_FUN(__glewStateCaptureNV) + +#define GLEW_NV_command_list GLEW_GET_VAR(__GLEW_NV_command_list) + +#endif /* GL_NV_command_list */ + +/* ------------------------- GL_NV_compute_program5 ------------------------ */ + +#ifndef GL_NV_compute_program5 +#define GL_NV_compute_program5 1 + +#define GL_COMPUTE_PROGRAM_NV 0x90FB +#define GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV 0x90FC + +#define GLEW_NV_compute_program5 GLEW_GET_VAR(__GLEW_NV_compute_program5) + +#endif /* GL_NV_compute_program5 */ + /* ------------------------ GL_NV_conditional_render ----------------------- */ #ifndef GL_NV_conditional_render @@ -7674,6 +14394,74 @@ typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVPROC) (void); #endif /* GL_NV_conditional_render */ +/* ----------------------- GL_NV_conservative_raster ----------------------- */ + +#ifndef GL_NV_conservative_raster +#define GL_NV_conservative_raster 1 + +#define GL_CONSERVATIVE_RASTERIZATION_NV 0x9346 +#define GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV 0x9347 +#define GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV 0x9348 +#define GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV 0x9349 + +typedef void (GLAPIENTRY * PFNGLSUBPIXELPRECISIONBIASNVPROC) (GLuint xbits, GLuint ybits); + +#define glSubpixelPrecisionBiasNV GLEW_GET_FUN(__glewSubpixelPrecisionBiasNV) + +#define GLEW_NV_conservative_raster GLEW_GET_VAR(__GLEW_NV_conservative_raster) + +#endif /* GL_NV_conservative_raster */ + +/* -------------------- GL_NV_conservative_raster_dilate ------------------- */ + +#ifndef GL_NV_conservative_raster_dilate +#define GL_NV_conservative_raster_dilate 1 + +#define GL_CONSERVATIVE_RASTER_DILATE_NV 0x9379 +#define GL_CONSERVATIVE_RASTER_DILATE_RANGE_NV 0x937A +#define GL_CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV 0x937B + +typedef void (GLAPIENTRY * PFNGLCONSERVATIVERASTERPARAMETERFNVPROC) (GLenum pname, GLfloat value); + +#define glConservativeRasterParameterfNV GLEW_GET_FUN(__glewConservativeRasterParameterfNV) + +#define GLEW_NV_conservative_raster_dilate GLEW_GET_VAR(__GLEW_NV_conservative_raster_dilate) + +#endif /* GL_NV_conservative_raster_dilate */ + +/* -------------- GL_NV_conservative_raster_pre_snap_triangles ------------- */ + +#ifndef GL_NV_conservative_raster_pre_snap_triangles +#define GL_NV_conservative_raster_pre_snap_triangles 1 + +#define GL_CONSERVATIVE_RASTER_MODE_NV 0x954D +#define GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV 0x954E +#define GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV 0x954F + +typedef void (GLAPIENTRY * PFNGLCONSERVATIVERASTERPARAMETERINVPROC) (GLenum pname, GLint param); + +#define glConservativeRasterParameteriNV GLEW_GET_FUN(__glewConservativeRasterParameteriNV) + +#define GLEW_NV_conservative_raster_pre_snap_triangles GLEW_GET_VAR(__GLEW_NV_conservative_raster_pre_snap_triangles) + +#endif /* GL_NV_conservative_raster_pre_snap_triangles */ + +/* --------------------------- GL_NV_copy_buffer --------------------------- */ + +#ifndef GL_NV_copy_buffer +#define GL_NV_copy_buffer 1 + +#define GL_COPY_READ_BUFFER_NV 0x8F36 +#define GL_COPY_WRITE_BUFFER_NV 0x8F37 + +typedef void (GLAPIENTRY * PFNGLCOPYBUFFERSUBDATANVPROC) (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size); + +#define glCopyBufferSubDataNV GLEW_GET_FUN(__glewCopyBufferSubDataNV) + +#define GLEW_NV_copy_buffer GLEW_GET_VAR(__GLEW_NV_copy_buffer) + +#endif /* GL_NV_copy_buffer */ + /* ----------------------- GL_NV_copy_depth_to_color ----------------------- */ #ifndef GL_NV_copy_depth_to_color @@ -7686,6 +14474,31 @@ typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVPROC) (void); #endif /* GL_NV_copy_depth_to_color */ +/* ---------------------------- GL_NV_copy_image --------------------------- */ + +#ifndef GL_NV_copy_image +#define GL_NV_copy_image 1 + +typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); + +#define glCopyImageSubDataNV GLEW_GET_FUN(__glewCopyImageSubDataNV) + +#define GLEW_NV_copy_image GLEW_GET_VAR(__GLEW_NV_copy_image) + +#endif /* GL_NV_copy_image */ + +/* -------------------------- GL_NV_deep_texture3D ------------------------- */ + +#ifndef GL_NV_deep_texture3D +#define GL_NV_deep_texture3D 1 + +#define GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV 0x90D0 +#define GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV 0x90D1 + +#define GLEW_NV_deep_texture3D GLEW_GET_VAR(__GLEW_NV_deep_texture3D) + +#endif /* GL_NV_deep_texture3D */ + /* ------------------------ GL_NV_depth_buffer_float ----------------------- */ #ifndef GL_NV_depth_buffer_float @@ -7734,6 +14547,104 @@ typedef void (GLAPIENTRY * PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFa #endif /* GL_NV_depth_range_unclamped */ +/* --------------------------- GL_NV_draw_buffers -------------------------- */ + +#ifndef GL_NV_draw_buffers +#define GL_NV_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_NV 0x8824 +#define GL_DRAW_BUFFER0_NV 0x8825 +#define GL_DRAW_BUFFER1_NV 0x8826 +#define GL_DRAW_BUFFER2_NV 0x8827 +#define GL_DRAW_BUFFER3_NV 0x8828 +#define GL_DRAW_BUFFER4_NV 0x8829 +#define GL_DRAW_BUFFER5_NV 0x882A +#define GL_DRAW_BUFFER6_NV 0x882B +#define GL_DRAW_BUFFER7_NV 0x882C +#define GL_DRAW_BUFFER8_NV 0x882D +#define GL_DRAW_BUFFER9_NV 0x882E +#define GL_DRAW_BUFFER10_NV 0x882F +#define GL_DRAW_BUFFER11_NV 0x8830 +#define GL_DRAW_BUFFER12_NV 0x8831 +#define GL_DRAW_BUFFER13_NV 0x8832 +#define GL_DRAW_BUFFER14_NV 0x8833 +#define GL_DRAW_BUFFER15_NV 0x8834 +#define GL_COLOR_ATTACHMENT0_NV 0x8CE0 +#define GL_COLOR_ATTACHMENT1_NV 0x8CE1 +#define GL_COLOR_ATTACHMENT2_NV 0x8CE2 +#define GL_COLOR_ATTACHMENT3_NV 0x8CE3 +#define GL_COLOR_ATTACHMENT4_NV 0x8CE4 +#define GL_COLOR_ATTACHMENT5_NV 0x8CE5 +#define GL_COLOR_ATTACHMENT6_NV 0x8CE6 +#define GL_COLOR_ATTACHMENT7_NV 0x8CE7 +#define GL_COLOR_ATTACHMENT8_NV 0x8CE8 +#define GL_COLOR_ATTACHMENT9_NV 0x8CE9 +#define GL_COLOR_ATTACHMENT10_NV 0x8CEA +#define GL_COLOR_ATTACHMENT11_NV 0x8CEB +#define GL_COLOR_ATTACHMENT12_NV 0x8CEC +#define GL_COLOR_ATTACHMENT13_NV 0x8CED +#define GL_COLOR_ATTACHMENT14_NV 0x8CEE +#define GL_COLOR_ATTACHMENT15_NV 0x8CEF + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersNV GLEW_GET_FUN(__glewDrawBuffersNV) + +#define GLEW_NV_draw_buffers GLEW_GET_VAR(__GLEW_NV_draw_buffers) + +#endif /* GL_NV_draw_buffers */ + +/* -------------------------- GL_NV_draw_instanced ------------------------- */ + +#ifndef GL_NV_draw_instanced +#define GL_NV_draw_instanced 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDNVPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDNVPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); + +#define glDrawArraysInstancedNV GLEW_GET_FUN(__glewDrawArraysInstancedNV) +#define glDrawElementsInstancedNV GLEW_GET_FUN(__glewDrawElementsInstancedNV) + +#define GLEW_NV_draw_instanced GLEW_GET_VAR(__GLEW_NV_draw_instanced) + +#endif /* GL_NV_draw_instanced */ + +/* --------------------------- GL_NV_draw_texture -------------------------- */ + +#ifndef GL_NV_draw_texture +#define GL_NV_draw_texture 1 + +typedef void (GLAPIENTRY * PFNGLDRAWTEXTURENVPROC) (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); + +#define glDrawTextureNV GLEW_GET_FUN(__glewDrawTextureNV) + +#define GLEW_NV_draw_texture GLEW_GET_VAR(__GLEW_NV_draw_texture) + +#endif /* GL_NV_draw_texture */ + +/* ------------------------ GL_NV_draw_vulkan_image ------------------------ */ + +#ifndef GL_NV_draw_vulkan_image +#define GL_NV_draw_vulkan_image 1 + +typedef void (APIENTRY *GLVULKANPROCNV)(void); + +typedef void (GLAPIENTRY * PFNGLDRAWVKIMAGENVPROC) (GLuint64 vkImage, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); +typedef GLVULKANPROCNV (GLAPIENTRY * PFNGLGETVKPROCADDRNVPROC) (const GLchar* name); +typedef void (GLAPIENTRY * PFNGLSIGNALVKFENCENVPROC) (GLuint64 vkFence); +typedef void (GLAPIENTRY * PFNGLSIGNALVKSEMAPHORENVPROC) (GLuint64 vkSemaphore); +typedef void (GLAPIENTRY * PFNGLWAITVKSEMAPHORENVPROC) (GLuint64 vkSemaphore); + +#define glDrawVkImageNV GLEW_GET_FUN(__glewDrawVkImageNV) +#define glGetVkProcAddrNV GLEW_GET_FUN(__glewGetVkProcAddrNV) +#define glSignalVkFenceNV GLEW_GET_FUN(__glewSignalVkFenceNV) +#define glSignalVkSemaphoreNV GLEW_GET_FUN(__glewSignalVkSemaphoreNV) +#define glWaitVkSemaphoreNV GLEW_GET_FUN(__glewWaitVkSemaphoreNV) + +#define GLEW_NV_draw_vulkan_image GLEW_GET_VAR(__GLEW_NV_draw_vulkan_image) + +#endif /* GL_NV_draw_vulkan_image */ + /* ---------------------------- GL_NV_evaluators --------------------------- */ #ifndef GL_NV_evaluators @@ -7767,10 +14678,10 @@ typedef void (GLAPIENTRY * PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFa typedef void (GLAPIENTRY * PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void* points); +typedef void (GLAPIENTRY * PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void *points); typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void* points); +typedef void (GLAPIENTRY * PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points); typedef void (GLAPIENTRY * PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint* params); @@ -7788,6 +14699,15 @@ typedef void (GLAPIENTRY * PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pna #endif /* GL_NV_evaluators */ +/* --------------------- GL_NV_explicit_attrib_location -------------------- */ + +#ifndef GL_NV_explicit_attrib_location +#define GL_NV_explicit_attrib_location 1 + +#define GLEW_NV_explicit_attrib_location GLEW_GET_VAR(__GLEW_NV_explicit_attrib_location) + +#endif /* GL_NV_explicit_attrib_location */ + /* ----------------------- GL_NV_explicit_multisample ---------------------- */ #ifndef GL_NV_explicit_multisample @@ -7816,6 +14736,33 @@ typedef void (GLAPIENTRY * PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint re #endif /* GL_NV_explicit_multisample */ +/* ---------------------- GL_NV_fbo_color_attachments ---------------------- */ + +#ifndef GL_NV_fbo_color_attachments +#define GL_NV_fbo_color_attachments 1 + +#define GL_MAX_COLOR_ATTACHMENTS_NV 0x8CDF +#define GL_COLOR_ATTACHMENT0_NV 0x8CE0 +#define GL_COLOR_ATTACHMENT1_NV 0x8CE1 +#define GL_COLOR_ATTACHMENT2_NV 0x8CE2 +#define GL_COLOR_ATTACHMENT3_NV 0x8CE3 +#define GL_COLOR_ATTACHMENT4_NV 0x8CE4 +#define GL_COLOR_ATTACHMENT5_NV 0x8CE5 +#define GL_COLOR_ATTACHMENT6_NV 0x8CE6 +#define GL_COLOR_ATTACHMENT7_NV 0x8CE7 +#define GL_COLOR_ATTACHMENT8_NV 0x8CE8 +#define GL_COLOR_ATTACHMENT9_NV 0x8CE9 +#define GL_COLOR_ATTACHMENT10_NV 0x8CEA +#define GL_COLOR_ATTACHMENT11_NV 0x8CEB +#define GL_COLOR_ATTACHMENT12_NV 0x8CEC +#define GL_COLOR_ATTACHMENT13_NV 0x8CED +#define GL_COLOR_ATTACHMENT14_NV 0x8CEE +#define GL_COLOR_ATTACHMENT15_NV 0x8CEF + +#define GLEW_NV_fbo_color_attachments GLEW_GET_VAR(__GLEW_NV_fbo_color_attachments) + +#endif /* GL_NV_fbo_color_attachments */ + /* ------------------------------ GL_NV_fence ------------------------------ */ #ifndef GL_NV_fence @@ -7845,6 +14792,17 @@ typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence); #endif /* GL_NV_fence */ +/* -------------------------- GL_NV_fill_rectangle ------------------------- */ + +#ifndef GL_NV_fill_rectangle +#define GL_NV_fill_rectangle 1 + +#define GL_FILL_RECTANGLE_NV 0x933C + +#define GLEW_NV_fill_rectangle GLEW_GET_VAR(__GLEW_NV_fill_rectangle) + +#endif /* GL_NV_fill_rectangle */ + /* --------------------------- GL_NV_float_buffer -------------------------- */ #ifndef GL_NV_float_buffer @@ -7883,6 +14841,22 @@ typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence); #endif /* GL_NV_fog_distance */ +/* -------------------- GL_NV_fragment_coverage_to_color ------------------- */ + +#ifndef GL_NV_fragment_coverage_to_color +#define GL_NV_fragment_coverage_to_color 1 + +#define GL_FRAGMENT_COVERAGE_TO_COLOR_NV 0x92DD +#define GL_FRAGMENT_COVERAGE_COLOR_NV 0x92DE + +typedef void (GLAPIENTRY * PFNGLFRAGMENTCOVERAGECOLORNVPROC) (GLuint color); + +#define glFragmentCoverageColorNV GLEW_GET_FUN(__glewFragmentCoverageColorNV) + +#define GLEW_NV_fragment_coverage_to_color GLEW_GET_VAR(__GLEW_NV_fragment_coverage_to_color) + +#endif /* GL_NV_fragment_coverage_to_color */ + /* ------------------------- GL_NV_fragment_program ------------------------ */ #ifndef GL_NV_fragment_program @@ -7946,6 +14920,74 @@ typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsi #endif /* GL_NV_fragment_program_option */ +/* -------------------- GL_NV_fragment_shader_interlock -------------------- */ + +#ifndef GL_NV_fragment_shader_interlock +#define GL_NV_fragment_shader_interlock 1 + +#define GLEW_NV_fragment_shader_interlock GLEW_GET_VAR(__GLEW_NV_fragment_shader_interlock) + +#endif /* GL_NV_fragment_shader_interlock */ + +/* ------------------------- GL_NV_framebuffer_blit ------------------------ */ + +#ifndef GL_NV_framebuffer_blit +#define GL_NV_framebuffer_blit 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_NV 0x8CA6 +#define GL_READ_FRAMEBUFFER_NV 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_NV 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_NV 0x8CAA + +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERNVPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + +#define glBlitFramebufferNV GLEW_GET_FUN(__glewBlitFramebufferNV) + +#define GLEW_NV_framebuffer_blit GLEW_GET_VAR(__GLEW_NV_framebuffer_blit) + +#endif /* GL_NV_framebuffer_blit */ + +/* -------------------- GL_NV_framebuffer_mixed_samples -------------------- */ + +#ifndef GL_NV_framebuffer_mixed_samples +#define GL_NV_framebuffer_mixed_samples 1 + +#define GL_COLOR_SAMPLES_NV 0x8E20 +#define GL_RASTER_MULTISAMPLE_EXT 0x9327 +#define GL_RASTER_SAMPLES_EXT 0x9328 +#define GL_MAX_RASTER_SAMPLES_EXT 0x9329 +#define GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A +#define GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B +#define GL_EFFECTIVE_RASTER_SAMPLES_EXT 0x932C +#define GL_DEPTH_SAMPLES_NV 0x932D +#define GL_STENCIL_SAMPLES_NV 0x932E +#define GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F +#define GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330 +#define GL_COVERAGE_MODULATION_TABLE_NV 0x9331 +#define GL_COVERAGE_MODULATION_NV 0x9332 +#define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 + +#define GLEW_NV_framebuffer_mixed_samples GLEW_GET_VAR(__GLEW_NV_framebuffer_mixed_samples) + +#endif /* GL_NV_framebuffer_mixed_samples */ + +/* --------------------- GL_NV_framebuffer_multisample --------------------- */ + +#ifndef GL_NV_framebuffer_multisample +#define GL_NV_framebuffer_multisample 1 + +#define GL_RENDERBUFFER_SAMPLES_NV 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_NV 0x8D56 +#define GL_MAX_SAMPLES_NV 0x8D57 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleNV GLEW_GET_FUN(__glewRenderbufferStorageMultisampleNV) + +#define GLEW_NV_framebuffer_multisample GLEW_GET_VAR(__GLEW_NV_framebuffer_multisample) + +#endif /* GL_NV_framebuffer_multisample */ + /* ----------------- GL_NV_framebuffer_multisample_coverage ---------------- */ #ifndef GL_NV_framebuffer_multisample_coverage @@ -7964,6 +15006,15 @@ typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (G #endif /* GL_NV_framebuffer_multisample_coverage */ +/* ----------------------- GL_NV_generate_mipmap_sRGB ---------------------- */ + +#ifndef GL_NV_generate_mipmap_sRGB +#define GL_NV_generate_mipmap_sRGB 1 + +#define GLEW_NV_generate_mipmap_sRGB GLEW_GET_VAR(__GLEW_NV_generate_mipmap_sRGB) + +#endif /* GL_NV_generate_mipmap_sRGB */ + /* ------------------------ GL_NV_geometry_program4 ------------------------ */ #ifndef GL_NV_geometry_program4 @@ -7990,6 +15041,56 @@ typedef void (GLAPIENTRY * PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint #endif /* GL_NV_geometry_shader4 */ +/* ------------------- GL_NV_geometry_shader_passthrough ------------------- */ + +#ifndef GL_NV_geometry_shader_passthrough +#define GL_NV_geometry_shader_passthrough 1 + +#define GLEW_NV_geometry_shader_passthrough GLEW_GET_VAR(__GLEW_NV_geometry_shader_passthrough) + +#endif /* GL_NV_geometry_shader_passthrough */ + +/* -------------------------- GL_NV_gpu_multicast -------------------------- */ + +#ifndef GL_NV_gpu_multicast +#define GL_NV_gpu_multicast 1 + +#define GL_PER_GPU_STORAGE_BIT_NV 0x0800 +#define GL_MULTICAST_GPUS_NV 0x92BA +#define GL_PER_GPU_STORAGE_NV 0x9548 +#define GL_MULTICAST_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9549 +#define GL_RENDER_GPU_MASK_NV 0x9558 + +typedef void (GLAPIENTRY * PFNGLMULTICASTBARRIERNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLMULTICASTBLITFRAMEBUFFERNVPROC) (GLuint srcGpu, GLuint dstGpu, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef void (GLAPIENTRY * PFNGLMULTICASTBUFFERSUBDATANVPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +typedef void (GLAPIENTRY * PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC) (GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLMULTICASTCOPYIMAGESUBDATANVPROC) (GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +typedef void (GLAPIENTRY * PFNGLMULTICASTFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint gpu, GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLMULTICASTGETQUERYOBJECTI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLMULTICASTGETQUERYOBJECTIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTICASTGETQUERYOBJECTUI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLMULTICASTGETQUERYOBJECTUIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLMULTICASTWAITSYNCNVPROC) (GLuint signalGpu, GLbitfield waitGpuMask); +typedef void (GLAPIENTRY * PFNGLRENDERGPUMASKNVPROC) (GLbitfield mask); + +#define glMulticastBarrierNV GLEW_GET_FUN(__glewMulticastBarrierNV) +#define glMulticastBlitFramebufferNV GLEW_GET_FUN(__glewMulticastBlitFramebufferNV) +#define glMulticastBufferSubDataNV GLEW_GET_FUN(__glewMulticastBufferSubDataNV) +#define glMulticastCopyBufferSubDataNV GLEW_GET_FUN(__glewMulticastCopyBufferSubDataNV) +#define glMulticastCopyImageSubDataNV GLEW_GET_FUN(__glewMulticastCopyImageSubDataNV) +#define glMulticastFramebufferSampleLocationsfvNV GLEW_GET_FUN(__glewMulticastFramebufferSampleLocationsfvNV) +#define glMulticastGetQueryObjecti64vNV GLEW_GET_FUN(__glewMulticastGetQueryObjecti64vNV) +#define glMulticastGetQueryObjectivNV GLEW_GET_FUN(__glewMulticastGetQueryObjectivNV) +#define glMulticastGetQueryObjectui64vNV GLEW_GET_FUN(__glewMulticastGetQueryObjectui64vNV) +#define glMulticastGetQueryObjectuivNV GLEW_GET_FUN(__glewMulticastGetQueryObjectuivNV) +#define glMulticastWaitSyncNV GLEW_GET_FUN(__glewMulticastWaitSyncNV) +#define glRenderGpuMaskNV GLEW_GET_FUN(__glewRenderGpuMaskNV) + +#define GLEW_NV_gpu_multicast GLEW_GET_VAR(__GLEW_NV_gpu_multicast) + +#endif /* GL_NV_gpu_multicast */ + /* --------------------------- GL_NV_gpu_program4 -------------------------- */ #ifndef GL_NV_gpu_program4 @@ -8034,6 +15135,148 @@ typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum targe #endif /* GL_NV_gpu_program4 */ +/* --------------------------- GL_NV_gpu_program5 -------------------------- */ + +#ifndef GL_NV_gpu_program5 +#define GL_NV_gpu_program5 1 + +#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C +#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F + +#define GLEW_NV_gpu_program5 GLEW_GET_VAR(__GLEW_NV_gpu_program5) + +#endif /* GL_NV_gpu_program5 */ + +/* -------------------- GL_NV_gpu_program5_mem_extended -------------------- */ + +#ifndef GL_NV_gpu_program5_mem_extended +#define GL_NV_gpu_program5_mem_extended 1 + +#define GLEW_NV_gpu_program5_mem_extended GLEW_GET_VAR(__GLEW_NV_gpu_program5_mem_extended) + +#endif /* GL_NV_gpu_program5_mem_extended */ + +/* ------------------------- GL_NV_gpu_program_fp64 ------------------------ */ + +#ifndef GL_NV_gpu_program_fp64 +#define GL_NV_gpu_program_fp64 1 + +#define GLEW_NV_gpu_program_fp64 GLEW_GET_VAR(__GLEW_NV_gpu_program_fp64) + +#endif /* GL_NV_gpu_program_fp64 */ + +/* --------------------------- GL_NV_gpu_shader5 --------------------------- */ + +#ifndef GL_NV_gpu_shader5 +#define GL_NV_gpu_shader5 1 + +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F +#define GL_INT8_NV 0x8FE0 +#define GL_INT8_VEC2_NV 0x8FE1 +#define GL_INT8_VEC3_NV 0x8FE2 +#define GL_INT8_VEC4_NV 0x8FE3 +#define GL_INT16_NV 0x8FE4 +#define GL_INT16_VEC2_NV 0x8FE5 +#define GL_INT16_VEC3_NV 0x8FE6 +#define GL_INT16_VEC4_NV 0x8FE7 +#define GL_INT64_VEC2_NV 0x8FE9 +#define GL_INT64_VEC3_NV 0x8FEA +#define GL_INT64_VEC4_NV 0x8FEB +#define GL_UNSIGNED_INT8_NV 0x8FEC +#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED +#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE +#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF +#define GL_UNSIGNED_INT16_NV 0x8FF0 +#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 +#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 +#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 +#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 +#define GL_FLOAT16_NV 0x8FF8 +#define GL_FLOAT16_VEC2_NV 0x8FF9 +#define GL_FLOAT16_VEC3_NV 0x8FFA +#define GL_FLOAT16_VEC4_NV 0x8FFB + +typedef void (GLAPIENTRY * PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); + +#define glGetUniformi64vNV GLEW_GET_FUN(__glewGetUniformi64vNV) +#define glGetUniformui64vNV GLEW_GET_FUN(__glewGetUniformui64vNV) +#define glProgramUniform1i64NV GLEW_GET_FUN(__glewProgramUniform1i64NV) +#define glProgramUniform1i64vNV GLEW_GET_FUN(__glewProgramUniform1i64vNV) +#define glProgramUniform1ui64NV GLEW_GET_FUN(__glewProgramUniform1ui64NV) +#define glProgramUniform1ui64vNV GLEW_GET_FUN(__glewProgramUniform1ui64vNV) +#define glProgramUniform2i64NV GLEW_GET_FUN(__glewProgramUniform2i64NV) +#define glProgramUniform2i64vNV GLEW_GET_FUN(__glewProgramUniform2i64vNV) +#define glProgramUniform2ui64NV GLEW_GET_FUN(__glewProgramUniform2ui64NV) +#define glProgramUniform2ui64vNV GLEW_GET_FUN(__glewProgramUniform2ui64vNV) +#define glProgramUniform3i64NV GLEW_GET_FUN(__glewProgramUniform3i64NV) +#define glProgramUniform3i64vNV GLEW_GET_FUN(__glewProgramUniform3i64vNV) +#define glProgramUniform3ui64NV GLEW_GET_FUN(__glewProgramUniform3ui64NV) +#define glProgramUniform3ui64vNV GLEW_GET_FUN(__glewProgramUniform3ui64vNV) +#define glProgramUniform4i64NV GLEW_GET_FUN(__glewProgramUniform4i64NV) +#define glProgramUniform4i64vNV GLEW_GET_FUN(__glewProgramUniform4i64vNV) +#define glProgramUniform4ui64NV GLEW_GET_FUN(__glewProgramUniform4ui64NV) +#define glProgramUniform4ui64vNV GLEW_GET_FUN(__glewProgramUniform4ui64vNV) +#define glUniform1i64NV GLEW_GET_FUN(__glewUniform1i64NV) +#define glUniform1i64vNV GLEW_GET_FUN(__glewUniform1i64vNV) +#define glUniform1ui64NV GLEW_GET_FUN(__glewUniform1ui64NV) +#define glUniform1ui64vNV GLEW_GET_FUN(__glewUniform1ui64vNV) +#define glUniform2i64NV GLEW_GET_FUN(__glewUniform2i64NV) +#define glUniform2i64vNV GLEW_GET_FUN(__glewUniform2i64vNV) +#define glUniform2ui64NV GLEW_GET_FUN(__glewUniform2ui64NV) +#define glUniform2ui64vNV GLEW_GET_FUN(__glewUniform2ui64vNV) +#define glUniform3i64NV GLEW_GET_FUN(__glewUniform3i64NV) +#define glUniform3i64vNV GLEW_GET_FUN(__glewUniform3i64vNV) +#define glUniform3ui64NV GLEW_GET_FUN(__glewUniform3ui64NV) +#define glUniform3ui64vNV GLEW_GET_FUN(__glewUniform3ui64vNV) +#define glUniform4i64NV GLEW_GET_FUN(__glewUniform4i64NV) +#define glUniform4i64vNV GLEW_GET_FUN(__glewUniform4i64vNV) +#define glUniform4ui64NV GLEW_GET_FUN(__glewUniform4ui64NV) +#define glUniform4ui64vNV GLEW_GET_FUN(__glewUniform4ui64vNV) + +#define GLEW_NV_gpu_shader5 GLEW_GET_VAR(__GLEW_NV_gpu_shader5) + +#endif /* GL_NV_gpu_shader5 */ + /* ---------------------------- GL_NV_half_float --------------------------- */ #ifndef GL_NV_half_float @@ -8141,6 +15384,48 @@ typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalf* weight); #endif /* GL_NV_half_float */ +/* -------------------------- GL_NV_image_formats -------------------------- */ + +#ifndef GL_NV_image_formats +#define GL_NV_image_formats 1 + +#define GLEW_NV_image_formats GLEW_GET_VAR(__GLEW_NV_image_formats) + +#endif /* GL_NV_image_formats */ + +/* ------------------------- GL_NV_instanced_arrays ------------------------ */ + +#ifndef GL_NV_instanced_arrays +#define GL_NV_instanced_arrays 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_NV 0x88FE + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORNVPROC) (GLuint index, GLuint divisor); + +#define glVertexAttribDivisorNV GLEW_GET_FUN(__glewVertexAttribDivisorNV) + +#define GLEW_NV_instanced_arrays GLEW_GET_VAR(__GLEW_NV_instanced_arrays) + +#endif /* GL_NV_instanced_arrays */ + +/* ------------------- GL_NV_internalformat_sample_query ------------------- */ + +#ifndef GL_NV_internalformat_sample_query +#define GL_NV_internalformat_sample_query 1 + +#define GL_MULTISAMPLES_NV 0x9371 +#define GL_SUPERSAMPLE_SCALE_X_NV 0x9372 +#define GL_SUPERSAMPLE_SCALE_Y_NV 0x9373 +#define GL_CONFORMANT_NV 0x9374 + +typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint* params); + +#define glGetInternalformatSampleivNV GLEW_GET_FUN(__glewGetInternalformatSampleivNV) + +#define GLEW_NV_internalformat_sample_query GLEW_GET_VAR(__GLEW_NV_internalformat_sample_query) + +#endif /* GL_NV_internalformat_sample_query */ + /* ------------------------ GL_NV_light_max_exponent ----------------------- */ #ifndef GL_NV_light_max_exponent @@ -8153,6 +15438,17 @@ typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalf* weight); #endif /* GL_NV_light_max_exponent */ +/* ----------------------- GL_NV_multisample_coverage ---------------------- */ + +#ifndef GL_NV_multisample_coverage +#define GL_NV_multisample_coverage 1 + +#define GL_COLOR_SAMPLES_NV 0x8E20 + +#define GLEW_NV_multisample_coverage GLEW_GET_VAR(__GLEW_NV_multisample_coverage) + +#endif /* GL_NV_multisample_coverage */ + /* --------------------- GL_NV_multisample_filter_hint --------------------- */ #ifndef GL_NV_multisample_filter_hint @@ -8164,6 +15460,36 @@ typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalf* weight); #endif /* GL_NV_multisample_filter_hint */ +/* ----------------------- GL_NV_non_square_matrices ----------------------- */ + +#ifndef GL_NV_non_square_matrices +#define GL_NV_non_square_matrices 1 + +#define GL_FLOAT_MAT2x3_NV 0x8B65 +#define GL_FLOAT_MAT2x4_NV 0x8B66 +#define GL_FLOAT_MAT3x2_NV 0x8B67 +#define GL_FLOAT_MAT3x4_NV 0x8B68 +#define GL_FLOAT_MAT4x2_NV 0x8B69 +#define GL_FLOAT_MAT4x3_NV 0x8B6A + +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); + +#define glUniformMatrix2x3fvNV GLEW_GET_FUN(__glewUniformMatrix2x3fvNV) +#define glUniformMatrix2x4fvNV GLEW_GET_FUN(__glewUniformMatrix2x4fvNV) +#define glUniformMatrix3x2fvNV GLEW_GET_FUN(__glewUniformMatrix3x2fvNV) +#define glUniformMatrix3x4fvNV GLEW_GET_FUN(__glewUniformMatrix3x4fvNV) +#define glUniformMatrix4x2fvNV GLEW_GET_FUN(__glewUniformMatrix4x2fvNV) +#define glUniformMatrix4x3fvNV GLEW_GET_FUN(__glewUniformMatrix4x3fvNV) + +#define GLEW_NV_non_square_matrices GLEW_GET_VAR(__GLEW_NV_non_square_matrices) + +#endif /* GL_NV_non_square_matrices */ + /* ------------------------- GL_NV_occlusion_query ------------------------- */ #ifndef GL_NV_occlusion_query @@ -8194,6 +15520,19 @@ typedef GLboolean (GLAPIENTRY * PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); #endif /* GL_NV_occlusion_query */ +/* -------------------------- GL_NV_pack_subimage -------------------------- */ + +#ifndef GL_NV_pack_subimage +#define GL_NV_pack_subimage 1 + +#define GL_PACK_ROW_LENGTH_NV 0x0D02 +#define GL_PACK_SKIP_ROWS_NV 0x0D03 +#define GL_PACK_SKIP_PIXELS_NV 0x0D04 + +#define GLEW_NV_pack_subimage GLEW_GET_VAR(__GLEW_NV_pack_subimage) + +#endif /* GL_NV_pack_subimage */ + /* ----------------------- GL_NV_packed_depth_stencil ---------------------- */ #ifndef GL_NV_packed_depth_stencil @@ -8206,6 +15545,30 @@ typedef GLboolean (GLAPIENTRY * PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); #endif /* GL_NV_packed_depth_stencil */ +/* --------------------------- GL_NV_packed_float -------------------------- */ + +#ifndef GL_NV_packed_float +#define GL_NV_packed_float 1 + +#define GL_R11F_G11F_B10F_NV 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_NV 0x8C3B + +#define GLEW_NV_packed_float GLEW_GET_VAR(__GLEW_NV_packed_float) + +#endif /* GL_NV_packed_float */ + +/* ----------------------- GL_NV_packed_float_linear ----------------------- */ + +#ifndef GL_NV_packed_float_linear +#define GL_NV_packed_float_linear 1 + +#define GL_R11F_G11F_B10F_NV 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_NV 0x8C3B + +#define GLEW_NV_packed_float_linear GLEW_GET_VAR(__GLEW_NV_packed_float_linear) + +#endif /* GL_NV_packed_float_linear */ + /* --------------------- GL_NV_parameter_buffer_object --------------------- */ #ifndef GL_NV_parameter_buffer_object @@ -8229,6 +15592,329 @@ typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, #endif /* GL_NV_parameter_buffer_object */ +/* --------------------- GL_NV_parameter_buffer_object2 -------------------- */ + +#ifndef GL_NV_parameter_buffer_object2 +#define GL_NV_parameter_buffer_object2 1 + +#define GLEW_NV_parameter_buffer_object2 GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object2) + +#endif /* GL_NV_parameter_buffer_object2 */ + +/* -------------------------- GL_NV_path_rendering ------------------------- */ + +#ifndef GL_NV_path_rendering +#define GL_NV_path_rendering 1 + +#define GL_CLOSE_PATH_NV 0x00 +#define GL_BOLD_BIT_NV 0x01 +#define GL_GLYPH_WIDTH_BIT_NV 0x01 +#define GL_GLYPH_HEIGHT_BIT_NV 0x02 +#define GL_ITALIC_BIT_NV 0x02 +#define GL_MOVE_TO_NV 0x02 +#define GL_RELATIVE_MOVE_TO_NV 0x03 +#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 +#define GL_LINE_TO_NV 0x04 +#define GL_RELATIVE_LINE_TO_NV 0x05 +#define GL_HORIZONTAL_LINE_TO_NV 0x06 +#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 +#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 +#define GL_VERTICAL_LINE_TO_NV 0x08 +#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 +#define GL_QUADRATIC_CURVE_TO_NV 0x0A +#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B +#define GL_CUBIC_CURVE_TO_NV 0x0C +#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D +#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E +#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F +#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 +#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 +#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 +#define GL_SMALL_CCW_ARC_TO_NV 0x12 +#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 +#define GL_SMALL_CW_ARC_TO_NV 0x14 +#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 +#define GL_LARGE_CCW_ARC_TO_NV 0x16 +#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 +#define GL_LARGE_CW_ARC_TO_NV 0x18 +#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 +#define GL_CONIC_CURVE_TO_NV 0x1A +#define GL_RELATIVE_CONIC_CURVE_TO_NV 0x1B +#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 +#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 +#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 +#define GL_ROUNDED_RECT_NV 0xE8 +#define GL_RELATIVE_ROUNDED_RECT_NV 0xE9 +#define GL_ROUNDED_RECT2_NV 0xEA +#define GL_RELATIVE_ROUNDED_RECT2_NV 0xEB +#define GL_ROUNDED_RECT4_NV 0xEC +#define GL_RELATIVE_ROUNDED_RECT4_NV 0xED +#define GL_ROUNDED_RECT8_NV 0xEE +#define GL_RELATIVE_ROUNDED_RECT8_NV 0xEF +#define GL_RESTART_PATH_NV 0xF0 +#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 +#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 +#define GL_RECT_NV 0xF6 +#define GL_RELATIVE_RECT_NV 0xF7 +#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 +#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA +#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC +#define GL_ARC_TO_NV 0xFE +#define GL_RELATIVE_ARC_TO_NV 0xFF +#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PATH_FORMAT_SVG_NV 0x9070 +#define GL_PATH_FORMAT_PS_NV 0x9071 +#define GL_STANDARD_FONT_NAME_NV 0x9072 +#define GL_SYSTEM_FONT_NAME_NV 0x9073 +#define GL_FILE_NAME_NV 0x9074 +#define GL_PATH_STROKE_WIDTH_NV 0x9075 +#define GL_PATH_END_CAPS_NV 0x9076 +#define GL_PATH_INITIAL_END_CAP_NV 0x9077 +#define GL_PATH_TERMINAL_END_CAP_NV 0x9078 +#define GL_PATH_JOIN_STYLE_NV 0x9079 +#define GL_PATH_MITER_LIMIT_NV 0x907A +#define GL_PATH_DASH_CAPS_NV 0x907B +#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C +#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D +#define GL_PATH_DASH_OFFSET_NV 0x907E +#define GL_PATH_CLIENT_LENGTH_NV 0x907F +#define GL_PATH_FILL_MODE_NV 0x9080 +#define GL_PATH_FILL_MASK_NV 0x9081 +#define GL_PATH_FILL_COVER_MODE_NV 0x9082 +#define GL_PATH_STROKE_COVER_MODE_NV 0x9083 +#define GL_PATH_STROKE_MASK_NV 0x9084 +#define GL_PATH_STROKE_BOUND_NV 0x9086 +#define GL_COUNT_UP_NV 0x9088 +#define GL_COUNT_DOWN_NV 0x9089 +#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A +#define GL_CONVEX_HULL_NV 0x908B +#define GL_BOUNDING_BOX_NV 0x908D +#define GL_TRANSLATE_X_NV 0x908E +#define GL_TRANSLATE_Y_NV 0x908F +#define GL_TRANSLATE_2D_NV 0x9090 +#define GL_TRANSLATE_3D_NV 0x9091 +#define GL_AFFINE_2D_NV 0x9092 +#define GL_AFFINE_3D_NV 0x9094 +#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 +#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 +#define GL_UTF8_NV 0x909A +#define GL_UTF16_NV 0x909B +#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C +#define GL_PATH_COMMAND_COUNT_NV 0x909D +#define GL_PATH_COORD_COUNT_NV 0x909E +#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F +#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 +#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 +#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 +#define GL_SQUARE_NV 0x90A3 +#define GL_ROUND_NV 0x90A4 +#define GL_TRIANGULAR_NV 0x90A5 +#define GL_BEVEL_NV 0x90A6 +#define GL_MITER_REVERT_NV 0x90A7 +#define GL_MITER_TRUNCATE_NV 0x90A8 +#define GL_SKIP_MISSING_GLYPH_NV 0x90A9 +#define GL_USE_MISSING_GLYPH_NV 0x90AA +#define GL_PATH_ERROR_POSITION_NV 0x90AB +#define GL_PATH_FOG_GEN_MODE_NV 0x90AC +#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD +#define GL_ADJACENT_PAIRS_NV 0x90AE +#define GL_FIRST_TO_REST_NV 0x90AF +#define GL_PATH_GEN_MODE_NV 0x90B0 +#define GL_PATH_GEN_COEFF_NV 0x90B1 +#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 +#define GL_PATH_GEN_COMPONENTS_NV 0x90B3 +#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 +#define GL_MOVE_TO_RESETS_NV 0x90B5 +#define GL_MOVE_TO_CONTINUES_NV 0x90B6 +#define GL_PATH_STENCIL_FUNC_NV 0x90B7 +#define GL_PATH_STENCIL_REF_NV 0x90B8 +#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 +#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD +#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE +#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF +#define GL_FONT_GLYPHS_AVAILABLE_NV 0x9368 +#define GL_FONT_TARGET_UNAVAILABLE_NV 0x9369 +#define GL_FONT_UNAVAILABLE_NV 0x936A +#define GL_FONT_UNINTELLIGIBLE_NV 0x936B +#define GL_STANDARD_FONT_FORMAT_NV 0x936C +#define GL_FRAGMENT_INPUT_NV 0x936D +#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 +#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 +#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 +#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 +#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 +#define GL_FONT_ASCENDER_BIT_NV 0x00200000 +#define GL_FONT_DESCENDER_BIT_NV 0x00400000 +#define GL_FONT_HEIGHT_BIT_NV 0x00800000 +#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 +#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 +#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 +#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 +#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 +#define GL_FONT_NUM_GLYPH_INDICES_BIT_NV 0x20000000 + +typedef void (GLAPIENTRY * PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); +typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); +typedef GLuint (GLAPIENTRY * PFNGLGENPATHSNVPROC) (GLsizei range); +typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte* commands); +typedef void (GLAPIENTRY * PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat* coords); +typedef void (GLAPIENTRY * PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat* dashArray); +typedef GLfloat (GLAPIENTRY * PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); +typedef void (GLAPIENTRY * PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat* metrics); +typedef void (GLAPIENTRY * PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); +typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); +typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); +typedef GLboolean (GLAPIENTRY * PFNGLISPATHNVPROC) (GLuint path); +typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); +typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLMATRIXLOAD3X2FNVPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOAD3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULT3X2FNVPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULT3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat* coeffs); +typedef void (GLAPIENTRY * PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const void*coords); +typedef void (GLAPIENTRY * PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); +typedef void (GLAPIENTRY * PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum zfunc); +typedef void (GLAPIENTRY * PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat* dashArray); +typedef void (GLAPIENTRY * PFNGLPATHFOGGENNVPROC) (GLenum genMode); +typedef GLenum (GLAPIENTRY * PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef GLenum (GLAPIENTRY * PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]); +typedef void (GLAPIENTRY * PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (GLAPIENTRY * PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void*charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef GLenum (GLAPIENTRY * PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); +typedef void (GLAPIENTRY * PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void *pathString); +typedef void (GLAPIENTRY * PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const void*coords); +typedef void (GLAPIENTRY * PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); +typedef void (GLAPIENTRY * PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat* coeffs); +typedef GLboolean (GLAPIENTRY * PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat* x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); +typedef void (GLAPIENTRY * PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat* coeffs); +typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat* transformValues); +typedef void (GLAPIENTRY * PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint paths[], const GLfloat weights[]); + +#define glCopyPathNV GLEW_GET_FUN(__glewCopyPathNV) +#define glCoverFillPathInstancedNV GLEW_GET_FUN(__glewCoverFillPathInstancedNV) +#define glCoverFillPathNV GLEW_GET_FUN(__glewCoverFillPathNV) +#define glCoverStrokePathInstancedNV GLEW_GET_FUN(__glewCoverStrokePathInstancedNV) +#define glCoverStrokePathNV GLEW_GET_FUN(__glewCoverStrokePathNV) +#define glDeletePathsNV GLEW_GET_FUN(__glewDeletePathsNV) +#define glGenPathsNV GLEW_GET_FUN(__glewGenPathsNV) +#define glGetPathColorGenfvNV GLEW_GET_FUN(__glewGetPathColorGenfvNV) +#define glGetPathColorGenivNV GLEW_GET_FUN(__glewGetPathColorGenivNV) +#define glGetPathCommandsNV GLEW_GET_FUN(__glewGetPathCommandsNV) +#define glGetPathCoordsNV GLEW_GET_FUN(__glewGetPathCoordsNV) +#define glGetPathDashArrayNV GLEW_GET_FUN(__glewGetPathDashArrayNV) +#define glGetPathLengthNV GLEW_GET_FUN(__glewGetPathLengthNV) +#define glGetPathMetricRangeNV GLEW_GET_FUN(__glewGetPathMetricRangeNV) +#define glGetPathMetricsNV GLEW_GET_FUN(__glewGetPathMetricsNV) +#define glGetPathParameterfvNV GLEW_GET_FUN(__glewGetPathParameterfvNV) +#define glGetPathParameterivNV GLEW_GET_FUN(__glewGetPathParameterivNV) +#define glGetPathSpacingNV GLEW_GET_FUN(__glewGetPathSpacingNV) +#define glGetPathTexGenfvNV GLEW_GET_FUN(__glewGetPathTexGenfvNV) +#define glGetPathTexGenivNV GLEW_GET_FUN(__glewGetPathTexGenivNV) +#define glGetProgramResourcefvNV GLEW_GET_FUN(__glewGetProgramResourcefvNV) +#define glInterpolatePathsNV GLEW_GET_FUN(__glewInterpolatePathsNV) +#define glIsPathNV GLEW_GET_FUN(__glewIsPathNV) +#define glIsPointInFillPathNV GLEW_GET_FUN(__glewIsPointInFillPathNV) +#define glIsPointInStrokePathNV GLEW_GET_FUN(__glewIsPointInStrokePathNV) +#define glMatrixLoad3x2fNV GLEW_GET_FUN(__glewMatrixLoad3x2fNV) +#define glMatrixLoad3x3fNV GLEW_GET_FUN(__glewMatrixLoad3x3fNV) +#define glMatrixLoadTranspose3x3fNV GLEW_GET_FUN(__glewMatrixLoadTranspose3x3fNV) +#define glMatrixMult3x2fNV GLEW_GET_FUN(__glewMatrixMult3x2fNV) +#define glMatrixMult3x3fNV GLEW_GET_FUN(__glewMatrixMult3x3fNV) +#define glMatrixMultTranspose3x3fNV GLEW_GET_FUN(__glewMatrixMultTranspose3x3fNV) +#define glPathColorGenNV GLEW_GET_FUN(__glewPathColorGenNV) +#define glPathCommandsNV GLEW_GET_FUN(__glewPathCommandsNV) +#define glPathCoordsNV GLEW_GET_FUN(__glewPathCoordsNV) +#define glPathCoverDepthFuncNV GLEW_GET_FUN(__glewPathCoverDepthFuncNV) +#define glPathDashArrayNV GLEW_GET_FUN(__glewPathDashArrayNV) +#define glPathFogGenNV GLEW_GET_FUN(__glewPathFogGenNV) +#define glPathGlyphIndexArrayNV GLEW_GET_FUN(__glewPathGlyphIndexArrayNV) +#define glPathGlyphIndexRangeNV GLEW_GET_FUN(__glewPathGlyphIndexRangeNV) +#define glPathGlyphRangeNV GLEW_GET_FUN(__glewPathGlyphRangeNV) +#define glPathGlyphsNV GLEW_GET_FUN(__glewPathGlyphsNV) +#define glPathMemoryGlyphIndexArrayNV GLEW_GET_FUN(__glewPathMemoryGlyphIndexArrayNV) +#define glPathParameterfNV GLEW_GET_FUN(__glewPathParameterfNV) +#define glPathParameterfvNV GLEW_GET_FUN(__glewPathParameterfvNV) +#define glPathParameteriNV GLEW_GET_FUN(__glewPathParameteriNV) +#define glPathParameterivNV GLEW_GET_FUN(__glewPathParameterivNV) +#define glPathStencilDepthOffsetNV GLEW_GET_FUN(__glewPathStencilDepthOffsetNV) +#define glPathStencilFuncNV GLEW_GET_FUN(__glewPathStencilFuncNV) +#define glPathStringNV GLEW_GET_FUN(__glewPathStringNV) +#define glPathSubCommandsNV GLEW_GET_FUN(__glewPathSubCommandsNV) +#define glPathSubCoordsNV GLEW_GET_FUN(__glewPathSubCoordsNV) +#define glPathTexGenNV GLEW_GET_FUN(__glewPathTexGenNV) +#define glPointAlongPathNV GLEW_GET_FUN(__glewPointAlongPathNV) +#define glProgramPathFragmentInputGenNV GLEW_GET_FUN(__glewProgramPathFragmentInputGenNV) +#define glStencilFillPathInstancedNV GLEW_GET_FUN(__glewStencilFillPathInstancedNV) +#define glStencilFillPathNV GLEW_GET_FUN(__glewStencilFillPathNV) +#define glStencilStrokePathInstancedNV GLEW_GET_FUN(__glewStencilStrokePathInstancedNV) +#define glStencilStrokePathNV GLEW_GET_FUN(__glewStencilStrokePathNV) +#define glStencilThenCoverFillPathInstancedNV GLEW_GET_FUN(__glewStencilThenCoverFillPathInstancedNV) +#define glStencilThenCoverFillPathNV GLEW_GET_FUN(__glewStencilThenCoverFillPathNV) +#define glStencilThenCoverStrokePathInstancedNV GLEW_GET_FUN(__glewStencilThenCoverStrokePathInstancedNV) +#define glStencilThenCoverStrokePathNV GLEW_GET_FUN(__glewStencilThenCoverStrokePathNV) +#define glTransformPathNV GLEW_GET_FUN(__glewTransformPathNV) +#define glWeightPathsNV GLEW_GET_FUN(__glewWeightPathsNV) + +#define GLEW_NV_path_rendering GLEW_GET_VAR(__GLEW_NV_path_rendering) + +#endif /* GL_NV_path_rendering */ + +/* -------------------- GL_NV_path_rendering_shared_edge ------------------- */ + +#ifndef GL_NV_path_rendering_shared_edge +#define GL_NV_path_rendering_shared_edge 1 + +#define GL_SHARED_EDGE_NV 0xC0 + +#define GLEW_NV_path_rendering_shared_edge GLEW_GET_VAR(__GLEW_NV_path_rendering_shared_edge) + +#endif /* GL_NV_path_rendering_shared_edge */ + +/* ----------------------- GL_NV_pixel_buffer_object ----------------------- */ + +#ifndef GL_NV_pixel_buffer_object +#define GL_NV_pixel_buffer_object 1 + +#define GL_PIXEL_PACK_BUFFER_NV 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_NV 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_NV 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_NV 0x88EF + +#define GLEW_NV_pixel_buffer_object GLEW_GET_VAR(__GLEW_NV_pixel_buffer_object) + +#endif /* GL_NV_pixel_buffer_object */ + /* ------------------------- GL_NV_pixel_data_range ------------------------ */ #ifndef GL_NV_pixel_data_range @@ -8242,7 +15928,7 @@ typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, #define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D typedef void (GLAPIENTRY * PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); -typedef void (GLAPIENTRY * PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, void* pointer); +typedef void (GLAPIENTRY * PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, void *pointer); #define glFlushPixelDataRangeNV GLEW_GET_FUN(__glewFlushPixelDataRangeNV) #define glPixelDataRangeNV GLEW_GET_FUN(__glewPixelDataRangeNV) @@ -8251,6 +15937,17 @@ typedef void (GLAPIENTRY * PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei le #endif /* GL_NV_pixel_data_range */ +/* ------------------------- GL_NV_platform_binary ------------------------- */ + +#ifndef GL_NV_platform_binary +#define GL_NV_platform_binary 1 + +#define GL_NVIDIA_PLATFORM_BINARY_NV 0x890B + +#define GLEW_NV_platform_binary GLEW_GET_VAR(__GLEW_NV_platform_binary) + +#endif /* GL_NV_platform_binary */ + /* --------------------------- GL_NV_point_sprite -------------------------- */ #ifndef GL_NV_point_sprite @@ -8270,6 +15967,26 @@ typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLi #endif /* GL_NV_point_sprite */ +/* --------------------------- GL_NV_polygon_mode -------------------------- */ + +#ifndef GL_NV_polygon_mode +#define GL_NV_polygon_mode 1 + +#define GL_POLYGON_MODE_NV 0x0B40 +#define GL_POINT_NV 0x1B00 +#define GL_LINE_NV 0x1B01 +#define GL_FILL_NV 0x1B02 +#define GL_POLYGON_OFFSET_POINT_NV 0x2A01 +#define GL_POLYGON_OFFSET_LINE_NV 0x2A02 + +typedef void (GLAPIENTRY * PFNGLPOLYGONMODENVPROC) (GLenum face, GLenum mode); + +#define glPolygonModeNV GLEW_GET_FUN(__glewPolygonModeNV) + +#define GLEW_NV_polygon_mode GLEW_GET_VAR(__GLEW_NV_polygon_mode) + +#endif /* GL_NV_polygon_mode */ + /* -------------------------- GL_NV_present_video -------------------------- */ #ifndef GL_NV_present_video @@ -8288,7 +16005,6 @@ typedef void (GLAPIENTRY * PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum typedef void (GLAPIENTRY * PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint* params); typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); -typedef void (GLAPIENTRY * PFNGLVIDEOPARAMETERIVNVPROC) (GLuint video_slot, GLenum pname, const GLint* params); #define glGetVideoi64vNV GLEW_GET_FUN(__glewGetVideoi64vNV) #define glGetVideoivNV GLEW_GET_FUN(__glewGetVideoivNV) @@ -8296,7 +16012,6 @@ typedef void (GLAPIENTRY * PFNGLVIDEOPARAMETERIVNVPROC) (GLuint video_slot, GLen #define glGetVideouivNV GLEW_GET_FUN(__glewGetVideouivNV) #define glPresentFrameDualFillNV GLEW_GET_FUN(__glewPresentFrameDualFillNV) #define glPresentFrameKeyedNV GLEW_GET_FUN(__glewPresentFrameKeyedNV) -#define glVideoParameterivNV GLEW_GET_FUN(__glewVideoParameterivNV) #define GLEW_NV_present_video GLEW_GET_VAR(__GLEW_NV_present_video) @@ -8320,6 +16035,33 @@ typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTNVPROC) (void); #endif /* GL_NV_primitive_restart */ +/* ---------------------------- GL_NV_read_depth --------------------------- */ + +#ifndef GL_NV_read_depth +#define GL_NV_read_depth 1 + +#define GLEW_NV_read_depth GLEW_GET_VAR(__GLEW_NV_read_depth) + +#endif /* GL_NV_read_depth */ + +/* ------------------------ GL_NV_read_depth_stencil ----------------------- */ + +#ifndef GL_NV_read_depth_stencil +#define GL_NV_read_depth_stencil 1 + +#define GLEW_NV_read_depth_stencil GLEW_GET_VAR(__GLEW_NV_read_depth_stencil) + +#endif /* GL_NV_read_depth_stencil */ + +/* --------------------------- GL_NV_read_stencil -------------------------- */ + +#ifndef GL_NV_read_stencil +#define GL_NV_read_stencil 1 + +#define GLEW_NV_read_stencil GLEW_GET_VAR(__GLEW_NV_read_stencil) + +#endif /* GL_NV_read_stencil */ + /* ------------------------ GL_NV_register_combiners ----------------------- */ #ifndef GL_NV_register_combiners @@ -8426,6 +16168,243 @@ typedef void (GLAPIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage #endif /* GL_NV_register_combiners2 */ +/* ------------------ GL_NV_robustness_video_memory_purge ------------------ */ + +#ifndef GL_NV_robustness_video_memory_purge +#define GL_NV_robustness_video_memory_purge 1 + +#define GL_EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x334C +#define GL_PURGED_CONTEXT_RESET_NV 0x92BB + +#define GLEW_NV_robustness_video_memory_purge GLEW_GET_VAR(__GLEW_NV_robustness_video_memory_purge) + +#endif /* GL_NV_robustness_video_memory_purge */ + +/* --------------------------- GL_NV_sRGB_formats -------------------------- */ + +#ifndef GL_NV_sRGB_formats +#define GL_NV_sRGB_formats 1 + +#define GL_ETC1_SRGB8_NV 0x88EE +#define GL_SRGB8_NV 0x8C41 +#define GL_SLUMINANCE_ALPHA_NV 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_NV 0x8C45 +#define GL_SLUMINANCE_NV 0x8C46 +#define GL_SLUMINANCE8_NV 0x8C47 +#define GL_COMPRESSED_SRGB_S3TC_DXT1_NV 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV 0x8C4F + +#define GLEW_NV_sRGB_formats GLEW_GET_VAR(__GLEW_NV_sRGB_formats) + +#endif /* GL_NV_sRGB_formats */ + +/* ------------------------- GL_NV_sample_locations ------------------------ */ + +#ifndef GL_NV_sample_locations +#define GL_NV_sample_locations 1 + +#define GL_SAMPLE_LOCATION_NV 0x8E50 +#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D +#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E +#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340 +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341 +#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342 +#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); + +#define glFramebufferSampleLocationsfvNV GLEW_GET_FUN(__glewFramebufferSampleLocationsfvNV) +#define glNamedFramebufferSampleLocationsfvNV GLEW_GET_FUN(__glewNamedFramebufferSampleLocationsfvNV) + +#define GLEW_NV_sample_locations GLEW_GET_VAR(__GLEW_NV_sample_locations) + +#endif /* GL_NV_sample_locations */ + +/* ------------------ GL_NV_sample_mask_override_coverage ------------------ */ + +#ifndef GL_NV_sample_mask_override_coverage +#define GL_NV_sample_mask_override_coverage 1 + +#define GLEW_NV_sample_mask_override_coverage GLEW_GET_VAR(__GLEW_NV_sample_mask_override_coverage) + +#endif /* GL_NV_sample_mask_override_coverage */ + +/* ---------------------- GL_NV_shader_atomic_counters --------------------- */ + +#ifndef GL_NV_shader_atomic_counters +#define GL_NV_shader_atomic_counters 1 + +#define GLEW_NV_shader_atomic_counters GLEW_GET_VAR(__GLEW_NV_shader_atomic_counters) + +#endif /* GL_NV_shader_atomic_counters */ + +/* ----------------------- GL_NV_shader_atomic_float ----------------------- */ + +#ifndef GL_NV_shader_atomic_float +#define GL_NV_shader_atomic_float 1 + +#define GLEW_NV_shader_atomic_float GLEW_GET_VAR(__GLEW_NV_shader_atomic_float) + +#endif /* GL_NV_shader_atomic_float */ + +/* ---------------------- GL_NV_shader_atomic_float64 ---------------------- */ + +#ifndef GL_NV_shader_atomic_float64 +#define GL_NV_shader_atomic_float64 1 + +#define GLEW_NV_shader_atomic_float64 GLEW_GET_VAR(__GLEW_NV_shader_atomic_float64) + +#endif /* GL_NV_shader_atomic_float64 */ + +/* -------------------- GL_NV_shader_atomic_fp16_vector -------------------- */ + +#ifndef GL_NV_shader_atomic_fp16_vector +#define GL_NV_shader_atomic_fp16_vector 1 + +#define GLEW_NV_shader_atomic_fp16_vector GLEW_GET_VAR(__GLEW_NV_shader_atomic_fp16_vector) + +#endif /* GL_NV_shader_atomic_fp16_vector */ + +/* ----------------------- GL_NV_shader_atomic_int64 ----------------------- */ + +#ifndef GL_NV_shader_atomic_int64 +#define GL_NV_shader_atomic_int64 1 + +#define GLEW_NV_shader_atomic_int64 GLEW_GET_VAR(__GLEW_NV_shader_atomic_int64) + +#endif /* GL_NV_shader_atomic_int64 */ + +/* ------------------------ GL_NV_shader_buffer_load ----------------------- */ + +#ifndef GL_NV_shader_buffer_load +#define GL_NV_shader_buffer_load 1 + +#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D +#define GL_GPU_ADDRESS_NV 0x8F34 +#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 + +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT* result); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT* params); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERRESIDENTNVPROC) (GLenum target); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); +typedef void (GLAPIENTRY * PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); + +#define glGetBufferParameterui64vNV GLEW_GET_FUN(__glewGetBufferParameterui64vNV) +#define glGetIntegerui64vNV GLEW_GET_FUN(__glewGetIntegerui64vNV) +#define glGetNamedBufferParameterui64vNV GLEW_GET_FUN(__glewGetNamedBufferParameterui64vNV) +#define glIsBufferResidentNV GLEW_GET_FUN(__glewIsBufferResidentNV) +#define glIsNamedBufferResidentNV GLEW_GET_FUN(__glewIsNamedBufferResidentNV) +#define glMakeBufferNonResidentNV GLEW_GET_FUN(__glewMakeBufferNonResidentNV) +#define glMakeBufferResidentNV GLEW_GET_FUN(__glewMakeBufferResidentNV) +#define glMakeNamedBufferNonResidentNV GLEW_GET_FUN(__glewMakeNamedBufferNonResidentNV) +#define glMakeNamedBufferResidentNV GLEW_GET_FUN(__glewMakeNamedBufferResidentNV) +#define glProgramUniformui64NV GLEW_GET_FUN(__glewProgramUniformui64NV) +#define glProgramUniformui64vNV GLEW_GET_FUN(__glewProgramUniformui64vNV) +#define glUniformui64NV GLEW_GET_FUN(__glewUniformui64NV) +#define glUniformui64vNV GLEW_GET_FUN(__glewUniformui64vNV) + +#define GLEW_NV_shader_buffer_load GLEW_GET_VAR(__GLEW_NV_shader_buffer_load) + +#endif /* GL_NV_shader_buffer_load */ + +/* ---------------- GL_NV_shader_noperspective_interpolation --------------- */ + +#ifndef GL_NV_shader_noperspective_interpolation +#define GL_NV_shader_noperspective_interpolation 1 + +#define GLEW_NV_shader_noperspective_interpolation GLEW_GET_VAR(__GLEW_NV_shader_noperspective_interpolation) + +#endif /* GL_NV_shader_noperspective_interpolation */ + +/* ------------------- GL_NV_shader_storage_buffer_object ------------------ */ + +#ifndef GL_NV_shader_storage_buffer_object +#define GL_NV_shader_storage_buffer_object 1 + +#define GLEW_NV_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_NV_shader_storage_buffer_object) + +#endif /* GL_NV_shader_storage_buffer_object */ + +/* ----------------------- GL_NV_shader_thread_group ----------------------- */ + +#ifndef GL_NV_shader_thread_group +#define GL_NV_shader_thread_group 1 + +#define GL_WARP_SIZE_NV 0x9339 +#define GL_WARPS_PER_SM_NV 0x933A +#define GL_SM_COUNT_NV 0x933B + +#define GLEW_NV_shader_thread_group GLEW_GET_VAR(__GLEW_NV_shader_thread_group) + +#endif /* GL_NV_shader_thread_group */ + +/* ---------------------- GL_NV_shader_thread_shuffle ---------------------- */ + +#ifndef GL_NV_shader_thread_shuffle +#define GL_NV_shader_thread_shuffle 1 + +#define GLEW_NV_shader_thread_shuffle GLEW_GET_VAR(__GLEW_NV_shader_thread_shuffle) + +#endif /* GL_NV_shader_thread_shuffle */ + +/* ---------------------- GL_NV_shadow_samplers_array ---------------------- */ + +#ifndef GL_NV_shadow_samplers_array +#define GL_NV_shadow_samplers_array 1 + +#define GL_SAMPLER_2D_ARRAY_SHADOW_NV 0x8DC4 + +#define GLEW_NV_shadow_samplers_array GLEW_GET_VAR(__GLEW_NV_shadow_samplers_array) + +#endif /* GL_NV_shadow_samplers_array */ + +/* ----------------------- GL_NV_shadow_samplers_cube ---------------------- */ + +#ifndef GL_NV_shadow_samplers_cube +#define GL_NV_shadow_samplers_cube 1 + +#define GL_SAMPLER_CUBE_SHADOW_NV 0x8DC5 + +#define GLEW_NV_shadow_samplers_cube GLEW_GET_VAR(__GLEW_NV_shadow_samplers_cube) + +#endif /* GL_NV_shadow_samplers_cube */ + +/* ---------------------- GL_NV_stereo_view_rendering ---------------------- */ + +#ifndef GL_NV_stereo_view_rendering +#define GL_NV_stereo_view_rendering 1 + +#define GLEW_NV_stereo_view_rendering GLEW_GET_VAR(__GLEW_NV_stereo_view_rendering) + +#endif /* GL_NV_stereo_view_rendering */ + +/* ---------------------- GL_NV_tessellation_program5 ---------------------- */ + +#ifndef GL_NV_tessellation_program5 +#define GL_NV_tessellation_program5 1 + +#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 +#define GL_TESS_CONTROL_PROGRAM_NV 0x891E +#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F +#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 +#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 + +#define GLEW_NV_tessellation_program5 GLEW_GET_VAR(__GLEW_NV_tessellation_program5) + +#endif /* GL_NV_tessellation_program5 */ + /* -------------------------- GL_NV_texgen_emboss -------------------------- */ #ifndef GL_NV_texgen_emboss @@ -8451,6 +16430,99 @@ typedef void (GLAPIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage #endif /* GL_NV_texgen_reflection */ +/* -------------------------- GL_NV_texture_array -------------------------- */ + +#ifndef GL_NV_texture_array +#define GL_NV_texture_array 1 + +#define GL_UNPACK_SKIP_IMAGES_NV 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_NV 0x806E +#define GL_MAX_ARRAY_TEXTURE_LAYERS_NV 0x88FF +#define GL_TEXTURE_2D_ARRAY_NV 0x8C1A +#define GL_TEXTURE_BINDING_2D_ARRAY_NV 0x8C1D +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_NV 0x8CD4 +#define GL_SAMPLER_2D_ARRAY_NV 0x8DC1 + +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DNVPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DNVPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DNVPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERNVPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DNVPROC) (GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DNVPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); + +#define glCompressedTexImage3DNV GLEW_GET_FUN(__glewCompressedTexImage3DNV) +#define glCompressedTexSubImage3DNV GLEW_GET_FUN(__glewCompressedTexSubImage3DNV) +#define glCopyTexSubImage3DNV GLEW_GET_FUN(__glewCopyTexSubImage3DNV) +#define glFramebufferTextureLayerNV GLEW_GET_FUN(__glewFramebufferTextureLayerNV) +#define glTexImage3DNV GLEW_GET_FUN(__glewTexImage3DNV) +#define glTexSubImage3DNV GLEW_GET_FUN(__glewTexSubImage3DNV) + +#define GLEW_NV_texture_array GLEW_GET_VAR(__GLEW_NV_texture_array) + +#endif /* GL_NV_texture_array */ + +/* ------------------------- GL_NV_texture_barrier ------------------------- */ + +#ifndef GL_NV_texture_barrier +#define GL_NV_texture_barrier 1 + +typedef void (GLAPIENTRY * PFNGLTEXTUREBARRIERNVPROC) (void); + +#define glTextureBarrierNV GLEW_GET_FUN(__glewTextureBarrierNV) + +#define GLEW_NV_texture_barrier GLEW_GET_VAR(__GLEW_NV_texture_barrier) + +#endif /* GL_NV_texture_barrier */ + +/* ----------------------- GL_NV_texture_border_clamp ---------------------- */ + +#ifndef GL_NV_texture_border_clamp +#define GL_NV_texture_border_clamp 1 + +#define GL_TEXTURE_BORDER_COLOR_NV 0x1004 +#define GL_CLAMP_TO_BORDER_NV 0x812D + +#define GLEW_NV_texture_border_clamp GLEW_GET_VAR(__GLEW_NV_texture_border_clamp) + +#endif /* GL_NV_texture_border_clamp */ + +/* --------------------- GL_NV_texture_compression_latc -------------------- */ + +#ifndef GL_NV_texture_compression_latc +#define GL_NV_texture_compression_latc 1 + +#define GL_COMPRESSED_LUMINANCE_LATC1_NV 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_NV 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_NV 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_NV 0x8C73 + +#define GLEW_NV_texture_compression_latc GLEW_GET_VAR(__GLEW_NV_texture_compression_latc) + +#endif /* GL_NV_texture_compression_latc */ + +/* --------------------- GL_NV_texture_compression_s3tc -------------------- */ + +#ifndef GL_NV_texture_compression_s3tc +#define GL_NV_texture_compression_s3tc 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_NV 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_NV 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_NV 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_NV 0x83F3 + +#define GLEW_NV_texture_compression_s3tc GLEW_GET_VAR(__GLEW_NV_texture_compression_s3tc) + +#endif /* GL_NV_texture_compression_s3tc */ + +/* ----------------- GL_NV_texture_compression_s3tc_update ----------------- */ + +#ifndef GL_NV_texture_compression_s3tc_update +#define GL_NV_texture_compression_s3tc_update 1 + +#define GLEW_NV_texture_compression_s3tc_update GLEW_GET_VAR(__GLEW_NV_texture_compression_s3tc_update) + +#endif /* GL_NV_texture_compression_s3tc_update */ + /* --------------------- GL_NV_texture_compression_vtc --------------------- */ #ifndef GL_NV_texture_compression_vtc @@ -8486,6 +16558,41 @@ typedef void (GLAPIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage #endif /* GL_NV_texture_expand_normal */ +/* ----------------------- GL_NV_texture_multisample ----------------------- */ + +#ifndef GL_NV_texture_multisample +#define GL_NV_texture_multisample 1 + +#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 +#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); + +#define glTexImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage2DMultisampleCoverageNV) +#define glTexImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage3DMultisampleCoverageNV) +#define glTextureImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage2DMultisampleCoverageNV) +#define glTextureImage2DMultisampleNV GLEW_GET_FUN(__glewTextureImage2DMultisampleNV) +#define glTextureImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage3DMultisampleCoverageNV) +#define glTextureImage3DMultisampleNV GLEW_GET_FUN(__glewTextureImage3DMultisampleNV) + +#define GLEW_NV_texture_multisample GLEW_GET_VAR(__GLEW_NV_texture_multisample) + +#endif /* GL_NV_texture_multisample */ + +/* ---------------------- GL_NV_texture_npot_2D_mipmap --------------------- */ + +#ifndef GL_NV_texture_npot_2D_mipmap +#define GL_NV_texture_npot_2D_mipmap 1 + +#define GLEW_NV_texture_npot_2D_mipmap GLEW_GET_VAR(__GLEW_NV_texture_npot_2D_mipmap) + +#endif /* GL_NV_texture_npot_2D_mipmap */ + /* ------------------------ GL_NV_texture_rectangle ------------------------ */ #ifndef GL_NV_texture_rectangle @@ -8500,6 +16607,15 @@ typedef void (GLAPIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage #endif /* GL_NV_texture_rectangle */ +/* ------------------- GL_NV_texture_rectangle_compressed ------------------ */ + +#ifndef GL_NV_texture_rectangle_compressed +#define GL_NV_texture_rectangle_compressed 1 + +#define GLEW_NV_texture_rectangle_compressed GLEW_GET_VAR(__GLEW_NV_texture_rectangle_compressed) + +#endif /* GL_NV_texture_rectangle_compressed */ + /* -------------------------- GL_NV_texture_shader ------------------------- */ #ifndef GL_NV_texture_shader @@ -8520,8 +16636,8 @@ typedef void (GLAPIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage #define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 #define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 #define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 -#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 #define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 #define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 #define GL_CONST_EYE_NV 0x86E5 #define GL_PASS_THROUGH_NV 0x86E6 @@ -8707,6 +16823,87 @@ typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program #endif /* GL_NV_transform_feedback */ +/* ----------------------- GL_NV_transform_feedback2 ----------------------- */ + +#ifndef GL_NV_transform_feedback2 +#define GL_NV_transform_feedback2 1 + +#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 + +typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); +typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint* ids); +typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); + +#define glBindTransformFeedbackNV GLEW_GET_FUN(__glewBindTransformFeedbackNV) +#define glDeleteTransformFeedbacksNV GLEW_GET_FUN(__glewDeleteTransformFeedbacksNV) +#define glDrawTransformFeedbackNV GLEW_GET_FUN(__glewDrawTransformFeedbackNV) +#define glGenTransformFeedbacksNV GLEW_GET_FUN(__glewGenTransformFeedbacksNV) +#define glIsTransformFeedbackNV GLEW_GET_FUN(__glewIsTransformFeedbackNV) +#define glPauseTransformFeedbackNV GLEW_GET_FUN(__glewPauseTransformFeedbackNV) +#define glResumeTransformFeedbackNV GLEW_GET_FUN(__glewResumeTransformFeedbackNV) + +#define GLEW_NV_transform_feedback2 GLEW_GET_VAR(__GLEW_NV_transform_feedback2) + +#endif /* GL_NV_transform_feedback2 */ + +/* ------------------ GL_NV_uniform_buffer_unified_memory ------------------ */ + +#ifndef GL_NV_uniform_buffer_unified_memory +#define GL_NV_uniform_buffer_unified_memory 1 + +#define GL_UNIFORM_BUFFER_UNIFIED_NV 0x936E +#define GL_UNIFORM_BUFFER_ADDRESS_NV 0x936F +#define GL_UNIFORM_BUFFER_LENGTH_NV 0x9370 + +#define GLEW_NV_uniform_buffer_unified_memory GLEW_GET_VAR(__GLEW_NV_uniform_buffer_unified_memory) + +#endif /* GL_NV_uniform_buffer_unified_memory */ + +/* -------------------------- GL_NV_vdpau_interop -------------------------- */ + +#ifndef GL_NV_vdpau_interop +#define GL_NV_vdpau_interop 1 + +#define GL_SURFACE_STATE_NV 0x86EB +#define GL_SURFACE_REGISTERED_NV 0x86FD +#define GL_SURFACE_MAPPED_NV 0x8700 +#define GL_WRITE_DISCARD_NV 0x88BE + +typedef GLintptr GLvdpauSurfaceNV; + +typedef void (GLAPIENTRY * PFNGLVDPAUFININVPROC) (void); +typedef void (GLAPIENTRY * PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values); +typedef void (GLAPIENTRY * PFNGLVDPAUINITNVPROC) (const void* vdpDevice, const void*getProcAddress); +typedef void (GLAPIENTRY * PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef void (GLAPIENTRY * PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV* surfaces); +typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef void (GLAPIENTRY * PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); +typedef void (GLAPIENTRY * PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV* surfaces); +typedef void (GLAPIENTRY * PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); + +#define glVDPAUFiniNV GLEW_GET_FUN(__glewVDPAUFiniNV) +#define glVDPAUGetSurfaceivNV GLEW_GET_FUN(__glewVDPAUGetSurfaceivNV) +#define glVDPAUInitNV GLEW_GET_FUN(__glewVDPAUInitNV) +#define glVDPAUIsSurfaceNV GLEW_GET_FUN(__glewVDPAUIsSurfaceNV) +#define glVDPAUMapSurfacesNV GLEW_GET_FUN(__glewVDPAUMapSurfacesNV) +#define glVDPAURegisterOutputSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterOutputSurfaceNV) +#define glVDPAURegisterVideoSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterVideoSurfaceNV) +#define glVDPAUSurfaceAccessNV GLEW_GET_FUN(__glewVDPAUSurfaceAccessNV) +#define glVDPAUUnmapSurfacesNV GLEW_GET_FUN(__glewVDPAUUnmapSurfacesNV) +#define glVDPAUUnregisterSurfaceNV GLEW_GET_FUN(__glewVDPAUUnregisterSurfaceNV) + +#define GLEW_NV_vdpau_interop GLEW_GET_VAR(__GLEW_NV_vdpau_interop) + +#endif /* GL_NV_vdpau_interop */ + /* ------------------------ GL_NV_vertex_array_range ----------------------- */ #ifndef GL_NV_vertex_array_range @@ -8719,7 +16916,7 @@ typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program #define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, void* pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, void *pointer); #define glFlushVertexArrayRangeNV GLEW_GET_FUN(__glewFlushVertexArrayRangeNV) #define glVertexArrayRangeNV GLEW_GET_FUN(__glewVertexArrayRangeNV) @@ -8739,6 +16936,119 @@ typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, void* p #endif /* GL_NV_vertex_array_range2 */ +/* ------------------- GL_NV_vertex_attrib_integer_64bit ------------------- */ + +#ifndef GL_NV_vertex_attrib_integer_64bit +#define GL_NV_vertex_attrib_integer_64bit 1 + +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); + +#define glGetVertexAttribLi64vNV GLEW_GET_FUN(__glewGetVertexAttribLi64vNV) +#define glGetVertexAttribLui64vNV GLEW_GET_FUN(__glewGetVertexAttribLui64vNV) +#define glVertexAttribL1i64NV GLEW_GET_FUN(__glewVertexAttribL1i64NV) +#define glVertexAttribL1i64vNV GLEW_GET_FUN(__glewVertexAttribL1i64vNV) +#define glVertexAttribL1ui64NV GLEW_GET_FUN(__glewVertexAttribL1ui64NV) +#define glVertexAttribL1ui64vNV GLEW_GET_FUN(__glewVertexAttribL1ui64vNV) +#define glVertexAttribL2i64NV GLEW_GET_FUN(__glewVertexAttribL2i64NV) +#define glVertexAttribL2i64vNV GLEW_GET_FUN(__glewVertexAttribL2i64vNV) +#define glVertexAttribL2ui64NV GLEW_GET_FUN(__glewVertexAttribL2ui64NV) +#define glVertexAttribL2ui64vNV GLEW_GET_FUN(__glewVertexAttribL2ui64vNV) +#define glVertexAttribL3i64NV GLEW_GET_FUN(__glewVertexAttribL3i64NV) +#define glVertexAttribL3i64vNV GLEW_GET_FUN(__glewVertexAttribL3i64vNV) +#define glVertexAttribL3ui64NV GLEW_GET_FUN(__glewVertexAttribL3ui64NV) +#define glVertexAttribL3ui64vNV GLEW_GET_FUN(__glewVertexAttribL3ui64vNV) +#define glVertexAttribL4i64NV GLEW_GET_FUN(__glewVertexAttribL4i64NV) +#define glVertexAttribL4i64vNV GLEW_GET_FUN(__glewVertexAttribL4i64vNV) +#define glVertexAttribL4ui64NV GLEW_GET_FUN(__glewVertexAttribL4ui64NV) +#define glVertexAttribL4ui64vNV GLEW_GET_FUN(__glewVertexAttribL4ui64vNV) +#define glVertexAttribLFormatNV GLEW_GET_FUN(__glewVertexAttribLFormatNV) + +#define GLEW_NV_vertex_attrib_integer_64bit GLEW_GET_VAR(__GLEW_NV_vertex_attrib_integer_64bit) + +#endif /* GL_NV_vertex_attrib_integer_64bit */ + +/* ------------------- GL_NV_vertex_buffer_unified_memory ------------------ */ + +#ifndef GL_NV_vertex_buffer_unified_memory +#define GL_NV_vertex_buffer_unified_memory 1 + +#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E +#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F +#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 +#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 +#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 +#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 +#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 +#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 +#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 +#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 +#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 +#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 +#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A +#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B +#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C +#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D +#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E +#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F +#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 +#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 +#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 +#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 +#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 +#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 +#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 + +typedef void (GLAPIENTRY * PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT result[]); +typedef void (GLAPIENTRY * PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); + +#define glBufferAddressRangeNV GLEW_GET_FUN(__glewBufferAddressRangeNV) +#define glColorFormatNV GLEW_GET_FUN(__glewColorFormatNV) +#define glEdgeFlagFormatNV GLEW_GET_FUN(__glewEdgeFlagFormatNV) +#define glFogCoordFormatNV GLEW_GET_FUN(__glewFogCoordFormatNV) +#define glGetIntegerui64i_vNV GLEW_GET_FUN(__glewGetIntegerui64i_vNV) +#define glIndexFormatNV GLEW_GET_FUN(__glewIndexFormatNV) +#define glNormalFormatNV GLEW_GET_FUN(__glewNormalFormatNV) +#define glSecondaryColorFormatNV GLEW_GET_FUN(__glewSecondaryColorFormatNV) +#define glTexCoordFormatNV GLEW_GET_FUN(__glewTexCoordFormatNV) +#define glVertexAttribFormatNV GLEW_GET_FUN(__glewVertexAttribFormatNV) +#define glVertexAttribIFormatNV GLEW_GET_FUN(__glewVertexAttribIFormatNV) +#define glVertexFormatNV GLEW_GET_FUN(__glewVertexFormatNV) + +#define GLEW_NV_vertex_buffer_unified_memory GLEW_GET_VAR(__GLEW_NV_vertex_buffer_unified_memory) + +#endif /* GL_NV_vertex_buffer_unified_memory */ + /* -------------------------- GL_NV_vertex_program ------------------------- */ #ifndef GL_NV_vertex_program @@ -8838,7 +17148,7 @@ typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLu typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte* program); typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, void** pointer); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint* params); @@ -8848,8 +17158,8 @@ typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble* params); typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint num, const GLdouble* params); -typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint num, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, GLuint* ids); typedef void (GLAPIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); @@ -8878,7 +17188,7 @@ typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); @@ -9008,76 +17318,165 @@ typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei #ifndef GL_NV_vertex_program4 #define GL_NV_vertex_program4 1 +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD + #define GLEW_NV_vertex_program4 GLEW_GET_VAR(__GLEW_NV_vertex_program4) #endif /* GL_NV_vertex_program4 */ +/* -------------------------- GL_NV_video_capture -------------------------- */ + +#ifndef GL_NV_video_capture +#define GL_NV_video_capture 1 + +#define GL_VIDEO_BUFFER_NV 0x9020 +#define GL_VIDEO_BUFFER_BINDING_NV 0x9021 +#define GL_FIELD_UPPER_NV 0x9022 +#define GL_FIELD_LOWER_NV 0x9023 +#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 +#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 +#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 +#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 +#define GL_VIDEO_BUFFER_PITCH_NV 0x9028 +#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 +#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A +#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B +#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C +#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D +#define GL_PARTIAL_SUCCESS_NV 0x902E +#define GL_SUCCESS_NV 0x902F +#define GL_FAILURE_NV 0x9030 +#define GL_YCBYCR8_422_NV 0x9031 +#define GL_YCBAYCR8A_4224_NV 0x9032 +#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 +#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 +#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 +#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 +#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 +#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 +#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 +#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A +#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B +#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C + +typedef void (GLAPIENTRY * PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); +typedef void (GLAPIENTRY * PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint* params); +typedef GLenum (GLAPIENTRY * PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint* sequence_num, GLuint64EXT *capture_time); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint* params); + +#define glBeginVideoCaptureNV GLEW_GET_FUN(__glewBeginVideoCaptureNV) +#define glBindVideoCaptureStreamBufferNV GLEW_GET_FUN(__glewBindVideoCaptureStreamBufferNV) +#define glBindVideoCaptureStreamTextureNV GLEW_GET_FUN(__glewBindVideoCaptureStreamTextureNV) +#define glEndVideoCaptureNV GLEW_GET_FUN(__glewEndVideoCaptureNV) +#define glGetVideoCaptureStreamdvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamdvNV) +#define glGetVideoCaptureStreamfvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamfvNV) +#define glGetVideoCaptureStreamivNV GLEW_GET_FUN(__glewGetVideoCaptureStreamivNV) +#define glGetVideoCaptureivNV GLEW_GET_FUN(__glewGetVideoCaptureivNV) +#define glVideoCaptureNV GLEW_GET_FUN(__glewVideoCaptureNV) +#define glVideoCaptureStreamParameterdvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterdvNV) +#define glVideoCaptureStreamParameterfvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterfvNV) +#define glVideoCaptureStreamParameterivNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterivNV) + +#define GLEW_NV_video_capture GLEW_GET_VAR(__GLEW_NV_video_capture) + +#endif /* GL_NV_video_capture */ + +/* -------------------------- GL_NV_viewport_array ------------------------- */ + +#ifndef GL_NV_viewport_array +#define GL_NV_viewport_array 1 + +#define GL_DEPTH_RANGE 0x0B70 +#define GL_VIEWPORT 0x0BA2 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_MAX_VIEWPORTS_NV 0x825B +#define GL_VIEWPORT_SUBPIXEL_BITS_NV 0x825C +#define GL_VIEWPORT_BOUNDS_RANGE_NV 0x825D +#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX_NV 0x825F + +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEARRAYFVNVPROC) (GLuint first, GLsizei count, const GLfloat * v); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEINDEXEDFNVPROC) (GLuint index, GLfloat n, GLfloat f); +typedef void (GLAPIENTRY * PFNGLDISABLEINVPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEINVPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETFLOATI_VNVPROC) (GLenum target, GLuint index, GLfloat* data); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDINVPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLSCISSORARRAYVNVPROC) (GLuint first, GLsizei count, const GLint * v); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDNVPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDVNVPROC) (GLuint index, const GLint * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTARRAYVNVPROC) (GLuint first, GLsizei count, const GLfloat * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFVNVPROC) (GLuint index, const GLfloat * v); + +#define glDepthRangeArrayfvNV GLEW_GET_FUN(__glewDepthRangeArrayfvNV) +#define glDepthRangeIndexedfNV GLEW_GET_FUN(__glewDepthRangeIndexedfNV) +#define glDisableiNV GLEW_GET_FUN(__glewDisableiNV) +#define glEnableiNV GLEW_GET_FUN(__glewEnableiNV) +#define glGetFloati_vNV GLEW_GET_FUN(__glewGetFloati_vNV) +#define glIsEnablediNV GLEW_GET_FUN(__glewIsEnablediNV) +#define glScissorArrayvNV GLEW_GET_FUN(__glewScissorArrayvNV) +#define glScissorIndexedNV GLEW_GET_FUN(__glewScissorIndexedNV) +#define glScissorIndexedvNV GLEW_GET_FUN(__glewScissorIndexedvNV) +#define glViewportArrayvNV GLEW_GET_FUN(__glewViewportArrayvNV) +#define glViewportIndexedfNV GLEW_GET_FUN(__glewViewportIndexedfNV) +#define glViewportIndexedfvNV GLEW_GET_FUN(__glewViewportIndexedfvNV) + +#define GLEW_NV_viewport_array GLEW_GET_VAR(__GLEW_NV_viewport_array) + +#endif /* GL_NV_viewport_array */ + +/* ------------------------- GL_NV_viewport_array2 ------------------------- */ + +#ifndef GL_NV_viewport_array2 +#define GL_NV_viewport_array2 1 + +#define GLEW_NV_viewport_array2 GLEW_GET_VAR(__GLEW_NV_viewport_array2) + +#endif /* GL_NV_viewport_array2 */ + +/* ------------------------- GL_NV_viewport_swizzle ------------------------ */ + +#ifndef GL_NV_viewport_swizzle +#define GL_NV_viewport_swizzle 1 + +#define GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV 0x9350 +#define GL_VIEWPORT_SWIZZLE_NEGATIVE_X_NV 0x9351 +#define GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV 0x9352 +#define GL_VIEWPORT_SWIZZLE_NEGATIVE_Y_NV 0x9353 +#define GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV 0x9354 +#define GL_VIEWPORT_SWIZZLE_NEGATIVE_Z_NV 0x9355 +#define GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV 0x9356 +#define GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV 0x9357 +#define GL_VIEWPORT_SWIZZLE_X_NV 0x9358 +#define GL_VIEWPORT_SWIZZLE_Y_NV 0x9359 +#define GL_VIEWPORT_SWIZZLE_Z_NV 0x935A +#define GL_VIEWPORT_SWIZZLE_W_NV 0x935B + +typedef void (GLAPIENTRY * PFNGLVIEWPORTSWIZZLENVPROC) (GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew); + +#define glViewportSwizzleNV GLEW_GET_FUN(__glewViewportSwizzleNV) + +#define GLEW_NV_viewport_swizzle GLEW_GET_VAR(__GLEW_NV_viewport_swizzle) + +#endif /* GL_NV_viewport_swizzle */ + /* ------------------------ GL_OES_byte_coordinates ------------------------ */ #ifndef GL_OES_byte_coordinates #define GL_OES_byte_coordinates 1 -#define GL_BYTE 0x1400 - #define GLEW_OES_byte_coordinates GLEW_GET_VAR(__GLEW_OES_byte_coordinates) #endif /* GL_OES_byte_coordinates */ -/* ------------------- GL_OES_compressed_paletted_texture ------------------ */ - -#ifndef GL_OES_compressed_paletted_texture -#define GL_OES_compressed_paletted_texture 1 - -#define GL_PALETTE4_RGB8_OES 0x8B90 -#define GL_PALETTE4_RGBA8_OES 0x8B91 -#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 -#define GL_PALETTE4_RGBA4_OES 0x8B93 -#define GL_PALETTE4_RGB5_A1_OES 0x8B94 -#define GL_PALETTE8_RGB8_OES 0x8B95 -#define GL_PALETTE8_RGBA8_OES 0x8B96 -#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 -#define GL_PALETTE8_RGBA4_OES 0x8B98 -#define GL_PALETTE8_RGB5_A1_OES 0x8B99 - -#define GLEW_OES_compressed_paletted_texture GLEW_GET_VAR(__GLEW_OES_compressed_paletted_texture) - -#endif /* GL_OES_compressed_paletted_texture */ - -/* --------------------------- GL_OES_read_format -------------------------- */ - -#ifndef GL_OES_read_format -#define GL_OES_read_format 1 - -#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B - -#define GLEW_OES_read_format GLEW_GET_VAR(__GLEW_OES_read_format) - -#endif /* GL_OES_read_format */ - -/* ------------------------ GL_OES_single_precision ------------------------ */ - -#ifndef GL_OES_single_precision -#define GL_OES_single_precision 1 - -typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFOESPROC) (GLclampd depth); -typedef void (GLAPIENTRY * PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat* equation); -typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f); -typedef void (GLAPIENTRY * PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); -typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat* equation); -typedef void (GLAPIENTRY * PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); - -#define glClearDepthfOES GLEW_GET_FUN(__glewClearDepthfOES) -#define glClipPlanefOES GLEW_GET_FUN(__glewClipPlanefOES) -#define glDepthRangefOES GLEW_GET_FUN(__glewDepthRangefOES) -#define glFrustumfOES GLEW_GET_FUN(__glewFrustumfOES) -#define glGetClipPlanefOES GLEW_GET_FUN(__glewGetClipPlanefOES) -#define glOrthofOES GLEW_GET_FUN(__glewOrthofOES) - -#define GLEW_OES_single_precision GLEW_GET_VAR(__GLEW_OES_single_precision) - -#endif /* GL_OES_single_precision */ - /* ---------------------------- GL_OML_interlace --------------------------- */ #ifndef GL_OML_interlace @@ -9118,6 +17517,46 @@ typedef void (GLAPIENTRY * PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, #endif /* GL_OML_subsample */ +/* ---------------------------- GL_OVR_multiview --------------------------- */ + +#ifndef GL_OVR_multiview +#define GL_OVR_multiview 1 + +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630 +#define GL_MAX_VIEWS_OVR 0x9631 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR 0x9632 +#define GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR 0x9633 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); + +#define glFramebufferTextureMultiviewOVR GLEW_GET_FUN(__glewFramebufferTextureMultiviewOVR) + +#define GLEW_OVR_multiview GLEW_GET_VAR(__GLEW_OVR_multiview) + +#endif /* GL_OVR_multiview */ + +/* --------------------------- GL_OVR_multiview2 --------------------------- */ + +#ifndef GL_OVR_multiview2 +#define GL_OVR_multiview2 1 + +#define GLEW_OVR_multiview2 GLEW_GET_VAR(__GLEW_OVR_multiview2) + +#endif /* GL_OVR_multiview2 */ + +/* ------------ GL_OVR_multiview_multisampled_render_to_texture ------------ */ + +#ifndef GL_OVR_multiview_multisampled_render_to_texture +#define GL_OVR_multiview_multisampled_render_to_texture 1 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLsizei samples, GLint baseViewIndex, GLsizei numViews); + +#define glFramebufferTextureMultisampleMultiviewOVR GLEW_GET_FUN(__glewFramebufferTextureMultisampleMultiviewOVR) + +#define GLEW_OVR_multiview_multisampled_render_to_texture GLEW_GET_VAR(__GLEW_OVR_multiview_multisampled_render_to_texture) + +#endif /* GL_OVR_multiview_multisampled_render_to_texture */ + /* --------------------------- GL_PGI_misc_hints --------------------------- */ #ifndef GL_PGI_misc_hints @@ -9180,6 +17619,416 @@ typedef void (GLAPIENTRY * PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, #endif /* GL_PGI_vertex_hints */ +/* --------------------------- GL_QCOM_alpha_test -------------------------- */ + +#ifndef GL_QCOM_alpha_test +#define GL_QCOM_alpha_test 1 + +#define GL_ALPHA_TEST_QCOM 0x0BC0 +#define GL_ALPHA_TEST_FUNC_QCOM 0x0BC1 +#define GL_ALPHA_TEST_REF_QCOM 0x0BC2 + +typedef void (GLAPIENTRY * PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref); + +#define glAlphaFuncQCOM GLEW_GET_FUN(__glewAlphaFuncQCOM) + +#define GLEW_QCOM_alpha_test GLEW_GET_VAR(__GLEW_QCOM_alpha_test) + +#endif /* GL_QCOM_alpha_test */ + +/* ------------------------ GL_QCOM_binning_control ------------------------ */ + +#ifndef GL_QCOM_binning_control +#define GL_QCOM_binning_control 1 + +#define GL_DONT_CARE 0x1100 +#define GL_BINNING_CONTROL_HINT_QCOM 0x8FB0 +#define GL_CPU_OPTIMIZED_QCOM 0x8FB1 +#define GL_GPU_OPTIMIZED_QCOM 0x8FB2 +#define GL_RENDER_DIRECT_TO_FRAMEBUFFER_QCOM 0x8FB3 + +#define GLEW_QCOM_binning_control GLEW_GET_VAR(__GLEW_QCOM_binning_control) + +#endif /* GL_QCOM_binning_control */ + +/* ------------------------- GL_QCOM_driver_control ------------------------ */ + +#ifndef GL_QCOM_driver_control +#define GL_QCOM_driver_control 1 + +typedef void (GLAPIENTRY * PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); +typedef void (GLAPIENTRY * PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); +typedef void (GLAPIENTRY * PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei* length, GLchar *driverControlString); +typedef void (GLAPIENTRY * PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint* num, GLsizei size, GLuint *driverControls); + +#define glDisableDriverControlQCOM GLEW_GET_FUN(__glewDisableDriverControlQCOM) +#define glEnableDriverControlQCOM GLEW_GET_FUN(__glewEnableDriverControlQCOM) +#define glGetDriverControlStringQCOM GLEW_GET_FUN(__glewGetDriverControlStringQCOM) +#define glGetDriverControlsQCOM GLEW_GET_FUN(__glewGetDriverControlsQCOM) + +#define GLEW_QCOM_driver_control GLEW_GET_VAR(__GLEW_QCOM_driver_control) + +#endif /* GL_QCOM_driver_control */ + +/* -------------------------- GL_QCOM_extended_get ------------------------- */ + +#ifndef GL_QCOM_extended_get +#define GL_QCOM_extended_get 1 + +#define GL_TEXTURE_WIDTH_QCOM 0x8BD2 +#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3 +#define GL_TEXTURE_DEPTH_QCOM 0x8BD4 +#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5 +#define GL_TEXTURE_FORMAT_QCOM 0x8BD6 +#define GL_TEXTURE_TYPE_QCOM 0x8BD7 +#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8 +#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9 +#define GL_TEXTURE_TARGET_QCOM 0x8BDA +#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB +#define GL_STATE_RESTORE 0x8BDC + +typedef void (GLAPIENTRY * PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, void** params); +typedef void (GLAPIENTRY * PFNGLEXTGETBUFFERSQCOMPROC) (GLuint* buffers, GLint maxBuffers, GLint* numBuffers); +typedef void (GLAPIENTRY * PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers); +typedef void (GLAPIENTRY * PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers); +typedef void (GLAPIENTRY * PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels); +typedef void (GLAPIENTRY * PFNGLEXTGETTEXTURESQCOMPROC) (GLuint* textures, GLint maxTextures, GLint* numTextures); +typedef void (GLAPIENTRY * PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param); + +#define glExtGetBufferPointervQCOM GLEW_GET_FUN(__glewExtGetBufferPointervQCOM) +#define glExtGetBuffersQCOM GLEW_GET_FUN(__glewExtGetBuffersQCOM) +#define glExtGetFramebuffersQCOM GLEW_GET_FUN(__glewExtGetFramebuffersQCOM) +#define glExtGetRenderbuffersQCOM GLEW_GET_FUN(__glewExtGetRenderbuffersQCOM) +#define glExtGetTexLevelParameterivQCOM GLEW_GET_FUN(__glewExtGetTexLevelParameterivQCOM) +#define glExtGetTexSubImageQCOM GLEW_GET_FUN(__glewExtGetTexSubImageQCOM) +#define glExtGetTexturesQCOM GLEW_GET_FUN(__glewExtGetTexturesQCOM) +#define glExtTexObjectStateOverrideiQCOM GLEW_GET_FUN(__glewExtTexObjectStateOverrideiQCOM) + +#define GLEW_QCOM_extended_get GLEW_GET_VAR(__GLEW_QCOM_extended_get) + +#endif /* GL_QCOM_extended_get */ + +/* ------------------------- GL_QCOM_extended_get2 ------------------------- */ + +#ifndef GL_QCOM_extended_get2 +#define GL_QCOM_extended_get2 1 + +typedef void (GLAPIENTRY * PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar* source, GLint* length); +typedef void (GLAPIENTRY * PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint* programs, GLint maxPrograms, GLint* numPrograms); +typedef void (GLAPIENTRY * PFNGLEXTGETSHADERSQCOMPROC) (GLuint* shaders, GLint maxShaders, GLint* numShaders); +typedef GLboolean (GLAPIENTRY * PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program); + +#define glExtGetProgramBinarySourceQCOM GLEW_GET_FUN(__glewExtGetProgramBinarySourceQCOM) +#define glExtGetProgramsQCOM GLEW_GET_FUN(__glewExtGetProgramsQCOM) +#define glExtGetShadersQCOM GLEW_GET_FUN(__glewExtGetShadersQCOM) +#define glExtIsProgramBinaryQCOM GLEW_GET_FUN(__glewExtIsProgramBinaryQCOM) + +#define GLEW_QCOM_extended_get2 GLEW_GET_VAR(__GLEW_QCOM_extended_get2) + +#endif /* GL_QCOM_extended_get2 */ + +/* ---------------------- GL_QCOM_framebuffer_foveated --------------------- */ + +#ifndef GL_QCOM_framebuffer_foveated +#define GL_QCOM_framebuffer_foveated 1 + +#define GL_FOVEATION_ENABLE_BIT_QCOM 0x1 +#define GL_FOVEATION_SCALED_BIN_METHOD_BIT_QCOM 0x2 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERFOVEATIONCONFIGQCOMPROC) (GLuint fbo, GLuint numLayers, GLuint focalPointsPerLayer, GLuint requestedFeatures, GLuint* providedFeatures); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERFOVEATIONPARAMETERSQCOMPROC) (GLuint fbo, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea); + +#define glFramebufferFoveationConfigQCOM GLEW_GET_FUN(__glewFramebufferFoveationConfigQCOM) +#define glFramebufferFoveationParametersQCOM GLEW_GET_FUN(__glewFramebufferFoveationParametersQCOM) + +#define GLEW_QCOM_framebuffer_foveated GLEW_GET_VAR(__GLEW_QCOM_framebuffer_foveated) + +#endif /* GL_QCOM_framebuffer_foveated */ + +/* ---------------------- GL_QCOM_perfmon_global_mode ---------------------- */ + +#ifndef GL_QCOM_perfmon_global_mode +#define GL_QCOM_perfmon_global_mode 1 + +#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0 + +#define GLEW_QCOM_perfmon_global_mode GLEW_GET_VAR(__GLEW_QCOM_perfmon_global_mode) + +#endif /* GL_QCOM_perfmon_global_mode */ + +/* -------------- GL_QCOM_shader_framebuffer_fetch_noncoherent ------------- */ + +#ifndef GL_QCOM_shader_framebuffer_fetch_noncoherent +#define GL_QCOM_shader_framebuffer_fetch_noncoherent 1 + +#define GL_FRAMEBUFFER_FETCH_NONCOHERENT_QCOM 0x96A2 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERFETCHBARRIERQCOMPROC) (void); + +#define glFramebufferFetchBarrierQCOM GLEW_GET_FUN(__glewFramebufferFetchBarrierQCOM) + +#define GLEW_QCOM_shader_framebuffer_fetch_noncoherent GLEW_GET_VAR(__GLEW_QCOM_shader_framebuffer_fetch_noncoherent) + +#endif /* GL_QCOM_shader_framebuffer_fetch_noncoherent */ + +/* ------------------------ GL_QCOM_tiled_rendering ------------------------ */ + +#ifndef GL_QCOM_tiled_rendering +#define GL_QCOM_tiled_rendering 1 + +#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001 +#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002 +#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004 +#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008 +#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010 +#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020 +#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040 +#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080 +#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100 +#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200 +#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400 +#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800 +#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000 +#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000 +#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000 +#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000 +#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000 +#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000 +#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000 +#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000 +#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000 +#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000 +#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000 +#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000 +#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000 +#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000 +#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000 +#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000 +#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000 +#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000 +#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000 +#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000 + +typedef void (GLAPIENTRY * PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask); +typedef void (GLAPIENTRY * PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); + +#define glEndTilingQCOM GLEW_GET_FUN(__glewEndTilingQCOM) +#define glStartTilingQCOM GLEW_GET_FUN(__glewStartTilingQCOM) + +#define GLEW_QCOM_tiled_rendering GLEW_GET_VAR(__GLEW_QCOM_tiled_rendering) + +#endif /* GL_QCOM_tiled_rendering */ + +/* ---------------------- GL_QCOM_writeonly_rendering ---------------------- */ + +#ifndef GL_QCOM_writeonly_rendering +#define GL_QCOM_writeonly_rendering 1 + +#define GL_WRITEONLY_RENDERING_QCOM 0x8823 + +#define GLEW_QCOM_writeonly_rendering GLEW_GET_VAR(__GLEW_QCOM_writeonly_rendering) + +#endif /* GL_QCOM_writeonly_rendering */ + +/* ---------------------- GL_REGAL_ES1_0_compatibility --------------------- */ + +#ifndef GL_REGAL_ES1_0_compatibility +#define GL_REGAL_ES1_0_compatibility 1 + +typedef int GLclampx; + +typedef void (GLAPIENTRY * PFNGLALPHAFUNCXPROC) (GLenum func, GLclampx ref); +typedef void (GLAPIENTRY * PFNGLCLEARCOLORXPROC) (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha); +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHXPROC) (GLclampx depth); +typedef void (GLAPIENTRY * PFNGLCOLOR4XPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEXPROC) (GLclampx zNear, GLclampx zFar); +typedef void (GLAPIENTRY * PFNGLFOGXPROC) (GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLFOGXVPROC) (GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLFRUSTUMFPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +typedef void (GLAPIENTRY * PFNGLFRUSTUMXPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +typedef void (GLAPIENTRY * PFNGLLIGHTMODELXPROC) (GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLLIGHTMODELXVPROC) (GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLLIGHTXPROC) (GLenum light, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLLIGHTXVPROC) (GLenum light, GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLLINEWIDTHXPROC) (GLfixed width); +typedef void (GLAPIENTRY * PFNGLLOADMATRIXXPROC) (const GLfixed* m); +typedef void (GLAPIENTRY * PFNGLMATERIALXPROC) (GLenum face, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLMATERIALXVPROC) (GLenum face, GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLMULTMATRIXXPROC) (const GLfixed* m); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4XPROC) (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +typedef void (GLAPIENTRY * PFNGLNORMAL3XPROC) (GLfixed nx, GLfixed ny, GLfixed nz); +typedef void (GLAPIENTRY * PFNGLORTHOFPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +typedef void (GLAPIENTRY * PFNGLORTHOXPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +typedef void (GLAPIENTRY * PFNGLPOINTSIZEXPROC) (GLfixed size); +typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETXPROC) (GLfixed factor, GLfixed units); +typedef void (GLAPIENTRY * PFNGLROTATEXPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEXPROC) (GLclampx value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSCALEXPROC) (GLfixed x, GLfixed y, GLfixed z); +typedef void (GLAPIENTRY * PFNGLTEXENVXPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLTEXENVXVPROC) (GLenum target, GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERXPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLTRANSLATEXPROC) (GLfixed x, GLfixed y, GLfixed z); + +#define glAlphaFuncx GLEW_GET_FUN(__glewAlphaFuncx) +#define glClearColorx GLEW_GET_FUN(__glewClearColorx) +#define glClearDepthx GLEW_GET_FUN(__glewClearDepthx) +#define glColor4x GLEW_GET_FUN(__glewColor4x) +#define glDepthRangex GLEW_GET_FUN(__glewDepthRangex) +#define glFogx GLEW_GET_FUN(__glewFogx) +#define glFogxv GLEW_GET_FUN(__glewFogxv) +#define glFrustumf GLEW_GET_FUN(__glewFrustumf) +#define glFrustumx GLEW_GET_FUN(__glewFrustumx) +#define glLightModelx GLEW_GET_FUN(__glewLightModelx) +#define glLightModelxv GLEW_GET_FUN(__glewLightModelxv) +#define glLightx GLEW_GET_FUN(__glewLightx) +#define glLightxv GLEW_GET_FUN(__glewLightxv) +#define glLineWidthx GLEW_GET_FUN(__glewLineWidthx) +#define glLoadMatrixx GLEW_GET_FUN(__glewLoadMatrixx) +#define glMaterialx GLEW_GET_FUN(__glewMaterialx) +#define glMaterialxv GLEW_GET_FUN(__glewMaterialxv) +#define glMultMatrixx GLEW_GET_FUN(__glewMultMatrixx) +#define glMultiTexCoord4x GLEW_GET_FUN(__glewMultiTexCoord4x) +#define glNormal3x GLEW_GET_FUN(__glewNormal3x) +#define glOrthof GLEW_GET_FUN(__glewOrthof) +#define glOrthox GLEW_GET_FUN(__glewOrthox) +#define glPointSizex GLEW_GET_FUN(__glewPointSizex) +#define glPolygonOffsetx GLEW_GET_FUN(__glewPolygonOffsetx) +#define glRotatex GLEW_GET_FUN(__glewRotatex) +#define glSampleCoveragex GLEW_GET_FUN(__glewSampleCoveragex) +#define glScalex GLEW_GET_FUN(__glewScalex) +#define glTexEnvx GLEW_GET_FUN(__glewTexEnvx) +#define glTexEnvxv GLEW_GET_FUN(__glewTexEnvxv) +#define glTexParameterx GLEW_GET_FUN(__glewTexParameterx) +#define glTranslatex GLEW_GET_FUN(__glewTranslatex) + +#define GLEW_REGAL_ES1_0_compatibility GLEW_GET_VAR(__GLEW_REGAL_ES1_0_compatibility) + +#endif /* GL_REGAL_ES1_0_compatibility */ + +/* ---------------------- GL_REGAL_ES1_1_compatibility --------------------- */ + +#ifndef GL_REGAL_ES1_1_compatibility +#define GL_REGAL_ES1_1_compatibility 1 + +typedef void (GLAPIENTRY * PFNGLCLIPPLANEFPROC) (GLenum plane, const GLfloat* equation); +typedef void (GLAPIENTRY * PFNGLCLIPPLANEXPROC) (GLenum plane, const GLfixed* equation); +typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFPROC) (GLenum pname, GLfloat eqn[4]); +typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEXPROC) (GLenum pname, GLfixed eqn[4]); +typedef void (GLAPIENTRY * PFNGLGETFIXEDVPROC) (GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETLIGHTXVPROC) (GLenum light, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETMATERIALXVPROC) (GLenum face, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETTEXENVXVPROC) (GLenum env, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERXVPROC) (GLenum target, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERXPROC) (GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERXVPROC) (GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLPOINTSIZEPOINTEROESPROC) (GLenum type, GLsizei stride, const void *pointer); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERXVPROC) (GLenum target, GLenum pname, const GLfixed* params); + +#define glClipPlanef GLEW_GET_FUN(__glewClipPlanef) +#define glClipPlanex GLEW_GET_FUN(__glewClipPlanex) +#define glGetClipPlanef GLEW_GET_FUN(__glewGetClipPlanef) +#define glGetClipPlanex GLEW_GET_FUN(__glewGetClipPlanex) +#define glGetFixedv GLEW_GET_FUN(__glewGetFixedv) +#define glGetLightxv GLEW_GET_FUN(__glewGetLightxv) +#define glGetMaterialxv GLEW_GET_FUN(__glewGetMaterialxv) +#define glGetTexEnvxv GLEW_GET_FUN(__glewGetTexEnvxv) +#define glGetTexParameterxv GLEW_GET_FUN(__glewGetTexParameterxv) +#define glPointParameterx GLEW_GET_FUN(__glewPointParameterx) +#define glPointParameterxv GLEW_GET_FUN(__glewPointParameterxv) +#define glPointSizePointerOES GLEW_GET_FUN(__glewPointSizePointerOES) +#define glTexParameterxv GLEW_GET_FUN(__glewTexParameterxv) + +#define GLEW_REGAL_ES1_1_compatibility GLEW_GET_VAR(__GLEW_REGAL_ES1_1_compatibility) + +#endif /* GL_REGAL_ES1_1_compatibility */ + +/* ---------------------------- GL_REGAL_enable ---------------------------- */ + +#ifndef GL_REGAL_enable +#define GL_REGAL_enable 1 + +#define GL_ERROR_REGAL 0x9322 +#define GL_DEBUG_REGAL 0x9323 +#define GL_LOG_REGAL 0x9324 +#define GL_EMULATION_REGAL 0x9325 +#define GL_DRIVER_REGAL 0x9326 +#define GL_MISSING_REGAL 0x9360 +#define GL_TRACE_REGAL 0x9361 +#define GL_CACHE_REGAL 0x9362 +#define GL_CODE_REGAL 0x9363 +#define GL_STATISTICS_REGAL 0x9364 + +#define GLEW_REGAL_enable GLEW_GET_VAR(__GLEW_REGAL_enable) + +#endif /* GL_REGAL_enable */ + +/* ------------------------- GL_REGAL_error_string ------------------------- */ + +#ifndef GL_REGAL_error_string +#define GL_REGAL_error_string 1 + +typedef const GLchar* (GLAPIENTRY * PFNGLERRORSTRINGREGALPROC) (GLenum error); + +#define glErrorStringREGAL GLEW_GET_FUN(__glewErrorStringREGAL) + +#define GLEW_REGAL_error_string GLEW_GET_VAR(__GLEW_REGAL_error_string) + +#endif /* GL_REGAL_error_string */ + +/* ------------------------ GL_REGAL_extension_query ----------------------- */ + +#ifndef GL_REGAL_extension_query +#define GL_REGAL_extension_query 1 + +typedef GLboolean (GLAPIENTRY * PFNGLGETEXTENSIONREGALPROC) (const GLchar* ext); +typedef GLboolean (GLAPIENTRY * PFNGLISSUPPORTEDREGALPROC) (const GLchar* ext); + +#define glGetExtensionREGAL GLEW_GET_FUN(__glewGetExtensionREGAL) +#define glIsSupportedREGAL GLEW_GET_FUN(__glewIsSupportedREGAL) + +#define GLEW_REGAL_extension_query GLEW_GET_VAR(__GLEW_REGAL_extension_query) + +#endif /* GL_REGAL_extension_query */ + +/* ------------------------------ GL_REGAL_log ----------------------------- */ + +#ifndef GL_REGAL_log +#define GL_REGAL_log 1 + +#define GL_LOG_ERROR_REGAL 0x9319 +#define GL_LOG_WARNING_REGAL 0x931A +#define GL_LOG_INFO_REGAL 0x931B +#define GL_LOG_APP_REGAL 0x931C +#define GL_LOG_DRIVER_REGAL 0x931D +#define GL_LOG_INTERNAL_REGAL 0x931E +#define GL_LOG_DEBUG_REGAL 0x931F +#define GL_LOG_STATUS_REGAL 0x9320 +#define GL_LOG_HTTP_REGAL 0x9321 + +typedef void (APIENTRY *GLLOGPROCREGAL)(GLenum stream, GLsizei length, const GLchar *message, void *context); + +typedef void (GLAPIENTRY * PFNGLLOGMESSAGECALLBACKREGALPROC) (GLLOGPROCREGAL callback); + +#define glLogMessageCallbackREGAL GLEW_GET_FUN(__glewLogMessageCallbackREGAL) + +#define GLEW_REGAL_log GLEW_GET_VAR(__GLEW_REGAL_log) + +#endif /* GL_REGAL_log */ + +/* ------------------------- GL_REGAL_proc_address ------------------------- */ + +#ifndef GL_REGAL_proc_address +#define GL_REGAL_proc_address 1 + +typedef void * (GLAPIENTRY * PFNGLGETPROCADDRESSREGALPROC) (const GLchar *name); + +#define glGetProcAddressREGAL GLEW_GET_FUN(__glewGetProcAddressREGAL) + +#define GLEW_REGAL_proc_address GLEW_GET_VAR(__GLEW_REGAL_proc_address) + +#endif /* GL_REGAL_proc_address */ + /* ----------------------- GL_REND_screen_coordinates ---------------------- */ #ifndef GL_REND_screen_coordinates @@ -9208,6 +18057,15 @@ typedef void (GLAPIENTRY * PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, #endif /* GL_S3_s3tc */ +/* ------------------------- GL_SGIS_clip_band_hint ------------------------ */ + +#ifndef GL_SGIS_clip_band_hint +#define GL_SGIS_clip_band_hint 1 + +#define GLEW_SGIS_clip_band_hint GLEW_GET_VAR(__GLEW_SGIS_clip_band_hint) + +#endif /* GL_SGIS_clip_band_hint */ + /* -------------------------- GL_SGIS_color_range -------------------------- */ #ifndef GL_SGIS_color_range @@ -9269,6 +18127,15 @@ typedef void (GLAPIENTRY * PFNGLGETFOGFUNCSGISPROC) (GLfloat* points); #endif /* GL_SGIS_generate_mipmap */ +/* -------------------------- GL_SGIS_line_texgen -------------------------- */ + +#ifndef GL_SGIS_line_texgen +#define GL_SGIS_line_texgen 1 + +#define GLEW_SGIS_line_texgen GLEW_GET_VAR(__GLEW_SGIS_line_texgen) + +#endif /* GL_SGIS_line_texgen */ + /* -------------------------- GL_SGIS_multisample -------------------------- */ #ifndef GL_SGIS_multisample @@ -9290,7 +18157,6 @@ typedef void (GLAPIENTRY * PFNGLGETFOGFUNCSGISPROC) (GLfloat* points); #define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA #define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB #define GL_SAMPLE_PATTERN_SGIS 0x80AC -#define GL_MULTISAMPLE_BIT_EXT 0x20000000 typedef void (GLAPIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); @@ -9302,6 +18168,37 @@ typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); #endif /* GL_SGIS_multisample */ +/* -------------------------- GL_SGIS_multitexture ------------------------- */ + +#ifndef GL_SGIS_multitexture +#define GL_SGIS_multitexture 1 + +#define GL_SELECTED_TEXTURE_SGIS 0x83C0 +#define GL_SELECTED_TEXTURE_COORD_SET_SGIS 0x83C1 +#define GL_SELECTED_TEXTURE_TRANSFORM_SGIS 0x83C2 +#define GL_MAX_TEXTURES_SGIS 0x83C3 +#define GL_MAX_TEXTURE_COORD_SETS_SGIS 0x83C4 +#define GL_TEXTURE_COORD_SET_INTERLEAVE_FACTOR_SGIS 0x83C5 +#define GL_TEXTURE_ENV_COORD_SET_SGIS 0x83C6 +#define GL_TEXTURE0_SGIS 0x83C7 +#define GL_TEXTURE1_SGIS 0x83C8 +#define GL_TEXTURE2_SGIS 0x83C9 +#define GL_TEXTURE3_SGIS 0x83CA + +typedef void (GLAPIENTRY * PFNGLINTERLEAVEDTEXTURECOORDSETSSGISPROC) (GLint factor); +typedef void (GLAPIENTRY * PFNGLSELECTTEXTURECOORDSETSGISPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLSELECTTEXTURESGISPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLSELECTTEXTURETRANSFORMSGISPROC) (GLenum target); + +#define glInterleavedTextureCoordSetsSGIS GLEW_GET_FUN(__glewInterleavedTextureCoordSetsSGIS) +#define glSelectTextureCoordSetSGIS GLEW_GET_FUN(__glewSelectTextureCoordSetSGIS) +#define glSelectTextureSGIS GLEW_GET_FUN(__glewSelectTextureSGIS) +#define glSelectTextureTransformSGIS GLEW_GET_FUN(__glewSelectTextureTransformSGIS) + +#define GLEW_SGIS_multitexture GLEW_GET_VAR(__GLEW_SGIS_multitexture) + +#endif /* GL_SGIS_multitexture */ + /* ------------------------- GL_SGIS_pixel_texture ------------------------- */ #ifndef GL_SGIS_pixel_texture @@ -9329,6 +18226,19 @@ typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); #endif /* GL_SGIS_point_line_texgen */ +/* ----------------------- GL_SGIS_shared_multisample ---------------------- */ + +#ifndef GL_SGIS_shared_multisample +#define GL_SGIS_shared_multisample 1 + +typedef void (GLAPIENTRY * PFNGLMULTISAMPLESUBRECTPOSSGISPROC) (GLint x, GLint y); + +#define glMultisampleSubRectPosSGIS GLEW_GET_FUN(__glewMultisampleSubRectPosSGIS) + +#define GLEW_SGIS_shared_multisample GLEW_GET_VAR(__GLEW_SGIS_shared_multisample) + +#endif /* GL_SGIS_shared_multisample */ + /* ------------------------ GL_SGIS_sharpen_texture ------------------------ */ #ifndef GL_SGIS_sharpen_texture @@ -9349,8 +18259,8 @@ typedef void (GLAPIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei #ifndef GL_SGIS_texture4D #define GL_SGIS_texture4D 1 -typedef void (GLAPIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void* pixels); -typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void *pixels); #define glTexImage4DSGIS GLEW_GET_FUN(__glewTexImage4DSGIS) #define glTexSubImage4DSGIS GLEW_GET_FUN(__glewTexSubImage4DSGIS) @@ -9472,6 +18382,42 @@ typedef GLint (GLAPIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint* markerp); #endif /* GL_SGIX_async_pixel */ +/* ----------------------- GL_SGIX_bali_g_instruments ---------------------- */ + +#ifndef GL_SGIX_bali_g_instruments +#define GL_SGIX_bali_g_instruments 1 + +#define GL_BALI_NUM_TRIS_CULLED_INSTRUMENT 0x6080 +#define GL_BALI_NUM_PRIMS_CLIPPED_INSTRUMENT 0x6081 +#define GL_BALI_NUM_PRIMS_REJECT_INSTRUMENT 0x6082 +#define GL_BALI_NUM_PRIMS_CLIP_RESULT_INSTRUMENT 0x6083 + +#define GLEW_SGIX_bali_g_instruments GLEW_GET_VAR(__GLEW_SGIX_bali_g_instruments) + +#endif /* GL_SGIX_bali_g_instruments */ + +/* ----------------------- GL_SGIX_bali_r_instruments ---------------------- */ + +#ifndef GL_SGIX_bali_r_instruments +#define GL_SGIX_bali_r_instruments 1 + +#define GL_BALI_FRAGMENTS_GENERATED_INSTRUMENT 0x6090 +#define GL_BALI_DEPTH_PASS_INSTRUMENT 0x6091 +#define GL_BALI_R_CHIP_COUNT 0x6092 + +#define GLEW_SGIX_bali_r_instruments GLEW_GET_VAR(__GLEW_SGIX_bali_r_instruments) + +#endif /* GL_SGIX_bali_r_instruments */ + +/* --------------------- GL_SGIX_bali_timer_instruments -------------------- */ + +#ifndef GL_SGIX_bali_timer_instruments +#define GL_SGIX_bali_timer_instruments 1 + +#define GLEW_SGIX_bali_timer_instruments GLEW_GET_VAR(__GLEW_SGIX_bali_timer_instruments) + +#endif /* GL_SGIX_bali_timer_instruments */ + /* ----------------------- GL_SGIX_blend_alpha_minmax ---------------------- */ #ifndef GL_SGIX_blend_alpha_minmax @@ -9484,6 +18430,37 @@ typedef GLint (GLAPIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint* markerp); #endif /* GL_SGIX_blend_alpha_minmax */ +/* --------------------------- GL_SGIX_blend_cadd -------------------------- */ + +#ifndef GL_SGIX_blend_cadd +#define GL_SGIX_blend_cadd 1 + +#define GL_FUNC_COMPLEX_ADD_EXT 0x601C + +#define GLEW_SGIX_blend_cadd GLEW_GET_VAR(__GLEW_SGIX_blend_cadd) + +#endif /* GL_SGIX_blend_cadd */ + +/* ------------------------ GL_SGIX_blend_cmultiply ------------------------ */ + +#ifndef GL_SGIX_blend_cmultiply +#define GL_SGIX_blend_cmultiply 1 + +#define GL_FUNC_COMPLEX_MULTIPLY_EXT 0x601B + +#define GLEW_SGIX_blend_cmultiply GLEW_GET_VAR(__GLEW_SGIX_blend_cmultiply) + +#endif /* GL_SGIX_blend_cmultiply */ + +/* --------------------- GL_SGIX_calligraphic_fragment --------------------- */ + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_SGIX_calligraphic_fragment 1 + +#define GLEW_SGIX_calligraphic_fragment GLEW_GET_VAR(__GLEW_SGIX_calligraphic_fragment) + +#endif /* GL_SGIX_calligraphic_fragment */ + /* ---------------------------- GL_SGIX_clipmap ---------------------------- */ #ifndef GL_SGIX_clipmap @@ -9493,6 +18470,35 @@ typedef GLint (GLAPIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint* markerp); #endif /* GL_SGIX_clipmap */ +/* --------------------- GL_SGIX_color_matrix_accuracy --------------------- */ + +#ifndef GL_SGIX_color_matrix_accuracy +#define GL_SGIX_color_matrix_accuracy 1 + +#define GL_COLOR_MATRIX_HINT 0x8317 + +#define GLEW_SGIX_color_matrix_accuracy GLEW_GET_VAR(__GLEW_SGIX_color_matrix_accuracy) + +#endif /* GL_SGIX_color_matrix_accuracy */ + +/* --------------------- GL_SGIX_color_table_index_mode -------------------- */ + +#ifndef GL_SGIX_color_table_index_mode +#define GL_SGIX_color_table_index_mode 1 + +#define GLEW_SGIX_color_table_index_mode GLEW_GET_VAR(__GLEW_SGIX_color_table_index_mode) + +#endif /* GL_SGIX_color_table_index_mode */ + +/* ------------------------- GL_SGIX_complex_polar ------------------------- */ + +#ifndef GL_SGIX_complex_polar +#define GL_SGIX_complex_polar 1 + +#define GLEW_SGIX_complex_polar GLEW_GET_VAR(__GLEW_SGIX_complex_polar) + +#endif /* GL_SGIX_complex_polar */ + /* ---------------------- GL_SGIX_convolution_accuracy --------------------- */ #ifndef GL_SGIX_convolution_accuracy @@ -9504,6 +18510,74 @@ typedef GLint (GLAPIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint* markerp); #endif /* GL_SGIX_convolution_accuracy */ +/* ---------------------------- GL_SGIX_cube_map --------------------------- */ + +#ifndef GL_SGIX_cube_map +#define GL_SGIX_cube_map 1 + +#define GL_ENV_MAP_SGIX 0x8340 +#define GL_CUBE_MAP_SGIX 0x8341 +#define GL_CUBE_MAP_ZP_SGIX 0x8342 +#define GL_CUBE_MAP_ZN_SGIX 0x8343 +#define GL_CUBE_MAP_XN_SGIX 0x8344 +#define GL_CUBE_MAP_XP_SGIX 0x8345 +#define GL_CUBE_MAP_YN_SGIX 0x8346 +#define GL_CUBE_MAP_YP_SGIX 0x8347 +#define GL_CUBE_MAP_BINDING_SGIX 0x8348 + +#define GLEW_SGIX_cube_map GLEW_GET_VAR(__GLEW_SGIX_cube_map) + +#endif /* GL_SGIX_cube_map */ + +/* ------------------------ GL_SGIX_cylinder_texgen ------------------------ */ + +#ifndef GL_SGIX_cylinder_texgen +#define GL_SGIX_cylinder_texgen 1 + +#define GLEW_SGIX_cylinder_texgen GLEW_GET_VAR(__GLEW_SGIX_cylinder_texgen) + +#endif /* GL_SGIX_cylinder_texgen */ + +/* ---------------------------- GL_SGIX_datapipe --------------------------- */ + +#ifndef GL_SGIX_datapipe +#define GL_SGIX_datapipe 1 + +#define GL_GEOMETRY_BIT 0x1 +#define GL_IMAGE_BIT 0x2 + +typedef void (GLAPIENTRY * PFNGLADDRESSSPACEPROC) (GLenum space, GLbitfield mask); +typedef GLint (GLAPIENTRY * PFNGLDATAPIPEPROC) (GLenum space); + +#define glAddressSpace GLEW_GET_FUN(__glewAddressSpace) +#define glDataPipe GLEW_GET_FUN(__glewDataPipe) + +#define GLEW_SGIX_datapipe GLEW_GET_VAR(__GLEW_SGIX_datapipe) + +#endif /* GL_SGIX_datapipe */ + +/* --------------------------- GL_SGIX_decimation -------------------------- */ + +#ifndef GL_SGIX_decimation +#define GL_SGIX_decimation 1 + +#define GLEW_SGIX_decimation GLEW_GET_VAR(__GLEW_SGIX_decimation) + +#endif /* GL_SGIX_decimation */ + +/* --------------------- GL_SGIX_depth_pass_instrument --------------------- */ + +#ifndef GL_SGIX_depth_pass_instrument +#define GL_SGIX_depth_pass_instrument 1 + +#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 +#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 +#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 + +#define GLEW_SGIX_depth_pass_instrument GLEW_GET_VAR(__GLEW_SGIX_depth_pass_instrument) + +#endif /* GL_SGIX_depth_pass_instrument */ + /* ------------------------- GL_SGIX_depth_texture ------------------------- */ #ifndef GL_SGIX_depth_texture @@ -9517,6 +18591,15 @@ typedef GLint (GLAPIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint* markerp); #endif /* GL_SGIX_depth_texture */ +/* ------------------------------ GL_SGIX_dvc ------------------------------ */ + +#ifndef GL_SGIX_dvc +#define GL_SGIX_dvc 1 + +#define GLEW_SGIX_dvc GLEW_GET_VAR(__GLEW_SGIX_dvc) + +#endif /* GL_SGIX_dvc */ + /* -------------------------- GL_SGIX_flush_raster ------------------------- */ #ifndef GL_SGIX_flush_raster @@ -9530,6 +18613,49 @@ typedef void (GLAPIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); #endif /* GL_SGIX_flush_raster */ +/* --------------------------- GL_SGIX_fog_blend --------------------------- */ + +#ifndef GL_SGIX_fog_blend +#define GL_SGIX_fog_blend 1 + +#define GL_FOG_BLEND_ALPHA_SGIX 0x81FE +#define GL_FOG_BLEND_COLOR_SGIX 0x81FF + +#define GLEW_SGIX_fog_blend GLEW_GET_VAR(__GLEW_SGIX_fog_blend) + +#endif /* GL_SGIX_fog_blend */ + +/* ---------------------- GL_SGIX_fog_factor_to_alpha ---------------------- */ + +#ifndef GL_SGIX_fog_factor_to_alpha +#define GL_SGIX_fog_factor_to_alpha 1 + +#define GLEW_SGIX_fog_factor_to_alpha GLEW_GET_VAR(__GLEW_SGIX_fog_factor_to_alpha) + +#endif /* GL_SGIX_fog_factor_to_alpha */ + +/* --------------------------- GL_SGIX_fog_layers -------------------------- */ + +#ifndef GL_SGIX_fog_layers +#define GL_SGIX_fog_layers 1 + +#define GL_FOG_TYPE_SGIX 0x8323 +#define GL_UNIFORM_SGIX 0x8324 +#define GL_LAYERED_SGIX 0x8325 +#define GL_FOG_GROUND_PLANE_SGIX 0x8326 +#define GL_FOG_LAYERS_POINTS_SGIX 0x8327 +#define GL_MAX_FOG_LAYERS_POINTS_SGIX 0x8328 + +typedef void (GLAPIENTRY * PFNGLFOGLAYERSSGIXPROC) (GLsizei n, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLGETFOGLAYERSSGIXPROC) (GLfloat* points); + +#define glFogLayersSGIX GLEW_GET_FUN(__glewFogLayersSGIX) +#define glGetFogLayersSGIX GLEW_GET_FUN(__glewGetFogLayersSGIX) + +#define GLEW_SGIX_fog_layers GLEW_GET_VAR(__GLEW_SGIX_fog_layers) + +#endif /* GL_SGIX_fog_layers */ + /* --------------------------- GL_SGIX_fog_offset -------------------------- */ #ifndef GL_SGIX_fog_offset @@ -9542,15 +18668,32 @@ typedef void (GLAPIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); #endif /* GL_SGIX_fog_offset */ +/* --------------------------- GL_SGIX_fog_patchy -------------------------- */ + +#ifndef GL_SGIX_fog_patchy +#define GL_SGIX_fog_patchy 1 + +#define GLEW_SGIX_fog_patchy GLEW_GET_VAR(__GLEW_SGIX_fog_patchy) + +#endif /* GL_SGIX_fog_patchy */ + +/* --------------------------- GL_SGIX_fog_scale --------------------------- */ + +#ifndef GL_SGIX_fog_scale +#define GL_SGIX_fog_scale 1 + +#define GL_FOG_SCALE_SGIX 0x81FC +#define GL_FOG_SCALE_VALUE_SGIX 0x81FD + +#define GLEW_SGIX_fog_scale GLEW_GET_VAR(__GLEW_SGIX_fog_scale) + +#endif /* GL_SGIX_fog_scale */ + /* -------------------------- GL_SGIX_fog_texture -------------------------- */ #ifndef GL_SGIX_fog_texture #define GL_SGIX_fog_texture 1 -#define GL_TEXTURE_FOG_SGIX 0 -#define GL_FOG_PATCHY_FACTOR_SGIX 0 -#define GL_FRAGMENT_FOG_SGIX 0 - typedef void (GLAPIENTRY * PFNGLTEXTUREFOGSGIXPROC) (GLenum pname); #define glTextureFogSGIX GLEW_GET_FUN(__glewTextureFogSGIX) @@ -9559,6 +18702,20 @@ typedef void (GLAPIENTRY * PFNGLTEXTUREFOGSGIXPROC) (GLenum pname); #endif /* GL_SGIX_fog_texture */ +/* -------------------- GL_SGIX_fragment_lighting_space -------------------- */ + +#ifndef GL_SGIX_fragment_lighting_space +#define GL_SGIX_fragment_lighting_space 1 + +#define GL_EYE_SPACE_SGIX 0x8436 +#define GL_TANGENT_SPACE_SGIX 0x8437 +#define GL_OBJECT_SPACE_SGIX 0x8438 +#define GL_FRAGMENT_LIGHT_SPACE_SGIX 0x843D + +#define GLEW_SGIX_fragment_lighting_space GLEW_GET_VAR(__GLEW_SGIX_fragment_lighting_space) + +#endif /* GL_SGIX_fragment_lighting_space */ + /* ------------------- GL_SGIX_fragment_specular_lighting ------------------ */ #ifndef GL_SGIX_fragment_specular_lighting @@ -9604,6 +18761,19 @@ typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLe #endif /* GL_SGIX_fragment_specular_lighting */ +/* ---------------------- GL_SGIX_fragments_instrument --------------------- */ + +#ifndef GL_SGIX_fragments_instrument +#define GL_SGIX_fragments_instrument 1 + +#define GL_FRAGMENTS_INSTRUMENT_SGIX 0x8313 +#define GL_FRAGMENTS_INSTRUMENT_COUNTERS_SGIX 0x8314 +#define GL_FRAGMENTS_INSTRUMENT_MAX_SGIX 0x8315 + +#define GLEW_SGIX_fragments_instrument GLEW_GET_VAR(__GLEW_SGIX_fragments_instrument) + +#endif /* GL_SGIX_fragments_instrument */ + /* --------------------------- GL_SGIX_framezoom --------------------------- */ #ifndef GL_SGIX_framezoom @@ -9617,6 +18787,77 @@ typedef void (GLAPIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); #endif /* GL_SGIX_framezoom */ +/* -------------------------- GL_SGIX_icc_texture -------------------------- */ + +#ifndef GL_SGIX_icc_texture +#define GL_SGIX_icc_texture 1 + +#define GL_RGB_ICC_SGIX 0x8460 +#define GL_RGBA_ICC_SGIX 0x8461 +#define GL_ALPHA_ICC_SGIX 0x8462 +#define GL_LUMINANCE_ICC_SGIX 0x8463 +#define GL_INTENSITY_ICC_SGIX 0x8464 +#define GL_LUMINANCE_ALPHA_ICC_SGIX 0x8465 +#define GL_R5_G6_B5_ICC_SGIX 0x8466 +#define GL_R5_G6_B5_A8_ICC_SGIX 0x8467 +#define GL_ALPHA16_ICC_SGIX 0x8468 +#define GL_LUMINANCE16_ICC_SGIX 0x8469 +#define GL_INTENSITY16_ICC_SGIX 0x846A +#define GL_LUMINANCE16_ALPHA8_ICC_SGIX 0x846B + +#define GLEW_SGIX_icc_texture GLEW_GET_VAR(__GLEW_SGIX_icc_texture) + +#endif /* GL_SGIX_icc_texture */ + +/* ------------------------ GL_SGIX_igloo_interface ------------------------ */ + +#ifndef GL_SGIX_igloo_interface +#define GL_SGIX_igloo_interface 1 + +#define GL_IGLOO_FULLSCREEN_SGIX 0x819E +#define GL_IGLOO_VIEWPORT_OFFSET_SGIX 0x819F +#define GL_IGLOO_SWAPTMESH_SGIX 0x81A0 +#define GL_IGLOO_COLORNORMAL_SGIX 0x81A1 +#define GL_IGLOO_IRISGL_MODE_SGIX 0x81A2 +#define GL_IGLOO_LMC_COLOR_SGIX 0x81A3 +#define GL_IGLOO_TMESHMODE_SGIX 0x81A4 +#define GL_LIGHT31 0xBEAD + +typedef void (GLAPIENTRY * PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, void *param); + +#define glIglooInterfaceSGIX GLEW_GET_FUN(__glewIglooInterfaceSGIX) + +#define GLEW_SGIX_igloo_interface GLEW_GET_VAR(__GLEW_SGIX_igloo_interface) + +#endif /* GL_SGIX_igloo_interface */ + +/* ----------------------- GL_SGIX_image_compression ----------------------- */ + +#ifndef GL_SGIX_image_compression +#define GL_SGIX_image_compression 1 + +#define GLEW_SGIX_image_compression GLEW_GET_VAR(__GLEW_SGIX_image_compression) + +#endif /* GL_SGIX_image_compression */ + +/* ---------------------- GL_SGIX_impact_pixel_texture --------------------- */ + +#ifndef GL_SGIX_impact_pixel_texture +#define GL_SGIX_impact_pixel_texture 1 + +#define GLEW_SGIX_impact_pixel_texture GLEW_GET_VAR(__GLEW_SGIX_impact_pixel_texture) + +#endif /* GL_SGIX_impact_pixel_texture */ + +/* ------------------------ GL_SGIX_instrument_error ----------------------- */ + +#ifndef GL_SGIX_instrument_error +#define GL_SGIX_instrument_error 1 + +#define GLEW_SGIX_instrument_error GLEW_GET_VAR(__GLEW_SGIX_instrument_error) + +#endif /* GL_SGIX_instrument_error */ + /* --------------------------- GL_SGIX_interlace --------------------------- */ #ifndef GL_SGIX_interlace @@ -9637,6 +18878,17 @@ typedef void (GLAPIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); #endif /* GL_SGIX_ir_instrument1 */ +/* ----------------------- GL_SGIX_line_quality_hint ----------------------- */ + +#ifndef GL_SGIX_line_quality_hint +#define GL_SGIX_line_quality_hint 1 + +#define GL_LINE_QUALITY_HINT_SGIX 0x835B + +#define GLEW_SGIX_line_quality_hint GLEW_GET_VAR(__GLEW_SGIX_line_quality_hint) + +#endif /* GL_SGIX_line_quality_hint */ + /* ------------------------- GL_SGIX_list_priority ------------------------- */ #ifndef GL_SGIX_list_priority @@ -9646,6 +18898,117 @@ typedef void (GLAPIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); #endif /* GL_SGIX_list_priority */ +/* ----------------------------- GL_SGIX_mpeg1 ----------------------------- */ + +#ifndef GL_SGIX_mpeg1 +#define GL_SGIX_mpeg1 1 + +typedef void (GLAPIENTRY * PFNGLALLOCMPEGPREDICTORSSGIXPROC) (GLsizei width, GLsizei height, GLsizei n, GLuint* predictors); +typedef void (GLAPIENTRY * PFNGLDELETEMPEGPREDICTORSSGIXPROC) (GLsizei n, GLuint* predictors); +typedef void (GLAPIENTRY * PFNGLGENMPEGPREDICTORSSGIXPROC) (GLsizei n, GLuint* predictors); +typedef void (GLAPIENTRY * PFNGLGETMPEGPARAMETERFVSGIXPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMPEGPARAMETERIVSGIXPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMPEGPREDICTORSGIXPROC) (GLenum target, GLenum format, GLenum type, void *pixels); +typedef void (GLAPIENTRY * PFNGLGETMPEGQUANTTABLEUBVPROC) (GLenum target, GLubyte* values); +typedef GLboolean (GLAPIENTRY * PFNGLISMPEGPREDICTORSGIXPROC) (GLuint predictor); +typedef void (GLAPIENTRY * PFNGLMPEGPREDICTORSGIXPROC) (GLenum target, GLenum format, GLenum type, void *pixels); +typedef void (GLAPIENTRY * PFNGLMPEGQUANTTABLEUBVPROC) (GLenum target, GLubyte* values); +typedef void (GLAPIENTRY * PFNGLSWAPMPEGPREDICTORSSGIXPROC) (GLenum target0, GLenum target1); + +#define glAllocMPEGPredictorsSGIX GLEW_GET_FUN(__glewAllocMPEGPredictorsSGIX) +#define glDeleteMPEGPredictorsSGIX GLEW_GET_FUN(__glewDeleteMPEGPredictorsSGIX) +#define glGenMPEGPredictorsSGIX GLEW_GET_FUN(__glewGenMPEGPredictorsSGIX) +#define glGetMPEGParameterfvSGIX GLEW_GET_FUN(__glewGetMPEGParameterfvSGIX) +#define glGetMPEGParameterivSGIX GLEW_GET_FUN(__glewGetMPEGParameterivSGIX) +#define glGetMPEGPredictorSGIX GLEW_GET_FUN(__glewGetMPEGPredictorSGIX) +#define glGetMPEGQuantTableubv GLEW_GET_FUN(__glewGetMPEGQuantTableubv) +#define glIsMPEGPredictorSGIX GLEW_GET_FUN(__glewIsMPEGPredictorSGIX) +#define glMPEGPredictorSGIX GLEW_GET_FUN(__glewMPEGPredictorSGIX) +#define glMPEGQuantTableubv GLEW_GET_FUN(__glewMPEGQuantTableubv) +#define glSwapMPEGPredictorsSGIX GLEW_GET_FUN(__glewSwapMPEGPredictorsSGIX) + +#define GLEW_SGIX_mpeg1 GLEW_GET_VAR(__GLEW_SGIX_mpeg1) + +#endif /* GL_SGIX_mpeg1 */ + +/* ----------------------------- GL_SGIX_mpeg2 ----------------------------- */ + +#ifndef GL_SGIX_mpeg2 +#define GL_SGIX_mpeg2 1 + +#define GLEW_SGIX_mpeg2 GLEW_GET_VAR(__GLEW_SGIX_mpeg2) + +#endif /* GL_SGIX_mpeg2 */ + +/* ------------------ GL_SGIX_nonlinear_lighting_pervertex ----------------- */ + +#ifndef GL_SGIX_nonlinear_lighting_pervertex +#define GL_SGIX_nonlinear_lighting_pervertex 1 + +typedef void (GLAPIENTRY * PFNGLGETNONLINLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLint* terms, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETNONLINMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLint* terms, const GLfloat *data); +typedef void (GLAPIENTRY * PFNGLNONLINLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLint terms, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLNONLINMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLint terms, const GLfloat* params); + +#define glGetNonlinLightfvSGIX GLEW_GET_FUN(__glewGetNonlinLightfvSGIX) +#define glGetNonlinMaterialfvSGIX GLEW_GET_FUN(__glewGetNonlinMaterialfvSGIX) +#define glNonlinLightfvSGIX GLEW_GET_FUN(__glewNonlinLightfvSGIX) +#define glNonlinMaterialfvSGIX GLEW_GET_FUN(__glewNonlinMaterialfvSGIX) + +#define GLEW_SGIX_nonlinear_lighting_pervertex GLEW_GET_VAR(__GLEW_SGIX_nonlinear_lighting_pervertex) + +#endif /* GL_SGIX_nonlinear_lighting_pervertex */ + +/* --------------------------- GL_SGIX_nurbs_eval -------------------------- */ + +#ifndef GL_SGIX_nurbs_eval +#define GL_SGIX_nurbs_eval 1 + +#define GL_MAP1_VERTEX_3_NURBS_SGIX 0x81CB +#define GL_MAP1_VERTEX_4_NURBS_SGIX 0x81CC +#define GL_MAP1_INDEX_NURBS_SGIX 0x81CD +#define GL_MAP1_COLOR_4_NURBS_SGIX 0x81CE +#define GL_MAP1_NORMAL_NURBS_SGIX 0x81CF +#define GL_MAP1_TEXTURE_COORD_1_NURBS_SGIX 0x81E0 +#define GL_MAP1_TEXTURE_COORD_2_NURBS_SGIX 0x81E1 +#define GL_MAP1_TEXTURE_COORD_3_NURBS_SGIX 0x81E2 +#define GL_MAP1_TEXTURE_COORD_4_NURBS_SGIX 0x81E3 +#define GL_MAP2_VERTEX_3_NURBS_SGIX 0x81E4 +#define GL_MAP2_VERTEX_4_NURBS_SGIX 0x81E5 +#define GL_MAP2_INDEX_NURBS_SGIX 0x81E6 +#define GL_MAP2_COLOR_4_NURBS_SGIX 0x81E7 +#define GL_MAP2_NORMAL_NURBS_SGIX 0x81E8 +#define GL_MAP2_TEXTURE_COORD_1_NURBS_SGIX 0x81E9 +#define GL_MAP2_TEXTURE_COORD_2_NURBS_SGIX 0x81EA +#define GL_MAP2_TEXTURE_COORD_3_NURBS_SGIX 0x81EB +#define GL_MAP2_TEXTURE_COORD_4_NURBS_SGIX 0x81EC +#define GL_NURBS_KNOT_COUNT_SGIX 0x81ED +#define GL_NURBS_KNOT_VECTOR_SGIX 0x81EE + +#define GLEW_SGIX_nurbs_eval GLEW_GET_VAR(__GLEW_SGIX_nurbs_eval) + +#endif /* GL_SGIX_nurbs_eval */ + +/* ---------------------- GL_SGIX_occlusion_instrument --------------------- */ + +#ifndef GL_SGIX_occlusion_instrument +#define GL_SGIX_occlusion_instrument 1 + +#define GL_OCCLUSION_INSTRUMENT_SGIX 0x6060 + +#define GLEW_SGIX_occlusion_instrument GLEW_GET_VAR(__GLEW_SGIX_occlusion_instrument) + +#endif /* GL_SGIX_occlusion_instrument */ + +/* ------------------------- GL_SGIX_packed_6bytes ------------------------- */ + +#ifndef GL_SGIX_packed_6bytes +#define GL_SGIX_packed_6bytes 1 + +#define GLEW_SGIX_packed_6bytes GLEW_GET_VAR(__GLEW_SGIX_packed_6bytes) + +#endif /* GL_SGIX_packed_6bytes */ + /* ------------------------- GL_SGIX_pixel_texture ------------------------- */ #ifndef GL_SGIX_pixel_texture @@ -9668,6 +19031,57 @@ typedef void (GLAPIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); #endif /* GL_SGIX_pixel_texture_bits */ +/* ----------------------- GL_SGIX_pixel_texture_lod ----------------------- */ + +#ifndef GL_SGIX_pixel_texture_lod +#define GL_SGIX_pixel_texture_lod 1 + +#define GLEW_SGIX_pixel_texture_lod GLEW_GET_VAR(__GLEW_SGIX_pixel_texture_lod) + +#endif /* GL_SGIX_pixel_texture_lod */ + +/* -------------------------- GL_SGIX_pixel_tiles -------------------------- */ + +#ifndef GL_SGIX_pixel_tiles +#define GL_SGIX_pixel_tiles 1 + +#define GLEW_SGIX_pixel_tiles GLEW_GET_VAR(__GLEW_SGIX_pixel_tiles) + +#endif /* GL_SGIX_pixel_tiles */ + +/* ------------------------- GL_SGIX_polynomial_ffd ------------------------ */ + +#ifndef GL_SGIX_polynomial_ffd +#define GL_SGIX_polynomial_ffd 1 + +#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x1 +#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x2 + +typedef void (GLAPIENTRY * PFNGLDEFORMSGIXPROC) (GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); + +#define glDeformSGIX GLEW_GET_FUN(__glewDeformSGIX) +#define glLoadIdentityDeformationMapSGIX GLEW_GET_FUN(__glewLoadIdentityDeformationMapSGIX) + +#define GLEW_SGIX_polynomial_ffd GLEW_GET_VAR(__GLEW_SGIX_polynomial_ffd) + +#endif /* GL_SGIX_polynomial_ffd */ + +/* --------------------------- GL_SGIX_quad_mesh --------------------------- */ + +#ifndef GL_SGIX_quad_mesh +#define GL_SGIX_quad_mesh 1 + +typedef void (GLAPIENTRY * PFNGLMESHBREADTHSGIXPROC) (GLint breadth); +typedef void (GLAPIENTRY * PFNGLMESHSTRIDESGIXPROC) (GLint stride); + +#define glMeshBreadthSGIX GLEW_GET_FUN(__glewMeshBreadthSGIX) +#define glMeshStrideSGIX GLEW_GET_FUN(__glewMeshStrideSGIX) + +#define GLEW_SGIX_quad_mesh GLEW_GET_VAR(__GLEW_SGIX_quad_mesh) + +#endif /* GL_SGIX_quad_mesh */ + /* ------------------------ GL_SGIX_reference_plane ------------------------ */ #ifndef GL_SGIX_reference_plane @@ -9696,6 +19110,17 @@ typedef void (GLAPIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble* equatio #endif /* GL_SGIX_resample */ +/* ------------------------- GL_SGIX_scalebias_hint ------------------------ */ + +#ifndef GL_SGIX_scalebias_hint +#define GL_SGIX_scalebias_hint 1 + +#define GL_SCALEBIAS_HINT_SGIX 0x8322 + +#define GLEW_SGIX_scalebias_hint GLEW_GET_VAR(__GLEW_SGIX_scalebias_hint) + +#endif /* GL_SGIX_scalebias_hint */ + /* ----------------------------- GL_SGIX_shadow ---------------------------- */ #ifndef GL_SGIX_shadow @@ -9721,6 +19146,31 @@ typedef void (GLAPIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble* equatio #endif /* GL_SGIX_shadow_ambient */ +/* ------------------------------ GL_SGIX_slim ----------------------------- */ + +#ifndef GL_SGIX_slim +#define GL_SGIX_slim 1 + +#define GL_PACK_MAX_COMPRESSED_SIZE_SGIX 0x831B +#define GL_SLIM8U_SGIX 0x831D +#define GL_SLIM10U_SGIX 0x831E +#define GL_SLIM12S_SGIX 0x831F + +#define GLEW_SGIX_slim GLEW_GET_VAR(__GLEW_SGIX_slim) + +#endif /* GL_SGIX_slim */ + +/* ------------------------ GL_SGIX_spotlight_cutoff ----------------------- */ + +#ifndef GL_SGIX_spotlight_cutoff +#define GL_SGIX_spotlight_cutoff 1 + +#define GL_SPOT_CUTOFF_DELTA_SGIX 0x8193 + +#define GLEW_SGIX_spotlight_cutoff GLEW_GET_VAR(__GLEW_SGIX_spotlight_cutoff) + +#endif /* GL_SGIX_spotlight_cutoff */ + /* ----------------------------- GL_SGIX_sprite ---------------------------- */ #ifndef GL_SGIX_sprite @@ -9740,6 +19190,30 @@ typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, GLint* #endif /* GL_SGIX_sprite */ +/* -------------------------- GL_SGIX_subdiv_patch ------------------------- */ + +#ifndef GL_SGIX_subdiv_patch +#define GL_SGIX_subdiv_patch 1 + +#define GLEW_SGIX_subdiv_patch GLEW_GET_VAR(__GLEW_SGIX_subdiv_patch) + +#endif /* GL_SGIX_subdiv_patch */ + +/* --------------------------- GL_SGIX_subsample --------------------------- */ + +#ifndef GL_SGIX_subsample +#define GL_SGIX_subsample 1 + +#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 +#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 +#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 +#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 +#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 + +#define GLEW_SGIX_subsample GLEW_GET_VAR(__GLEW_SGIX_subsample) + +#endif /* GL_SGIX_subsample */ + /* ----------------------- GL_SGIX_tag_sample_buffer ----------------------- */ #ifndef GL_SGIX_tag_sample_buffer @@ -9784,6 +19258,18 @@ typedef void (GLAPIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); #endif /* GL_SGIX_texture_lod_bias */ +/* ------------------- GL_SGIX_texture_mipmap_anisotropic ------------------ */ + +#ifndef GL_SGIX_texture_mipmap_anisotropic +#define GL_SGIX_texture_mipmap_anisotropic 1 + +#define GL_TEXTURE_MIPMAP_ANISOTROPY_SGIX 0x832E +#define GL_MAX_MIPMAP_ANISOTROPY_SGIX 0x832F + +#define GLEW_SGIX_texture_mipmap_anisotropic GLEW_GET_VAR(__GLEW_SGIX_texture_mipmap_anisotropic) + +#endif /* GL_SGIX_texture_mipmap_anisotropic */ + /* ---------------------- GL_SGIX_texture_multi_buffer --------------------- */ #ifndef GL_SGIX_texture_multi_buffer @@ -9795,6 +19281,17 @@ typedef void (GLAPIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); #endif /* GL_SGIX_texture_multi_buffer */ +/* ------------------------- GL_SGIX_texture_phase ------------------------- */ + +#ifndef GL_SGIX_texture_phase +#define GL_SGIX_texture_phase 1 + +#define GL_PHASE_SGIX 0x832A + +#define GLEW_SGIX_texture_phase GLEW_GET_VAR(__GLEW_SGIX_texture_phase) + +#endif /* GL_SGIX_texture_phase */ + /* ------------------------- GL_SGIX_texture_range ------------------------- */ #ifndef GL_SGIX_texture_range @@ -9847,6 +19344,53 @@ typedef void (GLAPIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); #endif /* GL_SGIX_texture_scale_bias */ +/* ---------------------- GL_SGIX_texture_supersample ---------------------- */ + +#ifndef GL_SGIX_texture_supersample +#define GL_SGIX_texture_supersample 1 + +#define GLEW_SGIX_texture_supersample GLEW_GET_VAR(__GLEW_SGIX_texture_supersample) + +#endif /* GL_SGIX_texture_supersample */ + +/* --------------------------- GL_SGIX_vector_ops -------------------------- */ + +#ifndef GL_SGIX_vector_ops +#define GL_SGIX_vector_ops 1 + +typedef void (GLAPIENTRY * PFNGLGETVECTOROPERATIONSGIXPROC) (GLenum operation); +typedef void (GLAPIENTRY * PFNGLVECTOROPERATIONSGIXPROC) (GLenum operation); + +#define glGetVectorOperationSGIX GLEW_GET_FUN(__glewGetVectorOperationSGIX) +#define glVectorOperationSGIX GLEW_GET_FUN(__glewVectorOperationSGIX) + +#define GLEW_SGIX_vector_ops GLEW_GET_VAR(__GLEW_SGIX_vector_ops) + +#endif /* GL_SGIX_vector_ops */ + +/* ---------------------- GL_SGIX_vertex_array_object ---------------------- */ + +#ifndef GL_SGIX_vertex_array_object +#define GL_SGIX_vertex_array_object 1 + +typedef GLboolean (GLAPIENTRY * PFNGLAREVERTEXARRAYSRESIDENTSGIXPROC) (GLsizei n, const GLuint* arrays, GLboolean* residences); +typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYSGIXPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSSGIXPROC) (GLsizei n, const GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSSGIXPROC) (GLsizei n, GLuint* arrays); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYSGIXPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLPRIORITIZEVERTEXARRAYSSGIXPROC) (GLsizei n, const GLuint* arrays, const GLclampf* priorities); + +#define glAreVertexArraysResidentSGIX GLEW_GET_FUN(__glewAreVertexArraysResidentSGIX) +#define glBindVertexArraySGIX GLEW_GET_FUN(__glewBindVertexArraySGIX) +#define glDeleteVertexArraysSGIX GLEW_GET_FUN(__glewDeleteVertexArraysSGIX) +#define glGenVertexArraysSGIX GLEW_GET_FUN(__glewGenVertexArraysSGIX) +#define glIsVertexArraySGIX GLEW_GET_FUN(__glewIsVertexArraySGIX) +#define glPrioritizeVertexArraysSGIX GLEW_GET_FUN(__glewPrioritizeVertexArraysSGIX) + +#define GLEW_SGIX_vertex_array_object GLEW_GET_VAR(__GLEW_SGIX_vertex_array_object) + +#endif /* GL_SGIX_vertex_array_object */ + /* ------------------------- GL_SGIX_vertex_preclip ------------------------ */ #ifndef GL_SGIX_vertex_preclip @@ -9880,6 +19424,27 @@ typedef void (GLAPIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); #endif /* GL_SGIX_ycrcb */ +/* ------------------------ GL_SGIX_ycrcb_subsample ------------------------ */ + +#ifndef GL_SGIX_ycrcb_subsample +#define GL_SGIX_ycrcb_subsample 1 + +#define GLEW_SGIX_ycrcb_subsample GLEW_GET_VAR(__GLEW_SGIX_ycrcb_subsample) + +#endif /* GL_SGIX_ycrcb_subsample */ + +/* ----------------------------- GL_SGIX_ycrcba ---------------------------- */ + +#ifndef GL_SGIX_ycrcba +#define GL_SGIX_ycrcba 1 + +#define GL_YCRCB_SGIX 0x8318 +#define GL_YCRCBA_SGIX 0x8319 + +#define GLEW_SGIX_ycrcba GLEW_GET_VAR(__GLEW_SGIX_ycrcba) + +#endif /* GL_SGIX_ycrcba */ + /* -------------------------- GL_SGI_color_matrix -------------------------- */ #ifndef GL_SGI_color_matrix @@ -9925,11 +19490,11 @@ typedef void (GLAPIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* table); +typedef void (GLAPIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, void* table); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, void *table); #define glColorTableParameterfvSGI GLEW_GET_FUN(__glewColorTableParameterfvSGI) #define glColorTableParameterivSGI GLEW_GET_FUN(__glewColorTableParameterivSGI) @@ -9943,6 +19508,63 @@ typedef void (GLAPIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum for #endif /* GL_SGI_color_table */ +/* ----------------------------- GL_SGI_complex ---------------------------- */ + +#ifndef GL_SGI_complex +#define GL_SGI_complex 1 + +#define GLEW_SGI_complex GLEW_GET_VAR(__GLEW_SGI_complex) + +#endif /* GL_SGI_complex */ + +/* -------------------------- GL_SGI_complex_type -------------------------- */ + +#ifndef GL_SGI_complex_type +#define GL_SGI_complex_type 1 + +#define GL_COMPLEX_UNSIGNED_BYTE_SGI 0x81BD +#define GL_COMPLEX_BYTE_SGI 0x81BE +#define GL_COMPLEX_UNSIGNED_SHORT_SGI 0x81BF +#define GL_COMPLEX_SHORT_SGI 0x81C0 +#define GL_COMPLEX_UNSIGNED_INT_SGI 0x81C1 +#define GL_COMPLEX_INT_SGI 0x81C2 +#define GL_COMPLEX_FLOAT_SGI 0x81C3 + +#define GLEW_SGI_complex_type GLEW_GET_VAR(__GLEW_SGI_complex_type) + +#endif /* GL_SGI_complex_type */ + +/* ------------------------------- GL_SGI_fft ------------------------------ */ + +#ifndef GL_SGI_fft +#define GL_SGI_fft 1 + +#define GL_PIXEL_TRANSFORM_OPERATOR_SGI 0x81C4 +#define GL_CONVOLUTION_SGI 0x81C5 +#define GL_FFT_1D_SGI 0x81C6 +#define GL_PIXEL_TRANSFORM_SGI 0x81C7 +#define GL_MAX_FFT_WIDTH_SGI 0x81C8 + +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFSGIPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERISGIPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMSGIPROC) (GLenum target); + +#define glGetPixelTransformParameterfvSGI GLEW_GET_FUN(__glewGetPixelTransformParameterfvSGI) +#define glGetPixelTransformParameterivSGI GLEW_GET_FUN(__glewGetPixelTransformParameterivSGI) +#define glPixelTransformParameterfSGI GLEW_GET_FUN(__glewPixelTransformParameterfSGI) +#define glPixelTransformParameterfvSGI GLEW_GET_FUN(__glewPixelTransformParameterfvSGI) +#define glPixelTransformParameteriSGI GLEW_GET_FUN(__glewPixelTransformParameteriSGI) +#define glPixelTransformParameterivSGI GLEW_GET_FUN(__glewPixelTransformParameterivSGI) +#define glPixelTransformSGI GLEW_GET_FUN(__glewPixelTransformSGI) + +#define GLEW_SGI_fft GLEW_GET_VAR(__GLEW_SGI_fft) + +#endif /* GL_SGI_fft */ + /* ----------------------- GL_SGI_texture_color_table ---------------------- */ #ifndef GL_SGI_texture_color_table @@ -10029,7 +19651,7 @@ typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); #ifndef GL_SUN_read_video_pixels #define GL_SUN_read_video_pixels 1 -typedef void (GLAPIENTRY * PFNGLREADVIDEOPIXELSSUNPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels); +typedef void (GLAPIENTRY * PFNGLREADVIDEOPIXELSSUNPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels); #define glReadVideoPixelsSUN GLEW_GET_FUN(__glewReadVideoPixelsSUN) @@ -10071,7 +19693,7 @@ typedef void (GLAPIENTRY * PFNGLREADVIDEOPIXELSSUNPROC) (GLint x, GLint y, GLsiz #define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA #define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const void* pointer); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const void *pointer); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte* code); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); @@ -10194,6 +19816,15 @@ typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat* tc, #endif /* GL_WIN_phong_shading */ +/* ------------------------- GL_WIN_scene_markerXXX ------------------------ */ + +#ifndef GL_WIN_scene_markerXXX +#define GL_WIN_scene_markerXXX 1 + +#define GLEW_WIN_scene_markerXXX GLEW_GET_VAR(__GLEW_WIN_scene_markerXXX) + +#endif /* GL_WIN_scene_markerXXX */ + /* -------------------------- GL_WIN_specular_fog -------------------------- */ #ifndef GL_WIN_specular_fog @@ -10220,22 +19851,7 @@ typedef void (GLAPIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsiz /* ------------------------------------------------------------------------- */ -#if defined(GLEW_MX) && defined(_WIN32) -#define GLEW_FUN_EXPORT -#else -#define GLEW_FUN_EXPORT GLEWAPI -#endif /* GLEW_MX */ -#if defined(GLEW_MX) -#define GLEW_VAR_EXPORT -#else -#define GLEW_VAR_EXPORT GLEWAPI -#endif /* GLEW_MX */ - -#if defined(GLEW_MX) && defined(_WIN32) -struct GLEWContextStruct -{ -#endif /* GLEW_MX */ GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D; GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements; @@ -10460,8 +20076,6 @@ GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv; GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender; GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback; -GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEPROC __glewBindBufferBase; -GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange; GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation; GLEW_FUN_EXPORT PFNGLCLAMPCOLORPROC __glewClampColor; GLEW_FUN_EXPORT PFNGLCLEARBUFFERFIPROC __glewClearBufferfi; @@ -10475,7 +20089,6 @@ GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender; GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback; GLEW_FUN_EXPORT PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v; GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation; -GLEW_FUN_EXPORT PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v; GLEW_FUN_EXPORT PFNGLGETSTRINGIPROC __glewGetStringi; GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv; GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv; @@ -10517,8 +20130,106 @@ GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer; +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced; +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex; +GLEW_FUN_EXPORT PFNGLTEXBUFFERPROC __glewTexBuffer; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v; +GLEW_FUN_EXPORT PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v; + +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIPROC __glewBlendEquationi; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei; +GLEW_FUN_EXPORT PFNGLBLENDFUNCIPROC __glewBlendFunci; +GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading; + +GLEW_FUN_EXPORT PFNGLGETGRAPHICSRESETSTATUSPROC __glewGetGraphicsResetStatus; +GLEW_FUN_EXPORT PFNGLGETNCOMPRESSEDTEXIMAGEPROC __glewGetnCompressedTexImage; +GLEW_FUN_EXPORT PFNGLGETNTEXIMAGEPROC __glewGetnTexImage; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMDVPROC __glewGetnUniformdv; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC __glewMultiDrawArraysIndirectCount; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC __glewMultiDrawElementsIndirectCount; +GLEW_FUN_EXPORT PFNGLSPECIALIZESHADERPROC __glewSpecializeShader; + GLEW_FUN_EXPORT PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC __glewFramebufferSamplePositionsfvAMD; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERFVAMDPROC __glewGetFramebufferParameterfvAMD; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERFVAMDPROC __glewGetNamedFramebufferParameterfvAMD; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC __glewNamedFramebufferSamplePositionsfvAMD; + +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPARAMETERIAMDPROC __glewVertexAttribParameteriAMD; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD; + +GLEW_FUN_EXPORT PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD; +GLEW_FUN_EXPORT PFNGLGENNAMESAMDPROC __glewGenNamesAMD; +GLEW_FUN_EXPORT PFNGLISNAMEAMDPROC __glewIsNameAMD; + +GLEW_FUN_EXPORT PFNGLQUERYOBJECTPARAMETERUIAMDPROC __glewQueryObjectParameteruiAMD; + +GLEW_FUN_EXPORT PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD; +GLEW_FUN_EXPORT PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD; +GLEW_FUN_EXPORT PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD; +GLEW_FUN_EXPORT PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD; +GLEW_FUN_EXPORT PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD; + +GLEW_FUN_EXPORT PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGESPARSEAMDPROC __glewTexStorageSparseAMD; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGESPARSEAMDPROC __glewTextureStorageSparseAMD; + +GLEW_FUN_EXPORT PFNGLSTENCILOPVALUEAMDPROC __glewStencilOpValueAMD; + +GLEW_FUN_EXPORT PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD; +GLEW_FUN_EXPORT PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD; + +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERANGLEPROC __glewBlitFramebufferANGLE; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC __glewRenderbufferStorageMultisampleANGLE; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDANGLEPROC __glewDrawArraysInstancedANGLE; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDANGLEPROC __glewDrawElementsInstancedANGLE; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORANGLEPROC __glewVertexAttribDivisorANGLE; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYANGLEPROC __glewBeginQueryANGLE; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESANGLEPROC __glewDeleteQueriesANGLE; +GLEW_FUN_EXPORT PFNGLENDQUERYANGLEPROC __glewEndQueryANGLE; +GLEW_FUN_EXPORT PFNGLGENQUERIESANGLEPROC __glewGenQueriesANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VANGLEPROC __glewGetQueryObjecti64vANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVANGLEPROC __glewGetQueryObjectivANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VANGLEPROC __glewGetQueryObjectui64vANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVANGLEPROC __glewGetQueryObjectuivANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYIVANGLEPROC __glewGetQueryivANGLE; +GLEW_FUN_EXPORT PFNGLISQUERYANGLEPROC __glewIsQueryANGLE; +GLEW_FUN_EXPORT PFNGLQUERYCOUNTERANGLEPROC __glewQueryCounterANGLE; + +GLEW_FUN_EXPORT PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC __glewGetTranslatedShaderSourceANGLE; + +GLEW_FUN_EXPORT PFNGLCOPYTEXTURELEVELSAPPLEPROC __glewCopyTextureLevelsAPPLE; + GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE; GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE; GLEW_FUN_EXPORT PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE; @@ -10537,6 +20248,21 @@ GLEW_FUN_EXPORT PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE; GLEW_FUN_EXPORT PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE; GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC __glewRenderbufferStorageMultisampleAPPLE; +GLEW_FUN_EXPORT PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC __glewResolveMultisampleFramebufferAPPLE; + +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE; +GLEW_FUN_EXPORT PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE; +GLEW_FUN_EXPORT PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE; + +GLEW_FUN_EXPORT PFNGLCLIENTWAITSYNCAPPLEPROC __glewClientWaitSyncAPPLE; +GLEW_FUN_EXPORT PFNGLDELETESYNCAPPLEPROC __glewDeleteSyncAPPLE; +GLEW_FUN_EXPORT PFNGLFENCESYNCAPPLEPROC __glewFenceSyncAPPLE; +GLEW_FUN_EXPORT PFNGLGETINTEGER64VAPPLEPROC __glewGetInteger64vAPPLE; +GLEW_FUN_EXPORT PFNGLGETSYNCIVAPPLEPROC __glewGetSyncivAPPLE; +GLEW_FUN_EXPORT PFNGLISSYNCAPPLEPROC __glewIsSyncAPPLE; +GLEW_FUN_EXPORT PFNGLWAITSYNCAPPLEPROC __glewWaitSyncAPPLE; + GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE; GLEW_FUN_EXPORT PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE; @@ -10549,12 +20275,195 @@ GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeA GLEW_FUN_EXPORT PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE; GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE; +GLEW_FUN_EXPORT PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHFPROC __glewClearDepthf; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEFPROC __glewDepthRangef; +GLEW_FUN_EXPORT PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat; +GLEW_FUN_EXPORT PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler; +GLEW_FUN_EXPORT PFNGLSHADERBINARYPROC __glewShaderBinary; + +GLEW_FUN_EXPORT PFNGLMEMORYBARRIERBYREGIONPROC __glewMemoryBarrierByRegion; + +GLEW_FUN_EXPORT PFNGLPRIMITIVEBOUNDINGBOXARBPROC __glewPrimitiveBoundingBoxARB; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance; + +GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLEARBPROC __glewGetImageHandleARB; +GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLEARBPROC __glewGetTextureHandleARB; +GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLEARBPROC __glewGetTextureSamplerHandleARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VARBPROC __glewGetVertexAttribLui64vARB; +GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTARBPROC __glewIsImageHandleResidentARB; +GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTARBPROC __glewIsTextureHandleResidentARB; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC __glewMakeImageHandleNonResidentARB; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTARBPROC __glewMakeImageHandleResidentARB; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC __glewMakeTextureHandleNonResidentARB; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTARBPROC __glewMakeTextureHandleResidentARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC __glewProgramUniformHandleui64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC __glewProgramUniformHandleui64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64ARBPROC __glewUniformHandleui64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VARBPROC __glewUniformHandleui64vARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64ARBPROC __glewVertexAttribL1ui64ARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VARBPROC __glewVertexAttribL1ui64vARB; + +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed; +GLEW_FUN_EXPORT PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex; + +GLEW_FUN_EXPORT PFNGLBUFFERSTORAGEPROC __glewBufferStorage; + +GLEW_FUN_EXPORT PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB; + +GLEW_FUN_EXPORT PFNGLCLEARBUFFERDATAPROC __glewClearBufferData; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERSUBDATAPROC __glewClearBufferSubData; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERDATAEXTPROC __glewClearNamedBufferDataEXT; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC __glewClearNamedBufferSubDataEXT; + +GLEW_FUN_EXPORT PFNGLCLEARTEXIMAGEPROC __glewClearTexImage; +GLEW_FUN_EXPORT PFNGLCLEARTEXSUBIMAGEPROC __glewClearTexSubImage; + +GLEW_FUN_EXPORT PFNGLCLIPCONTROLPROC __glewClipControl; + GLEW_FUN_EXPORT PFNGLCLAMPCOLORARBPROC __glewClampColorARB; +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEPROC __glewDispatchCompute; +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEINDIRECTPROC __glewDispatchComputeIndirect; + +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC __glewDispatchComputeGroupSizeARB; + +GLEW_FUN_EXPORT PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData; + +GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATAPROC __glewCopyImageSubData; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB; + +GLEW_FUN_EXPORT PFNGLBINDTEXTUREUNITPROC __glewBindTextureUnit; +GLEW_FUN_EXPORT PFNGLBLITNAMEDFRAMEBUFFERPROC __glewBlitNamedFramebuffer; +GLEW_FUN_EXPORT PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC __glewCheckNamedFramebufferStatus; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERDATAPROC __glewClearNamedBufferData; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERSUBDATAPROC __glewClearNamedBufferSubData; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERFIPROC __glewClearNamedFramebufferfi; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERFVPROC __glewClearNamedFramebufferfv; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERIVPROC __glewClearNamedFramebufferiv; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC __glewClearNamedFramebufferuiv; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC __glewCompressedTextureSubImage1D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC __glewCompressedTextureSubImage2D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC __glewCompressedTextureSubImage3D; +GLEW_FUN_EXPORT PFNGLCOPYNAMEDBUFFERSUBDATAPROC __glewCopyNamedBufferSubData; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE1DPROC __glewCopyTextureSubImage1D; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE2DPROC __glewCopyTextureSubImage2D; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE3DPROC __glewCopyTextureSubImage3D; +GLEW_FUN_EXPORT PFNGLCREATEBUFFERSPROC __glewCreateBuffers; +GLEW_FUN_EXPORT PFNGLCREATEFRAMEBUFFERSPROC __glewCreateFramebuffers; +GLEW_FUN_EXPORT PFNGLCREATEPROGRAMPIPELINESPROC __glewCreateProgramPipelines; +GLEW_FUN_EXPORT PFNGLCREATEQUERIESPROC __glewCreateQueries; +GLEW_FUN_EXPORT PFNGLCREATERENDERBUFFERSPROC __glewCreateRenderbuffers; +GLEW_FUN_EXPORT PFNGLCREATESAMPLERSPROC __glewCreateSamplers; +GLEW_FUN_EXPORT PFNGLCREATETEXTURESPROC __glewCreateTextures; +GLEW_FUN_EXPORT PFNGLCREATETRANSFORMFEEDBACKSPROC __glewCreateTransformFeedbacks; +GLEW_FUN_EXPORT PFNGLCREATEVERTEXARRAYSPROC __glewCreateVertexArrays; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYATTRIBPROC __glewDisableVertexArrayAttrib; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYATTRIBPROC __glewEnableVertexArrayAttrib; +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC __glewFlushMappedNamedBufferRange; +GLEW_FUN_EXPORT PFNGLGENERATETEXTUREMIPMAPPROC __glewGenerateTextureMipmap; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC __glewGetCompressedTextureImage; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERI64VPROC __glewGetNamedBufferParameteri64v; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERIVPROC __glewGetNamedBufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPOINTERVPROC __glewGetNamedBufferPointerv; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERSUBDATAPROC __glewGetNamedBufferSubData; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetNamedFramebufferAttachmentParameteriv; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC __glewGetNamedFramebufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC __glewGetNamedRenderbufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTI64VPROC __glewGetQueryBufferObjecti64v; +GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTIVPROC __glewGetQueryBufferObjectiv; +GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTUI64VPROC __glewGetQueryBufferObjectui64v; +GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTUIVPROC __glewGetQueryBufferObjectuiv; +GLEW_FUN_EXPORT PFNGLGETTEXTUREIMAGEPROC __glewGetTextureImage; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERFVPROC __glewGetTextureLevelParameterfv; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERIVPROC __glewGetTextureLevelParameteriv; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIIVPROC __glewGetTextureParameterIiv; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIUIVPROC __glewGetTextureParameterIuiv; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERFVPROC __glewGetTextureParameterfv; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIVPROC __glewGetTextureParameteriv; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKI64_VPROC __glewGetTransformFeedbacki64_v; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKI_VPROC __glewGetTransformFeedbacki_v; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKIVPROC __glewGetTransformFeedbackiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINDEXED64IVPROC __glewGetVertexArrayIndexed64iv; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINDEXEDIVPROC __glewGetVertexArrayIndexediv; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYIVPROC __glewGetVertexArrayiv; +GLEW_FUN_EXPORT PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC __glewInvalidateNamedFramebufferData; +GLEW_FUN_EXPORT PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC __glewInvalidateNamedFramebufferSubData; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERPROC __glewMapNamedBuffer; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERRANGEPROC __glewMapNamedBufferRange; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERDATAPROC __glewNamedBufferData; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEPROC __glewNamedBufferStorage; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSUBDATAPROC __glewNamedBufferSubData; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC __glewNamedFramebufferDrawBuffer; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC __glewNamedFramebufferDrawBuffers; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC __glewNamedFramebufferParameteri; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC __glewNamedFramebufferReadBuffer; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC __glewNamedFramebufferRenderbuffer; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREPROC __glewNamedFramebufferTexture; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC __glewNamedFramebufferTextureLayer; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEPROC __glewNamedRenderbufferStorage; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewNamedRenderbufferStorageMultisample; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERPROC __glewTextureBuffer; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERRANGEPROC __glewTextureBufferRange; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIIVPROC __glewTextureParameterIiv; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIUIVPROC __glewTextureParameterIuiv; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFPROC __glewTextureParameterf; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFVPROC __glewTextureParameterfv; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIPROC __glewTextureParameteri; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIVPROC __glewTextureParameteriv; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE1DPROC __glewTextureStorage1D; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DPROC __glewTextureStorage2D; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC __glewTextureStorage2DMultisample; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DPROC __glewTextureStorage3D; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC __glewTextureStorage3DMultisample; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE1DPROC __glewTextureSubImage1D; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE2DPROC __glewTextureSubImage2D; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE3DPROC __glewTextureSubImage3D; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC __glewTransformFeedbackBufferBase; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC __glewTransformFeedbackBufferRange; +GLEW_FUN_EXPORT PFNGLUNMAPNAMEDBUFFERPROC __glewUnmapNamedBuffer; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBBINDINGPROC __glewVertexArrayAttribBinding; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBFORMATPROC __glewVertexArrayAttribFormat; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBIFORMATPROC __glewVertexArrayAttribIFormat; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBLFORMATPROC __glewVertexArrayAttribLFormat; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYBINDINGDIVISORPROC __glewVertexArrayBindingDivisor; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYELEMENTBUFFERPROC __glewVertexArrayElementBuffer; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXBUFFERPROC __glewVertexArrayVertexBuffer; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXBUFFERSPROC __glewVertexArrayVertexBuffers; + GLEW_FUN_EXPORT PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB; -GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB; -GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB; +GLEW_FUN_EXPORT PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERPARAMETERIPROC __glewFramebufferParameteri; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVPROC __glewGetFramebufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC __glewGetNamedFramebufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC __glewNamedFramebufferParameteriEXT; GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer; GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer; @@ -10563,10 +20472,10 @@ GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus; GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers; GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURLAYERPROC __glewFramebufferTexturLayer; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer; GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers; GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers; GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap; @@ -10582,6 +20491,71 @@ GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceA GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB; GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary; +GLEW_FUN_EXPORT PFNGLPROGRAMBINARYPROC __glewProgramBinary; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri; + +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC __glewGetCompressedTextureSubImage; +GLEW_FUN_EXPORT PFNGLGETTEXTURESUBIMAGEPROC __glewGetTextureSubImage; + +GLEW_FUN_EXPORT PFNGLSPECIALIZESHADERARBPROC __glewSpecializeShaderARB; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMDVPROC __glewGetUniformdv; +GLEW_FUN_EXPORT PFNGLUNIFORM1DPROC __glewUniform1d; +GLEW_FUN_EXPORT PFNGLUNIFORM1DVPROC __glewUniform1dv; +GLEW_FUN_EXPORT PFNGLUNIFORM2DPROC __glewUniform2d; +GLEW_FUN_EXPORT PFNGLUNIFORM2DVPROC __glewUniform2dv; +GLEW_FUN_EXPORT PFNGLUNIFORM3DPROC __glewUniform3d; +GLEW_FUN_EXPORT PFNGLUNIFORM3DVPROC __glewUniform3dv; +GLEW_FUN_EXPORT PFNGLUNIFORM4DPROC __glewUniform4d; +GLEW_FUN_EXPORT PFNGLUNIFORM4DVPROC __glewUniform4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMI64VARBPROC __glewGetUniformi64vARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUI64VARBPROC __glewGetUniformui64vARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMI64VARBPROC __glewGetnUniformi64vARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMUI64VARBPROC __glewGetnUniformui64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64ARBPROC __glewProgramUniform1i64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64VARBPROC __glewProgramUniform1i64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64ARBPROC __glewProgramUniform1ui64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64VARBPROC __glewProgramUniform1ui64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64ARBPROC __glewProgramUniform2i64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64VARBPROC __glewProgramUniform2i64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64ARBPROC __glewProgramUniform2ui64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64VARBPROC __glewProgramUniform2ui64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64ARBPROC __glewProgramUniform3i64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64VARBPROC __glewProgramUniform3i64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64ARBPROC __glewProgramUniform3ui64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64VARBPROC __glewProgramUniform3ui64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64ARBPROC __glewProgramUniform4i64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64VARBPROC __glewProgramUniform4i64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64ARBPROC __glewProgramUniform4ui64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64VARBPROC __glewProgramUniform4ui64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64ARBPROC __glewUniform1i64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64VARBPROC __glewUniform1i64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64ARBPROC __glewUniform1ui64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64VARBPROC __glewUniform1ui64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64ARBPROC __glewUniform2i64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64VARBPROC __glewUniform2i64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64ARBPROC __glewUniform2ui64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64VARBPROC __glewUniform2ui64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64ARBPROC __glewUniform3i64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64VARBPROC __glewUniform3i64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64ARBPROC __glewUniform3ui64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64VARBPROC __glewUniform3ui64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64ARBPROC __glewUniform4i64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64VARBPROC __glewUniform4i64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64ARBPROC __glewUniform4ui64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64VARBPROC __glewUniform4ui64vARB; + GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEPROC __glewColorSubTable; GLEW_FUN_EXPORT PFNGLCOLORTABLEPROC __glewColorTable; GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv; @@ -10615,8 +20589,24 @@ GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMPROC __glewResetHistogram; GLEW_FUN_EXPORT PFNGLRESETMINMAXPROC __glewResetMinmax; GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D; +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC __glewMultiDrawArraysIndirectCountARB; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC __glewMultiDrawElementsIndirectCountARB; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB; +GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ; + +GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATI64VPROC __glewGetInternalformati64v; + +GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERDATAPROC __glewInvalidateBufferData; +GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERSUBDATAPROC __glewInvalidateBufferSubData; +GLEW_FUN_EXPORT PFNGLINVALIDATEFRAMEBUFFERPROC __glewInvalidateFramebuffer; +GLEW_FUN_EXPORT PFNGLINVALIDATESUBFRAMEBUFFERPROC __glewInvalidateSubFramebuffer; +GLEW_FUN_EXPORT PFNGLINVALIDATETEXIMAGEPROC __glewInvalidateTexImage; +GLEW_FUN_EXPORT PFNGLINVALIDATETEXSUBIMAGEPROC __glewInvalidateTexSubImage; + GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange; GLEW_FUN_EXPORT PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange; @@ -10626,6 +20616,16 @@ GLEW_FUN_EXPORT PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB; GLEW_FUN_EXPORT PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB; GLEW_FUN_EXPORT PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB; +GLEW_FUN_EXPORT PFNGLBINDBUFFERSBASEPROC __glewBindBuffersBase; +GLEW_FUN_EXPORT PFNGLBINDBUFFERSRANGEPROC __glewBindBuffersRange; +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTURESPROC __glewBindImageTextures; +GLEW_FUN_EXPORT PFNGLBINDSAMPLERSPROC __glewBindSamplers; +GLEW_FUN_EXPORT PFNGLBINDTEXTURESPROC __glewBindTextures; +GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERSPROC __glewBindVertexBuffers; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTPROC __glewMultiDrawArraysIndirect; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTPROC __glewMultiDrawElementsIndirect; + GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB; GLEW_FUN_EXPORT PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB; @@ -10672,9 +20672,129 @@ GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB; GLEW_FUN_EXPORT PFNGLGETQUERYIVARBPROC __glewGetQueryivARB; GLEW_FUN_EXPORT PFNGLISQUERYARBPROC __glewIsQueryARB; +GLEW_FUN_EXPORT PFNGLMAXSHADERCOMPILERTHREADSARBPROC __glewMaxShaderCompilerThreadsARB; + GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB; +GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETCLAMPPROC __glewPolygonOffsetClamp; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMINTERFACEIVPROC __glewGetProgramInterfaceiv; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEINDEXPROC __glewGetProgramResourceIndex; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONPROC __glewGetProgramResourceLocation; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC __glewGetProgramResourceLocationIndex; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCENAMEPROC __glewGetProgramResourceName; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEIVPROC __glewGetProgramResourceiv; + +GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex; + +GLEW_FUN_EXPORT PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB; +GLEW_FUN_EXPORT PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB; +GLEW_FUN_EXPORT PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB; +GLEW_FUN_EXPORT PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB; +GLEW_FUN_EXPORT PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB; +GLEW_FUN_EXPORT PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB; +GLEW_FUN_EXPORT PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB; +GLEW_FUN_EXPORT PFNGLGETNMAPIVARBPROC __glewGetnMapivARB; +GLEW_FUN_EXPORT PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB; +GLEW_FUN_EXPORT PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB; +GLEW_FUN_EXPORT PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB; +GLEW_FUN_EXPORT PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB; +GLEW_FUN_EXPORT PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC __glewFramebufferSampleLocationsfvARB; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC __glewNamedFramebufferSampleLocationsfvARB; + +GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB; + +GLEW_FUN_EXPORT PFNGLBINDSAMPLERPROC __glewBindSampler; +GLEW_FUN_EXPORT PFNGLDELETESAMPLERSPROC __glewDeleteSamplers; +GLEW_FUN_EXPORT PFNGLGENSAMPLERSPROC __glewGenSamplers; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv; +GLEW_FUN_EXPORT PFNGLISSAMPLERPROC __glewIsSampler; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv; + +GLEW_FUN_EXPORT PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram; +GLEW_FUN_EXPORT PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines; +GLEW_FUN_EXPORT PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv; +GLEW_FUN_EXPORT PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline; + +GLEW_FUN_EXPORT PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv; + +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture; +GLEW_FUN_EXPORT PFNGLMEMORYBARRIERPROC __glewMemoryBarrier; + GLEW_FUN_EXPORT PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB; GLEW_FUN_EXPORT PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB; GLEW_FUN_EXPORT PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB; @@ -10715,8 +20835,46 @@ GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB; GLEW_FUN_EXPORT PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB; GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB; +GLEW_FUN_EXPORT PFNGLSHADERSTORAGEBLOCKBINDINGPROC __glewShaderStorageBlockBinding; + +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName; +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName; +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv; +GLEW_FUN_EXPORT PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex; +GLEW_FUN_EXPORT PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation; +GLEW_FUN_EXPORT PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv; +GLEW_FUN_EXPORT PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv; + +GLEW_FUN_EXPORT PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB; +GLEW_FUN_EXPORT PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB; +GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB; +GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB; +GLEW_FUN_EXPORT PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB; +GLEW_FUN_EXPORT PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB; + +GLEW_FUN_EXPORT PFNGLBUFFERPAGECOMMITMENTARBPROC __glewBufferPageCommitmentARB; + +GLEW_FUN_EXPORT PFNGLTEXPAGECOMMITMENTARBPROC __glewTexPageCommitmentARB; + +GLEW_FUN_EXPORT PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync; +GLEW_FUN_EXPORT PFNGLDELETESYNCPROC __glewDeleteSync; +GLEW_FUN_EXPORT PFNGLFENCESYNCPROC __glewFenceSync; +GLEW_FUN_EXPORT PFNGLGETINTEGER64VPROC __glewGetInteger64v; +GLEW_FUN_EXPORT PFNGLGETSYNCIVPROC __glewGetSynciv; +GLEW_FUN_EXPORT PFNGLISSYNCPROC __glewIsSync; +GLEW_FUN_EXPORT PFNGLWAITSYNCPROC __glewWaitSync; + +GLEW_FUN_EXPORT PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv; +GLEW_FUN_EXPORT PFNGLPATCHPARAMETERIPROC __glewPatchParameteri; + +GLEW_FUN_EXPORT PFNGLTEXTUREBARRIERPROC __glewTextureBarrier; + GLEW_FUN_EXPORT PFNGLTEXBUFFERARBPROC __glewTexBufferARB; +GLEW_FUN_EXPORT PFNGLTEXBUFFERRANGEPROC __glewTexBufferRange; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERRANGEEXTPROC __glewTextureBufferRangeEXT; + GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB; @@ -10725,16 +20883,87 @@ GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2 GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB; GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB; +GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv; +GLEW_FUN_EXPORT PFNGLSAMPLEMASKIPROC __glewSampleMaski; +GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGE1DPROC __glewTexStorage1D; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DPROC __glewTexStorage2D; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DPROC __glewTexStorage3D; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DMULTISAMPLEPROC __glewTexStorage2DMultisample; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DMULTISAMPLEPROC __glewTexStorage3DMultisample; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC __glewTextureStorage2DMultisampleEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC __glewTextureStorage3DMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLTEXTUREVIEWPROC __glewTextureView; + +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v; +GLEW_FUN_EXPORT PFNGLQUERYCOUNTERPROC __glewQueryCounter; + +GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback; +GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback; +GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks; +GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback; +GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback; +GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream; +GLEW_FUN_EXPORT PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed; +GLEW_FUN_EXPORT PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv; + +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced; + GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB; GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB; GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB; GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB; +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEPROC __glewBindBufferBase; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv; +GLEW_FUN_EXPORT PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v; +GLEW_FUN_EXPORT PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex; +GLEW_FUN_EXPORT PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices; +GLEW_FUN_EXPORT PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding; + GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray; GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays; GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays; GLEW_FUN_EXPORT PFNGLISVERTEXARRAYPROC __glewIsVertexArray; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERPROC __glewBindVertexBuffer; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC __glewVertexArrayBindVertexBufferEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC __glewVertexArrayVertexAttribBindingEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC __glewVertexArrayVertexAttribFormatEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC __glewVertexArrayVertexAttribIFormatEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC __glewVertexArrayVertexAttribLFormatEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC __glewVertexArrayVertexBindingDivisorEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBBINDINGPROC __glewVertexAttribBinding; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATPROC __glewVertexAttribFormat; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATPROC __glewVertexAttribIFormat; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATPROC __glewVertexAttribLFormat; +GLEW_FUN_EXPORT PFNGLVERTEXBINDINGDIVISORPROC __glewVertexBindingDivisor; + GLEW_FUN_EXPORT PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB; GLEW_FUN_EXPORT PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB; GLEW_FUN_EXPORT PFNGLWEIGHTBVARBPROC __glewWeightbvARB; @@ -10825,6 +21054,56 @@ GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB; GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB; GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB; +GLEW_FUN_EXPORT PFNGLCOLORP3UIPROC __glewColorP3ui; +GLEW_FUN_EXPORT PFNGLCOLORP3UIVPROC __glewColorP3uiv; +GLEW_FUN_EXPORT PFNGLCOLORP4UIPROC __glewColorP4ui; +GLEW_FUN_EXPORT PFNGLCOLORP4UIVPROC __glewColorP4uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv; +GLEW_FUN_EXPORT PFNGLNORMALP3UIPROC __glewNormalP3ui; +GLEW_FUN_EXPORT PFNGLNORMALP3UIVPROC __glewNormalP3uiv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP2UIPROC __glewVertexP2ui; +GLEW_FUN_EXPORT PFNGLVERTEXP2UIVPROC __glewVertexP2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP3UIPROC __glewVertexP3ui; +GLEW_FUN_EXPORT PFNGLVERTEXP3UIVPROC __glewVertexP3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP4UIPROC __glewVertexP4ui; +GLEW_FUN_EXPORT PFNGLVERTEXP4UIVPROC __glewVertexP4uiv; + +GLEW_FUN_EXPORT PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed; +GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v; +GLEW_FUN_EXPORT PFNGLGETFLOATI_VPROC __glewGetFloati_v; +GLEW_FUN_EXPORT PFNGLSCISSORARRAYVPROC __glewScissorArrayv; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDPROC __glewScissorIndexed; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv; +GLEW_FUN_EXPORT PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv; + GLEW_FUN_EXPORT PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB; @@ -10871,8 +21150,8 @@ GLEW_FUN_EXPORT PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderCon GLEW_FUN_EXPORT PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI; GLEW_FUN_EXPORT PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI; -GLEW_FUN_EXPORT PFNGLPNTRIANGLESFATIPROC __glPNTrianglewesfATI; -GLEW_FUN_EXPORT PFNGLPNTRIANGLESIATIPROC __glPNTrianglewesiATI; +GLEW_FUN_EXPORT PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI; +GLEW_FUN_EXPORT PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI; GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI; GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI; @@ -10907,6 +21186,14 @@ GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI; GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI; GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI; GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DATIPROC __glewVertexStream1dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DVATIPROC __glewVertexStream1dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FATIPROC __glewVertexStream1fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FVATIPROC __glewVertexStream1fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IATIPROC __glewVertexStream1iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IVATIPROC __glewVertexStream1ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SATIPROC __glewVertexStream1sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SVATIPROC __glewVertexStream1svATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI; @@ -10932,6 +21219,10 @@ GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI; +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEEXTPROC __glewDrawArraysInstancedBaseInstanceEXT; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEEXTPROC __glewDrawElementsInstancedBaseInstanceEXT; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEEXTPROC __glewDrawElementsInstancedBaseVertexBaseInstanceEXT; + GLEW_FUN_EXPORT PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT; GLEW_FUN_EXPORT PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT; GLEW_FUN_EXPORT PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT; @@ -10940,10 +21231,20 @@ GLEW_FUN_EXPORT PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT; GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT; +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONINDEXEDEXTPROC __glewBindFragDataLocationIndexedEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGDATAINDEXEXTPROC __glewGetFragDataIndexEXT; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONINDEXEXTPROC __glewGetProgramResourceLocationIndexEXT; + GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT; GLEW_FUN_EXPORT PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT; +GLEW_FUN_EXPORT PFNGLBUFFERSTORAGEEXTPROC __glewBufferStorageEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEEXTPROC __glewNamedBufferStorageEXT; + +GLEW_FUN_EXPORT PFNGLCLEARTEXIMAGEEXTPROC __glewClearTexImageEXT; +GLEW_FUN_EXPORT PFNGLCLEARTEXSUBIMAGEEXTPROC __glewClearTexSubImageEXT; + GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT; GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT; @@ -10967,6 +21268,8 @@ GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT; GLEW_FUN_EXPORT PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT; GLEW_FUN_EXPORT PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT; +GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATAEXTPROC __glewCopyImageSubDataEXT; + GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT; GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT; GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT; @@ -10976,6 +21279,13 @@ GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT; GLEW_FUN_EXPORT PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT; GLEW_FUN_EXPORT PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETOBJECTLABELEXTPROC __glewGetObjectLabelEXT; +GLEW_FUN_EXPORT PFNGLLABELOBJECTEXTPROC __glewLabelObjectEXT; + +GLEW_FUN_EXPORT PFNGLINSERTEVENTMARKEREXTPROC __glewInsertEventMarkerEXT; +GLEW_FUN_EXPORT PFNGLPOPGROUPMARKEREXTPROC __glewPopGroupMarkerEXT; +GLEW_FUN_EXPORT PFNGLPUSHGROUPMARKEREXTPROC __glewPushGroupMarkerEXT; + GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT; GLEW_FUN_EXPORT PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT; @@ -11004,7 +21314,14 @@ GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT; GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT; GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT; +GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT; GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT; +GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT; +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT; @@ -11013,7 +21330,9 @@ GLEW_FUN_EXPORT PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT; GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT; GLEW_FUN_EXPORT PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT; GLEW_FUN_EXPORT PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT; GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT; @@ -11039,6 +21358,7 @@ GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT; GLEW_FUN_EXPORT PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT; GLEW_FUN_EXPORT PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT; GLEW_FUN_EXPORT PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT; GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT; GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT; @@ -11046,7 +21366,12 @@ GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivE GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT; GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT; GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT; GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT; GLEW_FUN_EXPORT PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT; GLEW_FUN_EXPORT PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT; GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT; @@ -11093,6 +21418,7 @@ GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT; GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT; GLEW_FUN_EXPORT PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT; GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT; @@ -11164,6 +21490,22 @@ GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT; GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT; GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT; GLEW_FUN_EXPORT PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC __glewVertexArrayVertexAttribDivisorEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT; + +GLEW_FUN_EXPORT PFNGLDISCARDFRAMEBUFFEREXTPROC __glewDiscardFramebufferEXT; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSEXTPROC __glewDrawBuffersEXT; GLEW_FUN_EXPORT PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT; GLEW_FUN_EXPORT PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT; @@ -11172,11 +21514,28 @@ GLEW_FUN_EXPORT PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT; GLEW_FUN_EXPORT PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT; GLEW_FUN_EXPORT PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIEXTPROC __glewBlendEquationSeparateiEXT; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIEXTPROC __glewBlendEquationiEXT; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIEXTPROC __glewBlendFuncSeparateiEXT; +GLEW_FUN_EXPORT PFNGLBLENDFUNCIEXTPROC __glewBlendFunciEXT; +GLEW_FUN_EXPORT PFNGLCOLORMASKIEXTPROC __glewColorMaskiEXT; +GLEW_FUN_EXPORT PFNGLDISABLEIEXTPROC __glewDisableiEXT; +GLEW_FUN_EXPORT PFNGLENABLEIEXTPROC __glewEnableiEXT; +GLEW_FUN_EXPORT PFNGLISENABLEDIEXTPROC __glewIsEnablediEXT; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSBASEVERTEXEXTPROC __glewDrawElementsBaseVertexEXT; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXEXTPROC __glewDrawElementsInstancedBaseVertexEXT; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSBASEVERTEXEXTPROC __glewDrawRangeElementsBaseVertexEXT; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC __glewMultiDrawElementsBaseVertexEXT; + GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT; GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT; GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT; +GLEW_FUN_EXPORT PFNGLBUFFERSTORAGEEXTERNALEXTPROC __glewBufferStorageExternalEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEEXTERNALEXTPROC __glewNamedBufferStorageExternalEXT; + GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT; GLEW_FUN_EXPORT PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT; GLEW_FUN_EXPORT PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT; @@ -11226,7 +21585,6 @@ GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT; GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT; GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT; @@ -11282,16 +21640,55 @@ GLEW_FUN_EXPORT PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT; GLEW_FUN_EXPORT PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISOREXTPROC __glewVertexAttribDivisorEXT; + GLEW_FUN_EXPORT PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT; GLEW_FUN_EXPORT PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT; GLEW_FUN_EXPORT PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT; +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC __glewFlushMappedBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLMAPBUFFERRANGEEXTPROC __glewMapBufferRangeEXT; + +GLEW_FUN_EXPORT PFNGLBUFFERSTORAGEMEMEXTPROC __glewBufferStorageMemEXT; +GLEW_FUN_EXPORT PFNGLCREATEMEMORYOBJECTSEXTPROC __glewCreateMemoryObjectsEXT; +GLEW_FUN_EXPORT PFNGLDELETEMEMORYOBJECTSEXTPROC __glewDeleteMemoryObjectsEXT; +GLEW_FUN_EXPORT PFNGLGETMEMORYOBJECTPARAMETERIVEXTPROC __glewGetMemoryObjectParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETUNSIGNEDBYTEI_VEXTPROC __glewGetUnsignedBytei_vEXT; +GLEW_FUN_EXPORT PFNGLGETUNSIGNEDBYTEVEXTPROC __glewGetUnsignedBytevEXT; +GLEW_FUN_EXPORT PFNGLISMEMORYOBJECTEXTPROC __glewIsMemoryObjectEXT; +GLEW_FUN_EXPORT PFNGLMEMORYOBJECTPARAMETERIVEXTPROC __glewMemoryObjectParameterivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEMEMEXTPROC __glewNamedBufferStorageMemEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGEMEM1DEXTPROC __glewTexStorageMem1DEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGEMEM2DEXTPROC __glewTexStorageMem2DEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGEMEM2DMULTISAMPLEEXTPROC __glewTexStorageMem2DMultisampleEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGEMEM3DEXTPROC __glewTexStorageMem3DEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGEMEM3DMULTISAMPLEEXTPROC __glewTexStorageMem3DMultisampleEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGEMEM1DEXTPROC __glewTextureStorageMem1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGEMEM2DEXTPROC __glewTextureStorageMem2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGEMEM2DMULTISAMPLEEXTPROC __glewTextureStorageMem2DMultisampleEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGEMEM3DEXTPROC __glewTextureStorageMem3DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGEMEM3DMULTISAMPLEEXTPROC __glewTextureStorageMem3DMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTMEMORYFDEXTPROC __glewImportMemoryFdEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTMEMORYWIN32HANDLEEXTPROC __glewImportMemoryWin32HandleEXT; +GLEW_FUN_EXPORT PFNGLIMPORTMEMORYWIN32NAMEEXTPROC __glewImportMemoryWin32NameEXT; + GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT; GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT; +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTEXTPROC __glewMultiDrawArraysIndirectEXT; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTEXTPROC __glewMultiDrawElementsIndirectEXT; + GLEW_FUN_EXPORT PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT; GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC __glewFramebufferTexture2DMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSINDEXEDEXTPROC __glewDrawBuffersIndexedEXT; +GLEW_FUN_EXPORT PFNGLGETINTEGERI_VEXTPROC __glewGetIntegeri_vEXT; +GLEW_FUN_EXPORT PFNGLREADBUFFERINDEXEDEXTPROC __glewReadBufferIndexedEXT; + GLEW_FUN_EXPORT PFNGLCOLORTABLEEXTPROC __glewColorTableEXT; GLEW_FUN_EXPORT PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT; GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT; @@ -11309,6 +21706,15 @@ GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT; GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT; +GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETCLAMPEXTPROC __glewPolygonOffsetClampEXT; + +GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT; + +GLEW_FUN_EXPORT PFNGLCOVERAGEMODULATIONNVPROC __glewCoverageModulationNV; +GLEW_FUN_EXPORT PFNGLCOVERAGEMODULATIONTABLENVPROC __glewCoverageModulationTableNV; +GLEW_FUN_EXPORT PFNGLGETCOVERAGEMODULATIONTABLENVPROC __glewGetCoverageModulationTableNV; +GLEW_FUN_EXPORT PFNGLRASTERSAMPLESEXTPROC __glewRasterSamplesEXT; + GLEW_FUN_EXPORT PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT; GLEW_FUN_EXPORT PFNGLENDSCENEEXTPROC __glewEndSceneEXT; @@ -11330,6 +21736,33 @@ GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT; +GLEW_FUN_EXPORT PFNGLDELETESEMAPHORESEXTPROC __glewDeleteSemaphoresEXT; +GLEW_FUN_EXPORT PFNGLGENSEMAPHORESEXTPROC __glewGenSemaphoresEXT; +GLEW_FUN_EXPORT PFNGLGETSEMAPHOREPARAMETERUI64VEXTPROC __glewGetSemaphoreParameterui64vEXT; +GLEW_FUN_EXPORT PFNGLISSEMAPHOREEXTPROC __glewIsSemaphoreEXT; +GLEW_FUN_EXPORT PFNGLSEMAPHOREPARAMETERUI64VEXTPROC __glewSemaphoreParameterui64vEXT; +GLEW_FUN_EXPORT PFNGLSIGNALSEMAPHOREEXTPROC __glewSignalSemaphoreEXT; +GLEW_FUN_EXPORT PFNGLWAITSEMAPHOREEXTPROC __glewWaitSemaphoreEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTSEMAPHOREFDEXTPROC __glewImportSemaphoreFdEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTSEMAPHOREWIN32HANDLEEXTPROC __glewImportSemaphoreWin32HandleEXT; +GLEW_FUN_EXPORT PFNGLIMPORTSEMAPHOREWIN32NAMEEXTPROC __glewImportSemaphoreWin32NameEXT; + +GLEW_FUN_EXPORT PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT; +GLEW_FUN_EXPORT PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT; + +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT; +GLEW_FUN_EXPORT PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT; + +GLEW_FUN_EXPORT PFNGLCLEARPIXELLOCALSTORAGEUIEXTPROC __glewClearPixelLocalStorageuiEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC __glewFramebufferPixelLocalStorageSizeEXT; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC __glewGetFramebufferPixelLocalStorageSizeEXT; + +GLEW_FUN_EXPORT PFNGLTEXPAGECOMMITMENTEXTPROC __glewTexPageCommitmentEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPAGECOMMITMENTEXTPROC __glewTexturePageCommitmentEXT; + GLEW_FUN_EXPORT PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT; GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT; @@ -11338,6 +21771,8 @@ GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT; GLEW_FUN_EXPORT PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT; + GLEW_FUN_EXPORT PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT; GLEW_FUN_EXPORT PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT; @@ -11356,6 +21791,15 @@ GLEW_FUN_EXPORT PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT; GLEW_FUN_EXPORT PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE1DEXTPROC __glewTexStorage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DEXTPROC __glewTexStorage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DEXTPROC __glewTexStorage3DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT; + +GLEW_FUN_EXPORT PFNGLTEXTUREVIEWEXTPROC __glewTextureViewEXT; + GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT; @@ -11371,12 +21815,27 @@ GLEW_FUN_EXPORT PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT; GLEW_FUN_EXPORT PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT; GLEW_FUN_EXPORT PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT; GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT; -GLEW_FUN_EXPORT PFNGLGETPOINTERVEXTPROC __glewGetPointervEXT; GLEW_FUN_EXPORT PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT; GLEW_FUN_EXPORT PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT; GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT; GLEW_FUN_EXPORT PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT; +GLEW_FUN_EXPORT PFNGLBINDARRAYSETEXTPROC __glewBindArraySetEXT; +GLEW_FUN_EXPORT PFNGLCREATEARRAYSETEXTPROC __glewCreateArraySetExt; +GLEW_FUN_EXPORT PFNGLDELETEARRAYSETSEXTPROC __glewDeleteArraySetsEXT; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT; + GLEW_FUN_EXPORT PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT; GLEW_FUN_EXPORT PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT; GLEW_FUN_EXPORT PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT; @@ -11424,6 +21883,13 @@ GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT; GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT; GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT; +GLEW_FUN_EXPORT PFNGLACQUIREKEYEDMUTEXWIN32EXTPROC __glewAcquireKeyedMutexWin32EXT; +GLEW_FUN_EXPORT PFNGLRELEASEKEYEDMUTEXWIN32EXTPROC __glewReleaseKeyedMutexWin32EXT; + +GLEW_FUN_EXPORT PFNGLWINDOWRECTANGLESEXTPROC __glewWindowRectanglesEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT; + GLEW_FUN_EXPORT PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY; GLEW_FUN_EXPORT PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY; @@ -11447,19 +21913,54 @@ GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointe GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM; GLEW_FUN_EXPORT PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM; +GLEW_FUN_EXPORT PFNGLMAPTEXTURE2DINTELPROC __glewMapTexture2DINTEL; +GLEW_FUN_EXPORT PFNGLSYNCTEXTUREINTELPROC __glewSyncTextureINTEL; +GLEW_FUN_EXPORT PFNGLUNMAPTEXTURE2DINTELPROC __glewUnmapTexture2DINTEL; + GLEW_FUN_EXPORT PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL; GLEW_FUN_EXPORT PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL; GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL; GLEW_FUN_EXPORT PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL; +GLEW_FUN_EXPORT PFNGLBEGINPERFQUERYINTELPROC __glewBeginPerfQueryINTEL; +GLEW_FUN_EXPORT PFNGLCREATEPERFQUERYINTELPROC __glewCreatePerfQueryINTEL; +GLEW_FUN_EXPORT PFNGLDELETEPERFQUERYINTELPROC __glewDeletePerfQueryINTEL; +GLEW_FUN_EXPORT PFNGLENDPERFQUERYINTELPROC __glewEndPerfQueryINTEL; +GLEW_FUN_EXPORT PFNGLGETFIRSTPERFQUERYIDINTELPROC __glewGetFirstPerfQueryIdINTEL; +GLEW_FUN_EXPORT PFNGLGETNEXTPERFQUERYIDINTELPROC __glewGetNextPerfQueryIdINTEL; +GLEW_FUN_EXPORT PFNGLGETPERFCOUNTERINFOINTELPROC __glewGetPerfCounterInfoINTEL; +GLEW_FUN_EXPORT PFNGLGETPERFQUERYDATAINTELPROC __glewGetPerfQueryDataINTEL; +GLEW_FUN_EXPORT PFNGLGETPERFQUERYIDBYNAMEINTELPROC __glewGetPerfQueryIdByNameINTEL; +GLEW_FUN_EXPORT PFNGLGETPERFQUERYINFOINTELPROC __glewGetPerfQueryInfoINTEL; + GLEW_FUN_EXPORT PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL; GLEW_FUN_EXPORT PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL; -GLEW_FUN_EXPORT PFNGLBUFFERREGIONENABLEDEXTPROC __glewBufferRegionEnabledEXT; -GLEW_FUN_EXPORT PFNGLDELETEBUFFERREGIONEXTPROC __glewDeleteBufferRegionEXT; -GLEW_FUN_EXPORT PFNGLDRAWBUFFERREGIONEXTPROC __glewDrawBufferRegionEXT; -GLEW_FUN_EXPORT PFNGLNEWBUFFERREGIONEXTPROC __glewNewBufferRegionEXT; -GLEW_FUN_EXPORT PFNGLREADBUFFERREGIONEXTPROC __glewReadBufferRegionEXT; +GLEW_FUN_EXPORT PFNGLBLENDBARRIERKHRPROC __glewBlendBarrierKHR; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKPROC __glewDebugMessageCallback; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLPROC __glewDebugMessageControl; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog; +GLEW_FUN_EXPORT PFNGLGETOBJECTLABELPROC __glewGetObjectLabel; +GLEW_FUN_EXPORT PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel; +GLEW_FUN_EXPORT PFNGLOBJECTLABELPROC __glewObjectLabel; +GLEW_FUN_EXPORT PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel; +GLEW_FUN_EXPORT PFNGLPOPDEBUGGROUPPROC __glewPopDebugGroup; +GLEW_FUN_EXPORT PFNGLPUSHDEBUGGROUPPROC __glewPushDebugGroup; + +GLEW_FUN_EXPORT PFNGLMAXSHADERCOMPILERTHREADSKHRPROC __glewMaxShaderCompilerThreadsKHR; + +GLEW_FUN_EXPORT PFNGLGETNUNIFORMFVPROC __glewGetnUniformfv; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMIVPROC __glewGetnUniformiv; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMUIVPROC __glewGetnUniformuiv; +GLEW_FUN_EXPORT PFNGLREADNPIXELSPROC __glewReadnPixels; + +GLEW_FUN_EXPORT PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion; +GLEW_FUN_EXPORT PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion; +GLEW_FUN_EXPORT PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion; +GLEW_FUN_EXPORT PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion; GLEW_FUN_EXPORT PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA; @@ -11488,13 +21989,89 @@ GLEW_FUN_EXPORT PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA; +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVXPROC __glewBeginConditionalRenderNVX; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVXPROC __glewEndConditionalRenderNVX; + +GLEW_FUN_EXPORT PFNGLLGPUCOPYIMAGESUBDATANVXPROC __glewLGPUCopyImageSubDataNVX; +GLEW_FUN_EXPORT PFNGLLGPUINTERLOCKNVXPROC __glewLGPUInterlockNVX; +GLEW_FUN_EXPORT PFNGLLGPUNAMEDBUFFERSUBDATANVXPROC __glewLGPUNamedBufferSubDataNVX; + +GLEW_FUN_EXPORT PFNGLSTEREOPARAMETERFNVPROC __glewStereoParameterfNV; +GLEW_FUN_EXPORT PFNGLSTEREOPARAMETERINVPROC __glewStereoParameteriNV; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC __glewMultiDrawArraysIndirectBindlessNV; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC __glewMultiDrawElementsIndirectBindlessNV; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC __glewMultiDrawArraysIndirectBindlessCountNV; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC __glewMultiDrawElementsIndirectBindlessCountNV; + +GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLENVPROC __glewGetImageHandleNV; +GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLENVPROC __glewGetTextureHandleNV; +GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLENVPROC __glewGetTextureSamplerHandleNV; +GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTNVPROC __glewIsImageHandleResidentNV; +GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTNVPROC __glewIsTextureHandleResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC __glewMakeImageHandleNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTNVPROC __glewMakeImageHandleResidentNV; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC __glewMakeTextureHandleNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTNVPROC __glewMakeTextureHandleResidentNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC __glewProgramUniformHandleui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC __glewProgramUniformHandleui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64NVPROC __glewUniformHandleui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VNVPROC __glewUniformHandleui64vNV; + +GLEW_FUN_EXPORT PFNGLBLENDBARRIERNVPROC __glewBlendBarrierNV; +GLEW_FUN_EXPORT PFNGLBLENDPARAMETERINVPROC __glewBlendParameteriNV; + +GLEW_FUN_EXPORT PFNGLVIEWPORTPOSITIONWSCALENVPROC __glewViewportPositionWScaleNV; + +GLEW_FUN_EXPORT PFNGLCALLCOMMANDLISTNVPROC __glewCallCommandListNV; +GLEW_FUN_EXPORT PFNGLCOMMANDLISTSEGMENTSNVPROC __glewCommandListSegmentsNV; +GLEW_FUN_EXPORT PFNGLCOMPILECOMMANDLISTNVPROC __glewCompileCommandListNV; +GLEW_FUN_EXPORT PFNGLCREATECOMMANDLISTSNVPROC __glewCreateCommandListsNV; +GLEW_FUN_EXPORT PFNGLCREATESTATESNVPROC __glewCreateStatesNV; +GLEW_FUN_EXPORT PFNGLDELETECOMMANDLISTSNVPROC __glewDeleteCommandListsNV; +GLEW_FUN_EXPORT PFNGLDELETESTATESNVPROC __glewDeleteStatesNV; +GLEW_FUN_EXPORT PFNGLDRAWCOMMANDSADDRESSNVPROC __glewDrawCommandsAddressNV; +GLEW_FUN_EXPORT PFNGLDRAWCOMMANDSNVPROC __glewDrawCommandsNV; +GLEW_FUN_EXPORT PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC __glewDrawCommandsStatesAddressNV; +GLEW_FUN_EXPORT PFNGLDRAWCOMMANDSSTATESNVPROC __glewDrawCommandsStatesNV; +GLEW_FUN_EXPORT PFNGLGETCOMMANDHEADERNVPROC __glewGetCommandHeaderNV; +GLEW_FUN_EXPORT PFNGLGETSTAGEINDEXNVPROC __glewGetStageIndexNV; +GLEW_FUN_EXPORT PFNGLISCOMMANDLISTNVPROC __glewIsCommandListNV; +GLEW_FUN_EXPORT PFNGLISSTATENVPROC __glewIsStateNV; +GLEW_FUN_EXPORT PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC __glewListDrawCommandsStatesClientNV; +GLEW_FUN_EXPORT PFNGLSTATECAPTURENVPROC __glewStateCaptureNV; + GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV; GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV; +GLEW_FUN_EXPORT PFNGLSUBPIXELPRECISIONBIASNVPROC __glewSubpixelPrecisionBiasNV; + +GLEW_FUN_EXPORT PFNGLCONSERVATIVERASTERPARAMETERFNVPROC __glewConservativeRasterParameterfNV; + +GLEW_FUN_EXPORT PFNGLCONSERVATIVERASTERPARAMETERINVPROC __glewConservativeRasterParameteriNV; + +GLEW_FUN_EXPORT PFNGLCOPYBUFFERSUBDATANVPROC __glewCopyBufferSubDataNV; + +GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV; + GLEW_FUN_EXPORT PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV; GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV; GLEW_FUN_EXPORT PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV; +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSNVPROC __glewDrawBuffersNV; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDNVPROC __glewDrawArraysInstancedNV; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDNVPROC __glewDrawElementsInstancedNV; + +GLEW_FUN_EXPORT PFNGLDRAWTEXTURENVPROC __glewDrawTextureNV; + +GLEW_FUN_EXPORT PFNGLDRAWVKIMAGENVPROC __glewDrawVkImageNV; +GLEW_FUN_EXPORT PFNGLGETVKPROCADDRNVPROC __glewGetVkProcAddrNV; +GLEW_FUN_EXPORT PFNGLSIGNALVKFENCENVPROC __glewSignalVkFenceNV; +GLEW_FUN_EXPORT PFNGLSIGNALVKSEMAPHORENVPROC __glewSignalVkSemaphoreNV; +GLEW_FUN_EXPORT PFNGLWAITVKSEMAPHORENVPROC __glewWaitVkSemaphoreNV; + GLEW_FUN_EXPORT PFNGLEVALMAPSNVPROC __glewEvalMapsNV; GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV; GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV; @@ -11517,6 +22094,8 @@ GLEW_FUN_EXPORT PFNGLISFENCENVPROC __glewIsFenceNV; GLEW_FUN_EXPORT PFNGLSETFENCENVPROC __glewSetFenceNV; GLEW_FUN_EXPORT PFNGLTESTFENCENVPROC __glewTestFenceNV; +GLEW_FUN_EXPORT PFNGLFRAGMENTCOVERAGECOLORNVPROC __glewFragmentCoverageColorNV; + GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV; GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV; GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV; @@ -11524,10 +22103,27 @@ GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4 GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV; GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV; +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERNVPROC __glewBlitFramebufferNV; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC __glewRenderbufferStorageMultisampleNV; + GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV; GLEW_FUN_EXPORT PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV; +GLEW_FUN_EXPORT PFNGLMULTICASTBARRIERNVPROC __glewMulticastBarrierNV; +GLEW_FUN_EXPORT PFNGLMULTICASTBLITFRAMEBUFFERNVPROC __glewMulticastBlitFramebufferNV; +GLEW_FUN_EXPORT PFNGLMULTICASTBUFFERSUBDATANVPROC __glewMulticastBufferSubDataNV; +GLEW_FUN_EXPORT PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC __glewMulticastCopyBufferSubDataNV; +GLEW_FUN_EXPORT PFNGLMULTICASTCOPYIMAGESUBDATANVPROC __glewMulticastCopyImageSubDataNV; +GLEW_FUN_EXPORT PFNGLMULTICASTFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewMulticastFramebufferSampleLocationsfvNV; +GLEW_FUN_EXPORT PFNGLMULTICASTGETQUERYOBJECTI64VNVPROC __glewMulticastGetQueryObjecti64vNV; +GLEW_FUN_EXPORT PFNGLMULTICASTGETQUERYOBJECTIVNVPROC __glewMulticastGetQueryObjectivNV; +GLEW_FUN_EXPORT PFNGLMULTICASTGETQUERYOBJECTUI64VNVPROC __glewMulticastGetQueryObjectui64vNV; +GLEW_FUN_EXPORT PFNGLMULTICASTGETQUERYOBJECTUIVNVPROC __glewMulticastGetQueryObjectuivNV; +GLEW_FUN_EXPORT PFNGLMULTICASTWAITSYNCNVPROC __glewMulticastWaitSyncNV; +GLEW_FUN_EXPORT PFNGLRENDERGPUMASKNVPROC __glewRenderGpuMaskNV; + GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV; GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV; GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV; @@ -11541,6 +22137,41 @@ GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParamete GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV; GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV; +GLEW_FUN_EXPORT PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV; + GLEW_FUN_EXPORT PFNGLCOLOR3HNVPROC __glewColor3hNV; GLEW_FUN_EXPORT PFNGLCOLOR3HVNVPROC __glewColor3hvNV; GLEW_FUN_EXPORT PFNGLCOLOR4HNVPROC __glewColor4hNV; @@ -11588,6 +22219,17 @@ GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV; GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV; GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORNVPROC __glewVertexAttribDivisorNV; + +GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATSAMPLEIVNVPROC __glewGetInternalformatSampleivNV; + +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3FVNVPROC __glewUniformMatrix2x3fvNV; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4FVNVPROC __glewUniformMatrix2x4fvNV; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2FVNVPROC __glewUniformMatrix3x2fvNV; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4FVNVPROC __glewUniformMatrix3x4fvNV; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2FVNVPROC __glewUniformMatrix4x2fvNV; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3FVNVPROC __glewUniformMatrix4x3fvNV; + GLEW_FUN_EXPORT PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV; GLEW_FUN_EXPORT PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV; GLEW_FUN_EXPORT PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV; @@ -11600,19 +22242,85 @@ GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParamet GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV; GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV; +GLEW_FUN_EXPORT PFNGLCOPYPATHNVPROC __glewCopyPathNV; +GLEW_FUN_EXPORT PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV; +GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV; +GLEW_FUN_EXPORT PFNGLDELETEPATHSNVPROC __glewDeletePathsNV; +GLEW_FUN_EXPORT PFNGLGENPATHSNVPROC __glewGenPathsNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV; +GLEW_FUN_EXPORT PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV; +GLEW_FUN_EXPORT PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV; +GLEW_FUN_EXPORT PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV; +GLEW_FUN_EXPORT PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV; +GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV; +GLEW_FUN_EXPORT PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV; +GLEW_FUN_EXPORT PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEFVNVPROC __glewGetProgramResourcefvNV; +GLEW_FUN_EXPORT PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV; +GLEW_FUN_EXPORT PFNGLISPATHNVPROC __glewIsPathNV; +GLEW_FUN_EXPORT PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV; +GLEW_FUN_EXPORT PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV; +GLEW_FUN_EXPORT PFNGLMATRIXLOAD3X2FNVPROC __glewMatrixLoad3x2fNV; +GLEW_FUN_EXPORT PFNGLMATRIXLOAD3X3FNVPROC __glewMatrixLoad3x3fNV; +GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC __glewMatrixLoadTranspose3x3fNV; +GLEW_FUN_EXPORT PFNGLMATRIXMULT3X2FNVPROC __glewMatrixMult3x2fNV; +GLEW_FUN_EXPORT PFNGLMATRIXMULT3X3FNVPROC __glewMatrixMult3x3fNV; +GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC __glewMatrixMultTranspose3x3fNV; +GLEW_FUN_EXPORT PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV; +GLEW_FUN_EXPORT PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV; +GLEW_FUN_EXPORT PFNGLPATHCOORDSNVPROC __glewPathCoordsNV; +GLEW_FUN_EXPORT PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV; +GLEW_FUN_EXPORT PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV; +GLEW_FUN_EXPORT PFNGLPATHFOGGENNVPROC __glewPathFogGenNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHINDEXARRAYNVPROC __glewPathGlyphIndexArrayNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHINDEXRANGENVPROC __glewPathGlyphIndexRangeNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV; +GLEW_FUN_EXPORT PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC __glewPathMemoryGlyphIndexArrayNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV; +GLEW_FUN_EXPORT PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV; +GLEW_FUN_EXPORT PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV; +GLEW_FUN_EXPORT PFNGLPATHSTRINGNVPROC __glewPathStringNV; +GLEW_FUN_EXPORT PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV; +GLEW_FUN_EXPORT PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV; +GLEW_FUN_EXPORT PFNGLPATHTEXGENNVPROC __glewPathTexGenNV; +GLEW_FUN_EXPORT PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC __glewProgramPathFragmentInputGenNV; +GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV; +GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV; +GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC __glewStencilThenCoverFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERFILLPATHNVPROC __glewStencilThenCoverFillPathNV; +GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC __glewStencilThenCoverStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC __glewStencilThenCoverStrokePathNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV; +GLEW_FUN_EXPORT PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV; + GLEW_FUN_EXPORT PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV; GLEW_FUN_EXPORT PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV; +GLEW_FUN_EXPORT PFNGLPOLYGONMODENVPROC __glewPolygonModeNV; + GLEW_FUN_EXPORT PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV; GLEW_FUN_EXPORT PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV; GLEW_FUN_EXPORT PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV; GLEW_FUN_EXPORT PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV; GLEW_FUN_EXPORT PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV; GLEW_FUN_EXPORT PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV; -GLEW_FUN_EXPORT PFNGLVIDEOPARAMETERIVNVPROC __glewVideoParameterivNV; GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV; GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV; @@ -11634,6 +22342,39 @@ GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombin GLEW_FUN_EXPORT PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV; GLEW_FUN_EXPORT PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewFramebufferSampleLocationsfvNV; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewNamedFramebufferSampleLocationsfvNV; + +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV; +GLEW_FUN_EXPORT PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV; +GLEW_FUN_EXPORT PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV; +GLEW_FUN_EXPORT PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV; +GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORMUI64NVPROC __glewUniformui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV; + +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DNVPROC __glewCompressedTexImage3DNV; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DNVPROC __glewCompressedTexSubImage3DNV; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DNVPROC __glewCopyTexSubImage3DNV; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERNVPROC __glewFramebufferTextureLayerNV; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DNVPROC __glewTexImage3DNV; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DNVPROC __glewTexSubImage3DNV; + +GLEW_FUN_EXPORT PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV; + GLEW_FUN_EXPORT PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV; GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV; GLEW_FUN_EXPORT PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV; @@ -11646,9 +22387,61 @@ GLEW_FUN_EXPORT PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV; GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV; GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV; +GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV; +GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV; + +GLEW_FUN_EXPORT PFNGLVDPAUFININVPROC __glewVDPAUFiniNV; +GLEW_FUN_EXPORT PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV; +GLEW_FUN_EXPORT PFNGLVDPAUINITNVPROC __glewVDPAUInitNV; +GLEW_FUN_EXPORT PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV; +GLEW_FUN_EXPORT PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV; +GLEW_FUN_EXPORT PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV; +GLEW_FUN_EXPORT PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV; + GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV; GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV; + +GLEW_FUN_EXPORT PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV; +GLEW_FUN_EXPORT PFNGLCOLORFORMATNVPROC __glewColorFormatNV; +GLEW_FUN_EXPORT PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV; +GLEW_FUN_EXPORT PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV; +GLEW_FUN_EXPORT PFNGLINDEXFORMATNVPROC __glewIndexFormatNV; +GLEW_FUN_EXPORT PFNGLNORMALFORMATNVPROC __glewNormalFormatNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV; +GLEW_FUN_EXPORT PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV; + GLEW_FUN_EXPORT PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV; GLEW_FUN_EXPORT PFNGLBINDPROGRAMNVPROC __glewBindProgramNV; GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV; @@ -11714,12 +22507,121 @@ GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV; -GLEW_FUN_EXPORT PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES; -GLEW_FUN_EXPORT PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES; -GLEW_FUN_EXPORT PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES; -GLEW_FUN_EXPORT PFNGLFRUSTUMFOESPROC __glewFrustumfOES; -GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES; -GLEW_FUN_EXPORT PFNGLORTHOFOESPROC __glewOrthofOES; +GLEW_FUN_EXPORT PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV; +GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV; +GLEW_FUN_EXPORT PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV; + +GLEW_FUN_EXPORT PFNGLDEPTHRANGEARRAYFVNVPROC __glewDepthRangeArrayfvNV; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEINDEXEDFNVPROC __glewDepthRangeIndexedfNV; +GLEW_FUN_EXPORT PFNGLDISABLEINVPROC __glewDisableiNV; +GLEW_FUN_EXPORT PFNGLENABLEINVPROC __glewEnableiNV; +GLEW_FUN_EXPORT PFNGLGETFLOATI_VNVPROC __glewGetFloati_vNV; +GLEW_FUN_EXPORT PFNGLISENABLEDINVPROC __glewIsEnablediNV; +GLEW_FUN_EXPORT PFNGLSCISSORARRAYVNVPROC __glewScissorArrayvNV; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDNVPROC __glewScissorIndexedNV; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDVNVPROC __glewScissorIndexedvNV; +GLEW_FUN_EXPORT PFNGLVIEWPORTARRAYVNVPROC __glewViewportArrayvNV; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFNVPROC __glewViewportIndexedfNV; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFVNVPROC __glewViewportIndexedfvNV; + +GLEW_FUN_EXPORT PFNGLVIEWPORTSWIZZLENVPROC __glewViewportSwizzleNV; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC __glewFramebufferTextureMultiviewOVR; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVRPROC __glewFramebufferTextureMultisampleMultiviewOVR; + +GLEW_FUN_EXPORT PFNGLALPHAFUNCQCOMPROC __glewAlphaFuncQCOM; + +GLEW_FUN_EXPORT PFNGLDISABLEDRIVERCONTROLQCOMPROC __glewDisableDriverControlQCOM; +GLEW_FUN_EXPORT PFNGLENABLEDRIVERCONTROLQCOMPROC __glewEnableDriverControlQCOM; +GLEW_FUN_EXPORT PFNGLGETDRIVERCONTROLSTRINGQCOMPROC __glewGetDriverControlStringQCOM; +GLEW_FUN_EXPORT PFNGLGETDRIVERCONTROLSQCOMPROC __glewGetDriverControlsQCOM; + +GLEW_FUN_EXPORT PFNGLEXTGETBUFFERPOINTERVQCOMPROC __glewExtGetBufferPointervQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETBUFFERSQCOMPROC __glewExtGetBuffersQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETFRAMEBUFFERSQCOMPROC __glewExtGetFramebuffersQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETRENDERBUFFERSQCOMPROC __glewExtGetRenderbuffersQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC __glewExtGetTexLevelParameterivQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETTEXSUBIMAGEQCOMPROC __glewExtGetTexSubImageQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETTEXTURESQCOMPROC __glewExtGetTexturesQCOM; +GLEW_FUN_EXPORT PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC __glewExtTexObjectStateOverrideiQCOM; + +GLEW_FUN_EXPORT PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC __glewExtGetProgramBinarySourceQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETPROGRAMSQCOMPROC __glewExtGetProgramsQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETSHADERSQCOMPROC __glewExtGetShadersQCOM; +GLEW_FUN_EXPORT PFNGLEXTISPROGRAMBINARYQCOMPROC __glewExtIsProgramBinaryQCOM; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERFOVEATIONCONFIGQCOMPROC __glewFramebufferFoveationConfigQCOM; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERFOVEATIONPARAMETERSQCOMPROC __glewFramebufferFoveationParametersQCOM; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERFETCHBARRIERQCOMPROC __glewFramebufferFetchBarrierQCOM; + +GLEW_FUN_EXPORT PFNGLENDTILINGQCOMPROC __glewEndTilingQCOM; +GLEW_FUN_EXPORT PFNGLSTARTTILINGQCOMPROC __glewStartTilingQCOM; + +GLEW_FUN_EXPORT PFNGLALPHAFUNCXPROC __glewAlphaFuncx; +GLEW_FUN_EXPORT PFNGLCLEARCOLORXPROC __glewClearColorx; +GLEW_FUN_EXPORT PFNGLCLEARDEPTHXPROC __glewClearDepthx; +GLEW_FUN_EXPORT PFNGLCOLOR4XPROC __glewColor4x; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEXPROC __glewDepthRangex; +GLEW_FUN_EXPORT PFNGLFOGXPROC __glewFogx; +GLEW_FUN_EXPORT PFNGLFOGXVPROC __glewFogxv; +GLEW_FUN_EXPORT PFNGLFRUSTUMFPROC __glewFrustumf; +GLEW_FUN_EXPORT PFNGLFRUSTUMXPROC __glewFrustumx; +GLEW_FUN_EXPORT PFNGLLIGHTMODELXPROC __glewLightModelx; +GLEW_FUN_EXPORT PFNGLLIGHTMODELXVPROC __glewLightModelxv; +GLEW_FUN_EXPORT PFNGLLIGHTXPROC __glewLightx; +GLEW_FUN_EXPORT PFNGLLIGHTXVPROC __glewLightxv; +GLEW_FUN_EXPORT PFNGLLINEWIDTHXPROC __glewLineWidthx; +GLEW_FUN_EXPORT PFNGLLOADMATRIXXPROC __glewLoadMatrixx; +GLEW_FUN_EXPORT PFNGLMATERIALXPROC __glewMaterialx; +GLEW_FUN_EXPORT PFNGLMATERIALXVPROC __glewMaterialxv; +GLEW_FUN_EXPORT PFNGLMULTMATRIXXPROC __glewMultMatrixx; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4XPROC __glewMultiTexCoord4x; +GLEW_FUN_EXPORT PFNGLNORMAL3XPROC __glewNormal3x; +GLEW_FUN_EXPORT PFNGLORTHOFPROC __glewOrthof; +GLEW_FUN_EXPORT PFNGLORTHOXPROC __glewOrthox; +GLEW_FUN_EXPORT PFNGLPOINTSIZEXPROC __glewPointSizex; +GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETXPROC __glewPolygonOffsetx; +GLEW_FUN_EXPORT PFNGLROTATEXPROC __glewRotatex; +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEXPROC __glewSampleCoveragex; +GLEW_FUN_EXPORT PFNGLSCALEXPROC __glewScalex; +GLEW_FUN_EXPORT PFNGLTEXENVXPROC __glewTexEnvx; +GLEW_FUN_EXPORT PFNGLTEXENVXVPROC __glewTexEnvxv; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERXPROC __glewTexParameterx; +GLEW_FUN_EXPORT PFNGLTRANSLATEXPROC __glewTranslatex; + +GLEW_FUN_EXPORT PFNGLCLIPPLANEFPROC __glewClipPlanef; +GLEW_FUN_EXPORT PFNGLCLIPPLANEXPROC __glewClipPlanex; +GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFPROC __glewGetClipPlanef; +GLEW_FUN_EXPORT PFNGLGETCLIPPLANEXPROC __glewGetClipPlanex; +GLEW_FUN_EXPORT PFNGLGETFIXEDVPROC __glewGetFixedv; +GLEW_FUN_EXPORT PFNGLGETLIGHTXVPROC __glewGetLightxv; +GLEW_FUN_EXPORT PFNGLGETMATERIALXVPROC __glewGetMaterialxv; +GLEW_FUN_EXPORT PFNGLGETTEXENVXVPROC __glewGetTexEnvxv; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERXVPROC __glewGetTexParameterxv; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERXPROC __glewPointParameterx; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERXVPROC __glewPointParameterxv; +GLEW_FUN_EXPORT PFNGLPOINTSIZEPOINTEROESPROC __glewPointSizePointerOES; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERXVPROC __glewTexParameterxv; + +GLEW_FUN_EXPORT PFNGLERRORSTRINGREGALPROC __glewErrorStringREGAL; + +GLEW_FUN_EXPORT PFNGLGETEXTENSIONREGALPROC __glewGetExtensionREGAL; +GLEW_FUN_EXPORT PFNGLISSUPPORTEDREGALPROC __glewIsSupportedREGAL; + +GLEW_FUN_EXPORT PFNGLLOGMESSAGECALLBACKREGALPROC __glewLogMessageCallbackREGAL; + +GLEW_FUN_EXPORT PFNGLGETPROCADDRESSREGALPROC __glewGetProcAddressREGAL; GLEW_FUN_EXPORT PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS; GLEW_FUN_EXPORT PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS; @@ -11730,6 +22632,13 @@ GLEW_FUN_EXPORT PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS; GLEW_FUN_EXPORT PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS; GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS; +GLEW_FUN_EXPORT PFNGLINTERLEAVEDTEXTURECOORDSETSSGISPROC __glewInterleavedTextureCoordSetsSGIS; +GLEW_FUN_EXPORT PFNGLSELECTTEXTURECOORDSETSGISPROC __glewSelectTextureCoordSetSGIS; +GLEW_FUN_EXPORT PFNGLSELECTTEXTURESGISPROC __glewSelectTextureSGIS; +GLEW_FUN_EXPORT PFNGLSELECTTEXTURETRANSFORMSGISPROC __glewSelectTextureTransformSGIS; + +GLEW_FUN_EXPORT PFNGLMULTISAMPLESUBRECTPOSSGISPROC __glewMultisampleSubRectPosSGIS; + GLEW_FUN_EXPORT PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS; GLEW_FUN_EXPORT PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS; @@ -11746,8 +22655,14 @@ GLEW_FUN_EXPORT PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX; GLEW_FUN_EXPORT PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX; GLEW_FUN_EXPORT PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX; +GLEW_FUN_EXPORT PFNGLADDRESSSPACEPROC __glewAddressSpace; +GLEW_FUN_EXPORT PFNGLDATAPIPEPROC __glewDataPipe; + GLEW_FUN_EXPORT PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX; +GLEW_FUN_EXPORT PFNGLFOGLAYERSSGIXPROC __glewFogLayersSGIX; +GLEW_FUN_EXPORT PFNGLGETFOGLAYERSSGIXPROC __glewGetFogLayersSGIX; + GLEW_FUN_EXPORT PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX; @@ -11770,8 +22685,33 @@ GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSG GLEW_FUN_EXPORT PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX; +GLEW_FUN_EXPORT PFNGLIGLOOINTERFACESGIXPROC __glewIglooInterfaceSGIX; + +GLEW_FUN_EXPORT PFNGLALLOCMPEGPREDICTORSSGIXPROC __glewAllocMPEGPredictorsSGIX; +GLEW_FUN_EXPORT PFNGLDELETEMPEGPREDICTORSSGIXPROC __glewDeleteMPEGPredictorsSGIX; +GLEW_FUN_EXPORT PFNGLGENMPEGPREDICTORSSGIXPROC __glewGenMPEGPredictorsSGIX; +GLEW_FUN_EXPORT PFNGLGETMPEGPARAMETERFVSGIXPROC __glewGetMPEGParameterfvSGIX; +GLEW_FUN_EXPORT PFNGLGETMPEGPARAMETERIVSGIXPROC __glewGetMPEGParameterivSGIX; +GLEW_FUN_EXPORT PFNGLGETMPEGPREDICTORSGIXPROC __glewGetMPEGPredictorSGIX; +GLEW_FUN_EXPORT PFNGLGETMPEGQUANTTABLEUBVPROC __glewGetMPEGQuantTableubv; +GLEW_FUN_EXPORT PFNGLISMPEGPREDICTORSGIXPROC __glewIsMPEGPredictorSGIX; +GLEW_FUN_EXPORT PFNGLMPEGPREDICTORSGIXPROC __glewMPEGPredictorSGIX; +GLEW_FUN_EXPORT PFNGLMPEGQUANTTABLEUBVPROC __glewMPEGQuantTableubv; +GLEW_FUN_EXPORT PFNGLSWAPMPEGPREDICTORSSGIXPROC __glewSwapMPEGPredictorsSGIX; + +GLEW_FUN_EXPORT PFNGLGETNONLINLIGHTFVSGIXPROC __glewGetNonlinLightfvSGIX; +GLEW_FUN_EXPORT PFNGLGETNONLINMATERIALFVSGIXPROC __glewGetNonlinMaterialfvSGIX; +GLEW_FUN_EXPORT PFNGLNONLINLIGHTFVSGIXPROC __glewNonlinLightfvSGIX; +GLEW_FUN_EXPORT PFNGLNONLINMATERIALFVSGIXPROC __glewNonlinMaterialfvSGIX; + GLEW_FUN_EXPORT PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX; +GLEW_FUN_EXPORT PFNGLDEFORMSGIXPROC __glewDeformSGIX; +GLEW_FUN_EXPORT PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC __glewLoadIdentityDeformationMapSGIX; + +GLEW_FUN_EXPORT PFNGLMESHBREADTHSGIXPROC __glewMeshBreadthSGIX; +GLEW_FUN_EXPORT PFNGLMESHSTRIDESGIXPROC __glewMeshStrideSGIX; + GLEW_FUN_EXPORT PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX; GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX; @@ -11781,6 +22721,16 @@ GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX; GLEW_FUN_EXPORT PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX; +GLEW_FUN_EXPORT PFNGLGETVECTOROPERATIONSGIXPROC __glewGetVectorOperationSGIX; +GLEW_FUN_EXPORT PFNGLVECTOROPERATIONSGIXPROC __glewVectorOperationSGIX; + +GLEW_FUN_EXPORT PFNGLAREVERTEXARRAYSRESIDENTSGIXPROC __glewAreVertexArraysResidentSGIX; +GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYSGIXPROC __glewBindVertexArraySGIX; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSSGIXPROC __glewDeleteVertexArraysSGIX; +GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSSGIXPROC __glewGenVertexArraysSGIX; +GLEW_FUN_EXPORT PFNGLISVERTEXARRAYSGIXPROC __glewIsVertexArraySGIX; +GLEW_FUN_EXPORT PFNGLPRIORITIZEVERTEXARRAYSSGIXPROC __glewPrioritizeVertexArraysSGIX; + GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI; GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI; GLEW_FUN_EXPORT PFNGLCOLORTABLESGIPROC __glewColorTableSGI; @@ -11789,6 +22739,14 @@ GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParamete GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI; GLEW_FUN_EXPORT PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI; +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERFVSGIPROC __glewGetPixelTransformParameterfvSGI; +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERIVSGIPROC __glewGetPixelTransformParameterivSGI; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFSGIPROC __glewPixelTransformParameterfSGI; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFVSGIPROC __glewPixelTransformParameterfvSGI; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERISGIPROC __glewPixelTransformParameteriSGI; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIVSGIPROC __glewPixelTransformParameterivSGI; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMSGIPROC __glewPixelTransformSGI; + GLEW_FUN_EXPORT PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX; GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN; @@ -11852,83 +22810,281 @@ GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN; GLEW_FUN_EXPORT PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN; - -#if defined(GLEW_MX) && !defined(_WIN32) -struct GLEWContextStruct -{ -#endif /* GLEW_MX */ - GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_1; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2_1; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_3; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_4; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_5; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_0; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_1; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_4; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_5; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_6; GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_tbuffer; GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_texture_compression_FXT1; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_blend_minmax_factor; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_compressed_3DC_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_compressed_ATC_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_conservative_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_debug_output; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_depth_clamp_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_draw_buffers_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_framebuffer_sample_positions; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_gcn_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_gpu_shader_half_float; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_gpu_shader_int16; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_gpu_shader_int64; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_interleaved_elements; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_name_gen_delete; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_occlusion_query_event; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_performance_monitor; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_pinned_memory; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_program_binary_Z400; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_query_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sample_positions; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_seamless_cubemap_per_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_atomic_counter_ops; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_ballot; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_explicit_vertex_parameter; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_export; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_value_export; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_trinary_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sparse_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_stencil_operation_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_texture_gather_bias_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_texture_texture4; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_transform_feedback3_lines_triangles; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_transform_feedback4; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_layer; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_tessellator; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_viewport_index; +GLEW_VAR_EXPORT GLboolean __GLEW_ANDROID_extension_pack_es31a; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_framebuffer_blit; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_pack_reverse_row_order; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_program_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt1; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt3; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt5; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_usage; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_translated_shader_source; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_aux_depth_stencil; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_client_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_clip_distance; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_color_buffer_packed_float; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_copy_texture_levels; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_element_array; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_fence; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_float_pixels; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_flush_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_object_purgeable; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_pixel_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_rgb_422; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_row_bytes; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_specular_vector; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_sync; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_2D_limited_npot; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_format_BGRA8888; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_max_level; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_packed_float; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_range; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_transform_hint; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_object; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_program_evaluators; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_ycbcr_422; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES2_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_1_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_2_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_arrays_of_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_base_instance; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_bindless_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_blend_func_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_buffer_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_cl_event; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clip_control; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_color_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compressed_texture_pixel_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_variable_group_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_conditional_render_inverted; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_conservative_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_image; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_cull_distance; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_debug_output; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_derivative_control; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_direct_state_access; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_elements_base_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_indirect; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_enhanced_layouts; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_attrib_location; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_uniform_location; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_coord_conventions; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_layer_viewport; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program_shadow; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader_interlock; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_no_attachments; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_sRGB; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_get_program_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_get_texture_sub_image; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gl_spirv; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader5; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader_fp64; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader_int64; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_pixel; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_vertex; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_imaging; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_indirect_parameters; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_invalidate_subdata; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_alignment; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_range; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_matrix_palette; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_bind; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_draw_indirect; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multitexture; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_parallel_shader_compile; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pipeline_statistics_query; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pixel_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_parameters; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_polygon_offset_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_post_depth_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_program_interface_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_provoking_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_query_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robust_buffer_access_behavior; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_application_isolation; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_share_group_isolation; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_locations; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_shading; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sampler_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cubemap_per_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_separate_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counter_ops; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_ballot; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_bit_encoding; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_clock; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_draw_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_group_vote; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_load_store; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_size; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_precision; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_stencil_export; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_storage_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_subroutine; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_image_samples; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_viewport_layer_array; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_100; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_420pack; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_include; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_packing; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow_ambient; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_spirv_extensions; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_stencil_texturing; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sync; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_tessellation_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_barrier; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_border_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object_rgb32; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_range; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_bptc; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_rgtc; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map_array; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_add; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_combine; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_crossbar; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_dot3; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_filter_anisotropic; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_filter_minmax; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_gather; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirror_clamp_to_edge; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirrored_repeat; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_non_power_of_two; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_levels; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_lod; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rectangle; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rg; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rgb10_a2ui; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_stencil8; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_swizzle; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_view; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback3; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback_overflow_query; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transpose_matrix; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_uniform_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_bgra; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_binding; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_blend; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_program; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_10f_11f_11f_rev; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_viewport_array; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_window_pos; +GLEW_VAR_EXPORT GLboolean __GLEW_ARM_mali_program_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ARM_mali_shader_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ARM_rgba8; +GLEW_VAR_EXPORT GLboolean __GLEW_ARM_shader_framebuffer_fetch; +GLEW_VAR_EXPORT GLboolean __GLEW_ARM_shader_framebuffer_fetch_depth_stencil; GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_point_sprites; GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_combine3; GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_route; @@ -11938,6 +23094,7 @@ GLEW_VAR_EXPORT GLboolean __GLEW_ATI_element_array; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_envmap_bumpmap; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_fragment_shader; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_map_object_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_meminfo; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_pn_triangles; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_separate_stencil; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_shader_texture_lod; @@ -11949,48 +23106,86 @@ GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_mirror_once; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_array_object; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_attrib_array_object; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_streams; +GLEW_VAR_EXPORT GLboolean __GLEW_EGL_KHR_context_flush_control; +GLEW_VAR_EXPORT GLboolean __GLEW_EGL_NV_robustness_video_memory_purge; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_422_pixels; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_Cg_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_EGL_image_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_YUV_target; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_abgr; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_base_instance; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bgra; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bindable_uniform; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_color; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_equation_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_func_extended; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_func_separate; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_logic_op; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_minmax; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_subtract; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_buffer_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clear_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clip_cull_distance; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clip_volume_hint; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cmyka; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_buffer_half_float; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_subtable; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_compiled_vertex_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_compressed_ETC1_RGB8_sub_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_conservative_depth; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_convolution; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_coordinate_frame; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_copy_image; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_copy_texture; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cull_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_debug_label; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_debug_marker; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_depth_bounds_test; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_direct_state_access; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_discard_framebuffer; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers2; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers_indexed; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_elements_base_vertex; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_instanced; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_range_elements; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_external_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_float_blend; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fog_coord; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_frag_depth; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fragment_lighting; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_blit; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_point_size; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_shader; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_shader4; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_program_parameters; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_shader5; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_histogram; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_array_formats; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_func; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_material; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_instanced_arrays; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_light_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_map_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_memory_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_memory_object_fd; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_memory_object_win32; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_misc_attribute; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multi_draw_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multiple_textures; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisample_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisampled_render_to_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisampled_render_to_texture2; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multiview_draw_buffers; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_depth_stencil; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_float; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_pixels; @@ -12000,12 +23195,39 @@ GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform_color_table; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_point_parameters; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_polygon_offset; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_polygon_offset_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_post_depth_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_provoking_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pvrtc_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_raster_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_read_format_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_render_snorm; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_rescale_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_sRGB_write_control; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_scene_marker; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_secondary_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_semaphore; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_semaphore_fd; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_semaphore_win32; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_shader_objects; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_specular_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_framebuffer_fetch; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_group_vote; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_image_load_formatted; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_image_load_store; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_implicit_conversions; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_integer_mix; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_io_blocks; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_non_constant_global_initializers; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_pixel_local_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_pixel_local_storage2; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_texture_lod; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shadow_funcs; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shadow_samplers; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shared_texture_palette; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_sparse_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_sparse_texture2; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_clear_tag; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_two_side; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_wrap; @@ -12014,32 +23236,53 @@ GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture3D; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_array; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_astc_decode_mode; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_astc_decode_mode_rgb9e5; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_bptc; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_dxt1; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_latc; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_rgtc; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_s3tc; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_cube_map_array; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_edge_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_add; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_combine; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_dot3; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_anisotropic; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_format_BGRA8888; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_integer; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_lod_bias; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_mirror_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_norm16; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_object; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_perturb_normal; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_rg; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB_R8; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB_RG8; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB_decode; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_shared_exponent; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_snorm; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_storage; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_swizzle; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_type_2_10_10_10_REV; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_view; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_timer_query; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_transform_feedback; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_unpack_subimage; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array_setXXX; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_attrib_64bit; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_shader; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_weighting; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_win32_keyed_mutex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_window_rectangles; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_x11_sync_object; GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_frame_terminator; GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_string_marker; GLEW_VAR_EXPORT GLboolean __GLEW_HP_convolution_border_modes; @@ -12054,81 +23297,214 @@ GLEW_VAR_EXPORT GLboolean __GLEW_IBM_texture_mirrored_repeat; GLEW_VAR_EXPORT GLboolean __GLEW_IBM_vertex_array_lists; GLEW_VAR_EXPORT GLboolean __GLEW_INGR_color_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_INGR_interlace_read; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_conservative_rasterization; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_fragment_shader_ordering; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_framebuffer_CMAA; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_map_texture; GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_parallel_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_performance_query; GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_texture_scissor; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_blend_equation_advanced; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_blend_equation_advanced_coherent; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_context_flush_control; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_debug; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_no_error; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_parallel_shader_compile; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_robust_buffer_access_behavior; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_robustness; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_hdr; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_ldr; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_sliced_3d; GLEW_VAR_EXPORT GLboolean __GLEW_KTX_buffer_region; GLEW_VAR_EXPORT GLboolean __GLEW_MESAX_texture_stack; GLEW_VAR_EXPORT GLboolean __GLEW_MESA_pack_invert; GLEW_VAR_EXPORT GLboolean __GLEW_MESA_resize_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_shader_integer_functions; GLEW_VAR_EXPORT GLboolean __GLEW_MESA_window_pos; GLEW_VAR_EXPORT GLboolean __GLEW_MESA_ycbcr_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_blend_equation_advanced_multi_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_conditional_render; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_gpu_memory_info; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_linked_gpu_multicast; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_3dvision_settings; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_EGL_stream_consumer_external; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_alpha_to_coverage_dither_control; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bgr; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_multi_draw_indirect_count; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_equation_advanced; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_equation_advanced_coherent; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_minmax_factor; GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_square; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_clip_space_w_scaling; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_command_list; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_compute_program5; GLEW_VAR_EXPORT GLboolean __GLEW_NV_conditional_render; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_conservative_raster; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_conservative_raster_dilate; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_conservative_raster_pre_snap_triangles; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_buffer; GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_depth_to_color; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_image; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_deep_texture3D; GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_buffer_float; GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_range_unclamped; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_draw_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_draw_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_draw_vulkan_image; GLEW_VAR_EXPORT GLboolean __GLEW_NV_evaluators; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_explicit_attrib_location; GLEW_VAR_EXPORT GLboolean __GLEW_NV_explicit_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fbo_color_attachments; GLEW_VAR_EXPORT GLboolean __GLEW_NV_fence; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fill_rectangle; GLEW_VAR_EXPORT GLboolean __GLEW_NV_float_buffer; GLEW_VAR_EXPORT GLboolean __GLEW_NV_fog_distance; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_coverage_to_color; GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program; GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program2; GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program4; GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program_option; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_shader_interlock; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_blit; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_mixed_samples; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_multisample_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_generate_mipmap_sRGB; GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_program4; GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader_passthrough; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_multicast; GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5_mem_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program_fp64; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_shader5; GLEW_VAR_EXPORT GLboolean __GLEW_NV_half_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_image_formats; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_internalformat_sample_query; GLEW_VAR_EXPORT GLboolean __GLEW_NV_light_max_exponent; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_coverage; GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_filter_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_non_square_matrices; GLEW_VAR_EXPORT GLboolean __GLEW_NV_occlusion_query; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_pack_subimage; GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_float_linear; GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_path_rendering; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_path_rendering_shared_edge; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_pixel_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_NV_pixel_data_range; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_platform_binary; GLEW_VAR_EXPORT GLboolean __GLEW_NV_point_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_polygon_mode; GLEW_VAR_EXPORT GLboolean __GLEW_NV_present_video; GLEW_VAR_EXPORT GLboolean __GLEW_NV_primitive_restart; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_read_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_read_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_read_stencil; GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners; GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_robustness_video_memory_purge; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_sRGB_formats; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_sample_locations; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_sample_mask_override_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_counters; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_float64; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_fp16_vector; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_int64; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_buffer_load; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_noperspective_interpolation; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_storage_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_thread_group; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_thread_shuffle; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shadow_samplers_array; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shadow_samplers_cube; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_stereo_view_rendering; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_tessellation_program5; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_emboss; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_reflection; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_array; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_barrier; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_border_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_latc; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_s3tc_update; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_vtc; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_env_combine4; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_expand_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_npot_2D_mipmap; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_rectangle_compressed; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader2; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader3; GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_uniform_buffer_unified_memory; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vdpau_interop; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_attrib_integer_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_buffer_unified_memory; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program1_1; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2_option; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program3; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_video_capture; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_viewport_array; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_viewport_array2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_viewport_swizzle; GLEW_VAR_EXPORT GLboolean __GLEW_OES_byte_coordinates; -GLEW_VAR_EXPORT GLboolean __GLEW_OES_compressed_paletted_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_OES_read_format; -GLEW_VAR_EXPORT GLboolean __GLEW_OES_single_precision; GLEW_VAR_EXPORT GLboolean __GLEW_OML_interlace; GLEW_VAR_EXPORT GLboolean __GLEW_OML_resample; GLEW_VAR_EXPORT GLboolean __GLEW_OML_subsample; +GLEW_VAR_EXPORT GLboolean __GLEW_OVR_multiview; +GLEW_VAR_EXPORT GLboolean __GLEW_OVR_multiview2; +GLEW_VAR_EXPORT GLboolean __GLEW_OVR_multiview_multisampled_render_to_texture; GLEW_VAR_EXPORT GLboolean __GLEW_PGI_misc_hints; GLEW_VAR_EXPORT GLboolean __GLEW_PGI_vertex_hints; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_alpha_test; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_binning_control; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_driver_control; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_extended_get; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_extended_get2; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_framebuffer_foveated; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_perfmon_global_mode; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_shader_framebuffer_fetch_noncoherent; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_tiled_rendering; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_writeonly_rendering; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_ES1_0_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_ES1_1_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_enable; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_error_string; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_extension_query; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_log; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_proc_address; GLEW_VAR_EXPORT GLboolean __GLEW_REND_screen_coordinates; GLEW_VAR_EXPORT GLboolean __GLEW_S3_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_clip_band_hint; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_color_range; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_detail_texture; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_fog_function; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_generate_mipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_line_texgen; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_multitexture; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_pixel_texture; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_point_line_texgen; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_shared_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_sharpen_texture; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture4D; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_border_clamp; @@ -12139,37 +23515,90 @@ GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_select; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_histogram; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_pixel; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_bali_g_instruments; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_bali_r_instruments; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_bali_timer_instruments; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_alpha_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_cadd; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_cmultiply; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_calligraphic_fragment; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_clipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_color_matrix_accuracy; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_color_table_index_mode; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_complex_polar; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_convolution_accuracy; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_cylinder_texgen; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_datapipe; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_decimation; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_depth_pass_instrument; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_dvc; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_flush_raster; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_factor_to_alpha; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_layers; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_offset; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_patchy; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_scale; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragment_lighting_space; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragment_specular_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragments_instrument; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_framezoom; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_icc_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_igloo_interface; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_image_compression; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_impact_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_instrument_error; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_interlace; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ir_instrument1; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_line_quality_hint; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_list_priority; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_mpeg1; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_mpeg2; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_nonlinear_lighting_pervertex; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_nurbs_eval; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_occlusion_instrument; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_packed_6bytes; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture_bits; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_tiles; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_polynomial_ffd; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_quad_mesh; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_reference_plane; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_resample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_scalebias_hint; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow_ambient; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_slim; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_spotlight_cutoff; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_subdiv_patch; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_subsample; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_tag_sample_buffer; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_add_env; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_coordinate_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_lod_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_mipmap_anisotropic; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_multi_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_phase; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_range; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_scale_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_supersample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vector_ops; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_array_object; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip_hint; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ycrcb; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ycrcb_subsample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ycrcba; GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_matrix; GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_complex; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_complex_type; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_fft; GLEW_VAR_EXPORT GLboolean __GLEW_SGI_texture_color_table; GLEW_VAR_EXPORT GLboolean __GLEW_SUNX_constant_data; GLEW_VAR_EXPORT GLboolean __GLEW_SUN_convolution_border_modes; @@ -12180,21 +23609,18 @@ GLEW_VAR_EXPORT GLboolean __GLEW_SUN_slice_accum; GLEW_VAR_EXPORT GLboolean __GLEW_SUN_triangle_list; GLEW_VAR_EXPORT GLboolean __GLEW_SUN_vertex; GLEW_VAR_EXPORT GLboolean __GLEW_WIN_phong_shading; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_scene_markerXXX; GLEW_VAR_EXPORT GLboolean __GLEW_WIN_specular_fog; GLEW_VAR_EXPORT GLboolean __GLEW_WIN_swap_hint; - -#ifdef GLEW_MX -}; /* GLEWContextStruct */ -#endif /* GLEW_MX */ - /* ------------------------------------------------------------------------- */ /* error codes */ #define GLEW_OK 0 #define GLEW_NO_ERROR 0 #define GLEW_ERROR_NO_GL_VERSION 1 /* missing GL version */ -#define GLEW_ERROR_GL_VERSION_10_ONLY 2 /* GL 1.1 and up are not supported */ -#define GLEW_ERROR_GLX_VERSION_11_ONLY 3 /* GLX 1.2 and up are not supported */ +#define GLEW_ERROR_GL_VERSION_10_ONLY 2 /* Need at least OpenGL 1.1 */ +#define GLEW_ERROR_GLX_VERSION_11_ONLY 3 /* Need at least GLX 1.2 */ +#define GLEW_ERROR_NO_GLX_DISPLAY 4 /* Need GLX display for GLX support */ /* string codes */ #define GLEW_VERSION 1 @@ -12202,48 +23628,38 @@ GLEW_VAR_EXPORT GLboolean __GLEW_WIN_swap_hint; #define GLEW_VERSION_MINOR 3 #define GLEW_VERSION_MICRO 4 +/* ------------------------------------------------------------------------- */ + +/* GLEW version info */ + +/* +VERSION 2.1.0 +VERSION_MAJOR 2 +VERSION_MINOR 1 +VERSION_MICRO 0 +*/ + /* API */ -#ifdef GLEW_MX - -typedef struct GLEWContextStruct GLEWContext; -GLEWAPI GLenum glewContextInit (GLEWContext* ctx); -GLEWAPI GLboolean glewContextIsSupported (GLEWContext* ctx, const char* name); - -#define glewInit() glewContextInit(glewGetContext()) -#define glewIsSupported(x) glewContextIsSupported(glewGetContext(), x) +GLEWAPI GLenum GLEWAPIENTRY glewInit (void); +GLEWAPI GLboolean GLEWAPIENTRY glewIsSupported (const char *name); #define glewIsExtensionSupported(x) glewIsSupported(x) -#define GLEW_GET_VAR(x) (*(const GLboolean*)&(glewGetContext()->x)) -#ifdef _WIN32 -# define GLEW_GET_FUN(x) glewGetContext()->x -#else -# define GLEW_GET_FUN(x) x +#ifndef GLEW_GET_VAR +#define GLEW_GET_VAR(x) (*(const GLboolean*)&x) #endif -#else /* GLEW_MX */ - -GLEWAPI GLenum glewInit (); -GLEWAPI GLboolean glewIsSupported (const char* name); -#define glewIsExtensionSupported(x) glewIsSupported(x) - -#define GLEW_GET_VAR(x) (*(const GLboolean*)&x) +#ifndef GLEW_GET_FUN #define GLEW_GET_FUN(x) x - -#endif /* GLEW_MX */ +#endif GLEWAPI GLboolean glewExperimental; -GLEWAPI GLboolean glewGetExtension (const char* name); -GLEWAPI const GLubyte* glewGetErrorString (GLenum error); -GLEWAPI const GLubyte* glewGetString (GLenum name); - -#ifdef __cplusplus -} -#endif +GLEWAPI GLboolean GLEWAPIENTRY glewGetExtension (const char *name); +GLEWAPI const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error); +GLEWAPI const GLubyte * GLEWAPIENTRY glewGetString (GLenum name); #ifdef GLEW_APIENTRY_DEFINED #undef GLEW_APIENTRY_DEFINED #undef APIENTRY -#undef GLAPIENTRY #endif #ifdef GLEW_CALLBACK_DEFINED diff --git a/test_conformance/gl/GLEW/GL/glxew.h b/test_conformance/gl/GLEW/GL/glxew.h index 625ee0fb..160134b1 100644 --- a/test_conformance/gl/GLEW/GL/glxew.h +++ b/test_conformance/gl/GLEW/GL/glxew.h @@ -1,27 +1,28 @@ /* ** The OpenGL Extension Wrangler Library +** Copyright (C) 2008-2017, Nigel Stewart ** Copyright (C) 2002-2008, Milan Ikits ** Copyright (C) 2002-2008, Marcelo E. Magallon ** Copyright (C) 2002, Lev Povalahev ** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without +** +** 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, +** +** * 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 +** * 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. -** * The name of the author may be used to endorse or promote products +** * The name of the author 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 +** 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 +** 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) @@ -55,7 +56,7 @@ /* ** Copyright (c) 2007 The Khronos Group Inc. -** +** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the ** "Materials"), to deal in the Materials without restriction, including @@ -63,10 +64,10 @@ ** distribute, sublicense, and/or sell copies of the Materials, and to ** permit persons to whom the Materials are furnished to do so, subject to ** the following conditions: -** +** ** The above copyright notice and this permission notice shall be included ** in all copies or substantial portions of the Materials. -** +** ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -83,23 +84,22 @@ #ifdef __glxext_h_ #error glxext.h included before glxew.h #endif -#ifdef GLX_H + +#if defined(GLX_H) || defined(__GLX_glx_h__) || defined(__glx_h__) #error glx.h included before glxew.h #endif #define __glxext_h_ -#define __GLX_glx_h__ + #define GLX_H +#define __GLX_glx_h__ +#define __glx_h__ #include #include #include #include -#ifdef __cplusplus -extern "C" { -#endif - /* ---------------------------- GLX_VERSION_1_0 --------------------------- */ #ifndef GLX_VERSION_1_0 @@ -138,7 +138,7 @@ typedef struct __glXContextRec *GLXContext; typedef struct __GLXcontextRec *GLXContext; #endif -typedef unsigned int GLXVideoDeviceNV; +typedef unsigned int GLXVideoDeviceNV; extern Bool glXQueryExtension (Display *dpy, int *errorBase, int *eventBase); extern Bool glXQueryVersion (Display *dpy, int *major, int *minor); @@ -197,12 +197,12 @@ typedef Display* ( * PFNGLXGETCURRENTDISPLAYPROC) (void); #ifndef GLX_VERSION_1_3 #define GLX_VERSION_1_3 1 -#define GLX_RGBA_BIT 0x00000001 #define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 +#define GLX_RGBA_BIT 0x00000001 #define GLX_WINDOW_BIT 0x00000001 #define GLX_COLOR_INDEX_BIT 0x00000002 -#define GLX_PIXMAP_BIT 0x00000002 #define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 +#define GLX_PIXMAP_BIT 0x00000002 #define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 #define GLX_PBUFFER_BIT 0x00000004 #define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 @@ -255,26 +255,26 @@ typedef Display* ( * PFNGLXGETCURRENTDISPLAYPROC) (void); #define GLX_DONT_CARE 0xFFFFFFFF typedef XID GLXFBConfigID; -typedef XID GLXWindow; typedef XID GLXPbuffer; +typedef XID GLXWindow; typedef struct __GLXFBConfigRec *GLXFBConfig; typedef struct { - int event_type; - int draw_type; - unsigned long serial; - Bool send_event; - Display *display; - GLXDrawable drawable; - unsigned int buffer_mask; - unsigned int aux_buffer; - int x, y; - int width, height; - int count; + int event_type; + int draw_type; + unsigned long serial; + Bool send_event; + Display *display; + GLXDrawable drawable; + unsigned int buffer_mask; + unsigned int aux_buffer; + int x, y; + int width, height; + int count; } GLXPbufferClobberEvent; typedef union __GLXEvent { - GLXPbufferClobberEvent glxpbufferclobber; - long pad[24]; + GLXPbufferClobberEvent glxpbufferclobber; + long pad[24]; } GLXEvent; typedef GLXFBConfig* ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); @@ -343,6 +343,55 @@ extern void ( * glXGetProcAddress (const GLubyte *procName)) (void); #endif /* GLX_3DFX_multisample */ +/* ------------------------ GLX_AMD_gpu_association ------------------------ */ + +#ifndef GLX_AMD_gpu_association +#define GLX_AMD_gpu_association 1 + +#define GLX_GPU_VENDOR_AMD 0x1F00 +#define GLX_GPU_RENDERER_STRING_AMD 0x1F01 +#define GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 +#define GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 +#define GLX_GPU_RAM_AMD 0x21A3 +#define GLX_GPU_CLOCK_AMD 0x21A4 +#define GLX_GPU_NUM_PIPES_AMD 0x21A5 +#define GLX_GPU_NUM_SIMD_AMD 0x21A6 +#define GLX_GPU_NUM_RB_AMD 0x21A7 +#define GLX_GPU_NUM_SPI_AMD 0x21A8 + +typedef void ( * PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC) (GLXContext dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef GLXContext ( * PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC) (unsigned int id, GLXContext share_list); +typedef GLXContext ( * PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (unsigned int id, GLXContext share_context, const int* attribList); +typedef Bool ( * PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC) (GLXContext ctx); +typedef unsigned int ( * PFNGLXGETCONTEXTGPUIDAMDPROC) (GLXContext ctx); +typedef GLXContext ( * PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); +typedef unsigned int ( * PFNGLXGETGPUIDSAMDPROC) (unsigned int maxCount, unsigned int* ids); +typedef int ( * PFNGLXGETGPUINFOAMDPROC) (unsigned int id, int property, GLenum dataType, unsigned int size, void* data); +typedef Bool ( * PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (GLXContext ctx); + +#define glXBlitContextFramebufferAMD GLXEW_GET_FUN(__glewXBlitContextFramebufferAMD) +#define glXCreateAssociatedContextAMD GLXEW_GET_FUN(__glewXCreateAssociatedContextAMD) +#define glXCreateAssociatedContextAttribsAMD GLXEW_GET_FUN(__glewXCreateAssociatedContextAttribsAMD) +#define glXDeleteAssociatedContextAMD GLXEW_GET_FUN(__glewXDeleteAssociatedContextAMD) +#define glXGetContextGPUIDAMD GLXEW_GET_FUN(__glewXGetContextGPUIDAMD) +#define glXGetCurrentAssociatedContextAMD GLXEW_GET_FUN(__glewXGetCurrentAssociatedContextAMD) +#define glXGetGPUIDsAMD GLXEW_GET_FUN(__glewXGetGPUIDsAMD) +#define glXGetGPUInfoAMD GLXEW_GET_FUN(__glewXGetGPUInfoAMD) +#define glXMakeAssociatedContextCurrentAMD GLXEW_GET_FUN(__glewXMakeAssociatedContextCurrentAMD) + +#define GLXEW_AMD_gpu_association GLXEW_GET_VAR(__GLXEW_AMD_gpu_association) + +#endif /* GLX_AMD_gpu_association */ + +/* --------------------- GLX_ARB_context_flush_control --------------------- */ + +#ifndef GLX_ARB_context_flush_control +#define GLX_ARB_context_flush_control 1 + +#define GLXEW_ARB_context_flush_control GLXEW_GET_VAR(__GLXEW_ARB_context_flush_control) + +#endif /* GLX_ARB_context_flush_control */ + /* ------------------------- GLX_ARB_create_context ------------------------ */ #ifndef GLX_ARB_create_context @@ -362,13 +411,49 @@ typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display* dpy, GLXFBCo #endif /* GLX_ARB_create_context */ +/* -------------------- GLX_ARB_create_context_no_error -------------------- */ + +#ifndef GLX_ARB_create_context_no_error +#define GLX_ARB_create_context_no_error 1 + +#define GLXEW_ARB_create_context_no_error GLXEW_GET_VAR(__GLXEW_ARB_create_context_no_error) + +#endif /* GLX_ARB_create_context_no_error */ + +/* --------------------- GLX_ARB_create_context_profile -------------------- */ + +#ifndef GLX_ARB_create_context_profile +#define GLX_ARB_create_context_profile 1 + +#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 +#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126 + +#define GLXEW_ARB_create_context_profile GLXEW_GET_VAR(__GLXEW_ARB_create_context_profile) + +#endif /* GLX_ARB_create_context_profile */ + +/* ------------------- GLX_ARB_create_context_robustness ------------------- */ + +#ifndef GLX_ARB_create_context_robustness +#define GLX_ARB_create_context_robustness 1 + +#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261 + +#define GLXEW_ARB_create_context_robustness GLXEW_GET_VAR(__GLXEW_ARB_create_context_robustness) + +#endif /* GLX_ARB_create_context_robustness */ + /* ------------------------- GLX_ARB_fbconfig_float ------------------------ */ #ifndef GLX_ARB_fbconfig_float #define GLX_ARB_fbconfig_float 1 -#define GLX_RGBA_FLOAT_BIT 0x00000004 -#define GLX_RGBA_FLOAT_TYPE 0x20B9 +#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004 +#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9 #define GLXEW_ARB_fbconfig_float GLXEW_GET_VAR(__GLXEW_ARB_fbconfig_float) @@ -408,6 +493,39 @@ extern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void); #endif /* GLX_ARB_multisample */ +/* ---------------- GLX_ARB_robustness_application_isolation --------------- */ + +#ifndef GLX_ARB_robustness_application_isolation +#define GLX_ARB_robustness_application_isolation 1 + +#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define GLXEW_ARB_robustness_application_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_application_isolation) + +#endif /* GLX_ARB_robustness_application_isolation */ + +/* ---------------- GLX_ARB_robustness_share_group_isolation --------------- */ + +#ifndef GLX_ARB_robustness_share_group_isolation +#define GLX_ARB_robustness_share_group_isolation 1 + +#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define GLXEW_ARB_robustness_share_group_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_share_group_isolation) + +#endif /* GLX_ARB_robustness_share_group_isolation */ + +/* ---------------------- GLX_ARB_vertex_buffer_object --------------------- */ + +#ifndef GLX_ARB_vertex_buffer_object +#define GLX_ARB_vertex_buffer_object 1 + +#define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095 + +#define GLXEW_ARB_vertex_buffer_object GLXEW_GET_VAR(__GLXEW_ARB_vertex_buffer_object) + +#endif /* GLX_ARB_vertex_buffer_object */ + /* ----------------------- GLX_ATI_pixel_format_float ---------------------- */ #ifndef GLX_ATI_pixel_format_float @@ -472,6 +590,39 @@ typedef void ( * PFNGLXRELEASETEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, i #endif /* GLX_ATI_render_texture */ +/* --------------------------- GLX_EXT_buffer_age -------------------------- */ + +#ifndef GLX_EXT_buffer_age +#define GLX_EXT_buffer_age 1 + +#define GLX_BACK_BUFFER_AGE_EXT 0x20F4 + +#define GLXEW_EXT_buffer_age GLXEW_GET_VAR(__GLXEW_EXT_buffer_age) + +#endif /* GLX_EXT_buffer_age */ + +/* ------------------- GLX_EXT_create_context_es2_profile ------------------ */ + +#ifndef GLX_EXT_create_context_es2_profile +#define GLX_EXT_create_context_es2_profile 1 + +#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 + +#define GLXEW_EXT_create_context_es2_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es2_profile) + +#endif /* GLX_EXT_create_context_es2_profile */ + +/* ------------------- GLX_EXT_create_context_es_profile ------------------- */ + +#ifndef GLX_EXT_create_context_es_profile +#define GLX_EXT_create_context_es_profile 1 + +#define GLX_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 + +#define GLXEW_EXT_create_context_es_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es_profile) + +#endif /* GLX_EXT_create_context_es_profile */ + /* --------------------- GLX_EXT_fbconfig_packed_float --------------------- */ #ifndef GLX_EXT_fbconfig_packed_float @@ -520,6 +671,17 @@ typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display* dpy, GLXContext context #endif /* GLX_EXT_import_context */ +/* ---------------------------- GLX_EXT_libglvnd --------------------------- */ + +#ifndef GLX_EXT_libglvnd +#define GLX_EXT_libglvnd 1 + +#define GLX_VENDOR_NAMES_EXT 0x20F6 + +#define GLXEW_EXT_libglvnd GLXEW_GET_VAR(__GLXEW_EXT_libglvnd) + +#endif /* GLX_EXT_libglvnd */ + /* -------------------------- GLX_EXT_scene_marker ------------------------- */ #ifndef GLX_EXT_scene_marker @@ -529,6 +691,46 @@ typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display* dpy, GLXContext context #endif /* GLX_EXT_scene_marker */ +/* -------------------------- GLX_EXT_stereo_tree -------------------------- */ + +#ifndef GLX_EXT_stereo_tree +#define GLX_EXT_stereo_tree 1 + +#define GLX_STEREO_NOTIFY_EXT 0x00000000 +#define GLX_STEREO_NOTIFY_MASK_EXT 0x00000001 +#define GLX_STEREO_TREE_EXT 0x20F5 + +#define GLXEW_EXT_stereo_tree GLXEW_GET_VAR(__GLXEW_EXT_stereo_tree) + +#endif /* GLX_EXT_stereo_tree */ + +/* -------------------------- GLX_EXT_swap_control ------------------------- */ + +#ifndef GLX_EXT_swap_control +#define GLX_EXT_swap_control 1 + +#define GLX_SWAP_INTERVAL_EXT 0x20F1 +#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2 + +typedef void ( * PFNGLXSWAPINTERVALEXTPROC) (Display* dpy, GLXDrawable drawable, int interval); + +#define glXSwapIntervalEXT GLXEW_GET_FUN(__glewXSwapIntervalEXT) + +#define GLXEW_EXT_swap_control GLXEW_GET_VAR(__GLXEW_EXT_swap_control) + +#endif /* GLX_EXT_swap_control */ + +/* ----------------------- GLX_EXT_swap_control_tear ----------------------- */ + +#ifndef GLX_EXT_swap_control_tear +#define GLX_EXT_swap_control_tear 1 + +#define GLX_LATE_SWAPS_TEAR_EXT 0x20F3 + +#define GLXEW_EXT_swap_control_tear GLXEW_GET_VAR(__GLXEW_EXT_swap_control_tear) + +#endif /* GLX_EXT_swap_control_tear */ + /* ---------------------- GLX_EXT_texture_from_pixmap ---------------------- */ #ifndef GLX_EXT_texture_from_pixmap @@ -615,6 +817,20 @@ typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display* display, GLXDrawable dr #endif /* GLX_EXT_visual_rating */ +/* -------------------------- GLX_INTEL_swap_event ------------------------- */ + +#ifndef GLX_INTEL_swap_event +#define GLX_INTEL_swap_event 1 + +#define GLX_EXCHANGE_COMPLETE_INTEL 0x8180 +#define GLX_COPY_COMPLETE_INTEL 0x8181 +#define GLX_FLIP_COMPLETE_INTEL 0x8182 +#define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000 + +#define GLXEW_INTEL_swap_event GLXEW_GET_VAR(__GLXEW_INTEL_swap_event) + +#endif /* GLX_INTEL_swap_event */ + /* -------------------------- GLX_MESA_agp_offset -------------------------- */ #ifndef GLX_MESA_agp_offset @@ -654,6 +870,38 @@ typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display* dpy, XVisualInfo #endif /* GLX_MESA_pixmap_colormap */ +/* ------------------------ GLX_MESA_query_renderer ------------------------ */ + +#ifndef GLX_MESA_query_renderer +#define GLX_MESA_query_renderer 1 + +#define GLX_RENDERER_VENDOR_ID_MESA 0x8183 +#define GLX_RENDERER_DEVICE_ID_MESA 0x8184 +#define GLX_RENDERER_VERSION_MESA 0x8185 +#define GLX_RENDERER_ACCELERATED_MESA 0x8186 +#define GLX_RENDERER_VIDEO_MEMORY_MESA 0x8187 +#define GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA 0x8188 +#define GLX_RENDERER_PREFERRED_PROFILE_MESA 0x8189 +#define GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA 0x818A +#define GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA 0x818B +#define GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA 0x818C +#define GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA 0x818D +#define GLX_RENDERER_ID_MESA 0x818E + +typedef Bool ( * PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC) (int attribute, unsigned int* value); +typedef const char* ( * PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC) (int attribute); +typedef Bool ( * PFNGLXQUERYRENDERERINTEGERMESAPROC) (Display* dpy, int screen, int renderer, int attribute, unsigned int *value); +typedef const char* ( * PFNGLXQUERYRENDERERSTRINGMESAPROC) (Display *dpy, int screen, int renderer, int attribute); + +#define glXQueryCurrentRendererIntegerMESA GLXEW_GET_FUN(__glewXQueryCurrentRendererIntegerMESA) +#define glXQueryCurrentRendererStringMESA GLXEW_GET_FUN(__glewXQueryCurrentRendererStringMESA) +#define glXQueryRendererIntegerMESA GLXEW_GET_FUN(__glewXQueryRendererIntegerMESA) +#define glXQueryRendererStringMESA GLXEW_GET_FUN(__glewXQueryRendererStringMESA) + +#define GLXEW_MESA_query_renderer GLXEW_GET_VAR(__GLXEW_MESA_query_renderer) + +#endif /* GLX_MESA_query_renderer */ + /* ------------------------ GLX_MESA_release_buffers ----------------------- */ #ifndef GLX_MESA_release_buffers @@ -683,6 +931,62 @@ typedef GLboolean ( * PFNGLXSET3DFXMODEMESAPROC) (GLint mode); #endif /* GLX_MESA_set_3dfx_mode */ +/* ------------------------- GLX_MESA_swap_control ------------------------- */ + +#ifndef GLX_MESA_swap_control +#define GLX_MESA_swap_control 1 + +typedef int ( * PFNGLXGETSWAPINTERVALMESAPROC) (void); +typedef int ( * PFNGLXSWAPINTERVALMESAPROC) (unsigned int interval); + +#define glXGetSwapIntervalMESA GLXEW_GET_FUN(__glewXGetSwapIntervalMESA) +#define glXSwapIntervalMESA GLXEW_GET_FUN(__glewXSwapIntervalMESA) + +#define GLXEW_MESA_swap_control GLXEW_GET_VAR(__GLXEW_MESA_swap_control) + +#endif /* GLX_MESA_swap_control */ + +/* --------------------------- GLX_NV_copy_buffer -------------------------- */ + +#ifndef GLX_NV_copy_buffer +#define GLX_NV_copy_buffer 1 + +typedef void ( * PFNGLXCOPYBUFFERSUBDATANVPROC) (Display* dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void ( * PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC) (Display* dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); + +#define glXCopyBufferSubDataNV GLXEW_GET_FUN(__glewXCopyBufferSubDataNV) +#define glXNamedCopyBufferSubDataNV GLXEW_GET_FUN(__glewXNamedCopyBufferSubDataNV) + +#define GLXEW_NV_copy_buffer GLXEW_GET_VAR(__GLXEW_NV_copy_buffer) + +#endif /* GLX_NV_copy_buffer */ + +/* --------------------------- GLX_NV_copy_image --------------------------- */ + +#ifndef GLX_NV_copy_image +#define GLX_NV_copy_image 1 + +typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); + +#define glXCopyImageSubDataNV GLXEW_GET_FUN(__glewXCopyImageSubDataNV) + +#define GLXEW_NV_copy_image GLXEW_GET_VAR(__GLXEW_NV_copy_image) + +#endif /* GLX_NV_copy_image */ + +/* ------------------------ GLX_NV_delay_before_swap ----------------------- */ + +#ifndef GLX_NV_delay_before_swap +#define GLX_NV_delay_before_swap 1 + +typedef Bool ( * PFNGLXDELAYBEFORESWAPNVPROC) (Display* dpy, GLXDrawable drawable, GLfloat seconds); + +#define glXDelayBeforeSwapNV GLXEW_GET_FUN(__glewXDelayBeforeSwapNV) + +#define GLXEW_NV_delay_before_swap GLXEW_GET_VAR(__GLXEW_NV_delay_before_swap) + +#endif /* GLX_NV_delay_before_swap */ + /* -------------------------- GLX_NV_float_buffer -------------------------- */ #ifndef GLX_NV_float_buffer @@ -694,6 +998,18 @@ typedef GLboolean ( * PFNGLXSET3DFXMODEMESAPROC) (GLint mode); #endif /* GLX_NV_float_buffer */ +/* ---------------------- GLX_NV_multisample_coverage ---------------------- */ + +#ifndef GLX_NV_multisample_coverage +#define GLX_NV_multisample_coverage 1 + +#define GLX_COLOR_SAMPLES_NV 0x20B3 +#define GLX_COVERAGE_SAMPLES_NV 100001 + +#define GLXEW_NV_multisample_coverage GLXEW_GET_VAR(__GLXEW_NV_multisample_coverage) + +#endif /* GLX_NV_multisample_coverage */ + /* -------------------------- GLX_NV_present_video ------------------------- */ #ifndef GLX_NV_present_video @@ -711,6 +1027,17 @@ typedef unsigned int* ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int #endif /* GLX_NV_present_video */ +/* ------------------ GLX_NV_robustness_video_memory_purge ----------------- */ + +#ifndef GLX_NV_robustness_video_memory_purge +#define GLX_NV_robustness_video_memory_purge 1 + +#define GLX_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x20F7 + +#define GLXEW_NV_robustness_video_memory_purge GLXEW_GET_VAR(__GLXEW_NV_robustness_video_memory_purge) + +#endif /* GLX_NV_robustness_video_memory_purge */ + /* --------------------------- GLX_NV_swap_group --------------------------- */ #ifndef GLX_NV_swap_group @@ -749,10 +1076,37 @@ typedef void ( * PFNGLXFREEMEMORYNVPROC) (void *pointer); #endif /* GLX_NV_vertex_array_range */ -/* -------------------------- GLX_NV_video_output -------------------------- */ +/* -------------------------- GLX_NV_video_capture ------------------------- */ -#ifndef GLX_NV_video_output -#define GLX_NV_video_output 1 +#ifndef GLX_NV_video_capture +#define GLX_NV_video_capture 1 + +#define GLX_DEVICE_ID_NV 0x20CD +#define GLX_UNIQUE_ID_NV 0x20CE +#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF + +typedef XID GLXVideoCaptureDeviceNV; + +typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display* dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device); +typedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display* dpy, int screen, int *nelements); +typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device); +typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value); +typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device); + +#define glXBindVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXBindVideoCaptureDeviceNV) +#define glXEnumerateVideoCaptureDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoCaptureDevicesNV) +#define glXLockVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXLockVideoCaptureDeviceNV) +#define glXQueryVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXQueryVideoCaptureDeviceNV) +#define glXReleaseVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoCaptureDeviceNV) + +#define GLXEW_NV_video_capture GLXEW_GET_VAR(__GLXEW_NV_video_capture) + +#endif /* GLX_NV_video_capture */ + +/* ---------------------------- GLX_NV_video_out --------------------------- */ + +#ifndef GLX_NV_video_out +#define GLX_NV_video_out 1 #define GLX_VIDEO_OUT_COLOR_NV 0x20C3 #define GLX_VIDEO_OUT_ALPHA_NV 0x20C4 @@ -779,9 +1133,9 @@ typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display* dpy, GLXPbuffer pbuf, #define glXReleaseVideoImageNV GLXEW_GET_FUN(__glewXReleaseVideoImageNV) #define glXSendPbufferToVideoNV GLXEW_GET_FUN(__glewXSendPbufferToVideoNV) -#define GLXEW_NV_video_output GLXEW_GET_VAR(__GLXEW_NV_video_output) +#define GLXEW_NV_video_out GLXEW_GET_VAR(__GLXEW_NV_video_out) -#endif /* GLX_NV_video_output */ +#endif /* GLX_NV_video_out */ /* -------------------------- GLX_OML_swap_method -------------------------- */ @@ -799,8 +1153,7 @@ typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display* dpy, GLXPbuffer pbuf, /* -------------------------- GLX_OML_sync_control ------------------------- */ -#if !defined(GLX_OML_sync_control) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) -#include +#ifndef GLX_OML_sync_control #define GLX_OML_sync_control 1 typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display* dpy, GLXDrawable drawable, int32_t* numerator, int32_t* denominator); @@ -835,16 +1188,6 @@ typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display* dpy, GLXDrawable drawable, i #ifndef GLX_SGIS_color_range #define GLX_SGIS_color_range 1 -#define GLX_MIN_RED_SGIS 0 -#define GLX_MAX_GREEN_SGIS 0 -#define GLX_MIN_BLUE_SGIS 0 -#define GLX_MAX_ALPHA_SGIS 0 -#define GLX_MIN_GREEN_SGIS 0 -#define GLX_MIN_ALPHA_SGIS 0 -#define GLX_MAX_RED_SGIS 0 -#define GLX_EXTENDED_RANGE_SGIS 0 -#define GLX_MAX_BLUE_SGIS 0 - #define GLXEW_SGIS_color_range GLXEW_GET_VAR(__GLXEW_SGIS_color_range) #endif /* GLX_SGIS_color_range */ @@ -878,10 +1221,10 @@ typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display* dpy, GLXDrawable drawable, i #ifndef GLX_SGIX_fbconfig #define GLX_SGIX_fbconfig 1 -#define GLX_WINDOW_BIT_SGIX 0x00000001 #define GLX_RGBA_BIT_SGIX 0x00000001 -#define GLX_PIXMAP_BIT_SGIX 0x00000002 +#define GLX_WINDOW_BIT_SGIX 0x00000001 #define GLX_COLOR_INDEX_BIT_SGIX 0x00000002 +#define GLX_PIXMAP_BIT_SGIX 0x00000002 #define GLX_SCREEN_EXT 0x800C #define GLX_DRAWABLE_TYPE_SGIX 0x8010 #define GLX_RENDER_TYPE_SGIX 0x8011 @@ -918,8 +1261,8 @@ typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLX #define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001 #define GLX_PIPE_RECT_SGIX 0x00000001 -#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002 #define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002 +#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002 #define GLX_HYPERPIPE_STEREO_SGIX 0x00000003 #define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004 #define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 @@ -928,32 +1271,32 @@ typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLX #define GLX_HYPERPIPE_ID_SGIX 0x8030 typedef struct { - char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; - int networkId; + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int networkId; } GLXHyperpipeNetworkSGIX; typedef struct { - char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; - int XOrigin; - int YOrigin; - int maxHeight; - int maxWidth; + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int XOrigin; + int YOrigin; + int maxHeight; + int maxWidth; } GLXPipeRectLimits; typedef struct { - char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; - int channel; - unsigned int participationType; - int timeSlice; + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int channel; + unsigned int participationType; + int timeSlice; } GLXHyperpipeConfigSGIX; typedef struct { - char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; - int srcXOrigin; - int srcYOrigin; - int srcWidth; - int srcHeight; - int destXOrigin; - int destYOrigin; - int destWidth; - int destHeight; + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int srcXOrigin; + int srcYOrigin; + int srcWidth; + int srcHeight; + int destXOrigin; + int destYOrigin; + int destWidth; + int destHeight; } GLXPipeRect; typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId); @@ -985,8 +1328,8 @@ typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Disp #define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001 #define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002 -#define GLX_PBUFFER_BIT_SGIX 0x00000004 #define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004 +#define GLX_PBUFFER_BIT_SGIX 0x00000004 #define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008 #define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010 #define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020 @@ -1137,7 +1480,7 @@ typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval); #ifndef GLX_SGI_video_sync #define GLX_SGI_video_sync 1 -typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (uint* count); +typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int* count); typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int* count); #define glXGetVideoSyncSGI GLXEW_GET_FUN(__glewXGetVideoSyncSGI) @@ -1180,218 +1523,245 @@ typedef int ( * PFNGLXVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, /* ------------------------------------------------------------------------- */ -#ifdef GLEW_MX -#define GLXEW_EXPORT -#else -#define GLXEW_EXPORT extern -#endif /* GLEW_MX */ +#define GLXEW_FUN_EXPORT GLEW_FUN_EXPORT +#define GLXEW_VAR_EXPORT GLEW_VAR_EXPORT -extern PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay; +GLXEW_FUN_EXPORT PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay; -extern PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig; -extern PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext; -extern PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer; -extern PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap; -extern PFNGLXCREATEWINDOWPROC __glewXCreateWindow; -extern PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer; -extern PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap; -extern PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow; -extern PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable; -extern PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib; -extern PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs; -extern PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent; -extern PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig; -extern PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent; -extern PFNGLXQUERYCONTEXTPROC __glewXQueryContext; -extern PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable; -extern PFNGLXSELECTEVENTPROC __glewXSelectEvent; +GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig; +GLXEW_FUN_EXPORT PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext; +GLXEW_FUN_EXPORT PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer; +GLXEW_FUN_EXPORT PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap; +GLXEW_FUN_EXPORT PFNGLXCREATEWINDOWPROC __glewXCreateWindow; +GLXEW_FUN_EXPORT PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer; +GLXEW_FUN_EXPORT PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap; +GLXEW_FUN_EXPORT PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow; +GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs; +GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent; +GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig; +GLXEW_FUN_EXPORT PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent; +GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTPROC __glewXQueryContext; +GLXEW_FUN_EXPORT PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable; +GLXEW_FUN_EXPORT PFNGLXSELECTEVENTPROC __glewXSelectEvent; -extern PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB; +GLXEW_FUN_EXPORT PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC __glewXBlitContextFramebufferAMD; +GLXEW_FUN_EXPORT PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC __glewXCreateAssociatedContextAMD; +GLXEW_FUN_EXPORT PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __glewXCreateAssociatedContextAttribsAMD; +GLXEW_FUN_EXPORT PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC __glewXDeleteAssociatedContextAMD; +GLXEW_FUN_EXPORT PFNGLXGETCONTEXTGPUIDAMDPROC __glewXGetContextGPUIDAMD; +GLXEW_FUN_EXPORT PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC __glewXGetCurrentAssociatedContextAMD; +GLXEW_FUN_EXPORT PFNGLXGETGPUIDSAMDPROC __glewXGetGPUIDsAMD; +GLXEW_FUN_EXPORT PFNGLXGETGPUINFOAMDPROC __glewXGetGPUInfoAMD; +GLXEW_FUN_EXPORT PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __glewXMakeAssociatedContextCurrentAMD; -extern PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI; -extern PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI; -extern PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI; +GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB; -extern PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT; -extern PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT; -extern PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT; -extern PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT; +GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI; +GLXEW_FUN_EXPORT PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI; +GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI; -extern PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT; -extern PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT; +GLXEW_FUN_EXPORT PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT; +GLXEW_FUN_EXPORT PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT; +GLXEW_FUN_EXPORT PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT; +GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT; -extern PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA; +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT; -extern PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA; +GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT; +GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT; -extern PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA; +GLXEW_FUN_EXPORT PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA; -extern PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA; +GLXEW_FUN_EXPORT PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA; -extern PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA; +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA; -extern PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV; -extern PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV; +GLXEW_FUN_EXPORT PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC __glewXQueryCurrentRendererIntegerMESA; +GLXEW_FUN_EXPORT PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC __glewXQueryCurrentRendererStringMESA; +GLXEW_FUN_EXPORT PFNGLXQUERYRENDERERINTEGERMESAPROC __glewXQueryRendererIntegerMESA; +GLXEW_FUN_EXPORT PFNGLXQUERYRENDERERSTRINGMESAPROC __glewXQueryRendererStringMESA; -extern PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV; -extern PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV; -extern PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV; -extern PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV; -extern PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV; -extern PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV; +GLXEW_FUN_EXPORT PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA; -extern PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV; -extern PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV; +GLXEW_FUN_EXPORT PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA; -extern PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV; -extern PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV; -extern PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV; -extern PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV; -extern PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV; -extern PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV; +GLXEW_FUN_EXPORT PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA; +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA; -#ifdef GLX_OML_sync_control -extern PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML; -extern PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML; -extern PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML; -extern PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML; -extern PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML; -#endif +GLXEW_FUN_EXPORT PFNGLXCOPYBUFFERSUBDATANVPROC __glewXCopyBufferSubDataNV; +GLXEW_FUN_EXPORT PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC __glewXNamedCopyBufferSubDataNV; -extern PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX; -extern PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX; -extern PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX; -extern PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX; -extern PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX; -extern PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV; -extern PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX; -extern PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX; -extern PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX; -extern PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX; -extern PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX; -extern PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX; -extern PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX; -extern PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX; +GLXEW_FUN_EXPORT PFNGLXDELAYBEFORESWAPNVPROC __glewXDelayBeforeSwapNV; -extern PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX; -extern PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX; -extern PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX; -extern PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX; -extern PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX; +GLXEW_FUN_EXPORT PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV; +GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV; -extern PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX; -extern PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX; +GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV; +GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV; +GLXEW_FUN_EXPORT PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV; +GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV; +GLXEW_FUN_EXPORT PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV; +GLXEW_FUN_EXPORT PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV; -extern PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX; +GLXEW_FUN_EXPORT PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV; +GLXEW_FUN_EXPORT PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV; -extern PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX; -extern PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX; -extern PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX; -extern PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX; -extern PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX; +GLXEW_FUN_EXPORT PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV; +GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV; +GLXEW_FUN_EXPORT PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV; +GLXEW_FUN_EXPORT PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV; +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV; -extern PFNGLXCUSHIONSGIPROC __glewXCushionSGI; +GLXEW_FUN_EXPORT PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV; +GLXEW_FUN_EXPORT PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV; +GLXEW_FUN_EXPORT PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV; +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV; +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV; +GLXEW_FUN_EXPORT PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV; -extern PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI; -extern PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI; +GLXEW_FUN_EXPORT PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML; +GLXEW_FUN_EXPORT PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML; +GLXEW_FUN_EXPORT PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML; +GLXEW_FUN_EXPORT PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML; +GLXEW_FUN_EXPORT PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML; -extern PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI; +GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX; +GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX; -extern PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI; -extern PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI; +GLXEW_FUN_EXPORT PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX; +GLXEW_FUN_EXPORT PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX; -extern PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN; +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX; +GLXEW_FUN_EXPORT PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX; +GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX; +GLXEW_FUN_EXPORT PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX; -extern PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN; -extern PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN; +GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX; -#if defined(GLEW_MX) -struct GLXEWContextStruct -{ -#endif /* GLEW_MX */ +GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX; -GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_0; -GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_1; -GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_2; -GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_3; -GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_4; -GLXEW_EXPORT GLboolean __GLXEW_3DFX_multisample; -GLXEW_EXPORT GLboolean __GLXEW_ARB_create_context; -GLXEW_EXPORT GLboolean __GLXEW_ARB_fbconfig_float; -GLXEW_EXPORT GLboolean __GLXEW_ARB_framebuffer_sRGB; -GLXEW_EXPORT GLboolean __GLXEW_ARB_get_proc_address; -GLXEW_EXPORT GLboolean __GLXEW_ARB_multisample; -GLXEW_EXPORT GLboolean __GLXEW_ATI_pixel_format_float; -GLXEW_EXPORT GLboolean __GLXEW_ATI_render_texture; -GLXEW_EXPORT GLboolean __GLXEW_EXT_fbconfig_packed_float; -GLXEW_EXPORT GLboolean __GLXEW_EXT_framebuffer_sRGB; -GLXEW_EXPORT GLboolean __GLXEW_EXT_import_context; -GLXEW_EXPORT GLboolean __GLXEW_EXT_scene_marker; -GLXEW_EXPORT GLboolean __GLXEW_EXT_texture_from_pixmap; -GLXEW_EXPORT GLboolean __GLXEW_EXT_visual_info; -GLXEW_EXPORT GLboolean __GLXEW_EXT_visual_rating; -GLXEW_EXPORT GLboolean __GLXEW_MESA_agp_offset; -GLXEW_EXPORT GLboolean __GLXEW_MESA_copy_sub_buffer; -GLXEW_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap; -GLXEW_EXPORT GLboolean __GLXEW_MESA_release_buffers; -GLXEW_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode; -GLXEW_EXPORT GLboolean __GLXEW_NV_float_buffer; -GLXEW_EXPORT GLboolean __GLXEW_NV_present_video; -GLXEW_EXPORT GLboolean __GLXEW_NV_swap_group; -GLXEW_EXPORT GLboolean __GLXEW_NV_vertex_array_range; -GLXEW_EXPORT GLboolean __GLXEW_NV_video_output; -GLXEW_EXPORT GLboolean __GLXEW_OML_swap_method; -GLXEW_EXPORT GLboolean __GLXEW_OML_sync_control; -GLXEW_EXPORT GLboolean __GLXEW_SGIS_blended_overlay; -GLXEW_EXPORT GLboolean __GLXEW_SGIS_color_range; -GLXEW_EXPORT GLboolean __GLXEW_SGIS_multisample; -GLXEW_EXPORT GLboolean __GLXEW_SGIS_shared_multisample; -GLXEW_EXPORT GLboolean __GLXEW_SGIX_fbconfig; -GLXEW_EXPORT GLboolean __GLXEW_SGIX_hyperpipe; -GLXEW_EXPORT GLboolean __GLXEW_SGIX_pbuffer; -GLXEW_EXPORT GLboolean __GLXEW_SGIX_swap_barrier; -GLXEW_EXPORT GLboolean __GLXEW_SGIX_swap_group; -GLXEW_EXPORT GLboolean __GLXEW_SGIX_video_resize; -GLXEW_EXPORT GLboolean __GLXEW_SGIX_visual_select_group; -GLXEW_EXPORT GLboolean __GLXEW_SGI_cushion; -GLXEW_EXPORT GLboolean __GLXEW_SGI_make_current_read; -GLXEW_EXPORT GLboolean __GLXEW_SGI_swap_control; -GLXEW_EXPORT GLboolean __GLXEW_SGI_video_sync; -GLXEW_EXPORT GLboolean __GLXEW_SUN_get_transparent_index; -GLXEW_EXPORT GLboolean __GLXEW_SUN_video_resize; +GLXEW_FUN_EXPORT PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX; +GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX; +GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX; -#ifdef GLEW_MX -}; /* GLXEWContextStruct */ -#endif /* GLEW_MX */ +GLXEW_FUN_EXPORT PFNGLXCUSHIONSGIPROC __glewXCushionSGI; +GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI; +GLXEW_FUN_EXPORT PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI; + +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI; + +GLXEW_FUN_EXPORT PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI; +GLXEW_FUN_EXPORT PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI; + +GLXEW_FUN_EXPORT PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN; + +GLXEW_FUN_EXPORT PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN; +GLXEW_FUN_EXPORT PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_0; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_1; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_2; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_3; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_4; +GLXEW_VAR_EXPORT GLboolean __GLXEW_3DFX_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_AMD_gpu_association; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_context_flush_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_no_error; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_profile; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_robustness; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_fbconfig_float; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_framebuffer_sRGB; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_get_proc_address; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_application_isolation; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_share_group_isolation; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_vertex_buffer_object; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_pixel_format_float; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_render_texture; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_buffer_age; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es2_profile; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es_profile; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_fbconfig_packed_float; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_framebuffer_sRGB; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_import_context; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_libglvnd; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_scene_marker; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_stereo_tree; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control_tear; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_texture_from_pixmap; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_info; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_rating; +GLXEW_VAR_EXPORT GLboolean __GLXEW_INTEL_swap_event; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_agp_offset; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_copy_sub_buffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_query_renderer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_release_buffers; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_swap_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_copy_buffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_copy_image; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_delay_before_swap; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_float_buffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_multisample_coverage; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_present_video; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_robustness_video_memory_purge; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_swap_group; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_vertex_array_range; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_capture; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_out; +GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_swap_method; +GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_sync_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_blended_overlay; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_color_range; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_shared_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_fbconfig; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_hyperpipe; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_pbuffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_barrier; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_group; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_video_resize; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_visual_select_group; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_cushion; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_make_current_read; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_swap_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_video_sync; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_get_transparent_index; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_video_resize; /* ------------------------------------------------------------------------ */ -#ifdef GLEW_MX - -typedef struct GLXEWContextStruct GLXEWContext; -extern GLenum glxewContextInit (GLXEWContext* ctx); -extern GLboolean glxewContextIsSupported (GLXEWContext* ctx, const char* name); - -#define glxewInit() glxewContextInit(glxewGetContext()) -#define glxewIsSupported(x) glxewContextIsSupported(glxewGetContext(), x) - -#define GLXEW_GET_VAR(x) (*(const GLboolean*)&(glxewGetContext()->x)) -#define GLXEW_GET_FUN(x) x - -#else /* GLEW_MX */ +GLEWAPI GLenum GLEWAPIENTRY glxewInit (); +GLEWAPI GLboolean GLEWAPIENTRY glxewIsSupported (const char *name); +#ifndef GLXEW_GET_VAR #define GLXEW_GET_VAR(x) (*(const GLboolean*)&x) -#define GLXEW_GET_FUN(x) x - -extern GLboolean glxewIsSupported (const char* name); - -#endif /* GLEW_MX */ - -extern GLboolean glxewGetExtension (const char* name); - -#ifdef __cplusplus -} #endif +#ifndef GLXEW_GET_FUN +#define GLXEW_GET_FUN(x) x +#endif + +GLEWAPI GLboolean GLEWAPIENTRY glxewGetExtension (const char *name); + #endif /* __glxew_h__ */ diff --git a/test_conformance/gl/GLEW/GL/wglew.h b/test_conformance/gl/GLEW/GL/wglew.h index 7f802761..57e82c35 100644 --- a/test_conformance/gl/GLEW/GL/wglew.h +++ b/test_conformance/gl/GLEW/GL/wglew.h @@ -1,27 +1,28 @@ /* ** The OpenGL Extension Wrangler Library +** Copyright (C) 2008-2017, Nigel Stewart ** Copyright (C) 2002-2008, Milan Ikits ** Copyright (C) 2002-2008, Marcelo E. Magallon ** Copyright (C) 2002, Lev Povalahev ** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without +** +** 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, +** +** * 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 +** * 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. -** * The name of the author may be used to endorse or promote products +** * The name of the author 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 +** 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 +** 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) @@ -31,7 +32,7 @@ /* ** Copyright (c) 2007 The Khronos Group Inc. -** +** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the ** "Materials"), to deal in the Materials without restriction, including @@ -39,10 +40,10 @@ ** distribute, sublicense, and/or sell copies of the Materials, and to ** permit persons to whom the Materials are furnished to do so, subject to ** the following conditions: -** +** ** The above copyright notice and this permission notice shall be included ** in all copies or substantial portions of the Materials. -** +** ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -62,11 +63,12 @@ #define __wglext_h_ -#if !defined(APIENTRY) && !defined(__CYGWIN__) +#if !defined(WINAPI) # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN 1 # endif #include +# undef WIN32_LEAN_AND_MEAN #endif /* @@ -83,10 +85,6 @@ # endif #endif -#ifdef __cplusplus -extern "C" { -#endif - /* -------------------------- WGL_3DFX_multisample ------------------------- */ #ifndef WGL_3DFX_multisample @@ -117,6 +115,46 @@ typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState #endif /* WGL_3DL_stereo_control */ +/* ------------------------ WGL_AMD_gpu_association ------------------------ */ + +#ifndef WGL_AMD_gpu_association +#define WGL_AMD_gpu_association 1 + +#define WGL_GPU_VENDOR_AMD 0x1F00 +#define WGL_GPU_RENDERER_STRING_AMD 0x1F01 +#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 +#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 +#define WGL_GPU_RAM_AMD 0x21A3 +#define WGL_GPU_CLOCK_AMD 0x21A4 +#define WGL_GPU_NUM_PIPES_AMD 0x21A5 +#define WGL_GPU_NUM_SIMD_AMD 0x21A6 +#define WGL_GPU_NUM_RB_AMD 0x21A7 +#define WGL_GPU_NUM_SPI_AMD 0x21A8 + +typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int* attribList); +typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc); +typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc); +typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); +typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT* ids); +typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, INT property, GLenum dataType, UINT size, void* data); +typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc); + +#define wglBlitContextFramebufferAMD WGLEW_GET_FUN(__wglewBlitContextFramebufferAMD) +#define wglCreateAssociatedContextAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAMD) +#define wglCreateAssociatedContextAttribsAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAttribsAMD) +#define wglDeleteAssociatedContextAMD WGLEW_GET_FUN(__wglewDeleteAssociatedContextAMD) +#define wglGetContextGPUIDAMD WGLEW_GET_FUN(__wglewGetContextGPUIDAMD) +#define wglGetCurrentAssociatedContextAMD WGLEW_GET_FUN(__wglewGetCurrentAssociatedContextAMD) +#define wglGetGPUIDsAMD WGLEW_GET_FUN(__wglewGetGPUIDsAMD) +#define wglGetGPUInfoAMD WGLEW_GET_FUN(__wglewGetGPUInfoAMD) +#define wglMakeAssociatedContextCurrentAMD WGLEW_GET_FUN(__wglewMakeAssociatedContextCurrentAMD) + +#define WGLEW_AMD_gpu_association WGLEW_GET_VAR(__WGLEW_AMD_gpu_association) + +#endif /* WGL_AMD_gpu_association */ + /* ------------------------- WGL_ARB_buffer_region ------------------------- */ #ifndef WGL_ARB_buffer_region @@ -141,6 +179,15 @@ typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, in #endif /* WGL_ARB_buffer_region */ +/* --------------------- WGL_ARB_context_flush_control --------------------- */ + +#ifndef WGL_ARB_context_flush_control +#define WGL_ARB_context_flush_control 1 + +#define WGLEW_ARB_context_flush_control WGLEW_GET_VAR(__WGLEW_ARB_context_flush_control) + +#endif /* WGL_ARB_context_flush_control */ + /* ------------------------- WGL_ARB_create_context ------------------------ */ #ifndef WGL_ARB_create_context @@ -152,6 +199,8 @@ typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, in #define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 #define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 #define WGL_CONTEXT_FLAGS_ARB 0x2094 +#define ERROR_INVALID_VERSION_ARB 0x2095 +#define ERROR_INVALID_PROFILE_ARB 0x2096 typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int* attribList); @@ -161,6 +210,42 @@ typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShar #endif /* WGL_ARB_create_context */ +/* -------------------- WGL_ARB_create_context_no_error -------------------- */ + +#ifndef WGL_ARB_create_context_no_error +#define WGL_ARB_create_context_no_error 1 + +#define WGLEW_ARB_create_context_no_error WGLEW_GET_VAR(__WGLEW_ARB_create_context_no_error) + +#endif /* WGL_ARB_create_context_no_error */ + +/* --------------------- WGL_ARB_create_context_profile -------------------- */ + +#ifndef WGL_ARB_create_context_profile +#define WGL_ARB_create_context_profile 1 + +#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 +#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 + +#define WGLEW_ARB_create_context_profile WGLEW_GET_VAR(__WGLEW_ARB_create_context_profile) + +#endif /* WGL_ARB_create_context_profile */ + +/* ------------------- WGL_ARB_create_context_robustness ------------------- */ + +#ifndef WGL_ARB_create_context_robustness +#define WGL_ARB_create_context_robustness 1 + +#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261 + +#define WGLEW_ARB_create_context_robustness WGLEW_GET_VAR(__WGLEW_ARB_create_context_robustness) + +#endif /* WGL_ARB_create_context_robustness */ + /* ----------------------- WGL_ARB_extensions_string ----------------------- */ #ifndef WGL_ARB_extensions_string @@ -376,6 +461,28 @@ typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, con #endif /* WGL_ARB_render_texture */ +/* ---------------- WGL_ARB_robustness_application_isolation --------------- */ + +#ifndef WGL_ARB_robustness_application_isolation +#define WGL_ARB_robustness_application_isolation 1 + +#define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define WGLEW_ARB_robustness_application_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_application_isolation) + +#endif /* WGL_ARB_robustness_application_isolation */ + +/* ---------------- WGL_ARB_robustness_share_group_isolation --------------- */ + +#ifndef WGL_ARB_robustness_share_group_isolation +#define WGL_ARB_robustness_share_group_isolation 1 + +#define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define WGLEW_ARB_robustness_share_group_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_share_group_isolation) + +#endif /* WGL_ARB_robustness_share_group_isolation */ + /* ----------------------- WGL_ATI_pixel_format_float ---------------------- */ #ifndef WGL_ATI_pixel_format_float @@ -400,6 +507,41 @@ typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, con #endif /* WGL_ATI_render_texture_rectangle */ +/* --------------------------- WGL_EXT_colorspace -------------------------- */ + +#ifndef WGL_EXT_colorspace +#define WGL_EXT_colorspace 1 + +#define WGL_COLORSPACE_SRGB_EXT 0x3089 +#define WGL_COLORSPACE_LINEAR_EXT 0x308A +#define WGL_COLORSPACE_EXT 0x309D + +#define WGLEW_EXT_colorspace WGLEW_GET_VAR(__WGLEW_EXT_colorspace) + +#endif /* WGL_EXT_colorspace */ + +/* ------------------- WGL_EXT_create_context_es2_profile ------------------ */ + +#ifndef WGL_EXT_create_context_es2_profile +#define WGL_EXT_create_context_es2_profile 1 + +#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 + +#define WGLEW_EXT_create_context_es2_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es2_profile) + +#endif /* WGL_EXT_create_context_es2_profile */ + +/* ------------------- WGL_EXT_create_context_es_profile ------------------- */ + +#ifndef WGL_EXT_create_context_es_profile +#define WGL_EXT_create_context_es_profile 1 + +#define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 + +#define WGLEW_EXT_create_context_es_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es_profile) + +#endif /* WGL_EXT_create_context_es_profile */ + /* -------------------------- WGL_EXT_depth_float -------------------------- */ #ifndef WGL_EXT_depth_float @@ -605,6 +747,15 @@ typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval); #endif /* WGL_EXT_swap_control */ +/* ----------------------- WGL_EXT_swap_control_tear ----------------------- */ + +#ifndef WGL_EXT_swap_control_tear +#define WGL_EXT_swap_control_tear 1 + +#define WGLEW_EXT_swap_control_tear WGLEW_GET_VAR(__WGLEW_EXT_swap_control_tear) + +#endif /* WGL_EXT_swap_control_tear */ + /* --------------------- WGL_I3D_digital_video_control --------------------- */ #ifndef WGL_I3D_digital_video_control @@ -752,6 +903,72 @@ typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWO #endif /* WGL_I3D_swap_frame_usage */ +/* --------------------------- WGL_NV_DX_interop --------------------------- */ + +#ifndef WGL_NV_DX_interop +#define WGL_NV_DX_interop 1 + +#define WGL_ACCESS_READ_ONLY_NV 0x0000 +#define WGL_ACCESS_READ_WRITE_NV 0x0001 +#define WGL_ACCESS_WRITE_DISCARD_NV 0x0002 + +typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice); +typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); +typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access); +typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void* dxDevice); +typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void* dxObject, GLuint name, GLenum type, GLenum access); +typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void* dxObject, HANDLE shareHandle); +typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); +typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject); + +#define wglDXCloseDeviceNV WGLEW_GET_FUN(__wglewDXCloseDeviceNV) +#define wglDXLockObjectsNV WGLEW_GET_FUN(__wglewDXLockObjectsNV) +#define wglDXObjectAccessNV WGLEW_GET_FUN(__wglewDXObjectAccessNV) +#define wglDXOpenDeviceNV WGLEW_GET_FUN(__wglewDXOpenDeviceNV) +#define wglDXRegisterObjectNV WGLEW_GET_FUN(__wglewDXRegisterObjectNV) +#define wglDXSetResourceShareHandleNV WGLEW_GET_FUN(__wglewDXSetResourceShareHandleNV) +#define wglDXUnlockObjectsNV WGLEW_GET_FUN(__wglewDXUnlockObjectsNV) +#define wglDXUnregisterObjectNV WGLEW_GET_FUN(__wglewDXUnregisterObjectNV) + +#define WGLEW_NV_DX_interop WGLEW_GET_VAR(__WGLEW_NV_DX_interop) + +#endif /* WGL_NV_DX_interop */ + +/* --------------------------- WGL_NV_DX_interop2 -------------------------- */ + +#ifndef WGL_NV_DX_interop2 +#define WGL_NV_DX_interop2 1 + +#define WGLEW_NV_DX_interop2 WGLEW_GET_VAR(__WGLEW_NV_DX_interop2) + +#endif /* WGL_NV_DX_interop2 */ + +/* --------------------------- WGL_NV_copy_image --------------------------- */ + +#ifndef WGL_NV_copy_image +#define WGL_NV_copy_image 1 + +typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); + +#define wglCopyImageSubDataNV WGLEW_GET_FUN(__wglewCopyImageSubDataNV) + +#define WGLEW_NV_copy_image WGLEW_GET_VAR(__WGLEW_NV_copy_image) + +#endif /* WGL_NV_copy_image */ + +/* ------------------------ WGL_NV_delay_before_swap ----------------------- */ + +#ifndef WGL_NV_delay_before_swap +#define WGL_NV_delay_before_swap 1 + +typedef BOOL (WINAPI * PFNWGLDELAYBEFORESWAPNVPROC) (HDC hDC, GLfloat seconds); + +#define wglDelayBeforeSwapNV WGLEW_GET_FUN(__wglewDelayBeforeSwapNV) + +#define WGLEW_NV_delay_before_swap WGLEW_GET_VAR(__WGLEW_NV_delay_before_swap) + +#endif /* WGL_NV_delay_before_swap */ + /* -------------------------- WGL_NV_float_buffer -------------------------- */ #ifndef WGL_NV_float_buffer @@ -781,11 +998,11 @@ typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWO DECLARE_HANDLE(HGPUNV); typedef struct _GPU_DEVICE { - DWORD cb; - CHAR DeviceName[32]; - CHAR DeviceString[128]; - DWORD Flags; - RECT rcVirtualScreen; + DWORD cb; + CHAR DeviceName[32]; + CHAR DeviceString[128]; + DWORD Flags; + RECT rcVirtualScreen; } GPU_DEVICE, *PGPU_DEVICE; typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList); @@ -804,6 +1021,18 @@ typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu); #endif /* WGL_NV_gpu_affinity */ +/* ---------------------- WGL_NV_multisample_coverage ---------------------- */ + +#ifndef WGL_NV_multisample_coverage +#define WGL_NV_multisample_coverage 1 + +#define WGL_COVERAGE_SAMPLES_NV 0x2042 +#define WGL_COLOR_SAMPLES_NV 0x20B9 + +#define WGLEW_NV_multisample_coverage WGLEW_GET_VAR(__WGLEW_NV_multisample_coverage) + +#endif /* WGL_NV_multisample_coverage */ + /* -------------------------- WGL_NV_present_video ------------------------- */ #ifndef WGL_NV_present_video @@ -863,7 +1092,7 @@ typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrie typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group); typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint* count); typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint* maxGroups, GLuint *maxBarriers); -typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint* group); +typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint* group, GLuint *barrier); typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC); #define wglBindSwapBarrierNV WGLEW_GET_FUN(__wglewBindSwapBarrierNV) @@ -892,6 +1121,32 @@ typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer); #endif /* WGL_NV_vertex_array_range */ +/* -------------------------- WGL_NV_video_capture ------------------------- */ + +#ifndef WGL_NV_video_capture +#define WGL_NV_video_capture 1 + +#define WGL_UNIQUE_ID_NV 0x20CE +#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF + +DECLARE_HANDLE(HVIDEOINPUTDEVICENV); + +typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice); +typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV* phDeviceList); +typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); + +#define wglBindVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewBindVideoCaptureDeviceNV) +#define wglEnumerateVideoCaptureDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoCaptureDevicesNV) +#define wglLockVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewLockVideoCaptureDeviceNV) +#define wglQueryVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewQueryVideoCaptureDeviceNV) +#define wglReleaseVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoCaptureDeviceNV) + +#define WGLEW_NV_video_capture WGLEW_GET_VAR(__WGLEW_NV_video_capture) + +#endif /* WGL_NV_video_capture */ + /* -------------------------- WGL_NV_video_output -------------------------- */ #ifndef WGL_NV_video_output @@ -956,210 +1211,229 @@ typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT6 /* ------------------------------------------------------------------------- */ -#ifdef GLEW_MX -#define WGLEW_EXPORT -#else -#define WGLEW_EXPORT GLEWAPI -#endif /* GLEW_MX */ +#define WGLEW_FUN_EXPORT GLEW_FUN_EXPORT +#define WGLEW_VAR_EXPORT GLEW_VAR_EXPORT -#ifdef GLEW_MX -struct WGLEWContextStruct -{ -#endif /* GLEW_MX */ +WGLEW_FUN_EXPORT PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL; -WGLEW_EXPORT PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL; +WGLEW_FUN_EXPORT PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD; +WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD; +WGLEW_FUN_EXPORT PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD; +WGLEW_FUN_EXPORT PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD; +WGLEW_FUN_EXPORT PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD; +WGLEW_FUN_EXPORT PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD; -WGLEW_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB; -WGLEW_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB; -WGLEW_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB; -WGLEW_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB; -WGLEW_EXPORT PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB; +WGLEW_FUN_EXPORT PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB; -WGLEW_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB; +WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB; -WGLEW_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB; -WGLEW_EXPORT PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB; +WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB; +WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB; -WGLEW_EXPORT PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB; -WGLEW_EXPORT PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB; -WGLEW_EXPORT PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB; -WGLEW_EXPORT PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB; -WGLEW_EXPORT PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB; +WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB; +WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB; +WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB; +WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB; +WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB; -WGLEW_EXPORT PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB; -WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB; -WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB; +WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB; -WGLEW_EXPORT PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB; -WGLEW_EXPORT PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB; -WGLEW_EXPORT PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB; +WGLEW_FUN_EXPORT PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB; +WGLEW_FUN_EXPORT PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB; +WGLEW_FUN_EXPORT PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB; -WGLEW_EXPORT PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT; -WGLEW_EXPORT PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT; -WGLEW_EXPORT PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT; -WGLEW_EXPORT PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT; -WGLEW_EXPORT PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT; +WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT; -WGLEW_EXPORT PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT; -WGLEW_EXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT; +WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT; +WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT; -WGLEW_EXPORT PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT; -WGLEW_EXPORT PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT; -WGLEW_EXPORT PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT; -WGLEW_EXPORT PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT; -WGLEW_EXPORT PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT; +WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT; +WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT; +WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT; +WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT; +WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT; -WGLEW_EXPORT PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT; -WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT; -WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT; +WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT; -WGLEW_EXPORT PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT; -WGLEW_EXPORT PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT; +WGLEW_FUN_EXPORT PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT; +WGLEW_FUN_EXPORT PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT; -WGLEW_EXPORT PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D; -WGLEW_EXPORT PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D; +WGLEW_FUN_EXPORT PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D; +WGLEW_FUN_EXPORT PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D; -WGLEW_EXPORT PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D; -WGLEW_EXPORT PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D; -WGLEW_EXPORT PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D; -WGLEW_EXPORT PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D; +WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D; +WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D; +WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D; +WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D; -WGLEW_EXPORT PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D; -WGLEW_EXPORT PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D; -WGLEW_EXPORT PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D; -WGLEW_EXPORT PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D; -WGLEW_EXPORT PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D; -WGLEW_EXPORT PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D; -WGLEW_EXPORT PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D; -WGLEW_EXPORT PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D; -WGLEW_EXPORT PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D; -WGLEW_EXPORT PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D; -WGLEW_EXPORT PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D; -WGLEW_EXPORT PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D; +WGLEW_FUN_EXPORT PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D; +WGLEW_FUN_EXPORT PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D; -WGLEW_EXPORT PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D; -WGLEW_EXPORT PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D; -WGLEW_EXPORT PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D; -WGLEW_EXPORT PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D; +WGLEW_FUN_EXPORT PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D; +WGLEW_FUN_EXPORT PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D; +WGLEW_FUN_EXPORT PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D; +WGLEW_FUN_EXPORT PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D; -WGLEW_EXPORT PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D; -WGLEW_EXPORT PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D; -WGLEW_EXPORT PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D; -WGLEW_EXPORT PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D; +WGLEW_FUN_EXPORT PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D; -WGLEW_EXPORT PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D; -WGLEW_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D; -WGLEW_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D; -WGLEW_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D; +WGLEW_FUN_EXPORT PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D; +WGLEW_FUN_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D; +WGLEW_FUN_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D; -WGLEW_EXPORT PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV; -WGLEW_EXPORT PFNWGLDELETEDCNVPROC __wglewDeleteDCNV; -WGLEW_EXPORT PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV; -WGLEW_EXPORT PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV; -WGLEW_EXPORT PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV; +WGLEW_FUN_EXPORT PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV; +WGLEW_FUN_EXPORT PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV; +WGLEW_FUN_EXPORT PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV; +WGLEW_FUN_EXPORT PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV; +WGLEW_FUN_EXPORT PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV; +WGLEW_FUN_EXPORT PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV; +WGLEW_FUN_EXPORT PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV; +WGLEW_FUN_EXPORT PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV; -WGLEW_EXPORT PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV; -WGLEW_EXPORT PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV; -WGLEW_EXPORT PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV; +WGLEW_FUN_EXPORT PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV; -WGLEW_EXPORT PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV; -WGLEW_EXPORT PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV; -WGLEW_EXPORT PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV; -WGLEW_EXPORT PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV; -WGLEW_EXPORT PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV; -WGLEW_EXPORT PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV; +WGLEW_FUN_EXPORT PFNWGLDELAYBEFORESWAPNVPROC __wglewDelayBeforeSwapNV; -WGLEW_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV; -WGLEW_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV; +WGLEW_FUN_EXPORT PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV; +WGLEW_FUN_EXPORT PFNWGLDELETEDCNVPROC __wglewDeleteDCNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV; -WGLEW_EXPORT PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV; -WGLEW_EXPORT PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV; -WGLEW_EXPORT PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV; -WGLEW_EXPORT PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV; -WGLEW_EXPORT PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV; -WGLEW_EXPORT PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV; +WGLEW_FUN_EXPORT PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV; +WGLEW_FUN_EXPORT PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV; -WGLEW_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML; -WGLEW_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML; -WGLEW_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML; -WGLEW_EXPORT PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML; -WGLEW_EXPORT PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML; -WGLEW_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML; -WGLEW_EXPORT GLboolean __WGLEW_3DFX_multisample; -WGLEW_EXPORT GLboolean __WGLEW_3DL_stereo_control; -WGLEW_EXPORT GLboolean __WGLEW_ARB_buffer_region; -WGLEW_EXPORT GLboolean __WGLEW_ARB_create_context; -WGLEW_EXPORT GLboolean __WGLEW_ARB_extensions_string; -WGLEW_EXPORT GLboolean __WGLEW_ARB_framebuffer_sRGB; -WGLEW_EXPORT GLboolean __WGLEW_ARB_make_current_read; -WGLEW_EXPORT GLboolean __WGLEW_ARB_multisample; -WGLEW_EXPORT GLboolean __WGLEW_ARB_pbuffer; -WGLEW_EXPORT GLboolean __WGLEW_ARB_pixel_format; -WGLEW_EXPORT GLboolean __WGLEW_ARB_pixel_format_float; -WGLEW_EXPORT GLboolean __WGLEW_ARB_render_texture; -WGLEW_EXPORT GLboolean __WGLEW_ATI_pixel_format_float; -WGLEW_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle; -WGLEW_EXPORT GLboolean __WGLEW_EXT_depth_float; -WGLEW_EXPORT GLboolean __WGLEW_EXT_display_color_table; -WGLEW_EXPORT GLboolean __WGLEW_EXT_extensions_string; -WGLEW_EXPORT GLboolean __WGLEW_EXT_framebuffer_sRGB; -WGLEW_EXPORT GLboolean __WGLEW_EXT_make_current_read; -WGLEW_EXPORT GLboolean __WGLEW_EXT_multisample; -WGLEW_EXPORT GLboolean __WGLEW_EXT_pbuffer; -WGLEW_EXPORT GLboolean __WGLEW_EXT_pixel_format; -WGLEW_EXPORT GLboolean __WGLEW_EXT_pixel_format_packed_float; -WGLEW_EXPORT GLboolean __WGLEW_EXT_swap_control; -WGLEW_EXPORT GLboolean __WGLEW_I3D_digital_video_control; -WGLEW_EXPORT GLboolean __WGLEW_I3D_gamma; -WGLEW_EXPORT GLboolean __WGLEW_I3D_genlock; -WGLEW_EXPORT GLboolean __WGLEW_I3D_image_buffer; -WGLEW_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock; -WGLEW_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage; -WGLEW_EXPORT GLboolean __WGLEW_NV_float_buffer; -WGLEW_EXPORT GLboolean __WGLEW_NV_gpu_affinity; -WGLEW_EXPORT GLboolean __WGLEW_NV_present_video; -WGLEW_EXPORT GLboolean __WGLEW_NV_render_depth_texture; -WGLEW_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle; -WGLEW_EXPORT GLboolean __WGLEW_NV_swap_group; -WGLEW_EXPORT GLboolean __WGLEW_NV_vertex_array_range; -WGLEW_EXPORT GLboolean __WGLEW_NV_video_output; -WGLEW_EXPORT GLboolean __WGLEW_OML_sync_control; +WGLEW_FUN_EXPORT PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV; +WGLEW_FUN_EXPORT PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV; +WGLEW_FUN_EXPORT PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV; +WGLEW_FUN_EXPORT PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV; +WGLEW_FUN_EXPORT PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV; -#ifdef GLEW_MX -}; /* WGLEWContextStruct */ -#endif /* GLEW_MX */ +WGLEW_FUN_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV; +WGLEW_FUN_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV; +WGLEW_FUN_EXPORT PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV; +WGLEW_FUN_EXPORT PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV; + +WGLEW_FUN_EXPORT PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV; +WGLEW_FUN_EXPORT PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV; +WGLEW_FUN_EXPORT PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV; + +WGLEW_FUN_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML; +WGLEW_FUN_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML; +WGLEW_FUN_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML; +WGLEW_FUN_EXPORT PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML; +WGLEW_FUN_EXPORT PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML; +WGLEW_FUN_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML; +WGLEW_VAR_EXPORT GLboolean __WGLEW_3DFX_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_3DL_stereo_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_AMD_gpu_association; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_buffer_region; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_context_flush_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_no_error; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_robustness; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_extensions_string; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_framebuffer_sRGB; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_make_current_read; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pbuffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_render_texture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_application_isolation; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_share_group_isolation; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_pixel_format_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_colorspace; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es2_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_depth_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_display_color_table; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_extensions_string; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_framebuffer_sRGB; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_make_current_read; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pbuffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format_packed_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control_tear; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_digital_video_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_gamma; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_genlock; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_image_buffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop2; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_copy_image; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_delay_before_swap; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_float_buffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_gpu_affinity; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_multisample_coverage; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_present_video; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_depth_texture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_swap_group; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_vertex_array_range; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_capture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_output; +WGLEW_VAR_EXPORT GLboolean __WGLEW_OML_sync_control; /* ------------------------------------------------------------------------- */ -#ifdef GLEW_MX - -typedef struct WGLEWContextStruct WGLEWContext; -GLEWAPI GLenum wglewContextInit (WGLEWContext* ctx); -GLEWAPI GLboolean wglewContextIsSupported (WGLEWContext* ctx, const char* name); - -#define wglewInit() wglewContextInit(wglewGetContext()) -#define wglewIsSupported(x) wglewContextIsSupported(wglewGetContext(), x) - -#define WGLEW_GET_VAR(x) (*(const GLboolean*)&(wglewGetContext()->x)) -#define WGLEW_GET_FUN(x) wglewGetContext()->x - -#else /* GLEW_MX */ +GLEWAPI GLenum GLEWAPIENTRY wglewInit (); +GLEWAPI GLboolean GLEWAPIENTRY wglewIsSupported (const char *name); +#ifndef WGLEW_GET_VAR #define WGLEW_GET_VAR(x) (*(const GLboolean*)&x) -#define WGLEW_GET_FUN(x) x - -GLEWAPI GLboolean wglewIsSupported (const char* name); - -#endif /* GLEW_MX */ - -GLEWAPI GLboolean wglewGetExtension (const char* name); - -#ifdef __cplusplus -} #endif +#ifndef WGLEW_GET_FUN +#define WGLEW_GET_FUN(x) x +#endif + +GLEWAPI GLboolean GLEWAPIENTRY wglewGetExtension (const char *name); + #undef GLEWAPI #endif /* __wglew_h__ */ diff --git a/test_conformance/gl/GLEW/glew.c b/test_conformance/gl/GLEW/glew.c index 1100800a..9104b265 100644 --- a/test_conformance/gl/GLEW/glew.c +++ b/test_conformance/gl/GLEW/glew.c @@ -1,27 +1,28 @@ /* ** The OpenGL Extension Wrangler Library +** Copyright (C) 2008-2017, Nigel Stewart ** Copyright (C) 2002-2008, Milan Ikits ** Copyright (C) 2002-2008, Marcelo E. Magallon ** Copyright (C) 2002, Lev Povalahev ** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without +** +** 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, +** +** * 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 +** * 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. -** * The name of the author may be used to endorse or promote products +** * The name of the author 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 +** 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 +** 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) @@ -29,70 +30,52 @@ ** THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef GLEW_INCLUDE #include -#if defined(_WIN32) +#else +#include GLEW_INCLUDE +#endif + +#if defined(GLEW_OSMESA) +# define GLAPI extern +# include +#elif defined(GLEW_EGL) +# include +# include +#elif defined(_WIN32) +/* + * If NOGDI is defined, wingdi.h won't be included by windows.h, and thus + * wglGetProcAddress won't be declared. It will instead be implicitly declared, + * potentially incorrectly, which we don't want. + */ +# if defined(NOGDI) +# undef NOGDI +# endif # include -#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) +#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) # include #endif -/* - * Define glewGetContext and related helper macros. - */ -#ifdef GLEW_MX -# define glewGetContext() ctx -# ifdef _WIN32 -# define GLEW_CONTEXT_ARG_DEF_INIT GLEWContext* ctx -# define GLEW_CONTEXT_ARG_VAR_INIT ctx -# define wglewGetContext() ctx -# define WGLEW_CONTEXT_ARG_DEF_INIT WGLEWContext* ctx -# define WGLEW_CONTEXT_ARG_DEF_LIST WGLEWContext* ctx -# else /* _WIN32 */ -# define GLEW_CONTEXT_ARG_DEF_INIT void -# define GLEW_CONTEXT_ARG_VAR_INIT -# define glxewGetContext() ctx -# define GLXEW_CONTEXT_ARG_DEF_INIT void -# define GLXEW_CONTEXT_ARG_DEF_LIST GLXEWContext* ctx -# endif /* _WIN32 */ -# define GLEW_CONTEXT_ARG_DEF_LIST GLEWContext* ctx -#else /* GLEW_MX */ -# define GLEW_CONTEXT_ARG_DEF_INIT void -# define GLEW_CONTEXT_ARG_VAR_INIT -# define GLEW_CONTEXT_ARG_DEF_LIST void -# define WGLEW_CONTEXT_ARG_DEF_INIT void -# define WGLEW_CONTEXT_ARG_DEF_LIST void -# define GLXEW_CONTEXT_ARG_DEF_INIT void -# define GLXEW_CONTEXT_ARG_DEF_LIST void -#endif /* GLEW_MX */ +#include /* For size_t */ -#if defined(__APPLE__) -#include -#include -#include +#if defined(GLEW_EGL) +#elif defined(GLEW_REGAL) -void* NSGLGetProcAddress (const GLubyte *name) -{ - static const struct mach_header* image = NULL; - NSSymbol symbol; - char* symbolName; - if (NULL == image) - { - image = NSAddImage("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", NSADDIMAGE_OPTION_RETURN_ON_ERROR); - } - /* prepend a '_' for the Unix C symbol mangling convention */ - symbolName = malloc(strlen((const char*)name) + 2); - strcpy(symbolName+1, (const char*)name); - symbolName[0] = '_'; - symbol = NULL; - /* if (NSIsSymbolNameDefined(symbolName)) - symbol = NSLookupAndBindSymbol(symbolName); */ - symbol = image ? NSLookupSymbolInImage(image, symbolName, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) : NULL; - free(symbolName); - return symbol ? NSAddressOfSymbol(symbol) : NULL; -} -#endif /* __APPLE__ */ +/* In GLEW_REGAL mode we call direcly into the linked + libRegal.so glGetProcAddressREGAL for looking up + the GL function pointers. */ -#if defined(__sgi) || defined (__sun) +# undef glGetProcAddressREGAL +# ifdef WIN32 +extern void * __stdcall glGetProcAddressREGAL(const GLchar *name); +static void * (__stdcall * regalGetProcAddress) (const GLchar *) = glGetProcAddressREGAL; +# else +extern void * glGetProcAddressREGAL(const GLchar *name); +static void * (*regalGetProcAddress) (const GLchar *) = glGetProcAddressREGAL; +# endif +# define glGetProcAddressREGAL GLEW_GET_FUN(__glewGetProcAddressREGAL) + +#elif defined(__sgi) || defined (__sun) || defined(__HAIKU__) || defined(GLEW_APPLE_GLX) #include #include #include @@ -113,34 +96,116 @@ void* dlGetProcAddress (const GLubyte* name) else return dlsym(h, (const char*)name); } -#endif /* __sgi || __sun */ +#endif /* __sgi || __sun || GLEW_APPLE_GLX */ + +#if defined(__APPLE__) +#include +#include +#include + +#ifdef MAC_OS_X_VERSION_10_3 + +#include + +void* NSGLGetProcAddress (const GLubyte *name) +{ + static void* image = NULL; + void* addr; + if (NULL == image) + { + image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY); + } + if( !image ) return NULL; + addr = dlsym(image, (const char*)name); + if( addr ) return addr; +#ifdef GLEW_APPLE_GLX + return dlGetProcAddress( name ); // try next for glx symbols +#else + return NULL; +#endif +} +#else + +#include + +void* NSGLGetProcAddress (const GLubyte *name) +{ + static const struct mach_header* image = NULL; + NSSymbol symbol; + char* symbolName; + if (NULL == image) + { + image = NSAddImage("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", NSADDIMAGE_OPTION_RETURN_ON_ERROR); + } + /* prepend a '_' for the Unix C symbol mangling convention */ + symbolName = malloc(strlen((const char*)name) + 2); + strcpy(symbolName+1, (const char*)name); + symbolName[0] = '_'; + symbol = NULL; + /* if (NSIsSymbolNameDefined(symbolName)) + symbol = NSLookupAndBindSymbol(symbolName); */ + symbol = image ? NSLookupSymbolInImage(image, symbolName, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) : NULL; + free(symbolName); + if( symbol ) return NSAddressOfSymbol(symbol); +#ifdef GLEW_APPLE_GLX + return dlGetProcAddress( name ); // try next for glx symbols +#else + return NULL; +#endif +} +#endif /* MAC_OS_X_VERSION_10_3 */ +#endif /* __APPLE__ */ /* * Define glewGetProcAddress. */ -#if defined(_WIN32) +#if defined(GLEW_REGAL) +# define glewGetProcAddress(name) regalGetProcAddress((const GLchar *)name) +#elif defined(GLEW_OSMESA) +# define glewGetProcAddress(name) OSMesaGetProcAddress((const char *)name) +#elif defined(GLEW_EGL) +# define glewGetProcAddress(name) eglGetProcAddress((const char *)name) +#elif defined(_WIN32) # define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name) -#else -# if defined(__APPLE__) -# define glewGetProcAddress(name) NSGLGetProcAddress(name) -# else -# if defined(__sgi) || defined(__sun) -# define glewGetProcAddress(name) dlGetProcAddress(name) -# else /* __linux */ -# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name) -# endif -# endif +#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) +# define glewGetProcAddress(name) NSGLGetProcAddress(name) +#elif defined(__sgi) || defined(__sun) || defined(__HAIKU__) +# define glewGetProcAddress(name) dlGetProcAddress(name) +#elif defined(__ANDROID__) +# define glewGetProcAddress(name) NULL /* TODO */ +#elif defined(__native_client__) +# define glewGetProcAddress(name) NULL /* TODO */ +#else /* __linux */ +# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name) #endif /* - * Define GLboolean const cast. + * Redefine GLEW_GET_VAR etc without const cast */ -#define CONST_CAST(x) (*(GLboolean*)&x) + +#undef GLEW_GET_VAR +# define GLEW_GET_VAR(x) (x) + +#ifdef WGLEW_GET_VAR +# undef WGLEW_GET_VAR +# define WGLEW_GET_VAR(x) (x) +#endif /* WGLEW_GET_VAR */ + +#ifdef GLXEW_GET_VAR +# undef GLXEW_GET_VAR +# define GLXEW_GET_VAR(x) (x) +#endif /* GLXEW_GET_VAR */ + +#ifdef EGLEW_GET_VAR +# undef EGLEW_GET_VAR +# define EGLEW_GET_VAR(x) (x) +#endif /* EGLEW_GET_VAR */ /* * GLEW, just like OpenGL or GLU, does not rely on the standard C library. * These functions implement the functionality required in this file. */ + static GLuint _glewStrLen (const GLubyte* s) { GLuint i=0; @@ -154,9 +219,20 @@ static GLuint _glewStrCLen (const GLubyte* s, GLubyte c) GLuint i=0; if (s == NULL) return 0; while (s[i] != '\0' && s[i] != c) i++; - return s[i] == c ? i : 0; + return i; } +static GLuint _glewStrCopy(char *d, const char *s, char c) +{ + GLuint i=0; + if (s == NULL) return 0; + while (s[i] != '\0' && s[i] != c) { d[i] = s[i]; i++; } + d[i] = '\0'; + return i; +} + +#if !defined(GLEW_OSMESA) +#if !defined(__APPLE__) || defined(GLEW_APPLE_GLX) static GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n) { GLuint i=0; @@ -165,8 +241,10 @@ static GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n) while (i < n && a[i] != '\0' && b[i] != '\0' && a[i] == b[i]) i++; return i == n ? GL_TRUE : GL_FALSE; } +#endif +#endif -static GLboolean _glewStrSame1 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +static GLboolean _glewStrSame1 (const GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) { while (*na > 0 && (**a == ' ' || **a == '\n' || **a == '\r' || **a == '\t')) { @@ -179,15 +257,15 @@ static GLboolean _glewStrSame1 (GLubyte** a, GLuint* na, const GLubyte* b, GLuin while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; if(i == nb) { - *a = *a + nb; - *na = *na - nb; - return GL_TRUE; + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; } } return GL_FALSE; } -static GLboolean _glewStrSame2 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +static GLboolean _glewStrSame2 (const GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) { if(*na >= nb) { @@ -195,15 +273,15 @@ static GLboolean _glewStrSame2 (GLubyte** a, GLuint* na, const GLubyte* b, GLuin while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; if(i == nb) { - *a = *a + nb; - *na = *na - nb; - return GL_TRUE; + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; } } return GL_FALSE; } -static GLboolean _glewStrSame3 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +static GLboolean _glewStrSame3 (const GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) { if(*na >= nb) { @@ -219,7 +297,29 @@ static GLboolean _glewStrSame3 (GLubyte** a, GLuint* na, const GLubyte* b, GLuin return GL_FALSE; } -#if !defined(_WIN32) || !defined(GLEW_MX) +/* + * Search for name in the extensions string. Use of strstr() + * is not sufficient because extension names can be prefixes of + * other extension names. Could use strtok() but the constant + * string returned by glGetString might be in read-only memory. + */ +#if !defined(GLEW_OSMESA) +#if !defined(__APPLE__) || defined(GLEW_APPLE_GLX) +static GLboolean _glewSearchExtension (const char* name, const GLubyte *start, const GLubyte *end) +{ + const GLubyte* p; + GLuint len = _glewStrLen((const GLubyte*)name); + p = start; + while (p < end) + { + GLuint n = _glewStrCLen(p, ' '); + if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE; + p += n+1; + } + return GL_FALSE; +} +#endif +#endif PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D = NULL; PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements = NULL; @@ -442,8 +542,162 @@ PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv = NULL; PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv = NULL; PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv = NULL; +PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender = NULL; +PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback = NULL; +PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation = NULL; +PFNGLCLAMPCOLORPROC __glewClampColor = NULL; +PFNGLCLEARBUFFERFIPROC __glewClearBufferfi = NULL; +PFNGLCLEARBUFFERFVPROC __glewClearBufferfv = NULL; +PFNGLCLEARBUFFERIVPROC __glewClearBufferiv = NULL; +PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv = NULL; +PFNGLCOLORMASKIPROC __glewColorMaski = NULL; +PFNGLDISABLEIPROC __glewDisablei = NULL; +PFNGLENABLEIPROC __glewEnablei = NULL; +PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender = NULL; +PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback = NULL; +PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v = NULL; +PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation = NULL; +PFNGLGETSTRINGIPROC __glewGetStringi = NULL; +PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv = NULL; +PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv = NULL; +PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying = NULL; +PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv = NULL; +PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv = NULL; +PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv = NULL; +PFNGLISENABLEDIPROC __glewIsEnabledi = NULL; +PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv = NULL; +PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv = NULL; +PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings = NULL; +PFNGLUNIFORM1UIPROC __glewUniform1ui = NULL; +PFNGLUNIFORM1UIVPROC __glewUniform1uiv = NULL; +PFNGLUNIFORM2UIPROC __glewUniform2ui = NULL; +PFNGLUNIFORM2UIVPROC __glewUniform2uiv = NULL; +PFNGLUNIFORM3UIPROC __glewUniform3ui = NULL; +PFNGLUNIFORM3UIVPROC __glewUniform3uiv = NULL; +PFNGLUNIFORM4UIPROC __glewUniform4ui = NULL; +PFNGLUNIFORM4UIVPROC __glewUniform4uiv = NULL; +PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i = NULL; +PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv = NULL; +PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui = NULL; +PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv = NULL; +PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i = NULL; +PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv = NULL; +PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui = NULL; +PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv = NULL; +PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i = NULL; +PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv = NULL; +PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui = NULL; +PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv = NULL; +PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv = NULL; +PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i = NULL; +PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv = NULL; +PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv = NULL; +PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv = NULL; +PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui = NULL; +PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv = NULL; +PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv = NULL; +PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer = NULL; + +PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced = NULL; +PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced = NULL; +PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex = NULL; +PFNGLTEXBUFFERPROC __glewTexBuffer = NULL; + +PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture = NULL; +PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v = NULL; +PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v = NULL; + +PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor = NULL; + +PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei = NULL; +PFNGLBLENDEQUATIONIPROC __glewBlendEquationi = NULL; +PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei = NULL; +PFNGLBLENDFUNCIPROC __glewBlendFunci = NULL; +PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading = NULL; + +PFNGLGETGRAPHICSRESETSTATUSPROC __glewGetGraphicsResetStatus = NULL; +PFNGLGETNCOMPRESSEDTEXIMAGEPROC __glewGetnCompressedTexImage = NULL; +PFNGLGETNTEXIMAGEPROC __glewGetnTexImage = NULL; +PFNGLGETNUNIFORMDVPROC __glewGetnUniformdv = NULL; + +PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC __glewMultiDrawArraysIndirectCount = NULL; +PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC __glewMultiDrawElementsIndirectCount = NULL; +PFNGLSPECIALIZESHADERPROC __glewSpecializeShader = NULL; + PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX = NULL; +PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD = NULL; +PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD = NULL; +PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD = NULL; +PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD = NULL; + +PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD = NULL; +PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD = NULL; +PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD = NULL; +PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD = NULL; + +PFNGLFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC __glewFramebufferSamplePositionsfvAMD = NULL; +PFNGLGETFRAMEBUFFERPARAMETERFVAMDPROC __glewGetFramebufferParameterfvAMD = NULL; +PFNGLGETNAMEDFRAMEBUFFERPARAMETERFVAMDPROC __glewGetNamedFramebufferParameterfvAMD = NULL; +PFNGLNAMEDFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC __glewNamedFramebufferSamplePositionsfvAMD = NULL; + +PFNGLVERTEXATTRIBPARAMETERIAMDPROC __glewVertexAttribParameteriAMD = NULL; + +PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD = NULL; +PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD = NULL; + +PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD = NULL; +PFNGLGENNAMESAMDPROC __glewGenNamesAMD = NULL; +PFNGLISNAMEAMDPROC __glewIsNameAMD = NULL; + +PFNGLQUERYOBJECTPARAMETERUIAMDPROC __glewQueryObjectParameteruiAMD = NULL; + +PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD = NULL; +PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD = NULL; +PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD = NULL; +PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD = NULL; +PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD = NULL; +PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD = NULL; +PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD = NULL; +PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD = NULL; +PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD = NULL; +PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD = NULL; +PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD = NULL; + +PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD = NULL; + +PFNGLTEXSTORAGESPARSEAMDPROC __glewTexStorageSparseAMD = NULL; +PFNGLTEXTURESTORAGESPARSEAMDPROC __glewTextureStorageSparseAMD = NULL; + +PFNGLSTENCILOPVALUEAMDPROC __glewStencilOpValueAMD = NULL; + +PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD = NULL; +PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD = NULL; + +PFNGLBLITFRAMEBUFFERANGLEPROC __glewBlitFramebufferANGLE = NULL; + +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC __glewRenderbufferStorageMultisampleANGLE = NULL; + +PFNGLDRAWARRAYSINSTANCEDANGLEPROC __glewDrawArraysInstancedANGLE = NULL; +PFNGLDRAWELEMENTSINSTANCEDANGLEPROC __glewDrawElementsInstancedANGLE = NULL; +PFNGLVERTEXATTRIBDIVISORANGLEPROC __glewVertexAttribDivisorANGLE = NULL; + +PFNGLBEGINQUERYANGLEPROC __glewBeginQueryANGLE = NULL; +PFNGLDELETEQUERIESANGLEPROC __glewDeleteQueriesANGLE = NULL; +PFNGLENDQUERYANGLEPROC __glewEndQueryANGLE = NULL; +PFNGLGENQUERIESANGLEPROC __glewGenQueriesANGLE = NULL; +PFNGLGETQUERYOBJECTI64VANGLEPROC __glewGetQueryObjecti64vANGLE = NULL; +PFNGLGETQUERYOBJECTIVANGLEPROC __glewGetQueryObjectivANGLE = NULL; +PFNGLGETQUERYOBJECTUI64VANGLEPROC __glewGetQueryObjectui64vANGLE = NULL; +PFNGLGETQUERYOBJECTUIVANGLEPROC __glewGetQueryObjectuivANGLE = NULL; +PFNGLGETQUERYIVANGLEPROC __glewGetQueryivANGLE = NULL; +PFNGLISQUERYANGLEPROC __glewIsQueryANGLE = NULL; +PFNGLQUERYCOUNTERANGLEPROC __glewQueryCounterANGLE = NULL; + +PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC __glewGetTranslatedShaderSourceANGLE = NULL; + +PFNGLCOPYTEXTURELEVELSAPPLEPROC __glewCopyTextureLevelsAPPLE = NULL; + PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE = NULL; PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE = NULL; PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE = NULL; @@ -462,6 +716,21 @@ PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE = NULL; PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE = NULL; PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE = NULL; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC __glewRenderbufferStorageMultisampleAPPLE = NULL; +PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC __glewResolveMultisampleFramebufferAPPLE = NULL; + +PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE = NULL; +PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE = NULL; +PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE = NULL; + +PFNGLCLIENTWAITSYNCAPPLEPROC __glewClientWaitSyncAPPLE = NULL; +PFNGLDELETESYNCAPPLEPROC __glewDeleteSyncAPPLE = NULL; +PFNGLFENCESYNCAPPLEPROC __glewFenceSyncAPPLE = NULL; +PFNGLGETINTEGER64VAPPLEPROC __glewGetInteger64vAPPLE = NULL; +PFNGLGETSYNCIVAPPLEPROC __glewGetSyncivAPPLE = NULL; +PFNGLISSYNCAPPLEPROC __glewIsSyncAPPLE = NULL; +PFNGLWAITSYNCAPPLEPROC __glewWaitSyncAPPLE = NULL; + PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE = NULL; PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE = NULL; @@ -474,10 +743,287 @@ PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE = NULL; PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE = NULL; PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE = NULL; +PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE = NULL; +PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE = NULL; +PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE = NULL; +PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE = NULL; +PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE = NULL; +PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE = NULL; +PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE = NULL; + +PFNGLCLEARDEPTHFPROC __glewClearDepthf = NULL; +PFNGLDEPTHRANGEFPROC __glewDepthRangef = NULL; +PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat = NULL; +PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler = NULL; +PFNGLSHADERBINARYPROC __glewShaderBinary = NULL; + +PFNGLMEMORYBARRIERBYREGIONPROC __glewMemoryBarrierByRegion = NULL; + +PFNGLPRIMITIVEBOUNDINGBOXARBPROC __glewPrimitiveBoundingBoxARB = NULL; + +PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance = NULL; +PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance = NULL; +PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance = NULL; + +PFNGLGETIMAGEHANDLEARBPROC __glewGetImageHandleARB = NULL; +PFNGLGETTEXTUREHANDLEARBPROC __glewGetTextureHandleARB = NULL; +PFNGLGETTEXTURESAMPLERHANDLEARBPROC __glewGetTextureSamplerHandleARB = NULL; +PFNGLGETVERTEXATTRIBLUI64VARBPROC __glewGetVertexAttribLui64vARB = NULL; +PFNGLISIMAGEHANDLERESIDENTARBPROC __glewIsImageHandleResidentARB = NULL; +PFNGLISTEXTUREHANDLERESIDENTARBPROC __glewIsTextureHandleResidentARB = NULL; +PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC __glewMakeImageHandleNonResidentARB = NULL; +PFNGLMAKEIMAGEHANDLERESIDENTARBPROC __glewMakeImageHandleResidentARB = NULL; +PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC __glewMakeTextureHandleNonResidentARB = NULL; +PFNGLMAKETEXTUREHANDLERESIDENTARBPROC __glewMakeTextureHandleResidentARB = NULL; +PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC __glewProgramUniformHandleui64ARB = NULL; +PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC __glewProgramUniformHandleui64vARB = NULL; +PFNGLUNIFORMHANDLEUI64ARBPROC __glewUniformHandleui64ARB = NULL; +PFNGLUNIFORMHANDLEUI64VARBPROC __glewUniformHandleui64vARB = NULL; +PFNGLVERTEXATTRIBL1UI64ARBPROC __glewVertexAttribL1ui64ARB = NULL; +PFNGLVERTEXATTRIBL1UI64VARBPROC __glewVertexAttribL1ui64vARB = NULL; + +PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed = NULL; +PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex = NULL; + +PFNGLBUFFERSTORAGEPROC __glewBufferStorage = NULL; + +PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB = NULL; + +PFNGLCLEARBUFFERDATAPROC __glewClearBufferData = NULL; +PFNGLCLEARBUFFERSUBDATAPROC __glewClearBufferSubData = NULL; +PFNGLCLEARNAMEDBUFFERDATAEXTPROC __glewClearNamedBufferDataEXT = NULL; +PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC __glewClearNamedBufferSubDataEXT = NULL; + +PFNGLCLEARTEXIMAGEPROC __glewClearTexImage = NULL; +PFNGLCLEARTEXSUBIMAGEPROC __glewClearTexSubImage = NULL; + +PFNGLCLIPCONTROLPROC __glewClipControl = NULL; + PFNGLCLAMPCOLORARBPROC __glewClampColorARB = NULL; +PFNGLDISPATCHCOMPUTEPROC __glewDispatchCompute = NULL; +PFNGLDISPATCHCOMPUTEINDIRECTPROC __glewDispatchComputeIndirect = NULL; + +PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC __glewDispatchComputeGroupSizeARB = NULL; + +PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData = NULL; + +PFNGLCOPYIMAGESUBDATAPROC __glewCopyImageSubData = NULL; + +PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB = NULL; +PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB = NULL; +PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB = NULL; +PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB = NULL; + +PFNGLBINDTEXTUREUNITPROC __glewBindTextureUnit = NULL; +PFNGLBLITNAMEDFRAMEBUFFERPROC __glewBlitNamedFramebuffer = NULL; +PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC __glewCheckNamedFramebufferStatus = NULL; +PFNGLCLEARNAMEDBUFFERDATAPROC __glewClearNamedBufferData = NULL; +PFNGLCLEARNAMEDBUFFERSUBDATAPROC __glewClearNamedBufferSubData = NULL; +PFNGLCLEARNAMEDFRAMEBUFFERFIPROC __glewClearNamedFramebufferfi = NULL; +PFNGLCLEARNAMEDFRAMEBUFFERFVPROC __glewClearNamedFramebufferfv = NULL; +PFNGLCLEARNAMEDFRAMEBUFFERIVPROC __glewClearNamedFramebufferiv = NULL; +PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC __glewClearNamedFramebufferuiv = NULL; +PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC __glewCompressedTextureSubImage1D = NULL; +PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC __glewCompressedTextureSubImage2D = NULL; +PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC __glewCompressedTextureSubImage3D = NULL; +PFNGLCOPYNAMEDBUFFERSUBDATAPROC __glewCopyNamedBufferSubData = NULL; +PFNGLCOPYTEXTURESUBIMAGE1DPROC __glewCopyTextureSubImage1D = NULL; +PFNGLCOPYTEXTURESUBIMAGE2DPROC __glewCopyTextureSubImage2D = NULL; +PFNGLCOPYTEXTURESUBIMAGE3DPROC __glewCopyTextureSubImage3D = NULL; +PFNGLCREATEBUFFERSPROC __glewCreateBuffers = NULL; +PFNGLCREATEFRAMEBUFFERSPROC __glewCreateFramebuffers = NULL; +PFNGLCREATEPROGRAMPIPELINESPROC __glewCreateProgramPipelines = NULL; +PFNGLCREATEQUERIESPROC __glewCreateQueries = NULL; +PFNGLCREATERENDERBUFFERSPROC __glewCreateRenderbuffers = NULL; +PFNGLCREATESAMPLERSPROC __glewCreateSamplers = NULL; +PFNGLCREATETEXTURESPROC __glewCreateTextures = NULL; +PFNGLCREATETRANSFORMFEEDBACKSPROC __glewCreateTransformFeedbacks = NULL; +PFNGLCREATEVERTEXARRAYSPROC __glewCreateVertexArrays = NULL; +PFNGLDISABLEVERTEXARRAYATTRIBPROC __glewDisableVertexArrayAttrib = NULL; +PFNGLENABLEVERTEXARRAYATTRIBPROC __glewEnableVertexArrayAttrib = NULL; +PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC __glewFlushMappedNamedBufferRange = NULL; +PFNGLGENERATETEXTUREMIPMAPPROC __glewGenerateTextureMipmap = NULL; +PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC __glewGetCompressedTextureImage = NULL; +PFNGLGETNAMEDBUFFERPARAMETERI64VPROC __glewGetNamedBufferParameteri64v = NULL; +PFNGLGETNAMEDBUFFERPARAMETERIVPROC __glewGetNamedBufferParameteriv = NULL; +PFNGLGETNAMEDBUFFERPOINTERVPROC __glewGetNamedBufferPointerv = NULL; +PFNGLGETNAMEDBUFFERSUBDATAPROC __glewGetNamedBufferSubData = NULL; +PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetNamedFramebufferAttachmentParameteriv = NULL; +PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC __glewGetNamedFramebufferParameteriv = NULL; +PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC __glewGetNamedRenderbufferParameteriv = NULL; +PFNGLGETQUERYBUFFEROBJECTI64VPROC __glewGetQueryBufferObjecti64v = NULL; +PFNGLGETQUERYBUFFEROBJECTIVPROC __glewGetQueryBufferObjectiv = NULL; +PFNGLGETQUERYBUFFEROBJECTUI64VPROC __glewGetQueryBufferObjectui64v = NULL; +PFNGLGETQUERYBUFFEROBJECTUIVPROC __glewGetQueryBufferObjectuiv = NULL; +PFNGLGETTEXTUREIMAGEPROC __glewGetTextureImage = NULL; +PFNGLGETTEXTURELEVELPARAMETERFVPROC __glewGetTextureLevelParameterfv = NULL; +PFNGLGETTEXTURELEVELPARAMETERIVPROC __glewGetTextureLevelParameteriv = NULL; +PFNGLGETTEXTUREPARAMETERIIVPROC __glewGetTextureParameterIiv = NULL; +PFNGLGETTEXTUREPARAMETERIUIVPROC __glewGetTextureParameterIuiv = NULL; +PFNGLGETTEXTUREPARAMETERFVPROC __glewGetTextureParameterfv = NULL; +PFNGLGETTEXTUREPARAMETERIVPROC __glewGetTextureParameteriv = NULL; +PFNGLGETTRANSFORMFEEDBACKI64_VPROC __glewGetTransformFeedbacki64_v = NULL; +PFNGLGETTRANSFORMFEEDBACKI_VPROC __glewGetTransformFeedbacki_v = NULL; +PFNGLGETTRANSFORMFEEDBACKIVPROC __glewGetTransformFeedbackiv = NULL; +PFNGLGETVERTEXARRAYINDEXED64IVPROC __glewGetVertexArrayIndexed64iv = NULL; +PFNGLGETVERTEXARRAYINDEXEDIVPROC __glewGetVertexArrayIndexediv = NULL; +PFNGLGETVERTEXARRAYIVPROC __glewGetVertexArrayiv = NULL; +PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC __glewInvalidateNamedFramebufferData = NULL; +PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC __glewInvalidateNamedFramebufferSubData = NULL; +PFNGLMAPNAMEDBUFFERPROC __glewMapNamedBuffer = NULL; +PFNGLMAPNAMEDBUFFERRANGEPROC __glewMapNamedBufferRange = NULL; +PFNGLNAMEDBUFFERDATAPROC __glewNamedBufferData = NULL; +PFNGLNAMEDBUFFERSTORAGEPROC __glewNamedBufferStorage = NULL; +PFNGLNAMEDBUFFERSUBDATAPROC __glewNamedBufferSubData = NULL; +PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC __glewNamedFramebufferDrawBuffer = NULL; +PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC __glewNamedFramebufferDrawBuffers = NULL; +PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC __glewNamedFramebufferParameteri = NULL; +PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC __glewNamedFramebufferReadBuffer = NULL; +PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC __glewNamedFramebufferRenderbuffer = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTUREPROC __glewNamedFramebufferTexture = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC __glewNamedFramebufferTextureLayer = NULL; +PFNGLNAMEDRENDERBUFFERSTORAGEPROC __glewNamedRenderbufferStorage = NULL; +PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewNamedRenderbufferStorageMultisample = NULL; +PFNGLTEXTUREBUFFERPROC __glewTextureBuffer = NULL; +PFNGLTEXTUREBUFFERRANGEPROC __glewTextureBufferRange = NULL; +PFNGLTEXTUREPARAMETERIIVPROC __glewTextureParameterIiv = NULL; +PFNGLTEXTUREPARAMETERIUIVPROC __glewTextureParameterIuiv = NULL; +PFNGLTEXTUREPARAMETERFPROC __glewTextureParameterf = NULL; +PFNGLTEXTUREPARAMETERFVPROC __glewTextureParameterfv = NULL; +PFNGLTEXTUREPARAMETERIPROC __glewTextureParameteri = NULL; +PFNGLTEXTUREPARAMETERIVPROC __glewTextureParameteriv = NULL; +PFNGLTEXTURESTORAGE1DPROC __glewTextureStorage1D = NULL; +PFNGLTEXTURESTORAGE2DPROC __glewTextureStorage2D = NULL; +PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC __glewTextureStorage2DMultisample = NULL; +PFNGLTEXTURESTORAGE3DPROC __glewTextureStorage3D = NULL; +PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC __glewTextureStorage3DMultisample = NULL; +PFNGLTEXTURESUBIMAGE1DPROC __glewTextureSubImage1D = NULL; +PFNGLTEXTURESUBIMAGE2DPROC __glewTextureSubImage2D = NULL; +PFNGLTEXTURESUBIMAGE3DPROC __glewTextureSubImage3D = NULL; +PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC __glewTransformFeedbackBufferBase = NULL; +PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC __glewTransformFeedbackBufferRange = NULL; +PFNGLUNMAPNAMEDBUFFERPROC __glewUnmapNamedBuffer = NULL; +PFNGLVERTEXARRAYATTRIBBINDINGPROC __glewVertexArrayAttribBinding = NULL; +PFNGLVERTEXARRAYATTRIBFORMATPROC __glewVertexArrayAttribFormat = NULL; +PFNGLVERTEXARRAYATTRIBIFORMATPROC __glewVertexArrayAttribIFormat = NULL; +PFNGLVERTEXARRAYATTRIBLFORMATPROC __glewVertexArrayAttribLFormat = NULL; +PFNGLVERTEXARRAYBINDINGDIVISORPROC __glewVertexArrayBindingDivisor = NULL; +PFNGLVERTEXARRAYELEMENTBUFFERPROC __glewVertexArrayElementBuffer = NULL; +PFNGLVERTEXARRAYVERTEXBUFFERPROC __glewVertexArrayVertexBuffer = NULL; +PFNGLVERTEXARRAYVERTEXBUFFERSPROC __glewVertexArrayVertexBuffers = NULL; + PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB = NULL; +PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB = NULL; +PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB = NULL; +PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB = NULL; +PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB = NULL; + +PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex = NULL; +PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex = NULL; +PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex = NULL; +PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex = NULL; + +PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect = NULL; +PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect = NULL; + +PFNGLFRAMEBUFFERPARAMETERIPROC __glewFramebufferParameteri = NULL; +PFNGLGETFRAMEBUFFERPARAMETERIVPROC __glewGetFramebufferParameteriv = NULL; +PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC __glewGetNamedFramebufferParameterivEXT = NULL; +PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC __glewNamedFramebufferParameteriEXT = NULL; + +PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer = NULL; +PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer = NULL; +PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer = NULL; +PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus = NULL; +PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers = NULL; +PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers = NULL; +PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer = NULL; +PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D = NULL; +PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D = NULL; +PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D = NULL; +PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer = NULL; +PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers = NULL; +PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers = NULL; +PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap = NULL; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv = NULL; +PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv = NULL; +PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer = NULL; +PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer = NULL; +PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage = NULL; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample = NULL; + +PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB = NULL; +PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB = NULL; +PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB = NULL; +PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB = NULL; + +PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary = NULL; +PFNGLPROGRAMBINARYPROC __glewProgramBinary = NULL; +PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri = NULL; + +PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC __glewGetCompressedTextureSubImage = NULL; +PFNGLGETTEXTURESUBIMAGEPROC __glewGetTextureSubImage = NULL; + +PFNGLSPECIALIZESHADERARBPROC __glewSpecializeShaderARB = NULL; + +PFNGLGETUNIFORMDVPROC __glewGetUniformdv = NULL; +PFNGLUNIFORM1DPROC __glewUniform1d = NULL; +PFNGLUNIFORM1DVPROC __glewUniform1dv = NULL; +PFNGLUNIFORM2DPROC __glewUniform2d = NULL; +PFNGLUNIFORM2DVPROC __glewUniform2dv = NULL; +PFNGLUNIFORM3DPROC __glewUniform3d = NULL; +PFNGLUNIFORM3DVPROC __glewUniform3dv = NULL; +PFNGLUNIFORM4DPROC __glewUniform4d = NULL; +PFNGLUNIFORM4DVPROC __glewUniform4dv = NULL; +PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv = NULL; +PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv = NULL; +PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv = NULL; +PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv = NULL; +PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv = NULL; +PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv = NULL; +PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv = NULL; +PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv = NULL; +PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv = NULL; + +PFNGLGETUNIFORMI64VARBPROC __glewGetUniformi64vARB = NULL; +PFNGLGETUNIFORMUI64VARBPROC __glewGetUniformui64vARB = NULL; +PFNGLGETNUNIFORMI64VARBPROC __glewGetnUniformi64vARB = NULL; +PFNGLGETNUNIFORMUI64VARBPROC __glewGetnUniformui64vARB = NULL; +PFNGLPROGRAMUNIFORM1I64ARBPROC __glewProgramUniform1i64ARB = NULL; +PFNGLPROGRAMUNIFORM1I64VARBPROC __glewProgramUniform1i64vARB = NULL; +PFNGLPROGRAMUNIFORM1UI64ARBPROC __glewProgramUniform1ui64ARB = NULL; +PFNGLPROGRAMUNIFORM1UI64VARBPROC __glewProgramUniform1ui64vARB = NULL; +PFNGLPROGRAMUNIFORM2I64ARBPROC __glewProgramUniform2i64ARB = NULL; +PFNGLPROGRAMUNIFORM2I64VARBPROC __glewProgramUniform2i64vARB = NULL; +PFNGLPROGRAMUNIFORM2UI64ARBPROC __glewProgramUniform2ui64ARB = NULL; +PFNGLPROGRAMUNIFORM2UI64VARBPROC __glewProgramUniform2ui64vARB = NULL; +PFNGLPROGRAMUNIFORM3I64ARBPROC __glewProgramUniform3i64ARB = NULL; +PFNGLPROGRAMUNIFORM3I64VARBPROC __glewProgramUniform3i64vARB = NULL; +PFNGLPROGRAMUNIFORM3UI64ARBPROC __glewProgramUniform3ui64ARB = NULL; +PFNGLPROGRAMUNIFORM3UI64VARBPROC __glewProgramUniform3ui64vARB = NULL; +PFNGLPROGRAMUNIFORM4I64ARBPROC __glewProgramUniform4i64ARB = NULL; +PFNGLPROGRAMUNIFORM4I64VARBPROC __glewProgramUniform4i64vARB = NULL; +PFNGLPROGRAMUNIFORM4UI64ARBPROC __glewProgramUniform4ui64ARB = NULL; +PFNGLPROGRAMUNIFORM4UI64VARBPROC __glewProgramUniform4ui64vARB = NULL; +PFNGLUNIFORM1I64ARBPROC __glewUniform1i64ARB = NULL; +PFNGLUNIFORM1I64VARBPROC __glewUniform1i64vARB = NULL; +PFNGLUNIFORM1UI64ARBPROC __glewUniform1ui64ARB = NULL; +PFNGLUNIFORM1UI64VARBPROC __glewUniform1ui64vARB = NULL; +PFNGLUNIFORM2I64ARBPROC __glewUniform2i64ARB = NULL; +PFNGLUNIFORM2I64VARBPROC __glewUniform2i64vARB = NULL; +PFNGLUNIFORM2UI64ARBPROC __glewUniform2ui64ARB = NULL; +PFNGLUNIFORM2UI64VARBPROC __glewUniform2ui64vARB = NULL; +PFNGLUNIFORM3I64ARBPROC __glewUniform3i64ARB = NULL; +PFNGLUNIFORM3I64VARBPROC __glewUniform3i64vARB = NULL; +PFNGLUNIFORM3UI64ARBPROC __glewUniform3ui64ARB = NULL; +PFNGLUNIFORM3UI64VARBPROC __glewUniform3ui64vARB = NULL; +PFNGLUNIFORM4I64ARBPROC __glewUniform4i64ARB = NULL; +PFNGLUNIFORM4I64VARBPROC __glewUniform4i64vARB = NULL; +PFNGLUNIFORM4UI64ARBPROC __glewUniform4ui64ARB = NULL; +PFNGLUNIFORM4UI64VARBPROC __glewUniform4ui64vARB = NULL; + PFNGLCOLORSUBTABLEPROC __glewColorSubTable = NULL; PFNGLCOLORTABLEPROC __glewColorTable = NULL; PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv = NULL; @@ -511,12 +1057,43 @@ PFNGLRESETHISTOGRAMPROC __glewResetHistogram = NULL; PFNGLRESETMINMAXPROC __glewResetMinmax = NULL; PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D = NULL; +PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC __glewMultiDrawArraysIndirectCountARB = NULL; +PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC __glewMultiDrawElementsIndirectCountARB = NULL; + +PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB = NULL; +PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB = NULL; +PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB = NULL; + +PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ = NULL; + +PFNGLGETINTERNALFORMATI64VPROC __glewGetInternalformati64v = NULL; + +PFNGLINVALIDATEBUFFERDATAPROC __glewInvalidateBufferData = NULL; +PFNGLINVALIDATEBUFFERSUBDATAPROC __glewInvalidateBufferSubData = NULL; +PFNGLINVALIDATEFRAMEBUFFERPROC __glewInvalidateFramebuffer = NULL; +PFNGLINVALIDATESUBFRAMEBUFFERPROC __glewInvalidateSubFramebuffer = NULL; +PFNGLINVALIDATETEXIMAGEPROC __glewInvalidateTexImage = NULL; +PFNGLINVALIDATETEXSUBIMAGEPROC __glewInvalidateTexSubImage = NULL; + +PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange = NULL; +PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange = NULL; + PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB = NULL; PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB = NULL; PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB = NULL; PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB = NULL; PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB = NULL; +PFNGLBINDBUFFERSBASEPROC __glewBindBuffersBase = NULL; +PFNGLBINDBUFFERSRANGEPROC __glewBindBuffersRange = NULL; +PFNGLBINDIMAGETEXTURESPROC __glewBindImageTextures = NULL; +PFNGLBINDSAMPLERSPROC __glewBindSamplers = NULL; +PFNGLBINDTEXTURESPROC __glewBindTextures = NULL; +PFNGLBINDVERTEXBUFFERSPROC __glewBindVertexBuffers = NULL; + +PFNGLMULTIDRAWARRAYSINDIRECTPROC __glewMultiDrawArraysIndirect = NULL; +PFNGLMULTIDRAWELEMENTSINDIRECTPROC __glewMultiDrawElementsIndirect = NULL; + PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB = NULL; PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB = NULL; @@ -563,9 +1140,129 @@ PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB = NULL; PFNGLGETQUERYIVARBPROC __glewGetQueryivARB = NULL; PFNGLISQUERYARBPROC __glewIsQueryARB = NULL; +PFNGLMAXSHADERCOMPILERTHREADSARBPROC __glewMaxShaderCompilerThreadsARB = NULL; + PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB = NULL; PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB = NULL; +PFNGLPOLYGONOFFSETCLAMPPROC __glewPolygonOffsetClamp = NULL; + +PFNGLGETPROGRAMINTERFACEIVPROC __glewGetProgramInterfaceiv = NULL; +PFNGLGETPROGRAMRESOURCEINDEXPROC __glewGetProgramResourceIndex = NULL; +PFNGLGETPROGRAMRESOURCELOCATIONPROC __glewGetProgramResourceLocation = NULL; +PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC __glewGetProgramResourceLocationIndex = NULL; +PFNGLGETPROGRAMRESOURCENAMEPROC __glewGetProgramResourceName = NULL; +PFNGLGETPROGRAMRESOURCEIVPROC __glewGetProgramResourceiv = NULL; + +PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex = NULL; + +PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB = NULL; +PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB = NULL; +PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB = NULL; +PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB = NULL; +PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB = NULL; +PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB = NULL; +PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB = NULL; +PFNGLGETNMAPIVARBPROC __glewGetnMapivARB = NULL; +PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB = NULL; +PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB = NULL; +PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB = NULL; +PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB = NULL; +PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB = NULL; +PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB = NULL; +PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB = NULL; +PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB = NULL; +PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB = NULL; +PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB = NULL; +PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB = NULL; +PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB = NULL; + +PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC __glewFramebufferSampleLocationsfvARB = NULL; +PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC __glewNamedFramebufferSampleLocationsfvARB = NULL; + +PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB = NULL; + +PFNGLBINDSAMPLERPROC __glewBindSampler = NULL; +PFNGLDELETESAMPLERSPROC __glewDeleteSamplers = NULL; +PFNGLGENSAMPLERSPROC __glewGenSamplers = NULL; +PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv = NULL; +PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv = NULL; +PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv = NULL; +PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv = NULL; +PFNGLISSAMPLERPROC __glewIsSampler = NULL; +PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv = NULL; +PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv = NULL; +PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf = NULL; +PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv = NULL; +PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri = NULL; +PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv = NULL; + +PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram = NULL; +PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline = NULL; +PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv = NULL; +PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines = NULL; +PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines = NULL; +PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog = NULL; +PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv = NULL; +PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline = NULL; +PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d = NULL; +PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv = NULL; +PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f = NULL; +PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv = NULL; +PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i = NULL; +PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv = NULL; +PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui = NULL; +PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv = NULL; +PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d = NULL; +PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv = NULL; +PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f = NULL; +PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv = NULL; +PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i = NULL; +PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv = NULL; +PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui = NULL; +PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv = NULL; +PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d = NULL; +PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv = NULL; +PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f = NULL; +PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv = NULL; +PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i = NULL; +PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv = NULL; +PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui = NULL; +PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv = NULL; +PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d = NULL; +PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv = NULL; +PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f = NULL; +PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv = NULL; +PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i = NULL; +PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv = NULL; +PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui = NULL; +PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv = NULL; +PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages = NULL; +PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline = NULL; + +PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv = NULL; + +PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture = NULL; +PFNGLMEMORYBARRIERPROC __glewMemoryBarrier = NULL; + PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB = NULL; PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB = NULL; PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB = NULL; @@ -606,6 +1303,46 @@ PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB = NULL; PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB = NULL; PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB = NULL; +PFNGLSHADERSTORAGEBLOCKBINDINGPROC __glewShaderStorageBlockBinding = NULL; + +PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName = NULL; +PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName = NULL; +PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv = NULL; +PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv = NULL; +PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex = NULL; +PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation = NULL; +PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv = NULL; +PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv = NULL; + +PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB = NULL; +PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB = NULL; +PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB = NULL; +PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB = NULL; +PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB = NULL; +PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB = NULL; + +PFNGLBUFFERPAGECOMMITMENTARBPROC __glewBufferPageCommitmentARB = NULL; + +PFNGLTEXPAGECOMMITMENTARBPROC __glewTexPageCommitmentARB = NULL; + +PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync = NULL; +PFNGLDELETESYNCPROC __glewDeleteSync = NULL; +PFNGLFENCESYNCPROC __glewFenceSync = NULL; +PFNGLGETINTEGER64VPROC __glewGetInteger64v = NULL; +PFNGLGETSYNCIVPROC __glewGetSynciv = NULL; +PFNGLISSYNCPROC __glewIsSync = NULL; +PFNGLWAITSYNCPROC __glewWaitSync = NULL; + +PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv = NULL; +PFNGLPATCHPARAMETERIPROC __glewPatchParameteri = NULL; + +PFNGLTEXTUREBARRIERPROC __glewTextureBarrier = NULL; + +PFNGLTEXBUFFERARBPROC __glewTexBufferARB = NULL; + +PFNGLTEXBUFFERRANGEPROC __glewTexBufferRange = NULL; +PFNGLTEXTUREBUFFERRANGEEXTPROC __glewTextureBufferRangeEXT = NULL; + PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB = NULL; PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB = NULL; PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB = NULL; @@ -614,11 +1351,87 @@ PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB = NULL; PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB = NULL; PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB = NULL; +PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv = NULL; +PFNGLSAMPLEMASKIPROC __glewSampleMaski = NULL; +PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample = NULL; +PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample = NULL; + +PFNGLTEXSTORAGE1DPROC __glewTexStorage1D = NULL; +PFNGLTEXSTORAGE2DPROC __glewTexStorage2D = NULL; +PFNGLTEXSTORAGE3DPROC __glewTexStorage3D = NULL; + +PFNGLTEXSTORAGE2DMULTISAMPLEPROC __glewTexStorage2DMultisample = NULL; +PFNGLTEXSTORAGE3DMULTISAMPLEPROC __glewTexStorage3DMultisample = NULL; +PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC __glewTextureStorage2DMultisampleEXT = NULL; +PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC __glewTextureStorage3DMultisampleEXT = NULL; + +PFNGLTEXTUREVIEWPROC __glewTextureView = NULL; + +PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v = NULL; +PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v = NULL; +PFNGLQUERYCOUNTERPROC __glewQueryCounter = NULL; + +PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback = NULL; +PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks = NULL; +PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback = NULL; +PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks = NULL; +PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback = NULL; +PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback = NULL; +PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback = NULL; + +PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed = NULL; +PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream = NULL; +PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed = NULL; +PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv = NULL; + +PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced = NULL; +PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced = NULL; + PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB = NULL; PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB = NULL; PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB = NULL; PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB = NULL; +PFNGLBINDBUFFERBASEPROC __glewBindBufferBase = NULL; +PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange = NULL; +PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName = NULL; +PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv = NULL; +PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName = NULL; +PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv = NULL; +PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v = NULL; +PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex = NULL; +PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices = NULL; +PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding = NULL; + +PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray = NULL; +PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays = NULL; +PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays = NULL; +PFNGLISVERTEXARRAYPROC __glewIsVertexArray = NULL; + +PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv = NULL; +PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d = NULL; +PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv = NULL; +PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d = NULL; +PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv = NULL; +PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d = NULL; +PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv = NULL; +PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d = NULL; +PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv = NULL; +PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer = NULL; + +PFNGLBINDVERTEXBUFFERPROC __glewBindVertexBuffer = NULL; +PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC __glewVertexArrayBindVertexBufferEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC __glewVertexArrayVertexAttribBindingEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC __glewVertexArrayVertexAttribFormatEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC __glewVertexArrayVertexAttribIFormatEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC __glewVertexArrayVertexAttribLFormatEXT = NULL; +PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC __glewVertexArrayVertexBindingDivisorEXT = NULL; +PFNGLVERTEXATTRIBBINDINGPROC __glewVertexAttribBinding = NULL; +PFNGLVERTEXATTRIBFORMATPROC __glewVertexAttribFormat = NULL; +PFNGLVERTEXATTRIBIFORMATPROC __glewVertexAttribIFormat = NULL; +PFNGLVERTEXATTRIBLFORMATPROC __glewVertexAttribLFormat = NULL; +PFNGLVERTEXBINDINGDIVISORPROC __glewVertexBindingDivisor = NULL; + PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB = NULL; PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB = NULL; PFNGLWEIGHTBVARBPROC __glewWeightbvARB = NULL; @@ -709,6 +1522,56 @@ PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB = NULL; PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB = NULL; PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB = NULL; +PFNGLCOLORP3UIPROC __glewColorP3ui = NULL; +PFNGLCOLORP3UIVPROC __glewColorP3uiv = NULL; +PFNGLCOLORP4UIPROC __glewColorP4ui = NULL; +PFNGLCOLORP4UIVPROC __glewColorP4uiv = NULL; +PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui = NULL; +PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv = NULL; +PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui = NULL; +PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv = NULL; +PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui = NULL; +PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv = NULL; +PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui = NULL; +PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv = NULL; +PFNGLNORMALP3UIPROC __glewNormalP3ui = NULL; +PFNGLNORMALP3UIVPROC __glewNormalP3uiv = NULL; +PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui = NULL; +PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv = NULL; +PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui = NULL; +PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv = NULL; +PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui = NULL; +PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv = NULL; +PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui = NULL; +PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv = NULL; +PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui = NULL; +PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv = NULL; +PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui = NULL; +PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv = NULL; +PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui = NULL; +PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv = NULL; +PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui = NULL; +PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv = NULL; +PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui = NULL; +PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv = NULL; +PFNGLVERTEXP2UIPROC __glewVertexP2ui = NULL; +PFNGLVERTEXP2UIVPROC __glewVertexP2uiv = NULL; +PFNGLVERTEXP3UIPROC __glewVertexP3ui = NULL; +PFNGLVERTEXP3UIVPROC __glewVertexP3uiv = NULL; +PFNGLVERTEXP4UIPROC __glewVertexP4ui = NULL; +PFNGLVERTEXP4UIVPROC __glewVertexP4uiv = NULL; + +PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv = NULL; +PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed = NULL; +PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v = NULL; +PFNGLGETFLOATI_VPROC __glewGetFloati_v = NULL; +PFNGLSCISSORARRAYVPROC __glewScissorArrayv = NULL; +PFNGLSCISSORINDEXEDPROC __glewScissorIndexed = NULL; +PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv = NULL; +PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv = NULL; +PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf = NULL; +PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv = NULL; + PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB = NULL; PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB = NULL; PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB = NULL; @@ -755,8 +1618,8 @@ PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI = NULL; PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI = NULL; PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI = NULL; -PFNGLPNTRIANGLESFATIPROC __glPNTrianglewesfATI = NULL; -PFNGLPNTRIANGLESIATIPROC __glPNTrianglewesiATI = NULL; +PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI = NULL; +PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI = NULL; PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI = NULL; PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI = NULL; @@ -791,6 +1654,14 @@ PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI = NULL; PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI = NULL; PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI = NULL; PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI = NULL; +PFNGLVERTEXSTREAM1DATIPROC __glewVertexStream1dATI = NULL; +PFNGLVERTEXSTREAM1DVATIPROC __glewVertexStream1dvATI = NULL; +PFNGLVERTEXSTREAM1FATIPROC __glewVertexStream1fATI = NULL; +PFNGLVERTEXSTREAM1FVATIPROC __glewVertexStream1fvATI = NULL; +PFNGLVERTEXSTREAM1IATIPROC __glewVertexStream1iATI = NULL; +PFNGLVERTEXSTREAM1IVATIPROC __glewVertexStream1ivATI = NULL; +PFNGLVERTEXSTREAM1SATIPROC __glewVertexStream1sATI = NULL; +PFNGLVERTEXSTREAM1SVATIPROC __glewVertexStream1svATI = NULL; PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI = NULL; PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI = NULL; PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI = NULL; @@ -816,6 +1687,10 @@ PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI = NULL; PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI = NULL; PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI = NULL; +PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEEXTPROC __glewDrawArraysInstancedBaseInstanceEXT = NULL; +PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEEXTPROC __glewDrawElementsInstancedBaseInstanceEXT = NULL; +PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEEXTPROC __glewDrawElementsInstancedBaseVertexBaseInstanceEXT = NULL; + PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT = NULL; PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT = NULL; PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT = NULL; @@ -824,10 +1699,20 @@ PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT = NULL; PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT = NULL; +PFNGLBINDFRAGDATALOCATIONINDEXEDEXTPROC __glewBindFragDataLocationIndexedEXT = NULL; +PFNGLGETFRAGDATAINDEXEXTPROC __glewGetFragDataIndexEXT = NULL; +PFNGLGETPROGRAMRESOURCELOCATIONINDEXEXTPROC __glewGetProgramResourceLocationIndexEXT = NULL; + PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT = NULL; PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT = NULL; +PFNGLBUFFERSTORAGEEXTPROC __glewBufferStorageEXT = NULL; +PFNGLNAMEDBUFFERSTORAGEEXTPROC __glewNamedBufferStorageEXT = NULL; + +PFNGLCLEARTEXIMAGEEXTPROC __glewClearTexImageEXT = NULL; +PFNGLCLEARTEXSUBIMAGEEXTPROC __glewClearTexSubImageEXT = NULL; + PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT = NULL; PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT = NULL; @@ -851,6 +1736,8 @@ PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT = NULL; PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT = NULL; PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT = NULL; +PFNGLCOPYIMAGESUBDATAEXTPROC __glewCopyImageSubDataEXT = NULL; + PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT = NULL; PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT = NULL; PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT = NULL; @@ -860,8 +1747,234 @@ PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT = NULL; PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT = NULL; PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT = NULL; +PFNGLGETOBJECTLABELEXTPROC __glewGetObjectLabelEXT = NULL; +PFNGLLABELOBJECTEXTPROC __glewLabelObjectEXT = NULL; + +PFNGLINSERTEVENTMARKEREXTPROC __glewInsertEventMarkerEXT = NULL; +PFNGLPOPGROUPMARKEREXTPROC __glewPopGroupMarkerEXT = NULL; +PFNGLPUSHGROUPMARKEREXTPROC __glewPushGroupMarkerEXT = NULL; + PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT = NULL; +PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT = NULL; +PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT = NULL; +PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT = NULL; +PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT = NULL; +PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT = NULL; +PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT = NULL; +PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT = NULL; +PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT = NULL; +PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT = NULL; +PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT = NULL; +PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT = NULL; +PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT = NULL; +PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT = NULL; +PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT = NULL; +PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT = NULL; +PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT = NULL; +PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT = NULL; +PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT = NULL; +PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT = NULL; +PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT = NULL; +PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT = NULL; +PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT = NULL; +PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT = NULL; +PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT = NULL; +PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT = NULL; +PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT = NULL; +PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT = NULL; +PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT = NULL; +PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT = NULL; +PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT = NULL; +PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT = NULL; +PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT = NULL; +PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT = NULL; +PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT = NULL; +PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT = NULL; +PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT = NULL; +PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT = NULL; +PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT = NULL; +PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT = NULL; +PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT = NULL; +PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT = NULL; +PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT = NULL; +PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT = NULL; +PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT = NULL; +PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT = NULL; +PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT = NULL; +PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT = NULL; +PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT = NULL; +PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT = NULL; +PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT = NULL; +PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT = NULL; +PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT = NULL; +PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT = NULL; +PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT = NULL; +PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT = NULL; +PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT = NULL; +PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT = NULL; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT = NULL; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT = NULL; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT = NULL; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT = NULL; +PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT = NULL; +PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT = NULL; +PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT = NULL; +PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT = NULL; +PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT = NULL; +PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT = NULL; +PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT = NULL; +PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT = NULL; +PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT = NULL; +PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT = NULL; +PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT = NULL; +PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT = NULL; +PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT = NULL; +PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT = NULL; +PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT = NULL; +PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT = NULL; +PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT = NULL; +PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT = NULL; +PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT = NULL; +PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT = NULL; +PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT = NULL; +PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT = NULL; +PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT = NULL; +PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT = NULL; +PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT = NULL; +PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT = NULL; +PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT = NULL; +PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT = NULL; +PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT = NULL; +PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT = NULL; +PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT = NULL; +PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT = NULL; +PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT = NULL; +PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT = NULL; +PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT = NULL; +PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT = NULL; +PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT = NULL; +PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT = NULL; +PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT = NULL; +PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT = NULL; +PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT = NULL; +PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT = NULL; +PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT = NULL; +PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT = NULL; +PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT = NULL; +PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT = NULL; +PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT = NULL; +PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT = NULL; +PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT = NULL; +PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT = NULL; +PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT = NULL; +PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT = NULL; +PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT = NULL; +PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT = NULL; +PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT = NULL; +PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT = NULL; +PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT = NULL; +PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT = NULL; +PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT = NULL; +PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT = NULL; +PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT = NULL; +PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT = NULL; +PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT = NULL; +PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT = NULL; +PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT = NULL; +PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT = NULL; +PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT = NULL; +PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT = NULL; +PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT = NULL; +PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT = NULL; +PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT = NULL; +PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT = NULL; +PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT = NULL; +PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT = NULL; +PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT = NULL; +PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT = NULL; +PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT = NULL; +PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT = NULL; +PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT = NULL; +PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT = NULL; +PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT = NULL; +PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT = NULL; +PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT = NULL; +PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT = NULL; +PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT = NULL; +PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT = NULL; +PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT = NULL; +PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT = NULL; +PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT = NULL; +PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT = NULL; +PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT = NULL; +PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT = NULL; +PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT = NULL; +PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT = NULL; +PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT = NULL; +PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT = NULL; +PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT = NULL; +PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT = NULL; +PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT = NULL; +PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT = NULL; +PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT = NULL; +PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT = NULL; +PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT = NULL; +PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT = NULL; +PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT = NULL; +PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT = NULL; +PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT = NULL; +PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT = NULL; +PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT = NULL; +PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT = NULL; +PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT = NULL; +PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT = NULL; +PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT = NULL; +PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT = NULL; +PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT = NULL; +PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT = NULL; +PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT = NULL; +PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC __glewVertexArrayVertexAttribDivisorEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT = NULL; +PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT = NULL; + +PFNGLDISCARDFRAMEBUFFEREXTPROC __glewDiscardFramebufferEXT = NULL; + +PFNGLDRAWBUFFERSEXTPROC __glewDrawBuffersEXT = NULL; + PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT = NULL; PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT = NULL; PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT = NULL; @@ -869,11 +1982,28 @@ PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT = NULL; PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT = NULL; PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT = NULL; +PFNGLBLENDEQUATIONSEPARATEIEXTPROC __glewBlendEquationSeparateiEXT = NULL; +PFNGLBLENDEQUATIONIEXTPROC __glewBlendEquationiEXT = NULL; +PFNGLBLENDFUNCSEPARATEIEXTPROC __glewBlendFuncSeparateiEXT = NULL; +PFNGLBLENDFUNCIEXTPROC __glewBlendFunciEXT = NULL; +PFNGLCOLORMASKIEXTPROC __glewColorMaskiEXT = NULL; +PFNGLDISABLEIEXTPROC __glewDisableiEXT = NULL; +PFNGLENABLEIEXTPROC __glewEnableiEXT = NULL; +PFNGLISENABLEDIEXTPROC __glewIsEnablediEXT = NULL; + +PFNGLDRAWELEMENTSBASEVERTEXEXTPROC __glewDrawElementsBaseVertexEXT = NULL; +PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXEXTPROC __glewDrawElementsInstancedBaseVertexEXT = NULL; +PFNGLDRAWRANGEELEMENTSBASEVERTEXEXTPROC __glewDrawRangeElementsBaseVertexEXT = NULL; +PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC __glewMultiDrawElementsBaseVertexEXT = NULL; + PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT = NULL; PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT = NULL; PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT = NULL; +PFNGLBUFFERSTORAGEEXTERNALEXTPROC __glewBufferStorageExternalEXT = NULL; +PFNGLNAMEDBUFFERSTORAGEEXTERNALEXTPROC __glewNamedBufferStorageExternalEXT = NULL; + PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT = NULL; PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT = NULL; PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT = NULL; @@ -923,7 +2053,6 @@ PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT = NULL; PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT = NULL; PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT = NULL; -PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT = NULL; PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT = NULL; PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT = NULL; @@ -979,16 +2108,55 @@ PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT = NULL; PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT = NULL; +PFNGLVERTEXATTRIBDIVISOREXTPROC __glewVertexAttribDivisorEXT = NULL; + PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT = NULL; PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT = NULL; PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT = NULL; +PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC __glewFlushMappedBufferRangeEXT = NULL; +PFNGLMAPBUFFERRANGEEXTPROC __glewMapBufferRangeEXT = NULL; + +PFNGLBUFFERSTORAGEMEMEXTPROC __glewBufferStorageMemEXT = NULL; +PFNGLCREATEMEMORYOBJECTSEXTPROC __glewCreateMemoryObjectsEXT = NULL; +PFNGLDELETEMEMORYOBJECTSEXTPROC __glewDeleteMemoryObjectsEXT = NULL; +PFNGLGETMEMORYOBJECTPARAMETERIVEXTPROC __glewGetMemoryObjectParameterivEXT = NULL; +PFNGLGETUNSIGNEDBYTEI_VEXTPROC __glewGetUnsignedBytei_vEXT = NULL; +PFNGLGETUNSIGNEDBYTEVEXTPROC __glewGetUnsignedBytevEXT = NULL; +PFNGLISMEMORYOBJECTEXTPROC __glewIsMemoryObjectEXT = NULL; +PFNGLMEMORYOBJECTPARAMETERIVEXTPROC __glewMemoryObjectParameterivEXT = NULL; +PFNGLNAMEDBUFFERSTORAGEMEMEXTPROC __glewNamedBufferStorageMemEXT = NULL; +PFNGLTEXSTORAGEMEM1DEXTPROC __glewTexStorageMem1DEXT = NULL; +PFNGLTEXSTORAGEMEM2DEXTPROC __glewTexStorageMem2DEXT = NULL; +PFNGLTEXSTORAGEMEM2DMULTISAMPLEEXTPROC __glewTexStorageMem2DMultisampleEXT = NULL; +PFNGLTEXSTORAGEMEM3DEXTPROC __glewTexStorageMem3DEXT = NULL; +PFNGLTEXSTORAGEMEM3DMULTISAMPLEEXTPROC __glewTexStorageMem3DMultisampleEXT = NULL; +PFNGLTEXTURESTORAGEMEM1DEXTPROC __glewTextureStorageMem1DEXT = NULL; +PFNGLTEXTURESTORAGEMEM2DEXTPROC __glewTextureStorageMem2DEXT = NULL; +PFNGLTEXTURESTORAGEMEM2DMULTISAMPLEEXTPROC __glewTextureStorageMem2DMultisampleEXT = NULL; +PFNGLTEXTURESTORAGEMEM3DEXTPROC __glewTextureStorageMem3DEXT = NULL; +PFNGLTEXTURESTORAGEMEM3DMULTISAMPLEEXTPROC __glewTextureStorageMem3DMultisampleEXT = NULL; + +PFNGLIMPORTMEMORYFDEXTPROC __glewImportMemoryFdEXT = NULL; + +PFNGLIMPORTMEMORYWIN32HANDLEEXTPROC __glewImportMemoryWin32HandleEXT = NULL; +PFNGLIMPORTMEMORYWIN32NAMEEXTPROC __glewImportMemoryWin32NameEXT = NULL; + PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT = NULL; PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT = NULL; +PFNGLMULTIDRAWARRAYSINDIRECTEXTPROC __glewMultiDrawArraysIndirectEXT = NULL; +PFNGLMULTIDRAWELEMENTSINDIRECTEXTPROC __glewMultiDrawElementsIndirectEXT = NULL; + PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT = NULL; PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT = NULL; +PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC __glewFramebufferTexture2DMultisampleEXT = NULL; + +PFNGLDRAWBUFFERSINDEXEDEXTPROC __glewDrawBuffersIndexedEXT = NULL; +PFNGLGETINTEGERI_VEXTPROC __glewGetIntegeri_vEXT = NULL; +PFNGLREADBUFFERINDEXEDEXTPROC __glewReadBufferIndexedEXT = NULL; + PFNGLCOLORTABLEEXTPROC __glewColorTableEXT = NULL; PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT = NULL; PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT = NULL; @@ -1006,6 +2174,15 @@ PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT = NULL; PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT = NULL; +PFNGLPOLYGONOFFSETCLAMPEXTPROC __glewPolygonOffsetClampEXT = NULL; + +PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT = NULL; + +PFNGLCOVERAGEMODULATIONNVPROC __glewCoverageModulationNV = NULL; +PFNGLCOVERAGEMODULATIONTABLENVPROC __glewCoverageModulationTableNV = NULL; +PFNGLGETCOVERAGEMODULATIONTABLENVPROC __glewGetCoverageModulationTableNV = NULL; +PFNGLRASTERSAMPLESEXTPROC __glewRasterSamplesEXT = NULL; + PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT = NULL; PFNGLENDSCENEEXTPROC __glewEndSceneEXT = NULL; @@ -1027,6 +2204,33 @@ PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT = NULL; PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT = NULL; PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT = NULL; +PFNGLDELETESEMAPHORESEXTPROC __glewDeleteSemaphoresEXT = NULL; +PFNGLGENSEMAPHORESEXTPROC __glewGenSemaphoresEXT = NULL; +PFNGLGETSEMAPHOREPARAMETERUI64VEXTPROC __glewGetSemaphoreParameterui64vEXT = NULL; +PFNGLISSEMAPHOREEXTPROC __glewIsSemaphoreEXT = NULL; +PFNGLSEMAPHOREPARAMETERUI64VEXTPROC __glewSemaphoreParameterui64vEXT = NULL; +PFNGLSIGNALSEMAPHOREEXTPROC __glewSignalSemaphoreEXT = NULL; +PFNGLWAITSEMAPHOREEXTPROC __glewWaitSemaphoreEXT = NULL; + +PFNGLIMPORTSEMAPHOREFDEXTPROC __glewImportSemaphoreFdEXT = NULL; + +PFNGLIMPORTSEMAPHOREWIN32HANDLEEXTPROC __glewImportSemaphoreWin32HandleEXT = NULL; +PFNGLIMPORTSEMAPHOREWIN32NAMEEXTPROC __glewImportSemaphoreWin32NameEXT = NULL; + +PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT = NULL; +PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT = NULL; +PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT = NULL; + +PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT = NULL; +PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT = NULL; + +PFNGLCLEARPIXELLOCALSTORAGEUIEXTPROC __glewClearPixelLocalStorageuiEXT = NULL; +PFNGLFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC __glewFramebufferPixelLocalStorageSizeEXT = NULL; +PFNGLGETFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC __glewGetFramebufferPixelLocalStorageSizeEXT = NULL; + +PFNGLTEXPAGECOMMITMENTEXTPROC __glewTexPageCommitmentEXT = NULL; +PFNGLTEXTUREPAGECOMMITMENTEXTPROC __glewTexturePageCommitmentEXT = NULL; + PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT = NULL; PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT = NULL; @@ -1035,6 +2239,8 @@ PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT = NULL; PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT = NULL; +PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT = NULL; + PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT = NULL; PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT = NULL; @@ -1053,19 +2259,51 @@ PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT = NULL; PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT = NULL; +PFNGLTEXSTORAGE1DEXTPROC __glewTexStorage1DEXT = NULL; +PFNGLTEXSTORAGE2DEXTPROC __glewTexStorage2DEXT = NULL; +PFNGLTEXSTORAGE3DEXTPROC __glewTexStorage3DEXT = NULL; +PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT = NULL; +PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT = NULL; +PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT = NULL; + +PFNGLTEXTUREVIEWEXTPROC __glewTextureViewEXT = NULL; + PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT = NULL; PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT = NULL; +PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT = NULL; +PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT = NULL; +PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT = NULL; +PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT = NULL; +PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT = NULL; +PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT = NULL; +PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT = NULL; + PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT = NULL; PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT = NULL; PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT = NULL; PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT = NULL; -PFNGLGETPOINTERVEXTPROC __glewGetPointervEXT = NULL; PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT = NULL; PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT = NULL; PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT = NULL; PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT = NULL; +PFNGLBINDARRAYSETEXTPROC __glewBindArraySetEXT = NULL; +PFNGLCREATEARRAYSETEXTPROC __glewCreateArraySetExt = NULL; +PFNGLDELETEARRAYSETSEXTPROC __glewDeleteArraySetsEXT = NULL; + +PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT = NULL; +PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT = NULL; +PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT = NULL; +PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT = NULL; +PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT = NULL; +PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT = NULL; +PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT = NULL; +PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT = NULL; +PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT = NULL; +PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT = NULL; + PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT = NULL; PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT = NULL; PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT = NULL; @@ -1113,6 +2351,13 @@ PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT = NULL; PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT = NULL; PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT = NULL; +PFNGLACQUIREKEYEDMUTEXWIN32EXTPROC __glewAcquireKeyedMutexWin32EXT = NULL; +PFNGLRELEASEKEYEDMUTEXWIN32EXTPROC __glewReleaseKeyedMutexWin32EXT = NULL; + +PFNGLWINDOWRECTANGLESEXTPROC __glewWindowRectanglesEXT = NULL; + +PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT = NULL; + PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY = NULL; PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY = NULL; @@ -1136,19 +2381,54 @@ PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM = NULL; PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM = NULL; PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM = NULL; +PFNGLMAPTEXTURE2DINTELPROC __glewMapTexture2DINTEL = NULL; +PFNGLSYNCTEXTUREINTELPROC __glewSyncTextureINTEL = NULL; +PFNGLUNMAPTEXTURE2DINTELPROC __glewUnmapTexture2DINTEL = NULL; + PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL = NULL; PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL = NULL; PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL = NULL; PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL = NULL; +PFNGLBEGINPERFQUERYINTELPROC __glewBeginPerfQueryINTEL = NULL; +PFNGLCREATEPERFQUERYINTELPROC __glewCreatePerfQueryINTEL = NULL; +PFNGLDELETEPERFQUERYINTELPROC __glewDeletePerfQueryINTEL = NULL; +PFNGLENDPERFQUERYINTELPROC __glewEndPerfQueryINTEL = NULL; +PFNGLGETFIRSTPERFQUERYIDINTELPROC __glewGetFirstPerfQueryIdINTEL = NULL; +PFNGLGETNEXTPERFQUERYIDINTELPROC __glewGetNextPerfQueryIdINTEL = NULL; +PFNGLGETPERFCOUNTERINFOINTELPROC __glewGetPerfCounterInfoINTEL = NULL; +PFNGLGETPERFQUERYDATAINTELPROC __glewGetPerfQueryDataINTEL = NULL; +PFNGLGETPERFQUERYIDBYNAMEINTELPROC __glewGetPerfQueryIdByNameINTEL = NULL; +PFNGLGETPERFQUERYINFOINTELPROC __glewGetPerfQueryInfoINTEL = NULL; + PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL = NULL; PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL = NULL; -PFNGLBUFFERREGIONENABLEDEXTPROC __glewBufferRegionEnabledEXT = NULL; -PFNGLDELETEBUFFERREGIONEXTPROC __glewDeleteBufferRegionEXT = NULL; -PFNGLDRAWBUFFERREGIONEXTPROC __glewDrawBufferRegionEXT = NULL; -PFNGLNEWBUFFERREGIONEXTPROC __glewNewBufferRegionEXT = NULL; -PFNGLREADBUFFERREGIONEXTPROC __glewReadBufferRegionEXT = NULL; +PFNGLBLENDBARRIERKHRPROC __glewBlendBarrierKHR = NULL; + +PFNGLDEBUGMESSAGECALLBACKPROC __glewDebugMessageCallback = NULL; +PFNGLDEBUGMESSAGECONTROLPROC __glewDebugMessageControl = NULL; +PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert = NULL; +PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog = NULL; +PFNGLGETOBJECTLABELPROC __glewGetObjectLabel = NULL; +PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel = NULL; +PFNGLOBJECTLABELPROC __glewObjectLabel = NULL; +PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel = NULL; +PFNGLPOPDEBUGGROUPPROC __glewPopDebugGroup = NULL; +PFNGLPUSHDEBUGGROUPPROC __glewPushDebugGroup = NULL; + +PFNGLMAXSHADERCOMPILERTHREADSKHRPROC __glewMaxShaderCompilerThreadsKHR = NULL; + +PFNGLGETNUNIFORMFVPROC __glewGetnUniformfv = NULL; +PFNGLGETNUNIFORMIVPROC __glewGetnUniformiv = NULL; +PFNGLGETNUNIFORMUIVPROC __glewGetnUniformuiv = NULL; +PFNGLREADNPIXELSPROC __glewReadnPixels = NULL; + +PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled = NULL; +PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion = NULL; +PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion = NULL; +PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion = NULL; +PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion = NULL; PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA = NULL; @@ -1177,10 +2457,89 @@ PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA = NULL; PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA = NULL; PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA = NULL; +PFNGLBEGINCONDITIONALRENDERNVXPROC __glewBeginConditionalRenderNVX = NULL; +PFNGLENDCONDITIONALRENDERNVXPROC __glewEndConditionalRenderNVX = NULL; + +PFNGLLGPUCOPYIMAGESUBDATANVXPROC __glewLGPUCopyImageSubDataNVX = NULL; +PFNGLLGPUINTERLOCKNVXPROC __glewLGPUInterlockNVX = NULL; +PFNGLLGPUNAMEDBUFFERSUBDATANVXPROC __glewLGPUNamedBufferSubDataNVX = NULL; + +PFNGLSTEREOPARAMETERFNVPROC __glewStereoParameterfNV = NULL; +PFNGLSTEREOPARAMETERINVPROC __glewStereoParameteriNV = NULL; + +PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC __glewMultiDrawArraysIndirectBindlessNV = NULL; +PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC __glewMultiDrawElementsIndirectBindlessNV = NULL; + +PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC __glewMultiDrawArraysIndirectBindlessCountNV = NULL; +PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC __glewMultiDrawElementsIndirectBindlessCountNV = NULL; + +PFNGLGETIMAGEHANDLENVPROC __glewGetImageHandleNV = NULL; +PFNGLGETTEXTUREHANDLENVPROC __glewGetTextureHandleNV = NULL; +PFNGLGETTEXTURESAMPLERHANDLENVPROC __glewGetTextureSamplerHandleNV = NULL; +PFNGLISIMAGEHANDLERESIDENTNVPROC __glewIsImageHandleResidentNV = NULL; +PFNGLISTEXTUREHANDLERESIDENTNVPROC __glewIsTextureHandleResidentNV = NULL; +PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC __glewMakeImageHandleNonResidentNV = NULL; +PFNGLMAKEIMAGEHANDLERESIDENTNVPROC __glewMakeImageHandleResidentNV = NULL; +PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC __glewMakeTextureHandleNonResidentNV = NULL; +PFNGLMAKETEXTUREHANDLERESIDENTNVPROC __glewMakeTextureHandleResidentNV = NULL; +PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC __glewProgramUniformHandleui64NV = NULL; +PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC __glewProgramUniformHandleui64vNV = NULL; +PFNGLUNIFORMHANDLEUI64NVPROC __glewUniformHandleui64NV = NULL; +PFNGLUNIFORMHANDLEUI64VNVPROC __glewUniformHandleui64vNV = NULL; + +PFNGLBLENDBARRIERNVPROC __glewBlendBarrierNV = NULL; +PFNGLBLENDPARAMETERINVPROC __glewBlendParameteriNV = NULL; + +PFNGLVIEWPORTPOSITIONWSCALENVPROC __glewViewportPositionWScaleNV = NULL; + +PFNGLCALLCOMMANDLISTNVPROC __glewCallCommandListNV = NULL; +PFNGLCOMMANDLISTSEGMENTSNVPROC __glewCommandListSegmentsNV = NULL; +PFNGLCOMPILECOMMANDLISTNVPROC __glewCompileCommandListNV = NULL; +PFNGLCREATECOMMANDLISTSNVPROC __glewCreateCommandListsNV = NULL; +PFNGLCREATESTATESNVPROC __glewCreateStatesNV = NULL; +PFNGLDELETECOMMANDLISTSNVPROC __glewDeleteCommandListsNV = NULL; +PFNGLDELETESTATESNVPROC __glewDeleteStatesNV = NULL; +PFNGLDRAWCOMMANDSADDRESSNVPROC __glewDrawCommandsAddressNV = NULL; +PFNGLDRAWCOMMANDSNVPROC __glewDrawCommandsNV = NULL; +PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC __glewDrawCommandsStatesAddressNV = NULL; +PFNGLDRAWCOMMANDSSTATESNVPROC __glewDrawCommandsStatesNV = NULL; +PFNGLGETCOMMANDHEADERNVPROC __glewGetCommandHeaderNV = NULL; +PFNGLGETSTAGEINDEXNVPROC __glewGetStageIndexNV = NULL; +PFNGLISCOMMANDLISTNVPROC __glewIsCommandListNV = NULL; +PFNGLISSTATENVPROC __glewIsStateNV = NULL; +PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC __glewListDrawCommandsStatesClientNV = NULL; +PFNGLSTATECAPTURENVPROC __glewStateCaptureNV = NULL; + +PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV = NULL; +PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV = NULL; + +PFNGLSUBPIXELPRECISIONBIASNVPROC __glewSubpixelPrecisionBiasNV = NULL; + +PFNGLCONSERVATIVERASTERPARAMETERFNVPROC __glewConservativeRasterParameterfNV = NULL; + +PFNGLCONSERVATIVERASTERPARAMETERINVPROC __glewConservativeRasterParameteriNV = NULL; + +PFNGLCOPYBUFFERSUBDATANVPROC __glewCopyBufferSubDataNV = NULL; + +PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV = NULL; + PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV = NULL; PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV = NULL; PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV = NULL; +PFNGLDRAWBUFFERSNVPROC __glewDrawBuffersNV = NULL; + +PFNGLDRAWARRAYSINSTANCEDNVPROC __glewDrawArraysInstancedNV = NULL; +PFNGLDRAWELEMENTSINSTANCEDNVPROC __glewDrawElementsInstancedNV = NULL; + +PFNGLDRAWTEXTURENVPROC __glewDrawTextureNV = NULL; + +PFNGLDRAWVKIMAGENVPROC __glewDrawVkImageNV = NULL; +PFNGLGETVKPROCADDRNVPROC __glewGetVkProcAddrNV = NULL; +PFNGLSIGNALVKFENCENVPROC __glewSignalVkFenceNV = NULL; +PFNGLSIGNALVKSEMAPHORENVPROC __glewSignalVkSemaphoreNV = NULL; +PFNGLWAITVKSEMAPHORENVPROC __glewWaitVkSemaphoreNV = NULL; + PFNGLEVALMAPSNVPROC __glewEvalMapsNV = NULL; PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV = NULL; PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV = NULL; @@ -1191,6 +2550,10 @@ PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV = NULL; PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV = NULL; PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV = NULL; +PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV = NULL; +PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV = NULL; +PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV = NULL; + PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV = NULL; PFNGLFINISHFENCENVPROC __glewFinishFenceNV = NULL; PFNGLGENFENCESNVPROC __glewGenFencesNV = NULL; @@ -1199,6 +2562,8 @@ PFNGLISFENCENVPROC __glewIsFenceNV = NULL; PFNGLSETFENCENVPROC __glewSetFenceNV = NULL; PFNGLTESTFENCENVPROC __glewTestFenceNV = NULL; +PFNGLFRAGMENTCOVERAGECOLORNVPROC __glewFragmentCoverageColorNV = NULL; + PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV = NULL; PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV = NULL; PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV = NULL; @@ -1206,10 +2571,27 @@ PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV = NULL; PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV = NULL; PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV = NULL; +PFNGLBLITFRAMEBUFFERNVPROC __glewBlitFramebufferNV = NULL; + +PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC __glewRenderbufferStorageMultisampleNV = NULL; + PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV = NULL; PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV = NULL; +PFNGLMULTICASTBARRIERNVPROC __glewMulticastBarrierNV = NULL; +PFNGLMULTICASTBLITFRAMEBUFFERNVPROC __glewMulticastBlitFramebufferNV = NULL; +PFNGLMULTICASTBUFFERSUBDATANVPROC __glewMulticastBufferSubDataNV = NULL; +PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC __glewMulticastCopyBufferSubDataNV = NULL; +PFNGLMULTICASTCOPYIMAGESUBDATANVPROC __glewMulticastCopyImageSubDataNV = NULL; +PFNGLMULTICASTFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewMulticastFramebufferSampleLocationsfvNV = NULL; +PFNGLMULTICASTGETQUERYOBJECTI64VNVPROC __glewMulticastGetQueryObjecti64vNV = NULL; +PFNGLMULTICASTGETQUERYOBJECTIVNVPROC __glewMulticastGetQueryObjectivNV = NULL; +PFNGLMULTICASTGETQUERYOBJECTUI64VNVPROC __glewMulticastGetQueryObjectui64vNV = NULL; +PFNGLMULTICASTGETQUERYOBJECTUIVNVPROC __glewMulticastGetQueryObjectuivNV = NULL; +PFNGLMULTICASTWAITSYNCNVPROC __glewMulticastWaitSyncNV = NULL; +PFNGLRENDERGPUMASKNVPROC __glewRenderGpuMaskNV = NULL; + PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV = NULL; PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV = NULL; PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV = NULL; @@ -1223,6 +2605,41 @@ PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV = NULL; PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV = NULL; PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV = NULL; +PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV = NULL; +PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV = NULL; +PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV = NULL; +PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV = NULL; +PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV = NULL; +PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV = NULL; +PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV = NULL; +PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV = NULL; +PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV = NULL; +PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV = NULL; +PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV = NULL; +PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV = NULL; +PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV = NULL; +PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV = NULL; +PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV = NULL; +PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV = NULL; +PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV = NULL; +PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV = NULL; +PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV = NULL; +PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV = NULL; +PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV = NULL; +PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV = NULL; +PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV = NULL; +PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV = NULL; +PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV = NULL; +PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV = NULL; +PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV = NULL; +PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV = NULL; +PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV = NULL; +PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV = NULL; +PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV = NULL; +PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV = NULL; +PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV = NULL; +PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV = NULL; + PFNGLCOLOR3HNVPROC __glewColor3hNV = NULL; PFNGLCOLOR3HVNVPROC __glewColor3hvNV = NULL; PFNGLCOLOR4HNVPROC __glewColor4hNV = NULL; @@ -1270,6 +2687,17 @@ PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV = NULL; PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV = NULL; PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV = NULL; +PFNGLVERTEXATTRIBDIVISORNVPROC __glewVertexAttribDivisorNV = NULL; + +PFNGLGETINTERNALFORMATSAMPLEIVNVPROC __glewGetInternalformatSampleivNV = NULL; + +PFNGLUNIFORMMATRIX2X3FVNVPROC __glewUniformMatrix2x3fvNV = NULL; +PFNGLUNIFORMMATRIX2X4FVNVPROC __glewUniformMatrix2x4fvNV = NULL; +PFNGLUNIFORMMATRIX3X2FVNVPROC __glewUniformMatrix3x2fvNV = NULL; +PFNGLUNIFORMMATRIX3X4FVNVPROC __glewUniformMatrix3x4fvNV = NULL; +PFNGLUNIFORMMATRIX4X2FVNVPROC __glewUniformMatrix4x2fvNV = NULL; +PFNGLUNIFORMMATRIX4X3FVNVPROC __glewUniformMatrix4x3fvNV = NULL; + PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV = NULL; PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV = NULL; PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV = NULL; @@ -1282,12 +2710,86 @@ PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV = NULL; PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV = NULL; PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV = NULL; +PFNGLCOPYPATHNVPROC __glewCopyPathNV = NULL; +PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV = NULL; +PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV = NULL; +PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV = NULL; +PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV = NULL; +PFNGLDELETEPATHSNVPROC __glewDeletePathsNV = NULL; +PFNGLGENPATHSNVPROC __glewGenPathsNV = NULL; +PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV = NULL; +PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV = NULL; +PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV = NULL; +PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV = NULL; +PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV = NULL; +PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV = NULL; +PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV = NULL; +PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV = NULL; +PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV = NULL; +PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV = NULL; +PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV = NULL; +PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV = NULL; +PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV = NULL; +PFNGLGETPROGRAMRESOURCEFVNVPROC __glewGetProgramResourcefvNV = NULL; +PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV = NULL; +PFNGLISPATHNVPROC __glewIsPathNV = NULL; +PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV = NULL; +PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV = NULL; +PFNGLMATRIXLOAD3X2FNVPROC __glewMatrixLoad3x2fNV = NULL; +PFNGLMATRIXLOAD3X3FNVPROC __glewMatrixLoad3x3fNV = NULL; +PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC __glewMatrixLoadTranspose3x3fNV = NULL; +PFNGLMATRIXMULT3X2FNVPROC __glewMatrixMult3x2fNV = NULL; +PFNGLMATRIXMULT3X3FNVPROC __glewMatrixMult3x3fNV = NULL; +PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC __glewMatrixMultTranspose3x3fNV = NULL; +PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV = NULL; +PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV = NULL; +PFNGLPATHCOORDSNVPROC __glewPathCoordsNV = NULL; +PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV = NULL; +PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV = NULL; +PFNGLPATHFOGGENNVPROC __glewPathFogGenNV = NULL; +PFNGLPATHGLYPHINDEXARRAYNVPROC __glewPathGlyphIndexArrayNV = NULL; +PFNGLPATHGLYPHINDEXRANGENVPROC __glewPathGlyphIndexRangeNV = NULL; +PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV = NULL; +PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV = NULL; +PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC __glewPathMemoryGlyphIndexArrayNV = NULL; +PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV = NULL; +PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV = NULL; +PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV = NULL; +PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV = NULL; +PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV = NULL; +PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV = NULL; +PFNGLPATHSTRINGNVPROC __glewPathStringNV = NULL; +PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV = NULL; +PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV = NULL; +PFNGLPATHTEXGENNVPROC __glewPathTexGenNV = NULL; +PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV = NULL; +PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC __glewProgramPathFragmentInputGenNV = NULL; +PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV = NULL; +PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV = NULL; +PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV = NULL; +PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV = NULL; +PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC __glewStencilThenCoverFillPathInstancedNV = NULL; +PFNGLSTENCILTHENCOVERFILLPATHNVPROC __glewStencilThenCoverFillPathNV = NULL; +PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC __glewStencilThenCoverStrokePathInstancedNV = NULL; +PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC __glewStencilThenCoverStrokePathNV = NULL; +PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV = NULL; +PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV = NULL; + PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV = NULL; PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV = NULL; PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV = NULL; PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV = NULL; +PFNGLPOLYGONMODENVPROC __glewPolygonModeNV = NULL; + +PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV = NULL; +PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV = NULL; +PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV = NULL; +PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV = NULL; +PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV = NULL; +PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV = NULL; + PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV = NULL; PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV = NULL; @@ -1308,6 +2810,39 @@ PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameter PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV = NULL; PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV = NULL; +PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewFramebufferSampleLocationsfvNV = NULL; +PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewNamedFramebufferSampleLocationsfvNV = NULL; + +PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV = NULL; +PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV = NULL; +PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV = NULL; +PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV = NULL; +PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV = NULL; +PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV = NULL; +PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV = NULL; +PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV = NULL; +PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV = NULL; +PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV = NULL; +PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV = NULL; +PFNGLUNIFORMUI64NVPROC __glewUniformui64NV = NULL; +PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV = NULL; + +PFNGLCOMPRESSEDTEXIMAGE3DNVPROC __glewCompressedTexImage3DNV = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE3DNVPROC __glewCompressedTexSubImage3DNV = NULL; +PFNGLCOPYTEXSUBIMAGE3DNVPROC __glewCopyTexSubImage3DNV = NULL; +PFNGLFRAMEBUFFERTEXTURELAYERNVPROC __glewFramebufferTextureLayerNV = NULL; +PFNGLTEXIMAGE3DNVPROC __glewTexImage3DNV = NULL; +PFNGLTEXSUBIMAGE3DNVPROC __glewTexSubImage3DNV = NULL; + +PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV = NULL; + +PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV = NULL; +PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV = NULL; +PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV = NULL; +PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV = NULL; +PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV = NULL; +PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV = NULL; + PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV = NULL; PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV = NULL; PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV = NULL; @@ -1320,9 +2855,61 @@ PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV = NULL; PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV = NULL; PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV = NULL; +PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV = NULL; +PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV = NULL; +PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV = NULL; +PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV = NULL; +PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV = NULL; +PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV = NULL; +PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV = NULL; + +PFNGLVDPAUFININVPROC __glewVDPAUFiniNV = NULL; +PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV = NULL; +PFNGLVDPAUINITNVPROC __glewVDPAUInitNV = NULL; +PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV = NULL; +PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV = NULL; +PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV = NULL; +PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV = NULL; +PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV = NULL; +PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV = NULL; +PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV = NULL; + PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV = NULL; PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV = NULL; +PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV = NULL; +PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV = NULL; +PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV = NULL; +PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV = NULL; +PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV = NULL; +PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV = NULL; +PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV = NULL; +PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV = NULL; +PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV = NULL; +PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV = NULL; +PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV = NULL; +PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV = NULL; +PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV = NULL; +PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV = NULL; +PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV = NULL; +PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV = NULL; +PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV = NULL; +PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV = NULL; +PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV = NULL; + +PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV = NULL; +PFNGLCOLORFORMATNVPROC __glewColorFormatNV = NULL; +PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV = NULL; +PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV = NULL; +PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV = NULL; +PFNGLINDEXFORMATNVPROC __glewIndexFormatNV = NULL; +PFNGLNORMALFORMATNVPROC __glewNormalFormatNV = NULL; +PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV = NULL; +PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV = NULL; +PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV = NULL; +PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV = NULL; +PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV = NULL; + PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV = NULL; PFNGLBINDPROGRAMNVPROC __glewBindProgramNV = NULL; PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV = NULL; @@ -1388,12 +2975,121 @@ PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV = NULL; PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV = NULL; PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV = NULL; -PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES = NULL; -PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES = NULL; -PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES = NULL; -PFNGLFRUSTUMFOESPROC __glewFrustumfOES = NULL; -PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES = NULL; -PFNGLORTHOFOESPROC __glewOrthofOES = NULL; +PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV = NULL; +PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV = NULL; +PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV = NULL; +PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV = NULL; +PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV = NULL; +PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV = NULL; +PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV = NULL; +PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV = NULL; +PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV = NULL; +PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV = NULL; +PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV = NULL; +PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV = NULL; + +PFNGLDEPTHRANGEARRAYFVNVPROC __glewDepthRangeArrayfvNV = NULL; +PFNGLDEPTHRANGEINDEXEDFNVPROC __glewDepthRangeIndexedfNV = NULL; +PFNGLDISABLEINVPROC __glewDisableiNV = NULL; +PFNGLENABLEINVPROC __glewEnableiNV = NULL; +PFNGLGETFLOATI_VNVPROC __glewGetFloati_vNV = NULL; +PFNGLISENABLEDINVPROC __glewIsEnablediNV = NULL; +PFNGLSCISSORARRAYVNVPROC __glewScissorArrayvNV = NULL; +PFNGLSCISSORINDEXEDNVPROC __glewScissorIndexedNV = NULL; +PFNGLSCISSORINDEXEDVNVPROC __glewScissorIndexedvNV = NULL; +PFNGLVIEWPORTARRAYVNVPROC __glewViewportArrayvNV = NULL; +PFNGLVIEWPORTINDEXEDFNVPROC __glewViewportIndexedfNV = NULL; +PFNGLVIEWPORTINDEXEDFVNVPROC __glewViewportIndexedfvNV = NULL; + +PFNGLVIEWPORTSWIZZLENVPROC __glewViewportSwizzleNV = NULL; + +PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC __glewFramebufferTextureMultiviewOVR = NULL; + +PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVRPROC __glewFramebufferTextureMultisampleMultiviewOVR = NULL; + +PFNGLALPHAFUNCQCOMPROC __glewAlphaFuncQCOM = NULL; + +PFNGLDISABLEDRIVERCONTROLQCOMPROC __glewDisableDriverControlQCOM = NULL; +PFNGLENABLEDRIVERCONTROLQCOMPROC __glewEnableDriverControlQCOM = NULL; +PFNGLGETDRIVERCONTROLSTRINGQCOMPROC __glewGetDriverControlStringQCOM = NULL; +PFNGLGETDRIVERCONTROLSQCOMPROC __glewGetDriverControlsQCOM = NULL; + +PFNGLEXTGETBUFFERPOINTERVQCOMPROC __glewExtGetBufferPointervQCOM = NULL; +PFNGLEXTGETBUFFERSQCOMPROC __glewExtGetBuffersQCOM = NULL; +PFNGLEXTGETFRAMEBUFFERSQCOMPROC __glewExtGetFramebuffersQCOM = NULL; +PFNGLEXTGETRENDERBUFFERSQCOMPROC __glewExtGetRenderbuffersQCOM = NULL; +PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC __glewExtGetTexLevelParameterivQCOM = NULL; +PFNGLEXTGETTEXSUBIMAGEQCOMPROC __glewExtGetTexSubImageQCOM = NULL; +PFNGLEXTGETTEXTURESQCOMPROC __glewExtGetTexturesQCOM = NULL; +PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC __glewExtTexObjectStateOverrideiQCOM = NULL; + +PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC __glewExtGetProgramBinarySourceQCOM = NULL; +PFNGLEXTGETPROGRAMSQCOMPROC __glewExtGetProgramsQCOM = NULL; +PFNGLEXTGETSHADERSQCOMPROC __glewExtGetShadersQCOM = NULL; +PFNGLEXTISPROGRAMBINARYQCOMPROC __glewExtIsProgramBinaryQCOM = NULL; + +PFNGLFRAMEBUFFERFOVEATIONCONFIGQCOMPROC __glewFramebufferFoveationConfigQCOM = NULL; +PFNGLFRAMEBUFFERFOVEATIONPARAMETERSQCOMPROC __glewFramebufferFoveationParametersQCOM = NULL; + +PFNGLFRAMEBUFFERFETCHBARRIERQCOMPROC __glewFramebufferFetchBarrierQCOM = NULL; + +PFNGLENDTILINGQCOMPROC __glewEndTilingQCOM = NULL; +PFNGLSTARTTILINGQCOMPROC __glewStartTilingQCOM = NULL; + +PFNGLALPHAFUNCXPROC __glewAlphaFuncx = NULL; +PFNGLCLEARCOLORXPROC __glewClearColorx = NULL; +PFNGLCLEARDEPTHXPROC __glewClearDepthx = NULL; +PFNGLCOLOR4XPROC __glewColor4x = NULL; +PFNGLDEPTHRANGEXPROC __glewDepthRangex = NULL; +PFNGLFOGXPROC __glewFogx = NULL; +PFNGLFOGXVPROC __glewFogxv = NULL; +PFNGLFRUSTUMFPROC __glewFrustumf = NULL; +PFNGLFRUSTUMXPROC __glewFrustumx = NULL; +PFNGLLIGHTMODELXPROC __glewLightModelx = NULL; +PFNGLLIGHTMODELXVPROC __glewLightModelxv = NULL; +PFNGLLIGHTXPROC __glewLightx = NULL; +PFNGLLIGHTXVPROC __glewLightxv = NULL; +PFNGLLINEWIDTHXPROC __glewLineWidthx = NULL; +PFNGLLOADMATRIXXPROC __glewLoadMatrixx = NULL; +PFNGLMATERIALXPROC __glewMaterialx = NULL; +PFNGLMATERIALXVPROC __glewMaterialxv = NULL; +PFNGLMULTMATRIXXPROC __glewMultMatrixx = NULL; +PFNGLMULTITEXCOORD4XPROC __glewMultiTexCoord4x = NULL; +PFNGLNORMAL3XPROC __glewNormal3x = NULL; +PFNGLORTHOFPROC __glewOrthof = NULL; +PFNGLORTHOXPROC __glewOrthox = NULL; +PFNGLPOINTSIZEXPROC __glewPointSizex = NULL; +PFNGLPOLYGONOFFSETXPROC __glewPolygonOffsetx = NULL; +PFNGLROTATEXPROC __glewRotatex = NULL; +PFNGLSAMPLECOVERAGEXPROC __glewSampleCoveragex = NULL; +PFNGLSCALEXPROC __glewScalex = NULL; +PFNGLTEXENVXPROC __glewTexEnvx = NULL; +PFNGLTEXENVXVPROC __glewTexEnvxv = NULL; +PFNGLTEXPARAMETERXPROC __glewTexParameterx = NULL; +PFNGLTRANSLATEXPROC __glewTranslatex = NULL; + +PFNGLCLIPPLANEFPROC __glewClipPlanef = NULL; +PFNGLCLIPPLANEXPROC __glewClipPlanex = NULL; +PFNGLGETCLIPPLANEFPROC __glewGetClipPlanef = NULL; +PFNGLGETCLIPPLANEXPROC __glewGetClipPlanex = NULL; +PFNGLGETFIXEDVPROC __glewGetFixedv = NULL; +PFNGLGETLIGHTXVPROC __glewGetLightxv = NULL; +PFNGLGETMATERIALXVPROC __glewGetMaterialxv = NULL; +PFNGLGETTEXENVXVPROC __glewGetTexEnvxv = NULL; +PFNGLGETTEXPARAMETERXVPROC __glewGetTexParameterxv = NULL; +PFNGLPOINTPARAMETERXPROC __glewPointParameterx = NULL; +PFNGLPOINTPARAMETERXVPROC __glewPointParameterxv = NULL; +PFNGLPOINTSIZEPOINTEROESPROC __glewPointSizePointerOES = NULL; +PFNGLTEXPARAMETERXVPROC __glewTexParameterxv = NULL; + +PFNGLERRORSTRINGREGALPROC __glewErrorStringREGAL = NULL; + +PFNGLGETEXTENSIONREGALPROC __glewGetExtensionREGAL = NULL; +PFNGLISSUPPORTEDREGALPROC __glewIsSupportedREGAL = NULL; + +PFNGLLOGMESSAGECALLBACKREGALPROC __glewLogMessageCallbackREGAL = NULL; + +PFNGLGETPROCADDRESSREGALPROC __glewGetProcAddressREGAL = NULL; PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS = NULL; PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS = NULL; @@ -1404,6 +3100,13 @@ PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS = NULL; PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS = NULL; PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS = NULL; +PFNGLINTERLEAVEDTEXTURECOORDSETSSGISPROC __glewInterleavedTextureCoordSetsSGIS = NULL; +PFNGLSELECTTEXTURECOORDSETSGISPROC __glewSelectTextureCoordSetSGIS = NULL; +PFNGLSELECTTEXTURESGISPROC __glewSelectTextureSGIS = NULL; +PFNGLSELECTTEXTURETRANSFORMSGISPROC __glewSelectTextureTransformSGIS = NULL; + +PFNGLMULTISAMPLESUBRECTPOSSGISPROC __glewMultisampleSubRectPosSGIS = NULL; + PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS = NULL; PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS = NULL; @@ -1420,8 +3123,14 @@ PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX = NULL; PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX = NULL; PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX = NULL; +PFNGLADDRESSSPACEPROC __glewAddressSpace = NULL; +PFNGLDATAPIPEPROC __glewDataPipe = NULL; + PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX = NULL; +PFNGLFOGLAYERSSGIXPROC __glewFogLayersSGIX = NULL; +PFNGLGETFOGLAYERSSGIXPROC __glewGetFogLayersSGIX = NULL; + PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX = NULL; PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX = NULL; @@ -1444,8 +3153,33 @@ PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX = NULL; PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX = NULL; +PFNGLIGLOOINTERFACESGIXPROC __glewIglooInterfaceSGIX = NULL; + +PFNGLALLOCMPEGPREDICTORSSGIXPROC __glewAllocMPEGPredictorsSGIX = NULL; +PFNGLDELETEMPEGPREDICTORSSGIXPROC __glewDeleteMPEGPredictorsSGIX = NULL; +PFNGLGENMPEGPREDICTORSSGIXPROC __glewGenMPEGPredictorsSGIX = NULL; +PFNGLGETMPEGPARAMETERFVSGIXPROC __glewGetMPEGParameterfvSGIX = NULL; +PFNGLGETMPEGPARAMETERIVSGIXPROC __glewGetMPEGParameterivSGIX = NULL; +PFNGLGETMPEGPREDICTORSGIXPROC __glewGetMPEGPredictorSGIX = NULL; +PFNGLGETMPEGQUANTTABLEUBVPROC __glewGetMPEGQuantTableubv = NULL; +PFNGLISMPEGPREDICTORSGIXPROC __glewIsMPEGPredictorSGIX = NULL; +PFNGLMPEGPREDICTORSGIXPROC __glewMPEGPredictorSGIX = NULL; +PFNGLMPEGQUANTTABLEUBVPROC __glewMPEGQuantTableubv = NULL; +PFNGLSWAPMPEGPREDICTORSSGIXPROC __glewSwapMPEGPredictorsSGIX = NULL; + +PFNGLGETNONLINLIGHTFVSGIXPROC __glewGetNonlinLightfvSGIX = NULL; +PFNGLGETNONLINMATERIALFVSGIXPROC __glewGetNonlinMaterialfvSGIX = NULL; +PFNGLNONLINLIGHTFVSGIXPROC __glewNonlinLightfvSGIX = NULL; +PFNGLNONLINMATERIALFVSGIXPROC __glewNonlinMaterialfvSGIX = NULL; + PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX = NULL; +PFNGLDEFORMSGIXPROC __glewDeformSGIX = NULL; +PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC __glewLoadIdentityDeformationMapSGIX = NULL; + +PFNGLMESHBREADTHSGIXPROC __glewMeshBreadthSGIX = NULL; +PFNGLMESHSTRIDESGIXPROC __glewMeshStrideSGIX = NULL; + PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX = NULL; PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX = NULL; @@ -1455,6 +3189,16 @@ PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX = NULL; PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX = NULL; +PFNGLGETVECTOROPERATIONSGIXPROC __glewGetVectorOperationSGIX = NULL; +PFNGLVECTOROPERATIONSGIXPROC __glewVectorOperationSGIX = NULL; + +PFNGLAREVERTEXARRAYSRESIDENTSGIXPROC __glewAreVertexArraysResidentSGIX = NULL; +PFNGLBINDVERTEXARRAYSGIXPROC __glewBindVertexArraySGIX = NULL; +PFNGLDELETEVERTEXARRAYSSGIXPROC __glewDeleteVertexArraysSGIX = NULL; +PFNGLGENVERTEXARRAYSSGIXPROC __glewGenVertexArraysSGIX = NULL; +PFNGLISVERTEXARRAYSGIXPROC __glewIsVertexArraySGIX = NULL; +PFNGLPRIORITIZEVERTEXARRAYSSGIXPROC __glewPrioritizeVertexArraysSGIX = NULL; + PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI = NULL; PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI = NULL; PFNGLCOLORTABLESGIPROC __glewColorTableSGI = NULL; @@ -1463,6 +3207,14 @@ PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI = NULL; PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI = NULL; PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI = NULL; +PFNGLGETPIXELTRANSFORMPARAMETERFVSGIPROC __glewGetPixelTransformParameterfvSGI = NULL; +PFNGLGETPIXELTRANSFORMPARAMETERIVSGIPROC __glewGetPixelTransformParameterivSGI = NULL; +PFNGLPIXELTRANSFORMPARAMETERFSGIPROC __glewPixelTransformParameterfSGI = NULL; +PFNGLPIXELTRANSFORMPARAMETERFVSGIPROC __glewPixelTransformParameterfvSGI = NULL; +PFNGLPIXELTRANSFORMPARAMETERISGIPROC __glewPixelTransformParameteriSGI = NULL; +PFNGLPIXELTRANSFORMPARAMETERIVSGIPROC __glewPixelTransformParameterivSGI = NULL; +PFNGLPIXELTRANSFORMSGIPROC __glewPixelTransformSGI = NULL; + PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX = NULL; PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN = NULL; @@ -1527,68 +3279,281 @@ PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN = NULL; PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN = NULL; -#endif /* !WIN32 || !GLEW_MX */ - -#if !defined(GLEW_MX) - GLboolean __GLEW_VERSION_1_1 = GL_FALSE; GLboolean __GLEW_VERSION_1_2 = GL_FALSE; +GLboolean __GLEW_VERSION_1_2_1 = GL_FALSE; GLboolean __GLEW_VERSION_1_3 = GL_FALSE; GLboolean __GLEW_VERSION_1_4 = GL_FALSE; GLboolean __GLEW_VERSION_1_5 = GL_FALSE; GLboolean __GLEW_VERSION_2_0 = GL_FALSE; GLboolean __GLEW_VERSION_2_1 = GL_FALSE; +GLboolean __GLEW_VERSION_3_0 = GL_FALSE; +GLboolean __GLEW_VERSION_3_1 = GL_FALSE; +GLboolean __GLEW_VERSION_3_2 = GL_FALSE; +GLboolean __GLEW_VERSION_3_3 = GL_FALSE; +GLboolean __GLEW_VERSION_4_0 = GL_FALSE; +GLboolean __GLEW_VERSION_4_1 = GL_FALSE; +GLboolean __GLEW_VERSION_4_2 = GL_FALSE; +GLboolean __GLEW_VERSION_4_3 = GL_FALSE; +GLboolean __GLEW_VERSION_4_4 = GL_FALSE; +GLboolean __GLEW_VERSION_4_5 = GL_FALSE; +GLboolean __GLEW_VERSION_4_6 = GL_FALSE; GLboolean __GLEW_3DFX_multisample = GL_FALSE; GLboolean __GLEW_3DFX_tbuffer = GL_FALSE; GLboolean __GLEW_3DFX_texture_compression_FXT1 = GL_FALSE; +GLboolean __GLEW_AMD_blend_minmax_factor = GL_FALSE; +GLboolean __GLEW_AMD_compressed_3DC_texture = GL_FALSE; +GLboolean __GLEW_AMD_compressed_ATC_texture = GL_FALSE; +GLboolean __GLEW_AMD_conservative_depth = GL_FALSE; +GLboolean __GLEW_AMD_debug_output = GL_FALSE; +GLboolean __GLEW_AMD_depth_clamp_separate = GL_FALSE; +GLboolean __GLEW_AMD_draw_buffers_blend = GL_FALSE; +GLboolean __GLEW_AMD_framebuffer_sample_positions = GL_FALSE; +GLboolean __GLEW_AMD_gcn_shader = GL_FALSE; +GLboolean __GLEW_AMD_gpu_shader_half_float = GL_FALSE; +GLboolean __GLEW_AMD_gpu_shader_int16 = GL_FALSE; +GLboolean __GLEW_AMD_gpu_shader_int64 = GL_FALSE; +GLboolean __GLEW_AMD_interleaved_elements = GL_FALSE; +GLboolean __GLEW_AMD_multi_draw_indirect = GL_FALSE; +GLboolean __GLEW_AMD_name_gen_delete = GL_FALSE; +GLboolean __GLEW_AMD_occlusion_query_event = GL_FALSE; +GLboolean __GLEW_AMD_performance_monitor = GL_FALSE; +GLboolean __GLEW_AMD_pinned_memory = GL_FALSE; +GLboolean __GLEW_AMD_program_binary_Z400 = GL_FALSE; +GLboolean __GLEW_AMD_query_buffer_object = GL_FALSE; +GLboolean __GLEW_AMD_sample_positions = GL_FALSE; +GLboolean __GLEW_AMD_seamless_cubemap_per_texture = GL_FALSE; +GLboolean __GLEW_AMD_shader_atomic_counter_ops = GL_FALSE; +GLboolean __GLEW_AMD_shader_ballot = GL_FALSE; +GLboolean __GLEW_AMD_shader_explicit_vertex_parameter = GL_FALSE; +GLboolean __GLEW_AMD_shader_stencil_export = GL_FALSE; +GLboolean __GLEW_AMD_shader_stencil_value_export = GL_FALSE; +GLboolean __GLEW_AMD_shader_trinary_minmax = GL_FALSE; +GLboolean __GLEW_AMD_sparse_texture = GL_FALSE; +GLboolean __GLEW_AMD_stencil_operation_extended = GL_FALSE; +GLboolean __GLEW_AMD_texture_gather_bias_lod = GL_FALSE; +GLboolean __GLEW_AMD_texture_texture4 = GL_FALSE; +GLboolean __GLEW_AMD_transform_feedback3_lines_triangles = GL_FALSE; +GLboolean __GLEW_AMD_transform_feedback4 = GL_FALSE; +GLboolean __GLEW_AMD_vertex_shader_layer = GL_FALSE; +GLboolean __GLEW_AMD_vertex_shader_tessellator = GL_FALSE; +GLboolean __GLEW_AMD_vertex_shader_viewport_index = GL_FALSE; +GLboolean __GLEW_ANDROID_extension_pack_es31a = GL_FALSE; +GLboolean __GLEW_ANGLE_depth_texture = GL_FALSE; +GLboolean __GLEW_ANGLE_framebuffer_blit = GL_FALSE; +GLboolean __GLEW_ANGLE_framebuffer_multisample = GL_FALSE; +GLboolean __GLEW_ANGLE_instanced_arrays = GL_FALSE; +GLboolean __GLEW_ANGLE_pack_reverse_row_order = GL_FALSE; +GLboolean __GLEW_ANGLE_program_binary = GL_FALSE; +GLboolean __GLEW_ANGLE_texture_compression_dxt1 = GL_FALSE; +GLboolean __GLEW_ANGLE_texture_compression_dxt3 = GL_FALSE; +GLboolean __GLEW_ANGLE_texture_compression_dxt5 = GL_FALSE; +GLboolean __GLEW_ANGLE_texture_usage = GL_FALSE; +GLboolean __GLEW_ANGLE_timer_query = GL_FALSE; +GLboolean __GLEW_ANGLE_translated_shader_source = GL_FALSE; +GLboolean __GLEW_APPLE_aux_depth_stencil = GL_FALSE; GLboolean __GLEW_APPLE_client_storage = GL_FALSE; +GLboolean __GLEW_APPLE_clip_distance = GL_FALSE; +GLboolean __GLEW_APPLE_color_buffer_packed_float = GL_FALSE; +GLboolean __GLEW_APPLE_copy_texture_levels = GL_FALSE; GLboolean __GLEW_APPLE_element_array = GL_FALSE; GLboolean __GLEW_APPLE_fence = GL_FALSE; GLboolean __GLEW_APPLE_float_pixels = GL_FALSE; GLboolean __GLEW_APPLE_flush_buffer_range = GL_FALSE; +GLboolean __GLEW_APPLE_framebuffer_multisample = GL_FALSE; +GLboolean __GLEW_APPLE_object_purgeable = GL_FALSE; GLboolean __GLEW_APPLE_pixel_buffer = GL_FALSE; +GLboolean __GLEW_APPLE_rgb_422 = GL_FALSE; +GLboolean __GLEW_APPLE_row_bytes = GL_FALSE; GLboolean __GLEW_APPLE_specular_vector = GL_FALSE; +GLboolean __GLEW_APPLE_sync = GL_FALSE; +GLboolean __GLEW_APPLE_texture_2D_limited_npot = GL_FALSE; +GLboolean __GLEW_APPLE_texture_format_BGRA8888 = GL_FALSE; +GLboolean __GLEW_APPLE_texture_max_level = GL_FALSE; +GLboolean __GLEW_APPLE_texture_packed_float = GL_FALSE; GLboolean __GLEW_APPLE_texture_range = GL_FALSE; GLboolean __GLEW_APPLE_transform_hint = GL_FALSE; GLboolean __GLEW_APPLE_vertex_array_object = GL_FALSE; GLboolean __GLEW_APPLE_vertex_array_range = GL_FALSE; +GLboolean __GLEW_APPLE_vertex_program_evaluators = GL_FALSE; GLboolean __GLEW_APPLE_ycbcr_422 = GL_FALSE; +GLboolean __GLEW_ARB_ES2_compatibility = GL_FALSE; +GLboolean __GLEW_ARB_ES3_1_compatibility = GL_FALSE; +GLboolean __GLEW_ARB_ES3_2_compatibility = GL_FALSE; +GLboolean __GLEW_ARB_ES3_compatibility = GL_FALSE; +GLboolean __GLEW_ARB_arrays_of_arrays = GL_FALSE; +GLboolean __GLEW_ARB_base_instance = GL_FALSE; +GLboolean __GLEW_ARB_bindless_texture = GL_FALSE; +GLboolean __GLEW_ARB_blend_func_extended = GL_FALSE; +GLboolean __GLEW_ARB_buffer_storage = GL_FALSE; +GLboolean __GLEW_ARB_cl_event = GL_FALSE; +GLboolean __GLEW_ARB_clear_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_clear_texture = GL_FALSE; +GLboolean __GLEW_ARB_clip_control = GL_FALSE; GLboolean __GLEW_ARB_color_buffer_float = GL_FALSE; +GLboolean __GLEW_ARB_compatibility = GL_FALSE; +GLboolean __GLEW_ARB_compressed_texture_pixel_storage = GL_FALSE; +GLboolean __GLEW_ARB_compute_shader = GL_FALSE; +GLboolean __GLEW_ARB_compute_variable_group_size = GL_FALSE; +GLboolean __GLEW_ARB_conditional_render_inverted = GL_FALSE; +GLboolean __GLEW_ARB_conservative_depth = GL_FALSE; +GLboolean __GLEW_ARB_copy_buffer = GL_FALSE; +GLboolean __GLEW_ARB_copy_image = GL_FALSE; +GLboolean __GLEW_ARB_cull_distance = GL_FALSE; +GLboolean __GLEW_ARB_debug_output = GL_FALSE; +GLboolean __GLEW_ARB_depth_buffer_float = GL_FALSE; +GLboolean __GLEW_ARB_depth_clamp = GL_FALSE; GLboolean __GLEW_ARB_depth_texture = GL_FALSE; +GLboolean __GLEW_ARB_derivative_control = GL_FALSE; +GLboolean __GLEW_ARB_direct_state_access = GL_FALSE; GLboolean __GLEW_ARB_draw_buffers = GL_FALSE; +GLboolean __GLEW_ARB_draw_buffers_blend = GL_FALSE; +GLboolean __GLEW_ARB_draw_elements_base_vertex = GL_FALSE; +GLboolean __GLEW_ARB_draw_indirect = GL_FALSE; +GLboolean __GLEW_ARB_draw_instanced = GL_FALSE; +GLboolean __GLEW_ARB_enhanced_layouts = GL_FALSE; +GLboolean __GLEW_ARB_explicit_attrib_location = GL_FALSE; +GLboolean __GLEW_ARB_explicit_uniform_location = GL_FALSE; +GLboolean __GLEW_ARB_fragment_coord_conventions = GL_FALSE; +GLboolean __GLEW_ARB_fragment_layer_viewport = GL_FALSE; GLboolean __GLEW_ARB_fragment_program = GL_FALSE; GLboolean __GLEW_ARB_fragment_program_shadow = GL_FALSE; GLboolean __GLEW_ARB_fragment_shader = GL_FALSE; +GLboolean __GLEW_ARB_fragment_shader_interlock = GL_FALSE; +GLboolean __GLEW_ARB_framebuffer_no_attachments = GL_FALSE; +GLboolean __GLEW_ARB_framebuffer_object = GL_FALSE; +GLboolean __GLEW_ARB_framebuffer_sRGB = GL_FALSE; +GLboolean __GLEW_ARB_geometry_shader4 = GL_FALSE; +GLboolean __GLEW_ARB_get_program_binary = GL_FALSE; +GLboolean __GLEW_ARB_get_texture_sub_image = GL_FALSE; +GLboolean __GLEW_ARB_gl_spirv = GL_FALSE; +GLboolean __GLEW_ARB_gpu_shader5 = GL_FALSE; +GLboolean __GLEW_ARB_gpu_shader_fp64 = GL_FALSE; +GLboolean __GLEW_ARB_gpu_shader_int64 = GL_FALSE; GLboolean __GLEW_ARB_half_float_pixel = GL_FALSE; +GLboolean __GLEW_ARB_half_float_vertex = GL_FALSE; GLboolean __GLEW_ARB_imaging = GL_FALSE; +GLboolean __GLEW_ARB_indirect_parameters = GL_FALSE; +GLboolean __GLEW_ARB_instanced_arrays = GL_FALSE; +GLboolean __GLEW_ARB_internalformat_query = GL_FALSE; +GLboolean __GLEW_ARB_internalformat_query2 = GL_FALSE; +GLboolean __GLEW_ARB_invalidate_subdata = GL_FALSE; +GLboolean __GLEW_ARB_map_buffer_alignment = GL_FALSE; +GLboolean __GLEW_ARB_map_buffer_range = GL_FALSE; GLboolean __GLEW_ARB_matrix_palette = GL_FALSE; +GLboolean __GLEW_ARB_multi_bind = GL_FALSE; +GLboolean __GLEW_ARB_multi_draw_indirect = GL_FALSE; GLboolean __GLEW_ARB_multisample = GL_FALSE; GLboolean __GLEW_ARB_multitexture = GL_FALSE; GLboolean __GLEW_ARB_occlusion_query = GL_FALSE; +GLboolean __GLEW_ARB_occlusion_query2 = GL_FALSE; +GLboolean __GLEW_ARB_parallel_shader_compile = GL_FALSE; +GLboolean __GLEW_ARB_pipeline_statistics_query = GL_FALSE; GLboolean __GLEW_ARB_pixel_buffer_object = GL_FALSE; GLboolean __GLEW_ARB_point_parameters = GL_FALSE; GLboolean __GLEW_ARB_point_sprite = GL_FALSE; +GLboolean __GLEW_ARB_polygon_offset_clamp = GL_FALSE; +GLboolean __GLEW_ARB_post_depth_coverage = GL_FALSE; +GLboolean __GLEW_ARB_program_interface_query = GL_FALSE; +GLboolean __GLEW_ARB_provoking_vertex = GL_FALSE; +GLboolean __GLEW_ARB_query_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_robust_buffer_access_behavior = GL_FALSE; +GLboolean __GLEW_ARB_robustness = GL_FALSE; +GLboolean __GLEW_ARB_robustness_application_isolation = GL_FALSE; +GLboolean __GLEW_ARB_robustness_share_group_isolation = GL_FALSE; +GLboolean __GLEW_ARB_sample_locations = GL_FALSE; +GLboolean __GLEW_ARB_sample_shading = GL_FALSE; +GLboolean __GLEW_ARB_sampler_objects = GL_FALSE; +GLboolean __GLEW_ARB_seamless_cube_map = GL_FALSE; +GLboolean __GLEW_ARB_seamless_cubemap_per_texture = GL_FALSE; +GLboolean __GLEW_ARB_separate_shader_objects = GL_FALSE; +GLboolean __GLEW_ARB_shader_atomic_counter_ops = GL_FALSE; +GLboolean __GLEW_ARB_shader_atomic_counters = GL_FALSE; +GLboolean __GLEW_ARB_shader_ballot = GL_FALSE; +GLboolean __GLEW_ARB_shader_bit_encoding = GL_FALSE; +GLboolean __GLEW_ARB_shader_clock = GL_FALSE; +GLboolean __GLEW_ARB_shader_draw_parameters = GL_FALSE; +GLboolean __GLEW_ARB_shader_group_vote = GL_FALSE; +GLboolean __GLEW_ARB_shader_image_load_store = GL_FALSE; +GLboolean __GLEW_ARB_shader_image_size = GL_FALSE; GLboolean __GLEW_ARB_shader_objects = GL_FALSE; +GLboolean __GLEW_ARB_shader_precision = GL_FALSE; +GLboolean __GLEW_ARB_shader_stencil_export = GL_FALSE; +GLboolean __GLEW_ARB_shader_storage_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_shader_subroutine = GL_FALSE; +GLboolean __GLEW_ARB_shader_texture_image_samples = GL_FALSE; +GLboolean __GLEW_ARB_shader_texture_lod = GL_FALSE; +GLboolean __GLEW_ARB_shader_viewport_layer_array = GL_FALSE; GLboolean __GLEW_ARB_shading_language_100 = GL_FALSE; +GLboolean __GLEW_ARB_shading_language_420pack = GL_FALSE; +GLboolean __GLEW_ARB_shading_language_include = GL_FALSE; +GLboolean __GLEW_ARB_shading_language_packing = GL_FALSE; GLboolean __GLEW_ARB_shadow = GL_FALSE; GLboolean __GLEW_ARB_shadow_ambient = GL_FALSE; +GLboolean __GLEW_ARB_sparse_buffer = GL_FALSE; +GLboolean __GLEW_ARB_sparse_texture = GL_FALSE; +GLboolean __GLEW_ARB_sparse_texture2 = GL_FALSE; +GLboolean __GLEW_ARB_sparse_texture_clamp = GL_FALSE; +GLboolean __GLEW_ARB_spirv_extensions = GL_FALSE; +GLboolean __GLEW_ARB_stencil_texturing = GL_FALSE; +GLboolean __GLEW_ARB_sync = GL_FALSE; +GLboolean __GLEW_ARB_tessellation_shader = GL_FALSE; +GLboolean __GLEW_ARB_texture_barrier = GL_FALSE; GLboolean __GLEW_ARB_texture_border_clamp = GL_FALSE; +GLboolean __GLEW_ARB_texture_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_texture_buffer_object_rgb32 = GL_FALSE; +GLboolean __GLEW_ARB_texture_buffer_range = GL_FALSE; GLboolean __GLEW_ARB_texture_compression = GL_FALSE; +GLboolean __GLEW_ARB_texture_compression_bptc = GL_FALSE; +GLboolean __GLEW_ARB_texture_compression_rgtc = GL_FALSE; GLboolean __GLEW_ARB_texture_cube_map = GL_FALSE; +GLboolean __GLEW_ARB_texture_cube_map_array = GL_FALSE; GLboolean __GLEW_ARB_texture_env_add = GL_FALSE; GLboolean __GLEW_ARB_texture_env_combine = GL_FALSE; GLboolean __GLEW_ARB_texture_env_crossbar = GL_FALSE; GLboolean __GLEW_ARB_texture_env_dot3 = GL_FALSE; +GLboolean __GLEW_ARB_texture_filter_anisotropic = GL_FALSE; +GLboolean __GLEW_ARB_texture_filter_minmax = GL_FALSE; GLboolean __GLEW_ARB_texture_float = GL_FALSE; +GLboolean __GLEW_ARB_texture_gather = GL_FALSE; +GLboolean __GLEW_ARB_texture_mirror_clamp_to_edge = GL_FALSE; GLboolean __GLEW_ARB_texture_mirrored_repeat = GL_FALSE; +GLboolean __GLEW_ARB_texture_multisample = GL_FALSE; GLboolean __GLEW_ARB_texture_non_power_of_two = GL_FALSE; +GLboolean __GLEW_ARB_texture_query_levels = GL_FALSE; +GLboolean __GLEW_ARB_texture_query_lod = GL_FALSE; GLboolean __GLEW_ARB_texture_rectangle = GL_FALSE; +GLboolean __GLEW_ARB_texture_rg = GL_FALSE; +GLboolean __GLEW_ARB_texture_rgb10_a2ui = GL_FALSE; +GLboolean __GLEW_ARB_texture_stencil8 = GL_FALSE; +GLboolean __GLEW_ARB_texture_storage = GL_FALSE; +GLboolean __GLEW_ARB_texture_storage_multisample = GL_FALSE; +GLboolean __GLEW_ARB_texture_swizzle = GL_FALSE; +GLboolean __GLEW_ARB_texture_view = GL_FALSE; +GLboolean __GLEW_ARB_timer_query = GL_FALSE; +GLboolean __GLEW_ARB_transform_feedback2 = GL_FALSE; +GLboolean __GLEW_ARB_transform_feedback3 = GL_FALSE; +GLboolean __GLEW_ARB_transform_feedback_instanced = GL_FALSE; +GLboolean __GLEW_ARB_transform_feedback_overflow_query = GL_FALSE; GLboolean __GLEW_ARB_transpose_matrix = GL_FALSE; +GLboolean __GLEW_ARB_uniform_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_vertex_array_bgra = GL_FALSE; +GLboolean __GLEW_ARB_vertex_array_object = GL_FALSE; +GLboolean __GLEW_ARB_vertex_attrib_64bit = GL_FALSE; +GLboolean __GLEW_ARB_vertex_attrib_binding = GL_FALSE; GLboolean __GLEW_ARB_vertex_blend = GL_FALSE; GLboolean __GLEW_ARB_vertex_buffer_object = GL_FALSE; GLboolean __GLEW_ARB_vertex_program = GL_FALSE; GLboolean __GLEW_ARB_vertex_shader = GL_FALSE; +GLboolean __GLEW_ARB_vertex_type_10f_11f_11f_rev = GL_FALSE; +GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev = GL_FALSE; +GLboolean __GLEW_ARB_viewport_array = GL_FALSE; GLboolean __GLEW_ARB_window_pos = GL_FALSE; +GLboolean __GLEW_ARM_mali_program_binary = GL_FALSE; +GLboolean __GLEW_ARM_mali_shader_binary = GL_FALSE; +GLboolean __GLEW_ARM_rgba8 = GL_FALSE; +GLboolean __GLEW_ARM_shader_framebuffer_fetch = GL_FALSE; +GLboolean __GLEW_ARM_shader_framebuffer_fetch_depth_stencil = GL_FALSE; GLboolean __GLEW_ATIX_point_sprites = GL_FALSE; GLboolean __GLEW_ATIX_texture_env_combine3 = GL_FALSE; GLboolean __GLEW_ATIX_texture_env_route = GL_FALSE; @@ -1598,6 +3563,7 @@ GLboolean __GLEW_ATI_element_array = GL_FALSE; GLboolean __GLEW_ATI_envmap_bumpmap = GL_FALSE; GLboolean __GLEW_ATI_fragment_shader = GL_FALSE; GLboolean __GLEW_ATI_map_object_buffer = GL_FALSE; +GLboolean __GLEW_ATI_meminfo = GL_FALSE; GLboolean __GLEW_ATI_pn_triangles = GL_FALSE; GLboolean __GLEW_ATI_separate_stencil = GL_FALSE; GLboolean __GLEW_ATI_shader_texture_lod = GL_FALSE; @@ -1609,47 +3575,86 @@ GLboolean __GLEW_ATI_texture_mirror_once = GL_FALSE; GLboolean __GLEW_ATI_vertex_array_object = GL_FALSE; GLboolean __GLEW_ATI_vertex_attrib_array_object = GL_FALSE; GLboolean __GLEW_ATI_vertex_streams = GL_FALSE; +GLboolean __GLEW_EGL_KHR_context_flush_control = GL_FALSE; +GLboolean __GLEW_EGL_NV_robustness_video_memory_purge = GL_FALSE; GLboolean __GLEW_EXT_422_pixels = GL_FALSE; GLboolean __GLEW_EXT_Cg_shader = GL_FALSE; +GLboolean __GLEW_EXT_EGL_image_array = GL_FALSE; +GLboolean __GLEW_EXT_YUV_target = GL_FALSE; GLboolean __GLEW_EXT_abgr = GL_FALSE; +GLboolean __GLEW_EXT_base_instance = GL_FALSE; GLboolean __GLEW_EXT_bgra = GL_FALSE; GLboolean __GLEW_EXT_bindable_uniform = GL_FALSE; GLboolean __GLEW_EXT_blend_color = GL_FALSE; GLboolean __GLEW_EXT_blend_equation_separate = GL_FALSE; +GLboolean __GLEW_EXT_blend_func_extended = GL_FALSE; GLboolean __GLEW_EXT_blend_func_separate = GL_FALSE; GLboolean __GLEW_EXT_blend_logic_op = GL_FALSE; GLboolean __GLEW_EXT_blend_minmax = GL_FALSE; GLboolean __GLEW_EXT_blend_subtract = GL_FALSE; +GLboolean __GLEW_EXT_buffer_storage = GL_FALSE; +GLboolean __GLEW_EXT_clear_texture = GL_FALSE; +GLboolean __GLEW_EXT_clip_cull_distance = GL_FALSE; GLboolean __GLEW_EXT_clip_volume_hint = GL_FALSE; GLboolean __GLEW_EXT_cmyka = GL_FALSE; +GLboolean __GLEW_EXT_color_buffer_float = GL_FALSE; +GLboolean __GLEW_EXT_color_buffer_half_float = GL_FALSE; GLboolean __GLEW_EXT_color_subtable = GL_FALSE; GLboolean __GLEW_EXT_compiled_vertex_array = GL_FALSE; +GLboolean __GLEW_EXT_compressed_ETC1_RGB8_sub_texture = GL_FALSE; +GLboolean __GLEW_EXT_conservative_depth = GL_FALSE; GLboolean __GLEW_EXT_convolution = GL_FALSE; GLboolean __GLEW_EXT_coordinate_frame = GL_FALSE; +GLboolean __GLEW_EXT_copy_image = GL_FALSE; GLboolean __GLEW_EXT_copy_texture = GL_FALSE; GLboolean __GLEW_EXT_cull_vertex = GL_FALSE; +GLboolean __GLEW_EXT_debug_label = GL_FALSE; +GLboolean __GLEW_EXT_debug_marker = GL_FALSE; GLboolean __GLEW_EXT_depth_bounds_test = GL_FALSE; +GLboolean __GLEW_EXT_direct_state_access = GL_FALSE; +GLboolean __GLEW_EXT_discard_framebuffer = GL_FALSE; +GLboolean __GLEW_EXT_draw_buffers = GL_FALSE; GLboolean __GLEW_EXT_draw_buffers2 = GL_FALSE; +GLboolean __GLEW_EXT_draw_buffers_indexed = GL_FALSE; +GLboolean __GLEW_EXT_draw_elements_base_vertex = GL_FALSE; GLboolean __GLEW_EXT_draw_instanced = GL_FALSE; GLboolean __GLEW_EXT_draw_range_elements = GL_FALSE; +GLboolean __GLEW_EXT_external_buffer = GL_FALSE; +GLboolean __GLEW_EXT_float_blend = GL_FALSE; GLboolean __GLEW_EXT_fog_coord = GL_FALSE; +GLboolean __GLEW_EXT_frag_depth = GL_FALSE; GLboolean __GLEW_EXT_fragment_lighting = GL_FALSE; GLboolean __GLEW_EXT_framebuffer_blit = GL_FALSE; GLboolean __GLEW_EXT_framebuffer_multisample = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled = GL_FALSE; GLboolean __GLEW_EXT_framebuffer_object = GL_FALSE; GLboolean __GLEW_EXT_framebuffer_sRGB = GL_FALSE; +GLboolean __GLEW_EXT_geometry_point_size = GL_FALSE; +GLboolean __GLEW_EXT_geometry_shader = GL_FALSE; GLboolean __GLEW_EXT_geometry_shader4 = GL_FALSE; GLboolean __GLEW_EXT_gpu_program_parameters = GL_FALSE; GLboolean __GLEW_EXT_gpu_shader4 = GL_FALSE; +GLboolean __GLEW_EXT_gpu_shader5 = GL_FALSE; GLboolean __GLEW_EXT_histogram = GL_FALSE; GLboolean __GLEW_EXT_index_array_formats = GL_FALSE; GLboolean __GLEW_EXT_index_func = GL_FALSE; GLboolean __GLEW_EXT_index_material = GL_FALSE; GLboolean __GLEW_EXT_index_texture = GL_FALSE; +GLboolean __GLEW_EXT_instanced_arrays = GL_FALSE; GLboolean __GLEW_EXT_light_texture = GL_FALSE; +GLboolean __GLEW_EXT_map_buffer_range = GL_FALSE; +GLboolean __GLEW_EXT_memory_object = GL_FALSE; +GLboolean __GLEW_EXT_memory_object_fd = GL_FALSE; +GLboolean __GLEW_EXT_memory_object_win32 = GL_FALSE; GLboolean __GLEW_EXT_misc_attribute = GL_FALSE; GLboolean __GLEW_EXT_multi_draw_arrays = GL_FALSE; +GLboolean __GLEW_EXT_multi_draw_indirect = GL_FALSE; +GLboolean __GLEW_EXT_multiple_textures = GL_FALSE; GLboolean __GLEW_EXT_multisample = GL_FALSE; +GLboolean __GLEW_EXT_multisample_compatibility = GL_FALSE; +GLboolean __GLEW_EXT_multisampled_render_to_texture = GL_FALSE; +GLboolean __GLEW_EXT_multisampled_render_to_texture2 = GL_FALSE; +GLboolean __GLEW_EXT_multiview_draw_buffers = GL_FALSE; GLboolean __GLEW_EXT_packed_depth_stencil = GL_FALSE; GLboolean __GLEW_EXT_packed_float = GL_FALSE; GLboolean __GLEW_EXT_packed_pixels = GL_FALSE; @@ -1659,12 +3664,39 @@ GLboolean __GLEW_EXT_pixel_transform = GL_FALSE; GLboolean __GLEW_EXT_pixel_transform_color_table = GL_FALSE; GLboolean __GLEW_EXT_point_parameters = GL_FALSE; GLboolean __GLEW_EXT_polygon_offset = GL_FALSE; +GLboolean __GLEW_EXT_polygon_offset_clamp = GL_FALSE; +GLboolean __GLEW_EXT_post_depth_coverage = GL_FALSE; +GLboolean __GLEW_EXT_provoking_vertex = GL_FALSE; +GLboolean __GLEW_EXT_pvrtc_sRGB = GL_FALSE; +GLboolean __GLEW_EXT_raster_multisample = GL_FALSE; +GLboolean __GLEW_EXT_read_format_bgra = GL_FALSE; +GLboolean __GLEW_EXT_render_snorm = GL_FALSE; GLboolean __GLEW_EXT_rescale_normal = GL_FALSE; +GLboolean __GLEW_EXT_sRGB = GL_FALSE; +GLboolean __GLEW_EXT_sRGB_write_control = GL_FALSE; GLboolean __GLEW_EXT_scene_marker = GL_FALSE; GLboolean __GLEW_EXT_secondary_color = GL_FALSE; +GLboolean __GLEW_EXT_semaphore = GL_FALSE; +GLboolean __GLEW_EXT_semaphore_fd = GL_FALSE; +GLboolean __GLEW_EXT_semaphore_win32 = GL_FALSE; +GLboolean __GLEW_EXT_separate_shader_objects = GL_FALSE; GLboolean __GLEW_EXT_separate_specular_color = GL_FALSE; +GLboolean __GLEW_EXT_shader_framebuffer_fetch = GL_FALSE; +GLboolean __GLEW_EXT_shader_group_vote = GL_FALSE; +GLboolean __GLEW_EXT_shader_image_load_formatted = GL_FALSE; +GLboolean __GLEW_EXT_shader_image_load_store = GL_FALSE; +GLboolean __GLEW_EXT_shader_implicit_conversions = GL_FALSE; +GLboolean __GLEW_EXT_shader_integer_mix = GL_FALSE; +GLboolean __GLEW_EXT_shader_io_blocks = GL_FALSE; +GLboolean __GLEW_EXT_shader_non_constant_global_initializers = GL_FALSE; +GLboolean __GLEW_EXT_shader_pixel_local_storage = GL_FALSE; +GLboolean __GLEW_EXT_shader_pixel_local_storage2 = GL_FALSE; +GLboolean __GLEW_EXT_shader_texture_lod = GL_FALSE; GLboolean __GLEW_EXT_shadow_funcs = GL_FALSE; +GLboolean __GLEW_EXT_shadow_samplers = GL_FALSE; GLboolean __GLEW_EXT_shared_texture_palette = GL_FALSE; +GLboolean __GLEW_EXT_sparse_texture = GL_FALSE; +GLboolean __GLEW_EXT_sparse_texture2 = GL_FALSE; GLboolean __GLEW_EXT_stencil_clear_tag = GL_FALSE; GLboolean __GLEW_EXT_stencil_two_side = GL_FALSE; GLboolean __GLEW_EXT_stencil_wrap = GL_FALSE; @@ -1673,29 +3705,53 @@ GLboolean __GLEW_EXT_texture = GL_FALSE; GLboolean __GLEW_EXT_texture3D = GL_FALSE; GLboolean __GLEW_EXT_texture_array = GL_FALSE; GLboolean __GLEW_EXT_texture_buffer_object = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_astc_decode_mode = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_astc_decode_mode_rgb9e5 = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_bptc = GL_FALSE; GLboolean __GLEW_EXT_texture_compression_dxt1 = GL_FALSE; GLboolean __GLEW_EXT_texture_compression_latc = GL_FALSE; GLboolean __GLEW_EXT_texture_compression_rgtc = GL_FALSE; GLboolean __GLEW_EXT_texture_compression_s3tc = GL_FALSE; GLboolean __GLEW_EXT_texture_cube_map = GL_FALSE; +GLboolean __GLEW_EXT_texture_cube_map_array = GL_FALSE; GLboolean __GLEW_EXT_texture_edge_clamp = GL_FALSE; GLboolean __GLEW_EXT_texture_env = GL_FALSE; GLboolean __GLEW_EXT_texture_env_add = GL_FALSE; GLboolean __GLEW_EXT_texture_env_combine = GL_FALSE; GLboolean __GLEW_EXT_texture_env_dot3 = GL_FALSE; GLboolean __GLEW_EXT_texture_filter_anisotropic = GL_FALSE; +GLboolean __GLEW_EXT_texture_filter_minmax = GL_FALSE; +GLboolean __GLEW_EXT_texture_format_BGRA8888 = GL_FALSE; GLboolean __GLEW_EXT_texture_integer = GL_FALSE; GLboolean __GLEW_EXT_texture_lod_bias = GL_FALSE; GLboolean __GLEW_EXT_texture_mirror_clamp = GL_FALSE; +GLboolean __GLEW_EXT_texture_norm16 = GL_FALSE; GLboolean __GLEW_EXT_texture_object = GL_FALSE; GLboolean __GLEW_EXT_texture_perturb_normal = GL_FALSE; GLboolean __GLEW_EXT_texture_rectangle = GL_FALSE; +GLboolean __GLEW_EXT_texture_rg = GL_FALSE; GLboolean __GLEW_EXT_texture_sRGB = GL_FALSE; +GLboolean __GLEW_EXT_texture_sRGB_R8 = GL_FALSE; +GLboolean __GLEW_EXT_texture_sRGB_RG8 = GL_FALSE; +GLboolean __GLEW_EXT_texture_sRGB_decode = GL_FALSE; GLboolean __GLEW_EXT_texture_shared_exponent = GL_FALSE; +GLboolean __GLEW_EXT_texture_snorm = GL_FALSE; +GLboolean __GLEW_EXT_texture_storage = GL_FALSE; +GLboolean __GLEW_EXT_texture_swizzle = GL_FALSE; +GLboolean __GLEW_EXT_texture_type_2_10_10_10_REV = GL_FALSE; +GLboolean __GLEW_EXT_texture_view = GL_FALSE; GLboolean __GLEW_EXT_timer_query = GL_FALSE; +GLboolean __GLEW_EXT_transform_feedback = GL_FALSE; +GLboolean __GLEW_EXT_unpack_subimage = GL_FALSE; GLboolean __GLEW_EXT_vertex_array = GL_FALSE; +GLboolean __GLEW_EXT_vertex_array_bgra = GL_FALSE; +GLboolean __GLEW_EXT_vertex_array_setXXX = GL_FALSE; +GLboolean __GLEW_EXT_vertex_attrib_64bit = GL_FALSE; GLboolean __GLEW_EXT_vertex_shader = GL_FALSE; GLboolean __GLEW_EXT_vertex_weighting = GL_FALSE; +GLboolean __GLEW_EXT_win32_keyed_mutex = GL_FALSE; +GLboolean __GLEW_EXT_window_rectangles = GL_FALSE; +GLboolean __GLEW_EXT_x11_sync_object = GL_FALSE; GLboolean __GLEW_GREMEDY_frame_terminator = GL_FALSE; GLboolean __GLEW_GREMEDY_string_marker = GL_FALSE; GLboolean __GLEW_HP_convolution_border_modes = GL_FALSE; @@ -1710,77 +3766,214 @@ GLboolean __GLEW_IBM_texture_mirrored_repeat = GL_FALSE; GLboolean __GLEW_IBM_vertex_array_lists = GL_FALSE; GLboolean __GLEW_INGR_color_clamp = GL_FALSE; GLboolean __GLEW_INGR_interlace_read = GL_FALSE; +GLboolean __GLEW_INTEL_conservative_rasterization = GL_FALSE; +GLboolean __GLEW_INTEL_fragment_shader_ordering = GL_FALSE; +GLboolean __GLEW_INTEL_framebuffer_CMAA = GL_FALSE; +GLboolean __GLEW_INTEL_map_texture = GL_FALSE; GLboolean __GLEW_INTEL_parallel_arrays = GL_FALSE; +GLboolean __GLEW_INTEL_performance_query = GL_FALSE; GLboolean __GLEW_INTEL_texture_scissor = GL_FALSE; +GLboolean __GLEW_KHR_blend_equation_advanced = GL_FALSE; +GLboolean __GLEW_KHR_blend_equation_advanced_coherent = GL_FALSE; +GLboolean __GLEW_KHR_context_flush_control = GL_FALSE; +GLboolean __GLEW_KHR_debug = GL_FALSE; +GLboolean __GLEW_KHR_no_error = GL_FALSE; +GLboolean __GLEW_KHR_parallel_shader_compile = GL_FALSE; +GLboolean __GLEW_KHR_robust_buffer_access_behavior = GL_FALSE; +GLboolean __GLEW_KHR_robustness = GL_FALSE; +GLboolean __GLEW_KHR_texture_compression_astc_hdr = GL_FALSE; +GLboolean __GLEW_KHR_texture_compression_astc_ldr = GL_FALSE; +GLboolean __GLEW_KHR_texture_compression_astc_sliced_3d = GL_FALSE; GLboolean __GLEW_KTX_buffer_region = GL_FALSE; GLboolean __GLEW_MESAX_texture_stack = GL_FALSE; GLboolean __GLEW_MESA_pack_invert = GL_FALSE; GLboolean __GLEW_MESA_resize_buffers = GL_FALSE; +GLboolean __GLEW_MESA_shader_integer_functions = GL_FALSE; GLboolean __GLEW_MESA_window_pos = GL_FALSE; GLboolean __GLEW_MESA_ycbcr_texture = GL_FALSE; +GLboolean __GLEW_NVX_blend_equation_advanced_multi_draw_buffers = GL_FALSE; +GLboolean __GLEW_NVX_conditional_render = GL_FALSE; +GLboolean __GLEW_NVX_gpu_memory_info = GL_FALSE; +GLboolean __GLEW_NVX_linked_gpu_multicast = GL_FALSE; +GLboolean __GLEW_NV_3dvision_settings = GL_FALSE; +GLboolean __GLEW_NV_EGL_stream_consumer_external = GL_FALSE; +GLboolean __GLEW_NV_alpha_to_coverage_dither_control = GL_FALSE; +GLboolean __GLEW_NV_bgr = GL_FALSE; +GLboolean __GLEW_NV_bindless_multi_draw_indirect = GL_FALSE; +GLboolean __GLEW_NV_bindless_multi_draw_indirect_count = GL_FALSE; +GLboolean __GLEW_NV_bindless_texture = GL_FALSE; +GLboolean __GLEW_NV_blend_equation_advanced = GL_FALSE; +GLboolean __GLEW_NV_blend_equation_advanced_coherent = GL_FALSE; +GLboolean __GLEW_NV_blend_minmax_factor = GL_FALSE; GLboolean __GLEW_NV_blend_square = GL_FALSE; +GLboolean __GLEW_NV_clip_space_w_scaling = GL_FALSE; +GLboolean __GLEW_NV_command_list = GL_FALSE; +GLboolean __GLEW_NV_compute_program5 = GL_FALSE; +GLboolean __GLEW_NV_conditional_render = GL_FALSE; +GLboolean __GLEW_NV_conservative_raster = GL_FALSE; +GLboolean __GLEW_NV_conservative_raster_dilate = GL_FALSE; +GLboolean __GLEW_NV_conservative_raster_pre_snap_triangles = GL_FALSE; +GLboolean __GLEW_NV_copy_buffer = GL_FALSE; GLboolean __GLEW_NV_copy_depth_to_color = GL_FALSE; +GLboolean __GLEW_NV_copy_image = GL_FALSE; +GLboolean __GLEW_NV_deep_texture3D = GL_FALSE; GLboolean __GLEW_NV_depth_buffer_float = GL_FALSE; GLboolean __GLEW_NV_depth_clamp = GL_FALSE; GLboolean __GLEW_NV_depth_range_unclamped = GL_FALSE; +GLboolean __GLEW_NV_draw_buffers = GL_FALSE; +GLboolean __GLEW_NV_draw_instanced = GL_FALSE; +GLboolean __GLEW_NV_draw_texture = GL_FALSE; +GLboolean __GLEW_NV_draw_vulkan_image = GL_FALSE; GLboolean __GLEW_NV_evaluators = GL_FALSE; +GLboolean __GLEW_NV_explicit_attrib_location = GL_FALSE; +GLboolean __GLEW_NV_explicit_multisample = GL_FALSE; +GLboolean __GLEW_NV_fbo_color_attachments = GL_FALSE; GLboolean __GLEW_NV_fence = GL_FALSE; +GLboolean __GLEW_NV_fill_rectangle = GL_FALSE; GLboolean __GLEW_NV_float_buffer = GL_FALSE; GLboolean __GLEW_NV_fog_distance = GL_FALSE; +GLboolean __GLEW_NV_fragment_coverage_to_color = GL_FALSE; GLboolean __GLEW_NV_fragment_program = GL_FALSE; GLboolean __GLEW_NV_fragment_program2 = GL_FALSE; GLboolean __GLEW_NV_fragment_program4 = GL_FALSE; GLboolean __GLEW_NV_fragment_program_option = GL_FALSE; +GLboolean __GLEW_NV_fragment_shader_interlock = GL_FALSE; +GLboolean __GLEW_NV_framebuffer_blit = GL_FALSE; +GLboolean __GLEW_NV_framebuffer_mixed_samples = GL_FALSE; +GLboolean __GLEW_NV_framebuffer_multisample = GL_FALSE; GLboolean __GLEW_NV_framebuffer_multisample_coverage = GL_FALSE; +GLboolean __GLEW_NV_generate_mipmap_sRGB = GL_FALSE; GLboolean __GLEW_NV_geometry_program4 = GL_FALSE; GLboolean __GLEW_NV_geometry_shader4 = GL_FALSE; +GLboolean __GLEW_NV_geometry_shader_passthrough = GL_FALSE; +GLboolean __GLEW_NV_gpu_multicast = GL_FALSE; GLboolean __GLEW_NV_gpu_program4 = GL_FALSE; +GLboolean __GLEW_NV_gpu_program5 = GL_FALSE; +GLboolean __GLEW_NV_gpu_program5_mem_extended = GL_FALSE; +GLboolean __GLEW_NV_gpu_program_fp64 = GL_FALSE; +GLboolean __GLEW_NV_gpu_shader5 = GL_FALSE; GLboolean __GLEW_NV_half_float = GL_FALSE; +GLboolean __GLEW_NV_image_formats = GL_FALSE; +GLboolean __GLEW_NV_instanced_arrays = GL_FALSE; +GLboolean __GLEW_NV_internalformat_sample_query = GL_FALSE; GLboolean __GLEW_NV_light_max_exponent = GL_FALSE; +GLboolean __GLEW_NV_multisample_coverage = GL_FALSE; GLboolean __GLEW_NV_multisample_filter_hint = GL_FALSE; +GLboolean __GLEW_NV_non_square_matrices = GL_FALSE; GLboolean __GLEW_NV_occlusion_query = GL_FALSE; +GLboolean __GLEW_NV_pack_subimage = GL_FALSE; GLboolean __GLEW_NV_packed_depth_stencil = GL_FALSE; +GLboolean __GLEW_NV_packed_float = GL_FALSE; +GLboolean __GLEW_NV_packed_float_linear = GL_FALSE; GLboolean __GLEW_NV_parameter_buffer_object = GL_FALSE; +GLboolean __GLEW_NV_parameter_buffer_object2 = GL_FALSE; +GLboolean __GLEW_NV_path_rendering = GL_FALSE; +GLboolean __GLEW_NV_path_rendering_shared_edge = GL_FALSE; +GLboolean __GLEW_NV_pixel_buffer_object = GL_FALSE; GLboolean __GLEW_NV_pixel_data_range = GL_FALSE; +GLboolean __GLEW_NV_platform_binary = GL_FALSE; GLboolean __GLEW_NV_point_sprite = GL_FALSE; +GLboolean __GLEW_NV_polygon_mode = GL_FALSE; +GLboolean __GLEW_NV_present_video = GL_FALSE; GLboolean __GLEW_NV_primitive_restart = GL_FALSE; +GLboolean __GLEW_NV_read_depth = GL_FALSE; +GLboolean __GLEW_NV_read_depth_stencil = GL_FALSE; +GLboolean __GLEW_NV_read_stencil = GL_FALSE; GLboolean __GLEW_NV_register_combiners = GL_FALSE; GLboolean __GLEW_NV_register_combiners2 = GL_FALSE; +GLboolean __GLEW_NV_robustness_video_memory_purge = GL_FALSE; +GLboolean __GLEW_NV_sRGB_formats = GL_FALSE; +GLboolean __GLEW_NV_sample_locations = GL_FALSE; +GLboolean __GLEW_NV_sample_mask_override_coverage = GL_FALSE; +GLboolean __GLEW_NV_shader_atomic_counters = GL_FALSE; +GLboolean __GLEW_NV_shader_atomic_float = GL_FALSE; +GLboolean __GLEW_NV_shader_atomic_float64 = GL_FALSE; +GLboolean __GLEW_NV_shader_atomic_fp16_vector = GL_FALSE; +GLboolean __GLEW_NV_shader_atomic_int64 = GL_FALSE; +GLboolean __GLEW_NV_shader_buffer_load = GL_FALSE; +GLboolean __GLEW_NV_shader_noperspective_interpolation = GL_FALSE; +GLboolean __GLEW_NV_shader_storage_buffer_object = GL_FALSE; +GLboolean __GLEW_NV_shader_thread_group = GL_FALSE; +GLboolean __GLEW_NV_shader_thread_shuffle = GL_FALSE; +GLboolean __GLEW_NV_shadow_samplers_array = GL_FALSE; +GLboolean __GLEW_NV_shadow_samplers_cube = GL_FALSE; +GLboolean __GLEW_NV_stereo_view_rendering = GL_FALSE; +GLboolean __GLEW_NV_tessellation_program5 = GL_FALSE; GLboolean __GLEW_NV_texgen_emboss = GL_FALSE; GLboolean __GLEW_NV_texgen_reflection = GL_FALSE; +GLboolean __GLEW_NV_texture_array = GL_FALSE; +GLboolean __GLEW_NV_texture_barrier = GL_FALSE; +GLboolean __GLEW_NV_texture_border_clamp = GL_FALSE; +GLboolean __GLEW_NV_texture_compression_latc = GL_FALSE; +GLboolean __GLEW_NV_texture_compression_s3tc = GL_FALSE; +GLboolean __GLEW_NV_texture_compression_s3tc_update = GL_FALSE; GLboolean __GLEW_NV_texture_compression_vtc = GL_FALSE; GLboolean __GLEW_NV_texture_env_combine4 = GL_FALSE; GLboolean __GLEW_NV_texture_expand_normal = GL_FALSE; +GLboolean __GLEW_NV_texture_multisample = GL_FALSE; +GLboolean __GLEW_NV_texture_npot_2D_mipmap = GL_FALSE; GLboolean __GLEW_NV_texture_rectangle = GL_FALSE; +GLboolean __GLEW_NV_texture_rectangle_compressed = GL_FALSE; GLboolean __GLEW_NV_texture_shader = GL_FALSE; GLboolean __GLEW_NV_texture_shader2 = GL_FALSE; GLboolean __GLEW_NV_texture_shader3 = GL_FALSE; GLboolean __GLEW_NV_transform_feedback = GL_FALSE; +GLboolean __GLEW_NV_transform_feedback2 = GL_FALSE; +GLboolean __GLEW_NV_uniform_buffer_unified_memory = GL_FALSE; +GLboolean __GLEW_NV_vdpau_interop = GL_FALSE; GLboolean __GLEW_NV_vertex_array_range = GL_FALSE; GLboolean __GLEW_NV_vertex_array_range2 = GL_FALSE; +GLboolean __GLEW_NV_vertex_attrib_integer_64bit = GL_FALSE; +GLboolean __GLEW_NV_vertex_buffer_unified_memory = GL_FALSE; GLboolean __GLEW_NV_vertex_program = GL_FALSE; GLboolean __GLEW_NV_vertex_program1_1 = GL_FALSE; GLboolean __GLEW_NV_vertex_program2 = GL_FALSE; GLboolean __GLEW_NV_vertex_program2_option = GL_FALSE; GLboolean __GLEW_NV_vertex_program3 = GL_FALSE; GLboolean __GLEW_NV_vertex_program4 = GL_FALSE; +GLboolean __GLEW_NV_video_capture = GL_FALSE; +GLboolean __GLEW_NV_viewport_array = GL_FALSE; +GLboolean __GLEW_NV_viewport_array2 = GL_FALSE; +GLboolean __GLEW_NV_viewport_swizzle = GL_FALSE; GLboolean __GLEW_OES_byte_coordinates = GL_FALSE; -GLboolean __GLEW_OES_compressed_paletted_texture = GL_FALSE; -GLboolean __GLEW_OES_read_format = GL_FALSE; -GLboolean __GLEW_OES_single_precision = GL_FALSE; GLboolean __GLEW_OML_interlace = GL_FALSE; GLboolean __GLEW_OML_resample = GL_FALSE; GLboolean __GLEW_OML_subsample = GL_FALSE; +GLboolean __GLEW_OVR_multiview = GL_FALSE; +GLboolean __GLEW_OVR_multiview2 = GL_FALSE; +GLboolean __GLEW_OVR_multiview_multisampled_render_to_texture = GL_FALSE; GLboolean __GLEW_PGI_misc_hints = GL_FALSE; GLboolean __GLEW_PGI_vertex_hints = GL_FALSE; +GLboolean __GLEW_QCOM_alpha_test = GL_FALSE; +GLboolean __GLEW_QCOM_binning_control = GL_FALSE; +GLboolean __GLEW_QCOM_driver_control = GL_FALSE; +GLboolean __GLEW_QCOM_extended_get = GL_FALSE; +GLboolean __GLEW_QCOM_extended_get2 = GL_FALSE; +GLboolean __GLEW_QCOM_framebuffer_foveated = GL_FALSE; +GLboolean __GLEW_QCOM_perfmon_global_mode = GL_FALSE; +GLboolean __GLEW_QCOM_shader_framebuffer_fetch_noncoherent = GL_FALSE; +GLboolean __GLEW_QCOM_tiled_rendering = GL_FALSE; +GLboolean __GLEW_QCOM_writeonly_rendering = GL_FALSE; +GLboolean __GLEW_REGAL_ES1_0_compatibility = GL_FALSE; +GLboolean __GLEW_REGAL_ES1_1_compatibility = GL_FALSE; +GLboolean __GLEW_REGAL_enable = GL_FALSE; +GLboolean __GLEW_REGAL_error_string = GL_FALSE; +GLboolean __GLEW_REGAL_extension_query = GL_FALSE; +GLboolean __GLEW_REGAL_log = GL_FALSE; +GLboolean __GLEW_REGAL_proc_address = GL_FALSE; GLboolean __GLEW_REND_screen_coordinates = GL_FALSE; GLboolean __GLEW_S3_s3tc = GL_FALSE; +GLboolean __GLEW_SGIS_clip_band_hint = GL_FALSE; GLboolean __GLEW_SGIS_color_range = GL_FALSE; GLboolean __GLEW_SGIS_detail_texture = GL_FALSE; GLboolean __GLEW_SGIS_fog_function = GL_FALSE; GLboolean __GLEW_SGIS_generate_mipmap = GL_FALSE; +GLboolean __GLEW_SGIS_line_texgen = GL_FALSE; GLboolean __GLEW_SGIS_multisample = GL_FALSE; +GLboolean __GLEW_SGIS_multitexture = GL_FALSE; GLboolean __GLEW_SGIS_pixel_texture = GL_FALSE; +GLboolean __GLEW_SGIS_point_line_texgen = GL_FALSE; +GLboolean __GLEW_SGIS_shared_multisample = GL_FALSE; GLboolean __GLEW_SGIS_sharpen_texture = GL_FALSE; GLboolean __GLEW_SGIS_texture4D = GL_FALSE; GLboolean __GLEW_SGIS_texture_border_clamp = GL_FALSE; @@ -1791,36 +3984,90 @@ GLboolean __GLEW_SGIS_texture_select = GL_FALSE; GLboolean __GLEW_SGIX_async = GL_FALSE; GLboolean __GLEW_SGIX_async_histogram = GL_FALSE; GLboolean __GLEW_SGIX_async_pixel = GL_FALSE; +GLboolean __GLEW_SGIX_bali_g_instruments = GL_FALSE; +GLboolean __GLEW_SGIX_bali_r_instruments = GL_FALSE; +GLboolean __GLEW_SGIX_bali_timer_instruments = GL_FALSE; GLboolean __GLEW_SGIX_blend_alpha_minmax = GL_FALSE; +GLboolean __GLEW_SGIX_blend_cadd = GL_FALSE; +GLboolean __GLEW_SGIX_blend_cmultiply = GL_FALSE; +GLboolean __GLEW_SGIX_calligraphic_fragment = GL_FALSE; GLboolean __GLEW_SGIX_clipmap = GL_FALSE; +GLboolean __GLEW_SGIX_color_matrix_accuracy = GL_FALSE; +GLboolean __GLEW_SGIX_color_table_index_mode = GL_FALSE; +GLboolean __GLEW_SGIX_complex_polar = GL_FALSE; +GLboolean __GLEW_SGIX_convolution_accuracy = GL_FALSE; +GLboolean __GLEW_SGIX_cube_map = GL_FALSE; +GLboolean __GLEW_SGIX_cylinder_texgen = GL_FALSE; +GLboolean __GLEW_SGIX_datapipe = GL_FALSE; +GLboolean __GLEW_SGIX_decimation = GL_FALSE; +GLboolean __GLEW_SGIX_depth_pass_instrument = GL_FALSE; GLboolean __GLEW_SGIX_depth_texture = GL_FALSE; +GLboolean __GLEW_SGIX_dvc = GL_FALSE; GLboolean __GLEW_SGIX_flush_raster = GL_FALSE; +GLboolean __GLEW_SGIX_fog_blend = GL_FALSE; +GLboolean __GLEW_SGIX_fog_factor_to_alpha = GL_FALSE; +GLboolean __GLEW_SGIX_fog_layers = GL_FALSE; GLboolean __GLEW_SGIX_fog_offset = GL_FALSE; +GLboolean __GLEW_SGIX_fog_patchy = GL_FALSE; +GLboolean __GLEW_SGIX_fog_scale = GL_FALSE; GLboolean __GLEW_SGIX_fog_texture = GL_FALSE; +GLboolean __GLEW_SGIX_fragment_lighting_space = GL_FALSE; GLboolean __GLEW_SGIX_fragment_specular_lighting = GL_FALSE; +GLboolean __GLEW_SGIX_fragments_instrument = GL_FALSE; GLboolean __GLEW_SGIX_framezoom = GL_FALSE; +GLboolean __GLEW_SGIX_icc_texture = GL_FALSE; +GLboolean __GLEW_SGIX_igloo_interface = GL_FALSE; +GLboolean __GLEW_SGIX_image_compression = GL_FALSE; +GLboolean __GLEW_SGIX_impact_pixel_texture = GL_FALSE; +GLboolean __GLEW_SGIX_instrument_error = GL_FALSE; GLboolean __GLEW_SGIX_interlace = GL_FALSE; GLboolean __GLEW_SGIX_ir_instrument1 = GL_FALSE; +GLboolean __GLEW_SGIX_line_quality_hint = GL_FALSE; GLboolean __GLEW_SGIX_list_priority = GL_FALSE; +GLboolean __GLEW_SGIX_mpeg1 = GL_FALSE; +GLboolean __GLEW_SGIX_mpeg2 = GL_FALSE; +GLboolean __GLEW_SGIX_nonlinear_lighting_pervertex = GL_FALSE; +GLboolean __GLEW_SGIX_nurbs_eval = GL_FALSE; +GLboolean __GLEW_SGIX_occlusion_instrument = GL_FALSE; +GLboolean __GLEW_SGIX_packed_6bytes = GL_FALSE; GLboolean __GLEW_SGIX_pixel_texture = GL_FALSE; GLboolean __GLEW_SGIX_pixel_texture_bits = GL_FALSE; +GLboolean __GLEW_SGIX_pixel_texture_lod = GL_FALSE; +GLboolean __GLEW_SGIX_pixel_tiles = GL_FALSE; +GLboolean __GLEW_SGIX_polynomial_ffd = GL_FALSE; +GLboolean __GLEW_SGIX_quad_mesh = GL_FALSE; GLboolean __GLEW_SGIX_reference_plane = GL_FALSE; GLboolean __GLEW_SGIX_resample = GL_FALSE; +GLboolean __GLEW_SGIX_scalebias_hint = GL_FALSE; GLboolean __GLEW_SGIX_shadow = GL_FALSE; GLboolean __GLEW_SGIX_shadow_ambient = GL_FALSE; +GLboolean __GLEW_SGIX_slim = GL_FALSE; +GLboolean __GLEW_SGIX_spotlight_cutoff = GL_FALSE; GLboolean __GLEW_SGIX_sprite = GL_FALSE; +GLboolean __GLEW_SGIX_subdiv_patch = GL_FALSE; +GLboolean __GLEW_SGIX_subsample = GL_FALSE; GLboolean __GLEW_SGIX_tag_sample_buffer = GL_FALSE; GLboolean __GLEW_SGIX_texture_add_env = GL_FALSE; GLboolean __GLEW_SGIX_texture_coordinate_clamp = GL_FALSE; GLboolean __GLEW_SGIX_texture_lod_bias = GL_FALSE; +GLboolean __GLEW_SGIX_texture_mipmap_anisotropic = GL_FALSE; GLboolean __GLEW_SGIX_texture_multi_buffer = GL_FALSE; +GLboolean __GLEW_SGIX_texture_phase = GL_FALSE; GLboolean __GLEW_SGIX_texture_range = GL_FALSE; GLboolean __GLEW_SGIX_texture_scale_bias = GL_FALSE; +GLboolean __GLEW_SGIX_texture_supersample = GL_FALSE; +GLboolean __GLEW_SGIX_vector_ops = GL_FALSE; +GLboolean __GLEW_SGIX_vertex_array_object = GL_FALSE; GLboolean __GLEW_SGIX_vertex_preclip = GL_FALSE; GLboolean __GLEW_SGIX_vertex_preclip_hint = GL_FALSE; GLboolean __GLEW_SGIX_ycrcb = GL_FALSE; +GLboolean __GLEW_SGIX_ycrcb_subsample = GL_FALSE; +GLboolean __GLEW_SGIX_ycrcba = GL_FALSE; GLboolean __GLEW_SGI_color_matrix = GL_FALSE; GLboolean __GLEW_SGI_color_table = GL_FALSE; +GLboolean __GLEW_SGI_complex = GL_FALSE; +GLboolean __GLEW_SGI_complex_type = GL_FALSE; +GLboolean __GLEW_SGI_fft = GL_FALSE; GLboolean __GLEW_SGI_texture_color_table = GL_FALSE; GLboolean __GLEW_SUNX_constant_data = GL_FALSE; GLboolean __GLEW_SUN_convolution_border_modes = GL_FALSE; @@ -1831,14 +4078,5181 @@ GLboolean __GLEW_SUN_slice_accum = GL_FALSE; GLboolean __GLEW_SUN_triangle_list = GL_FALSE; GLboolean __GLEW_SUN_vertex = GL_FALSE; GLboolean __GLEW_WIN_phong_shading = GL_FALSE; +GLboolean __GLEW_WIN_scene_markerXXX = GL_FALSE; GLboolean __GLEW_WIN_specular_fog = GL_FALSE; GLboolean __GLEW_WIN_swap_hint = GL_FALSE; -#endif /* !GLEW_MX */ +static const char * _glewExtensionLookup[] = { +#ifdef GL_VERSION_1_2 + "GL_VERSION_1_2", +#endif +#ifdef GL_VERSION_1_2_1 + "GL_VERSION_1_2_1", +#endif +#ifdef GL_VERSION_1_3 + "GL_VERSION_1_3", +#endif +#ifdef GL_VERSION_1_4 + "GL_VERSION_1_4", +#endif +#ifdef GL_VERSION_1_5 + "GL_VERSION_1_5", +#endif +#ifdef GL_VERSION_2_0 + "GL_VERSION_2_0", +#endif +#ifdef GL_VERSION_2_1 + "GL_VERSION_2_1", +#endif +#ifdef GL_VERSION_3_0 + "GL_VERSION_3_0", +#endif +#ifdef GL_VERSION_3_1 + "GL_VERSION_3_1", +#endif +#ifdef GL_VERSION_3_2 + "GL_VERSION_3_2", +#endif +#ifdef GL_VERSION_3_3 + "GL_VERSION_3_3", +#endif +#ifdef GL_VERSION_4_0 + "GL_VERSION_4_0", +#endif +#ifdef GL_VERSION_4_1 + "GL_VERSION_4_1", +#endif +#ifdef GL_VERSION_4_2 + "GL_VERSION_4_2", +#endif +#ifdef GL_VERSION_4_3 + "GL_VERSION_4_3", +#endif +#ifdef GL_VERSION_4_4 + "GL_VERSION_4_4", +#endif +#ifdef GL_VERSION_4_5 + "GL_VERSION_4_5", +#endif +#ifdef GL_VERSION_4_6 + "GL_VERSION_4_6", +#endif +#ifdef GL_3DFX_multisample + "GL_3DFX_multisample", +#endif +#ifdef GL_3DFX_tbuffer + "GL_3DFX_tbuffer", +#endif +#ifdef GL_3DFX_texture_compression_FXT1 + "GL_3DFX_texture_compression_FXT1", +#endif +#ifdef GL_AMD_blend_minmax_factor + "GL_AMD_blend_minmax_factor", +#endif +#ifdef GL_AMD_compressed_3DC_texture + "GL_AMD_compressed_3DC_texture", +#endif +#ifdef GL_AMD_compressed_ATC_texture + "GL_AMD_compressed_ATC_texture", +#endif +#ifdef GL_AMD_conservative_depth + "GL_AMD_conservative_depth", +#endif +#ifdef GL_AMD_debug_output + "GL_AMD_debug_output", +#endif +#ifdef GL_AMD_depth_clamp_separate + "GL_AMD_depth_clamp_separate", +#endif +#ifdef GL_AMD_draw_buffers_blend + "GL_AMD_draw_buffers_blend", +#endif +#ifdef GL_AMD_framebuffer_sample_positions + "GL_AMD_framebuffer_sample_positions", +#endif +#ifdef GL_AMD_gcn_shader + "GL_AMD_gcn_shader", +#endif +#ifdef GL_AMD_gpu_shader_half_float + "GL_AMD_gpu_shader_half_float", +#endif +#ifdef GL_AMD_gpu_shader_int16 + "GL_AMD_gpu_shader_int16", +#endif +#ifdef GL_AMD_gpu_shader_int64 + "GL_AMD_gpu_shader_int64", +#endif +#ifdef GL_AMD_interleaved_elements + "GL_AMD_interleaved_elements", +#endif +#ifdef GL_AMD_multi_draw_indirect + "GL_AMD_multi_draw_indirect", +#endif +#ifdef GL_AMD_name_gen_delete + "GL_AMD_name_gen_delete", +#endif +#ifdef GL_AMD_occlusion_query_event + "GL_AMD_occlusion_query_event", +#endif +#ifdef GL_AMD_performance_monitor + "GL_AMD_performance_monitor", +#endif +#ifdef GL_AMD_pinned_memory + "GL_AMD_pinned_memory", +#endif +#ifdef GL_AMD_program_binary_Z400 + "GL_AMD_program_binary_Z400", +#endif +#ifdef GL_AMD_query_buffer_object + "GL_AMD_query_buffer_object", +#endif +#ifdef GL_AMD_sample_positions + "GL_AMD_sample_positions", +#endif +#ifdef GL_AMD_seamless_cubemap_per_texture + "GL_AMD_seamless_cubemap_per_texture", +#endif +#ifdef GL_AMD_shader_atomic_counter_ops + "GL_AMD_shader_atomic_counter_ops", +#endif +#ifdef GL_AMD_shader_ballot + "GL_AMD_shader_ballot", +#endif +#ifdef GL_AMD_shader_explicit_vertex_parameter + "GL_AMD_shader_explicit_vertex_parameter", +#endif +#ifdef GL_AMD_shader_stencil_export + "GL_AMD_shader_stencil_export", +#endif +#ifdef GL_AMD_shader_stencil_value_export + "GL_AMD_shader_stencil_value_export", +#endif +#ifdef GL_AMD_shader_trinary_minmax + "GL_AMD_shader_trinary_minmax", +#endif +#ifdef GL_AMD_sparse_texture + "GL_AMD_sparse_texture", +#endif +#ifdef GL_AMD_stencil_operation_extended + "GL_AMD_stencil_operation_extended", +#endif +#ifdef GL_AMD_texture_gather_bias_lod + "GL_AMD_texture_gather_bias_lod", +#endif +#ifdef GL_AMD_texture_texture4 + "GL_AMD_texture_texture4", +#endif +#ifdef GL_AMD_transform_feedback3_lines_triangles + "GL_AMD_transform_feedback3_lines_triangles", +#endif +#ifdef GL_AMD_transform_feedback4 + "GL_AMD_transform_feedback4", +#endif +#ifdef GL_AMD_vertex_shader_layer + "GL_AMD_vertex_shader_layer", +#endif +#ifdef GL_AMD_vertex_shader_tessellator + "GL_AMD_vertex_shader_tessellator", +#endif +#ifdef GL_AMD_vertex_shader_viewport_index + "GL_AMD_vertex_shader_viewport_index", +#endif +#ifdef GL_ANDROID_extension_pack_es31a + "GL_ANDROID_extension_pack_es31a", +#endif +#ifdef GL_ANGLE_depth_texture + "GL_ANGLE_depth_texture", +#endif +#ifdef GL_ANGLE_framebuffer_blit + "GL_ANGLE_framebuffer_blit", +#endif +#ifdef GL_ANGLE_framebuffer_multisample + "GL_ANGLE_framebuffer_multisample", +#endif +#ifdef GL_ANGLE_instanced_arrays + "GL_ANGLE_instanced_arrays", +#endif +#ifdef GL_ANGLE_pack_reverse_row_order + "GL_ANGLE_pack_reverse_row_order", +#endif +#ifdef GL_ANGLE_program_binary + "GL_ANGLE_program_binary", +#endif +#ifdef GL_ANGLE_texture_compression_dxt1 + "GL_ANGLE_texture_compression_dxt1", +#endif +#ifdef GL_ANGLE_texture_compression_dxt3 + "GL_ANGLE_texture_compression_dxt3", +#endif +#ifdef GL_ANGLE_texture_compression_dxt5 + "GL_ANGLE_texture_compression_dxt5", +#endif +#ifdef GL_ANGLE_texture_usage + "GL_ANGLE_texture_usage", +#endif +#ifdef GL_ANGLE_timer_query + "GL_ANGLE_timer_query", +#endif +#ifdef GL_ANGLE_translated_shader_source + "GL_ANGLE_translated_shader_source", +#endif +#ifdef GL_APPLE_aux_depth_stencil + "GL_APPLE_aux_depth_stencil", +#endif +#ifdef GL_APPLE_client_storage + "GL_APPLE_client_storage", +#endif +#ifdef GL_APPLE_clip_distance + "GL_APPLE_clip_distance", +#endif +#ifdef GL_APPLE_color_buffer_packed_float + "GL_APPLE_color_buffer_packed_float", +#endif +#ifdef GL_APPLE_copy_texture_levels + "GL_APPLE_copy_texture_levels", +#endif +#ifdef GL_APPLE_element_array + "GL_APPLE_element_array", +#endif +#ifdef GL_APPLE_fence + "GL_APPLE_fence", +#endif +#ifdef GL_APPLE_float_pixels + "GL_APPLE_float_pixels", +#endif +#ifdef GL_APPLE_flush_buffer_range + "GL_APPLE_flush_buffer_range", +#endif +#ifdef GL_APPLE_framebuffer_multisample + "GL_APPLE_framebuffer_multisample", +#endif +#ifdef GL_APPLE_object_purgeable + "GL_APPLE_object_purgeable", +#endif +#ifdef GL_APPLE_pixel_buffer + "GL_APPLE_pixel_buffer", +#endif +#ifdef GL_APPLE_rgb_422 + "GL_APPLE_rgb_422", +#endif +#ifdef GL_APPLE_row_bytes + "GL_APPLE_row_bytes", +#endif +#ifdef GL_APPLE_specular_vector + "GL_APPLE_specular_vector", +#endif +#ifdef GL_APPLE_sync + "GL_APPLE_sync", +#endif +#ifdef GL_APPLE_texture_2D_limited_npot + "GL_APPLE_texture_2D_limited_npot", +#endif +#ifdef GL_APPLE_texture_format_BGRA8888 + "GL_APPLE_texture_format_BGRA8888", +#endif +#ifdef GL_APPLE_texture_max_level + "GL_APPLE_texture_max_level", +#endif +#ifdef GL_APPLE_texture_packed_float + "GL_APPLE_texture_packed_float", +#endif +#ifdef GL_APPLE_texture_range + "GL_APPLE_texture_range", +#endif +#ifdef GL_APPLE_transform_hint + "GL_APPLE_transform_hint", +#endif +#ifdef GL_APPLE_vertex_array_object + "GL_APPLE_vertex_array_object", +#endif +#ifdef GL_APPLE_vertex_array_range + "GL_APPLE_vertex_array_range", +#endif +#ifdef GL_APPLE_vertex_program_evaluators + "GL_APPLE_vertex_program_evaluators", +#endif +#ifdef GL_APPLE_ycbcr_422 + "GL_APPLE_ycbcr_422", +#endif +#ifdef GL_ARB_ES2_compatibility + "GL_ARB_ES2_compatibility", +#endif +#ifdef GL_ARB_ES3_1_compatibility + "GL_ARB_ES3_1_compatibility", +#endif +#ifdef GL_ARB_ES3_2_compatibility + "GL_ARB_ES3_2_compatibility", +#endif +#ifdef GL_ARB_ES3_compatibility + "GL_ARB_ES3_compatibility", +#endif +#ifdef GL_ARB_arrays_of_arrays + "GL_ARB_arrays_of_arrays", +#endif +#ifdef GL_ARB_base_instance + "GL_ARB_base_instance", +#endif +#ifdef GL_ARB_bindless_texture + "GL_ARB_bindless_texture", +#endif +#ifdef GL_ARB_blend_func_extended + "GL_ARB_blend_func_extended", +#endif +#ifdef GL_ARB_buffer_storage + "GL_ARB_buffer_storage", +#endif +#ifdef GL_ARB_cl_event + "GL_ARB_cl_event", +#endif +#ifdef GL_ARB_clear_buffer_object + "GL_ARB_clear_buffer_object", +#endif +#ifdef GL_ARB_clear_texture + "GL_ARB_clear_texture", +#endif +#ifdef GL_ARB_clip_control + "GL_ARB_clip_control", +#endif +#ifdef GL_ARB_color_buffer_float + "GL_ARB_color_buffer_float", +#endif +#ifdef GL_ARB_compatibility + "GL_ARB_compatibility", +#endif +#ifdef GL_ARB_compressed_texture_pixel_storage + "GL_ARB_compressed_texture_pixel_storage", +#endif +#ifdef GL_ARB_compute_shader + "GL_ARB_compute_shader", +#endif +#ifdef GL_ARB_compute_variable_group_size + "GL_ARB_compute_variable_group_size", +#endif +#ifdef GL_ARB_conditional_render_inverted + "GL_ARB_conditional_render_inverted", +#endif +#ifdef GL_ARB_conservative_depth + "GL_ARB_conservative_depth", +#endif +#ifdef GL_ARB_copy_buffer + "GL_ARB_copy_buffer", +#endif +#ifdef GL_ARB_copy_image + "GL_ARB_copy_image", +#endif +#ifdef GL_ARB_cull_distance + "GL_ARB_cull_distance", +#endif +#ifdef GL_ARB_debug_output + "GL_ARB_debug_output", +#endif +#ifdef GL_ARB_depth_buffer_float + "GL_ARB_depth_buffer_float", +#endif +#ifdef GL_ARB_depth_clamp + "GL_ARB_depth_clamp", +#endif +#ifdef GL_ARB_depth_texture + "GL_ARB_depth_texture", +#endif +#ifdef GL_ARB_derivative_control + "GL_ARB_derivative_control", +#endif +#ifdef GL_ARB_direct_state_access + "GL_ARB_direct_state_access", +#endif +#ifdef GL_ARB_draw_buffers + "GL_ARB_draw_buffers", +#endif +#ifdef GL_ARB_draw_buffers_blend + "GL_ARB_draw_buffers_blend", +#endif +#ifdef GL_ARB_draw_elements_base_vertex + "GL_ARB_draw_elements_base_vertex", +#endif +#ifdef GL_ARB_draw_indirect + "GL_ARB_draw_indirect", +#endif +#ifdef GL_ARB_draw_instanced + "GL_ARB_draw_instanced", +#endif +#ifdef GL_ARB_enhanced_layouts + "GL_ARB_enhanced_layouts", +#endif +#ifdef GL_ARB_explicit_attrib_location + "GL_ARB_explicit_attrib_location", +#endif +#ifdef GL_ARB_explicit_uniform_location + "GL_ARB_explicit_uniform_location", +#endif +#ifdef GL_ARB_fragment_coord_conventions + "GL_ARB_fragment_coord_conventions", +#endif +#ifdef GL_ARB_fragment_layer_viewport + "GL_ARB_fragment_layer_viewport", +#endif +#ifdef GL_ARB_fragment_program + "GL_ARB_fragment_program", +#endif +#ifdef GL_ARB_fragment_program_shadow + "GL_ARB_fragment_program_shadow", +#endif +#ifdef GL_ARB_fragment_shader + "GL_ARB_fragment_shader", +#endif +#ifdef GL_ARB_fragment_shader_interlock + "GL_ARB_fragment_shader_interlock", +#endif +#ifdef GL_ARB_framebuffer_no_attachments + "GL_ARB_framebuffer_no_attachments", +#endif +#ifdef GL_ARB_framebuffer_object + "GL_ARB_framebuffer_object", +#endif +#ifdef GL_ARB_framebuffer_sRGB + "GL_ARB_framebuffer_sRGB", +#endif +#ifdef GL_ARB_geometry_shader4 + "GL_ARB_geometry_shader4", +#endif +#ifdef GL_ARB_get_program_binary + "GL_ARB_get_program_binary", +#endif +#ifdef GL_ARB_get_texture_sub_image + "GL_ARB_get_texture_sub_image", +#endif +#ifdef GL_ARB_gl_spirv + "GL_ARB_gl_spirv", +#endif +#ifdef GL_ARB_gpu_shader5 + "GL_ARB_gpu_shader5", +#endif +#ifdef GL_ARB_gpu_shader_fp64 + "GL_ARB_gpu_shader_fp64", +#endif +#ifdef GL_ARB_gpu_shader_int64 + "GL_ARB_gpu_shader_int64", +#endif +#ifdef GL_ARB_half_float_pixel + "GL_ARB_half_float_pixel", +#endif +#ifdef GL_ARB_half_float_vertex + "GL_ARB_half_float_vertex", +#endif +#ifdef GL_ARB_imaging + "GL_ARB_imaging", +#endif +#ifdef GL_ARB_indirect_parameters + "GL_ARB_indirect_parameters", +#endif +#ifdef GL_ARB_instanced_arrays + "GL_ARB_instanced_arrays", +#endif +#ifdef GL_ARB_internalformat_query + "GL_ARB_internalformat_query", +#endif +#ifdef GL_ARB_internalformat_query2 + "GL_ARB_internalformat_query2", +#endif +#ifdef GL_ARB_invalidate_subdata + "GL_ARB_invalidate_subdata", +#endif +#ifdef GL_ARB_map_buffer_alignment + "GL_ARB_map_buffer_alignment", +#endif +#ifdef GL_ARB_map_buffer_range + "GL_ARB_map_buffer_range", +#endif +#ifdef GL_ARB_matrix_palette + "GL_ARB_matrix_palette", +#endif +#ifdef GL_ARB_multi_bind + "GL_ARB_multi_bind", +#endif +#ifdef GL_ARB_multi_draw_indirect + "GL_ARB_multi_draw_indirect", +#endif +#ifdef GL_ARB_multisample + "GL_ARB_multisample", +#endif +#ifdef GL_ARB_multitexture + "GL_ARB_multitexture", +#endif +#ifdef GL_ARB_occlusion_query + "GL_ARB_occlusion_query", +#endif +#ifdef GL_ARB_occlusion_query2 + "GL_ARB_occlusion_query2", +#endif +#ifdef GL_ARB_parallel_shader_compile + "GL_ARB_parallel_shader_compile", +#endif +#ifdef GL_ARB_pipeline_statistics_query + "GL_ARB_pipeline_statistics_query", +#endif +#ifdef GL_ARB_pixel_buffer_object + "GL_ARB_pixel_buffer_object", +#endif +#ifdef GL_ARB_point_parameters + "GL_ARB_point_parameters", +#endif +#ifdef GL_ARB_point_sprite + "GL_ARB_point_sprite", +#endif +#ifdef GL_ARB_polygon_offset_clamp + "GL_ARB_polygon_offset_clamp", +#endif +#ifdef GL_ARB_post_depth_coverage + "GL_ARB_post_depth_coverage", +#endif +#ifdef GL_ARB_program_interface_query + "GL_ARB_program_interface_query", +#endif +#ifdef GL_ARB_provoking_vertex + "GL_ARB_provoking_vertex", +#endif +#ifdef GL_ARB_query_buffer_object + "GL_ARB_query_buffer_object", +#endif +#ifdef GL_ARB_robust_buffer_access_behavior + "GL_ARB_robust_buffer_access_behavior", +#endif +#ifdef GL_ARB_robustness + "GL_ARB_robustness", +#endif +#ifdef GL_ARB_robustness_application_isolation + "GL_ARB_robustness_application_isolation", +#endif +#ifdef GL_ARB_robustness_share_group_isolation + "GL_ARB_robustness_share_group_isolation", +#endif +#ifdef GL_ARB_sample_locations + "GL_ARB_sample_locations", +#endif +#ifdef GL_ARB_sample_shading + "GL_ARB_sample_shading", +#endif +#ifdef GL_ARB_sampler_objects + "GL_ARB_sampler_objects", +#endif +#ifdef GL_ARB_seamless_cube_map + "GL_ARB_seamless_cube_map", +#endif +#ifdef GL_ARB_seamless_cubemap_per_texture + "GL_ARB_seamless_cubemap_per_texture", +#endif +#ifdef GL_ARB_separate_shader_objects + "GL_ARB_separate_shader_objects", +#endif +#ifdef GL_ARB_shader_atomic_counter_ops + "GL_ARB_shader_atomic_counter_ops", +#endif +#ifdef GL_ARB_shader_atomic_counters + "GL_ARB_shader_atomic_counters", +#endif +#ifdef GL_ARB_shader_ballot + "GL_ARB_shader_ballot", +#endif +#ifdef GL_ARB_shader_bit_encoding + "GL_ARB_shader_bit_encoding", +#endif +#ifdef GL_ARB_shader_clock + "GL_ARB_shader_clock", +#endif +#ifdef GL_ARB_shader_draw_parameters + "GL_ARB_shader_draw_parameters", +#endif +#ifdef GL_ARB_shader_group_vote + "GL_ARB_shader_group_vote", +#endif +#ifdef GL_ARB_shader_image_load_store + "GL_ARB_shader_image_load_store", +#endif +#ifdef GL_ARB_shader_image_size + "GL_ARB_shader_image_size", +#endif +#ifdef GL_ARB_shader_objects + "GL_ARB_shader_objects", +#endif +#ifdef GL_ARB_shader_precision + "GL_ARB_shader_precision", +#endif +#ifdef GL_ARB_shader_stencil_export + "GL_ARB_shader_stencil_export", +#endif +#ifdef GL_ARB_shader_storage_buffer_object + "GL_ARB_shader_storage_buffer_object", +#endif +#ifdef GL_ARB_shader_subroutine + "GL_ARB_shader_subroutine", +#endif +#ifdef GL_ARB_shader_texture_image_samples + "GL_ARB_shader_texture_image_samples", +#endif +#ifdef GL_ARB_shader_texture_lod + "GL_ARB_shader_texture_lod", +#endif +#ifdef GL_ARB_shader_viewport_layer_array + "GL_ARB_shader_viewport_layer_array", +#endif +#ifdef GL_ARB_shading_language_100 + "GL_ARB_shading_language_100", +#endif +#ifdef GL_ARB_shading_language_420pack + "GL_ARB_shading_language_420pack", +#endif +#ifdef GL_ARB_shading_language_include + "GL_ARB_shading_language_include", +#endif +#ifdef GL_ARB_shading_language_packing + "GL_ARB_shading_language_packing", +#endif +#ifdef GL_ARB_shadow + "GL_ARB_shadow", +#endif +#ifdef GL_ARB_shadow_ambient + "GL_ARB_shadow_ambient", +#endif +#ifdef GL_ARB_sparse_buffer + "GL_ARB_sparse_buffer", +#endif +#ifdef GL_ARB_sparse_texture + "GL_ARB_sparse_texture", +#endif +#ifdef GL_ARB_sparse_texture2 + "GL_ARB_sparse_texture2", +#endif +#ifdef GL_ARB_sparse_texture_clamp + "GL_ARB_sparse_texture_clamp", +#endif +#ifdef GL_ARB_spirv_extensions + "GL_ARB_spirv_extensions", +#endif +#ifdef GL_ARB_stencil_texturing + "GL_ARB_stencil_texturing", +#endif +#ifdef GL_ARB_sync + "GL_ARB_sync", +#endif +#ifdef GL_ARB_tessellation_shader + "GL_ARB_tessellation_shader", +#endif +#ifdef GL_ARB_texture_barrier + "GL_ARB_texture_barrier", +#endif +#ifdef GL_ARB_texture_border_clamp + "GL_ARB_texture_border_clamp", +#endif +#ifdef GL_ARB_texture_buffer_object + "GL_ARB_texture_buffer_object", +#endif +#ifdef GL_ARB_texture_buffer_object_rgb32 + "GL_ARB_texture_buffer_object_rgb32", +#endif +#ifdef GL_ARB_texture_buffer_range + "GL_ARB_texture_buffer_range", +#endif +#ifdef GL_ARB_texture_compression + "GL_ARB_texture_compression", +#endif +#ifdef GL_ARB_texture_compression_bptc + "GL_ARB_texture_compression_bptc", +#endif +#ifdef GL_ARB_texture_compression_rgtc + "GL_ARB_texture_compression_rgtc", +#endif +#ifdef GL_ARB_texture_cube_map + "GL_ARB_texture_cube_map", +#endif +#ifdef GL_ARB_texture_cube_map_array + "GL_ARB_texture_cube_map_array", +#endif +#ifdef GL_ARB_texture_env_add + "GL_ARB_texture_env_add", +#endif +#ifdef GL_ARB_texture_env_combine + "GL_ARB_texture_env_combine", +#endif +#ifdef GL_ARB_texture_env_crossbar + "GL_ARB_texture_env_crossbar", +#endif +#ifdef GL_ARB_texture_env_dot3 + "GL_ARB_texture_env_dot3", +#endif +#ifdef GL_ARB_texture_filter_anisotropic + "GL_ARB_texture_filter_anisotropic", +#endif +#ifdef GL_ARB_texture_filter_minmax + "GL_ARB_texture_filter_minmax", +#endif +#ifdef GL_ARB_texture_float + "GL_ARB_texture_float", +#endif +#ifdef GL_ARB_texture_gather + "GL_ARB_texture_gather", +#endif +#ifdef GL_ARB_texture_mirror_clamp_to_edge + "GL_ARB_texture_mirror_clamp_to_edge", +#endif +#ifdef GL_ARB_texture_mirrored_repeat + "GL_ARB_texture_mirrored_repeat", +#endif +#ifdef GL_ARB_texture_multisample + "GL_ARB_texture_multisample", +#endif +#ifdef GL_ARB_texture_non_power_of_two + "GL_ARB_texture_non_power_of_two", +#endif +#ifdef GL_ARB_texture_query_levels + "GL_ARB_texture_query_levels", +#endif +#ifdef GL_ARB_texture_query_lod + "GL_ARB_texture_query_lod", +#endif +#ifdef GL_ARB_texture_rectangle + "GL_ARB_texture_rectangle", +#endif +#ifdef GL_ARB_texture_rg + "GL_ARB_texture_rg", +#endif +#ifdef GL_ARB_texture_rgb10_a2ui + "GL_ARB_texture_rgb10_a2ui", +#endif +#ifdef GL_ARB_texture_stencil8 + "GL_ARB_texture_stencil8", +#endif +#ifdef GL_ARB_texture_storage + "GL_ARB_texture_storage", +#endif +#ifdef GL_ARB_texture_storage_multisample + "GL_ARB_texture_storage_multisample", +#endif +#ifdef GL_ARB_texture_swizzle + "GL_ARB_texture_swizzle", +#endif +#ifdef GL_ARB_texture_view + "GL_ARB_texture_view", +#endif +#ifdef GL_ARB_timer_query + "GL_ARB_timer_query", +#endif +#ifdef GL_ARB_transform_feedback2 + "GL_ARB_transform_feedback2", +#endif +#ifdef GL_ARB_transform_feedback3 + "GL_ARB_transform_feedback3", +#endif +#ifdef GL_ARB_transform_feedback_instanced + "GL_ARB_transform_feedback_instanced", +#endif +#ifdef GL_ARB_transform_feedback_overflow_query + "GL_ARB_transform_feedback_overflow_query", +#endif +#ifdef GL_ARB_transpose_matrix + "GL_ARB_transpose_matrix", +#endif +#ifdef GL_ARB_uniform_buffer_object + "GL_ARB_uniform_buffer_object", +#endif +#ifdef GL_ARB_vertex_array_bgra + "GL_ARB_vertex_array_bgra", +#endif +#ifdef GL_ARB_vertex_array_object + "GL_ARB_vertex_array_object", +#endif +#ifdef GL_ARB_vertex_attrib_64bit + "GL_ARB_vertex_attrib_64bit", +#endif +#ifdef GL_ARB_vertex_attrib_binding + "GL_ARB_vertex_attrib_binding", +#endif +#ifdef GL_ARB_vertex_blend + "GL_ARB_vertex_blend", +#endif +#ifdef GL_ARB_vertex_buffer_object + "GL_ARB_vertex_buffer_object", +#endif +#ifdef GL_ARB_vertex_program + "GL_ARB_vertex_program", +#endif +#ifdef GL_ARB_vertex_shader + "GL_ARB_vertex_shader", +#endif +#ifdef GL_ARB_vertex_type_10f_11f_11f_rev + "GL_ARB_vertex_type_10f_11f_11f_rev", +#endif +#ifdef GL_ARB_vertex_type_2_10_10_10_rev + "GL_ARB_vertex_type_2_10_10_10_rev", +#endif +#ifdef GL_ARB_viewport_array + "GL_ARB_viewport_array", +#endif +#ifdef GL_ARB_window_pos + "GL_ARB_window_pos", +#endif +#ifdef GL_ARM_mali_program_binary + "GL_ARM_mali_program_binary", +#endif +#ifdef GL_ARM_mali_shader_binary + "GL_ARM_mali_shader_binary", +#endif +#ifdef GL_ARM_rgba8 + "GL_ARM_rgba8", +#endif +#ifdef GL_ARM_shader_framebuffer_fetch + "GL_ARM_shader_framebuffer_fetch", +#endif +#ifdef GL_ARM_shader_framebuffer_fetch_depth_stencil + "GL_ARM_shader_framebuffer_fetch_depth_stencil", +#endif +#ifdef GL_ATIX_point_sprites + "GL_ATIX_point_sprites", +#endif +#ifdef GL_ATIX_texture_env_combine3 + "GL_ATIX_texture_env_combine3", +#endif +#ifdef GL_ATIX_texture_env_route + "GL_ATIX_texture_env_route", +#endif +#ifdef GL_ATIX_vertex_shader_output_point_size + "GL_ATIX_vertex_shader_output_point_size", +#endif +#ifdef GL_ATI_draw_buffers + "GL_ATI_draw_buffers", +#endif +#ifdef GL_ATI_element_array + "GL_ATI_element_array", +#endif +#ifdef GL_ATI_envmap_bumpmap + "GL_ATI_envmap_bumpmap", +#endif +#ifdef GL_ATI_fragment_shader + "GL_ATI_fragment_shader", +#endif +#ifdef GL_ATI_map_object_buffer + "GL_ATI_map_object_buffer", +#endif +#ifdef GL_ATI_meminfo + "GL_ATI_meminfo", +#endif +#ifdef GL_ATI_pn_triangles + "GL_ATI_pn_triangles", +#endif +#ifdef GL_ATI_separate_stencil + "GL_ATI_separate_stencil", +#endif +#ifdef GL_ATI_shader_texture_lod + "GL_ATI_shader_texture_lod", +#endif +#ifdef GL_ATI_text_fragment_shader + "GL_ATI_text_fragment_shader", +#endif +#ifdef GL_ATI_texture_compression_3dc + "GL_ATI_texture_compression_3dc", +#endif +#ifdef GL_ATI_texture_env_combine3 + "GL_ATI_texture_env_combine3", +#endif +#ifdef GL_ATI_texture_float + "GL_ATI_texture_float", +#endif +#ifdef GL_ATI_texture_mirror_once + "GL_ATI_texture_mirror_once", +#endif +#ifdef GL_ATI_vertex_array_object + "GL_ATI_vertex_array_object", +#endif +#ifdef GL_ATI_vertex_attrib_array_object + "GL_ATI_vertex_attrib_array_object", +#endif +#ifdef GL_ATI_vertex_streams + "GL_ATI_vertex_streams", +#endif +#ifdef GL_EGL_KHR_context_flush_control + "GL_EGL_KHR_context_flush_control", +#endif +#ifdef GL_EGL_NV_robustness_video_memory_purge + "GL_EGL_NV_robustness_video_memory_purge", +#endif +#ifdef GL_EXT_422_pixels + "GL_EXT_422_pixels", +#endif +#ifdef GL_EXT_Cg_shader + "GL_EXT_Cg_shader", +#endif +#ifdef GL_EXT_EGL_image_array + "GL_EXT_EGL_image_array", +#endif +#ifdef GL_EXT_YUV_target + "GL_EXT_YUV_target", +#endif +#ifdef GL_EXT_abgr + "GL_EXT_abgr", +#endif +#ifdef GL_EXT_base_instance + "GL_EXT_base_instance", +#endif +#ifdef GL_EXT_bgra + "GL_EXT_bgra", +#endif +#ifdef GL_EXT_bindable_uniform + "GL_EXT_bindable_uniform", +#endif +#ifdef GL_EXT_blend_color + "GL_EXT_blend_color", +#endif +#ifdef GL_EXT_blend_equation_separate + "GL_EXT_blend_equation_separate", +#endif +#ifdef GL_EXT_blend_func_extended + "GL_EXT_blend_func_extended", +#endif +#ifdef GL_EXT_blend_func_separate + "GL_EXT_blend_func_separate", +#endif +#ifdef GL_EXT_blend_logic_op + "GL_EXT_blend_logic_op", +#endif +#ifdef GL_EXT_blend_minmax + "GL_EXT_blend_minmax", +#endif +#ifdef GL_EXT_blend_subtract + "GL_EXT_blend_subtract", +#endif +#ifdef GL_EXT_buffer_storage + "GL_EXT_buffer_storage", +#endif +#ifdef GL_EXT_clear_texture + "GL_EXT_clear_texture", +#endif +#ifdef GL_EXT_clip_cull_distance + "GL_EXT_clip_cull_distance", +#endif +#ifdef GL_EXT_clip_volume_hint + "GL_EXT_clip_volume_hint", +#endif +#ifdef GL_EXT_cmyka + "GL_EXT_cmyka", +#endif +#ifdef GL_EXT_color_buffer_float + "GL_EXT_color_buffer_float", +#endif +#ifdef GL_EXT_color_buffer_half_float + "GL_EXT_color_buffer_half_float", +#endif +#ifdef GL_EXT_color_subtable + "GL_EXT_color_subtable", +#endif +#ifdef GL_EXT_compiled_vertex_array + "GL_EXT_compiled_vertex_array", +#endif +#ifdef GL_EXT_compressed_ETC1_RGB8_sub_texture + "GL_EXT_compressed_ETC1_RGB8_sub_texture", +#endif +#ifdef GL_EXT_conservative_depth + "GL_EXT_conservative_depth", +#endif +#ifdef GL_EXT_convolution + "GL_EXT_convolution", +#endif +#ifdef GL_EXT_coordinate_frame + "GL_EXT_coordinate_frame", +#endif +#ifdef GL_EXT_copy_image + "GL_EXT_copy_image", +#endif +#ifdef GL_EXT_copy_texture + "GL_EXT_copy_texture", +#endif +#ifdef GL_EXT_cull_vertex + "GL_EXT_cull_vertex", +#endif +#ifdef GL_EXT_debug_label + "GL_EXT_debug_label", +#endif +#ifdef GL_EXT_debug_marker + "GL_EXT_debug_marker", +#endif +#ifdef GL_EXT_depth_bounds_test + "GL_EXT_depth_bounds_test", +#endif +#ifdef GL_EXT_direct_state_access + "GL_EXT_direct_state_access", +#endif +#ifdef GL_EXT_discard_framebuffer + "GL_EXT_discard_framebuffer", +#endif +#ifdef GL_EXT_draw_buffers + "GL_EXT_draw_buffers", +#endif +#ifdef GL_EXT_draw_buffers2 + "GL_EXT_draw_buffers2", +#endif +#ifdef GL_EXT_draw_buffers_indexed + "GL_EXT_draw_buffers_indexed", +#endif +#ifdef GL_EXT_draw_elements_base_vertex + "GL_EXT_draw_elements_base_vertex", +#endif +#ifdef GL_EXT_draw_instanced + "GL_EXT_draw_instanced", +#endif +#ifdef GL_EXT_draw_range_elements + "GL_EXT_draw_range_elements", +#endif +#ifdef GL_EXT_external_buffer + "GL_EXT_external_buffer", +#endif +#ifdef GL_EXT_float_blend + "GL_EXT_float_blend", +#endif +#ifdef GL_EXT_fog_coord + "GL_EXT_fog_coord", +#endif +#ifdef GL_EXT_frag_depth + "GL_EXT_frag_depth", +#endif +#ifdef GL_EXT_fragment_lighting + "GL_EXT_fragment_lighting", +#endif +#ifdef GL_EXT_framebuffer_blit + "GL_EXT_framebuffer_blit", +#endif +#ifdef GL_EXT_framebuffer_multisample + "GL_EXT_framebuffer_multisample", +#endif +#ifdef GL_EXT_framebuffer_multisample_blit_scaled + "GL_EXT_framebuffer_multisample_blit_scaled", +#endif +#ifdef GL_EXT_framebuffer_object + "GL_EXT_framebuffer_object", +#endif +#ifdef GL_EXT_framebuffer_sRGB + "GL_EXT_framebuffer_sRGB", +#endif +#ifdef GL_EXT_geometry_point_size + "GL_EXT_geometry_point_size", +#endif +#ifdef GL_EXT_geometry_shader + "GL_EXT_geometry_shader", +#endif +#ifdef GL_EXT_geometry_shader4 + "GL_EXT_geometry_shader4", +#endif +#ifdef GL_EXT_gpu_program_parameters + "GL_EXT_gpu_program_parameters", +#endif +#ifdef GL_EXT_gpu_shader4 + "GL_EXT_gpu_shader4", +#endif +#ifdef GL_EXT_gpu_shader5 + "GL_EXT_gpu_shader5", +#endif +#ifdef GL_EXT_histogram + "GL_EXT_histogram", +#endif +#ifdef GL_EXT_index_array_formats + "GL_EXT_index_array_formats", +#endif +#ifdef GL_EXT_index_func + "GL_EXT_index_func", +#endif +#ifdef GL_EXT_index_material + "GL_EXT_index_material", +#endif +#ifdef GL_EXT_index_texture + "GL_EXT_index_texture", +#endif +#ifdef GL_EXT_instanced_arrays + "GL_EXT_instanced_arrays", +#endif +#ifdef GL_EXT_light_texture + "GL_EXT_light_texture", +#endif +#ifdef GL_EXT_map_buffer_range + "GL_EXT_map_buffer_range", +#endif +#ifdef GL_EXT_memory_object + "GL_EXT_memory_object", +#endif +#ifdef GL_EXT_memory_object_fd + "GL_EXT_memory_object_fd", +#endif +#ifdef GL_EXT_memory_object_win32 + "GL_EXT_memory_object_win32", +#endif +#ifdef GL_EXT_misc_attribute + "GL_EXT_misc_attribute", +#endif +#ifdef GL_EXT_multi_draw_arrays + "GL_EXT_multi_draw_arrays", +#endif +#ifdef GL_EXT_multi_draw_indirect + "GL_EXT_multi_draw_indirect", +#endif +#ifdef GL_EXT_multiple_textures + "GL_EXT_multiple_textures", +#endif +#ifdef GL_EXT_multisample + "GL_EXT_multisample", +#endif +#ifdef GL_EXT_multisample_compatibility + "GL_EXT_multisample_compatibility", +#endif +#ifdef GL_EXT_multisampled_render_to_texture + "GL_EXT_multisampled_render_to_texture", +#endif +#ifdef GL_EXT_multisampled_render_to_texture2 + "GL_EXT_multisampled_render_to_texture2", +#endif +#ifdef GL_EXT_multiview_draw_buffers + "GL_EXT_multiview_draw_buffers", +#endif +#ifdef GL_EXT_packed_depth_stencil + "GL_EXT_packed_depth_stencil", +#endif +#ifdef GL_EXT_packed_float + "GL_EXT_packed_float", +#endif +#ifdef GL_EXT_packed_pixels + "GL_EXT_packed_pixels", +#endif +#ifdef GL_EXT_paletted_texture + "GL_EXT_paletted_texture", +#endif +#ifdef GL_EXT_pixel_buffer_object + "GL_EXT_pixel_buffer_object", +#endif +#ifdef GL_EXT_pixel_transform + "GL_EXT_pixel_transform", +#endif +#ifdef GL_EXT_pixel_transform_color_table + "GL_EXT_pixel_transform_color_table", +#endif +#ifdef GL_EXT_point_parameters + "GL_EXT_point_parameters", +#endif +#ifdef GL_EXT_polygon_offset + "GL_EXT_polygon_offset", +#endif +#ifdef GL_EXT_polygon_offset_clamp + "GL_EXT_polygon_offset_clamp", +#endif +#ifdef GL_EXT_post_depth_coverage + "GL_EXT_post_depth_coverage", +#endif +#ifdef GL_EXT_provoking_vertex + "GL_EXT_provoking_vertex", +#endif +#ifdef GL_EXT_pvrtc_sRGB + "GL_EXT_pvrtc_sRGB", +#endif +#ifdef GL_EXT_raster_multisample + "GL_EXT_raster_multisample", +#endif +#ifdef GL_EXT_read_format_bgra + "GL_EXT_read_format_bgra", +#endif +#ifdef GL_EXT_render_snorm + "GL_EXT_render_snorm", +#endif +#ifdef GL_EXT_rescale_normal + "GL_EXT_rescale_normal", +#endif +#ifdef GL_EXT_sRGB + "GL_EXT_sRGB", +#endif +#ifdef GL_EXT_sRGB_write_control + "GL_EXT_sRGB_write_control", +#endif +#ifdef GL_EXT_scene_marker + "GL_EXT_scene_marker", +#endif +#ifdef GL_EXT_secondary_color + "GL_EXT_secondary_color", +#endif +#ifdef GL_EXT_semaphore + "GL_EXT_semaphore", +#endif +#ifdef GL_EXT_semaphore_fd + "GL_EXT_semaphore_fd", +#endif +#ifdef GL_EXT_semaphore_win32 + "GL_EXT_semaphore_win32", +#endif +#ifdef GL_EXT_separate_shader_objects + "GL_EXT_separate_shader_objects", +#endif +#ifdef GL_EXT_separate_specular_color + "GL_EXT_separate_specular_color", +#endif +#ifdef GL_EXT_shader_framebuffer_fetch + "GL_EXT_shader_framebuffer_fetch", +#endif +#ifdef GL_EXT_shader_group_vote + "GL_EXT_shader_group_vote", +#endif +#ifdef GL_EXT_shader_image_load_formatted + "GL_EXT_shader_image_load_formatted", +#endif +#ifdef GL_EXT_shader_image_load_store + "GL_EXT_shader_image_load_store", +#endif +#ifdef GL_EXT_shader_implicit_conversions + "GL_EXT_shader_implicit_conversions", +#endif +#ifdef GL_EXT_shader_integer_mix + "GL_EXT_shader_integer_mix", +#endif +#ifdef GL_EXT_shader_io_blocks + "GL_EXT_shader_io_blocks", +#endif +#ifdef GL_EXT_shader_non_constant_global_initializers + "GL_EXT_shader_non_constant_global_initializers", +#endif +#ifdef GL_EXT_shader_pixel_local_storage + "GL_EXT_shader_pixel_local_storage", +#endif +#ifdef GL_EXT_shader_pixel_local_storage2 + "GL_EXT_shader_pixel_local_storage2", +#endif +#ifdef GL_EXT_shader_texture_lod + "GL_EXT_shader_texture_lod", +#endif +#ifdef GL_EXT_shadow_funcs + "GL_EXT_shadow_funcs", +#endif +#ifdef GL_EXT_shadow_samplers + "GL_EXT_shadow_samplers", +#endif +#ifdef GL_EXT_shared_texture_palette + "GL_EXT_shared_texture_palette", +#endif +#ifdef GL_EXT_sparse_texture + "GL_EXT_sparse_texture", +#endif +#ifdef GL_EXT_sparse_texture2 + "GL_EXT_sparse_texture2", +#endif +#ifdef GL_EXT_stencil_clear_tag + "GL_EXT_stencil_clear_tag", +#endif +#ifdef GL_EXT_stencil_two_side + "GL_EXT_stencil_two_side", +#endif +#ifdef GL_EXT_stencil_wrap + "GL_EXT_stencil_wrap", +#endif +#ifdef GL_EXT_subtexture + "GL_EXT_subtexture", +#endif +#ifdef GL_EXT_texture + "GL_EXT_texture", +#endif +#ifdef GL_EXT_texture3D + "GL_EXT_texture3D", +#endif +#ifdef GL_EXT_texture_array + "GL_EXT_texture_array", +#endif +#ifdef GL_EXT_texture_buffer_object + "GL_EXT_texture_buffer_object", +#endif +#ifdef GL_EXT_texture_compression_astc_decode_mode + "GL_EXT_texture_compression_astc_decode_mode", +#endif +#ifdef GL_EXT_texture_compression_astc_decode_mode_rgb9e5 + "GL_EXT_texture_compression_astc_decode_mode_rgb9e5", +#endif +#ifdef GL_EXT_texture_compression_bptc + "GL_EXT_texture_compression_bptc", +#endif +#ifdef GL_EXT_texture_compression_dxt1 + "GL_EXT_texture_compression_dxt1", +#endif +#ifdef GL_EXT_texture_compression_latc + "GL_EXT_texture_compression_latc", +#endif +#ifdef GL_EXT_texture_compression_rgtc + "GL_EXT_texture_compression_rgtc", +#endif +#ifdef GL_EXT_texture_compression_s3tc + "GL_EXT_texture_compression_s3tc", +#endif +#ifdef GL_EXT_texture_cube_map + "GL_EXT_texture_cube_map", +#endif +#ifdef GL_EXT_texture_cube_map_array + "GL_EXT_texture_cube_map_array", +#endif +#ifdef GL_EXT_texture_edge_clamp + "GL_EXT_texture_edge_clamp", +#endif +#ifdef GL_EXT_texture_env + "GL_EXT_texture_env", +#endif +#ifdef GL_EXT_texture_env_add + "GL_EXT_texture_env_add", +#endif +#ifdef GL_EXT_texture_env_combine + "GL_EXT_texture_env_combine", +#endif +#ifdef GL_EXT_texture_env_dot3 + "GL_EXT_texture_env_dot3", +#endif +#ifdef GL_EXT_texture_filter_anisotropic + "GL_EXT_texture_filter_anisotropic", +#endif +#ifdef GL_EXT_texture_filter_minmax + "GL_EXT_texture_filter_minmax", +#endif +#ifdef GL_EXT_texture_format_BGRA8888 + "GL_EXT_texture_format_BGRA8888", +#endif +#ifdef GL_EXT_texture_integer + "GL_EXT_texture_integer", +#endif +#ifdef GL_EXT_texture_lod_bias + "GL_EXT_texture_lod_bias", +#endif +#ifdef GL_EXT_texture_mirror_clamp + "GL_EXT_texture_mirror_clamp", +#endif +#ifdef GL_EXT_texture_norm16 + "GL_EXT_texture_norm16", +#endif +#ifdef GL_EXT_texture_object + "GL_EXT_texture_object", +#endif +#ifdef GL_EXT_texture_perturb_normal + "GL_EXT_texture_perturb_normal", +#endif +#ifdef GL_EXT_texture_rectangle + "GL_EXT_texture_rectangle", +#endif +#ifdef GL_EXT_texture_rg + "GL_EXT_texture_rg", +#endif +#ifdef GL_EXT_texture_sRGB + "GL_EXT_texture_sRGB", +#endif +#ifdef GL_EXT_texture_sRGB_R8 + "GL_EXT_texture_sRGB_R8", +#endif +#ifdef GL_EXT_texture_sRGB_RG8 + "GL_EXT_texture_sRGB_RG8", +#endif +#ifdef GL_EXT_texture_sRGB_decode + "GL_EXT_texture_sRGB_decode", +#endif +#ifdef GL_EXT_texture_shared_exponent + "GL_EXT_texture_shared_exponent", +#endif +#ifdef GL_EXT_texture_snorm + "GL_EXT_texture_snorm", +#endif +#ifdef GL_EXT_texture_storage + "GL_EXT_texture_storage", +#endif +#ifdef GL_EXT_texture_swizzle + "GL_EXT_texture_swizzle", +#endif +#ifdef GL_EXT_texture_type_2_10_10_10_REV + "GL_EXT_texture_type_2_10_10_10_REV", +#endif +#ifdef GL_EXT_texture_view + "GL_EXT_texture_view", +#endif +#ifdef GL_EXT_timer_query + "GL_EXT_timer_query", +#endif +#ifdef GL_EXT_transform_feedback + "GL_EXT_transform_feedback", +#endif +#ifdef GL_EXT_unpack_subimage + "GL_EXT_unpack_subimage", +#endif +#ifdef GL_EXT_vertex_array + "GL_EXT_vertex_array", +#endif +#ifdef GL_EXT_vertex_array_bgra + "GL_EXT_vertex_array_bgra", +#endif +#ifdef GL_EXT_vertex_array_setXXX + "GL_EXT_vertex_array_setXXX", +#endif +#ifdef GL_EXT_vertex_attrib_64bit + "GL_EXT_vertex_attrib_64bit", +#endif +#ifdef GL_EXT_vertex_shader + "GL_EXT_vertex_shader", +#endif +#ifdef GL_EXT_vertex_weighting + "GL_EXT_vertex_weighting", +#endif +#ifdef GL_EXT_win32_keyed_mutex + "GL_EXT_win32_keyed_mutex", +#endif +#ifdef GL_EXT_window_rectangles + "GL_EXT_window_rectangles", +#endif +#ifdef GL_EXT_x11_sync_object + "GL_EXT_x11_sync_object", +#endif +#ifdef GL_GREMEDY_frame_terminator + "GL_GREMEDY_frame_terminator", +#endif +#ifdef GL_GREMEDY_string_marker + "GL_GREMEDY_string_marker", +#endif +#ifdef GL_HP_convolution_border_modes + "GL_HP_convolution_border_modes", +#endif +#ifdef GL_HP_image_transform + "GL_HP_image_transform", +#endif +#ifdef GL_HP_occlusion_test + "GL_HP_occlusion_test", +#endif +#ifdef GL_HP_texture_lighting + "GL_HP_texture_lighting", +#endif +#ifdef GL_IBM_cull_vertex + "GL_IBM_cull_vertex", +#endif +#ifdef GL_IBM_multimode_draw_arrays + "GL_IBM_multimode_draw_arrays", +#endif +#ifdef GL_IBM_rasterpos_clip + "GL_IBM_rasterpos_clip", +#endif +#ifdef GL_IBM_static_data + "GL_IBM_static_data", +#endif +#ifdef GL_IBM_texture_mirrored_repeat + "GL_IBM_texture_mirrored_repeat", +#endif +#ifdef GL_IBM_vertex_array_lists + "GL_IBM_vertex_array_lists", +#endif +#ifdef GL_INGR_color_clamp + "GL_INGR_color_clamp", +#endif +#ifdef GL_INGR_interlace_read + "GL_INGR_interlace_read", +#endif +#ifdef GL_INTEL_conservative_rasterization + "GL_INTEL_conservative_rasterization", +#endif +#ifdef GL_INTEL_fragment_shader_ordering + "GL_INTEL_fragment_shader_ordering", +#endif +#ifdef GL_INTEL_framebuffer_CMAA + "GL_INTEL_framebuffer_CMAA", +#endif +#ifdef GL_INTEL_map_texture + "GL_INTEL_map_texture", +#endif +#ifdef GL_INTEL_parallel_arrays + "GL_INTEL_parallel_arrays", +#endif +#ifdef GL_INTEL_performance_query + "GL_INTEL_performance_query", +#endif +#ifdef GL_INTEL_texture_scissor + "GL_INTEL_texture_scissor", +#endif +#ifdef GL_KHR_blend_equation_advanced + "GL_KHR_blend_equation_advanced", +#endif +#ifdef GL_KHR_blend_equation_advanced_coherent + "GL_KHR_blend_equation_advanced_coherent", +#endif +#ifdef GL_KHR_context_flush_control + "GL_KHR_context_flush_control", +#endif +#ifdef GL_KHR_debug + "GL_KHR_debug", +#endif +#ifdef GL_KHR_no_error + "GL_KHR_no_error", +#endif +#ifdef GL_KHR_parallel_shader_compile + "GL_KHR_parallel_shader_compile", +#endif +#ifdef GL_KHR_robust_buffer_access_behavior + "GL_KHR_robust_buffer_access_behavior", +#endif +#ifdef GL_KHR_robustness + "GL_KHR_robustness", +#endif +#ifdef GL_KHR_texture_compression_astc_hdr + "GL_KHR_texture_compression_astc_hdr", +#endif +#ifdef GL_KHR_texture_compression_astc_ldr + "GL_KHR_texture_compression_astc_ldr", +#endif +#ifdef GL_KHR_texture_compression_astc_sliced_3d + "GL_KHR_texture_compression_astc_sliced_3d", +#endif +#ifdef GL_KTX_buffer_region + "GL_KTX_buffer_region", +#endif +#ifdef GL_MESAX_texture_stack + "GL_MESAX_texture_stack", +#endif +#ifdef GL_MESA_pack_invert + "GL_MESA_pack_invert", +#endif +#ifdef GL_MESA_resize_buffers + "GL_MESA_resize_buffers", +#endif +#ifdef GL_MESA_shader_integer_functions + "GL_MESA_shader_integer_functions", +#endif +#ifdef GL_MESA_window_pos + "GL_MESA_window_pos", +#endif +#ifdef GL_MESA_ycbcr_texture + "GL_MESA_ycbcr_texture", +#endif +#ifdef GL_NVX_blend_equation_advanced_multi_draw_buffers + "GL_NVX_blend_equation_advanced_multi_draw_buffers", +#endif +#ifdef GL_NVX_conditional_render + "GL_NVX_conditional_render", +#endif +#ifdef GL_NVX_gpu_memory_info + "GL_NVX_gpu_memory_info", +#endif +#ifdef GL_NVX_linked_gpu_multicast + "GL_NVX_linked_gpu_multicast", +#endif +#ifdef GL_NV_3dvision_settings + "GL_NV_3dvision_settings", +#endif +#ifdef GL_NV_EGL_stream_consumer_external + "GL_NV_EGL_stream_consumer_external", +#endif +#ifdef GL_NV_alpha_to_coverage_dither_control + "GL_NV_alpha_to_coverage_dither_control", +#endif +#ifdef GL_NV_bgr + "GL_NV_bgr", +#endif +#ifdef GL_NV_bindless_multi_draw_indirect + "GL_NV_bindless_multi_draw_indirect", +#endif +#ifdef GL_NV_bindless_multi_draw_indirect_count + "GL_NV_bindless_multi_draw_indirect_count", +#endif +#ifdef GL_NV_bindless_texture + "GL_NV_bindless_texture", +#endif +#ifdef GL_NV_blend_equation_advanced + "GL_NV_blend_equation_advanced", +#endif +#ifdef GL_NV_blend_equation_advanced_coherent + "GL_NV_blend_equation_advanced_coherent", +#endif +#ifdef GL_NV_blend_minmax_factor + "GL_NV_blend_minmax_factor", +#endif +#ifdef GL_NV_blend_square + "GL_NV_blend_square", +#endif +#ifdef GL_NV_clip_space_w_scaling + "GL_NV_clip_space_w_scaling", +#endif +#ifdef GL_NV_command_list + "GL_NV_command_list", +#endif +#ifdef GL_NV_compute_program5 + "GL_NV_compute_program5", +#endif +#ifdef GL_NV_conditional_render + "GL_NV_conditional_render", +#endif +#ifdef GL_NV_conservative_raster + "GL_NV_conservative_raster", +#endif +#ifdef GL_NV_conservative_raster_dilate + "GL_NV_conservative_raster_dilate", +#endif +#ifdef GL_NV_conservative_raster_pre_snap_triangles + "GL_NV_conservative_raster_pre_snap_triangles", +#endif +#ifdef GL_NV_copy_buffer + "GL_NV_copy_buffer", +#endif +#ifdef GL_NV_copy_depth_to_color + "GL_NV_copy_depth_to_color", +#endif +#ifdef GL_NV_copy_image + "GL_NV_copy_image", +#endif +#ifdef GL_NV_deep_texture3D + "GL_NV_deep_texture3D", +#endif +#ifdef GL_NV_depth_buffer_float + "GL_NV_depth_buffer_float", +#endif +#ifdef GL_NV_depth_clamp + "GL_NV_depth_clamp", +#endif +#ifdef GL_NV_depth_range_unclamped + "GL_NV_depth_range_unclamped", +#endif +#ifdef GL_NV_draw_buffers + "GL_NV_draw_buffers", +#endif +#ifdef GL_NV_draw_instanced + "GL_NV_draw_instanced", +#endif +#ifdef GL_NV_draw_texture + "GL_NV_draw_texture", +#endif +#ifdef GL_NV_draw_vulkan_image + "GL_NV_draw_vulkan_image", +#endif +#ifdef GL_NV_evaluators + "GL_NV_evaluators", +#endif +#ifdef GL_NV_explicit_attrib_location + "GL_NV_explicit_attrib_location", +#endif +#ifdef GL_NV_explicit_multisample + "GL_NV_explicit_multisample", +#endif +#ifdef GL_NV_fbo_color_attachments + "GL_NV_fbo_color_attachments", +#endif +#ifdef GL_NV_fence + "GL_NV_fence", +#endif +#ifdef GL_NV_fill_rectangle + "GL_NV_fill_rectangle", +#endif +#ifdef GL_NV_float_buffer + "GL_NV_float_buffer", +#endif +#ifdef GL_NV_fog_distance + "GL_NV_fog_distance", +#endif +#ifdef GL_NV_fragment_coverage_to_color + "GL_NV_fragment_coverage_to_color", +#endif +#ifdef GL_NV_fragment_program + "GL_NV_fragment_program", +#endif +#ifdef GL_NV_fragment_program2 + "GL_NV_fragment_program2", +#endif +#ifdef GL_NV_fragment_program4 + "GL_NV_fragment_program4", +#endif +#ifdef GL_NV_fragment_program_option + "GL_NV_fragment_program_option", +#endif +#ifdef GL_NV_fragment_shader_interlock + "GL_NV_fragment_shader_interlock", +#endif +#ifdef GL_NV_framebuffer_blit + "GL_NV_framebuffer_blit", +#endif +#ifdef GL_NV_framebuffer_mixed_samples + "GL_NV_framebuffer_mixed_samples", +#endif +#ifdef GL_NV_framebuffer_multisample + "GL_NV_framebuffer_multisample", +#endif +#ifdef GL_NV_framebuffer_multisample_coverage + "GL_NV_framebuffer_multisample_coverage", +#endif +#ifdef GL_NV_generate_mipmap_sRGB + "GL_NV_generate_mipmap_sRGB", +#endif +#ifdef GL_NV_geometry_program4 + "GL_NV_geometry_program4", +#endif +#ifdef GL_NV_geometry_shader4 + "GL_NV_geometry_shader4", +#endif +#ifdef GL_NV_geometry_shader_passthrough + "GL_NV_geometry_shader_passthrough", +#endif +#ifdef GL_NV_gpu_multicast + "GL_NV_gpu_multicast", +#endif +#ifdef GL_NV_gpu_program4 + "GL_NV_gpu_program4", +#endif +#ifdef GL_NV_gpu_program5 + "GL_NV_gpu_program5", +#endif +#ifdef GL_NV_gpu_program5_mem_extended + "GL_NV_gpu_program5_mem_extended", +#endif +#ifdef GL_NV_gpu_program_fp64 + "GL_NV_gpu_program_fp64", +#endif +#ifdef GL_NV_gpu_shader5 + "GL_NV_gpu_shader5", +#endif +#ifdef GL_NV_half_float + "GL_NV_half_float", +#endif +#ifdef GL_NV_image_formats + "GL_NV_image_formats", +#endif +#ifdef GL_NV_instanced_arrays + "GL_NV_instanced_arrays", +#endif +#ifdef GL_NV_internalformat_sample_query + "GL_NV_internalformat_sample_query", +#endif +#ifdef GL_NV_light_max_exponent + "GL_NV_light_max_exponent", +#endif +#ifdef GL_NV_multisample_coverage + "GL_NV_multisample_coverage", +#endif +#ifdef GL_NV_multisample_filter_hint + "GL_NV_multisample_filter_hint", +#endif +#ifdef GL_NV_non_square_matrices + "GL_NV_non_square_matrices", +#endif +#ifdef GL_NV_occlusion_query + "GL_NV_occlusion_query", +#endif +#ifdef GL_NV_pack_subimage + "GL_NV_pack_subimage", +#endif +#ifdef GL_NV_packed_depth_stencil + "GL_NV_packed_depth_stencil", +#endif +#ifdef GL_NV_packed_float + "GL_NV_packed_float", +#endif +#ifdef GL_NV_packed_float_linear + "GL_NV_packed_float_linear", +#endif +#ifdef GL_NV_parameter_buffer_object + "GL_NV_parameter_buffer_object", +#endif +#ifdef GL_NV_parameter_buffer_object2 + "GL_NV_parameter_buffer_object2", +#endif +#ifdef GL_NV_path_rendering + "GL_NV_path_rendering", +#endif +#ifdef GL_NV_path_rendering_shared_edge + "GL_NV_path_rendering_shared_edge", +#endif +#ifdef GL_NV_pixel_buffer_object + "GL_NV_pixel_buffer_object", +#endif +#ifdef GL_NV_pixel_data_range + "GL_NV_pixel_data_range", +#endif +#ifdef GL_NV_platform_binary + "GL_NV_platform_binary", +#endif +#ifdef GL_NV_point_sprite + "GL_NV_point_sprite", +#endif +#ifdef GL_NV_polygon_mode + "GL_NV_polygon_mode", +#endif +#ifdef GL_NV_present_video + "GL_NV_present_video", +#endif +#ifdef GL_NV_primitive_restart + "GL_NV_primitive_restart", +#endif +#ifdef GL_NV_read_depth + "GL_NV_read_depth", +#endif +#ifdef GL_NV_read_depth_stencil + "GL_NV_read_depth_stencil", +#endif +#ifdef GL_NV_read_stencil + "GL_NV_read_stencil", +#endif +#ifdef GL_NV_register_combiners + "GL_NV_register_combiners", +#endif +#ifdef GL_NV_register_combiners2 + "GL_NV_register_combiners2", +#endif +#ifdef GL_NV_robustness_video_memory_purge + "GL_NV_robustness_video_memory_purge", +#endif +#ifdef GL_NV_sRGB_formats + "GL_NV_sRGB_formats", +#endif +#ifdef GL_NV_sample_locations + "GL_NV_sample_locations", +#endif +#ifdef GL_NV_sample_mask_override_coverage + "GL_NV_sample_mask_override_coverage", +#endif +#ifdef GL_NV_shader_atomic_counters + "GL_NV_shader_atomic_counters", +#endif +#ifdef GL_NV_shader_atomic_float + "GL_NV_shader_atomic_float", +#endif +#ifdef GL_NV_shader_atomic_float64 + "GL_NV_shader_atomic_float64", +#endif +#ifdef GL_NV_shader_atomic_fp16_vector + "GL_NV_shader_atomic_fp16_vector", +#endif +#ifdef GL_NV_shader_atomic_int64 + "GL_NV_shader_atomic_int64", +#endif +#ifdef GL_NV_shader_buffer_load + "GL_NV_shader_buffer_load", +#endif +#ifdef GL_NV_shader_noperspective_interpolation + "GL_NV_shader_noperspective_interpolation", +#endif +#ifdef GL_NV_shader_storage_buffer_object + "GL_NV_shader_storage_buffer_object", +#endif +#ifdef GL_NV_shader_thread_group + "GL_NV_shader_thread_group", +#endif +#ifdef GL_NV_shader_thread_shuffle + "GL_NV_shader_thread_shuffle", +#endif +#ifdef GL_NV_shadow_samplers_array + "GL_NV_shadow_samplers_array", +#endif +#ifdef GL_NV_shadow_samplers_cube + "GL_NV_shadow_samplers_cube", +#endif +#ifdef GL_NV_stereo_view_rendering + "GL_NV_stereo_view_rendering", +#endif +#ifdef GL_NV_tessellation_program5 + "GL_NV_tessellation_program5", +#endif +#ifdef GL_NV_texgen_emboss + "GL_NV_texgen_emboss", +#endif +#ifdef GL_NV_texgen_reflection + "GL_NV_texgen_reflection", +#endif +#ifdef GL_NV_texture_array + "GL_NV_texture_array", +#endif +#ifdef GL_NV_texture_barrier + "GL_NV_texture_barrier", +#endif +#ifdef GL_NV_texture_border_clamp + "GL_NV_texture_border_clamp", +#endif +#ifdef GL_NV_texture_compression_latc + "GL_NV_texture_compression_latc", +#endif +#ifdef GL_NV_texture_compression_s3tc + "GL_NV_texture_compression_s3tc", +#endif +#ifdef GL_NV_texture_compression_s3tc_update + "GL_NV_texture_compression_s3tc_update", +#endif +#ifdef GL_NV_texture_compression_vtc + "GL_NV_texture_compression_vtc", +#endif +#ifdef GL_NV_texture_env_combine4 + "GL_NV_texture_env_combine4", +#endif +#ifdef GL_NV_texture_expand_normal + "GL_NV_texture_expand_normal", +#endif +#ifdef GL_NV_texture_multisample + "GL_NV_texture_multisample", +#endif +#ifdef GL_NV_texture_npot_2D_mipmap + "GL_NV_texture_npot_2D_mipmap", +#endif +#ifdef GL_NV_texture_rectangle + "GL_NV_texture_rectangle", +#endif +#ifdef GL_NV_texture_rectangle_compressed + "GL_NV_texture_rectangle_compressed", +#endif +#ifdef GL_NV_texture_shader + "GL_NV_texture_shader", +#endif +#ifdef GL_NV_texture_shader2 + "GL_NV_texture_shader2", +#endif +#ifdef GL_NV_texture_shader3 + "GL_NV_texture_shader3", +#endif +#ifdef GL_NV_transform_feedback + "GL_NV_transform_feedback", +#endif +#ifdef GL_NV_transform_feedback2 + "GL_NV_transform_feedback2", +#endif +#ifdef GL_NV_uniform_buffer_unified_memory + "GL_NV_uniform_buffer_unified_memory", +#endif +#ifdef GL_NV_vdpau_interop + "GL_NV_vdpau_interop", +#endif +#ifdef GL_NV_vertex_array_range + "GL_NV_vertex_array_range", +#endif +#ifdef GL_NV_vertex_array_range2 + "GL_NV_vertex_array_range2", +#endif +#ifdef GL_NV_vertex_attrib_integer_64bit + "GL_NV_vertex_attrib_integer_64bit", +#endif +#ifdef GL_NV_vertex_buffer_unified_memory + "GL_NV_vertex_buffer_unified_memory", +#endif +#ifdef GL_NV_vertex_program + "GL_NV_vertex_program", +#endif +#ifdef GL_NV_vertex_program1_1 + "GL_NV_vertex_program1_1", +#endif +#ifdef GL_NV_vertex_program2 + "GL_NV_vertex_program2", +#endif +#ifdef GL_NV_vertex_program2_option + "GL_NV_vertex_program2_option", +#endif +#ifdef GL_NV_vertex_program3 + "GL_NV_vertex_program3", +#endif +#ifdef GL_NV_vertex_program4 + "GL_NV_vertex_program4", +#endif +#ifdef GL_NV_video_capture + "GL_NV_video_capture", +#endif +#ifdef GL_NV_viewport_array + "GL_NV_viewport_array", +#endif +#ifdef GL_NV_viewport_array2 + "GL_NV_viewport_array2", +#endif +#ifdef GL_NV_viewport_swizzle + "GL_NV_viewport_swizzle", +#endif +#ifdef GL_OES_byte_coordinates + "GL_OES_byte_coordinates", +#endif +#ifdef GL_OML_interlace + "GL_OML_interlace", +#endif +#ifdef GL_OML_resample + "GL_OML_resample", +#endif +#ifdef GL_OML_subsample + "GL_OML_subsample", +#endif +#ifdef GL_OVR_multiview + "GL_OVR_multiview", +#endif +#ifdef GL_OVR_multiview2 + "GL_OVR_multiview2", +#endif +#ifdef GL_OVR_multiview_multisampled_render_to_texture + "GL_OVR_multiview_multisampled_render_to_texture", +#endif +#ifdef GL_PGI_misc_hints + "GL_PGI_misc_hints", +#endif +#ifdef GL_PGI_vertex_hints + "GL_PGI_vertex_hints", +#endif +#ifdef GL_QCOM_alpha_test + "GL_QCOM_alpha_test", +#endif +#ifdef GL_QCOM_binning_control + "GL_QCOM_binning_control", +#endif +#ifdef GL_QCOM_driver_control + "GL_QCOM_driver_control", +#endif +#ifdef GL_QCOM_extended_get + "GL_QCOM_extended_get", +#endif +#ifdef GL_QCOM_extended_get2 + "GL_QCOM_extended_get2", +#endif +#ifdef GL_QCOM_framebuffer_foveated + "GL_QCOM_framebuffer_foveated", +#endif +#ifdef GL_QCOM_perfmon_global_mode + "GL_QCOM_perfmon_global_mode", +#endif +#ifdef GL_QCOM_shader_framebuffer_fetch_noncoherent + "GL_QCOM_shader_framebuffer_fetch_noncoherent", +#endif +#ifdef GL_QCOM_tiled_rendering + "GL_QCOM_tiled_rendering", +#endif +#ifdef GL_QCOM_writeonly_rendering + "GL_QCOM_writeonly_rendering", +#endif +#ifdef GL_REGAL_ES1_0_compatibility + "GL_REGAL_ES1_0_compatibility", +#endif +#ifdef GL_REGAL_ES1_1_compatibility + "GL_REGAL_ES1_1_compatibility", +#endif +#ifdef GL_REGAL_enable + "GL_REGAL_enable", +#endif +#ifdef GL_REGAL_error_string + "GL_REGAL_error_string", +#endif +#ifdef GL_REGAL_extension_query + "GL_REGAL_extension_query", +#endif +#ifdef GL_REGAL_log + "GL_REGAL_log", +#endif +#ifdef GL_REGAL_proc_address + "GL_REGAL_proc_address", +#endif +#ifdef GL_REND_screen_coordinates + "GL_REND_screen_coordinates", +#endif +#ifdef GL_S3_s3tc + "GL_S3_s3tc", +#endif +#ifdef GL_SGIS_clip_band_hint + "GL_SGIS_clip_band_hint", +#endif +#ifdef GL_SGIS_color_range + "GL_SGIS_color_range", +#endif +#ifdef GL_SGIS_detail_texture + "GL_SGIS_detail_texture", +#endif +#ifdef GL_SGIS_fog_function + "GL_SGIS_fog_function", +#endif +#ifdef GL_SGIS_generate_mipmap + "GL_SGIS_generate_mipmap", +#endif +#ifdef GL_SGIS_line_texgen + "GL_SGIS_line_texgen", +#endif +#ifdef GL_SGIS_multisample + "GL_SGIS_multisample", +#endif +#ifdef GL_SGIS_multitexture + "GL_SGIS_multitexture", +#endif +#ifdef GL_SGIS_pixel_texture + "GL_SGIS_pixel_texture", +#endif +#ifdef GL_SGIS_point_line_texgen + "GL_SGIS_point_line_texgen", +#endif +#ifdef GL_SGIS_shared_multisample + "GL_SGIS_shared_multisample", +#endif +#ifdef GL_SGIS_sharpen_texture + "GL_SGIS_sharpen_texture", +#endif +#ifdef GL_SGIS_texture4D + "GL_SGIS_texture4D", +#endif +#ifdef GL_SGIS_texture_border_clamp + "GL_SGIS_texture_border_clamp", +#endif +#ifdef GL_SGIS_texture_edge_clamp + "GL_SGIS_texture_edge_clamp", +#endif +#ifdef GL_SGIS_texture_filter4 + "GL_SGIS_texture_filter4", +#endif +#ifdef GL_SGIS_texture_lod + "GL_SGIS_texture_lod", +#endif +#ifdef GL_SGIS_texture_select + "GL_SGIS_texture_select", +#endif +#ifdef GL_SGIX_async + "GL_SGIX_async", +#endif +#ifdef GL_SGIX_async_histogram + "GL_SGIX_async_histogram", +#endif +#ifdef GL_SGIX_async_pixel + "GL_SGIX_async_pixel", +#endif +#ifdef GL_SGIX_bali_g_instruments + "GL_SGIX_bali_g_instruments", +#endif +#ifdef GL_SGIX_bali_r_instruments + "GL_SGIX_bali_r_instruments", +#endif +#ifdef GL_SGIX_bali_timer_instruments + "GL_SGIX_bali_timer_instruments", +#endif +#ifdef GL_SGIX_blend_alpha_minmax + "GL_SGIX_blend_alpha_minmax", +#endif +#ifdef GL_SGIX_blend_cadd + "GL_SGIX_blend_cadd", +#endif +#ifdef GL_SGIX_blend_cmultiply + "GL_SGIX_blend_cmultiply", +#endif +#ifdef GL_SGIX_calligraphic_fragment + "GL_SGIX_calligraphic_fragment", +#endif +#ifdef GL_SGIX_clipmap + "GL_SGIX_clipmap", +#endif +#ifdef GL_SGIX_color_matrix_accuracy + "GL_SGIX_color_matrix_accuracy", +#endif +#ifdef GL_SGIX_color_table_index_mode + "GL_SGIX_color_table_index_mode", +#endif +#ifdef GL_SGIX_complex_polar + "GL_SGIX_complex_polar", +#endif +#ifdef GL_SGIX_convolution_accuracy + "GL_SGIX_convolution_accuracy", +#endif +#ifdef GL_SGIX_cube_map + "GL_SGIX_cube_map", +#endif +#ifdef GL_SGIX_cylinder_texgen + "GL_SGIX_cylinder_texgen", +#endif +#ifdef GL_SGIX_datapipe + "GL_SGIX_datapipe", +#endif +#ifdef GL_SGIX_decimation + "GL_SGIX_decimation", +#endif +#ifdef GL_SGIX_depth_pass_instrument + "GL_SGIX_depth_pass_instrument", +#endif +#ifdef GL_SGIX_depth_texture + "GL_SGIX_depth_texture", +#endif +#ifdef GL_SGIX_dvc + "GL_SGIX_dvc", +#endif +#ifdef GL_SGIX_flush_raster + "GL_SGIX_flush_raster", +#endif +#ifdef GL_SGIX_fog_blend + "GL_SGIX_fog_blend", +#endif +#ifdef GL_SGIX_fog_factor_to_alpha + "GL_SGIX_fog_factor_to_alpha", +#endif +#ifdef GL_SGIX_fog_layers + "GL_SGIX_fog_layers", +#endif +#ifdef GL_SGIX_fog_offset + "GL_SGIX_fog_offset", +#endif +#ifdef GL_SGIX_fog_patchy + "GL_SGIX_fog_patchy", +#endif +#ifdef GL_SGIX_fog_scale + "GL_SGIX_fog_scale", +#endif +#ifdef GL_SGIX_fog_texture + "GL_SGIX_fog_texture", +#endif +#ifdef GL_SGIX_fragment_lighting_space + "GL_SGIX_fragment_lighting_space", +#endif +#ifdef GL_SGIX_fragment_specular_lighting + "GL_SGIX_fragment_specular_lighting", +#endif +#ifdef GL_SGIX_fragments_instrument + "GL_SGIX_fragments_instrument", +#endif +#ifdef GL_SGIX_framezoom + "GL_SGIX_framezoom", +#endif +#ifdef GL_SGIX_icc_texture + "GL_SGIX_icc_texture", +#endif +#ifdef GL_SGIX_igloo_interface + "GL_SGIX_igloo_interface", +#endif +#ifdef GL_SGIX_image_compression + "GL_SGIX_image_compression", +#endif +#ifdef GL_SGIX_impact_pixel_texture + "GL_SGIX_impact_pixel_texture", +#endif +#ifdef GL_SGIX_instrument_error + "GL_SGIX_instrument_error", +#endif +#ifdef GL_SGIX_interlace + "GL_SGIX_interlace", +#endif +#ifdef GL_SGIX_ir_instrument1 + "GL_SGIX_ir_instrument1", +#endif +#ifdef GL_SGIX_line_quality_hint + "GL_SGIX_line_quality_hint", +#endif +#ifdef GL_SGIX_list_priority + "GL_SGIX_list_priority", +#endif +#ifdef GL_SGIX_mpeg1 + "GL_SGIX_mpeg1", +#endif +#ifdef GL_SGIX_mpeg2 + "GL_SGIX_mpeg2", +#endif +#ifdef GL_SGIX_nonlinear_lighting_pervertex + "GL_SGIX_nonlinear_lighting_pervertex", +#endif +#ifdef GL_SGIX_nurbs_eval + "GL_SGIX_nurbs_eval", +#endif +#ifdef GL_SGIX_occlusion_instrument + "GL_SGIX_occlusion_instrument", +#endif +#ifdef GL_SGIX_packed_6bytes + "GL_SGIX_packed_6bytes", +#endif +#ifdef GL_SGIX_pixel_texture + "GL_SGIX_pixel_texture", +#endif +#ifdef GL_SGIX_pixel_texture_bits + "GL_SGIX_pixel_texture_bits", +#endif +#ifdef GL_SGIX_pixel_texture_lod + "GL_SGIX_pixel_texture_lod", +#endif +#ifdef GL_SGIX_pixel_tiles + "GL_SGIX_pixel_tiles", +#endif +#ifdef GL_SGIX_polynomial_ffd + "GL_SGIX_polynomial_ffd", +#endif +#ifdef GL_SGIX_quad_mesh + "GL_SGIX_quad_mesh", +#endif +#ifdef GL_SGIX_reference_plane + "GL_SGIX_reference_plane", +#endif +#ifdef GL_SGIX_resample + "GL_SGIX_resample", +#endif +#ifdef GL_SGIX_scalebias_hint + "GL_SGIX_scalebias_hint", +#endif +#ifdef GL_SGIX_shadow + "GL_SGIX_shadow", +#endif +#ifdef GL_SGIX_shadow_ambient + "GL_SGIX_shadow_ambient", +#endif +#ifdef GL_SGIX_slim + "GL_SGIX_slim", +#endif +#ifdef GL_SGIX_spotlight_cutoff + "GL_SGIX_spotlight_cutoff", +#endif +#ifdef GL_SGIX_sprite + "GL_SGIX_sprite", +#endif +#ifdef GL_SGIX_subdiv_patch + "GL_SGIX_subdiv_patch", +#endif +#ifdef GL_SGIX_subsample + "GL_SGIX_subsample", +#endif +#ifdef GL_SGIX_tag_sample_buffer + "GL_SGIX_tag_sample_buffer", +#endif +#ifdef GL_SGIX_texture_add_env + "GL_SGIX_texture_add_env", +#endif +#ifdef GL_SGIX_texture_coordinate_clamp + "GL_SGIX_texture_coordinate_clamp", +#endif +#ifdef GL_SGIX_texture_lod_bias + "GL_SGIX_texture_lod_bias", +#endif +#ifdef GL_SGIX_texture_mipmap_anisotropic + "GL_SGIX_texture_mipmap_anisotropic", +#endif +#ifdef GL_SGIX_texture_multi_buffer + "GL_SGIX_texture_multi_buffer", +#endif +#ifdef GL_SGIX_texture_phase + "GL_SGIX_texture_phase", +#endif +#ifdef GL_SGIX_texture_range + "GL_SGIX_texture_range", +#endif +#ifdef GL_SGIX_texture_scale_bias + "GL_SGIX_texture_scale_bias", +#endif +#ifdef GL_SGIX_texture_supersample + "GL_SGIX_texture_supersample", +#endif +#ifdef GL_SGIX_vector_ops + "GL_SGIX_vector_ops", +#endif +#ifdef GL_SGIX_vertex_array_object + "GL_SGIX_vertex_array_object", +#endif +#ifdef GL_SGIX_vertex_preclip + "GL_SGIX_vertex_preclip", +#endif +#ifdef GL_SGIX_vertex_preclip_hint + "GL_SGIX_vertex_preclip_hint", +#endif +#ifdef GL_SGIX_ycrcb + "GL_SGIX_ycrcb", +#endif +#ifdef GL_SGIX_ycrcb_subsample + "GL_SGIX_ycrcb_subsample", +#endif +#ifdef GL_SGIX_ycrcba + "GL_SGIX_ycrcba", +#endif +#ifdef GL_SGI_color_matrix + "GL_SGI_color_matrix", +#endif +#ifdef GL_SGI_color_table + "GL_SGI_color_table", +#endif +#ifdef GL_SGI_complex + "GL_SGI_complex", +#endif +#ifdef GL_SGI_complex_type + "GL_SGI_complex_type", +#endif +#ifdef GL_SGI_fft + "GL_SGI_fft", +#endif +#ifdef GL_SGI_texture_color_table + "GL_SGI_texture_color_table", +#endif +#ifdef GL_SUNX_constant_data + "GL_SUNX_constant_data", +#endif +#ifdef GL_SUN_convolution_border_modes + "GL_SUN_convolution_border_modes", +#endif +#ifdef GL_SUN_global_alpha + "GL_SUN_global_alpha", +#endif +#ifdef GL_SUN_mesh_array + "GL_SUN_mesh_array", +#endif +#ifdef GL_SUN_read_video_pixels + "GL_SUN_read_video_pixels", +#endif +#ifdef GL_SUN_slice_accum + "GL_SUN_slice_accum", +#endif +#ifdef GL_SUN_triangle_list + "GL_SUN_triangle_list", +#endif +#ifdef GL_SUN_vertex + "GL_SUN_vertex", +#endif +#ifdef GL_WIN_phong_shading + "GL_WIN_phong_shading", +#endif +#ifdef GL_WIN_scene_markerXXX + "GL_WIN_scene_markerXXX", +#endif +#ifdef GL_WIN_specular_fog + "GL_WIN_specular_fog", +#endif +#ifdef GL_WIN_swap_hint + "GL_WIN_swap_hint", +#endif + NULL +}; + +/* Detected in the extension string or strings */ +static GLboolean _glewExtensionString[801]; +/* Detected via extension string or experimental mode */ +static GLboolean* _glewExtensionEnabled[] = { +#ifdef GL_VERSION_1_2 + &__GLEW_VERSION_1_2, +#endif +#ifdef GL_VERSION_1_2_1 + &__GLEW_VERSION_1_2_1, +#endif +#ifdef GL_VERSION_1_3 + &__GLEW_VERSION_1_3, +#endif +#ifdef GL_VERSION_1_4 + &__GLEW_VERSION_1_4, +#endif +#ifdef GL_VERSION_1_5 + &__GLEW_VERSION_1_5, +#endif +#ifdef GL_VERSION_2_0 + &__GLEW_VERSION_2_0, +#endif +#ifdef GL_VERSION_2_1 + &__GLEW_VERSION_2_1, +#endif +#ifdef GL_VERSION_3_0 + &__GLEW_VERSION_3_0, +#endif +#ifdef GL_VERSION_3_1 + &__GLEW_VERSION_3_1, +#endif +#ifdef GL_VERSION_3_2 + &__GLEW_VERSION_3_2, +#endif +#ifdef GL_VERSION_3_3 + &__GLEW_VERSION_3_3, +#endif +#ifdef GL_VERSION_4_0 + &__GLEW_VERSION_4_0, +#endif +#ifdef GL_VERSION_4_1 + &__GLEW_VERSION_4_1, +#endif +#ifdef GL_VERSION_4_2 + &__GLEW_VERSION_4_2, +#endif +#ifdef GL_VERSION_4_3 + &__GLEW_VERSION_4_3, +#endif +#ifdef GL_VERSION_4_4 + &__GLEW_VERSION_4_4, +#endif +#ifdef GL_VERSION_4_5 + &__GLEW_VERSION_4_5, +#endif +#ifdef GL_VERSION_4_6 + &__GLEW_VERSION_4_6, +#endif +#ifdef GL_3DFX_multisample + &__GLEW_3DFX_multisample, +#endif +#ifdef GL_3DFX_tbuffer + &__GLEW_3DFX_tbuffer, +#endif +#ifdef GL_3DFX_texture_compression_FXT1 + &__GLEW_3DFX_texture_compression_FXT1, +#endif +#ifdef GL_AMD_blend_minmax_factor + &__GLEW_AMD_blend_minmax_factor, +#endif +#ifdef GL_AMD_compressed_3DC_texture + &__GLEW_AMD_compressed_3DC_texture, +#endif +#ifdef GL_AMD_compressed_ATC_texture + &__GLEW_AMD_compressed_ATC_texture, +#endif +#ifdef GL_AMD_conservative_depth + &__GLEW_AMD_conservative_depth, +#endif +#ifdef GL_AMD_debug_output + &__GLEW_AMD_debug_output, +#endif +#ifdef GL_AMD_depth_clamp_separate + &__GLEW_AMD_depth_clamp_separate, +#endif +#ifdef GL_AMD_draw_buffers_blend + &__GLEW_AMD_draw_buffers_blend, +#endif +#ifdef GL_AMD_framebuffer_sample_positions + &__GLEW_AMD_framebuffer_sample_positions, +#endif +#ifdef GL_AMD_gcn_shader + &__GLEW_AMD_gcn_shader, +#endif +#ifdef GL_AMD_gpu_shader_half_float + &__GLEW_AMD_gpu_shader_half_float, +#endif +#ifdef GL_AMD_gpu_shader_int16 + &__GLEW_AMD_gpu_shader_int16, +#endif +#ifdef GL_AMD_gpu_shader_int64 + &__GLEW_AMD_gpu_shader_int64, +#endif +#ifdef GL_AMD_interleaved_elements + &__GLEW_AMD_interleaved_elements, +#endif +#ifdef GL_AMD_multi_draw_indirect + &__GLEW_AMD_multi_draw_indirect, +#endif +#ifdef GL_AMD_name_gen_delete + &__GLEW_AMD_name_gen_delete, +#endif +#ifdef GL_AMD_occlusion_query_event + &__GLEW_AMD_occlusion_query_event, +#endif +#ifdef GL_AMD_performance_monitor + &__GLEW_AMD_performance_monitor, +#endif +#ifdef GL_AMD_pinned_memory + &__GLEW_AMD_pinned_memory, +#endif +#ifdef GL_AMD_program_binary_Z400 + &__GLEW_AMD_program_binary_Z400, +#endif +#ifdef GL_AMD_query_buffer_object + &__GLEW_AMD_query_buffer_object, +#endif +#ifdef GL_AMD_sample_positions + &__GLEW_AMD_sample_positions, +#endif +#ifdef GL_AMD_seamless_cubemap_per_texture + &__GLEW_AMD_seamless_cubemap_per_texture, +#endif +#ifdef GL_AMD_shader_atomic_counter_ops + &__GLEW_AMD_shader_atomic_counter_ops, +#endif +#ifdef GL_AMD_shader_ballot + &__GLEW_AMD_shader_ballot, +#endif +#ifdef GL_AMD_shader_explicit_vertex_parameter + &__GLEW_AMD_shader_explicit_vertex_parameter, +#endif +#ifdef GL_AMD_shader_stencil_export + &__GLEW_AMD_shader_stencil_export, +#endif +#ifdef GL_AMD_shader_stencil_value_export + &__GLEW_AMD_shader_stencil_value_export, +#endif +#ifdef GL_AMD_shader_trinary_minmax + &__GLEW_AMD_shader_trinary_minmax, +#endif +#ifdef GL_AMD_sparse_texture + &__GLEW_AMD_sparse_texture, +#endif +#ifdef GL_AMD_stencil_operation_extended + &__GLEW_AMD_stencil_operation_extended, +#endif +#ifdef GL_AMD_texture_gather_bias_lod + &__GLEW_AMD_texture_gather_bias_lod, +#endif +#ifdef GL_AMD_texture_texture4 + &__GLEW_AMD_texture_texture4, +#endif +#ifdef GL_AMD_transform_feedback3_lines_triangles + &__GLEW_AMD_transform_feedback3_lines_triangles, +#endif +#ifdef GL_AMD_transform_feedback4 + &__GLEW_AMD_transform_feedback4, +#endif +#ifdef GL_AMD_vertex_shader_layer + &__GLEW_AMD_vertex_shader_layer, +#endif +#ifdef GL_AMD_vertex_shader_tessellator + &__GLEW_AMD_vertex_shader_tessellator, +#endif +#ifdef GL_AMD_vertex_shader_viewport_index + &__GLEW_AMD_vertex_shader_viewport_index, +#endif +#ifdef GL_ANDROID_extension_pack_es31a + &__GLEW_ANDROID_extension_pack_es31a, +#endif +#ifdef GL_ANGLE_depth_texture + &__GLEW_ANGLE_depth_texture, +#endif +#ifdef GL_ANGLE_framebuffer_blit + &__GLEW_ANGLE_framebuffer_blit, +#endif +#ifdef GL_ANGLE_framebuffer_multisample + &__GLEW_ANGLE_framebuffer_multisample, +#endif +#ifdef GL_ANGLE_instanced_arrays + &__GLEW_ANGLE_instanced_arrays, +#endif +#ifdef GL_ANGLE_pack_reverse_row_order + &__GLEW_ANGLE_pack_reverse_row_order, +#endif +#ifdef GL_ANGLE_program_binary + &__GLEW_ANGLE_program_binary, +#endif +#ifdef GL_ANGLE_texture_compression_dxt1 + &__GLEW_ANGLE_texture_compression_dxt1, +#endif +#ifdef GL_ANGLE_texture_compression_dxt3 + &__GLEW_ANGLE_texture_compression_dxt3, +#endif +#ifdef GL_ANGLE_texture_compression_dxt5 + &__GLEW_ANGLE_texture_compression_dxt5, +#endif +#ifdef GL_ANGLE_texture_usage + &__GLEW_ANGLE_texture_usage, +#endif +#ifdef GL_ANGLE_timer_query + &__GLEW_ANGLE_timer_query, +#endif +#ifdef GL_ANGLE_translated_shader_source + &__GLEW_ANGLE_translated_shader_source, +#endif +#ifdef GL_APPLE_aux_depth_stencil + &__GLEW_APPLE_aux_depth_stencil, +#endif +#ifdef GL_APPLE_client_storage + &__GLEW_APPLE_client_storage, +#endif +#ifdef GL_APPLE_clip_distance + &__GLEW_APPLE_clip_distance, +#endif +#ifdef GL_APPLE_color_buffer_packed_float + &__GLEW_APPLE_color_buffer_packed_float, +#endif +#ifdef GL_APPLE_copy_texture_levels + &__GLEW_APPLE_copy_texture_levels, +#endif +#ifdef GL_APPLE_element_array + &__GLEW_APPLE_element_array, +#endif +#ifdef GL_APPLE_fence + &__GLEW_APPLE_fence, +#endif +#ifdef GL_APPLE_float_pixels + &__GLEW_APPLE_float_pixels, +#endif +#ifdef GL_APPLE_flush_buffer_range + &__GLEW_APPLE_flush_buffer_range, +#endif +#ifdef GL_APPLE_framebuffer_multisample + &__GLEW_APPLE_framebuffer_multisample, +#endif +#ifdef GL_APPLE_object_purgeable + &__GLEW_APPLE_object_purgeable, +#endif +#ifdef GL_APPLE_pixel_buffer + &__GLEW_APPLE_pixel_buffer, +#endif +#ifdef GL_APPLE_rgb_422 + &__GLEW_APPLE_rgb_422, +#endif +#ifdef GL_APPLE_row_bytes + &__GLEW_APPLE_row_bytes, +#endif +#ifdef GL_APPLE_specular_vector + &__GLEW_APPLE_specular_vector, +#endif +#ifdef GL_APPLE_sync + &__GLEW_APPLE_sync, +#endif +#ifdef GL_APPLE_texture_2D_limited_npot + &__GLEW_APPLE_texture_2D_limited_npot, +#endif +#ifdef GL_APPLE_texture_format_BGRA8888 + &__GLEW_APPLE_texture_format_BGRA8888, +#endif +#ifdef GL_APPLE_texture_max_level + &__GLEW_APPLE_texture_max_level, +#endif +#ifdef GL_APPLE_texture_packed_float + &__GLEW_APPLE_texture_packed_float, +#endif +#ifdef GL_APPLE_texture_range + &__GLEW_APPLE_texture_range, +#endif +#ifdef GL_APPLE_transform_hint + &__GLEW_APPLE_transform_hint, +#endif +#ifdef GL_APPLE_vertex_array_object + &__GLEW_APPLE_vertex_array_object, +#endif +#ifdef GL_APPLE_vertex_array_range + &__GLEW_APPLE_vertex_array_range, +#endif +#ifdef GL_APPLE_vertex_program_evaluators + &__GLEW_APPLE_vertex_program_evaluators, +#endif +#ifdef GL_APPLE_ycbcr_422 + &__GLEW_APPLE_ycbcr_422, +#endif +#ifdef GL_ARB_ES2_compatibility + &__GLEW_ARB_ES2_compatibility, +#endif +#ifdef GL_ARB_ES3_1_compatibility + &__GLEW_ARB_ES3_1_compatibility, +#endif +#ifdef GL_ARB_ES3_2_compatibility + &__GLEW_ARB_ES3_2_compatibility, +#endif +#ifdef GL_ARB_ES3_compatibility + &__GLEW_ARB_ES3_compatibility, +#endif +#ifdef GL_ARB_arrays_of_arrays + &__GLEW_ARB_arrays_of_arrays, +#endif +#ifdef GL_ARB_base_instance + &__GLEW_ARB_base_instance, +#endif +#ifdef GL_ARB_bindless_texture + &__GLEW_ARB_bindless_texture, +#endif +#ifdef GL_ARB_blend_func_extended + &__GLEW_ARB_blend_func_extended, +#endif +#ifdef GL_ARB_buffer_storage + &__GLEW_ARB_buffer_storage, +#endif +#ifdef GL_ARB_cl_event + &__GLEW_ARB_cl_event, +#endif +#ifdef GL_ARB_clear_buffer_object + &__GLEW_ARB_clear_buffer_object, +#endif +#ifdef GL_ARB_clear_texture + &__GLEW_ARB_clear_texture, +#endif +#ifdef GL_ARB_clip_control + &__GLEW_ARB_clip_control, +#endif +#ifdef GL_ARB_color_buffer_float + &__GLEW_ARB_color_buffer_float, +#endif +#ifdef GL_ARB_compatibility + &__GLEW_ARB_compatibility, +#endif +#ifdef GL_ARB_compressed_texture_pixel_storage + &__GLEW_ARB_compressed_texture_pixel_storage, +#endif +#ifdef GL_ARB_compute_shader + &__GLEW_ARB_compute_shader, +#endif +#ifdef GL_ARB_compute_variable_group_size + &__GLEW_ARB_compute_variable_group_size, +#endif +#ifdef GL_ARB_conditional_render_inverted + &__GLEW_ARB_conditional_render_inverted, +#endif +#ifdef GL_ARB_conservative_depth + &__GLEW_ARB_conservative_depth, +#endif +#ifdef GL_ARB_copy_buffer + &__GLEW_ARB_copy_buffer, +#endif +#ifdef GL_ARB_copy_image + &__GLEW_ARB_copy_image, +#endif +#ifdef GL_ARB_cull_distance + &__GLEW_ARB_cull_distance, +#endif +#ifdef GL_ARB_debug_output + &__GLEW_ARB_debug_output, +#endif +#ifdef GL_ARB_depth_buffer_float + &__GLEW_ARB_depth_buffer_float, +#endif +#ifdef GL_ARB_depth_clamp + &__GLEW_ARB_depth_clamp, +#endif +#ifdef GL_ARB_depth_texture + &__GLEW_ARB_depth_texture, +#endif +#ifdef GL_ARB_derivative_control + &__GLEW_ARB_derivative_control, +#endif +#ifdef GL_ARB_direct_state_access + &__GLEW_ARB_direct_state_access, +#endif +#ifdef GL_ARB_draw_buffers + &__GLEW_ARB_draw_buffers, +#endif +#ifdef GL_ARB_draw_buffers_blend + &__GLEW_ARB_draw_buffers_blend, +#endif +#ifdef GL_ARB_draw_elements_base_vertex + &__GLEW_ARB_draw_elements_base_vertex, +#endif +#ifdef GL_ARB_draw_indirect + &__GLEW_ARB_draw_indirect, +#endif +#ifdef GL_ARB_draw_instanced + &__GLEW_ARB_draw_instanced, +#endif +#ifdef GL_ARB_enhanced_layouts + &__GLEW_ARB_enhanced_layouts, +#endif +#ifdef GL_ARB_explicit_attrib_location + &__GLEW_ARB_explicit_attrib_location, +#endif +#ifdef GL_ARB_explicit_uniform_location + &__GLEW_ARB_explicit_uniform_location, +#endif +#ifdef GL_ARB_fragment_coord_conventions + &__GLEW_ARB_fragment_coord_conventions, +#endif +#ifdef GL_ARB_fragment_layer_viewport + &__GLEW_ARB_fragment_layer_viewport, +#endif +#ifdef GL_ARB_fragment_program + &__GLEW_ARB_fragment_program, +#endif +#ifdef GL_ARB_fragment_program_shadow + &__GLEW_ARB_fragment_program_shadow, +#endif +#ifdef GL_ARB_fragment_shader + &__GLEW_ARB_fragment_shader, +#endif +#ifdef GL_ARB_fragment_shader_interlock + &__GLEW_ARB_fragment_shader_interlock, +#endif +#ifdef GL_ARB_framebuffer_no_attachments + &__GLEW_ARB_framebuffer_no_attachments, +#endif +#ifdef GL_ARB_framebuffer_object + &__GLEW_ARB_framebuffer_object, +#endif +#ifdef GL_ARB_framebuffer_sRGB + &__GLEW_ARB_framebuffer_sRGB, +#endif +#ifdef GL_ARB_geometry_shader4 + &__GLEW_ARB_geometry_shader4, +#endif +#ifdef GL_ARB_get_program_binary + &__GLEW_ARB_get_program_binary, +#endif +#ifdef GL_ARB_get_texture_sub_image + &__GLEW_ARB_get_texture_sub_image, +#endif +#ifdef GL_ARB_gl_spirv + &__GLEW_ARB_gl_spirv, +#endif +#ifdef GL_ARB_gpu_shader5 + &__GLEW_ARB_gpu_shader5, +#endif +#ifdef GL_ARB_gpu_shader_fp64 + &__GLEW_ARB_gpu_shader_fp64, +#endif +#ifdef GL_ARB_gpu_shader_int64 + &__GLEW_ARB_gpu_shader_int64, +#endif +#ifdef GL_ARB_half_float_pixel + &__GLEW_ARB_half_float_pixel, +#endif +#ifdef GL_ARB_half_float_vertex + &__GLEW_ARB_half_float_vertex, +#endif +#ifdef GL_ARB_imaging + &__GLEW_ARB_imaging, +#endif +#ifdef GL_ARB_indirect_parameters + &__GLEW_ARB_indirect_parameters, +#endif +#ifdef GL_ARB_instanced_arrays + &__GLEW_ARB_instanced_arrays, +#endif +#ifdef GL_ARB_internalformat_query + &__GLEW_ARB_internalformat_query, +#endif +#ifdef GL_ARB_internalformat_query2 + &__GLEW_ARB_internalformat_query2, +#endif +#ifdef GL_ARB_invalidate_subdata + &__GLEW_ARB_invalidate_subdata, +#endif +#ifdef GL_ARB_map_buffer_alignment + &__GLEW_ARB_map_buffer_alignment, +#endif +#ifdef GL_ARB_map_buffer_range + &__GLEW_ARB_map_buffer_range, +#endif +#ifdef GL_ARB_matrix_palette + &__GLEW_ARB_matrix_palette, +#endif +#ifdef GL_ARB_multi_bind + &__GLEW_ARB_multi_bind, +#endif +#ifdef GL_ARB_multi_draw_indirect + &__GLEW_ARB_multi_draw_indirect, +#endif +#ifdef GL_ARB_multisample + &__GLEW_ARB_multisample, +#endif +#ifdef GL_ARB_multitexture + &__GLEW_ARB_multitexture, +#endif +#ifdef GL_ARB_occlusion_query + &__GLEW_ARB_occlusion_query, +#endif +#ifdef GL_ARB_occlusion_query2 + &__GLEW_ARB_occlusion_query2, +#endif +#ifdef GL_ARB_parallel_shader_compile + &__GLEW_ARB_parallel_shader_compile, +#endif +#ifdef GL_ARB_pipeline_statistics_query + &__GLEW_ARB_pipeline_statistics_query, +#endif +#ifdef GL_ARB_pixel_buffer_object + &__GLEW_ARB_pixel_buffer_object, +#endif +#ifdef GL_ARB_point_parameters + &__GLEW_ARB_point_parameters, +#endif +#ifdef GL_ARB_point_sprite + &__GLEW_ARB_point_sprite, +#endif +#ifdef GL_ARB_polygon_offset_clamp + &__GLEW_ARB_polygon_offset_clamp, +#endif +#ifdef GL_ARB_post_depth_coverage + &__GLEW_ARB_post_depth_coverage, +#endif +#ifdef GL_ARB_program_interface_query + &__GLEW_ARB_program_interface_query, +#endif +#ifdef GL_ARB_provoking_vertex + &__GLEW_ARB_provoking_vertex, +#endif +#ifdef GL_ARB_query_buffer_object + &__GLEW_ARB_query_buffer_object, +#endif +#ifdef GL_ARB_robust_buffer_access_behavior + &__GLEW_ARB_robust_buffer_access_behavior, +#endif +#ifdef GL_ARB_robustness + &__GLEW_ARB_robustness, +#endif +#ifdef GL_ARB_robustness_application_isolation + &__GLEW_ARB_robustness_application_isolation, +#endif +#ifdef GL_ARB_robustness_share_group_isolation + &__GLEW_ARB_robustness_share_group_isolation, +#endif +#ifdef GL_ARB_sample_locations + &__GLEW_ARB_sample_locations, +#endif +#ifdef GL_ARB_sample_shading + &__GLEW_ARB_sample_shading, +#endif +#ifdef GL_ARB_sampler_objects + &__GLEW_ARB_sampler_objects, +#endif +#ifdef GL_ARB_seamless_cube_map + &__GLEW_ARB_seamless_cube_map, +#endif +#ifdef GL_ARB_seamless_cubemap_per_texture + &__GLEW_ARB_seamless_cubemap_per_texture, +#endif +#ifdef GL_ARB_separate_shader_objects + &__GLEW_ARB_separate_shader_objects, +#endif +#ifdef GL_ARB_shader_atomic_counter_ops + &__GLEW_ARB_shader_atomic_counter_ops, +#endif +#ifdef GL_ARB_shader_atomic_counters + &__GLEW_ARB_shader_atomic_counters, +#endif +#ifdef GL_ARB_shader_ballot + &__GLEW_ARB_shader_ballot, +#endif +#ifdef GL_ARB_shader_bit_encoding + &__GLEW_ARB_shader_bit_encoding, +#endif +#ifdef GL_ARB_shader_clock + &__GLEW_ARB_shader_clock, +#endif +#ifdef GL_ARB_shader_draw_parameters + &__GLEW_ARB_shader_draw_parameters, +#endif +#ifdef GL_ARB_shader_group_vote + &__GLEW_ARB_shader_group_vote, +#endif +#ifdef GL_ARB_shader_image_load_store + &__GLEW_ARB_shader_image_load_store, +#endif +#ifdef GL_ARB_shader_image_size + &__GLEW_ARB_shader_image_size, +#endif +#ifdef GL_ARB_shader_objects + &__GLEW_ARB_shader_objects, +#endif +#ifdef GL_ARB_shader_precision + &__GLEW_ARB_shader_precision, +#endif +#ifdef GL_ARB_shader_stencil_export + &__GLEW_ARB_shader_stencil_export, +#endif +#ifdef GL_ARB_shader_storage_buffer_object + &__GLEW_ARB_shader_storage_buffer_object, +#endif +#ifdef GL_ARB_shader_subroutine + &__GLEW_ARB_shader_subroutine, +#endif +#ifdef GL_ARB_shader_texture_image_samples + &__GLEW_ARB_shader_texture_image_samples, +#endif +#ifdef GL_ARB_shader_texture_lod + &__GLEW_ARB_shader_texture_lod, +#endif +#ifdef GL_ARB_shader_viewport_layer_array + &__GLEW_ARB_shader_viewport_layer_array, +#endif +#ifdef GL_ARB_shading_language_100 + &__GLEW_ARB_shading_language_100, +#endif +#ifdef GL_ARB_shading_language_420pack + &__GLEW_ARB_shading_language_420pack, +#endif +#ifdef GL_ARB_shading_language_include + &__GLEW_ARB_shading_language_include, +#endif +#ifdef GL_ARB_shading_language_packing + &__GLEW_ARB_shading_language_packing, +#endif +#ifdef GL_ARB_shadow + &__GLEW_ARB_shadow, +#endif +#ifdef GL_ARB_shadow_ambient + &__GLEW_ARB_shadow_ambient, +#endif +#ifdef GL_ARB_sparse_buffer + &__GLEW_ARB_sparse_buffer, +#endif +#ifdef GL_ARB_sparse_texture + &__GLEW_ARB_sparse_texture, +#endif +#ifdef GL_ARB_sparse_texture2 + &__GLEW_ARB_sparse_texture2, +#endif +#ifdef GL_ARB_sparse_texture_clamp + &__GLEW_ARB_sparse_texture_clamp, +#endif +#ifdef GL_ARB_spirv_extensions + &__GLEW_ARB_spirv_extensions, +#endif +#ifdef GL_ARB_stencil_texturing + &__GLEW_ARB_stencil_texturing, +#endif +#ifdef GL_ARB_sync + &__GLEW_ARB_sync, +#endif +#ifdef GL_ARB_tessellation_shader + &__GLEW_ARB_tessellation_shader, +#endif +#ifdef GL_ARB_texture_barrier + &__GLEW_ARB_texture_barrier, +#endif +#ifdef GL_ARB_texture_border_clamp + &__GLEW_ARB_texture_border_clamp, +#endif +#ifdef GL_ARB_texture_buffer_object + &__GLEW_ARB_texture_buffer_object, +#endif +#ifdef GL_ARB_texture_buffer_object_rgb32 + &__GLEW_ARB_texture_buffer_object_rgb32, +#endif +#ifdef GL_ARB_texture_buffer_range + &__GLEW_ARB_texture_buffer_range, +#endif +#ifdef GL_ARB_texture_compression + &__GLEW_ARB_texture_compression, +#endif +#ifdef GL_ARB_texture_compression_bptc + &__GLEW_ARB_texture_compression_bptc, +#endif +#ifdef GL_ARB_texture_compression_rgtc + &__GLEW_ARB_texture_compression_rgtc, +#endif +#ifdef GL_ARB_texture_cube_map + &__GLEW_ARB_texture_cube_map, +#endif +#ifdef GL_ARB_texture_cube_map_array + &__GLEW_ARB_texture_cube_map_array, +#endif +#ifdef GL_ARB_texture_env_add + &__GLEW_ARB_texture_env_add, +#endif +#ifdef GL_ARB_texture_env_combine + &__GLEW_ARB_texture_env_combine, +#endif +#ifdef GL_ARB_texture_env_crossbar + &__GLEW_ARB_texture_env_crossbar, +#endif +#ifdef GL_ARB_texture_env_dot3 + &__GLEW_ARB_texture_env_dot3, +#endif +#ifdef GL_ARB_texture_filter_anisotropic + &__GLEW_ARB_texture_filter_anisotropic, +#endif +#ifdef GL_ARB_texture_filter_minmax + &__GLEW_ARB_texture_filter_minmax, +#endif +#ifdef GL_ARB_texture_float + &__GLEW_ARB_texture_float, +#endif +#ifdef GL_ARB_texture_gather + &__GLEW_ARB_texture_gather, +#endif +#ifdef GL_ARB_texture_mirror_clamp_to_edge + &__GLEW_ARB_texture_mirror_clamp_to_edge, +#endif +#ifdef GL_ARB_texture_mirrored_repeat + &__GLEW_ARB_texture_mirrored_repeat, +#endif +#ifdef GL_ARB_texture_multisample + &__GLEW_ARB_texture_multisample, +#endif +#ifdef GL_ARB_texture_non_power_of_two + &__GLEW_ARB_texture_non_power_of_two, +#endif +#ifdef GL_ARB_texture_query_levels + &__GLEW_ARB_texture_query_levels, +#endif +#ifdef GL_ARB_texture_query_lod + &__GLEW_ARB_texture_query_lod, +#endif +#ifdef GL_ARB_texture_rectangle + &__GLEW_ARB_texture_rectangle, +#endif +#ifdef GL_ARB_texture_rg + &__GLEW_ARB_texture_rg, +#endif +#ifdef GL_ARB_texture_rgb10_a2ui + &__GLEW_ARB_texture_rgb10_a2ui, +#endif +#ifdef GL_ARB_texture_stencil8 + &__GLEW_ARB_texture_stencil8, +#endif +#ifdef GL_ARB_texture_storage + &__GLEW_ARB_texture_storage, +#endif +#ifdef GL_ARB_texture_storage_multisample + &__GLEW_ARB_texture_storage_multisample, +#endif +#ifdef GL_ARB_texture_swizzle + &__GLEW_ARB_texture_swizzle, +#endif +#ifdef GL_ARB_texture_view + &__GLEW_ARB_texture_view, +#endif +#ifdef GL_ARB_timer_query + &__GLEW_ARB_timer_query, +#endif +#ifdef GL_ARB_transform_feedback2 + &__GLEW_ARB_transform_feedback2, +#endif +#ifdef GL_ARB_transform_feedback3 + &__GLEW_ARB_transform_feedback3, +#endif +#ifdef GL_ARB_transform_feedback_instanced + &__GLEW_ARB_transform_feedback_instanced, +#endif +#ifdef GL_ARB_transform_feedback_overflow_query + &__GLEW_ARB_transform_feedback_overflow_query, +#endif +#ifdef GL_ARB_transpose_matrix + &__GLEW_ARB_transpose_matrix, +#endif +#ifdef GL_ARB_uniform_buffer_object + &__GLEW_ARB_uniform_buffer_object, +#endif +#ifdef GL_ARB_vertex_array_bgra + &__GLEW_ARB_vertex_array_bgra, +#endif +#ifdef GL_ARB_vertex_array_object + &__GLEW_ARB_vertex_array_object, +#endif +#ifdef GL_ARB_vertex_attrib_64bit + &__GLEW_ARB_vertex_attrib_64bit, +#endif +#ifdef GL_ARB_vertex_attrib_binding + &__GLEW_ARB_vertex_attrib_binding, +#endif +#ifdef GL_ARB_vertex_blend + &__GLEW_ARB_vertex_blend, +#endif +#ifdef GL_ARB_vertex_buffer_object + &__GLEW_ARB_vertex_buffer_object, +#endif +#ifdef GL_ARB_vertex_program + &__GLEW_ARB_vertex_program, +#endif +#ifdef GL_ARB_vertex_shader + &__GLEW_ARB_vertex_shader, +#endif +#ifdef GL_ARB_vertex_type_10f_11f_11f_rev + &__GLEW_ARB_vertex_type_10f_11f_11f_rev, +#endif +#ifdef GL_ARB_vertex_type_2_10_10_10_rev + &__GLEW_ARB_vertex_type_2_10_10_10_rev, +#endif +#ifdef GL_ARB_viewport_array + &__GLEW_ARB_viewport_array, +#endif +#ifdef GL_ARB_window_pos + &__GLEW_ARB_window_pos, +#endif +#ifdef GL_ARM_mali_program_binary + &__GLEW_ARM_mali_program_binary, +#endif +#ifdef GL_ARM_mali_shader_binary + &__GLEW_ARM_mali_shader_binary, +#endif +#ifdef GL_ARM_rgba8 + &__GLEW_ARM_rgba8, +#endif +#ifdef GL_ARM_shader_framebuffer_fetch + &__GLEW_ARM_shader_framebuffer_fetch, +#endif +#ifdef GL_ARM_shader_framebuffer_fetch_depth_stencil + &__GLEW_ARM_shader_framebuffer_fetch_depth_stencil, +#endif +#ifdef GL_ATIX_point_sprites + &__GLEW_ATIX_point_sprites, +#endif +#ifdef GL_ATIX_texture_env_combine3 + &__GLEW_ATIX_texture_env_combine3, +#endif +#ifdef GL_ATIX_texture_env_route + &__GLEW_ATIX_texture_env_route, +#endif +#ifdef GL_ATIX_vertex_shader_output_point_size + &__GLEW_ATIX_vertex_shader_output_point_size, +#endif +#ifdef GL_ATI_draw_buffers + &__GLEW_ATI_draw_buffers, +#endif +#ifdef GL_ATI_element_array + &__GLEW_ATI_element_array, +#endif +#ifdef GL_ATI_envmap_bumpmap + &__GLEW_ATI_envmap_bumpmap, +#endif +#ifdef GL_ATI_fragment_shader + &__GLEW_ATI_fragment_shader, +#endif +#ifdef GL_ATI_map_object_buffer + &__GLEW_ATI_map_object_buffer, +#endif +#ifdef GL_ATI_meminfo + &__GLEW_ATI_meminfo, +#endif +#ifdef GL_ATI_pn_triangles + &__GLEW_ATI_pn_triangles, +#endif +#ifdef GL_ATI_separate_stencil + &__GLEW_ATI_separate_stencil, +#endif +#ifdef GL_ATI_shader_texture_lod + &__GLEW_ATI_shader_texture_lod, +#endif +#ifdef GL_ATI_text_fragment_shader + &__GLEW_ATI_text_fragment_shader, +#endif +#ifdef GL_ATI_texture_compression_3dc + &__GLEW_ATI_texture_compression_3dc, +#endif +#ifdef GL_ATI_texture_env_combine3 + &__GLEW_ATI_texture_env_combine3, +#endif +#ifdef GL_ATI_texture_float + &__GLEW_ATI_texture_float, +#endif +#ifdef GL_ATI_texture_mirror_once + &__GLEW_ATI_texture_mirror_once, +#endif +#ifdef GL_ATI_vertex_array_object + &__GLEW_ATI_vertex_array_object, +#endif +#ifdef GL_ATI_vertex_attrib_array_object + &__GLEW_ATI_vertex_attrib_array_object, +#endif +#ifdef GL_ATI_vertex_streams + &__GLEW_ATI_vertex_streams, +#endif +#ifdef GL_EGL_KHR_context_flush_control + &__GLEW_EGL_KHR_context_flush_control, +#endif +#ifdef GL_EGL_NV_robustness_video_memory_purge + &__GLEW_EGL_NV_robustness_video_memory_purge, +#endif +#ifdef GL_EXT_422_pixels + &__GLEW_EXT_422_pixels, +#endif +#ifdef GL_EXT_Cg_shader + &__GLEW_EXT_Cg_shader, +#endif +#ifdef GL_EXT_EGL_image_array + &__GLEW_EXT_EGL_image_array, +#endif +#ifdef GL_EXT_YUV_target + &__GLEW_EXT_YUV_target, +#endif +#ifdef GL_EXT_abgr + &__GLEW_EXT_abgr, +#endif +#ifdef GL_EXT_base_instance + &__GLEW_EXT_base_instance, +#endif +#ifdef GL_EXT_bgra + &__GLEW_EXT_bgra, +#endif +#ifdef GL_EXT_bindable_uniform + &__GLEW_EXT_bindable_uniform, +#endif +#ifdef GL_EXT_blend_color + &__GLEW_EXT_blend_color, +#endif +#ifdef GL_EXT_blend_equation_separate + &__GLEW_EXT_blend_equation_separate, +#endif +#ifdef GL_EXT_blend_func_extended + &__GLEW_EXT_blend_func_extended, +#endif +#ifdef GL_EXT_blend_func_separate + &__GLEW_EXT_blend_func_separate, +#endif +#ifdef GL_EXT_blend_logic_op + &__GLEW_EXT_blend_logic_op, +#endif +#ifdef GL_EXT_blend_minmax + &__GLEW_EXT_blend_minmax, +#endif +#ifdef GL_EXT_blend_subtract + &__GLEW_EXT_blend_subtract, +#endif +#ifdef GL_EXT_buffer_storage + &__GLEW_EXT_buffer_storage, +#endif +#ifdef GL_EXT_clear_texture + &__GLEW_EXT_clear_texture, +#endif +#ifdef GL_EXT_clip_cull_distance + &__GLEW_EXT_clip_cull_distance, +#endif +#ifdef GL_EXT_clip_volume_hint + &__GLEW_EXT_clip_volume_hint, +#endif +#ifdef GL_EXT_cmyka + &__GLEW_EXT_cmyka, +#endif +#ifdef GL_EXT_color_buffer_float + &__GLEW_EXT_color_buffer_float, +#endif +#ifdef GL_EXT_color_buffer_half_float + &__GLEW_EXT_color_buffer_half_float, +#endif +#ifdef GL_EXT_color_subtable + &__GLEW_EXT_color_subtable, +#endif +#ifdef GL_EXT_compiled_vertex_array + &__GLEW_EXT_compiled_vertex_array, +#endif +#ifdef GL_EXT_compressed_ETC1_RGB8_sub_texture + &__GLEW_EXT_compressed_ETC1_RGB8_sub_texture, +#endif +#ifdef GL_EXT_conservative_depth + &__GLEW_EXT_conservative_depth, +#endif +#ifdef GL_EXT_convolution + &__GLEW_EXT_convolution, +#endif +#ifdef GL_EXT_coordinate_frame + &__GLEW_EXT_coordinate_frame, +#endif +#ifdef GL_EXT_copy_image + &__GLEW_EXT_copy_image, +#endif +#ifdef GL_EXT_copy_texture + &__GLEW_EXT_copy_texture, +#endif +#ifdef GL_EXT_cull_vertex + &__GLEW_EXT_cull_vertex, +#endif +#ifdef GL_EXT_debug_label + &__GLEW_EXT_debug_label, +#endif +#ifdef GL_EXT_debug_marker + &__GLEW_EXT_debug_marker, +#endif +#ifdef GL_EXT_depth_bounds_test + &__GLEW_EXT_depth_bounds_test, +#endif +#ifdef GL_EXT_direct_state_access + &__GLEW_EXT_direct_state_access, +#endif +#ifdef GL_EXT_discard_framebuffer + &__GLEW_EXT_discard_framebuffer, +#endif +#ifdef GL_EXT_draw_buffers + &__GLEW_EXT_draw_buffers, +#endif +#ifdef GL_EXT_draw_buffers2 + &__GLEW_EXT_draw_buffers2, +#endif +#ifdef GL_EXT_draw_buffers_indexed + &__GLEW_EXT_draw_buffers_indexed, +#endif +#ifdef GL_EXT_draw_elements_base_vertex + &__GLEW_EXT_draw_elements_base_vertex, +#endif +#ifdef GL_EXT_draw_instanced + &__GLEW_EXT_draw_instanced, +#endif +#ifdef GL_EXT_draw_range_elements + &__GLEW_EXT_draw_range_elements, +#endif +#ifdef GL_EXT_external_buffer + &__GLEW_EXT_external_buffer, +#endif +#ifdef GL_EXT_float_blend + &__GLEW_EXT_float_blend, +#endif +#ifdef GL_EXT_fog_coord + &__GLEW_EXT_fog_coord, +#endif +#ifdef GL_EXT_frag_depth + &__GLEW_EXT_frag_depth, +#endif +#ifdef GL_EXT_fragment_lighting + &__GLEW_EXT_fragment_lighting, +#endif +#ifdef GL_EXT_framebuffer_blit + &__GLEW_EXT_framebuffer_blit, +#endif +#ifdef GL_EXT_framebuffer_multisample + &__GLEW_EXT_framebuffer_multisample, +#endif +#ifdef GL_EXT_framebuffer_multisample_blit_scaled + &__GLEW_EXT_framebuffer_multisample_blit_scaled, +#endif +#ifdef GL_EXT_framebuffer_object + &__GLEW_EXT_framebuffer_object, +#endif +#ifdef GL_EXT_framebuffer_sRGB + &__GLEW_EXT_framebuffer_sRGB, +#endif +#ifdef GL_EXT_geometry_point_size + &__GLEW_EXT_geometry_point_size, +#endif +#ifdef GL_EXT_geometry_shader + &__GLEW_EXT_geometry_shader, +#endif +#ifdef GL_EXT_geometry_shader4 + &__GLEW_EXT_geometry_shader4, +#endif +#ifdef GL_EXT_gpu_program_parameters + &__GLEW_EXT_gpu_program_parameters, +#endif +#ifdef GL_EXT_gpu_shader4 + &__GLEW_EXT_gpu_shader4, +#endif +#ifdef GL_EXT_gpu_shader5 + &__GLEW_EXT_gpu_shader5, +#endif +#ifdef GL_EXT_histogram + &__GLEW_EXT_histogram, +#endif +#ifdef GL_EXT_index_array_formats + &__GLEW_EXT_index_array_formats, +#endif +#ifdef GL_EXT_index_func + &__GLEW_EXT_index_func, +#endif +#ifdef GL_EXT_index_material + &__GLEW_EXT_index_material, +#endif +#ifdef GL_EXT_index_texture + &__GLEW_EXT_index_texture, +#endif +#ifdef GL_EXT_instanced_arrays + &__GLEW_EXT_instanced_arrays, +#endif +#ifdef GL_EXT_light_texture + &__GLEW_EXT_light_texture, +#endif +#ifdef GL_EXT_map_buffer_range + &__GLEW_EXT_map_buffer_range, +#endif +#ifdef GL_EXT_memory_object + &__GLEW_EXT_memory_object, +#endif +#ifdef GL_EXT_memory_object_fd + &__GLEW_EXT_memory_object_fd, +#endif +#ifdef GL_EXT_memory_object_win32 + &__GLEW_EXT_memory_object_win32, +#endif +#ifdef GL_EXT_misc_attribute + &__GLEW_EXT_misc_attribute, +#endif +#ifdef GL_EXT_multi_draw_arrays + &__GLEW_EXT_multi_draw_arrays, +#endif +#ifdef GL_EXT_multi_draw_indirect + &__GLEW_EXT_multi_draw_indirect, +#endif +#ifdef GL_EXT_multiple_textures + &__GLEW_EXT_multiple_textures, +#endif +#ifdef GL_EXT_multisample + &__GLEW_EXT_multisample, +#endif +#ifdef GL_EXT_multisample_compatibility + &__GLEW_EXT_multisample_compatibility, +#endif +#ifdef GL_EXT_multisampled_render_to_texture + &__GLEW_EXT_multisampled_render_to_texture, +#endif +#ifdef GL_EXT_multisampled_render_to_texture2 + &__GLEW_EXT_multisampled_render_to_texture2, +#endif +#ifdef GL_EXT_multiview_draw_buffers + &__GLEW_EXT_multiview_draw_buffers, +#endif +#ifdef GL_EXT_packed_depth_stencil + &__GLEW_EXT_packed_depth_stencil, +#endif +#ifdef GL_EXT_packed_float + &__GLEW_EXT_packed_float, +#endif +#ifdef GL_EXT_packed_pixels + &__GLEW_EXT_packed_pixels, +#endif +#ifdef GL_EXT_paletted_texture + &__GLEW_EXT_paletted_texture, +#endif +#ifdef GL_EXT_pixel_buffer_object + &__GLEW_EXT_pixel_buffer_object, +#endif +#ifdef GL_EXT_pixel_transform + &__GLEW_EXT_pixel_transform, +#endif +#ifdef GL_EXT_pixel_transform_color_table + &__GLEW_EXT_pixel_transform_color_table, +#endif +#ifdef GL_EXT_point_parameters + &__GLEW_EXT_point_parameters, +#endif +#ifdef GL_EXT_polygon_offset + &__GLEW_EXT_polygon_offset, +#endif +#ifdef GL_EXT_polygon_offset_clamp + &__GLEW_EXT_polygon_offset_clamp, +#endif +#ifdef GL_EXT_post_depth_coverage + &__GLEW_EXT_post_depth_coverage, +#endif +#ifdef GL_EXT_provoking_vertex + &__GLEW_EXT_provoking_vertex, +#endif +#ifdef GL_EXT_pvrtc_sRGB + &__GLEW_EXT_pvrtc_sRGB, +#endif +#ifdef GL_EXT_raster_multisample + &__GLEW_EXT_raster_multisample, +#endif +#ifdef GL_EXT_read_format_bgra + &__GLEW_EXT_read_format_bgra, +#endif +#ifdef GL_EXT_render_snorm + &__GLEW_EXT_render_snorm, +#endif +#ifdef GL_EXT_rescale_normal + &__GLEW_EXT_rescale_normal, +#endif +#ifdef GL_EXT_sRGB + &__GLEW_EXT_sRGB, +#endif +#ifdef GL_EXT_sRGB_write_control + &__GLEW_EXT_sRGB_write_control, +#endif +#ifdef GL_EXT_scene_marker + &__GLEW_EXT_scene_marker, +#endif +#ifdef GL_EXT_secondary_color + &__GLEW_EXT_secondary_color, +#endif +#ifdef GL_EXT_semaphore + &__GLEW_EXT_semaphore, +#endif +#ifdef GL_EXT_semaphore_fd + &__GLEW_EXT_semaphore_fd, +#endif +#ifdef GL_EXT_semaphore_win32 + &__GLEW_EXT_semaphore_win32, +#endif +#ifdef GL_EXT_separate_shader_objects + &__GLEW_EXT_separate_shader_objects, +#endif +#ifdef GL_EXT_separate_specular_color + &__GLEW_EXT_separate_specular_color, +#endif +#ifdef GL_EXT_shader_framebuffer_fetch + &__GLEW_EXT_shader_framebuffer_fetch, +#endif +#ifdef GL_EXT_shader_group_vote + &__GLEW_EXT_shader_group_vote, +#endif +#ifdef GL_EXT_shader_image_load_formatted + &__GLEW_EXT_shader_image_load_formatted, +#endif +#ifdef GL_EXT_shader_image_load_store + &__GLEW_EXT_shader_image_load_store, +#endif +#ifdef GL_EXT_shader_implicit_conversions + &__GLEW_EXT_shader_implicit_conversions, +#endif +#ifdef GL_EXT_shader_integer_mix + &__GLEW_EXT_shader_integer_mix, +#endif +#ifdef GL_EXT_shader_io_blocks + &__GLEW_EXT_shader_io_blocks, +#endif +#ifdef GL_EXT_shader_non_constant_global_initializers + &__GLEW_EXT_shader_non_constant_global_initializers, +#endif +#ifdef GL_EXT_shader_pixel_local_storage + &__GLEW_EXT_shader_pixel_local_storage, +#endif +#ifdef GL_EXT_shader_pixel_local_storage2 + &__GLEW_EXT_shader_pixel_local_storage2, +#endif +#ifdef GL_EXT_shader_texture_lod + &__GLEW_EXT_shader_texture_lod, +#endif +#ifdef GL_EXT_shadow_funcs + &__GLEW_EXT_shadow_funcs, +#endif +#ifdef GL_EXT_shadow_samplers + &__GLEW_EXT_shadow_samplers, +#endif +#ifdef GL_EXT_shared_texture_palette + &__GLEW_EXT_shared_texture_palette, +#endif +#ifdef GL_EXT_sparse_texture + &__GLEW_EXT_sparse_texture, +#endif +#ifdef GL_EXT_sparse_texture2 + &__GLEW_EXT_sparse_texture2, +#endif +#ifdef GL_EXT_stencil_clear_tag + &__GLEW_EXT_stencil_clear_tag, +#endif +#ifdef GL_EXT_stencil_two_side + &__GLEW_EXT_stencil_two_side, +#endif +#ifdef GL_EXT_stencil_wrap + &__GLEW_EXT_stencil_wrap, +#endif +#ifdef GL_EXT_subtexture + &__GLEW_EXT_subtexture, +#endif +#ifdef GL_EXT_texture + &__GLEW_EXT_texture, +#endif +#ifdef GL_EXT_texture3D + &__GLEW_EXT_texture3D, +#endif +#ifdef GL_EXT_texture_array + &__GLEW_EXT_texture_array, +#endif +#ifdef GL_EXT_texture_buffer_object + &__GLEW_EXT_texture_buffer_object, +#endif +#ifdef GL_EXT_texture_compression_astc_decode_mode + &__GLEW_EXT_texture_compression_astc_decode_mode, +#endif +#ifdef GL_EXT_texture_compression_astc_decode_mode_rgb9e5 + &__GLEW_EXT_texture_compression_astc_decode_mode_rgb9e5, +#endif +#ifdef GL_EXT_texture_compression_bptc + &__GLEW_EXT_texture_compression_bptc, +#endif +#ifdef GL_EXT_texture_compression_dxt1 + &__GLEW_EXT_texture_compression_dxt1, +#endif +#ifdef GL_EXT_texture_compression_latc + &__GLEW_EXT_texture_compression_latc, +#endif +#ifdef GL_EXT_texture_compression_rgtc + &__GLEW_EXT_texture_compression_rgtc, +#endif +#ifdef GL_EXT_texture_compression_s3tc + &__GLEW_EXT_texture_compression_s3tc, +#endif +#ifdef GL_EXT_texture_cube_map + &__GLEW_EXT_texture_cube_map, +#endif +#ifdef GL_EXT_texture_cube_map_array + &__GLEW_EXT_texture_cube_map_array, +#endif +#ifdef GL_EXT_texture_edge_clamp + &__GLEW_EXT_texture_edge_clamp, +#endif +#ifdef GL_EXT_texture_env + &__GLEW_EXT_texture_env, +#endif +#ifdef GL_EXT_texture_env_add + &__GLEW_EXT_texture_env_add, +#endif +#ifdef GL_EXT_texture_env_combine + &__GLEW_EXT_texture_env_combine, +#endif +#ifdef GL_EXT_texture_env_dot3 + &__GLEW_EXT_texture_env_dot3, +#endif +#ifdef GL_EXT_texture_filter_anisotropic + &__GLEW_EXT_texture_filter_anisotropic, +#endif +#ifdef GL_EXT_texture_filter_minmax + &__GLEW_EXT_texture_filter_minmax, +#endif +#ifdef GL_EXT_texture_format_BGRA8888 + &__GLEW_EXT_texture_format_BGRA8888, +#endif +#ifdef GL_EXT_texture_integer + &__GLEW_EXT_texture_integer, +#endif +#ifdef GL_EXT_texture_lod_bias + &__GLEW_EXT_texture_lod_bias, +#endif +#ifdef GL_EXT_texture_mirror_clamp + &__GLEW_EXT_texture_mirror_clamp, +#endif +#ifdef GL_EXT_texture_norm16 + &__GLEW_EXT_texture_norm16, +#endif +#ifdef GL_EXT_texture_object + &__GLEW_EXT_texture_object, +#endif +#ifdef GL_EXT_texture_perturb_normal + &__GLEW_EXT_texture_perturb_normal, +#endif +#ifdef GL_EXT_texture_rectangle + &__GLEW_EXT_texture_rectangle, +#endif +#ifdef GL_EXT_texture_rg + &__GLEW_EXT_texture_rg, +#endif +#ifdef GL_EXT_texture_sRGB + &__GLEW_EXT_texture_sRGB, +#endif +#ifdef GL_EXT_texture_sRGB_R8 + &__GLEW_EXT_texture_sRGB_R8, +#endif +#ifdef GL_EXT_texture_sRGB_RG8 + &__GLEW_EXT_texture_sRGB_RG8, +#endif +#ifdef GL_EXT_texture_sRGB_decode + &__GLEW_EXT_texture_sRGB_decode, +#endif +#ifdef GL_EXT_texture_shared_exponent + &__GLEW_EXT_texture_shared_exponent, +#endif +#ifdef GL_EXT_texture_snorm + &__GLEW_EXT_texture_snorm, +#endif +#ifdef GL_EXT_texture_storage + &__GLEW_EXT_texture_storage, +#endif +#ifdef GL_EXT_texture_swizzle + &__GLEW_EXT_texture_swizzle, +#endif +#ifdef GL_EXT_texture_type_2_10_10_10_REV + &__GLEW_EXT_texture_type_2_10_10_10_REV, +#endif +#ifdef GL_EXT_texture_view + &__GLEW_EXT_texture_view, +#endif +#ifdef GL_EXT_timer_query + &__GLEW_EXT_timer_query, +#endif +#ifdef GL_EXT_transform_feedback + &__GLEW_EXT_transform_feedback, +#endif +#ifdef GL_EXT_unpack_subimage + &__GLEW_EXT_unpack_subimage, +#endif +#ifdef GL_EXT_vertex_array + &__GLEW_EXT_vertex_array, +#endif +#ifdef GL_EXT_vertex_array_bgra + &__GLEW_EXT_vertex_array_bgra, +#endif +#ifdef GL_EXT_vertex_array_setXXX + &__GLEW_EXT_vertex_array_setXXX, +#endif +#ifdef GL_EXT_vertex_attrib_64bit + &__GLEW_EXT_vertex_attrib_64bit, +#endif +#ifdef GL_EXT_vertex_shader + &__GLEW_EXT_vertex_shader, +#endif +#ifdef GL_EXT_vertex_weighting + &__GLEW_EXT_vertex_weighting, +#endif +#ifdef GL_EXT_win32_keyed_mutex + &__GLEW_EXT_win32_keyed_mutex, +#endif +#ifdef GL_EXT_window_rectangles + &__GLEW_EXT_window_rectangles, +#endif +#ifdef GL_EXT_x11_sync_object + &__GLEW_EXT_x11_sync_object, +#endif +#ifdef GL_GREMEDY_frame_terminator + &__GLEW_GREMEDY_frame_terminator, +#endif +#ifdef GL_GREMEDY_string_marker + &__GLEW_GREMEDY_string_marker, +#endif +#ifdef GL_HP_convolution_border_modes + &__GLEW_HP_convolution_border_modes, +#endif +#ifdef GL_HP_image_transform + &__GLEW_HP_image_transform, +#endif +#ifdef GL_HP_occlusion_test + &__GLEW_HP_occlusion_test, +#endif +#ifdef GL_HP_texture_lighting + &__GLEW_HP_texture_lighting, +#endif +#ifdef GL_IBM_cull_vertex + &__GLEW_IBM_cull_vertex, +#endif +#ifdef GL_IBM_multimode_draw_arrays + &__GLEW_IBM_multimode_draw_arrays, +#endif +#ifdef GL_IBM_rasterpos_clip + &__GLEW_IBM_rasterpos_clip, +#endif +#ifdef GL_IBM_static_data + &__GLEW_IBM_static_data, +#endif +#ifdef GL_IBM_texture_mirrored_repeat + &__GLEW_IBM_texture_mirrored_repeat, +#endif +#ifdef GL_IBM_vertex_array_lists + &__GLEW_IBM_vertex_array_lists, +#endif +#ifdef GL_INGR_color_clamp + &__GLEW_INGR_color_clamp, +#endif +#ifdef GL_INGR_interlace_read + &__GLEW_INGR_interlace_read, +#endif +#ifdef GL_INTEL_conservative_rasterization + &__GLEW_INTEL_conservative_rasterization, +#endif +#ifdef GL_INTEL_fragment_shader_ordering + &__GLEW_INTEL_fragment_shader_ordering, +#endif +#ifdef GL_INTEL_framebuffer_CMAA + &__GLEW_INTEL_framebuffer_CMAA, +#endif +#ifdef GL_INTEL_map_texture + &__GLEW_INTEL_map_texture, +#endif +#ifdef GL_INTEL_parallel_arrays + &__GLEW_INTEL_parallel_arrays, +#endif +#ifdef GL_INTEL_performance_query + &__GLEW_INTEL_performance_query, +#endif +#ifdef GL_INTEL_texture_scissor + &__GLEW_INTEL_texture_scissor, +#endif +#ifdef GL_KHR_blend_equation_advanced + &__GLEW_KHR_blend_equation_advanced, +#endif +#ifdef GL_KHR_blend_equation_advanced_coherent + &__GLEW_KHR_blend_equation_advanced_coherent, +#endif +#ifdef GL_KHR_context_flush_control + &__GLEW_KHR_context_flush_control, +#endif +#ifdef GL_KHR_debug + &__GLEW_KHR_debug, +#endif +#ifdef GL_KHR_no_error + &__GLEW_KHR_no_error, +#endif +#ifdef GL_KHR_parallel_shader_compile + &__GLEW_KHR_parallel_shader_compile, +#endif +#ifdef GL_KHR_robust_buffer_access_behavior + &__GLEW_KHR_robust_buffer_access_behavior, +#endif +#ifdef GL_KHR_robustness + &__GLEW_KHR_robustness, +#endif +#ifdef GL_KHR_texture_compression_astc_hdr + &__GLEW_KHR_texture_compression_astc_hdr, +#endif +#ifdef GL_KHR_texture_compression_astc_ldr + &__GLEW_KHR_texture_compression_astc_ldr, +#endif +#ifdef GL_KHR_texture_compression_astc_sliced_3d + &__GLEW_KHR_texture_compression_astc_sliced_3d, +#endif +#ifdef GL_KTX_buffer_region + &__GLEW_KTX_buffer_region, +#endif +#ifdef GL_MESAX_texture_stack + &__GLEW_MESAX_texture_stack, +#endif +#ifdef GL_MESA_pack_invert + &__GLEW_MESA_pack_invert, +#endif +#ifdef GL_MESA_resize_buffers + &__GLEW_MESA_resize_buffers, +#endif +#ifdef GL_MESA_shader_integer_functions + &__GLEW_MESA_shader_integer_functions, +#endif +#ifdef GL_MESA_window_pos + &__GLEW_MESA_window_pos, +#endif +#ifdef GL_MESA_ycbcr_texture + &__GLEW_MESA_ycbcr_texture, +#endif +#ifdef GL_NVX_blend_equation_advanced_multi_draw_buffers + &__GLEW_NVX_blend_equation_advanced_multi_draw_buffers, +#endif +#ifdef GL_NVX_conditional_render + &__GLEW_NVX_conditional_render, +#endif +#ifdef GL_NVX_gpu_memory_info + &__GLEW_NVX_gpu_memory_info, +#endif +#ifdef GL_NVX_linked_gpu_multicast + &__GLEW_NVX_linked_gpu_multicast, +#endif +#ifdef GL_NV_3dvision_settings + &__GLEW_NV_3dvision_settings, +#endif +#ifdef GL_NV_EGL_stream_consumer_external + &__GLEW_NV_EGL_stream_consumer_external, +#endif +#ifdef GL_NV_alpha_to_coverage_dither_control + &__GLEW_NV_alpha_to_coverage_dither_control, +#endif +#ifdef GL_NV_bgr + &__GLEW_NV_bgr, +#endif +#ifdef GL_NV_bindless_multi_draw_indirect + &__GLEW_NV_bindless_multi_draw_indirect, +#endif +#ifdef GL_NV_bindless_multi_draw_indirect_count + &__GLEW_NV_bindless_multi_draw_indirect_count, +#endif +#ifdef GL_NV_bindless_texture + &__GLEW_NV_bindless_texture, +#endif +#ifdef GL_NV_blend_equation_advanced + &__GLEW_NV_blend_equation_advanced, +#endif +#ifdef GL_NV_blend_equation_advanced_coherent + &__GLEW_NV_blend_equation_advanced_coherent, +#endif +#ifdef GL_NV_blend_minmax_factor + &__GLEW_NV_blend_minmax_factor, +#endif +#ifdef GL_NV_blend_square + &__GLEW_NV_blend_square, +#endif +#ifdef GL_NV_clip_space_w_scaling + &__GLEW_NV_clip_space_w_scaling, +#endif +#ifdef GL_NV_command_list + &__GLEW_NV_command_list, +#endif +#ifdef GL_NV_compute_program5 + &__GLEW_NV_compute_program5, +#endif +#ifdef GL_NV_conditional_render + &__GLEW_NV_conditional_render, +#endif +#ifdef GL_NV_conservative_raster + &__GLEW_NV_conservative_raster, +#endif +#ifdef GL_NV_conservative_raster_dilate + &__GLEW_NV_conservative_raster_dilate, +#endif +#ifdef GL_NV_conservative_raster_pre_snap_triangles + &__GLEW_NV_conservative_raster_pre_snap_triangles, +#endif +#ifdef GL_NV_copy_buffer + &__GLEW_NV_copy_buffer, +#endif +#ifdef GL_NV_copy_depth_to_color + &__GLEW_NV_copy_depth_to_color, +#endif +#ifdef GL_NV_copy_image + &__GLEW_NV_copy_image, +#endif +#ifdef GL_NV_deep_texture3D + &__GLEW_NV_deep_texture3D, +#endif +#ifdef GL_NV_depth_buffer_float + &__GLEW_NV_depth_buffer_float, +#endif +#ifdef GL_NV_depth_clamp + &__GLEW_NV_depth_clamp, +#endif +#ifdef GL_NV_depth_range_unclamped + &__GLEW_NV_depth_range_unclamped, +#endif +#ifdef GL_NV_draw_buffers + &__GLEW_NV_draw_buffers, +#endif +#ifdef GL_NV_draw_instanced + &__GLEW_NV_draw_instanced, +#endif +#ifdef GL_NV_draw_texture + &__GLEW_NV_draw_texture, +#endif +#ifdef GL_NV_draw_vulkan_image + &__GLEW_NV_draw_vulkan_image, +#endif +#ifdef GL_NV_evaluators + &__GLEW_NV_evaluators, +#endif +#ifdef GL_NV_explicit_attrib_location + &__GLEW_NV_explicit_attrib_location, +#endif +#ifdef GL_NV_explicit_multisample + &__GLEW_NV_explicit_multisample, +#endif +#ifdef GL_NV_fbo_color_attachments + &__GLEW_NV_fbo_color_attachments, +#endif +#ifdef GL_NV_fence + &__GLEW_NV_fence, +#endif +#ifdef GL_NV_fill_rectangle + &__GLEW_NV_fill_rectangle, +#endif +#ifdef GL_NV_float_buffer + &__GLEW_NV_float_buffer, +#endif +#ifdef GL_NV_fog_distance + &__GLEW_NV_fog_distance, +#endif +#ifdef GL_NV_fragment_coverage_to_color + &__GLEW_NV_fragment_coverage_to_color, +#endif +#ifdef GL_NV_fragment_program + &__GLEW_NV_fragment_program, +#endif +#ifdef GL_NV_fragment_program2 + &__GLEW_NV_fragment_program2, +#endif +#ifdef GL_NV_fragment_program4 + &__GLEW_NV_fragment_program4, +#endif +#ifdef GL_NV_fragment_program_option + &__GLEW_NV_fragment_program_option, +#endif +#ifdef GL_NV_fragment_shader_interlock + &__GLEW_NV_fragment_shader_interlock, +#endif +#ifdef GL_NV_framebuffer_blit + &__GLEW_NV_framebuffer_blit, +#endif +#ifdef GL_NV_framebuffer_mixed_samples + &__GLEW_NV_framebuffer_mixed_samples, +#endif +#ifdef GL_NV_framebuffer_multisample + &__GLEW_NV_framebuffer_multisample, +#endif +#ifdef GL_NV_framebuffer_multisample_coverage + &__GLEW_NV_framebuffer_multisample_coverage, +#endif +#ifdef GL_NV_generate_mipmap_sRGB + &__GLEW_NV_generate_mipmap_sRGB, +#endif +#ifdef GL_NV_geometry_program4 + &__GLEW_NV_geometry_program4, +#endif +#ifdef GL_NV_geometry_shader4 + &__GLEW_NV_geometry_shader4, +#endif +#ifdef GL_NV_geometry_shader_passthrough + &__GLEW_NV_geometry_shader_passthrough, +#endif +#ifdef GL_NV_gpu_multicast + &__GLEW_NV_gpu_multicast, +#endif +#ifdef GL_NV_gpu_program4 + &__GLEW_NV_gpu_program4, +#endif +#ifdef GL_NV_gpu_program5 + &__GLEW_NV_gpu_program5, +#endif +#ifdef GL_NV_gpu_program5_mem_extended + &__GLEW_NV_gpu_program5_mem_extended, +#endif +#ifdef GL_NV_gpu_program_fp64 + &__GLEW_NV_gpu_program_fp64, +#endif +#ifdef GL_NV_gpu_shader5 + &__GLEW_NV_gpu_shader5, +#endif +#ifdef GL_NV_half_float + &__GLEW_NV_half_float, +#endif +#ifdef GL_NV_image_formats + &__GLEW_NV_image_formats, +#endif +#ifdef GL_NV_instanced_arrays + &__GLEW_NV_instanced_arrays, +#endif +#ifdef GL_NV_internalformat_sample_query + &__GLEW_NV_internalformat_sample_query, +#endif +#ifdef GL_NV_light_max_exponent + &__GLEW_NV_light_max_exponent, +#endif +#ifdef GL_NV_multisample_coverage + &__GLEW_NV_multisample_coverage, +#endif +#ifdef GL_NV_multisample_filter_hint + &__GLEW_NV_multisample_filter_hint, +#endif +#ifdef GL_NV_non_square_matrices + &__GLEW_NV_non_square_matrices, +#endif +#ifdef GL_NV_occlusion_query + &__GLEW_NV_occlusion_query, +#endif +#ifdef GL_NV_pack_subimage + &__GLEW_NV_pack_subimage, +#endif +#ifdef GL_NV_packed_depth_stencil + &__GLEW_NV_packed_depth_stencil, +#endif +#ifdef GL_NV_packed_float + &__GLEW_NV_packed_float, +#endif +#ifdef GL_NV_packed_float_linear + &__GLEW_NV_packed_float_linear, +#endif +#ifdef GL_NV_parameter_buffer_object + &__GLEW_NV_parameter_buffer_object, +#endif +#ifdef GL_NV_parameter_buffer_object2 + &__GLEW_NV_parameter_buffer_object2, +#endif +#ifdef GL_NV_path_rendering + &__GLEW_NV_path_rendering, +#endif +#ifdef GL_NV_path_rendering_shared_edge + &__GLEW_NV_path_rendering_shared_edge, +#endif +#ifdef GL_NV_pixel_buffer_object + &__GLEW_NV_pixel_buffer_object, +#endif +#ifdef GL_NV_pixel_data_range + &__GLEW_NV_pixel_data_range, +#endif +#ifdef GL_NV_platform_binary + &__GLEW_NV_platform_binary, +#endif +#ifdef GL_NV_point_sprite + &__GLEW_NV_point_sprite, +#endif +#ifdef GL_NV_polygon_mode + &__GLEW_NV_polygon_mode, +#endif +#ifdef GL_NV_present_video + &__GLEW_NV_present_video, +#endif +#ifdef GL_NV_primitive_restart + &__GLEW_NV_primitive_restart, +#endif +#ifdef GL_NV_read_depth + &__GLEW_NV_read_depth, +#endif +#ifdef GL_NV_read_depth_stencil + &__GLEW_NV_read_depth_stencil, +#endif +#ifdef GL_NV_read_stencil + &__GLEW_NV_read_stencil, +#endif +#ifdef GL_NV_register_combiners + &__GLEW_NV_register_combiners, +#endif +#ifdef GL_NV_register_combiners2 + &__GLEW_NV_register_combiners2, +#endif +#ifdef GL_NV_robustness_video_memory_purge + &__GLEW_NV_robustness_video_memory_purge, +#endif +#ifdef GL_NV_sRGB_formats + &__GLEW_NV_sRGB_formats, +#endif +#ifdef GL_NV_sample_locations + &__GLEW_NV_sample_locations, +#endif +#ifdef GL_NV_sample_mask_override_coverage + &__GLEW_NV_sample_mask_override_coverage, +#endif +#ifdef GL_NV_shader_atomic_counters + &__GLEW_NV_shader_atomic_counters, +#endif +#ifdef GL_NV_shader_atomic_float + &__GLEW_NV_shader_atomic_float, +#endif +#ifdef GL_NV_shader_atomic_float64 + &__GLEW_NV_shader_atomic_float64, +#endif +#ifdef GL_NV_shader_atomic_fp16_vector + &__GLEW_NV_shader_atomic_fp16_vector, +#endif +#ifdef GL_NV_shader_atomic_int64 + &__GLEW_NV_shader_atomic_int64, +#endif +#ifdef GL_NV_shader_buffer_load + &__GLEW_NV_shader_buffer_load, +#endif +#ifdef GL_NV_shader_noperspective_interpolation + &__GLEW_NV_shader_noperspective_interpolation, +#endif +#ifdef GL_NV_shader_storage_buffer_object + &__GLEW_NV_shader_storage_buffer_object, +#endif +#ifdef GL_NV_shader_thread_group + &__GLEW_NV_shader_thread_group, +#endif +#ifdef GL_NV_shader_thread_shuffle + &__GLEW_NV_shader_thread_shuffle, +#endif +#ifdef GL_NV_shadow_samplers_array + &__GLEW_NV_shadow_samplers_array, +#endif +#ifdef GL_NV_shadow_samplers_cube + &__GLEW_NV_shadow_samplers_cube, +#endif +#ifdef GL_NV_stereo_view_rendering + &__GLEW_NV_stereo_view_rendering, +#endif +#ifdef GL_NV_tessellation_program5 + &__GLEW_NV_tessellation_program5, +#endif +#ifdef GL_NV_texgen_emboss + &__GLEW_NV_texgen_emboss, +#endif +#ifdef GL_NV_texgen_reflection + &__GLEW_NV_texgen_reflection, +#endif +#ifdef GL_NV_texture_array + &__GLEW_NV_texture_array, +#endif +#ifdef GL_NV_texture_barrier + &__GLEW_NV_texture_barrier, +#endif +#ifdef GL_NV_texture_border_clamp + &__GLEW_NV_texture_border_clamp, +#endif +#ifdef GL_NV_texture_compression_latc + &__GLEW_NV_texture_compression_latc, +#endif +#ifdef GL_NV_texture_compression_s3tc + &__GLEW_NV_texture_compression_s3tc, +#endif +#ifdef GL_NV_texture_compression_s3tc_update + &__GLEW_NV_texture_compression_s3tc_update, +#endif +#ifdef GL_NV_texture_compression_vtc + &__GLEW_NV_texture_compression_vtc, +#endif +#ifdef GL_NV_texture_env_combine4 + &__GLEW_NV_texture_env_combine4, +#endif +#ifdef GL_NV_texture_expand_normal + &__GLEW_NV_texture_expand_normal, +#endif +#ifdef GL_NV_texture_multisample + &__GLEW_NV_texture_multisample, +#endif +#ifdef GL_NV_texture_npot_2D_mipmap + &__GLEW_NV_texture_npot_2D_mipmap, +#endif +#ifdef GL_NV_texture_rectangle + &__GLEW_NV_texture_rectangle, +#endif +#ifdef GL_NV_texture_rectangle_compressed + &__GLEW_NV_texture_rectangle_compressed, +#endif +#ifdef GL_NV_texture_shader + &__GLEW_NV_texture_shader, +#endif +#ifdef GL_NV_texture_shader2 + &__GLEW_NV_texture_shader2, +#endif +#ifdef GL_NV_texture_shader3 + &__GLEW_NV_texture_shader3, +#endif +#ifdef GL_NV_transform_feedback + &__GLEW_NV_transform_feedback, +#endif +#ifdef GL_NV_transform_feedback2 + &__GLEW_NV_transform_feedback2, +#endif +#ifdef GL_NV_uniform_buffer_unified_memory + &__GLEW_NV_uniform_buffer_unified_memory, +#endif +#ifdef GL_NV_vdpau_interop + &__GLEW_NV_vdpau_interop, +#endif +#ifdef GL_NV_vertex_array_range + &__GLEW_NV_vertex_array_range, +#endif +#ifdef GL_NV_vertex_array_range2 + &__GLEW_NV_vertex_array_range2, +#endif +#ifdef GL_NV_vertex_attrib_integer_64bit + &__GLEW_NV_vertex_attrib_integer_64bit, +#endif +#ifdef GL_NV_vertex_buffer_unified_memory + &__GLEW_NV_vertex_buffer_unified_memory, +#endif +#ifdef GL_NV_vertex_program + &__GLEW_NV_vertex_program, +#endif +#ifdef GL_NV_vertex_program1_1 + &__GLEW_NV_vertex_program1_1, +#endif +#ifdef GL_NV_vertex_program2 + &__GLEW_NV_vertex_program2, +#endif +#ifdef GL_NV_vertex_program2_option + &__GLEW_NV_vertex_program2_option, +#endif +#ifdef GL_NV_vertex_program3 + &__GLEW_NV_vertex_program3, +#endif +#ifdef GL_NV_vertex_program4 + &__GLEW_NV_vertex_program4, +#endif +#ifdef GL_NV_video_capture + &__GLEW_NV_video_capture, +#endif +#ifdef GL_NV_viewport_array + &__GLEW_NV_viewport_array, +#endif +#ifdef GL_NV_viewport_array2 + &__GLEW_NV_viewport_array2, +#endif +#ifdef GL_NV_viewport_swizzle + &__GLEW_NV_viewport_swizzle, +#endif +#ifdef GL_OES_byte_coordinates + &__GLEW_OES_byte_coordinates, +#endif +#ifdef GL_OML_interlace + &__GLEW_OML_interlace, +#endif +#ifdef GL_OML_resample + &__GLEW_OML_resample, +#endif +#ifdef GL_OML_subsample + &__GLEW_OML_subsample, +#endif +#ifdef GL_OVR_multiview + &__GLEW_OVR_multiview, +#endif +#ifdef GL_OVR_multiview2 + &__GLEW_OVR_multiview2, +#endif +#ifdef GL_OVR_multiview_multisampled_render_to_texture + &__GLEW_OVR_multiview_multisampled_render_to_texture, +#endif +#ifdef GL_PGI_misc_hints + &__GLEW_PGI_misc_hints, +#endif +#ifdef GL_PGI_vertex_hints + &__GLEW_PGI_vertex_hints, +#endif +#ifdef GL_QCOM_alpha_test + &__GLEW_QCOM_alpha_test, +#endif +#ifdef GL_QCOM_binning_control + &__GLEW_QCOM_binning_control, +#endif +#ifdef GL_QCOM_driver_control + &__GLEW_QCOM_driver_control, +#endif +#ifdef GL_QCOM_extended_get + &__GLEW_QCOM_extended_get, +#endif +#ifdef GL_QCOM_extended_get2 + &__GLEW_QCOM_extended_get2, +#endif +#ifdef GL_QCOM_framebuffer_foveated + &__GLEW_QCOM_framebuffer_foveated, +#endif +#ifdef GL_QCOM_perfmon_global_mode + &__GLEW_QCOM_perfmon_global_mode, +#endif +#ifdef GL_QCOM_shader_framebuffer_fetch_noncoherent + &__GLEW_QCOM_shader_framebuffer_fetch_noncoherent, +#endif +#ifdef GL_QCOM_tiled_rendering + &__GLEW_QCOM_tiled_rendering, +#endif +#ifdef GL_QCOM_writeonly_rendering + &__GLEW_QCOM_writeonly_rendering, +#endif +#ifdef GL_REGAL_ES1_0_compatibility + &__GLEW_REGAL_ES1_0_compatibility, +#endif +#ifdef GL_REGAL_ES1_1_compatibility + &__GLEW_REGAL_ES1_1_compatibility, +#endif +#ifdef GL_REGAL_enable + &__GLEW_REGAL_enable, +#endif +#ifdef GL_REGAL_error_string + &__GLEW_REGAL_error_string, +#endif +#ifdef GL_REGAL_extension_query + &__GLEW_REGAL_extension_query, +#endif +#ifdef GL_REGAL_log + &__GLEW_REGAL_log, +#endif +#ifdef GL_REGAL_proc_address + &__GLEW_REGAL_proc_address, +#endif +#ifdef GL_REND_screen_coordinates + &__GLEW_REND_screen_coordinates, +#endif +#ifdef GL_S3_s3tc + &__GLEW_S3_s3tc, +#endif +#ifdef GL_SGIS_clip_band_hint + &__GLEW_SGIS_clip_band_hint, +#endif +#ifdef GL_SGIS_color_range + &__GLEW_SGIS_color_range, +#endif +#ifdef GL_SGIS_detail_texture + &__GLEW_SGIS_detail_texture, +#endif +#ifdef GL_SGIS_fog_function + &__GLEW_SGIS_fog_function, +#endif +#ifdef GL_SGIS_generate_mipmap + &__GLEW_SGIS_generate_mipmap, +#endif +#ifdef GL_SGIS_line_texgen + &__GLEW_SGIS_line_texgen, +#endif +#ifdef GL_SGIS_multisample + &__GLEW_SGIS_multisample, +#endif +#ifdef GL_SGIS_multitexture + &__GLEW_SGIS_multitexture, +#endif +#ifdef GL_SGIS_pixel_texture + &__GLEW_SGIS_pixel_texture, +#endif +#ifdef GL_SGIS_point_line_texgen + &__GLEW_SGIS_point_line_texgen, +#endif +#ifdef GL_SGIS_shared_multisample + &__GLEW_SGIS_shared_multisample, +#endif +#ifdef GL_SGIS_sharpen_texture + &__GLEW_SGIS_sharpen_texture, +#endif +#ifdef GL_SGIS_texture4D + &__GLEW_SGIS_texture4D, +#endif +#ifdef GL_SGIS_texture_border_clamp + &__GLEW_SGIS_texture_border_clamp, +#endif +#ifdef GL_SGIS_texture_edge_clamp + &__GLEW_SGIS_texture_edge_clamp, +#endif +#ifdef GL_SGIS_texture_filter4 + &__GLEW_SGIS_texture_filter4, +#endif +#ifdef GL_SGIS_texture_lod + &__GLEW_SGIS_texture_lod, +#endif +#ifdef GL_SGIS_texture_select + &__GLEW_SGIS_texture_select, +#endif +#ifdef GL_SGIX_async + &__GLEW_SGIX_async, +#endif +#ifdef GL_SGIX_async_histogram + &__GLEW_SGIX_async_histogram, +#endif +#ifdef GL_SGIX_async_pixel + &__GLEW_SGIX_async_pixel, +#endif +#ifdef GL_SGIX_bali_g_instruments + &__GLEW_SGIX_bali_g_instruments, +#endif +#ifdef GL_SGIX_bali_r_instruments + &__GLEW_SGIX_bali_r_instruments, +#endif +#ifdef GL_SGIX_bali_timer_instruments + &__GLEW_SGIX_bali_timer_instruments, +#endif +#ifdef GL_SGIX_blend_alpha_minmax + &__GLEW_SGIX_blend_alpha_minmax, +#endif +#ifdef GL_SGIX_blend_cadd + &__GLEW_SGIX_blend_cadd, +#endif +#ifdef GL_SGIX_blend_cmultiply + &__GLEW_SGIX_blend_cmultiply, +#endif +#ifdef GL_SGIX_calligraphic_fragment + &__GLEW_SGIX_calligraphic_fragment, +#endif +#ifdef GL_SGIX_clipmap + &__GLEW_SGIX_clipmap, +#endif +#ifdef GL_SGIX_color_matrix_accuracy + &__GLEW_SGIX_color_matrix_accuracy, +#endif +#ifdef GL_SGIX_color_table_index_mode + &__GLEW_SGIX_color_table_index_mode, +#endif +#ifdef GL_SGIX_complex_polar + &__GLEW_SGIX_complex_polar, +#endif +#ifdef GL_SGIX_convolution_accuracy + &__GLEW_SGIX_convolution_accuracy, +#endif +#ifdef GL_SGIX_cube_map + &__GLEW_SGIX_cube_map, +#endif +#ifdef GL_SGIX_cylinder_texgen + &__GLEW_SGIX_cylinder_texgen, +#endif +#ifdef GL_SGIX_datapipe + &__GLEW_SGIX_datapipe, +#endif +#ifdef GL_SGIX_decimation + &__GLEW_SGIX_decimation, +#endif +#ifdef GL_SGIX_depth_pass_instrument + &__GLEW_SGIX_depth_pass_instrument, +#endif +#ifdef GL_SGIX_depth_texture + &__GLEW_SGIX_depth_texture, +#endif +#ifdef GL_SGIX_dvc + &__GLEW_SGIX_dvc, +#endif +#ifdef GL_SGIX_flush_raster + &__GLEW_SGIX_flush_raster, +#endif +#ifdef GL_SGIX_fog_blend + &__GLEW_SGIX_fog_blend, +#endif +#ifdef GL_SGIX_fog_factor_to_alpha + &__GLEW_SGIX_fog_factor_to_alpha, +#endif +#ifdef GL_SGIX_fog_layers + &__GLEW_SGIX_fog_layers, +#endif +#ifdef GL_SGIX_fog_offset + &__GLEW_SGIX_fog_offset, +#endif +#ifdef GL_SGIX_fog_patchy + &__GLEW_SGIX_fog_patchy, +#endif +#ifdef GL_SGIX_fog_scale + &__GLEW_SGIX_fog_scale, +#endif +#ifdef GL_SGIX_fog_texture + &__GLEW_SGIX_fog_texture, +#endif +#ifdef GL_SGIX_fragment_lighting_space + &__GLEW_SGIX_fragment_lighting_space, +#endif +#ifdef GL_SGIX_fragment_specular_lighting + &__GLEW_SGIX_fragment_specular_lighting, +#endif +#ifdef GL_SGIX_fragments_instrument + &__GLEW_SGIX_fragments_instrument, +#endif +#ifdef GL_SGIX_framezoom + &__GLEW_SGIX_framezoom, +#endif +#ifdef GL_SGIX_icc_texture + &__GLEW_SGIX_icc_texture, +#endif +#ifdef GL_SGIX_igloo_interface + &__GLEW_SGIX_igloo_interface, +#endif +#ifdef GL_SGIX_image_compression + &__GLEW_SGIX_image_compression, +#endif +#ifdef GL_SGIX_impact_pixel_texture + &__GLEW_SGIX_impact_pixel_texture, +#endif +#ifdef GL_SGIX_instrument_error + &__GLEW_SGIX_instrument_error, +#endif +#ifdef GL_SGIX_interlace + &__GLEW_SGIX_interlace, +#endif +#ifdef GL_SGIX_ir_instrument1 + &__GLEW_SGIX_ir_instrument1, +#endif +#ifdef GL_SGIX_line_quality_hint + &__GLEW_SGIX_line_quality_hint, +#endif +#ifdef GL_SGIX_list_priority + &__GLEW_SGIX_list_priority, +#endif +#ifdef GL_SGIX_mpeg1 + &__GLEW_SGIX_mpeg1, +#endif +#ifdef GL_SGIX_mpeg2 + &__GLEW_SGIX_mpeg2, +#endif +#ifdef GL_SGIX_nonlinear_lighting_pervertex + &__GLEW_SGIX_nonlinear_lighting_pervertex, +#endif +#ifdef GL_SGIX_nurbs_eval + &__GLEW_SGIX_nurbs_eval, +#endif +#ifdef GL_SGIX_occlusion_instrument + &__GLEW_SGIX_occlusion_instrument, +#endif +#ifdef GL_SGIX_packed_6bytes + &__GLEW_SGIX_packed_6bytes, +#endif +#ifdef GL_SGIX_pixel_texture + &__GLEW_SGIX_pixel_texture, +#endif +#ifdef GL_SGIX_pixel_texture_bits + &__GLEW_SGIX_pixel_texture_bits, +#endif +#ifdef GL_SGIX_pixel_texture_lod + &__GLEW_SGIX_pixel_texture_lod, +#endif +#ifdef GL_SGIX_pixel_tiles + &__GLEW_SGIX_pixel_tiles, +#endif +#ifdef GL_SGIX_polynomial_ffd + &__GLEW_SGIX_polynomial_ffd, +#endif +#ifdef GL_SGIX_quad_mesh + &__GLEW_SGIX_quad_mesh, +#endif +#ifdef GL_SGIX_reference_plane + &__GLEW_SGIX_reference_plane, +#endif +#ifdef GL_SGIX_resample + &__GLEW_SGIX_resample, +#endif +#ifdef GL_SGIX_scalebias_hint + &__GLEW_SGIX_scalebias_hint, +#endif +#ifdef GL_SGIX_shadow + &__GLEW_SGIX_shadow, +#endif +#ifdef GL_SGIX_shadow_ambient + &__GLEW_SGIX_shadow_ambient, +#endif +#ifdef GL_SGIX_slim + &__GLEW_SGIX_slim, +#endif +#ifdef GL_SGIX_spotlight_cutoff + &__GLEW_SGIX_spotlight_cutoff, +#endif +#ifdef GL_SGIX_sprite + &__GLEW_SGIX_sprite, +#endif +#ifdef GL_SGIX_subdiv_patch + &__GLEW_SGIX_subdiv_patch, +#endif +#ifdef GL_SGIX_subsample + &__GLEW_SGIX_subsample, +#endif +#ifdef GL_SGIX_tag_sample_buffer + &__GLEW_SGIX_tag_sample_buffer, +#endif +#ifdef GL_SGIX_texture_add_env + &__GLEW_SGIX_texture_add_env, +#endif +#ifdef GL_SGIX_texture_coordinate_clamp + &__GLEW_SGIX_texture_coordinate_clamp, +#endif +#ifdef GL_SGIX_texture_lod_bias + &__GLEW_SGIX_texture_lod_bias, +#endif +#ifdef GL_SGIX_texture_mipmap_anisotropic + &__GLEW_SGIX_texture_mipmap_anisotropic, +#endif +#ifdef GL_SGIX_texture_multi_buffer + &__GLEW_SGIX_texture_multi_buffer, +#endif +#ifdef GL_SGIX_texture_phase + &__GLEW_SGIX_texture_phase, +#endif +#ifdef GL_SGIX_texture_range + &__GLEW_SGIX_texture_range, +#endif +#ifdef GL_SGIX_texture_scale_bias + &__GLEW_SGIX_texture_scale_bias, +#endif +#ifdef GL_SGIX_texture_supersample + &__GLEW_SGIX_texture_supersample, +#endif +#ifdef GL_SGIX_vector_ops + &__GLEW_SGIX_vector_ops, +#endif +#ifdef GL_SGIX_vertex_array_object + &__GLEW_SGIX_vertex_array_object, +#endif +#ifdef GL_SGIX_vertex_preclip + &__GLEW_SGIX_vertex_preclip, +#endif +#ifdef GL_SGIX_vertex_preclip_hint + &__GLEW_SGIX_vertex_preclip_hint, +#endif +#ifdef GL_SGIX_ycrcb + &__GLEW_SGIX_ycrcb, +#endif +#ifdef GL_SGIX_ycrcb_subsample + &__GLEW_SGIX_ycrcb_subsample, +#endif +#ifdef GL_SGIX_ycrcba + &__GLEW_SGIX_ycrcba, +#endif +#ifdef GL_SGI_color_matrix + &__GLEW_SGI_color_matrix, +#endif +#ifdef GL_SGI_color_table + &__GLEW_SGI_color_table, +#endif +#ifdef GL_SGI_complex + &__GLEW_SGI_complex, +#endif +#ifdef GL_SGI_complex_type + &__GLEW_SGI_complex_type, +#endif +#ifdef GL_SGI_fft + &__GLEW_SGI_fft, +#endif +#ifdef GL_SGI_texture_color_table + &__GLEW_SGI_texture_color_table, +#endif +#ifdef GL_SUNX_constant_data + &__GLEW_SUNX_constant_data, +#endif +#ifdef GL_SUN_convolution_border_modes + &__GLEW_SUN_convolution_border_modes, +#endif +#ifdef GL_SUN_global_alpha + &__GLEW_SUN_global_alpha, +#endif +#ifdef GL_SUN_mesh_array + &__GLEW_SUN_mesh_array, +#endif +#ifdef GL_SUN_read_video_pixels + &__GLEW_SUN_read_video_pixels, +#endif +#ifdef GL_SUN_slice_accum + &__GLEW_SUN_slice_accum, +#endif +#ifdef GL_SUN_triangle_list + &__GLEW_SUN_triangle_list, +#endif +#ifdef GL_SUN_vertex + &__GLEW_SUN_vertex, +#endif +#ifdef GL_WIN_phong_shading + &__GLEW_WIN_phong_shading, +#endif +#ifdef GL_WIN_scene_markerXXX + &__GLEW_WIN_scene_markerXXX, +#endif +#ifdef GL_WIN_specular_fog + &__GLEW_WIN_specular_fog, +#endif +#ifdef GL_WIN_swap_hint + &__GLEW_WIN_swap_hint, +#endif + NULL +}; +static GLboolean _glewInit_GL_VERSION_1_2 (); +static GLboolean _glewInit_GL_VERSION_1_3 (); +static GLboolean _glewInit_GL_VERSION_1_4 (); +static GLboolean _glewInit_GL_VERSION_1_5 (); +static GLboolean _glewInit_GL_VERSION_2_0 (); +static GLboolean _glewInit_GL_VERSION_2_1 (); +static GLboolean _glewInit_GL_VERSION_3_0 (); +static GLboolean _glewInit_GL_VERSION_3_1 (); +static GLboolean _glewInit_GL_VERSION_3_2 (); +static GLboolean _glewInit_GL_VERSION_3_3 (); +static GLboolean _glewInit_GL_VERSION_4_0 (); +static GLboolean _glewInit_GL_VERSION_4_5 (); +static GLboolean _glewInit_GL_VERSION_4_6 (); +static GLboolean _glewInit_GL_3DFX_tbuffer (); +static GLboolean _glewInit_GL_AMD_debug_output (); +static GLboolean _glewInit_GL_AMD_draw_buffers_blend (); +static GLboolean _glewInit_GL_AMD_framebuffer_sample_positions (); +static GLboolean _glewInit_GL_AMD_interleaved_elements (); +static GLboolean _glewInit_GL_AMD_multi_draw_indirect (); +static GLboolean _glewInit_GL_AMD_name_gen_delete (); +static GLboolean _glewInit_GL_AMD_occlusion_query_event (); +static GLboolean _glewInit_GL_AMD_performance_monitor (); +static GLboolean _glewInit_GL_AMD_sample_positions (); +static GLboolean _glewInit_GL_AMD_sparse_texture (); +static GLboolean _glewInit_GL_AMD_stencil_operation_extended (); +static GLboolean _glewInit_GL_AMD_vertex_shader_tessellator (); +static GLboolean _glewInit_GL_ANGLE_framebuffer_blit (); +static GLboolean _glewInit_GL_ANGLE_framebuffer_multisample (); +static GLboolean _glewInit_GL_ANGLE_instanced_arrays (); +static GLboolean _glewInit_GL_ANGLE_timer_query (); +static GLboolean _glewInit_GL_ANGLE_translated_shader_source (); +static GLboolean _glewInit_GL_APPLE_copy_texture_levels (); +static GLboolean _glewInit_GL_APPLE_element_array (); +static GLboolean _glewInit_GL_APPLE_fence (); +static GLboolean _glewInit_GL_APPLE_flush_buffer_range (); +static GLboolean _glewInit_GL_APPLE_framebuffer_multisample (); +static GLboolean _glewInit_GL_APPLE_object_purgeable (); +static GLboolean _glewInit_GL_APPLE_sync (); +static GLboolean _glewInit_GL_APPLE_texture_range (); +static GLboolean _glewInit_GL_APPLE_vertex_array_object (); +static GLboolean _glewInit_GL_APPLE_vertex_array_range (); +static GLboolean _glewInit_GL_APPLE_vertex_program_evaluators (); +static GLboolean _glewInit_GL_ARB_ES2_compatibility (); +static GLboolean _glewInit_GL_ARB_ES3_1_compatibility (); +static GLboolean _glewInit_GL_ARB_ES3_2_compatibility (); +static GLboolean _glewInit_GL_ARB_base_instance (); +static GLboolean _glewInit_GL_ARB_bindless_texture (); +static GLboolean _glewInit_GL_ARB_blend_func_extended (); +static GLboolean _glewInit_GL_ARB_buffer_storage (); +static GLboolean _glewInit_GL_ARB_cl_event (); +static GLboolean _glewInit_GL_ARB_clear_buffer_object (); +static GLboolean _glewInit_GL_ARB_clear_texture (); +static GLboolean _glewInit_GL_ARB_clip_control (); +static GLboolean _glewInit_GL_ARB_color_buffer_float (); +static GLboolean _glewInit_GL_ARB_compute_shader (); +static GLboolean _glewInit_GL_ARB_compute_variable_group_size (); +static GLboolean _glewInit_GL_ARB_copy_buffer (); +static GLboolean _glewInit_GL_ARB_copy_image (); +static GLboolean _glewInit_GL_ARB_debug_output (); +static GLboolean _glewInit_GL_ARB_direct_state_access (); +static GLboolean _glewInit_GL_ARB_draw_buffers (); +static GLboolean _glewInit_GL_ARB_draw_buffers_blend (); +static GLboolean _glewInit_GL_ARB_draw_elements_base_vertex (); +static GLboolean _glewInit_GL_ARB_draw_indirect (); +static GLboolean _glewInit_GL_ARB_framebuffer_no_attachments (); +static GLboolean _glewInit_GL_ARB_framebuffer_object (); +static GLboolean _glewInit_GL_ARB_geometry_shader4 (); +static GLboolean _glewInit_GL_ARB_get_program_binary (); +static GLboolean _glewInit_GL_ARB_get_texture_sub_image (); +static GLboolean _glewInit_GL_ARB_gl_spirv (); +static GLboolean _glewInit_GL_ARB_gpu_shader_fp64 (); +static GLboolean _glewInit_GL_ARB_gpu_shader_int64 (); +static GLboolean _glewInit_GL_ARB_imaging (); +static GLboolean _glewInit_GL_ARB_indirect_parameters (); +static GLboolean _glewInit_GL_ARB_instanced_arrays (); +static GLboolean _glewInit_GL_ARB_internalformat_query (); +static GLboolean _glewInit_GL_ARB_internalformat_query2 (); +static GLboolean _glewInit_GL_ARB_invalidate_subdata (); +static GLboolean _glewInit_GL_ARB_map_buffer_range (); +static GLboolean _glewInit_GL_ARB_matrix_palette (); +static GLboolean _glewInit_GL_ARB_multi_bind (); +static GLboolean _glewInit_GL_ARB_multi_draw_indirect (); +static GLboolean _glewInit_GL_ARB_multisample (); +static GLboolean _glewInit_GL_ARB_multitexture (); +static GLboolean _glewInit_GL_ARB_occlusion_query (); +static GLboolean _glewInit_GL_ARB_parallel_shader_compile (); +static GLboolean _glewInit_GL_ARB_point_parameters (); +static GLboolean _glewInit_GL_ARB_polygon_offset_clamp (); +static GLboolean _glewInit_GL_ARB_program_interface_query (); +static GLboolean _glewInit_GL_ARB_provoking_vertex (); +static GLboolean _glewInit_GL_ARB_robustness (); +static GLboolean _glewInit_GL_ARB_sample_locations (); +static GLboolean _glewInit_GL_ARB_sample_shading (); +static GLboolean _glewInit_GL_ARB_sampler_objects (); +static GLboolean _glewInit_GL_ARB_separate_shader_objects (); +static GLboolean _glewInit_GL_ARB_shader_atomic_counters (); +static GLboolean _glewInit_GL_ARB_shader_image_load_store (); +static GLboolean _glewInit_GL_ARB_shader_objects (); +static GLboolean _glewInit_GL_ARB_shader_storage_buffer_object (); +static GLboolean _glewInit_GL_ARB_shader_subroutine (); +static GLboolean _glewInit_GL_ARB_shading_language_include (); +static GLboolean _glewInit_GL_ARB_sparse_buffer (); +static GLboolean _glewInit_GL_ARB_sparse_texture (); +static GLboolean _glewInit_GL_ARB_sync (); +static GLboolean _glewInit_GL_ARB_tessellation_shader (); +static GLboolean _glewInit_GL_ARB_texture_barrier (); +static GLboolean _glewInit_GL_ARB_texture_buffer_object (); +static GLboolean _glewInit_GL_ARB_texture_buffer_range (); +static GLboolean _glewInit_GL_ARB_texture_compression (); +static GLboolean _glewInit_GL_ARB_texture_multisample (); +static GLboolean _glewInit_GL_ARB_texture_storage (); +static GLboolean _glewInit_GL_ARB_texture_storage_multisample (); +static GLboolean _glewInit_GL_ARB_texture_view (); +static GLboolean _glewInit_GL_ARB_timer_query (); +static GLboolean _glewInit_GL_ARB_transform_feedback2 (); +static GLboolean _glewInit_GL_ARB_transform_feedback3 (); +static GLboolean _glewInit_GL_ARB_transform_feedback_instanced (); +static GLboolean _glewInit_GL_ARB_transpose_matrix (); +static GLboolean _glewInit_GL_ARB_uniform_buffer_object (); +static GLboolean _glewInit_GL_ARB_vertex_array_object (); +static GLboolean _glewInit_GL_ARB_vertex_attrib_64bit (); +static GLboolean _glewInit_GL_ARB_vertex_attrib_binding (); +static GLboolean _glewInit_GL_ARB_vertex_blend (); +static GLboolean _glewInit_GL_ARB_vertex_buffer_object (); +static GLboolean _glewInit_GL_ARB_vertex_program (); +static GLboolean _glewInit_GL_ARB_vertex_shader (); +static GLboolean _glewInit_GL_ARB_vertex_type_2_10_10_10_rev (); +static GLboolean _glewInit_GL_ARB_viewport_array (); +static GLboolean _glewInit_GL_ARB_window_pos (); +static GLboolean _glewInit_GL_ATI_draw_buffers (); +static GLboolean _glewInit_GL_ATI_element_array (); +static GLboolean _glewInit_GL_ATI_envmap_bumpmap (); +static GLboolean _glewInit_GL_ATI_fragment_shader (); +static GLboolean _glewInit_GL_ATI_map_object_buffer (); +static GLboolean _glewInit_GL_ATI_pn_triangles (); +static GLboolean _glewInit_GL_ATI_separate_stencil (); +static GLboolean _glewInit_GL_ATI_vertex_array_object (); +static GLboolean _glewInit_GL_ATI_vertex_attrib_array_object (); +static GLboolean _glewInit_GL_ATI_vertex_streams (); +static GLboolean _glewInit_GL_EXT_base_instance (); +static GLboolean _glewInit_GL_EXT_bindable_uniform (); +static GLboolean _glewInit_GL_EXT_blend_color (); +static GLboolean _glewInit_GL_EXT_blend_equation_separate (); +static GLboolean _glewInit_GL_EXT_blend_func_extended (); +static GLboolean _glewInit_GL_EXT_blend_func_separate (); +static GLboolean _glewInit_GL_EXT_blend_minmax (); +static GLboolean _glewInit_GL_EXT_buffer_storage (); +static GLboolean _glewInit_GL_EXT_clear_texture (); +static GLboolean _glewInit_GL_EXT_color_subtable (); +static GLboolean _glewInit_GL_EXT_compiled_vertex_array (); +static GLboolean _glewInit_GL_EXT_convolution (); +static GLboolean _glewInit_GL_EXT_coordinate_frame (); +static GLboolean _glewInit_GL_EXT_copy_image (); +static GLboolean _glewInit_GL_EXT_copy_texture (); +static GLboolean _glewInit_GL_EXT_cull_vertex (); +static GLboolean _glewInit_GL_EXT_debug_label (); +static GLboolean _glewInit_GL_EXT_debug_marker (); +static GLboolean _glewInit_GL_EXT_depth_bounds_test (); +static GLboolean _glewInit_GL_EXT_direct_state_access (); +static GLboolean _glewInit_GL_EXT_discard_framebuffer (); +static GLboolean _glewInit_GL_EXT_draw_buffers (); +static GLboolean _glewInit_GL_EXT_draw_buffers2 (); +static GLboolean _glewInit_GL_EXT_draw_buffers_indexed (); +static GLboolean _glewInit_GL_EXT_draw_elements_base_vertex (); +static GLboolean _glewInit_GL_EXT_draw_instanced (); +static GLboolean _glewInit_GL_EXT_draw_range_elements (); +static GLboolean _glewInit_GL_EXT_external_buffer (); +static GLboolean _glewInit_GL_EXT_fog_coord (); +static GLboolean _glewInit_GL_EXT_fragment_lighting (); +static GLboolean _glewInit_GL_EXT_framebuffer_blit (); +static GLboolean _glewInit_GL_EXT_framebuffer_multisample (); +static GLboolean _glewInit_GL_EXT_framebuffer_object (); +static GLboolean _glewInit_GL_EXT_geometry_shader4 (); +static GLboolean _glewInit_GL_EXT_gpu_program_parameters (); +static GLboolean _glewInit_GL_EXT_gpu_shader4 (); +static GLboolean _glewInit_GL_EXT_histogram (); +static GLboolean _glewInit_GL_EXT_index_func (); +static GLboolean _glewInit_GL_EXT_index_material (); +static GLboolean _glewInit_GL_EXT_instanced_arrays (); +static GLboolean _glewInit_GL_EXT_light_texture (); +static GLboolean _glewInit_GL_EXT_map_buffer_range (); +static GLboolean _glewInit_GL_EXT_memory_object (); +static GLboolean _glewInit_GL_EXT_memory_object_fd (); +static GLboolean _glewInit_GL_EXT_memory_object_win32 (); +static GLboolean _glewInit_GL_EXT_multi_draw_arrays (); +static GLboolean _glewInit_GL_EXT_multi_draw_indirect (); +static GLboolean _glewInit_GL_EXT_multisample (); +static GLboolean _glewInit_GL_EXT_multisampled_render_to_texture (); +static GLboolean _glewInit_GL_EXT_multiview_draw_buffers (); +static GLboolean _glewInit_GL_EXT_paletted_texture (); +static GLboolean _glewInit_GL_EXT_pixel_transform (); +static GLboolean _glewInit_GL_EXT_point_parameters (); +static GLboolean _glewInit_GL_EXT_polygon_offset (); +static GLboolean _glewInit_GL_EXT_polygon_offset_clamp (); +static GLboolean _glewInit_GL_EXT_provoking_vertex (); +static GLboolean _glewInit_GL_EXT_raster_multisample (); +static GLboolean _glewInit_GL_EXT_scene_marker (); +static GLboolean _glewInit_GL_EXT_secondary_color (); +static GLboolean _glewInit_GL_EXT_semaphore (); +static GLboolean _glewInit_GL_EXT_semaphore_fd (); +static GLboolean _glewInit_GL_EXT_semaphore_win32 (); +static GLboolean _glewInit_GL_EXT_separate_shader_objects (); +static GLboolean _glewInit_GL_EXT_shader_image_load_store (); +static GLboolean _glewInit_GL_EXT_shader_pixel_local_storage2 (); +static GLboolean _glewInit_GL_EXT_sparse_texture (); +static GLboolean _glewInit_GL_EXT_stencil_two_side (); +static GLboolean _glewInit_GL_EXT_subtexture (); +static GLboolean _glewInit_GL_EXT_texture3D (); +static GLboolean _glewInit_GL_EXT_texture_array (); +static GLboolean _glewInit_GL_EXT_texture_buffer_object (); +static GLboolean _glewInit_GL_EXT_texture_integer (); +static GLboolean _glewInit_GL_EXT_texture_object (); +static GLboolean _glewInit_GL_EXT_texture_perturb_normal (); +static GLboolean _glewInit_GL_EXT_texture_storage (); +static GLboolean _glewInit_GL_EXT_texture_view (); +static GLboolean _glewInit_GL_EXT_timer_query (); +static GLboolean _glewInit_GL_EXT_transform_feedback (); +static GLboolean _glewInit_GL_EXT_vertex_array (); +static GLboolean _glewInit_GL_EXT_vertex_array_setXXX (); +static GLboolean _glewInit_GL_EXT_vertex_attrib_64bit (); +static GLboolean _glewInit_GL_EXT_vertex_shader (); +static GLboolean _glewInit_GL_EXT_vertex_weighting (); +static GLboolean _glewInit_GL_EXT_win32_keyed_mutex (); +static GLboolean _glewInit_GL_EXT_window_rectangles (); +static GLboolean _glewInit_GL_EXT_x11_sync_object (); +static GLboolean _glewInit_GL_GREMEDY_frame_terminator (); +static GLboolean _glewInit_GL_GREMEDY_string_marker (); +static GLboolean _glewInit_GL_HP_image_transform (); +static GLboolean _glewInit_GL_IBM_multimode_draw_arrays (); +static GLboolean _glewInit_GL_IBM_vertex_array_lists (); +static GLboolean _glewInit_GL_INTEL_map_texture (); +static GLboolean _glewInit_GL_INTEL_parallel_arrays (); +static GLboolean _glewInit_GL_INTEL_performance_query (); +static GLboolean _glewInit_GL_INTEL_texture_scissor (); +static GLboolean _glewInit_GL_KHR_blend_equation_advanced (); +static GLboolean _glewInit_GL_KHR_debug (); +static GLboolean _glewInit_GL_KHR_parallel_shader_compile (); +static GLboolean _glewInit_GL_KHR_robustness (); +static GLboolean _glewInit_GL_KTX_buffer_region (); +static GLboolean _glewInit_GL_MESA_resize_buffers (); +static GLboolean _glewInit_GL_MESA_window_pos (); +static GLboolean _glewInit_GL_NVX_conditional_render (); +static GLboolean _glewInit_GL_NVX_linked_gpu_multicast (); +static GLboolean _glewInit_GL_NV_3dvision_settings (); +static GLboolean _glewInit_GL_NV_bindless_multi_draw_indirect (); +static GLboolean _glewInit_GL_NV_bindless_multi_draw_indirect_count (); +static GLboolean _glewInit_GL_NV_bindless_texture (); +static GLboolean _glewInit_GL_NV_blend_equation_advanced (); +static GLboolean _glewInit_GL_NV_clip_space_w_scaling (); +static GLboolean _glewInit_GL_NV_command_list (); +static GLboolean _glewInit_GL_NV_conditional_render (); +static GLboolean _glewInit_GL_NV_conservative_raster (); +static GLboolean _glewInit_GL_NV_conservative_raster_dilate (); +static GLboolean _glewInit_GL_NV_conservative_raster_pre_snap_triangles (); +static GLboolean _glewInit_GL_NV_copy_buffer (); +static GLboolean _glewInit_GL_NV_copy_image (); +static GLboolean _glewInit_GL_NV_depth_buffer_float (); +static GLboolean _glewInit_GL_NV_draw_buffers (); +static GLboolean _glewInit_GL_NV_draw_instanced (); +static GLboolean _glewInit_GL_NV_draw_texture (); +static GLboolean _glewInit_GL_NV_draw_vulkan_image (); +static GLboolean _glewInit_GL_NV_evaluators (); +static GLboolean _glewInit_GL_NV_explicit_multisample (); +static GLboolean _glewInit_GL_NV_fence (); +static GLboolean _glewInit_GL_NV_fragment_coverage_to_color (); +static GLboolean _glewInit_GL_NV_fragment_program (); +static GLboolean _glewInit_GL_NV_framebuffer_blit (); +static GLboolean _glewInit_GL_NV_framebuffer_multisample (); +static GLboolean _glewInit_GL_NV_framebuffer_multisample_coverage (); +static GLboolean _glewInit_GL_NV_geometry_program4 (); +static GLboolean _glewInit_GL_NV_gpu_multicast (); +static GLboolean _glewInit_GL_NV_gpu_program4 (); +static GLboolean _glewInit_GL_NV_gpu_shader5 (); +static GLboolean _glewInit_GL_NV_half_float (); +static GLboolean _glewInit_GL_NV_instanced_arrays (); +static GLboolean _glewInit_GL_NV_internalformat_sample_query (); +static GLboolean _glewInit_GL_NV_non_square_matrices (); +static GLboolean _glewInit_GL_NV_occlusion_query (); +static GLboolean _glewInit_GL_NV_parameter_buffer_object (); +static GLboolean _glewInit_GL_NV_path_rendering (); +static GLboolean _glewInit_GL_NV_pixel_data_range (); +static GLboolean _glewInit_GL_NV_point_sprite (); +static GLboolean _glewInit_GL_NV_polygon_mode (); +static GLboolean _glewInit_GL_NV_present_video (); +static GLboolean _glewInit_GL_NV_primitive_restart (); +static GLboolean _glewInit_GL_NV_register_combiners (); +static GLboolean _glewInit_GL_NV_register_combiners2 (); +static GLboolean _glewInit_GL_NV_sample_locations (); +static GLboolean _glewInit_GL_NV_shader_buffer_load (); +static GLboolean _glewInit_GL_NV_texture_array (); +static GLboolean _glewInit_GL_NV_texture_barrier (); +static GLboolean _glewInit_GL_NV_texture_multisample (); +static GLboolean _glewInit_GL_NV_transform_feedback (); +static GLboolean _glewInit_GL_NV_transform_feedback2 (); +static GLboolean _glewInit_GL_NV_vdpau_interop (); +static GLboolean _glewInit_GL_NV_vertex_array_range (); +static GLboolean _glewInit_GL_NV_vertex_attrib_integer_64bit (); +static GLboolean _glewInit_GL_NV_vertex_buffer_unified_memory (); +static GLboolean _glewInit_GL_NV_vertex_program (); +static GLboolean _glewInit_GL_NV_video_capture (); +static GLboolean _glewInit_GL_NV_viewport_array (); +static GLboolean _glewInit_GL_NV_viewport_swizzle (); +static GLboolean _glewInit_GL_OVR_multiview (); +static GLboolean _glewInit_GL_OVR_multiview_multisampled_render_to_texture (); +static GLboolean _glewInit_GL_QCOM_alpha_test (); +static GLboolean _glewInit_GL_QCOM_driver_control (); +static GLboolean _glewInit_GL_QCOM_extended_get (); +static GLboolean _glewInit_GL_QCOM_extended_get2 (); +static GLboolean _glewInit_GL_QCOM_framebuffer_foveated (); +static GLboolean _glewInit_GL_QCOM_shader_framebuffer_fetch_noncoherent (); +static GLboolean _glewInit_GL_QCOM_tiled_rendering (); +static GLboolean _glewInit_GL_REGAL_ES1_0_compatibility (); +static GLboolean _glewInit_GL_REGAL_ES1_1_compatibility (); +static GLboolean _glewInit_GL_REGAL_error_string (); +static GLboolean _glewInit_GL_REGAL_extension_query (); +static GLboolean _glewInit_GL_REGAL_log (); +static GLboolean _glewInit_GL_REGAL_proc_address (); +static GLboolean _glewInit_GL_SGIS_detail_texture (); +static GLboolean _glewInit_GL_SGIS_fog_function (); +static GLboolean _glewInit_GL_SGIS_multisample (); +static GLboolean _glewInit_GL_SGIS_multitexture (); +static GLboolean _glewInit_GL_SGIS_shared_multisample (); +static GLboolean _glewInit_GL_SGIS_sharpen_texture (); +static GLboolean _glewInit_GL_SGIS_texture4D (); +static GLboolean _glewInit_GL_SGIS_texture_filter4 (); +static GLboolean _glewInit_GL_SGIX_async (); +static GLboolean _glewInit_GL_SGIX_datapipe (); +static GLboolean _glewInit_GL_SGIX_flush_raster (); +static GLboolean _glewInit_GL_SGIX_fog_layers (); +static GLboolean _glewInit_GL_SGIX_fog_texture (); +static GLboolean _glewInit_GL_SGIX_fragment_specular_lighting (); +static GLboolean _glewInit_GL_SGIX_framezoom (); +static GLboolean _glewInit_GL_SGIX_igloo_interface (); +static GLboolean _glewInit_GL_SGIX_mpeg1 (); +static GLboolean _glewInit_GL_SGIX_nonlinear_lighting_pervertex (); +static GLboolean _glewInit_GL_SGIX_pixel_texture (); +static GLboolean _glewInit_GL_SGIX_polynomial_ffd (); +static GLboolean _glewInit_GL_SGIX_quad_mesh (); +static GLboolean _glewInit_GL_SGIX_reference_plane (); +static GLboolean _glewInit_GL_SGIX_sprite (); +static GLboolean _glewInit_GL_SGIX_tag_sample_buffer (); +static GLboolean _glewInit_GL_SGIX_vector_ops (); +static GLboolean _glewInit_GL_SGIX_vertex_array_object (); +static GLboolean _glewInit_GL_SGI_color_table (); +static GLboolean _glewInit_GL_SGI_fft (); +static GLboolean _glewInit_GL_SUNX_constant_data (); +static GLboolean _glewInit_GL_SUN_global_alpha (); +static GLboolean _glewInit_GL_SUN_read_video_pixels (); +static GLboolean _glewInit_GL_SUN_triangle_list (); +static GLboolean _glewInit_GL_SUN_vertex (); +static GLboolean _glewInit_GL_WIN_swap_hint (); #ifdef GL_VERSION_1_2 -static GLboolean _glewInit_GL_VERSION_1_2 (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_VERSION_1_2 () { GLboolean r = GL_FALSE; @@ -1854,7 +9268,7 @@ static GLboolean _glewInit_GL_VERSION_1_2 (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_VERSION_1_3 -static GLboolean _glewInit_GL_VERSION_1_3 (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_VERSION_1_3 () { GLboolean r = GL_FALSE; @@ -1912,7 +9326,7 @@ static GLboolean _glewInit_GL_VERSION_1_3 (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_VERSION_1_4 -static GLboolean _glewInit_GL_VERSION_1_4 (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_VERSION_1_4 () { GLboolean r = GL_FALSE; @@ -1971,7 +9385,7 @@ static GLboolean _glewInit_GL_VERSION_1_4 (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_VERSION_1_5 -static GLboolean _glewInit_GL_VERSION_1_5 (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_VERSION_1_5 () { GLboolean r = GL_FALSE; @@ -2002,7 +9416,7 @@ static GLboolean _glewInit_GL_VERSION_1_5 (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_VERSION_2_0 -static GLboolean _glewInit_GL_VERSION_2_0 (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_VERSION_2_0 () { GLboolean r = GL_FALSE; @@ -2107,7 +9521,7 @@ static GLboolean _glewInit_GL_VERSION_2_0 (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_VERSION_2_1 -static GLboolean _glewInit_GL_VERSION_2_1 (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_VERSION_2_1 () { GLboolean r = GL_FALSE; @@ -2123,13 +9537,180 @@ static GLboolean _glewInit_GL_VERSION_2_1 (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_VERSION_2_1 */ -#ifdef GL_3DFX_multisample +#ifdef GL_VERSION_3_0 -#endif /* GL_3DFX_multisample */ +static GLboolean _glewInit_GL_VERSION_3_0 () +{ + GLboolean r = GL_FALSE; + + r = _glewInit_GL_ARB_framebuffer_object() || r; + r = _glewInit_GL_ARB_map_buffer_range() || r; + r = _glewInit_GL_ARB_uniform_buffer_object() || r; + r = _glewInit_GL_ARB_vertex_array_object() || r; + + r = ((glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRender")) == NULL) || r; + r = ((glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedback")) == NULL) || r; + r = ((glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocation")) == NULL) || r; + r = ((glClampColor = (PFNGLCLAMPCOLORPROC)glewGetProcAddress((const GLubyte*)"glClampColor")) == NULL) || r; + r = ((glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)glewGetProcAddress((const GLubyte*)"glClearBufferfi")) == NULL) || r; + r = ((glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferfv")) == NULL) || r; + r = ((glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferiv")) == NULL) || r; + r = ((glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferuiv")) == NULL) || r; + r = ((glColorMaski = (PFNGLCOLORMASKIPROC)glewGetProcAddress((const GLubyte*)"glColorMaski")) == NULL) || r; + r = ((glDisablei = (PFNGLDISABLEIPROC)glewGetProcAddress((const GLubyte*)"glDisablei")) == NULL) || r; + r = ((glEnablei = (PFNGLENABLEIPROC)glewGetProcAddress((const GLubyte*)"glEnablei")) == NULL) || r; + r = ((glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRender")) == NULL) || r; + r = ((glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedback")) == NULL) || r; + r = ((glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)glewGetProcAddress((const GLubyte*)"glGetBooleani_v")) == NULL) || r; + r = ((glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataLocation")) == NULL) || r; + r = ((glGetStringi = (PFNGLGETSTRINGIPROC)glewGetProcAddress((const GLubyte*)"glGetStringi")) == NULL) || r; + r = ((glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIiv")) == NULL) || r; + r = ((glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIuiv")) == NULL) || r; + r = ((glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVarying")) == NULL) || r; + r = ((glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformuiv")) == NULL) || r; + r = ((glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIiv")) == NULL) || r; + r = ((glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIuiv")) == NULL) || r; + r = ((glIsEnabledi = (PFNGLISENABLEDIPROC)glewGetProcAddress((const GLubyte*)"glIsEnabledi")) == NULL) || r; + r = ((glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIiv")) == NULL) || r; + r = ((glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIuiv")) == NULL) || r; + r = ((glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryings")) == NULL) || r; + r = ((glUniform1ui = (PFNGLUNIFORM1UIPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui")) == NULL) || r; + r = ((glUniform1uiv = (PFNGLUNIFORM1UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform1uiv")) == NULL) || r; + r = ((glUniform2ui = (PFNGLUNIFORM2UIPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui")) == NULL) || r; + r = ((glUniform2uiv = (PFNGLUNIFORM2UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform2uiv")) == NULL) || r; + r = ((glUniform3ui = (PFNGLUNIFORM3UIPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui")) == NULL) || r; + r = ((glUniform3uiv = (PFNGLUNIFORM3UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform3uiv")) == NULL) || r; + r = ((glUniform4ui = (PFNGLUNIFORM4UIPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui")) == NULL) || r; + r = ((glUniform4uiv = (PFNGLUNIFORM4UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform4uiv")) == NULL) || r; + r = ((glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1i")) == NULL) || r; + r = ((glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1iv")) == NULL) || r; + r = ((glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1ui")) == NULL) || r; + r = ((glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uiv")) == NULL) || r; + r = ((glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2i")) == NULL) || r; + r = ((glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2iv")) == NULL) || r; + r = ((glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2ui")) == NULL) || r; + r = ((glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uiv")) == NULL) || r; + r = ((glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3i")) == NULL) || r; + r = ((glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3iv")) == NULL) || r; + r = ((glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3ui")) == NULL) || r; + r = ((glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uiv")) == NULL) || r; + r = ((glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4bv")) == NULL) || r; + r = ((glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4i")) == NULL) || r; + r = ((glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4iv")) == NULL) || r; + r = ((glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4sv")) == NULL) || r; + r = ((glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ubv")) == NULL) || r; + r = ((glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ui")) == NULL) || r; + r = ((glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uiv")) == NULL) || r; + r = ((glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4usv")) == NULL) || r; + r = ((glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIPointer")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_3_0 */ + +#ifdef GL_VERSION_3_1 + +static GLboolean _glewInit_GL_VERSION_3_1 () +{ + GLboolean r = GL_FALSE; + + r = _glewInit_GL_ARB_copy_buffer() || r; + + r = ((glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstanced")) == NULL) || r; + r = ((glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstanced")) == NULL) || r; + r = ((glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartIndex")) == NULL) || r; + r = ((glTexBuffer = (PFNGLTEXBUFFERPROC)glewGetProcAddress((const GLubyte*)"glTexBuffer")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_3_1 */ + +#ifdef GL_VERSION_3_2 + +static GLboolean _glewInit_GL_VERSION_3_2 () +{ + GLboolean r = GL_FALSE; + + r = _glewInit_GL_ARB_draw_elements_base_vertex() || r; + r = _glewInit_GL_ARB_provoking_vertex() || r; + r = _glewInit_GL_ARB_sync() || r; + r = _glewInit_GL_ARB_texture_multisample() || r; + + r = ((glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture")) == NULL) || r; + r = ((glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameteri64v")) == NULL) || r; + r = ((glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)glewGetProcAddress((const GLubyte*)"glGetInteger64i_v")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_3_2 */ + +#ifdef GL_VERSION_3_3 + +static GLboolean _glewInit_GL_VERSION_3_3 () +{ + GLboolean r = GL_FALSE; + + r = ((glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisor")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_3_3 */ + +#ifdef GL_VERSION_4_0 + +static GLboolean _glewInit_GL_VERSION_4_0 () +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationSeparatei = (PFNGLBLENDEQUATIONSEPARATEIPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparatei")) == NULL) || r; + r = ((glBlendEquationi = (PFNGLBLENDEQUATIONIPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationi")) == NULL) || r; + r = ((glBlendFuncSeparatei = (PFNGLBLENDFUNCSEPARATEIPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparatei")) == NULL) || r; + r = ((glBlendFunci = (PFNGLBLENDFUNCIPROC)glewGetProcAddress((const GLubyte*)"glBlendFunci")) == NULL) || r; + r = ((glMinSampleShading = (PFNGLMINSAMPLESHADINGPROC)glewGetProcAddress((const GLubyte*)"glMinSampleShading")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_4_0 */ + +#ifdef GL_VERSION_4_5 + +static GLboolean _glewInit_GL_VERSION_4_5 () +{ + GLboolean r = GL_FALSE; + + r = ((glGetGraphicsResetStatus = (PFNGLGETGRAPHICSRESETSTATUSPROC)glewGetProcAddress((const GLubyte*)"glGetGraphicsResetStatus")) == NULL) || r; + r = ((glGetnCompressedTexImage = (PFNGLGETNCOMPRESSEDTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetnCompressedTexImage")) == NULL) || r; + r = ((glGetnTexImage = (PFNGLGETNTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetnTexImage")) == NULL) || r; + r = ((glGetnUniformdv = (PFNGLGETNUNIFORMDVPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformdv")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_4_5 */ + +#ifdef GL_VERSION_4_6 + +static GLboolean _glewInit_GL_VERSION_4_6 () +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysIndirectCount = (PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectCount")) == NULL) || r; + r = ((glMultiDrawElementsIndirectCount = (PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectCount")) == NULL) || r; + r = ((glSpecializeShader = (PFNGLSPECIALIZESHADERPROC)glewGetProcAddress((const GLubyte*)"glSpecializeShader")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_4_6 */ #ifdef GL_3DFX_tbuffer -static GLboolean _glewInit_GL_3DFX_tbuffer (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_3DFX_tbuffer () { GLboolean r = GL_FALSE; @@ -2140,17 +9721,279 @@ static GLboolean _glewInit_GL_3DFX_tbuffer (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_3DFX_tbuffer */ -#ifdef GL_3DFX_texture_compression_FXT1 +#ifdef GL_AMD_debug_output -#endif /* GL_3DFX_texture_compression_FXT1 */ +static GLboolean _glewInit_GL_AMD_debug_output () +{ + GLboolean r = GL_FALSE; -#ifdef GL_APPLE_client_storage + r = ((glDebugMessageCallbackAMD = (PFNGLDEBUGMESSAGECALLBACKAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallbackAMD")) == NULL) || r; + r = ((glDebugMessageEnableAMD = (PFNGLDEBUGMESSAGEENABLEAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageEnableAMD")) == NULL) || r; + r = ((glDebugMessageInsertAMD = (PFNGLDEBUGMESSAGEINSERTAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsertAMD")) == NULL) || r; + r = ((glGetDebugMessageLogAMD = (PFNGLGETDEBUGMESSAGELOGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLogAMD")) == NULL) || r; -#endif /* GL_APPLE_client_storage */ + return r; +} + +#endif /* GL_AMD_debug_output */ + +#ifdef GL_AMD_draw_buffers_blend + +static GLboolean _glewInit_GL_AMD_draw_buffers_blend () +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationIndexedAMD = (PFNGLBLENDEQUATIONINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationIndexedAMD")) == NULL) || r; + r = ((glBlendEquationSeparateIndexedAMD = (PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateIndexedAMD")) == NULL) || r; + r = ((glBlendFuncIndexedAMD = (PFNGLBLENDFUNCINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncIndexedAMD")) == NULL) || r; + r = ((glBlendFuncSeparateIndexedAMD = (PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateIndexedAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_draw_buffers_blend */ + +#ifdef GL_AMD_framebuffer_sample_positions + +static GLboolean _glewInit_GL_AMD_framebuffer_sample_positions () +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferSamplePositionsfvAMD = (PFNGLFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC)glewGetProcAddress((const GLubyte*)"glFramebufferSamplePositionsfvAMD")) == NULL) || r; + r = ((glGetFramebufferParameterfvAMD = (PFNGLGETFRAMEBUFFERPARAMETERFVAMDPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferParameterfvAMD")) == NULL) || r; + r = ((glGetNamedFramebufferParameterfvAMD = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERFVAMDPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferParameterfvAMD")) == NULL) || r; + r = ((glNamedFramebufferSamplePositionsfvAMD = (PFNGLNAMEDFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferSamplePositionsfvAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_framebuffer_sample_positions */ + +#ifdef GL_AMD_interleaved_elements + +static GLboolean _glewInit_GL_AMD_interleaved_elements () +{ + GLboolean r = GL_FALSE; + + r = ((glVertexAttribParameteriAMD = (PFNGLVERTEXATTRIBPARAMETERIAMDPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribParameteriAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_interleaved_elements */ + +#ifdef GL_AMD_multi_draw_indirect + +static GLboolean _glewInit_GL_AMD_multi_draw_indirect () +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysIndirectAMD = (PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectAMD")) == NULL) || r; + r = ((glMultiDrawElementsIndirectAMD = (PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_multi_draw_indirect */ + +#ifdef GL_AMD_name_gen_delete + +static GLboolean _glewInit_GL_AMD_name_gen_delete () +{ + GLboolean r = GL_FALSE; + + r = ((glDeleteNamesAMD = (PFNGLDELETENAMESAMDPROC)glewGetProcAddress((const GLubyte*)"glDeleteNamesAMD")) == NULL) || r; + r = ((glGenNamesAMD = (PFNGLGENNAMESAMDPROC)glewGetProcAddress((const GLubyte*)"glGenNamesAMD")) == NULL) || r; + r = ((glIsNameAMD = (PFNGLISNAMEAMDPROC)glewGetProcAddress((const GLubyte*)"glIsNameAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_name_gen_delete */ + +#ifdef GL_AMD_occlusion_query_event + +static GLboolean _glewInit_GL_AMD_occlusion_query_event () +{ + GLboolean r = GL_FALSE; + + r = ((glQueryObjectParameteruiAMD = (PFNGLQUERYOBJECTPARAMETERUIAMDPROC)glewGetProcAddress((const GLubyte*)"glQueryObjectParameteruiAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_occlusion_query_event */ + +#ifdef GL_AMD_performance_monitor + +static GLboolean _glewInit_GL_AMD_performance_monitor () +{ + GLboolean r = GL_FALSE; + + r = ((glBeginPerfMonitorAMD = (PFNGLBEGINPERFMONITORAMDPROC)glewGetProcAddress((const GLubyte*)"glBeginPerfMonitorAMD")) == NULL) || r; + r = ((glDeletePerfMonitorsAMD = (PFNGLDELETEPERFMONITORSAMDPROC)glewGetProcAddress((const GLubyte*)"glDeletePerfMonitorsAMD")) == NULL) || r; + r = ((glEndPerfMonitorAMD = (PFNGLENDPERFMONITORAMDPROC)glewGetProcAddress((const GLubyte*)"glEndPerfMonitorAMD")) == NULL) || r; + r = ((glGenPerfMonitorsAMD = (PFNGLGENPERFMONITORSAMDPROC)glewGetProcAddress((const GLubyte*)"glGenPerfMonitorsAMD")) == NULL) || r; + r = ((glGetPerfMonitorCounterDataAMD = (PFNGLGETPERFMONITORCOUNTERDATAAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterDataAMD")) == NULL) || r; + r = ((glGetPerfMonitorCounterInfoAMD = (PFNGLGETPERFMONITORCOUNTERINFOAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterInfoAMD")) == NULL) || r; + r = ((glGetPerfMonitorCounterStringAMD = (PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterStringAMD")) == NULL) || r; + r = ((glGetPerfMonitorCountersAMD = (PFNGLGETPERFMONITORCOUNTERSAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCountersAMD")) == NULL) || r; + r = ((glGetPerfMonitorGroupStringAMD = (PFNGLGETPERFMONITORGROUPSTRINGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorGroupStringAMD")) == NULL) || r; + r = ((glGetPerfMonitorGroupsAMD = (PFNGLGETPERFMONITORGROUPSAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorGroupsAMD")) == NULL) || r; + r = ((glSelectPerfMonitorCountersAMD = (PFNGLSELECTPERFMONITORCOUNTERSAMDPROC)glewGetProcAddress((const GLubyte*)"glSelectPerfMonitorCountersAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_performance_monitor */ + +#ifdef GL_AMD_sample_positions + +static GLboolean _glewInit_GL_AMD_sample_positions () +{ + GLboolean r = GL_FALSE; + + r = ((glSetMultisamplefvAMD = (PFNGLSETMULTISAMPLEFVAMDPROC)glewGetProcAddress((const GLubyte*)"glSetMultisamplefvAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_sample_positions */ + +#ifdef GL_AMD_sparse_texture + +static GLboolean _glewInit_GL_AMD_sparse_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glTexStorageSparseAMD = (PFNGLTEXSTORAGESPARSEAMDPROC)glewGetProcAddress((const GLubyte*)"glTexStorageSparseAMD")) == NULL) || r; + r = ((glTextureStorageSparseAMD = (PFNGLTEXTURESTORAGESPARSEAMDPROC)glewGetProcAddress((const GLubyte*)"glTextureStorageSparseAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_sparse_texture */ + +#ifdef GL_AMD_stencil_operation_extended + +static GLboolean _glewInit_GL_AMD_stencil_operation_extended () +{ + GLboolean r = GL_FALSE; + + r = ((glStencilOpValueAMD = (PFNGLSTENCILOPVALUEAMDPROC)glewGetProcAddress((const GLubyte*)"glStencilOpValueAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_stencil_operation_extended */ + +#ifdef GL_AMD_vertex_shader_tessellator + +static GLboolean _glewInit_GL_AMD_vertex_shader_tessellator () +{ + GLboolean r = GL_FALSE; + + r = ((glTessellationFactorAMD = (PFNGLTESSELLATIONFACTORAMDPROC)glewGetProcAddress((const GLubyte*)"glTessellationFactorAMD")) == NULL) || r; + r = ((glTessellationModeAMD = (PFNGLTESSELLATIONMODEAMDPROC)glewGetProcAddress((const GLubyte*)"glTessellationModeAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_vertex_shader_tessellator */ + +#ifdef GL_ANGLE_framebuffer_blit + +static GLboolean _glewInit_GL_ANGLE_framebuffer_blit () +{ + GLboolean r = GL_FALSE; + + r = ((glBlitFramebufferANGLE = (PFNGLBLITFRAMEBUFFERANGLEPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebufferANGLE")) == NULL) || r; + + return r; +} + +#endif /* GL_ANGLE_framebuffer_blit */ + +#ifdef GL_ANGLE_framebuffer_multisample + +static GLboolean _glewInit_GL_ANGLE_framebuffer_multisample () +{ + GLboolean r = GL_FALSE; + + r = ((glRenderbufferStorageMultisampleANGLE = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleANGLE")) == NULL) || r; + + return r; +} + +#endif /* GL_ANGLE_framebuffer_multisample */ + +#ifdef GL_ANGLE_instanced_arrays + +static GLboolean _glewInit_GL_ANGLE_instanced_arrays () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstancedANGLE = (PFNGLDRAWARRAYSINSTANCEDANGLEPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedANGLE")) == NULL) || r; + r = ((glDrawElementsInstancedANGLE = (PFNGLDRAWELEMENTSINSTANCEDANGLEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedANGLE")) == NULL) || r; + r = ((glVertexAttribDivisorANGLE = (PFNGLVERTEXATTRIBDIVISORANGLEPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisorANGLE")) == NULL) || r; + + return r; +} + +#endif /* GL_ANGLE_instanced_arrays */ + +#ifdef GL_ANGLE_timer_query + +static GLboolean _glewInit_GL_ANGLE_timer_query () +{ + GLboolean r = GL_FALSE; + + r = ((glBeginQueryANGLE = (PFNGLBEGINQUERYANGLEPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryANGLE")) == NULL) || r; + r = ((glDeleteQueriesANGLE = (PFNGLDELETEQUERIESANGLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueriesANGLE")) == NULL) || r; + r = ((glEndQueryANGLE = (PFNGLENDQUERYANGLEPROC)glewGetProcAddress((const GLubyte*)"glEndQueryANGLE")) == NULL) || r; + r = ((glGenQueriesANGLE = (PFNGLGENQUERIESANGLEPROC)glewGetProcAddress((const GLubyte*)"glGenQueriesANGLE")) == NULL) || r; + r = ((glGetQueryObjecti64vANGLE = (PFNGLGETQUERYOBJECTI64VANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64vANGLE")) == NULL) || r; + r = ((glGetQueryObjectivANGLE = (PFNGLGETQUERYOBJECTIVANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectivANGLE")) == NULL) || r; + r = ((glGetQueryObjectui64vANGLE = (PFNGLGETQUERYOBJECTUI64VANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64vANGLE")) == NULL) || r; + r = ((glGetQueryObjectuivANGLE = (PFNGLGETQUERYOBJECTUIVANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuivANGLE")) == NULL) || r; + r = ((glGetQueryivANGLE = (PFNGLGETQUERYIVANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryivANGLE")) == NULL) || r; + r = ((glIsQueryANGLE = (PFNGLISQUERYANGLEPROC)glewGetProcAddress((const GLubyte*)"glIsQueryANGLE")) == NULL) || r; + r = ((glQueryCounterANGLE = (PFNGLQUERYCOUNTERANGLEPROC)glewGetProcAddress((const GLubyte*)"glQueryCounterANGLE")) == NULL) || r; + + return r; +} + +#endif /* GL_ANGLE_timer_query */ + +#ifdef GL_ANGLE_translated_shader_source + +static GLboolean _glewInit_GL_ANGLE_translated_shader_source () +{ + GLboolean r = GL_FALSE; + + r = ((glGetTranslatedShaderSourceANGLE = (PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetTranslatedShaderSourceANGLE")) == NULL) || r; + + return r; +} + +#endif /* GL_ANGLE_translated_shader_source */ + +#ifdef GL_APPLE_copy_texture_levels + +static GLboolean _glewInit_GL_APPLE_copy_texture_levels () +{ + GLboolean r = GL_FALSE; + + r = ((glCopyTextureLevelsAPPLE = (PFNGLCOPYTEXTURELEVELSAPPLEPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureLevelsAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_copy_texture_levels */ #ifdef GL_APPLE_element_array -static GLboolean _glewInit_GL_APPLE_element_array (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_APPLE_element_array () { GLboolean r = GL_FALSE; @@ -2167,7 +10010,7 @@ static GLboolean _glewInit_GL_APPLE_element_array (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_APPLE_fence -static GLboolean _glewInit_GL_APPLE_fence (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_APPLE_fence () { GLboolean r = GL_FALSE; @@ -2185,13 +10028,9 @@ static GLboolean _glewInit_GL_APPLE_fence (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_APPLE_fence */ -#ifdef GL_APPLE_float_pixels - -#endif /* GL_APPLE_float_pixels */ - #ifdef GL_APPLE_flush_buffer_range -static GLboolean _glewInit_GL_APPLE_flush_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_APPLE_flush_buffer_range () { GLboolean r = GL_FALSE; @@ -2203,17 +10042,57 @@ static GLboolean _glewInit_GL_APPLE_flush_buffer_range (GLEW_CONTEXT_ARG_DEF_INI #endif /* GL_APPLE_flush_buffer_range */ -#ifdef GL_APPLE_pixel_buffer +#ifdef GL_APPLE_framebuffer_multisample -#endif /* GL_APPLE_pixel_buffer */ +static GLboolean _glewInit_GL_APPLE_framebuffer_multisample () +{ + GLboolean r = GL_FALSE; -#ifdef GL_APPLE_specular_vector + r = ((glRenderbufferStorageMultisampleAPPLE = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleAPPLE")) == NULL) || r; + r = ((glResolveMultisampleFramebufferAPPLE = (PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC)glewGetProcAddress((const GLubyte*)"glResolveMultisampleFramebufferAPPLE")) == NULL) || r; -#endif /* GL_APPLE_specular_vector */ + return r; +} + +#endif /* GL_APPLE_framebuffer_multisample */ + +#ifdef GL_APPLE_object_purgeable + +static GLboolean _glewInit_GL_APPLE_object_purgeable () +{ + GLboolean r = GL_FALSE; + + r = ((glGetObjectParameterivAPPLE = (PFNGLGETOBJECTPARAMETERIVAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterivAPPLE")) == NULL) || r; + r = ((glObjectPurgeableAPPLE = (PFNGLOBJECTPURGEABLEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glObjectPurgeableAPPLE")) == NULL) || r; + r = ((glObjectUnpurgeableAPPLE = (PFNGLOBJECTUNPURGEABLEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glObjectUnpurgeableAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_object_purgeable */ + +#ifdef GL_APPLE_sync + +static GLboolean _glewInit_GL_APPLE_sync () +{ + GLboolean r = GL_FALSE; + + r = ((glClientWaitSyncAPPLE = (PFNGLCLIENTWAITSYNCAPPLEPROC)glewGetProcAddress((const GLubyte*)"glClientWaitSyncAPPLE")) == NULL) || r; + r = ((glDeleteSyncAPPLE = (PFNGLDELETESYNCAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteSyncAPPLE")) == NULL) || r; + r = ((glFenceSyncAPPLE = (PFNGLFENCESYNCAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFenceSyncAPPLE")) == NULL) || r; + r = ((glGetInteger64vAPPLE = (PFNGLGETINTEGER64VAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGetInteger64vAPPLE")) == NULL) || r; + r = ((glGetSyncivAPPLE = (PFNGLGETSYNCIVAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGetSyncivAPPLE")) == NULL) || r; + r = ((glIsSyncAPPLE = (PFNGLISSYNCAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsSyncAPPLE")) == NULL) || r; + r = ((glWaitSyncAPPLE = (PFNGLWAITSYNCAPPLEPROC)glewGetProcAddress((const GLubyte*)"glWaitSyncAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_sync */ #ifdef GL_APPLE_texture_range -static GLboolean _glewInit_GL_APPLE_texture_range (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_APPLE_texture_range () { GLboolean r = GL_FALSE; @@ -2225,13 +10104,9 @@ static GLboolean _glewInit_GL_APPLE_texture_range (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_APPLE_texture_range */ -#ifdef GL_APPLE_transform_hint - -#endif /* GL_APPLE_transform_hint */ - #ifdef GL_APPLE_vertex_array_object -static GLboolean _glewInit_GL_APPLE_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_APPLE_vertex_array_object () { GLboolean r = GL_FALSE; @@ -2247,7 +10122,7 @@ static GLboolean _glewInit_GL_APPLE_vertex_array_object (GLEW_CONTEXT_ARG_DEF_IN #ifdef GL_APPLE_vertex_array_range -static GLboolean _glewInit_GL_APPLE_vertex_array_range (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_APPLE_vertex_array_range () { GLboolean r = GL_FALSE; @@ -2260,13 +10135,197 @@ static GLboolean _glewInit_GL_APPLE_vertex_array_range (GLEW_CONTEXT_ARG_DEF_INI #endif /* GL_APPLE_vertex_array_range */ -#ifdef GL_APPLE_ycbcr_422 +#ifdef GL_APPLE_vertex_program_evaluators -#endif /* GL_APPLE_ycbcr_422 */ +static GLboolean _glewInit_GL_APPLE_vertex_program_evaluators () +{ + GLboolean r = GL_FALSE; + + r = ((glDisableVertexAttribAPPLE = (PFNGLDISABLEVERTEXATTRIBAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribAPPLE")) == NULL) || r; + r = ((glEnableVertexAttribAPPLE = (PFNGLENABLEVERTEXATTRIBAPPLEPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribAPPLE")) == NULL) || r; + r = ((glIsVertexAttribEnabledAPPLE = (PFNGLISVERTEXATTRIBENABLEDAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsVertexAttribEnabledAPPLE")) == NULL) || r; + r = ((glMapVertexAttrib1dAPPLE = (PFNGLMAPVERTEXATTRIB1DAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib1dAPPLE")) == NULL) || r; + r = ((glMapVertexAttrib1fAPPLE = (PFNGLMAPVERTEXATTRIB1FAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib1fAPPLE")) == NULL) || r; + r = ((glMapVertexAttrib2dAPPLE = (PFNGLMAPVERTEXATTRIB2DAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib2dAPPLE")) == NULL) || r; + r = ((glMapVertexAttrib2fAPPLE = (PFNGLMAPVERTEXATTRIB2FAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib2fAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_vertex_program_evaluators */ + +#ifdef GL_ARB_ES2_compatibility + +static GLboolean _glewInit_GL_ARB_ES2_compatibility () +{ + GLboolean r = GL_FALSE; + + r = ((glClearDepthf = (PFNGLCLEARDEPTHFPROC)glewGetProcAddress((const GLubyte*)"glClearDepthf")) == NULL) || r; + r = ((glDepthRangef = (PFNGLDEPTHRANGEFPROC)glewGetProcAddress((const GLubyte*)"glDepthRangef")) == NULL) || r; + r = ((glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC)glewGetProcAddress((const GLubyte*)"glGetShaderPrecisionFormat")) == NULL) || r; + r = ((glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC)glewGetProcAddress((const GLubyte*)"glReleaseShaderCompiler")) == NULL) || r; + r = ((glShaderBinary = (PFNGLSHADERBINARYPROC)glewGetProcAddress((const GLubyte*)"glShaderBinary")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_ES2_compatibility */ + +#ifdef GL_ARB_ES3_1_compatibility + +static GLboolean _glewInit_GL_ARB_ES3_1_compatibility () +{ + GLboolean r = GL_FALSE; + + r = ((glMemoryBarrierByRegion = (PFNGLMEMORYBARRIERBYREGIONPROC)glewGetProcAddress((const GLubyte*)"glMemoryBarrierByRegion")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_ES3_1_compatibility */ + +#ifdef GL_ARB_ES3_2_compatibility + +static GLboolean _glewInit_GL_ARB_ES3_2_compatibility () +{ + GLboolean r = GL_FALSE; + + r = ((glPrimitiveBoundingBoxARB = (PFNGLPRIMITIVEBOUNDINGBOXARBPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveBoundingBoxARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_ES3_2_compatibility */ + +#ifdef GL_ARB_base_instance + +static GLboolean _glewInit_GL_ARB_base_instance () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstancedBaseInstance = (PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedBaseInstance")) == NULL) || r; + r = ((glDrawElementsInstancedBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseInstance")) == NULL) || r; + r = ((glDrawElementsInstancedBaseVertexBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseVertexBaseInstance")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_base_instance */ + +#ifdef GL_ARB_bindless_texture + +static GLboolean _glewInit_GL_ARB_bindless_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glGetImageHandleARB = (PFNGLGETIMAGEHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetImageHandleARB")) == NULL) || r; + r = ((glGetTextureHandleARB = (PFNGLGETTEXTUREHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetTextureHandleARB")) == NULL) || r; + r = ((glGetTextureSamplerHandleARB = (PFNGLGETTEXTURESAMPLERHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetTextureSamplerHandleARB")) == NULL) || r; + r = ((glGetVertexAttribLui64vARB = (PFNGLGETVERTEXATTRIBLUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLui64vARB")) == NULL) || r; + r = ((glIsImageHandleResidentARB = (PFNGLISIMAGEHANDLERESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glIsImageHandleResidentARB")) == NULL) || r; + r = ((glIsTextureHandleResidentARB = (PFNGLISTEXTUREHANDLERESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glIsTextureHandleResidentARB")) == NULL) || r; + r = ((glMakeImageHandleNonResidentARB = (PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleNonResidentARB")) == NULL) || r; + r = ((glMakeImageHandleResidentARB = (PFNGLMAKEIMAGEHANDLERESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleResidentARB")) == NULL) || r; + r = ((glMakeTextureHandleNonResidentARB = (PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleNonResidentARB")) == NULL) || r; + r = ((glMakeTextureHandleResidentARB = (PFNGLMAKETEXTUREHANDLERESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleResidentARB")) == NULL) || r; + r = ((glProgramUniformHandleui64ARB = (PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64ARB")) == NULL) || r; + r = ((glProgramUniformHandleui64vARB = (PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64vARB")) == NULL) || r; + r = ((glUniformHandleui64ARB = (PFNGLUNIFORMHANDLEUI64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64ARB")) == NULL) || r; + r = ((glUniformHandleui64vARB = (PFNGLUNIFORMHANDLEUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64vARB")) == NULL) || r; + r = ((glVertexAttribL1ui64ARB = (PFNGLVERTEXATTRIBL1UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64ARB")) == NULL) || r; + r = ((glVertexAttribL1ui64vARB = (PFNGLVERTEXATTRIBL1UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64vARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_bindless_texture */ + +#ifdef GL_ARB_blend_func_extended + +static GLboolean _glewInit_GL_ARB_blend_func_extended () +{ + GLboolean r = GL_FALSE; + + r = ((glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocationIndexed")) == NULL) || r; + r = ((glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataIndex")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_blend_func_extended */ + +#ifdef GL_ARB_buffer_storage + +static GLboolean _glewInit_GL_ARB_buffer_storage () +{ + GLboolean r = GL_FALSE; + + r = ((glBufferStorage = (PFNGLBUFFERSTORAGEPROC)glewGetProcAddress((const GLubyte*)"glBufferStorage")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_buffer_storage */ + +#ifdef GL_ARB_cl_event + +static GLboolean _glewInit_GL_ARB_cl_event () +{ + GLboolean r = GL_FALSE; + + r = ((glCreateSyncFromCLeventARB = (PFNGLCREATESYNCFROMCLEVENTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateSyncFromCLeventARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_cl_event */ + +#ifdef GL_ARB_clear_buffer_object + +static GLboolean _glewInit_GL_ARB_clear_buffer_object () +{ + GLboolean r = GL_FALSE; + + r = ((glClearBufferData = (PFNGLCLEARBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glClearBufferData")) == NULL) || r; + r = ((glClearBufferSubData = (PFNGLCLEARBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glClearBufferSubData")) == NULL) || r; + r = ((glClearNamedBufferDataEXT = (PFNGLCLEARNAMEDBUFFERDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferDataEXT")) == NULL) || r; + r = ((glClearNamedBufferSubDataEXT = (PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferSubDataEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_clear_buffer_object */ + +#ifdef GL_ARB_clear_texture + +static GLboolean _glewInit_GL_ARB_clear_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glClearTexImage = (PFNGLCLEARTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glClearTexImage")) == NULL) || r; + r = ((glClearTexSubImage = (PFNGLCLEARTEXSUBIMAGEPROC)glewGetProcAddress((const GLubyte*)"glClearTexSubImage")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_clear_texture */ + +#ifdef GL_ARB_clip_control + +static GLboolean _glewInit_GL_ARB_clip_control () +{ + GLboolean r = GL_FALSE; + + r = ((glClipControl = (PFNGLCLIPCONTROLPROC)glewGetProcAddress((const GLubyte*)"glClipControl")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_clip_control */ #ifdef GL_ARB_color_buffer_float -static GLboolean _glewInit_GL_ARB_color_buffer_float (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ARB_color_buffer_float () { GLboolean r = GL_FALSE; @@ -2277,13 +10336,187 @@ static GLboolean _glewInit_GL_ARB_color_buffer_float (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_ARB_color_buffer_float */ -#ifdef GL_ARB_depth_texture +#ifdef GL_ARB_compute_shader -#endif /* GL_ARB_depth_texture */ +static GLboolean _glewInit_GL_ARB_compute_shader () +{ + GLboolean r = GL_FALSE; + + r = ((glDispatchCompute = (PFNGLDISPATCHCOMPUTEPROC)glewGetProcAddress((const GLubyte*)"glDispatchCompute")) == NULL) || r; + r = ((glDispatchComputeIndirect = (PFNGLDISPATCHCOMPUTEINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDispatchComputeIndirect")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_compute_shader */ + +#ifdef GL_ARB_compute_variable_group_size + +static GLboolean _glewInit_GL_ARB_compute_variable_group_size () +{ + GLboolean r = GL_FALSE; + + r = ((glDispatchComputeGroupSizeARB = (PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC)glewGetProcAddress((const GLubyte*)"glDispatchComputeGroupSizeARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_compute_variable_group_size */ + +#ifdef GL_ARB_copy_buffer + +static GLboolean _glewInit_GL_ARB_copy_buffer () +{ + GLboolean r = GL_FALSE; + + r = ((glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glCopyBufferSubData")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_copy_buffer */ + +#ifdef GL_ARB_copy_image + +static GLboolean _glewInit_GL_ARB_copy_image () +{ + GLboolean r = GL_FALSE; + + r = ((glCopyImageSubData = (PFNGLCOPYIMAGESUBDATAPROC)glewGetProcAddress((const GLubyte*)"glCopyImageSubData")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_copy_image */ + +#ifdef GL_ARB_debug_output + +static GLboolean _glewInit_GL_ARB_debug_output () +{ + GLboolean r = GL_FALSE; + + r = ((glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallbackARB")) == NULL) || r; + r = ((glDebugMessageControlARB = (PFNGLDEBUGMESSAGECONTROLARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageControlARB")) == NULL) || r; + r = ((glDebugMessageInsertARB = (PFNGLDEBUGMESSAGEINSERTARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsertARB")) == NULL) || r; + r = ((glGetDebugMessageLogARB = (PFNGLGETDEBUGMESSAGELOGARBPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLogARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_debug_output */ + +#ifdef GL_ARB_direct_state_access + +static GLboolean _glewInit_GL_ARB_direct_state_access () +{ + GLboolean r = GL_FALSE; + + r = ((glBindTextureUnit = (PFNGLBINDTEXTUREUNITPROC)glewGetProcAddress((const GLubyte*)"glBindTextureUnit")) == NULL) || r; + r = ((glBlitNamedFramebuffer = (PFNGLBLITNAMEDFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBlitNamedFramebuffer")) == NULL) || r; + r = ((glCheckNamedFramebufferStatus = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC)glewGetProcAddress((const GLubyte*)"glCheckNamedFramebufferStatus")) == NULL) || r; + r = ((glClearNamedBufferData = (PFNGLCLEARNAMEDBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferData")) == NULL) || r; + r = ((glClearNamedBufferSubData = (PFNGLCLEARNAMEDBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferSubData")) == NULL) || r; + r = ((glClearNamedFramebufferfi = (PFNGLCLEARNAMEDFRAMEBUFFERFIPROC)glewGetProcAddress((const GLubyte*)"glClearNamedFramebufferfi")) == NULL) || r; + r = ((glClearNamedFramebufferfv = (PFNGLCLEARNAMEDFRAMEBUFFERFVPROC)glewGetProcAddress((const GLubyte*)"glClearNamedFramebufferfv")) == NULL) || r; + r = ((glClearNamedFramebufferiv = (PFNGLCLEARNAMEDFRAMEBUFFERIVPROC)glewGetProcAddress((const GLubyte*)"glClearNamedFramebufferiv")) == NULL) || r; + r = ((glClearNamedFramebufferuiv = (PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC)glewGetProcAddress((const GLubyte*)"glClearNamedFramebufferuiv")) == NULL) || r; + r = ((glCompressedTextureSubImage1D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage1D")) == NULL) || r; + r = ((glCompressedTextureSubImage2D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage2D")) == NULL) || r; + r = ((glCompressedTextureSubImage3D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage3D")) == NULL) || r; + r = ((glCopyNamedBufferSubData = (PFNGLCOPYNAMEDBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glCopyNamedBufferSubData")) == NULL) || r; + r = ((glCopyTextureSubImage1D = (PFNGLCOPYTEXTURESUBIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage1D")) == NULL) || r; + r = ((glCopyTextureSubImage2D = (PFNGLCOPYTEXTURESUBIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage2D")) == NULL) || r; + r = ((glCopyTextureSubImage3D = (PFNGLCOPYTEXTURESUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage3D")) == NULL) || r; + r = ((glCreateBuffers = (PFNGLCREATEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glCreateBuffers")) == NULL) || r; + r = ((glCreateFramebuffers = (PFNGLCREATEFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glCreateFramebuffers")) == NULL) || r; + r = ((glCreateProgramPipelines = (PFNGLCREATEPROGRAMPIPELINESPROC)glewGetProcAddress((const GLubyte*)"glCreateProgramPipelines")) == NULL) || r; + r = ((glCreateQueries = (PFNGLCREATEQUERIESPROC)glewGetProcAddress((const GLubyte*)"glCreateQueries")) == NULL) || r; + r = ((glCreateRenderbuffers = (PFNGLCREATERENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glCreateRenderbuffers")) == NULL) || r; + r = ((glCreateSamplers = (PFNGLCREATESAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glCreateSamplers")) == NULL) || r; + r = ((glCreateTextures = (PFNGLCREATETEXTURESPROC)glewGetProcAddress((const GLubyte*)"glCreateTextures")) == NULL) || r; + r = ((glCreateTransformFeedbacks = (PFNGLCREATETRANSFORMFEEDBACKSPROC)glewGetProcAddress((const GLubyte*)"glCreateTransformFeedbacks")) == NULL) || r; + r = ((glCreateVertexArrays = (PFNGLCREATEVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glCreateVertexArrays")) == NULL) || r; + r = ((glDisableVertexArrayAttrib = (PFNGLDISABLEVERTEXARRAYATTRIBPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexArrayAttrib")) == NULL) || r; + r = ((glEnableVertexArrayAttrib = (PFNGLENABLEVERTEXARRAYATTRIBPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexArrayAttrib")) == NULL) || r; + r = ((glFlushMappedNamedBufferRange = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedNamedBufferRange")) == NULL) || r; + r = ((glGenerateTextureMipmap = (PFNGLGENERATETEXTUREMIPMAPPROC)glewGetProcAddress((const GLubyte*)"glGenerateTextureMipmap")) == NULL) || r; + r = ((glGetCompressedTextureImage = (PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTextureImage")) == NULL) || r; + r = ((glGetNamedBufferParameteri64v = (PFNGLGETNAMEDBUFFERPARAMETERI64VPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameteri64v")) == NULL) || r; + r = ((glGetNamedBufferParameteriv = (PFNGLGETNAMEDBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameteriv")) == NULL) || r; + r = ((glGetNamedBufferPointerv = (PFNGLGETNAMEDBUFFERPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferPointerv")) == NULL) || r; + r = ((glGetNamedBufferSubData = (PFNGLGETNAMEDBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferSubData")) == NULL) || r; + r = ((glGetNamedFramebufferAttachmentParameteriv = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferAttachmentParameteriv")) == NULL) || r; + r = ((glGetNamedFramebufferParameteriv = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferParameteriv")) == NULL) || r; + r = ((glGetNamedRenderbufferParameteriv = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedRenderbufferParameteriv")) == NULL) || r; + r = ((glGetQueryBufferObjecti64v = (PFNGLGETQUERYBUFFEROBJECTI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryBufferObjecti64v")) == NULL) || r; + r = ((glGetQueryBufferObjectiv = (PFNGLGETQUERYBUFFEROBJECTIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryBufferObjectiv")) == NULL) || r; + r = ((glGetQueryBufferObjectui64v = (PFNGLGETQUERYBUFFEROBJECTUI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryBufferObjectui64v")) == NULL) || r; + r = ((glGetQueryBufferObjectuiv = (PFNGLGETQUERYBUFFEROBJECTUIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryBufferObjectuiv")) == NULL) || r; + r = ((glGetTextureImage = (PFNGLGETTEXTUREIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetTextureImage")) == NULL) || r; + r = ((glGetTextureLevelParameterfv = (PFNGLGETTEXTURELEVELPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterfv")) == NULL) || r; + r = ((glGetTextureLevelParameteriv = (PFNGLGETTEXTURELEVELPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameteriv")) == NULL) || r; + r = ((glGetTextureParameterIiv = (PFNGLGETTEXTUREPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIiv")) == NULL) || r; + r = ((glGetTextureParameterIuiv = (PFNGLGETTEXTUREPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIuiv")) == NULL) || r; + r = ((glGetTextureParameterfv = (PFNGLGETTEXTUREPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterfv")) == NULL) || r; + r = ((glGetTextureParameteriv = (PFNGLGETTEXTUREPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameteriv")) == NULL) || r; + r = ((glGetTransformFeedbacki64_v = (PFNGLGETTRANSFORMFEEDBACKI64_VPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbacki64_v")) == NULL) || r; + r = ((glGetTransformFeedbacki_v = (PFNGLGETTRANSFORMFEEDBACKI_VPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbacki_v")) == NULL) || r; + r = ((glGetTransformFeedbackiv = (PFNGLGETTRANSFORMFEEDBACKIVPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackiv")) == NULL) || r; + r = ((glGetVertexArrayIndexed64iv = (PFNGLGETVERTEXARRAYINDEXED64IVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIndexed64iv")) == NULL) || r; + r = ((glGetVertexArrayIndexediv = (PFNGLGETVERTEXARRAYINDEXEDIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIndexediv")) == NULL) || r; + r = ((glGetVertexArrayiv = (PFNGLGETVERTEXARRAYIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayiv")) == NULL) || r; + r = ((glInvalidateNamedFramebufferData = (PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateNamedFramebufferData")) == NULL) || r; + r = ((glInvalidateNamedFramebufferSubData = (PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateNamedFramebufferSubData")) == NULL) || r; + r = ((glMapNamedBuffer = (PFNGLMAPNAMEDBUFFERPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBuffer")) == NULL) || r; + r = ((glMapNamedBufferRange = (PFNGLMAPNAMEDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBufferRange")) == NULL) || r; + r = ((glNamedBufferData = (PFNGLNAMEDBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferData")) == NULL) || r; + r = ((glNamedBufferStorage = (PFNGLNAMEDBUFFERSTORAGEPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferStorage")) == NULL) || r; + r = ((glNamedBufferSubData = (PFNGLNAMEDBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferSubData")) == NULL) || r; + r = ((glNamedFramebufferDrawBuffer = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferDrawBuffer")) == NULL) || r; + r = ((glNamedFramebufferDrawBuffers = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferDrawBuffers")) == NULL) || r; + r = ((glNamedFramebufferParameteri = (PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferParameteri")) == NULL) || r; + r = ((glNamedFramebufferReadBuffer = (PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferReadBuffer")) == NULL) || r; + r = ((glNamedFramebufferRenderbuffer = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferRenderbuffer")) == NULL) || r; + r = ((glNamedFramebufferTexture = (PFNGLNAMEDFRAMEBUFFERTEXTUREPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture")) == NULL) || r; + r = ((glNamedFramebufferTextureLayer = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureLayer")) == NULL) || r; + r = ((glNamedRenderbufferStorage = (PFNGLNAMEDRENDERBUFFERSTORAGEPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorage")) == NULL) || r; + r = ((glNamedRenderbufferStorageMultisample = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisample")) == NULL) || r; + r = ((glTextureBuffer = (PFNGLTEXTUREBUFFERPROC)glewGetProcAddress((const GLubyte*)"glTextureBuffer")) == NULL) || r; + r = ((glTextureBufferRange = (PFNGLTEXTUREBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glTextureBufferRange")) == NULL) || r; + r = ((glTextureParameterIiv = (PFNGLTEXTUREPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIiv")) == NULL) || r; + r = ((glTextureParameterIuiv = (PFNGLTEXTUREPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIuiv")) == NULL) || r; + r = ((glTextureParameterf = (PFNGLTEXTUREPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterf")) == NULL) || r; + r = ((glTextureParameterfv = (PFNGLTEXTUREPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfv")) == NULL) || r; + r = ((glTextureParameteri = (PFNGLTEXTUREPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glTextureParameteri")) == NULL) || r; + r = ((glTextureParameteriv = (PFNGLTEXTUREPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glTextureParameteriv")) == NULL) || r; + r = ((glTextureStorage1D = (PFNGLTEXTURESTORAGE1DPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage1D")) == NULL) || r; + r = ((glTextureStorage2D = (PFNGLTEXTURESTORAGE2DPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2D")) == NULL) || r; + r = ((glTextureStorage2DMultisample = (PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2DMultisample")) == NULL) || r; + r = ((glTextureStorage3D = (PFNGLTEXTURESTORAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3D")) == NULL) || r; + r = ((glTextureStorage3DMultisample = (PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3DMultisample")) == NULL) || r; + r = ((glTextureSubImage1D = (PFNGLTEXTURESUBIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage1D")) == NULL) || r; + r = ((glTextureSubImage2D = (PFNGLTEXTURESUBIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage2D")) == NULL) || r; + r = ((glTextureSubImage3D = (PFNGLTEXTURESUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage3D")) == NULL) || r; + r = ((glTransformFeedbackBufferBase = (PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackBufferBase")) == NULL) || r; + r = ((glTransformFeedbackBufferRange = (PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackBufferRange")) == NULL) || r; + r = ((glUnmapNamedBuffer = (PFNGLUNMAPNAMEDBUFFERPROC)glewGetProcAddress((const GLubyte*)"glUnmapNamedBuffer")) == NULL) || r; + r = ((glVertexArrayAttribBinding = (PFNGLVERTEXARRAYATTRIBBINDINGPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayAttribBinding")) == NULL) || r; + r = ((glVertexArrayAttribFormat = (PFNGLVERTEXARRAYATTRIBFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayAttribFormat")) == NULL) || r; + r = ((glVertexArrayAttribIFormat = (PFNGLVERTEXARRAYATTRIBIFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayAttribIFormat")) == NULL) || r; + r = ((glVertexArrayAttribLFormat = (PFNGLVERTEXARRAYATTRIBLFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayAttribLFormat")) == NULL) || r; + r = ((glVertexArrayBindingDivisor = (PFNGLVERTEXARRAYBINDINGDIVISORPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayBindingDivisor")) == NULL) || r; + r = ((glVertexArrayElementBuffer = (PFNGLVERTEXARRAYELEMENTBUFFERPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayElementBuffer")) == NULL) || r; + r = ((glVertexArrayVertexBuffer = (PFNGLVERTEXARRAYVERTEXBUFFERPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexBuffer")) == NULL) || r; + r = ((glVertexArrayVertexBuffers = (PFNGLVERTEXARRAYVERTEXBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexBuffers")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_direct_state_access */ #ifdef GL_ARB_draw_buffers -static GLboolean _glewInit_GL_ARB_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ARB_draw_buffers () { GLboolean r = GL_FALSE; @@ -2294,25 +10527,239 @@ static GLboolean _glewInit_GL_ARB_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_ARB_draw_buffers */ -#ifdef GL_ARB_fragment_program +#ifdef GL_ARB_draw_buffers_blend -#endif /* GL_ARB_fragment_program */ +static GLboolean _glewInit_GL_ARB_draw_buffers_blend () +{ + GLboolean r = GL_FALSE; -#ifdef GL_ARB_fragment_program_shadow + r = ((glBlendEquationSeparateiARB = (PFNGLBLENDEQUATIONSEPARATEIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateiARB")) == NULL) || r; + r = ((glBlendEquationiARB = (PFNGLBLENDEQUATIONIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationiARB")) == NULL) || r; + r = ((glBlendFuncSeparateiARB = (PFNGLBLENDFUNCSEPARATEIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateiARB")) == NULL) || r; + r = ((glBlendFunciARB = (PFNGLBLENDFUNCIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendFunciARB")) == NULL) || r; -#endif /* GL_ARB_fragment_program_shadow */ + return r; +} -#ifdef GL_ARB_fragment_shader +#endif /* GL_ARB_draw_buffers_blend */ -#endif /* GL_ARB_fragment_shader */ +#ifdef GL_ARB_draw_elements_base_vertex -#ifdef GL_ARB_half_float_pixel +static GLboolean _glewInit_GL_ARB_draw_elements_base_vertex () +{ + GLboolean r = GL_FALSE; -#endif /* GL_ARB_half_float_pixel */ + r = ((glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsBaseVertex")) == NULL) || r; + r = ((glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseVertex")) == NULL) || r; + r = ((glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementsBaseVertex")) == NULL) || r; + r = ((glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsBaseVertex")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_draw_elements_base_vertex */ + +#ifdef GL_ARB_draw_indirect + +static GLboolean _glewInit_GL_ARB_draw_indirect () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysIndirect = (PFNGLDRAWARRAYSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysIndirect")) == NULL) || r; + r = ((glDrawElementsIndirect = (PFNGLDRAWELEMENTSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsIndirect")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_draw_indirect */ + +#ifdef GL_ARB_framebuffer_no_attachments + +static GLboolean _glewInit_GL_ARB_framebuffer_no_attachments () +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferParameteri = (PFNGLFRAMEBUFFERPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glFramebufferParameteri")) == NULL) || r; + r = ((glGetFramebufferParameteriv = (PFNGLGETFRAMEBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferParameteriv")) == NULL) || r; + r = ((glGetNamedFramebufferParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferParameterivEXT")) == NULL) || r; + r = ((glNamedFramebufferParameteriEXT = (PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferParameteriEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_framebuffer_no_attachments */ + +#ifdef GL_ARB_framebuffer_object + +static GLboolean _glewInit_GL_ARB_framebuffer_object () +{ + GLboolean r = GL_FALSE; + + r = ((glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindFramebuffer")) == NULL) || r; + r = ((glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindRenderbuffer")) == NULL) || r; + r = ((glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebuffer")) == NULL) || r; + r = ((glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)glewGetProcAddress((const GLubyte*)"glCheckFramebufferStatus")) == NULL) || r; + r = ((glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteFramebuffers")) == NULL) || r; + r = ((glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteRenderbuffers")) == NULL) || r; + r = ((glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferRenderbuffer")) == NULL) || r; + r = ((glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture1D")) == NULL) || r; + r = ((glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2D")) == NULL) || r; + r = ((glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture3D")) == NULL) || r; + r = ((glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayer")) == NULL) || r; + r = ((glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenFramebuffers")) == NULL) || r; + r = ((glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenRenderbuffers")) == NULL) || r; + r = ((glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)glewGetProcAddress((const GLubyte*)"glGenerateMipmap")) == NULL) || r; + r = ((glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferAttachmentParameteriv")) == NULL) || r; + r = ((glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetRenderbufferParameteriv")) == NULL) || r; + r = ((glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsFramebuffer")) == NULL) || r; + r = ((glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsRenderbuffer")) == NULL) || r; + r = ((glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorage")) == NULL) || r; + r = ((glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisample")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_framebuffer_object */ + +#ifdef GL_ARB_geometry_shader4 + +static GLboolean _glewInit_GL_ARB_geometry_shader4 () +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferTextureARB = (PFNGLFRAMEBUFFERTEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureARB")) == NULL) || r; + r = ((glFramebufferTextureFaceARB = (PFNGLFRAMEBUFFERTEXTUREFACEARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureFaceARB")) == NULL) || r; + r = ((glFramebufferTextureLayerARB = (PFNGLFRAMEBUFFERTEXTURELAYERARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayerARB")) == NULL) || r; + r = ((glProgramParameteriARB = (PFNGLPROGRAMPARAMETERIARBPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteriARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_geometry_shader4 */ + +#ifdef GL_ARB_get_program_binary + +static GLboolean _glewInit_GL_ARB_get_program_binary () +{ + GLboolean r = GL_FALSE; + + r = ((glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC)glewGetProcAddress((const GLubyte*)"glGetProgramBinary")) == NULL) || r; + r = ((glProgramBinary = (PFNGLPROGRAMBINARYPROC)glewGetProcAddress((const GLubyte*)"glProgramBinary")) == NULL) || r; + r = ((glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteri")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_get_program_binary */ + +#ifdef GL_ARB_get_texture_sub_image + +static GLboolean _glewInit_GL_ARB_get_texture_sub_image () +{ + GLboolean r = GL_FALSE; + + r = ((glGetCompressedTextureSubImage = (PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTextureSubImage")) == NULL) || r; + r = ((glGetTextureSubImage = (PFNGLGETTEXTURESUBIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetTextureSubImage")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_get_texture_sub_image */ + +#ifdef GL_ARB_gl_spirv + +static GLboolean _glewInit_GL_ARB_gl_spirv () +{ + GLboolean r = GL_FALSE; + + r = ((glSpecializeShaderARB = (PFNGLSPECIALIZESHADERARBPROC)glewGetProcAddress((const GLubyte*)"glSpecializeShaderARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_gl_spirv */ + +#ifdef GL_ARB_gpu_shader_fp64 + +static GLboolean _glewInit_GL_ARB_gpu_shader_fp64 () +{ + GLboolean r = GL_FALSE; + + r = ((glGetUniformdv = (PFNGLGETUNIFORMDVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformdv")) == NULL) || r; + r = ((glUniform1d = (PFNGLUNIFORM1DPROC)glewGetProcAddress((const GLubyte*)"glUniform1d")) == NULL) || r; + r = ((glUniform1dv = (PFNGLUNIFORM1DVPROC)glewGetProcAddress((const GLubyte*)"glUniform1dv")) == NULL) || r; + r = ((glUniform2d = (PFNGLUNIFORM2DPROC)glewGetProcAddress((const GLubyte*)"glUniform2d")) == NULL) || r; + r = ((glUniform2dv = (PFNGLUNIFORM2DVPROC)glewGetProcAddress((const GLubyte*)"glUniform2dv")) == NULL) || r; + r = ((glUniform3d = (PFNGLUNIFORM3DPROC)glewGetProcAddress((const GLubyte*)"glUniform3d")) == NULL) || r; + r = ((glUniform3dv = (PFNGLUNIFORM3DVPROC)glewGetProcAddress((const GLubyte*)"glUniform3dv")) == NULL) || r; + r = ((glUniform4d = (PFNGLUNIFORM4DPROC)glewGetProcAddress((const GLubyte*)"glUniform4d")) == NULL) || r; + r = ((glUniform4dv = (PFNGLUNIFORM4DVPROC)glewGetProcAddress((const GLubyte*)"glUniform4dv")) == NULL) || r; + r = ((glUniformMatrix2dv = (PFNGLUNIFORMMATRIX2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2dv")) == NULL) || r; + r = ((glUniformMatrix2x3dv = (PFNGLUNIFORMMATRIX2X3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x3dv")) == NULL) || r; + r = ((glUniformMatrix2x4dv = (PFNGLUNIFORMMATRIX2X4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x4dv")) == NULL) || r; + r = ((glUniformMatrix3dv = (PFNGLUNIFORMMATRIX3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3dv")) == NULL) || r; + r = ((glUniformMatrix3x2dv = (PFNGLUNIFORMMATRIX3X2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x2dv")) == NULL) || r; + r = ((glUniformMatrix3x4dv = (PFNGLUNIFORMMATRIX3X4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x4dv")) == NULL) || r; + r = ((glUniformMatrix4dv = (PFNGLUNIFORMMATRIX4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4dv")) == NULL) || r; + r = ((glUniformMatrix4x2dv = (PFNGLUNIFORMMATRIX4X2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x2dv")) == NULL) || r; + r = ((glUniformMatrix4x3dv = (PFNGLUNIFORMMATRIX4X3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x3dv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_gpu_shader_fp64 */ + +#ifdef GL_ARB_gpu_shader_int64 + +static GLboolean _glewInit_GL_ARB_gpu_shader_int64 () +{ + GLboolean r = GL_FALSE; + + r = ((glGetUniformi64vARB = (PFNGLGETUNIFORMI64VARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformi64vARB")) == NULL) || r; + r = ((glGetUniformui64vARB = (PFNGLGETUNIFORMUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformui64vARB")) == NULL) || r; + r = ((glGetnUniformi64vARB = (PFNGLGETNUNIFORMI64VARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformi64vARB")) == NULL) || r; + r = ((glGetnUniformui64vARB = (PFNGLGETNUNIFORMUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformui64vARB")) == NULL) || r; + r = ((glProgramUniform1i64ARB = (PFNGLPROGRAMUNIFORM1I64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64ARB")) == NULL) || r; + r = ((glProgramUniform1i64vARB = (PFNGLPROGRAMUNIFORM1I64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64vARB")) == NULL) || r; + r = ((glProgramUniform1ui64ARB = (PFNGLPROGRAMUNIFORM1UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64ARB")) == NULL) || r; + r = ((glProgramUniform1ui64vARB = (PFNGLPROGRAMUNIFORM1UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64vARB")) == NULL) || r; + r = ((glProgramUniform2i64ARB = (PFNGLPROGRAMUNIFORM2I64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64ARB")) == NULL) || r; + r = ((glProgramUniform2i64vARB = (PFNGLPROGRAMUNIFORM2I64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64vARB")) == NULL) || r; + r = ((glProgramUniform2ui64ARB = (PFNGLPROGRAMUNIFORM2UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64ARB")) == NULL) || r; + r = ((glProgramUniform2ui64vARB = (PFNGLPROGRAMUNIFORM2UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64vARB")) == NULL) || r; + r = ((glProgramUniform3i64ARB = (PFNGLPROGRAMUNIFORM3I64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64ARB")) == NULL) || r; + r = ((glProgramUniform3i64vARB = (PFNGLPROGRAMUNIFORM3I64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64vARB")) == NULL) || r; + r = ((glProgramUniform3ui64ARB = (PFNGLPROGRAMUNIFORM3UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64ARB")) == NULL) || r; + r = ((glProgramUniform3ui64vARB = (PFNGLPROGRAMUNIFORM3UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64vARB")) == NULL) || r; + r = ((glProgramUniform4i64ARB = (PFNGLPROGRAMUNIFORM4I64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64ARB")) == NULL) || r; + r = ((glProgramUniform4i64vARB = (PFNGLPROGRAMUNIFORM4I64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64vARB")) == NULL) || r; + r = ((glProgramUniform4ui64ARB = (PFNGLPROGRAMUNIFORM4UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64ARB")) == NULL) || r; + r = ((glProgramUniform4ui64vARB = (PFNGLPROGRAMUNIFORM4UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64vARB")) == NULL) || r; + r = ((glUniform1i64ARB = (PFNGLUNIFORM1I64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64ARB")) == NULL) || r; + r = ((glUniform1i64vARB = (PFNGLUNIFORM1I64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64vARB")) == NULL) || r; + r = ((glUniform1ui64ARB = (PFNGLUNIFORM1UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64ARB")) == NULL) || r; + r = ((glUniform1ui64vARB = (PFNGLUNIFORM1UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64vARB")) == NULL) || r; + r = ((glUniform2i64ARB = (PFNGLUNIFORM2I64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64ARB")) == NULL) || r; + r = ((glUniform2i64vARB = (PFNGLUNIFORM2I64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64vARB")) == NULL) || r; + r = ((glUniform2ui64ARB = (PFNGLUNIFORM2UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64ARB")) == NULL) || r; + r = ((glUniform2ui64vARB = (PFNGLUNIFORM2UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64vARB")) == NULL) || r; + r = ((glUniform3i64ARB = (PFNGLUNIFORM3I64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64ARB")) == NULL) || r; + r = ((glUniform3i64vARB = (PFNGLUNIFORM3I64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64vARB")) == NULL) || r; + r = ((glUniform3ui64ARB = (PFNGLUNIFORM3UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64ARB")) == NULL) || r; + r = ((glUniform3ui64vARB = (PFNGLUNIFORM3UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64vARB")) == NULL) || r; + r = ((glUniform4i64ARB = (PFNGLUNIFORM4I64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64ARB")) == NULL) || r; + r = ((glUniform4i64vARB = (PFNGLUNIFORM4I64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64vARB")) == NULL) || r; + r = ((glUniform4ui64ARB = (PFNGLUNIFORM4UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64ARB")) == NULL) || r; + r = ((glUniform4ui64vARB = (PFNGLUNIFORM4UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64vARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_gpu_shader_int64 */ #ifdef GL_ARB_imaging -static GLboolean _glewInit_GL_ARB_imaging (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ARB_imaging () { GLboolean r = GL_FALSE; @@ -2355,9 +10802,96 @@ static GLboolean _glewInit_GL_ARB_imaging (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_ARB_imaging */ +#ifdef GL_ARB_indirect_parameters + +static GLboolean _glewInit_GL_ARB_indirect_parameters () +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysIndirectCountARB = (PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectCountARB")) == NULL) || r; + r = ((glMultiDrawElementsIndirectCountARB = (PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectCountARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_indirect_parameters */ + +#ifdef GL_ARB_instanced_arrays + +static GLboolean _glewInit_GL_ARB_instanced_arrays () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstancedARB = (PFNGLDRAWARRAYSINSTANCEDARBPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedARB")) == NULL) || r; + r = ((glDrawElementsInstancedARB = (PFNGLDRAWELEMENTSINSTANCEDARBPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedARB")) == NULL) || r; + r = ((glVertexAttribDivisorARB = (PFNGLVERTEXATTRIBDIVISORARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisorARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_instanced_arrays */ + +#ifdef GL_ARB_internalformat_query + +static GLboolean _glewInit_GL_ARB_internalformat_query () +{ + GLboolean r = GL_FALSE; + + r = ((glGetInternalformativ = (PFNGLGETINTERNALFORMATIVPROC)glewGetProcAddress((const GLubyte*)"glGetInternalformativ")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_internalformat_query */ + +#ifdef GL_ARB_internalformat_query2 + +static GLboolean _glewInit_GL_ARB_internalformat_query2 () +{ + GLboolean r = GL_FALSE; + + r = ((glGetInternalformati64v = (PFNGLGETINTERNALFORMATI64VPROC)glewGetProcAddress((const GLubyte*)"glGetInternalformati64v")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_internalformat_query2 */ + +#ifdef GL_ARB_invalidate_subdata + +static GLboolean _glewInit_GL_ARB_invalidate_subdata () +{ + GLboolean r = GL_FALSE; + + r = ((glInvalidateBufferData = (PFNGLINVALIDATEBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateBufferData")) == NULL) || r; + r = ((glInvalidateBufferSubData = (PFNGLINVALIDATEBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateBufferSubData")) == NULL) || r; + r = ((glInvalidateFramebuffer = (PFNGLINVALIDATEFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glInvalidateFramebuffer")) == NULL) || r; + r = ((glInvalidateSubFramebuffer = (PFNGLINVALIDATESUBFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glInvalidateSubFramebuffer")) == NULL) || r; + r = ((glInvalidateTexImage = (PFNGLINVALIDATETEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glInvalidateTexImage")) == NULL) || r; + r = ((glInvalidateTexSubImage = (PFNGLINVALIDATETEXSUBIMAGEPROC)glewGetProcAddress((const GLubyte*)"glInvalidateTexSubImage")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_invalidate_subdata */ + +#ifdef GL_ARB_map_buffer_range + +static GLboolean _glewInit_GL_ARB_map_buffer_range () +{ + GLboolean r = GL_FALSE; + + r = ((glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedBufferRange")) == NULL) || r; + r = ((glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glMapBufferRange")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_map_buffer_range */ + #ifdef GL_ARB_matrix_palette -static GLboolean _glewInit_GL_ARB_matrix_palette (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ARB_matrix_palette () { GLboolean r = GL_FALSE; @@ -2372,9 +10906,41 @@ static GLboolean _glewInit_GL_ARB_matrix_palette (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_ARB_matrix_palette */ +#ifdef GL_ARB_multi_bind + +static GLboolean _glewInit_GL_ARB_multi_bind () +{ + GLboolean r = GL_FALSE; + + r = ((glBindBuffersBase = (PFNGLBINDBUFFERSBASEPROC)glewGetProcAddress((const GLubyte*)"glBindBuffersBase")) == NULL) || r; + r = ((glBindBuffersRange = (PFNGLBINDBUFFERSRANGEPROC)glewGetProcAddress((const GLubyte*)"glBindBuffersRange")) == NULL) || r; + r = ((glBindImageTextures = (PFNGLBINDIMAGETEXTURESPROC)glewGetProcAddress((const GLubyte*)"glBindImageTextures")) == NULL) || r; + r = ((glBindSamplers = (PFNGLBINDSAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glBindSamplers")) == NULL) || r; + r = ((glBindTextures = (PFNGLBINDTEXTURESPROC)glewGetProcAddress((const GLubyte*)"glBindTextures")) == NULL) || r; + r = ((glBindVertexBuffers = (PFNGLBINDVERTEXBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glBindVertexBuffers")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_multi_bind */ + +#ifdef GL_ARB_multi_draw_indirect + +static GLboolean _glewInit_GL_ARB_multi_draw_indirect () +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysIndirect = (PFNGLMULTIDRAWARRAYSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirect")) == NULL) || r; + r = ((glMultiDrawElementsIndirect = (PFNGLMULTIDRAWELEMENTSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirect")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_multi_draw_indirect */ + #ifdef GL_ARB_multisample -static GLboolean _glewInit_GL_ARB_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ARB_multisample () { GLboolean r = GL_FALSE; @@ -2387,7 +10953,7 @@ static GLboolean _glewInit_GL_ARB_multisample (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_ARB_multitexture -static GLboolean _glewInit_GL_ARB_multitexture (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ARB_multitexture () { GLboolean r = GL_FALSE; @@ -2433,7 +10999,7 @@ static GLboolean _glewInit_GL_ARB_multitexture (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_ARB_occlusion_query -static GLboolean _glewInit_GL_ARB_occlusion_query (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ARB_occlusion_query () { GLboolean r = GL_FALSE; @@ -2451,13 +11017,22 @@ static GLboolean _glewInit_GL_ARB_occlusion_query (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_ARB_occlusion_query */ -#ifdef GL_ARB_pixel_buffer_object +#ifdef GL_ARB_parallel_shader_compile -#endif /* GL_ARB_pixel_buffer_object */ +static GLboolean _glewInit_GL_ARB_parallel_shader_compile () +{ + GLboolean r = GL_FALSE; + + r = ((glMaxShaderCompilerThreadsARB = (PFNGLMAXSHADERCOMPILERTHREADSARBPROC)glewGetProcAddress((const GLubyte*)"glMaxShaderCompilerThreadsARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_parallel_shader_compile */ #ifdef GL_ARB_point_parameters -static GLboolean _glewInit_GL_ARB_point_parameters (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ARB_point_parameters () { GLboolean r = GL_FALSE; @@ -2469,13 +11044,237 @@ static GLboolean _glewInit_GL_ARB_point_parameters (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_ARB_point_parameters */ -#ifdef GL_ARB_point_sprite +#ifdef GL_ARB_polygon_offset_clamp -#endif /* GL_ARB_point_sprite */ +static GLboolean _glewInit_GL_ARB_polygon_offset_clamp () +{ + GLboolean r = GL_FALSE; + + r = ((glPolygonOffsetClamp = (PFNGLPOLYGONOFFSETCLAMPPROC)glewGetProcAddress((const GLubyte*)"glPolygonOffsetClamp")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_polygon_offset_clamp */ + +#ifdef GL_ARB_program_interface_query + +static GLboolean _glewInit_GL_ARB_program_interface_query () +{ + GLboolean r = GL_FALSE; + + r = ((glGetProgramInterfaceiv = (PFNGLGETPROGRAMINTERFACEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramInterfaceiv")) == NULL) || r; + r = ((glGetProgramResourceIndex = (PFNGLGETPROGRAMRESOURCEINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceIndex")) == NULL) || r; + r = ((glGetProgramResourceLocation = (PFNGLGETPROGRAMRESOURCELOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceLocation")) == NULL) || r; + r = ((glGetProgramResourceLocationIndex = (PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceLocationIndex")) == NULL) || r; + r = ((glGetProgramResourceName = (PFNGLGETPROGRAMRESOURCENAMEPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceName")) == NULL) || r; + r = ((glGetProgramResourceiv = (PFNGLGETPROGRAMRESOURCEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceiv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_program_interface_query */ + +#ifdef GL_ARB_provoking_vertex + +static GLboolean _glewInit_GL_ARB_provoking_vertex () +{ + GLboolean r = GL_FALSE; + + r = ((glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)glewGetProcAddress((const GLubyte*)"glProvokingVertex")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_provoking_vertex */ + +#ifdef GL_ARB_robustness + +static GLboolean _glewInit_GL_ARB_robustness () +{ + GLboolean r = GL_FALSE; + + r = ((glGetGraphicsResetStatusARB = (PFNGLGETGRAPHICSRESETSTATUSARBPROC)glewGetProcAddress((const GLubyte*)"glGetGraphicsResetStatusARB")) == NULL) || r; + r = ((glGetnColorTableARB = (PFNGLGETNCOLORTABLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnColorTableARB")) == NULL) || r; + r = ((glGetnCompressedTexImageARB = (PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnCompressedTexImageARB")) == NULL) || r; + r = ((glGetnConvolutionFilterARB = (PFNGLGETNCONVOLUTIONFILTERARBPROC)glewGetProcAddress((const GLubyte*)"glGetnConvolutionFilterARB")) == NULL) || r; + r = ((glGetnHistogramARB = (PFNGLGETNHISTOGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glGetnHistogramARB")) == NULL) || r; + r = ((glGetnMapdvARB = (PFNGLGETNMAPDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapdvARB")) == NULL) || r; + r = ((glGetnMapfvARB = (PFNGLGETNMAPFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapfvARB")) == NULL) || r; + r = ((glGetnMapivARB = (PFNGLGETNMAPIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapivARB")) == NULL) || r; + r = ((glGetnMinmaxARB = (PFNGLGETNMINMAXARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMinmaxARB")) == NULL) || r; + r = ((glGetnPixelMapfvARB = (PFNGLGETNPIXELMAPFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapfvARB")) == NULL) || r; + r = ((glGetnPixelMapuivARB = (PFNGLGETNPIXELMAPUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapuivARB")) == NULL) || r; + r = ((glGetnPixelMapusvARB = (PFNGLGETNPIXELMAPUSVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapusvARB")) == NULL) || r; + r = ((glGetnPolygonStippleARB = (PFNGLGETNPOLYGONSTIPPLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPolygonStippleARB")) == NULL) || r; + r = ((glGetnSeparableFilterARB = (PFNGLGETNSEPARABLEFILTERARBPROC)glewGetProcAddress((const GLubyte*)"glGetnSeparableFilterARB")) == NULL) || r; + r = ((glGetnTexImageARB = (PFNGLGETNTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnTexImageARB")) == NULL) || r; + r = ((glGetnUniformdvARB = (PFNGLGETNUNIFORMDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformdvARB")) == NULL) || r; + r = ((glGetnUniformfvARB = (PFNGLGETNUNIFORMFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformfvARB")) == NULL) || r; + r = ((glGetnUniformivARB = (PFNGLGETNUNIFORMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformivARB")) == NULL) || r; + r = ((glGetnUniformuivARB = (PFNGLGETNUNIFORMUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformuivARB")) == NULL) || r; + r = ((glReadnPixelsARB = (PFNGLREADNPIXELSARBPROC)glewGetProcAddress((const GLubyte*)"glReadnPixelsARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_robustness */ + +#ifdef GL_ARB_sample_locations + +static GLboolean _glewInit_GL_ARB_sample_locations () +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferSampleLocationsfvARB = (PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferSampleLocationsfvARB")) == NULL) || r; + r = ((glNamedFramebufferSampleLocationsfvARB = (PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferSampleLocationsfvARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_sample_locations */ + +#ifdef GL_ARB_sample_shading + +static GLboolean _glewInit_GL_ARB_sample_shading () +{ + GLboolean r = GL_FALSE; + + r = ((glMinSampleShadingARB = (PFNGLMINSAMPLESHADINGARBPROC)glewGetProcAddress((const GLubyte*)"glMinSampleShadingARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_sample_shading */ + +#ifdef GL_ARB_sampler_objects + +static GLboolean _glewInit_GL_ARB_sampler_objects () +{ + GLboolean r = GL_FALSE; + + r = ((glBindSampler = (PFNGLBINDSAMPLERPROC)glewGetProcAddress((const GLubyte*)"glBindSampler")) == NULL) || r; + r = ((glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteSamplers")) == NULL) || r; + r = ((glGenSamplers = (PFNGLGENSAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glGenSamplers")) == NULL) || r; + r = ((glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterIiv")) == NULL) || r; + r = ((glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterIuiv")) == NULL) || r; + r = ((glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterfv")) == NULL) || r; + r = ((glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameteriv")) == NULL) || r; + r = ((glIsSampler = (PFNGLISSAMPLERPROC)glewGetProcAddress((const GLubyte*)"glIsSampler")) == NULL) || r; + r = ((glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterIiv")) == NULL) || r; + r = ((glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterIuiv")) == NULL) || r; + r = ((glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterf")) == NULL) || r; + r = ((glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterfv")) == NULL) || r; + r = ((glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameteri")) == NULL) || r; + r = ((glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameteriv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_sampler_objects */ + +#ifdef GL_ARB_separate_shader_objects + +static GLboolean _glewInit_GL_ARB_separate_shader_objects () +{ + GLboolean r = GL_FALSE; + + r = ((glActiveShaderProgram = (PFNGLACTIVESHADERPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glActiveShaderProgram")) == NULL) || r; + r = ((glBindProgramPipeline = (PFNGLBINDPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glBindProgramPipeline")) == NULL) || r; + r = ((glCreateShaderProgramv = (PFNGLCREATESHADERPROGRAMVPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderProgramv")) == NULL) || r; + r = ((glDeleteProgramPipelines = (PFNGLDELETEPROGRAMPIPELINESPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramPipelines")) == NULL) || r; + r = ((glGenProgramPipelines = (PFNGLGENPROGRAMPIPELINESPROC)glewGetProcAddress((const GLubyte*)"glGenProgramPipelines")) == NULL) || r; + r = ((glGetProgramPipelineInfoLog = (PFNGLGETPROGRAMPIPELINEINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetProgramPipelineInfoLog")) == NULL) || r; + r = ((glGetProgramPipelineiv = (PFNGLGETPROGRAMPIPELINEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramPipelineiv")) == NULL) || r; + r = ((glIsProgramPipeline = (PFNGLISPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glIsProgramPipeline")) == NULL) || r; + r = ((glProgramUniform1d = (PFNGLPROGRAMUNIFORM1DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1d")) == NULL) || r; + r = ((glProgramUniform1dv = (PFNGLPROGRAMUNIFORM1DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1dv")) == NULL) || r; + r = ((glProgramUniform1f = (PFNGLPROGRAMUNIFORM1FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1f")) == NULL) || r; + r = ((glProgramUniform1fv = (PFNGLPROGRAMUNIFORM1FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fv")) == NULL) || r; + r = ((glProgramUniform1i = (PFNGLPROGRAMUNIFORM1IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i")) == NULL) || r; + r = ((glProgramUniform1iv = (PFNGLPROGRAMUNIFORM1IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1iv")) == NULL) || r; + r = ((glProgramUniform1ui = (PFNGLPROGRAMUNIFORM1UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui")) == NULL) || r; + r = ((glProgramUniform1uiv = (PFNGLPROGRAMUNIFORM1UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uiv")) == NULL) || r; + r = ((glProgramUniform2d = (PFNGLPROGRAMUNIFORM2DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2d")) == NULL) || r; + r = ((glProgramUniform2dv = (PFNGLPROGRAMUNIFORM2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2dv")) == NULL) || r; + r = ((glProgramUniform2f = (PFNGLPROGRAMUNIFORM2FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2f")) == NULL) || r; + r = ((glProgramUniform2fv = (PFNGLPROGRAMUNIFORM2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fv")) == NULL) || r; + r = ((glProgramUniform2i = (PFNGLPROGRAMUNIFORM2IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i")) == NULL) || r; + r = ((glProgramUniform2iv = (PFNGLPROGRAMUNIFORM2IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2iv")) == NULL) || r; + r = ((glProgramUniform2ui = (PFNGLPROGRAMUNIFORM2UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui")) == NULL) || r; + r = ((glProgramUniform2uiv = (PFNGLPROGRAMUNIFORM2UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uiv")) == NULL) || r; + r = ((glProgramUniform3d = (PFNGLPROGRAMUNIFORM3DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3d")) == NULL) || r; + r = ((glProgramUniform3dv = (PFNGLPROGRAMUNIFORM3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3dv")) == NULL) || r; + r = ((glProgramUniform3f = (PFNGLPROGRAMUNIFORM3FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3f")) == NULL) || r; + r = ((glProgramUniform3fv = (PFNGLPROGRAMUNIFORM3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fv")) == NULL) || r; + r = ((glProgramUniform3i = (PFNGLPROGRAMUNIFORM3IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i")) == NULL) || r; + r = ((glProgramUniform3iv = (PFNGLPROGRAMUNIFORM3IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3iv")) == NULL) || r; + r = ((glProgramUniform3ui = (PFNGLPROGRAMUNIFORM3UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui")) == NULL) || r; + r = ((glProgramUniform3uiv = (PFNGLPROGRAMUNIFORM3UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uiv")) == NULL) || r; + r = ((glProgramUniform4d = (PFNGLPROGRAMUNIFORM4DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4d")) == NULL) || r; + r = ((glProgramUniform4dv = (PFNGLPROGRAMUNIFORM4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4dv")) == NULL) || r; + r = ((glProgramUniform4f = (PFNGLPROGRAMUNIFORM4FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4f")) == NULL) || r; + r = ((glProgramUniform4fv = (PFNGLPROGRAMUNIFORM4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fv")) == NULL) || r; + r = ((glProgramUniform4i = (PFNGLPROGRAMUNIFORM4IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i")) == NULL) || r; + r = ((glProgramUniform4iv = (PFNGLPROGRAMUNIFORM4IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4iv")) == NULL) || r; + r = ((glProgramUniform4ui = (PFNGLPROGRAMUNIFORM4UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui")) == NULL) || r; + r = ((glProgramUniform4uiv = (PFNGLPROGRAMUNIFORM4UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uiv")) == NULL) || r; + r = ((glProgramUniformMatrix2dv = (PFNGLPROGRAMUNIFORMMATRIX2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2dv")) == NULL) || r; + r = ((glProgramUniformMatrix2fv = (PFNGLPROGRAMUNIFORMMATRIX2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2fv")) == NULL) || r; + r = ((glProgramUniformMatrix2x3dv = (PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3dv")) == NULL) || r; + r = ((glProgramUniformMatrix2x3fv = (PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3fv")) == NULL) || r; + r = ((glProgramUniformMatrix2x4dv = (PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4dv")) == NULL) || r; + r = ((glProgramUniformMatrix2x4fv = (PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4fv")) == NULL) || r; + r = ((glProgramUniformMatrix3dv = (PFNGLPROGRAMUNIFORMMATRIX3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3dv")) == NULL) || r; + r = ((glProgramUniformMatrix3fv = (PFNGLPROGRAMUNIFORMMATRIX3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3fv")) == NULL) || r; + r = ((glProgramUniformMatrix3x2dv = (PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2dv")) == NULL) || r; + r = ((glProgramUniformMatrix3x2fv = (PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2fv")) == NULL) || r; + r = ((glProgramUniformMatrix3x4dv = (PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4dv")) == NULL) || r; + r = ((glProgramUniformMatrix3x4fv = (PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4fv")) == NULL) || r; + r = ((glProgramUniformMatrix4dv = (PFNGLPROGRAMUNIFORMMATRIX4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4dv")) == NULL) || r; + r = ((glProgramUniformMatrix4fv = (PFNGLPROGRAMUNIFORMMATRIX4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4fv")) == NULL) || r; + r = ((glProgramUniformMatrix4x2dv = (PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2dv")) == NULL) || r; + r = ((glProgramUniformMatrix4x2fv = (PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2fv")) == NULL) || r; + r = ((glProgramUniformMatrix4x3dv = (PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3dv")) == NULL) || r; + r = ((glProgramUniformMatrix4x3fv = (PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3fv")) == NULL) || r; + r = ((glUseProgramStages = (PFNGLUSEPROGRAMSTAGESPROC)glewGetProcAddress((const GLubyte*)"glUseProgramStages")) == NULL) || r; + r = ((glValidateProgramPipeline = (PFNGLVALIDATEPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glValidateProgramPipeline")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_separate_shader_objects */ + +#ifdef GL_ARB_shader_atomic_counters + +static GLboolean _glewInit_GL_ARB_shader_atomic_counters () +{ + GLboolean r = GL_FALSE; + + r = ((glGetActiveAtomicCounterBufferiv = (PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAtomicCounterBufferiv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_atomic_counters */ + +#ifdef GL_ARB_shader_image_load_store + +static GLboolean _glewInit_GL_ARB_shader_image_load_store () +{ + GLboolean r = GL_FALSE; + + r = ((glBindImageTexture = (PFNGLBINDIMAGETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glBindImageTexture")) == NULL) || r; + r = ((glMemoryBarrier = (PFNGLMEMORYBARRIERPROC)glewGetProcAddress((const GLubyte*)"glMemoryBarrier")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_image_load_store */ #ifdef GL_ARB_shader_objects -static GLboolean _glewInit_GL_ARB_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ARB_shader_objects () { GLboolean r = GL_FALSE; @@ -2524,25 +11323,159 @@ static GLboolean _glewInit_GL_ARB_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_ARB_shader_objects */ -#ifdef GL_ARB_shading_language_100 +#ifdef GL_ARB_shader_storage_buffer_object -#endif /* GL_ARB_shading_language_100 */ +static GLboolean _glewInit_GL_ARB_shader_storage_buffer_object () +{ + GLboolean r = GL_FALSE; -#ifdef GL_ARB_shadow + r = ((glShaderStorageBlockBinding = (PFNGLSHADERSTORAGEBLOCKBINDINGPROC)glewGetProcAddress((const GLubyte*)"glShaderStorageBlockBinding")) == NULL) || r; -#endif /* GL_ARB_shadow */ + return r; +} -#ifdef GL_ARB_shadow_ambient +#endif /* GL_ARB_shader_storage_buffer_object */ -#endif /* GL_ARB_shadow_ambient */ +#ifdef GL_ARB_shader_subroutine -#ifdef GL_ARB_texture_border_clamp +static GLboolean _glewInit_GL_ARB_shader_subroutine () +{ + GLboolean r = GL_FALSE; -#endif /* GL_ARB_texture_border_clamp */ + r = ((glGetActiveSubroutineName = (PFNGLGETACTIVESUBROUTINENAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineName")) == NULL) || r; + r = ((glGetActiveSubroutineUniformName = (PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineUniformName")) == NULL) || r; + r = ((glGetActiveSubroutineUniformiv = (PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineUniformiv")) == NULL) || r; + r = ((glGetProgramStageiv = (PFNGLGETPROGRAMSTAGEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStageiv")) == NULL) || r; + r = ((glGetSubroutineIndex = (PFNGLGETSUBROUTINEINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetSubroutineIndex")) == NULL) || r; + r = ((glGetSubroutineUniformLocation = (PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetSubroutineUniformLocation")) == NULL) || r; + r = ((glGetUniformSubroutineuiv = (PFNGLGETUNIFORMSUBROUTINEUIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformSubroutineuiv")) == NULL) || r; + r = ((glUniformSubroutinesuiv = (PFNGLUNIFORMSUBROUTINESUIVPROC)glewGetProcAddress((const GLubyte*)"glUniformSubroutinesuiv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_subroutine */ + +#ifdef GL_ARB_shading_language_include + +static GLboolean _glewInit_GL_ARB_shading_language_include () +{ + GLboolean r = GL_FALSE; + + r = ((glCompileShaderIncludeARB = (PFNGLCOMPILESHADERINCLUDEARBPROC)glewGetProcAddress((const GLubyte*)"glCompileShaderIncludeARB")) == NULL) || r; + r = ((glDeleteNamedStringARB = (PFNGLDELETENAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteNamedStringARB")) == NULL) || r; + r = ((glGetNamedStringARB = (PFNGLGETNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glGetNamedStringARB")) == NULL) || r; + r = ((glGetNamedStringivARB = (PFNGLGETNAMEDSTRINGIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetNamedStringivARB")) == NULL) || r; + r = ((glIsNamedStringARB = (PFNGLISNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glIsNamedStringARB")) == NULL) || r; + r = ((glNamedStringARB = (PFNGLNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glNamedStringARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shading_language_include */ + +#ifdef GL_ARB_sparse_buffer + +static GLboolean _glewInit_GL_ARB_sparse_buffer () +{ + GLboolean r = GL_FALSE; + + r = ((glBufferPageCommitmentARB = (PFNGLBUFFERPAGECOMMITMENTARBPROC)glewGetProcAddress((const GLubyte*)"glBufferPageCommitmentARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_sparse_buffer */ + +#ifdef GL_ARB_sparse_texture + +static GLboolean _glewInit_GL_ARB_sparse_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glTexPageCommitmentARB = (PFNGLTEXPAGECOMMITMENTARBPROC)glewGetProcAddress((const GLubyte*)"glTexPageCommitmentARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_sparse_texture */ + +#ifdef GL_ARB_sync + +static GLboolean _glewInit_GL_ARB_sync () +{ + GLboolean r = GL_FALSE; + + r = ((glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)glewGetProcAddress((const GLubyte*)"glClientWaitSync")) == NULL) || r; + r = ((glDeleteSync = (PFNGLDELETESYNCPROC)glewGetProcAddress((const GLubyte*)"glDeleteSync")) == NULL) || r; + r = ((glFenceSync = (PFNGLFENCESYNCPROC)glewGetProcAddress((const GLubyte*)"glFenceSync")) == NULL) || r; + r = ((glGetInteger64v = (PFNGLGETINTEGER64VPROC)glewGetProcAddress((const GLubyte*)"glGetInteger64v")) == NULL) || r; + r = ((glGetSynciv = (PFNGLGETSYNCIVPROC)glewGetProcAddress((const GLubyte*)"glGetSynciv")) == NULL) || r; + r = ((glIsSync = (PFNGLISSYNCPROC)glewGetProcAddress((const GLubyte*)"glIsSync")) == NULL) || r; + r = ((glWaitSync = (PFNGLWAITSYNCPROC)glewGetProcAddress((const GLubyte*)"glWaitSync")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_sync */ + +#ifdef GL_ARB_tessellation_shader + +static GLboolean _glewInit_GL_ARB_tessellation_shader () +{ + GLboolean r = GL_FALSE; + + r = ((glPatchParameterfv = (PFNGLPATCHPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glPatchParameterfv")) == NULL) || r; + r = ((glPatchParameteri = (PFNGLPATCHPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glPatchParameteri")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_tessellation_shader */ + +#ifdef GL_ARB_texture_barrier + +static GLboolean _glewInit_GL_ARB_texture_barrier () +{ + GLboolean r = GL_FALSE; + + r = ((glTextureBarrier = (PFNGLTEXTUREBARRIERPROC)glewGetProcAddress((const GLubyte*)"glTextureBarrier")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_barrier */ + +#ifdef GL_ARB_texture_buffer_object + +static GLboolean _glewInit_GL_ARB_texture_buffer_object () +{ + GLboolean r = GL_FALSE; + + r = ((glTexBufferARB = (PFNGLTEXBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glTexBufferARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_buffer_object */ + +#ifdef GL_ARB_texture_buffer_range + +static GLboolean _glewInit_GL_ARB_texture_buffer_range () +{ + GLboolean r = GL_FALSE; + + r = ((glTexBufferRange = (PFNGLTEXBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glTexBufferRange")) == NULL) || r; + r = ((glTextureBufferRangeEXT = (PFNGLTEXTUREBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureBufferRangeEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_buffer_range */ #ifdef GL_ARB_texture_compression -static GLboolean _glewInit_GL_ARB_texture_compression (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ARB_texture_compression () { GLboolean r = GL_FALSE; @@ -2559,45 +11492,133 @@ static GLboolean _glewInit_GL_ARB_texture_compression (GLEW_CONTEXT_ARG_DEF_INIT #endif /* GL_ARB_texture_compression */ -#ifdef GL_ARB_texture_cube_map +#ifdef GL_ARB_texture_multisample -#endif /* GL_ARB_texture_cube_map */ +static GLboolean _glewInit_GL_ARB_texture_multisample () +{ + GLboolean r = GL_FALSE; -#ifdef GL_ARB_texture_env_add + r = ((glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)glewGetProcAddress((const GLubyte*)"glGetMultisamplefv")) == NULL) || r; + r = ((glSampleMaski = (PFNGLSAMPLEMASKIPROC)glewGetProcAddress((const GLubyte*)"glSampleMaski")) == NULL) || r; + r = ((glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexImage2DMultisample")) == NULL) || r; + r = ((glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DMultisample")) == NULL) || r; -#endif /* GL_ARB_texture_env_add */ + return r; +} -#ifdef GL_ARB_texture_env_combine +#endif /* GL_ARB_texture_multisample */ -#endif /* GL_ARB_texture_env_combine */ +#ifdef GL_ARB_texture_storage -#ifdef GL_ARB_texture_env_crossbar +static GLboolean _glewInit_GL_ARB_texture_storage () +{ + GLboolean r = GL_FALSE; -#endif /* GL_ARB_texture_env_crossbar */ + r = ((glTexStorage1D = (PFNGLTEXSTORAGE1DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage1D")) == NULL) || r; + r = ((glTexStorage2D = (PFNGLTEXSTORAGE2DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage2D")) == NULL) || r; + r = ((glTexStorage3D = (PFNGLTEXSTORAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage3D")) == NULL) || r; -#ifdef GL_ARB_texture_env_dot3 + return r; +} -#endif /* GL_ARB_texture_env_dot3 */ +#endif /* GL_ARB_texture_storage */ -#ifdef GL_ARB_texture_float +#ifdef GL_ARB_texture_storage_multisample -#endif /* GL_ARB_texture_float */ +static GLboolean _glewInit_GL_ARB_texture_storage_multisample () +{ + GLboolean r = GL_FALSE; -#ifdef GL_ARB_texture_mirrored_repeat + r = ((glTexStorage2DMultisample = (PFNGLTEXSTORAGE2DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexStorage2DMultisample")) == NULL) || r; + r = ((glTexStorage3DMultisample = (PFNGLTEXSTORAGE3DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexStorage3DMultisample")) == NULL) || r; + r = ((glTextureStorage2DMultisampleEXT = (PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2DMultisampleEXT")) == NULL) || r; + r = ((glTextureStorage3DMultisampleEXT = (PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3DMultisampleEXT")) == NULL) || r; -#endif /* GL_ARB_texture_mirrored_repeat */ + return r; +} -#ifdef GL_ARB_texture_non_power_of_two +#endif /* GL_ARB_texture_storage_multisample */ -#endif /* GL_ARB_texture_non_power_of_two */ +#ifdef GL_ARB_texture_view -#ifdef GL_ARB_texture_rectangle +static GLboolean _glewInit_GL_ARB_texture_view () +{ + GLboolean r = GL_FALSE; -#endif /* GL_ARB_texture_rectangle */ + r = ((glTextureView = (PFNGLTEXTUREVIEWPROC)glewGetProcAddress((const GLubyte*)"glTextureView")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_view */ + +#ifdef GL_ARB_timer_query + +static GLboolean _glewInit_GL_ARB_timer_query () +{ + GLboolean r = GL_FALSE; + + r = ((glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64v")) == NULL) || r; + r = ((glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64v")) == NULL) || r; + r = ((glQueryCounter = (PFNGLQUERYCOUNTERPROC)glewGetProcAddress((const GLubyte*)"glQueryCounter")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_timer_query */ + +#ifdef GL_ARB_transform_feedback2 + +static GLboolean _glewInit_GL_ARB_transform_feedback2 () +{ + GLboolean r = GL_FALSE; + + r = ((glBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glBindTransformFeedback")) == NULL) || r; + r = ((glDeleteTransformFeedbacks = (PFNGLDELETETRANSFORMFEEDBACKSPROC)glewGetProcAddress((const GLubyte*)"glDeleteTransformFeedbacks")) == NULL) || r; + r = ((glDrawTransformFeedback = (PFNGLDRAWTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedback")) == NULL) || r; + r = ((glGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC)glewGetProcAddress((const GLubyte*)"glGenTransformFeedbacks")) == NULL) || r; + r = ((glIsTransformFeedback = (PFNGLISTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glIsTransformFeedback")) == NULL) || r; + r = ((glPauseTransformFeedback = (PFNGLPAUSETRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glPauseTransformFeedback")) == NULL) || r; + r = ((glResumeTransformFeedback = (PFNGLRESUMETRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glResumeTransformFeedback")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_transform_feedback2 */ + +#ifdef GL_ARB_transform_feedback3 + +static GLboolean _glewInit_GL_ARB_transform_feedback3 () +{ + GLboolean r = GL_FALSE; + + r = ((glBeginQueryIndexed = (PFNGLBEGINQUERYINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryIndexed")) == NULL) || r; + r = ((glDrawTransformFeedbackStream = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackStream")) == NULL) || r; + r = ((glEndQueryIndexed = (PFNGLENDQUERYINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glEndQueryIndexed")) == NULL) || r; + r = ((glGetQueryIndexediv = (PFNGLGETQUERYINDEXEDIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryIndexediv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_transform_feedback3 */ + +#ifdef GL_ARB_transform_feedback_instanced + +static GLboolean _glewInit_GL_ARB_transform_feedback_instanced () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawTransformFeedbackInstanced = (PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackInstanced")) == NULL) || r; + r = ((glDrawTransformFeedbackStreamInstanced = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackStreamInstanced")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_transform_feedback_instanced */ #ifdef GL_ARB_transpose_matrix -static GLboolean _glewInit_GL_ARB_transpose_matrix (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ARB_transpose_matrix () { GLboolean r = GL_FALSE; @@ -2611,9 +11632,93 @@ static GLboolean _glewInit_GL_ARB_transpose_matrix (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_ARB_transpose_matrix */ +#ifdef GL_ARB_uniform_buffer_object + +static GLboolean _glewInit_GL_ARB_uniform_buffer_object () +{ + GLboolean r = GL_FALSE; + + r = ((glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBase")) == NULL) || r; + r = ((glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRange")) == NULL) || r; + r = ((glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformBlockName")) == NULL) || r; + r = ((glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformBlockiv")) == NULL) || r; + r = ((glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformName")) == NULL) || r; + r = ((glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformsiv")) == NULL) || r; + r = ((glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)glewGetProcAddress((const GLubyte*)"glGetIntegeri_v")) == NULL) || r; + r = ((glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetUniformBlockIndex")) == NULL) || r; + r = ((glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)glewGetProcAddress((const GLubyte*)"glGetUniformIndices")) == NULL) || r; + r = ((glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)glewGetProcAddress((const GLubyte*)"glUniformBlockBinding")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_uniform_buffer_object */ + +#ifdef GL_ARB_vertex_array_object + +static GLboolean _glewInit_GL_ARB_vertex_array_object () +{ + GLboolean r = GL_FALSE; + + r = ((glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)glewGetProcAddress((const GLubyte*)"glBindVertexArray")) == NULL) || r; + r = ((glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexArrays")) == NULL) || r; + r = ((glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glGenVertexArrays")) == NULL) || r; + r = ((glIsVertexArray = (PFNGLISVERTEXARRAYPROC)glewGetProcAddress((const GLubyte*)"glIsVertexArray")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_array_object */ + +#ifdef GL_ARB_vertex_attrib_64bit + +static GLboolean _glewInit_GL_ARB_vertex_attrib_64bit () +{ + GLboolean r = GL_FALSE; + + r = ((glGetVertexAttribLdv = (PFNGLGETVERTEXATTRIBLDVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLdv")) == NULL) || r; + r = ((glVertexAttribL1d = (PFNGLVERTEXATTRIBL1DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1d")) == NULL) || r; + r = ((glVertexAttribL1dv = (PFNGLVERTEXATTRIBL1DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dv")) == NULL) || r; + r = ((glVertexAttribL2d = (PFNGLVERTEXATTRIBL2DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2d")) == NULL) || r; + r = ((glVertexAttribL2dv = (PFNGLVERTEXATTRIBL2DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dv")) == NULL) || r; + r = ((glVertexAttribL3d = (PFNGLVERTEXATTRIBL3DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3d")) == NULL) || r; + r = ((glVertexAttribL3dv = (PFNGLVERTEXATTRIBL3DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dv")) == NULL) || r; + r = ((glVertexAttribL4d = (PFNGLVERTEXATTRIBL4DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4d")) == NULL) || r; + r = ((glVertexAttribL4dv = (PFNGLVERTEXATTRIBL4DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dv")) == NULL) || r; + r = ((glVertexAttribLPointer = (PFNGLVERTEXATTRIBLPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLPointer")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_attrib_64bit */ + +#ifdef GL_ARB_vertex_attrib_binding + +static GLboolean _glewInit_GL_ARB_vertex_attrib_binding () +{ + GLboolean r = GL_FALSE; + + r = ((glBindVertexBuffer = (PFNGLBINDVERTEXBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindVertexBuffer")) == NULL) || r; + r = ((glVertexArrayBindVertexBufferEXT = (PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayBindVertexBufferEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribBindingEXT = (PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribBindingEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribFormatEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribIFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribIFormatEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribLFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribLFormatEXT")) == NULL) || r; + r = ((glVertexArrayVertexBindingDivisorEXT = (PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexBindingDivisorEXT")) == NULL) || r; + r = ((glVertexAttribBinding = (PFNGLVERTEXATTRIBBINDINGPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribBinding")) == NULL) || r; + r = ((glVertexAttribFormat = (PFNGLVERTEXATTRIBFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribFormat")) == NULL) || r; + r = ((glVertexAttribIFormat = (PFNGLVERTEXATTRIBIFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIFormat")) == NULL) || r; + r = ((glVertexAttribLFormat = (PFNGLVERTEXATTRIBLFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLFormat")) == NULL) || r; + r = ((glVertexBindingDivisor = (PFNGLVERTEXBINDINGDIVISORPROC)glewGetProcAddress((const GLubyte*)"glVertexBindingDivisor")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_attrib_binding */ + #ifdef GL_ARB_vertex_blend -static GLboolean _glewInit_GL_ARB_vertex_blend (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ARB_vertex_blend () { GLboolean r = GL_FALSE; @@ -2635,7 +11740,7 @@ static GLboolean _glewInit_GL_ARB_vertex_blend (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_ARB_vertex_buffer_object -static GLboolean _glewInit_GL_ARB_vertex_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ARB_vertex_buffer_object () { GLboolean r = GL_FALSE; @@ -2658,7 +11763,7 @@ static GLboolean _glewInit_GL_ARB_vertex_buffer_object (GLEW_CONTEXT_ARG_DEF_INI #ifdef GL_ARB_vertex_program -static GLboolean _glewInit_GL_ARB_vertex_program (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ARB_vertex_program () { GLboolean r = GL_FALSE; @@ -2732,7 +11837,7 @@ static GLboolean _glewInit_GL_ARB_vertex_program (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_ARB_vertex_shader -static GLboolean _glewInit_GL_ARB_vertex_shader (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ARB_vertex_shader () { GLboolean r = GL_FALSE; @@ -2745,9 +11850,81 @@ static GLboolean _glewInit_GL_ARB_vertex_shader (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_ARB_vertex_shader */ +#ifdef GL_ARB_vertex_type_2_10_10_10_rev + +static GLboolean _glewInit_GL_ARB_vertex_type_2_10_10_10_rev () +{ + GLboolean r = GL_FALSE; + + r = ((glColorP3ui = (PFNGLCOLORP3UIPROC)glewGetProcAddress((const GLubyte*)"glColorP3ui")) == NULL) || r; + r = ((glColorP3uiv = (PFNGLCOLORP3UIVPROC)glewGetProcAddress((const GLubyte*)"glColorP3uiv")) == NULL) || r; + r = ((glColorP4ui = (PFNGLCOLORP4UIPROC)glewGetProcAddress((const GLubyte*)"glColorP4ui")) == NULL) || r; + r = ((glColorP4uiv = (PFNGLCOLORP4UIVPROC)glewGetProcAddress((const GLubyte*)"glColorP4uiv")) == NULL) || r; + r = ((glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP1ui")) == NULL) || r; + r = ((glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP1uiv")) == NULL) || r; + r = ((glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP2ui")) == NULL) || r; + r = ((glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP2uiv")) == NULL) || r; + r = ((glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP3ui")) == NULL) || r; + r = ((glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP3uiv")) == NULL) || r; + r = ((glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP4ui")) == NULL) || r; + r = ((glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP4uiv")) == NULL) || r; + r = ((glNormalP3ui = (PFNGLNORMALP3UIPROC)glewGetProcAddress((const GLubyte*)"glNormalP3ui")) == NULL) || r; + r = ((glNormalP3uiv = (PFNGLNORMALP3UIVPROC)glewGetProcAddress((const GLubyte*)"glNormalP3uiv")) == NULL) || r; + r = ((glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorP3ui")) == NULL) || r; + r = ((glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorP3uiv")) == NULL) || r; + r = ((glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP1ui")) == NULL) || r; + r = ((glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP1uiv")) == NULL) || r; + r = ((glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP2ui")) == NULL) || r; + r = ((glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP2uiv")) == NULL) || r; + r = ((glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP3ui")) == NULL) || r; + r = ((glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP3uiv")) == NULL) || r; + r = ((glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP4ui")) == NULL) || r; + r = ((glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP4uiv")) == NULL) || r; + r = ((glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP1ui")) == NULL) || r; + r = ((glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP1uiv")) == NULL) || r; + r = ((glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP2ui")) == NULL) || r; + r = ((glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP2uiv")) == NULL) || r; + r = ((glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP3ui")) == NULL) || r; + r = ((glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP3uiv")) == NULL) || r; + r = ((glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP4ui")) == NULL) || r; + r = ((glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP4uiv")) == NULL) || r; + r = ((glVertexP2ui = (PFNGLVERTEXP2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP2ui")) == NULL) || r; + r = ((glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP2uiv")) == NULL) || r; + r = ((glVertexP3ui = (PFNGLVERTEXP3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP3ui")) == NULL) || r; + r = ((glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP3uiv")) == NULL) || r; + r = ((glVertexP4ui = (PFNGLVERTEXP4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP4ui")) == NULL) || r; + r = ((glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP4uiv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ + +#ifdef GL_ARB_viewport_array + +static GLboolean _glewInit_GL_ARB_viewport_array () +{ + GLboolean r = GL_FALSE; + + r = ((glDepthRangeArrayv = (PFNGLDEPTHRANGEARRAYVPROC)glewGetProcAddress((const GLubyte*)"glDepthRangeArrayv")) == NULL) || r; + r = ((glDepthRangeIndexed = (PFNGLDEPTHRANGEINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glDepthRangeIndexed")) == NULL) || r; + r = ((glGetDoublei_v = (PFNGLGETDOUBLEI_VPROC)glewGetProcAddress((const GLubyte*)"glGetDoublei_v")) == NULL) || r; + r = ((glGetFloati_v = (PFNGLGETFLOATI_VPROC)glewGetProcAddress((const GLubyte*)"glGetFloati_v")) == NULL) || r; + r = ((glScissorArrayv = (PFNGLSCISSORARRAYVPROC)glewGetProcAddress((const GLubyte*)"glScissorArrayv")) == NULL) || r; + r = ((glScissorIndexed = (PFNGLSCISSORINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glScissorIndexed")) == NULL) || r; + r = ((glScissorIndexedv = (PFNGLSCISSORINDEXEDVPROC)glewGetProcAddress((const GLubyte*)"glScissorIndexedv")) == NULL) || r; + r = ((glViewportArrayv = (PFNGLVIEWPORTARRAYVPROC)glewGetProcAddress((const GLubyte*)"glViewportArrayv")) == NULL) || r; + r = ((glViewportIndexedf = (PFNGLVIEWPORTINDEXEDFPROC)glewGetProcAddress((const GLubyte*)"glViewportIndexedf")) == NULL) || r; + r = ((glViewportIndexedfv = (PFNGLVIEWPORTINDEXEDFVPROC)glewGetProcAddress((const GLubyte*)"glViewportIndexedfv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_viewport_array */ + #ifdef GL_ARB_window_pos -static GLboolean _glewInit_GL_ARB_window_pos (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ARB_window_pos () { GLboolean r = GL_FALSE; @@ -2773,25 +11950,9 @@ static GLboolean _glewInit_GL_ARB_window_pos (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_ARB_window_pos */ -#ifdef GL_ATIX_point_sprites - -#endif /* GL_ATIX_point_sprites */ - -#ifdef GL_ATIX_texture_env_combine3 - -#endif /* GL_ATIX_texture_env_combine3 */ - -#ifdef GL_ATIX_texture_env_route - -#endif /* GL_ATIX_texture_env_route */ - -#ifdef GL_ATIX_vertex_shader_output_point_size - -#endif /* GL_ATIX_vertex_shader_output_point_size */ - #ifdef GL_ATI_draw_buffers -static GLboolean _glewInit_GL_ATI_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ATI_draw_buffers () { GLboolean r = GL_FALSE; @@ -2804,7 +11965,7 @@ static GLboolean _glewInit_GL_ATI_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_ATI_element_array -static GLboolean _glewInit_GL_ATI_element_array (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ATI_element_array () { GLboolean r = GL_FALSE; @@ -2819,7 +11980,7 @@ static GLboolean _glewInit_GL_ATI_element_array (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_ATI_envmap_bumpmap -static GLboolean _glewInit_GL_ATI_envmap_bumpmap (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ATI_envmap_bumpmap () { GLboolean r = GL_FALSE; @@ -2835,7 +11996,7 @@ static GLboolean _glewInit_GL_ATI_envmap_bumpmap (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_ATI_fragment_shader -static GLboolean _glewInit_GL_ATI_fragment_shader (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ATI_fragment_shader () { GLboolean r = GL_FALSE; @@ -2861,7 +12022,7 @@ static GLboolean _glewInit_GL_ATI_fragment_shader (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_ATI_map_object_buffer -static GLboolean _glewInit_GL_ATI_map_object_buffer (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ATI_map_object_buffer () { GLboolean r = GL_FALSE; @@ -2875,7 +12036,7 @@ static GLboolean _glewInit_GL_ATI_map_object_buffer (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_ATI_pn_triangles -static GLboolean _glewInit_GL_ATI_pn_triangles (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ATI_pn_triangles () { GLboolean r = GL_FALSE; @@ -2889,7 +12050,7 @@ static GLboolean _glewInit_GL_ATI_pn_triangles (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_ATI_separate_stencil -static GLboolean _glewInit_GL_ATI_separate_stencil (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ATI_separate_stencil () { GLboolean r = GL_FALSE; @@ -2901,33 +12062,9 @@ static GLboolean _glewInit_GL_ATI_separate_stencil (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_ATI_separate_stencil */ -#ifdef GL_ATI_shader_texture_lod - -#endif /* GL_ATI_shader_texture_lod */ - -#ifdef GL_ATI_text_fragment_shader - -#endif /* GL_ATI_text_fragment_shader */ - -#ifdef GL_ATI_texture_compression_3dc - -#endif /* GL_ATI_texture_compression_3dc */ - -#ifdef GL_ATI_texture_env_combine3 - -#endif /* GL_ATI_texture_env_combine3 */ - -#ifdef GL_ATI_texture_float - -#endif /* GL_ATI_texture_float */ - -#ifdef GL_ATI_texture_mirror_once - -#endif /* GL_ATI_texture_mirror_once */ - #ifdef GL_ATI_vertex_array_object -static GLboolean _glewInit_GL_ATI_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ATI_vertex_array_object () { GLboolean r = GL_FALSE; @@ -2951,7 +12088,7 @@ static GLboolean _glewInit_GL_ATI_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT #ifdef GL_ATI_vertex_attrib_array_object -static GLboolean _glewInit_GL_ATI_vertex_attrib_array_object (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ATI_vertex_attrib_array_object () { GLboolean r = GL_FALSE; @@ -2966,7 +12103,7 @@ static GLboolean _glewInit_GL_ATI_vertex_attrib_array_object (GLEW_CONTEXT_ARG_D #ifdef GL_ATI_vertex_streams -static GLboolean _glewInit_GL_ATI_vertex_streams (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_ATI_vertex_streams () { GLboolean r = GL_FALSE; @@ -2983,6 +12120,14 @@ static GLboolean _glewInit_GL_ATI_vertex_streams (GLEW_CONTEXT_ARG_DEF_INIT) r = ((glNormalStream3svATI = (PFNGLNORMALSTREAM3SVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3svATI")) == NULL) || r; r = ((glVertexBlendEnvfATI = (PFNGLVERTEXBLENDENVFATIPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendEnvfATI")) == NULL) || r; r = ((glVertexBlendEnviATI = (PFNGLVERTEXBLENDENVIATIPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendEnviATI")) == NULL) || r; + r = ((glVertexStream1dATI = (PFNGLVERTEXSTREAM1DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1dATI")) == NULL) || r; + r = ((glVertexStream1dvATI = (PFNGLVERTEXSTREAM1DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1dvATI")) == NULL) || r; + r = ((glVertexStream1fATI = (PFNGLVERTEXSTREAM1FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1fATI")) == NULL) || r; + r = ((glVertexStream1fvATI = (PFNGLVERTEXSTREAM1FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1fvATI")) == NULL) || r; + r = ((glVertexStream1iATI = (PFNGLVERTEXSTREAM1IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1iATI")) == NULL) || r; + r = ((glVertexStream1ivATI = (PFNGLVERTEXSTREAM1IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1ivATI")) == NULL) || r; + r = ((glVertexStream1sATI = (PFNGLVERTEXSTREAM1SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1sATI")) == NULL) || r; + r = ((glVertexStream1svATI = (PFNGLVERTEXSTREAM1SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1svATI")) == NULL) || r; r = ((glVertexStream2dATI = (PFNGLVERTEXSTREAM2DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2dATI")) == NULL) || r; r = ((glVertexStream2dvATI = (PFNGLVERTEXSTREAM2DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2dvATI")) == NULL) || r; r = ((glVertexStream2fATI = (PFNGLVERTEXSTREAM2FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2fATI")) == NULL) || r; @@ -3013,25 +12158,24 @@ static GLboolean _glewInit_GL_ATI_vertex_streams (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_ATI_vertex_streams */ -#ifdef GL_EXT_422_pixels +#ifdef GL_EXT_base_instance -#endif /* GL_EXT_422_pixels */ +static GLboolean _glewInit_GL_EXT_base_instance () +{ + GLboolean r = GL_FALSE; -#ifdef GL_EXT_Cg_shader + r = ((glDrawArraysInstancedBaseInstanceEXT = (PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedBaseInstanceEXT")) == NULL) || r; + r = ((glDrawElementsInstancedBaseInstanceEXT = (PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseInstanceEXT")) == NULL) || r; + r = ((glDrawElementsInstancedBaseVertexBaseInstanceEXT = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseVertexBaseInstanceEXT")) == NULL) || r; -#endif /* GL_EXT_Cg_shader */ + return r; +} -#ifdef GL_EXT_abgr - -#endif /* GL_EXT_abgr */ - -#ifdef GL_EXT_bgra - -#endif /* GL_EXT_bgra */ +#endif /* GL_EXT_base_instance */ #ifdef GL_EXT_bindable_uniform -static GLboolean _glewInit_GL_EXT_bindable_uniform (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_bindable_uniform () { GLboolean r = GL_FALSE; @@ -3046,7 +12190,7 @@ static GLboolean _glewInit_GL_EXT_bindable_uniform (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_EXT_blend_color -static GLboolean _glewInit_GL_EXT_blend_color (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_blend_color () { GLboolean r = GL_FALSE; @@ -3059,7 +12203,7 @@ static GLboolean _glewInit_GL_EXT_blend_color (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_EXT_blend_equation_separate -static GLboolean _glewInit_GL_EXT_blend_equation_separate (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_blend_equation_separate () { GLboolean r = GL_FALSE; @@ -3070,9 +12214,24 @@ static GLboolean _glewInit_GL_EXT_blend_equation_separate (GLEW_CONTEXT_ARG_DEF_ #endif /* GL_EXT_blend_equation_separate */ +#ifdef GL_EXT_blend_func_extended + +static GLboolean _glewInit_GL_EXT_blend_func_extended () +{ + GLboolean r = GL_FALSE; + + r = ((glBindFragDataLocationIndexedEXT = (PFNGLBINDFRAGDATALOCATIONINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocationIndexedEXT")) == NULL) || r; + r = ((glGetFragDataIndexEXT = (PFNGLGETFRAGDATAINDEXEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataIndexEXT")) == NULL) || r; + r = ((glGetProgramResourceLocationIndexEXT = (PFNGLGETPROGRAMRESOURCELOCATIONINDEXEXTPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceLocationIndexEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_func_extended */ + #ifdef GL_EXT_blend_func_separate -static GLboolean _glewInit_GL_EXT_blend_func_separate (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_blend_func_separate () { GLboolean r = GL_FALSE; @@ -3083,13 +12242,9 @@ static GLboolean _glewInit_GL_EXT_blend_func_separate (GLEW_CONTEXT_ARG_DEF_INIT #endif /* GL_EXT_blend_func_separate */ -#ifdef GL_EXT_blend_logic_op - -#endif /* GL_EXT_blend_logic_op */ - #ifdef GL_EXT_blend_minmax -static GLboolean _glewInit_GL_EXT_blend_minmax (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_blend_minmax () { GLboolean r = GL_FALSE; @@ -3100,21 +12255,37 @@ static GLboolean _glewInit_GL_EXT_blend_minmax (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_EXT_blend_minmax */ -#ifdef GL_EXT_blend_subtract +#ifdef GL_EXT_buffer_storage -#endif /* GL_EXT_blend_subtract */ +static GLboolean _glewInit_GL_EXT_buffer_storage () +{ + GLboolean r = GL_FALSE; -#ifdef GL_EXT_clip_volume_hint + r = ((glBufferStorageEXT = (PFNGLBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glBufferStorageEXT")) == NULL) || r; + r = ((glNamedBufferStorageEXT = (PFNGLNAMEDBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferStorageEXT")) == NULL) || r; -#endif /* GL_EXT_clip_volume_hint */ + return r; +} -#ifdef GL_EXT_cmyka +#endif /* GL_EXT_buffer_storage */ -#endif /* GL_EXT_cmyka */ +#ifdef GL_EXT_clear_texture + +static GLboolean _glewInit_GL_EXT_clear_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glClearTexImageEXT = (PFNGLCLEARTEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glClearTexImageEXT")) == NULL) || r; + r = ((glClearTexSubImageEXT = (PFNGLCLEARTEXSUBIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glClearTexSubImageEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_clear_texture */ #ifdef GL_EXT_color_subtable -static GLboolean _glewInit_GL_EXT_color_subtable (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_color_subtable () { GLboolean r = GL_FALSE; @@ -3128,7 +12299,7 @@ static GLboolean _glewInit_GL_EXT_color_subtable (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_EXT_compiled_vertex_array -static GLboolean _glewInit_GL_EXT_compiled_vertex_array (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_compiled_vertex_array () { GLboolean r = GL_FALSE; @@ -3142,7 +12313,7 @@ static GLboolean _glewInit_GL_EXT_compiled_vertex_array (GLEW_CONTEXT_ARG_DEF_IN #ifdef GL_EXT_convolution -static GLboolean _glewInit_GL_EXT_convolution (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_convolution () { GLboolean r = GL_FALSE; @@ -3167,7 +12338,7 @@ static GLboolean _glewInit_GL_EXT_convolution (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_EXT_coordinate_frame -static GLboolean _glewInit_GL_EXT_coordinate_frame (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_coordinate_frame () { GLboolean r = GL_FALSE; @@ -3179,9 +12350,22 @@ static GLboolean _glewInit_GL_EXT_coordinate_frame (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_EXT_coordinate_frame */ +#ifdef GL_EXT_copy_image + +static GLboolean _glewInit_GL_EXT_copy_image () +{ + GLboolean r = GL_FALSE; + + r = ((glCopyImageSubDataEXT = (PFNGLCOPYIMAGESUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyImageSubDataEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_copy_image */ + #ifdef GL_EXT_copy_texture -static GLboolean _glewInit_GL_EXT_copy_texture (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_copy_texture () { GLboolean r = GL_FALSE; @@ -3198,7 +12382,7 @@ static GLboolean _glewInit_GL_EXT_copy_texture (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_EXT_cull_vertex -static GLboolean _glewInit_GL_EXT_cull_vertex (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_cull_vertex () { GLboolean r = GL_FALSE; @@ -3210,9 +12394,38 @@ static GLboolean _glewInit_GL_EXT_cull_vertex (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_EXT_cull_vertex */ +#ifdef GL_EXT_debug_label + +static GLboolean _glewInit_GL_EXT_debug_label () +{ + GLboolean r = GL_FALSE; + + r = ((glGetObjectLabelEXT = (PFNGLGETOBJECTLABELEXTPROC)glewGetProcAddress((const GLubyte*)"glGetObjectLabelEXT")) == NULL) || r; + r = ((glLabelObjectEXT = (PFNGLLABELOBJECTEXTPROC)glewGetProcAddress((const GLubyte*)"glLabelObjectEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_debug_label */ + +#ifdef GL_EXT_debug_marker + +static GLboolean _glewInit_GL_EXT_debug_marker () +{ + GLboolean r = GL_FALSE; + + r = ((glInsertEventMarkerEXT = (PFNGLINSERTEVENTMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glInsertEventMarkerEXT")) == NULL) || r; + r = ((glPopGroupMarkerEXT = (PFNGLPOPGROUPMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glPopGroupMarkerEXT")) == NULL) || r; + r = ((glPushGroupMarkerEXT = (PFNGLPUSHGROUPMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glPushGroupMarkerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_debug_marker */ + #ifdef GL_EXT_depth_bounds_test -static GLboolean _glewInit_GL_EXT_depth_bounds_test (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_depth_bounds_test () { GLboolean r = GL_FALSE; @@ -3223,9 +12436,261 @@ static GLboolean _glewInit_GL_EXT_depth_bounds_test (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_EXT_depth_bounds_test */ +#ifdef GL_EXT_direct_state_access + +static GLboolean _glewInit_GL_EXT_direct_state_access () +{ + GLboolean r = GL_FALSE; + + r = ((glBindMultiTextureEXT = (PFNGLBINDMULTITEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindMultiTextureEXT")) == NULL) || r; + r = ((glCheckNamedFramebufferStatusEXT = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC)glewGetProcAddress((const GLubyte*)"glCheckNamedFramebufferStatusEXT")) == NULL) || r; + r = ((glClientAttribDefaultEXT = (PFNGLCLIENTATTRIBDEFAULTEXTPROC)glewGetProcAddress((const GLubyte*)"glClientAttribDefaultEXT")) == NULL) || r; + r = ((glCompressedMultiTexImage1DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage1DEXT")) == NULL) || r; + r = ((glCompressedMultiTexImage2DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage2DEXT")) == NULL) || r; + r = ((glCompressedMultiTexImage3DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage3DEXT")) == NULL) || r; + r = ((glCompressedMultiTexSubImage1DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage1DEXT")) == NULL) || r; + r = ((glCompressedMultiTexSubImage2DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage2DEXT")) == NULL) || r; + r = ((glCompressedMultiTexSubImage3DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage3DEXT")) == NULL) || r; + r = ((glCompressedTextureImage1DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage1DEXT")) == NULL) || r; + r = ((glCompressedTextureImage2DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage2DEXT")) == NULL) || r; + r = ((glCompressedTextureImage3DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage3DEXT")) == NULL) || r; + r = ((glCompressedTextureSubImage1DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage1DEXT")) == NULL) || r; + r = ((glCompressedTextureSubImage2DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage2DEXT")) == NULL) || r; + r = ((glCompressedTextureSubImage3DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage3DEXT")) == NULL) || r; + r = ((glCopyMultiTexImage1DEXT = (PFNGLCOPYMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexImage1DEXT")) == NULL) || r; + r = ((glCopyMultiTexImage2DEXT = (PFNGLCOPYMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexImage2DEXT")) == NULL) || r; + r = ((glCopyMultiTexSubImage1DEXT = (PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage1DEXT")) == NULL) || r; + r = ((glCopyMultiTexSubImage2DEXT = (PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage2DEXT")) == NULL) || r; + r = ((glCopyMultiTexSubImage3DEXT = (PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage3DEXT")) == NULL) || r; + r = ((glCopyTextureImage1DEXT = (PFNGLCOPYTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureImage1DEXT")) == NULL) || r; + r = ((glCopyTextureImage2DEXT = (PFNGLCOPYTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureImage2DEXT")) == NULL) || r; + r = ((glCopyTextureSubImage1DEXT = (PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage1DEXT")) == NULL) || r; + r = ((glCopyTextureSubImage2DEXT = (PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage2DEXT")) == NULL) || r; + r = ((glCopyTextureSubImage3DEXT = (PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage3DEXT")) == NULL) || r; + r = ((glDisableClientStateIndexedEXT = (PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableClientStateIndexedEXT")) == NULL) || r; + r = ((glDisableClientStateiEXT = (PFNGLDISABLECLIENTSTATEIEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableClientStateiEXT")) == NULL) || r; + r = ((glDisableVertexArrayAttribEXT = (PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexArrayAttribEXT")) == NULL) || r; + r = ((glDisableVertexArrayEXT = (PFNGLDISABLEVERTEXARRAYEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexArrayEXT")) == NULL) || r; + r = ((glEnableClientStateIndexedEXT = (PFNGLENABLECLIENTSTATEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableClientStateIndexedEXT")) == NULL) || r; + r = ((glEnableClientStateiEXT = (PFNGLENABLECLIENTSTATEIEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableClientStateiEXT")) == NULL) || r; + r = ((glEnableVertexArrayAttribEXT = (PFNGLENABLEVERTEXARRAYATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexArrayAttribEXT")) == NULL) || r; + r = ((glEnableVertexArrayEXT = (PFNGLENABLEVERTEXARRAYEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexArrayEXT")) == NULL) || r; + r = ((glFlushMappedNamedBufferRangeEXT = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedNamedBufferRangeEXT")) == NULL) || r; + r = ((glFramebufferDrawBufferEXT = (PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferDrawBufferEXT")) == NULL) || r; + r = ((glFramebufferDrawBuffersEXT = (PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferDrawBuffersEXT")) == NULL) || r; + r = ((glFramebufferReadBufferEXT = (PFNGLFRAMEBUFFERREADBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferReadBufferEXT")) == NULL) || r; + r = ((glGenerateMultiTexMipmapEXT = (PFNGLGENERATEMULTITEXMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateMultiTexMipmapEXT")) == NULL) || r; + r = ((glGenerateTextureMipmapEXT = (PFNGLGENERATETEXTUREMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateTextureMipmapEXT")) == NULL) || r; + r = ((glGetCompressedMultiTexImageEXT = (PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedMultiTexImageEXT")) == NULL) || r; + r = ((glGetCompressedTextureImageEXT = (PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTextureImageEXT")) == NULL) || r; + r = ((glGetDoubleIndexedvEXT = (PFNGLGETDOUBLEINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetDoubleIndexedvEXT")) == NULL) || r; + r = ((glGetDoublei_vEXT = (PFNGLGETDOUBLEI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetDoublei_vEXT")) == NULL) || r; + r = ((glGetFloatIndexedvEXT = (PFNGLGETFLOATINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFloatIndexedvEXT")) == NULL) || r; + r = ((glGetFloati_vEXT = (PFNGLGETFLOATI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFloati_vEXT")) == NULL) || r; + r = ((glGetFramebufferParameterivEXT = (PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferParameterivEXT")) == NULL) || r; + r = ((glGetMultiTexEnvfvEXT = (PFNGLGETMULTITEXENVFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexEnvfvEXT")) == NULL) || r; + r = ((glGetMultiTexEnvivEXT = (PFNGLGETMULTITEXENVIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexEnvivEXT")) == NULL) || r; + r = ((glGetMultiTexGendvEXT = (PFNGLGETMULTITEXGENDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGendvEXT")) == NULL) || r; + r = ((glGetMultiTexGenfvEXT = (PFNGLGETMULTITEXGENFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGenfvEXT")) == NULL) || r; + r = ((glGetMultiTexGenivEXT = (PFNGLGETMULTITEXGENIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGenivEXT")) == NULL) || r; + r = ((glGetMultiTexImageEXT = (PFNGLGETMULTITEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexImageEXT")) == NULL) || r; + r = ((glGetMultiTexLevelParameterfvEXT = (PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexLevelParameterfvEXT")) == NULL) || r; + r = ((glGetMultiTexLevelParameterivEXT = (PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexLevelParameterivEXT")) == NULL) || r; + r = ((glGetMultiTexParameterIivEXT = (PFNGLGETMULTITEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterIivEXT")) == NULL) || r; + r = ((glGetMultiTexParameterIuivEXT = (PFNGLGETMULTITEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterIuivEXT")) == NULL) || r; + r = ((glGetMultiTexParameterfvEXT = (PFNGLGETMULTITEXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterfvEXT")) == NULL) || r; + r = ((glGetMultiTexParameterivEXT = (PFNGLGETMULTITEXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterivEXT")) == NULL) || r; + r = ((glGetNamedBufferParameterivEXT = (PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameterivEXT")) == NULL) || r; + r = ((glGetNamedBufferPointervEXT = (PFNGLGETNAMEDBUFFERPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferPointervEXT")) == NULL) || r; + r = ((glGetNamedBufferSubDataEXT = (PFNGLGETNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferSubDataEXT")) == NULL) || r; + r = ((glGetNamedFramebufferAttachmentParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferAttachmentParameterivEXT")) == NULL) || r; + r = ((glGetNamedProgramLocalParameterIivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterIivEXT")) == NULL) || r; + r = ((glGetNamedProgramLocalParameterIuivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterIuivEXT")) == NULL) || r; + r = ((glGetNamedProgramLocalParameterdvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterdvEXT")) == NULL) || r; + r = ((glGetNamedProgramLocalParameterfvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterfvEXT")) == NULL) || r; + r = ((glGetNamedProgramStringEXT = (PFNGLGETNAMEDPROGRAMSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramStringEXT")) == NULL) || r; + r = ((glGetNamedProgramivEXT = (PFNGLGETNAMEDPROGRAMIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramivEXT")) == NULL) || r; + r = ((glGetNamedRenderbufferParameterivEXT = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedRenderbufferParameterivEXT")) == NULL) || r; + r = ((glGetPointerIndexedvEXT = (PFNGLGETPOINTERINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPointerIndexedvEXT")) == NULL) || r; + r = ((glGetPointeri_vEXT = (PFNGLGETPOINTERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPointeri_vEXT")) == NULL) || r; + r = ((glGetTextureImageEXT = (PFNGLGETTEXTUREIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureImageEXT")) == NULL) || r; + r = ((glGetTextureLevelParameterfvEXT = (PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterfvEXT")) == NULL) || r; + r = ((glGetTextureLevelParameterivEXT = (PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterivEXT")) == NULL) || r; + r = ((glGetTextureParameterIivEXT = (PFNGLGETTEXTUREPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIivEXT")) == NULL) || r; + r = ((glGetTextureParameterIuivEXT = (PFNGLGETTEXTUREPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIuivEXT")) == NULL) || r; + r = ((glGetTextureParameterfvEXT = (PFNGLGETTEXTUREPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterfvEXT")) == NULL) || r; + r = ((glGetTextureParameterivEXT = (PFNGLGETTEXTUREPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterivEXT")) == NULL) || r; + r = ((glGetVertexArrayIntegeri_vEXT = (PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIntegeri_vEXT")) == NULL) || r; + r = ((glGetVertexArrayIntegervEXT = (PFNGLGETVERTEXARRAYINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIntegervEXT")) == NULL) || r; + r = ((glGetVertexArrayPointeri_vEXT = (PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayPointeri_vEXT")) == NULL) || r; + r = ((glGetVertexArrayPointervEXT = (PFNGLGETVERTEXARRAYPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayPointervEXT")) == NULL) || r; + r = ((glMapNamedBufferEXT = (PFNGLMAPNAMEDBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBufferEXT")) == NULL) || r; + r = ((glMapNamedBufferRangeEXT = (PFNGLMAPNAMEDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBufferRangeEXT")) == NULL) || r; + r = ((glMatrixFrustumEXT = (PFNGLMATRIXFRUSTUMEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixFrustumEXT")) == NULL) || r; + r = ((glMatrixLoadIdentityEXT = (PFNGLMATRIXLOADIDENTITYEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadIdentityEXT")) == NULL) || r; + r = ((glMatrixLoadTransposedEXT = (PFNGLMATRIXLOADTRANSPOSEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTransposedEXT")) == NULL) || r; + r = ((glMatrixLoadTransposefEXT = (PFNGLMATRIXLOADTRANSPOSEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTransposefEXT")) == NULL) || r; + r = ((glMatrixLoaddEXT = (PFNGLMATRIXLOADDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoaddEXT")) == NULL) || r; + r = ((glMatrixLoadfEXT = (PFNGLMATRIXLOADFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadfEXT")) == NULL) || r; + r = ((glMatrixMultTransposedEXT = (PFNGLMATRIXMULTTRANSPOSEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTransposedEXT")) == NULL) || r; + r = ((glMatrixMultTransposefEXT = (PFNGLMATRIXMULTTRANSPOSEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTransposefEXT")) == NULL) || r; + r = ((glMatrixMultdEXT = (PFNGLMATRIXMULTDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultdEXT")) == NULL) || r; + r = ((glMatrixMultfEXT = (PFNGLMATRIXMULTFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultfEXT")) == NULL) || r; + r = ((glMatrixOrthoEXT = (PFNGLMATRIXORTHOEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixOrthoEXT")) == NULL) || r; + r = ((glMatrixPopEXT = (PFNGLMATRIXPOPEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixPopEXT")) == NULL) || r; + r = ((glMatrixPushEXT = (PFNGLMATRIXPUSHEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixPushEXT")) == NULL) || r; + r = ((glMatrixRotatedEXT = (PFNGLMATRIXROTATEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixRotatedEXT")) == NULL) || r; + r = ((glMatrixRotatefEXT = (PFNGLMATRIXROTATEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixRotatefEXT")) == NULL) || r; + r = ((glMatrixScaledEXT = (PFNGLMATRIXSCALEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixScaledEXT")) == NULL) || r; + r = ((glMatrixScalefEXT = (PFNGLMATRIXSCALEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixScalefEXT")) == NULL) || r; + r = ((glMatrixTranslatedEXT = (PFNGLMATRIXTRANSLATEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixTranslatedEXT")) == NULL) || r; + r = ((glMatrixTranslatefEXT = (PFNGLMATRIXTRANSLATEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixTranslatefEXT")) == NULL) || r; + r = ((glMultiTexBufferEXT = (PFNGLMULTITEXBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexBufferEXT")) == NULL) || r; + r = ((glMultiTexCoordPointerEXT = (PFNGLMULTITEXCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordPointerEXT")) == NULL) || r; + r = ((glMultiTexEnvfEXT = (PFNGLMULTITEXENVFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvfEXT")) == NULL) || r; + r = ((glMultiTexEnvfvEXT = (PFNGLMULTITEXENVFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvfvEXT")) == NULL) || r; + r = ((glMultiTexEnviEXT = (PFNGLMULTITEXENVIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnviEXT")) == NULL) || r; + r = ((glMultiTexEnvivEXT = (PFNGLMULTITEXENVIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvivEXT")) == NULL) || r; + r = ((glMultiTexGendEXT = (PFNGLMULTITEXGENDEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGendEXT")) == NULL) || r; + r = ((glMultiTexGendvEXT = (PFNGLMULTITEXGENDVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGendvEXT")) == NULL) || r; + r = ((glMultiTexGenfEXT = (PFNGLMULTITEXGENFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenfEXT")) == NULL) || r; + r = ((glMultiTexGenfvEXT = (PFNGLMULTITEXGENFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenfvEXT")) == NULL) || r; + r = ((glMultiTexGeniEXT = (PFNGLMULTITEXGENIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGeniEXT")) == NULL) || r; + r = ((glMultiTexGenivEXT = (PFNGLMULTITEXGENIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenivEXT")) == NULL) || r; + r = ((glMultiTexImage1DEXT = (PFNGLMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage1DEXT")) == NULL) || r; + r = ((glMultiTexImage2DEXT = (PFNGLMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage2DEXT")) == NULL) || r; + r = ((glMultiTexImage3DEXT = (PFNGLMULTITEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage3DEXT")) == NULL) || r; + r = ((glMultiTexParameterIivEXT = (PFNGLMULTITEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterIivEXT")) == NULL) || r; + r = ((glMultiTexParameterIuivEXT = (PFNGLMULTITEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterIuivEXT")) == NULL) || r; + r = ((glMultiTexParameterfEXT = (PFNGLMULTITEXPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterfEXT")) == NULL) || r; + r = ((glMultiTexParameterfvEXT = (PFNGLMULTITEXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterfvEXT")) == NULL) || r; + r = ((glMultiTexParameteriEXT = (PFNGLMULTITEXPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameteriEXT")) == NULL) || r; + r = ((glMultiTexParameterivEXT = (PFNGLMULTITEXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterivEXT")) == NULL) || r; + r = ((glMultiTexRenderbufferEXT = (PFNGLMULTITEXRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexRenderbufferEXT")) == NULL) || r; + r = ((glMultiTexSubImage1DEXT = (PFNGLMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage1DEXT")) == NULL) || r; + r = ((glMultiTexSubImage2DEXT = (PFNGLMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage2DEXT")) == NULL) || r; + r = ((glMultiTexSubImage3DEXT = (PFNGLMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage3DEXT")) == NULL) || r; + r = ((glNamedBufferDataEXT = (PFNGLNAMEDBUFFERDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferDataEXT")) == NULL) || r; + r = ((glNamedBufferSubDataEXT = (PFNGLNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferSubDataEXT")) == NULL) || r; + r = ((glNamedCopyBufferSubDataEXT = (PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedCopyBufferSubDataEXT")) == NULL) || r; + r = ((glNamedFramebufferRenderbufferEXT = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferRenderbufferEXT")) == NULL) || r; + r = ((glNamedFramebufferTexture1DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture1DEXT")) == NULL) || r; + r = ((glNamedFramebufferTexture2DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture2DEXT")) == NULL) || r; + r = ((glNamedFramebufferTexture3DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture3DEXT")) == NULL) || r; + r = ((glNamedFramebufferTextureEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureEXT")) == NULL) || r; + r = ((glNamedFramebufferTextureFaceEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureFaceEXT")) == NULL) || r; + r = ((glNamedFramebufferTextureLayerEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureLayerEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameter4dEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4dEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameter4dvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4dvEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameter4fEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4fEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameter4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4fvEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameterI4iEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4iEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameterI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4ivEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameterI4uiEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4uiEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameterI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4uivEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameters4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameters4fvEXT")) == NULL) || r; + r = ((glNamedProgramLocalParametersI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParametersI4ivEXT")) == NULL) || r; + r = ((glNamedProgramLocalParametersI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParametersI4uivEXT")) == NULL) || r; + r = ((glNamedProgramStringEXT = (PFNGLNAMEDPROGRAMSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramStringEXT")) == NULL) || r; + r = ((glNamedRenderbufferStorageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageEXT")) == NULL) || r; + r = ((glNamedRenderbufferStorageMultisampleCoverageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisampleCoverageEXT")) == NULL) || r; + r = ((glNamedRenderbufferStorageMultisampleEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisampleEXT")) == NULL) || r; + r = ((glProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fEXT")) == NULL) || r; + r = ((glProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fvEXT")) == NULL) || r; + r = ((glProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1iEXT")) == NULL) || r; + r = ((glProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ivEXT")) == NULL) || r; + r = ((glProgramUniform1uiEXT = (PFNGLPROGRAMUNIFORM1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uiEXT")) == NULL) || r; + r = ((glProgramUniform1uivEXT = (PFNGLPROGRAMUNIFORM1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uivEXT")) == NULL) || r; + r = ((glProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fEXT")) == NULL) || r; + r = ((glProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fvEXT")) == NULL) || r; + r = ((glProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2iEXT")) == NULL) || r; + r = ((glProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ivEXT")) == NULL) || r; + r = ((glProgramUniform2uiEXT = (PFNGLPROGRAMUNIFORM2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uiEXT")) == NULL) || r; + r = ((glProgramUniform2uivEXT = (PFNGLPROGRAMUNIFORM2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uivEXT")) == NULL) || r; + r = ((glProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fEXT")) == NULL) || r; + r = ((glProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fvEXT")) == NULL) || r; + r = ((glProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3iEXT")) == NULL) || r; + r = ((glProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ivEXT")) == NULL) || r; + r = ((glProgramUniform3uiEXT = (PFNGLPROGRAMUNIFORM3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uiEXT")) == NULL) || r; + r = ((glProgramUniform3uivEXT = (PFNGLPROGRAMUNIFORM3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uivEXT")) == NULL) || r; + r = ((glProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fEXT")) == NULL) || r; + r = ((glProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fvEXT")) == NULL) || r; + r = ((glProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4iEXT")) == NULL) || r; + r = ((glProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ivEXT")) == NULL) || r; + r = ((glProgramUniform4uiEXT = (PFNGLPROGRAMUNIFORM4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uiEXT")) == NULL) || r; + r = ((glProgramUniform4uivEXT = (PFNGLPROGRAMUNIFORM4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uivEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3fvEXT")) == NULL) || r; + r = ((glPushClientAttribDefaultEXT = (PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC)glewGetProcAddress((const GLubyte*)"glPushClientAttribDefaultEXT")) == NULL) || r; + r = ((glTextureBufferEXT = (PFNGLTEXTUREBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTextureBufferEXT")) == NULL) || r; + r = ((glTextureImage1DEXT = (PFNGLTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage1DEXT")) == NULL) || r; + r = ((glTextureImage2DEXT = (PFNGLTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DEXT")) == NULL) || r; + r = ((glTextureImage3DEXT = (PFNGLTEXTUREIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DEXT")) == NULL) || r; + r = ((glTextureParameterIivEXT = (PFNGLTEXTUREPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIivEXT")) == NULL) || r; + r = ((glTextureParameterIuivEXT = (PFNGLTEXTUREPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIuivEXT")) == NULL) || r; + r = ((glTextureParameterfEXT = (PFNGLTEXTUREPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfEXT")) == NULL) || r; + r = ((glTextureParameterfvEXT = (PFNGLTEXTUREPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfvEXT")) == NULL) || r; + r = ((glTextureParameteriEXT = (PFNGLTEXTUREPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameteriEXT")) == NULL) || r; + r = ((glTextureParameterivEXT = (PFNGLTEXTUREPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterivEXT")) == NULL) || r; + r = ((glTextureRenderbufferEXT = (PFNGLTEXTURERENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTextureRenderbufferEXT")) == NULL) || r; + r = ((glTextureSubImage1DEXT = (PFNGLTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage1DEXT")) == NULL) || r; + r = ((glTextureSubImage2DEXT = (PFNGLTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage2DEXT")) == NULL) || r; + r = ((glTextureSubImage3DEXT = (PFNGLTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage3DEXT")) == NULL) || r; + r = ((glUnmapNamedBufferEXT = (PFNGLUNMAPNAMEDBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glUnmapNamedBufferEXT")) == NULL) || r; + r = ((glVertexArrayColorOffsetEXT = (PFNGLVERTEXARRAYCOLOROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayColorOffsetEXT")) == NULL) || r; + r = ((glVertexArrayEdgeFlagOffsetEXT = (PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayEdgeFlagOffsetEXT")) == NULL) || r; + r = ((glVertexArrayFogCoordOffsetEXT = (PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayFogCoordOffsetEXT")) == NULL) || r; + r = ((glVertexArrayIndexOffsetEXT = (PFNGLVERTEXARRAYINDEXOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayIndexOffsetEXT")) == NULL) || r; + r = ((glVertexArrayMultiTexCoordOffsetEXT = (PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayMultiTexCoordOffsetEXT")) == NULL) || r; + r = ((glVertexArrayNormalOffsetEXT = (PFNGLVERTEXARRAYNORMALOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayNormalOffsetEXT")) == NULL) || r; + r = ((glVertexArraySecondaryColorOffsetEXT = (PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArraySecondaryColorOffsetEXT")) == NULL) || r; + r = ((glVertexArrayTexCoordOffsetEXT = (PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayTexCoordOffsetEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribDivisorEXT = (PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribDivisorEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribIOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribIOffsetEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribOffsetEXT")) == NULL) || r; + r = ((glVertexArrayVertexOffsetEXT = (PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexOffsetEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_direct_state_access */ + +#ifdef GL_EXT_discard_framebuffer + +static GLboolean _glewInit_GL_EXT_discard_framebuffer () +{ + GLboolean r = GL_FALSE; + + r = ((glDiscardFramebufferEXT = (PFNGLDISCARDFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glDiscardFramebufferEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_discard_framebuffer */ + +#ifdef GL_EXT_draw_buffers + +static GLboolean _glewInit_GL_EXT_draw_buffers () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawBuffersEXT = (PFNGLDRAWBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_draw_buffers */ + #ifdef GL_EXT_draw_buffers2 -static GLboolean _glewInit_GL_EXT_draw_buffers2 (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_draw_buffers2 () { GLboolean r = GL_FALSE; @@ -3241,9 +12706,45 @@ static GLboolean _glewInit_GL_EXT_draw_buffers2 (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_EXT_draw_buffers2 */ +#ifdef GL_EXT_draw_buffers_indexed + +static GLboolean _glewInit_GL_EXT_draw_buffers_indexed () +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationSeparateiEXT = (PFNGLBLENDEQUATIONSEPARATEIEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateiEXT")) == NULL) || r; + r = ((glBlendEquationiEXT = (PFNGLBLENDEQUATIONIEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationiEXT")) == NULL) || r; + r = ((glBlendFuncSeparateiEXT = (PFNGLBLENDFUNCSEPARATEIEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateiEXT")) == NULL) || r; + r = ((glBlendFunciEXT = (PFNGLBLENDFUNCIEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendFunciEXT")) == NULL) || r; + r = ((glColorMaskiEXT = (PFNGLCOLORMASKIEXTPROC)glewGetProcAddress((const GLubyte*)"glColorMaskiEXT")) == NULL) || r; + r = ((glDisableiEXT = (PFNGLDISABLEIEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableiEXT")) == NULL) || r; + r = ((glEnableiEXT = (PFNGLENABLEIEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableiEXT")) == NULL) || r; + r = ((glIsEnablediEXT = (PFNGLISENABLEDIEXTPROC)glewGetProcAddress((const GLubyte*)"glIsEnablediEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_draw_buffers_indexed */ + +#ifdef GL_EXT_draw_elements_base_vertex + +static GLboolean _glewInit_GL_EXT_draw_elements_base_vertex () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawElementsBaseVertexEXT = (PFNGLDRAWELEMENTSBASEVERTEXEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsBaseVertexEXT")) == NULL) || r; + r = ((glDrawElementsInstancedBaseVertexEXT = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseVertexEXT")) == NULL) || r; + r = ((glDrawRangeElementsBaseVertexEXT = (PFNGLDRAWRANGEELEMENTSBASEVERTEXEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementsBaseVertexEXT")) == NULL) || r; + r = ((glMultiDrawElementsBaseVertexEXT = (PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsBaseVertexEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_draw_elements_base_vertex */ + #ifdef GL_EXT_draw_instanced -static GLboolean _glewInit_GL_EXT_draw_instanced (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_draw_instanced () { GLboolean r = GL_FALSE; @@ -3257,7 +12758,7 @@ static GLboolean _glewInit_GL_EXT_draw_instanced (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_EXT_draw_range_elements -static GLboolean _glewInit_GL_EXT_draw_range_elements (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_draw_range_elements () { GLboolean r = GL_FALSE; @@ -3268,9 +12769,23 @@ static GLboolean _glewInit_GL_EXT_draw_range_elements (GLEW_CONTEXT_ARG_DEF_INIT #endif /* GL_EXT_draw_range_elements */ +#ifdef GL_EXT_external_buffer + +static GLboolean _glewInit_GL_EXT_external_buffer () +{ + GLboolean r = GL_FALSE; + + r = ((glBufferStorageExternalEXT = (PFNGLBUFFERSTORAGEEXTERNALEXTPROC)glewGetProcAddress((const GLubyte*)"glBufferStorageExternalEXT")) == NULL) || r; + r = ((glNamedBufferStorageExternalEXT = (PFNGLNAMEDBUFFERSTORAGEEXTERNALEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferStorageExternalEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_external_buffer */ + #ifdef GL_EXT_fog_coord -static GLboolean _glewInit_GL_EXT_fog_coord (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_fog_coord () { GLboolean r = GL_FALSE; @@ -3287,7 +12802,7 @@ static GLboolean _glewInit_GL_EXT_fog_coord (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_EXT_fragment_lighting -static GLboolean _glewInit_GL_EXT_fragment_lighting (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_fragment_lighting () { GLboolean r = GL_FALSE; @@ -3317,7 +12832,7 @@ static GLboolean _glewInit_GL_EXT_fragment_lighting (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_EXT_framebuffer_blit -static GLboolean _glewInit_GL_EXT_framebuffer_blit (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_framebuffer_blit () { GLboolean r = GL_FALSE; @@ -3330,7 +12845,7 @@ static GLboolean _glewInit_GL_EXT_framebuffer_blit (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_EXT_framebuffer_multisample -static GLboolean _glewInit_GL_EXT_framebuffer_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_framebuffer_multisample () { GLboolean r = GL_FALSE; @@ -3343,7 +12858,7 @@ static GLboolean _glewInit_GL_EXT_framebuffer_multisample (GLEW_CONTEXT_ARG_DEF_ #ifdef GL_EXT_framebuffer_object -static GLboolean _glewInit_GL_EXT_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_framebuffer_object () { GLboolean r = GL_FALSE; @@ -3370,19 +12885,14 @@ static GLboolean _glewInit_GL_EXT_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_EXT_framebuffer_object */ -#ifdef GL_EXT_framebuffer_sRGB - -#endif /* GL_EXT_framebuffer_sRGB */ - #ifdef GL_EXT_geometry_shader4 -static GLboolean _glewInit_GL_EXT_geometry_shader4 (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_geometry_shader4 () { GLboolean r = GL_FALSE; r = ((glFramebufferTextureEXT = (PFNGLFRAMEBUFFERTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureEXT")) == NULL) || r; r = ((glFramebufferTextureFaceEXT = (PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureFaceEXT")) == NULL) || r; - r = ((glFramebufferTextureLayerEXT = (PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayerEXT")) == NULL) || r; r = ((glProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteriEXT")) == NULL) || r; return r; @@ -3392,7 +12902,7 @@ static GLboolean _glewInit_GL_EXT_geometry_shader4 (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_EXT_gpu_program_parameters -static GLboolean _glewInit_GL_EXT_gpu_program_parameters (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_gpu_program_parameters () { GLboolean r = GL_FALSE; @@ -3406,7 +12916,7 @@ static GLboolean _glewInit_GL_EXT_gpu_program_parameters (GLEW_CONTEXT_ARG_DEF_I #ifdef GL_EXT_gpu_shader4 -static GLboolean _glewInit_GL_EXT_gpu_shader4 (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_gpu_shader4 () { GLboolean r = GL_FALSE; @@ -3452,7 +12962,7 @@ static GLboolean _glewInit_GL_EXT_gpu_shader4 (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_EXT_histogram -static GLboolean _glewInit_GL_EXT_histogram (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_histogram () { GLboolean r = GL_FALSE; @@ -3472,13 +12982,9 @@ static GLboolean _glewInit_GL_EXT_histogram (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_EXT_histogram */ -#ifdef GL_EXT_index_array_formats - -#endif /* GL_EXT_index_array_formats */ - #ifdef GL_EXT_index_func -static GLboolean _glewInit_GL_EXT_index_func (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_index_func () { GLboolean r = GL_FALSE; @@ -3491,7 +12997,7 @@ static GLboolean _glewInit_GL_EXT_index_func (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_EXT_index_material -static GLboolean _glewInit_GL_EXT_index_material (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_index_material () { GLboolean r = GL_FALSE; @@ -3502,13 +13008,22 @@ static GLboolean _glewInit_GL_EXT_index_material (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_EXT_index_material */ -#ifdef GL_EXT_index_texture +#ifdef GL_EXT_instanced_arrays -#endif /* GL_EXT_index_texture */ +static GLboolean _glewInit_GL_EXT_instanced_arrays () +{ + GLboolean r = GL_FALSE; + + r = ((glVertexAttribDivisorEXT = (PFNGLVERTEXATTRIBDIVISOREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisorEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_instanced_arrays */ #ifdef GL_EXT_light_texture -static GLboolean _glewInit_GL_EXT_light_texture (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_light_texture () { GLboolean r = GL_FALSE; @@ -3521,13 +13036,81 @@ static GLboolean _glewInit_GL_EXT_light_texture (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_EXT_light_texture */ -#ifdef GL_EXT_misc_attribute +#ifdef GL_EXT_map_buffer_range -#endif /* GL_EXT_misc_attribute */ +static GLboolean _glewInit_GL_EXT_map_buffer_range () +{ + GLboolean r = GL_FALSE; + + r = ((glFlushMappedBufferRangeEXT = (PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedBufferRangeEXT")) == NULL) || r; + r = ((glMapBufferRangeEXT = (PFNGLMAPBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glMapBufferRangeEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_map_buffer_range */ + +#ifdef GL_EXT_memory_object + +static GLboolean _glewInit_GL_EXT_memory_object () +{ + GLboolean r = GL_FALSE; + + r = ((glBufferStorageMemEXT = (PFNGLBUFFERSTORAGEMEMEXTPROC)glewGetProcAddress((const GLubyte*)"glBufferStorageMemEXT")) == NULL) || r; + r = ((glCreateMemoryObjectsEXT = (PFNGLCREATEMEMORYOBJECTSEXTPROC)glewGetProcAddress((const GLubyte*)"glCreateMemoryObjectsEXT")) == NULL) || r; + r = ((glDeleteMemoryObjectsEXT = (PFNGLDELETEMEMORYOBJECTSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteMemoryObjectsEXT")) == NULL) || r; + r = ((glGetMemoryObjectParameterivEXT = (PFNGLGETMEMORYOBJECTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMemoryObjectParameterivEXT")) == NULL) || r; + r = ((glGetUnsignedBytei_vEXT = (PFNGLGETUNSIGNEDBYTEI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUnsignedBytei_vEXT")) == NULL) || r; + r = ((glGetUnsignedBytevEXT = (PFNGLGETUNSIGNEDBYTEVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUnsignedBytevEXT")) == NULL) || r; + r = ((glIsMemoryObjectEXT = (PFNGLISMEMORYOBJECTEXTPROC)glewGetProcAddress((const GLubyte*)"glIsMemoryObjectEXT")) == NULL) || r; + r = ((glMemoryObjectParameterivEXT = (PFNGLMEMORYOBJECTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMemoryObjectParameterivEXT")) == NULL) || r; + r = ((glNamedBufferStorageMemEXT = (PFNGLNAMEDBUFFERSTORAGEMEMEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferStorageMemEXT")) == NULL) || r; + r = ((glTexStorageMem1DEXT = (PFNGLTEXSTORAGEMEM1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexStorageMem1DEXT")) == NULL) || r; + r = ((glTexStorageMem2DEXT = (PFNGLTEXSTORAGEMEM2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexStorageMem2DEXT")) == NULL) || r; + r = ((glTexStorageMem2DMultisampleEXT = (PFNGLTEXSTORAGEMEM2DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTexStorageMem2DMultisampleEXT")) == NULL) || r; + r = ((glTexStorageMem3DEXT = (PFNGLTEXSTORAGEMEM3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexStorageMem3DEXT")) == NULL) || r; + r = ((glTexStorageMem3DMultisampleEXT = (PFNGLTEXSTORAGEMEM3DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTexStorageMem3DMultisampleEXT")) == NULL) || r; + r = ((glTextureStorageMem1DEXT = (PFNGLTEXTURESTORAGEMEM1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorageMem1DEXT")) == NULL) || r; + r = ((glTextureStorageMem2DEXT = (PFNGLTEXTURESTORAGEMEM2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorageMem2DEXT")) == NULL) || r; + r = ((glTextureStorageMem2DMultisampleEXT = (PFNGLTEXTURESTORAGEMEM2DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorageMem2DMultisampleEXT")) == NULL) || r; + r = ((glTextureStorageMem3DEXT = (PFNGLTEXTURESTORAGEMEM3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorageMem3DEXT")) == NULL) || r; + r = ((glTextureStorageMem3DMultisampleEXT = (PFNGLTEXTURESTORAGEMEM3DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorageMem3DMultisampleEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_memory_object */ + +#ifdef GL_EXT_memory_object_fd + +static GLboolean _glewInit_GL_EXT_memory_object_fd () +{ + GLboolean r = GL_FALSE; + + r = ((glImportMemoryFdEXT = (PFNGLIMPORTMEMORYFDEXTPROC)glewGetProcAddress((const GLubyte*)"glImportMemoryFdEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_memory_object_fd */ + +#ifdef GL_EXT_memory_object_win32 + +static GLboolean _glewInit_GL_EXT_memory_object_win32 () +{ + GLboolean r = GL_FALSE; + + r = ((glImportMemoryWin32HandleEXT = (PFNGLIMPORTMEMORYWIN32HANDLEEXTPROC)glewGetProcAddress((const GLubyte*)"glImportMemoryWin32HandleEXT")) == NULL) || r; + r = ((glImportMemoryWin32NameEXT = (PFNGLIMPORTMEMORYWIN32NAMEEXTPROC)glewGetProcAddress((const GLubyte*)"glImportMemoryWin32NameEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_memory_object_win32 */ #ifdef GL_EXT_multi_draw_arrays -static GLboolean _glewInit_GL_EXT_multi_draw_arrays (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_multi_draw_arrays () { GLboolean r = GL_FALSE; @@ -3539,9 +13122,23 @@ static GLboolean _glewInit_GL_EXT_multi_draw_arrays (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_EXT_multi_draw_arrays */ +#ifdef GL_EXT_multi_draw_indirect + +static GLboolean _glewInit_GL_EXT_multi_draw_indirect () +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysIndirectEXT = (PFNGLMULTIDRAWARRAYSINDIRECTEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectEXT")) == NULL) || r; + r = ((glMultiDrawElementsIndirectEXT = (PFNGLMULTIDRAWELEMENTSINDIRECTEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_multi_draw_indirect */ + #ifdef GL_EXT_multisample -static GLboolean _glewInit_GL_EXT_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_multisample () { GLboolean r = GL_FALSE; @@ -3553,21 +13150,37 @@ static GLboolean _glewInit_GL_EXT_multisample (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_EXT_multisample */ -#ifdef GL_EXT_packed_depth_stencil +#ifdef GL_EXT_multisampled_render_to_texture -#endif /* GL_EXT_packed_depth_stencil */ +static GLboolean _glewInit_GL_EXT_multisampled_render_to_texture () +{ + GLboolean r = GL_FALSE; -#ifdef GL_EXT_packed_float + r = ((glFramebufferTexture2DMultisampleEXT = (PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2DMultisampleEXT")) == NULL) || r; -#endif /* GL_EXT_packed_float */ + return r; +} -#ifdef GL_EXT_packed_pixels +#endif /* GL_EXT_multisampled_render_to_texture */ -#endif /* GL_EXT_packed_pixels */ +#ifdef GL_EXT_multiview_draw_buffers + +static GLboolean _glewInit_GL_EXT_multiview_draw_buffers () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawBuffersIndexedEXT = (PFNGLDRAWBUFFERSINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersIndexedEXT")) == NULL) || r; + r = ((glGetIntegeri_vEXT = (PFNGLGETINTEGERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetIntegeri_vEXT")) == NULL) || r; + r = ((glReadBufferIndexedEXT = (PFNGLREADBUFFERINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glReadBufferIndexedEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_multiview_draw_buffers */ #ifdef GL_EXT_paletted_texture -static GLboolean _glewInit_GL_EXT_paletted_texture (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_paletted_texture () { GLboolean r = GL_FALSE; @@ -3581,13 +13194,9 @@ static GLboolean _glewInit_GL_EXT_paletted_texture (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_EXT_paletted_texture */ -#ifdef GL_EXT_pixel_buffer_object - -#endif /* GL_EXT_pixel_buffer_object */ - #ifdef GL_EXT_pixel_transform -static GLboolean _glewInit_GL_EXT_pixel_transform (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_pixel_transform () { GLboolean r = GL_FALSE; @@ -3603,13 +13212,9 @@ static GLboolean _glewInit_GL_EXT_pixel_transform (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_EXT_pixel_transform */ -#ifdef GL_EXT_pixel_transform_color_table - -#endif /* GL_EXT_pixel_transform_color_table */ - #ifdef GL_EXT_point_parameters -static GLboolean _glewInit_GL_EXT_point_parameters (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_point_parameters () { GLboolean r = GL_FALSE; @@ -3623,7 +13228,7 @@ static GLboolean _glewInit_GL_EXT_point_parameters (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_EXT_polygon_offset -static GLboolean _glewInit_GL_EXT_polygon_offset (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_polygon_offset () { GLboolean r = GL_FALSE; @@ -3634,13 +13239,51 @@ static GLboolean _glewInit_GL_EXT_polygon_offset (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_EXT_polygon_offset */ -#ifdef GL_EXT_rescale_normal +#ifdef GL_EXT_polygon_offset_clamp -#endif /* GL_EXT_rescale_normal */ +static GLboolean _glewInit_GL_EXT_polygon_offset_clamp () +{ + GLboolean r = GL_FALSE; + + r = ((glPolygonOffsetClampEXT = (PFNGLPOLYGONOFFSETCLAMPEXTPROC)glewGetProcAddress((const GLubyte*)"glPolygonOffsetClampEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_polygon_offset_clamp */ + +#ifdef GL_EXT_provoking_vertex + +static GLboolean _glewInit_GL_EXT_provoking_vertex () +{ + GLboolean r = GL_FALSE; + + r = ((glProvokingVertexEXT = (PFNGLPROVOKINGVERTEXEXTPROC)glewGetProcAddress((const GLubyte*)"glProvokingVertexEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_provoking_vertex */ + +#ifdef GL_EXT_raster_multisample + +static GLboolean _glewInit_GL_EXT_raster_multisample () +{ + GLboolean r = GL_FALSE; + + r = ((glCoverageModulationNV = (PFNGLCOVERAGEMODULATIONNVPROC)glewGetProcAddress((const GLubyte*)"glCoverageModulationNV")) == NULL) || r; + r = ((glCoverageModulationTableNV = (PFNGLCOVERAGEMODULATIONTABLENVPROC)glewGetProcAddress((const GLubyte*)"glCoverageModulationTableNV")) == NULL) || r; + r = ((glGetCoverageModulationTableNV = (PFNGLGETCOVERAGEMODULATIONTABLENVPROC)glewGetProcAddress((const GLubyte*)"glGetCoverageModulationTableNV")) == NULL) || r; + r = ((glRasterSamplesEXT = (PFNGLRASTERSAMPLESEXTPROC)glewGetProcAddress((const GLubyte*)"glRasterSamplesEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_raster_multisample */ #ifdef GL_EXT_scene_marker -static GLboolean _glewInit_GL_EXT_scene_marker (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_scene_marker () { GLboolean r = GL_FALSE; @@ -3654,7 +13297,7 @@ static GLboolean _glewInit_GL_EXT_scene_marker (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_EXT_secondary_color -static GLboolean _glewInit_GL_EXT_secondary_color (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_secondary_color () { GLboolean r = GL_FALSE; @@ -3681,25 +13324,113 @@ static GLboolean _glewInit_GL_EXT_secondary_color (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_EXT_secondary_color */ -#ifdef GL_EXT_separate_specular_color +#ifdef GL_EXT_semaphore -#endif /* GL_EXT_separate_specular_color */ +static GLboolean _glewInit_GL_EXT_semaphore () +{ + GLboolean r = GL_FALSE; -#ifdef GL_EXT_shadow_funcs + r = ((glDeleteSemaphoresEXT = (PFNGLDELETESEMAPHORESEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteSemaphoresEXT")) == NULL) || r; + r = ((glGenSemaphoresEXT = (PFNGLGENSEMAPHORESEXTPROC)glewGetProcAddress((const GLubyte*)"glGenSemaphoresEXT")) == NULL) || r; + r = ((glGetSemaphoreParameterui64vEXT = (PFNGLGETSEMAPHOREPARAMETERUI64VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetSemaphoreParameterui64vEXT")) == NULL) || r; + r = ((glIsSemaphoreEXT = (PFNGLISSEMAPHOREEXTPROC)glewGetProcAddress((const GLubyte*)"glIsSemaphoreEXT")) == NULL) || r; + r = ((glSemaphoreParameterui64vEXT = (PFNGLSEMAPHOREPARAMETERUI64VEXTPROC)glewGetProcAddress((const GLubyte*)"glSemaphoreParameterui64vEXT")) == NULL) || r; + r = ((glSignalSemaphoreEXT = (PFNGLSIGNALSEMAPHOREEXTPROC)glewGetProcAddress((const GLubyte*)"glSignalSemaphoreEXT")) == NULL) || r; + r = ((glWaitSemaphoreEXT = (PFNGLWAITSEMAPHOREEXTPROC)glewGetProcAddress((const GLubyte*)"glWaitSemaphoreEXT")) == NULL) || r; -#endif /* GL_EXT_shadow_funcs */ + return r; +} -#ifdef GL_EXT_shared_texture_palette +#endif /* GL_EXT_semaphore */ -#endif /* GL_EXT_shared_texture_palette */ +#ifdef GL_EXT_semaphore_fd -#ifdef GL_EXT_stencil_clear_tag +static GLboolean _glewInit_GL_EXT_semaphore_fd () +{ + GLboolean r = GL_FALSE; -#endif /* GL_EXT_stencil_clear_tag */ + r = ((glImportSemaphoreFdEXT = (PFNGLIMPORTSEMAPHOREFDEXTPROC)glewGetProcAddress((const GLubyte*)"glImportSemaphoreFdEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_semaphore_fd */ + +#ifdef GL_EXT_semaphore_win32 + +static GLboolean _glewInit_GL_EXT_semaphore_win32 () +{ + GLboolean r = GL_FALSE; + + r = ((glImportSemaphoreWin32HandleEXT = (PFNGLIMPORTSEMAPHOREWIN32HANDLEEXTPROC)glewGetProcAddress((const GLubyte*)"glImportSemaphoreWin32HandleEXT")) == NULL) || r; + r = ((glImportSemaphoreWin32NameEXT = (PFNGLIMPORTSEMAPHOREWIN32NAMEEXTPROC)glewGetProcAddress((const GLubyte*)"glImportSemaphoreWin32NameEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_semaphore_win32 */ + +#ifdef GL_EXT_separate_shader_objects + +static GLboolean _glewInit_GL_EXT_separate_shader_objects () +{ + GLboolean r = GL_FALSE; + + r = ((glActiveProgramEXT = (PFNGLACTIVEPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glActiveProgramEXT")) == NULL) || r; + r = ((glCreateShaderProgramEXT = (PFNGLCREATESHADERPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderProgramEXT")) == NULL) || r; + r = ((glUseShaderProgramEXT = (PFNGLUSESHADERPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glUseShaderProgramEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_separate_shader_objects */ + +#ifdef GL_EXT_shader_image_load_store + +static GLboolean _glewInit_GL_EXT_shader_image_load_store () +{ + GLboolean r = GL_FALSE; + + r = ((glBindImageTextureEXT = (PFNGLBINDIMAGETEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindImageTextureEXT")) == NULL) || r; + r = ((glMemoryBarrierEXT = (PFNGLMEMORYBARRIEREXTPROC)glewGetProcAddress((const GLubyte*)"glMemoryBarrierEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_shader_image_load_store */ + +#ifdef GL_EXT_shader_pixel_local_storage2 + +static GLboolean _glewInit_GL_EXT_shader_pixel_local_storage2 () +{ + GLboolean r = GL_FALSE; + + r = ((glClearPixelLocalStorageuiEXT = (PFNGLCLEARPIXELLOCALSTORAGEUIEXTPROC)glewGetProcAddress((const GLubyte*)"glClearPixelLocalStorageuiEXT")) == NULL) || r; + r = ((glFramebufferPixelLocalStorageSizeEXT = (PFNGLFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferPixelLocalStorageSizeEXT")) == NULL) || r; + r = ((glGetFramebufferPixelLocalStorageSizeEXT = (PFNGLGETFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferPixelLocalStorageSizeEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_shader_pixel_local_storage2 */ + +#ifdef GL_EXT_sparse_texture + +static GLboolean _glewInit_GL_EXT_sparse_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glTexPageCommitmentEXT = (PFNGLTEXPAGECOMMITMENTEXTPROC)glewGetProcAddress((const GLubyte*)"glTexPageCommitmentEXT")) == NULL) || r; + r = ((glTexturePageCommitmentEXT = (PFNGLTEXTUREPAGECOMMITMENTEXTPROC)glewGetProcAddress((const GLubyte*)"glTexturePageCommitmentEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_sparse_texture */ #ifdef GL_EXT_stencil_two_side -static GLboolean _glewInit_GL_EXT_stencil_two_side (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_stencil_two_side () { GLboolean r = GL_FALSE; @@ -3710,13 +13441,9 @@ static GLboolean _glewInit_GL_EXT_stencil_two_side (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_EXT_stencil_two_side */ -#ifdef GL_EXT_stencil_wrap - -#endif /* GL_EXT_stencil_wrap */ - #ifdef GL_EXT_subtexture -static GLboolean _glewInit_GL_EXT_subtexture (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_subtexture () { GLboolean r = GL_FALSE; @@ -3729,13 +13456,9 @@ static GLboolean _glewInit_GL_EXT_subtexture (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_EXT_subtexture */ -#ifdef GL_EXT_texture - -#endif /* GL_EXT_texture */ - #ifdef GL_EXT_texture3D -static GLboolean _glewInit_GL_EXT_texture3D (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_texture3D () { GLboolean r = GL_FALSE; @@ -3748,11 +13471,20 @@ static GLboolean _glewInit_GL_EXT_texture3D (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_EXT_texture_array +static GLboolean _glewInit_GL_EXT_texture_array () +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferTextureLayerEXT = (PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayerEXT")) == NULL) || r; + + return r; +} + #endif /* GL_EXT_texture_array */ #ifdef GL_EXT_texture_buffer_object -static GLboolean _glewInit_GL_EXT_texture_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_texture_buffer_object () { GLboolean r = GL_FALSE; @@ -3763,53 +13495,9 @@ static GLboolean _glewInit_GL_EXT_texture_buffer_object (GLEW_CONTEXT_ARG_DEF_IN #endif /* GL_EXT_texture_buffer_object */ -#ifdef GL_EXT_texture_compression_dxt1 - -#endif /* GL_EXT_texture_compression_dxt1 */ - -#ifdef GL_EXT_texture_compression_latc - -#endif /* GL_EXT_texture_compression_latc */ - -#ifdef GL_EXT_texture_compression_rgtc - -#endif /* GL_EXT_texture_compression_rgtc */ - -#ifdef GL_EXT_texture_compression_s3tc - -#endif /* GL_EXT_texture_compression_s3tc */ - -#ifdef GL_EXT_texture_cube_map - -#endif /* GL_EXT_texture_cube_map */ - -#ifdef GL_EXT_texture_edge_clamp - -#endif /* GL_EXT_texture_edge_clamp */ - -#ifdef GL_EXT_texture_env - -#endif /* GL_EXT_texture_env */ - -#ifdef GL_EXT_texture_env_add - -#endif /* GL_EXT_texture_env_add */ - -#ifdef GL_EXT_texture_env_combine - -#endif /* GL_EXT_texture_env_combine */ - -#ifdef GL_EXT_texture_env_dot3 - -#endif /* GL_EXT_texture_env_dot3 */ - -#ifdef GL_EXT_texture_filter_anisotropic - -#endif /* GL_EXT_texture_filter_anisotropic */ - #ifdef GL_EXT_texture_integer -static GLboolean _glewInit_GL_EXT_texture_integer (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_texture_integer () { GLboolean r = GL_FALSE; @@ -3825,17 +13513,9 @@ static GLboolean _glewInit_GL_EXT_texture_integer (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_EXT_texture_integer */ -#ifdef GL_EXT_texture_lod_bias - -#endif /* GL_EXT_texture_lod_bias */ - -#ifdef GL_EXT_texture_mirror_clamp - -#endif /* GL_EXT_texture_mirror_clamp */ - #ifdef GL_EXT_texture_object -static GLboolean _glewInit_GL_EXT_texture_object (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_texture_object () { GLboolean r = GL_FALSE; @@ -3853,7 +13533,7 @@ static GLboolean _glewInit_GL_EXT_texture_object (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_EXT_texture_perturb_normal -static GLboolean _glewInit_GL_EXT_texture_perturb_normal (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_texture_perturb_normal () { GLboolean r = GL_FALSE; @@ -3864,21 +13544,40 @@ static GLboolean _glewInit_GL_EXT_texture_perturb_normal (GLEW_CONTEXT_ARG_DEF_I #endif /* GL_EXT_texture_perturb_normal */ -#ifdef GL_EXT_texture_rectangle +#ifdef GL_EXT_texture_storage -#endif /* GL_EXT_texture_rectangle */ +static GLboolean _glewInit_GL_EXT_texture_storage () +{ + GLboolean r = GL_FALSE; -#ifdef GL_EXT_texture_sRGB + r = ((glTexStorage1DEXT = (PFNGLTEXSTORAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexStorage1DEXT")) == NULL) || r; + r = ((glTexStorage2DEXT = (PFNGLTEXSTORAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexStorage2DEXT")) == NULL) || r; + r = ((glTexStorage3DEXT = (PFNGLTEXSTORAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexStorage3DEXT")) == NULL) || r; + r = ((glTextureStorage1DEXT = (PFNGLTEXTURESTORAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage1DEXT")) == NULL) || r; + r = ((glTextureStorage2DEXT = (PFNGLTEXTURESTORAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2DEXT")) == NULL) || r; + r = ((glTextureStorage3DEXT = (PFNGLTEXTURESTORAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3DEXT")) == NULL) || r; -#endif /* GL_EXT_texture_sRGB */ + return r; +} -#ifdef GL_EXT_texture_shared_exponent +#endif /* GL_EXT_texture_storage */ -#endif /* GL_EXT_texture_shared_exponent */ +#ifdef GL_EXT_texture_view + +static GLboolean _glewInit_GL_EXT_texture_view () +{ + GLboolean r = GL_FALSE; + + r = ((glTextureViewEXT = (PFNGLTEXTUREVIEWEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureViewEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_view */ #ifdef GL_EXT_timer_query -static GLboolean _glewInit_GL_EXT_timer_query (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_timer_query () { GLboolean r = GL_FALSE; @@ -3890,9 +13589,28 @@ static GLboolean _glewInit_GL_EXT_timer_query (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_EXT_timer_query */ +#ifdef GL_EXT_transform_feedback + +static GLboolean _glewInit_GL_EXT_transform_feedback () +{ + GLboolean r = GL_FALSE; + + r = ((glBeginTransformFeedbackEXT = (PFNGLBEGINTRANSFORMFEEDBACKEXTPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedbackEXT")) == NULL) || r; + r = ((glBindBufferBaseEXT = (PFNGLBINDBUFFERBASEEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBaseEXT")) == NULL) || r; + r = ((glBindBufferOffsetEXT = (PFNGLBINDBUFFEROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferOffsetEXT")) == NULL) || r; + r = ((glBindBufferRangeEXT = (PFNGLBINDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRangeEXT")) == NULL) || r; + r = ((glEndTransformFeedbackEXT = (PFNGLENDTRANSFORMFEEDBACKEXTPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedbackEXT")) == NULL) || r; + r = ((glGetTransformFeedbackVaryingEXT = (PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVaryingEXT")) == NULL) || r; + r = ((glTransformFeedbackVaryingsEXT = (PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryingsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_transform_feedback */ + #ifdef GL_EXT_vertex_array -static GLboolean _glewInit_GL_EXT_vertex_array (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_vertex_array () { GLboolean r = GL_FALSE; @@ -3900,7 +13618,6 @@ static GLboolean _glewInit_GL_EXT_vertex_array (GLEW_CONTEXT_ARG_DEF_INIT) r = ((glColorPointerEXT = (PFNGLCOLORPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glColorPointerEXT")) == NULL) || r; r = ((glDrawArraysEXT = (PFNGLDRAWARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysEXT")) == NULL) || r; r = ((glEdgeFlagPointerEXT = (PFNGLEDGEFLAGPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagPointerEXT")) == NULL) || r; - r = ((glGetPointervEXT = (PFNGLGETPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPointervEXT")) == NULL) || r; r = ((glIndexPointerEXT = (PFNGLINDEXPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glIndexPointerEXT")) == NULL) || r; r = ((glNormalPointerEXT = (PFNGLNORMALPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glNormalPointerEXT")) == NULL) || r; r = ((glTexCoordPointerEXT = (PFNGLTEXCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointerEXT")) == NULL) || r; @@ -3911,9 +13628,47 @@ static GLboolean _glewInit_GL_EXT_vertex_array (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_EXT_vertex_array */ +#ifdef GL_EXT_vertex_array_setXXX + +static GLboolean _glewInit_GL_EXT_vertex_array_setXXX () +{ + GLboolean r = GL_FALSE; + + r = ((glBindArraySetEXT = (PFNGLBINDARRAYSETEXTPROC)glewGetProcAddress((const GLubyte*)"glBindArraySetEXT")) == NULL) || r; + r = ((glCreateArraySetExt = (PFNGLCREATEARRAYSETEXTPROC)glewGetProcAddress((const GLubyte*)"glCreateArraySetExt")) == NULL) || r; + r = ((glDeleteArraySetsEXT = (PFNGLDELETEARRAYSETSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteArraySetsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_array_setXXX */ + +#ifdef GL_EXT_vertex_attrib_64bit + +static GLboolean _glewInit_GL_EXT_vertex_attrib_64bit () +{ + GLboolean r = GL_FALSE; + + r = ((glGetVertexAttribLdvEXT = (PFNGLGETVERTEXATTRIBLDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLdvEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribLOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribLOffsetEXT")) == NULL) || r; + r = ((glVertexAttribL1dEXT = (PFNGLVERTEXATTRIBL1DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dEXT")) == NULL) || r; + r = ((glVertexAttribL1dvEXT = (PFNGLVERTEXATTRIBL1DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dvEXT")) == NULL) || r; + r = ((glVertexAttribL2dEXT = (PFNGLVERTEXATTRIBL2DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dEXT")) == NULL) || r; + r = ((glVertexAttribL2dvEXT = (PFNGLVERTEXATTRIBL2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dvEXT")) == NULL) || r; + r = ((glVertexAttribL3dEXT = (PFNGLVERTEXATTRIBL3DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dEXT")) == NULL) || r; + r = ((glVertexAttribL3dvEXT = (PFNGLVERTEXATTRIBL3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dvEXT")) == NULL) || r; + r = ((glVertexAttribL4dEXT = (PFNGLVERTEXATTRIBL4DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dEXT")) == NULL) || r; + r = ((glVertexAttribL4dvEXT = (PFNGLVERTEXATTRIBL4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dvEXT")) == NULL) || r; + r = ((glVertexAttribLPointerEXT = (PFNGLVERTEXATTRIBLPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_attrib_64bit */ + #ifdef GL_EXT_vertex_shader -static GLboolean _glewInit_GL_EXT_vertex_shader (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_vertex_shader () { GLboolean r = GL_FALSE; @@ -3967,7 +13722,7 @@ static GLboolean _glewInit_GL_EXT_vertex_shader (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_EXT_vertex_weighting -static GLboolean _glewInit_GL_EXT_vertex_weighting (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_EXT_vertex_weighting () { GLboolean r = GL_FALSE; @@ -3980,9 +13735,49 @@ static GLboolean _glewInit_GL_EXT_vertex_weighting (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_EXT_vertex_weighting */ +#ifdef GL_EXT_win32_keyed_mutex + +static GLboolean _glewInit_GL_EXT_win32_keyed_mutex () +{ + GLboolean r = GL_FALSE; + + r = ((glAcquireKeyedMutexWin32EXT = (PFNGLACQUIREKEYEDMUTEXWIN32EXTPROC)glewGetProcAddress((const GLubyte*)"glAcquireKeyedMutexWin32EXT")) == NULL) || r; + r = ((glReleaseKeyedMutexWin32EXT = (PFNGLRELEASEKEYEDMUTEXWIN32EXTPROC)glewGetProcAddress((const GLubyte*)"glReleaseKeyedMutexWin32EXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_win32_keyed_mutex */ + +#ifdef GL_EXT_window_rectangles + +static GLboolean _glewInit_GL_EXT_window_rectangles () +{ + GLboolean r = GL_FALSE; + + r = ((glWindowRectanglesEXT = (PFNGLWINDOWRECTANGLESEXTPROC)glewGetProcAddress((const GLubyte*)"glWindowRectanglesEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_window_rectangles */ + +#ifdef GL_EXT_x11_sync_object + +static GLboolean _glewInit_GL_EXT_x11_sync_object () +{ + GLboolean r = GL_FALSE; + + r = ((glImportSyncEXT = (PFNGLIMPORTSYNCEXTPROC)glewGetProcAddress((const GLubyte*)"glImportSyncEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_x11_sync_object */ + #ifdef GL_GREMEDY_frame_terminator -static GLboolean _glewInit_GL_GREMEDY_frame_terminator (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_GREMEDY_frame_terminator () { GLboolean r = GL_FALSE; @@ -3995,7 +13790,7 @@ static GLboolean _glewInit_GL_GREMEDY_frame_terminator (GLEW_CONTEXT_ARG_DEF_INI #ifdef GL_GREMEDY_string_marker -static GLboolean _glewInit_GL_GREMEDY_string_marker (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_GREMEDY_string_marker () { GLboolean r = GL_FALSE; @@ -4006,13 +13801,9 @@ static GLboolean _glewInit_GL_GREMEDY_string_marker (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_GREMEDY_string_marker */ -#ifdef GL_HP_convolution_border_modes - -#endif /* GL_HP_convolution_border_modes */ - #ifdef GL_HP_image_transform -static GLboolean _glewInit_GL_HP_image_transform (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_HP_image_transform () { GLboolean r = GL_FALSE; @@ -4028,21 +13819,9 @@ static GLboolean _glewInit_GL_HP_image_transform (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_HP_image_transform */ -#ifdef GL_HP_occlusion_test - -#endif /* GL_HP_occlusion_test */ - -#ifdef GL_HP_texture_lighting - -#endif /* GL_HP_texture_lighting */ - -#ifdef GL_IBM_cull_vertex - -#endif /* GL_IBM_cull_vertex */ - #ifdef GL_IBM_multimode_draw_arrays -static GLboolean _glewInit_GL_IBM_multimode_draw_arrays (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_IBM_multimode_draw_arrays () { GLboolean r = GL_FALSE; @@ -4054,21 +13833,9 @@ static GLboolean _glewInit_GL_IBM_multimode_draw_arrays (GLEW_CONTEXT_ARG_DEF_IN #endif /* GL_IBM_multimode_draw_arrays */ -#ifdef GL_IBM_rasterpos_clip - -#endif /* GL_IBM_rasterpos_clip */ - -#ifdef GL_IBM_static_data - -#endif /* GL_IBM_static_data */ - -#ifdef GL_IBM_texture_mirrored_repeat - -#endif /* GL_IBM_texture_mirrored_repeat */ - #ifdef GL_IBM_vertex_array_lists -static GLboolean _glewInit_GL_IBM_vertex_array_lists (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_IBM_vertex_array_lists () { GLboolean r = GL_FALSE; @@ -4086,17 +13853,24 @@ static GLboolean _glewInit_GL_IBM_vertex_array_lists (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_IBM_vertex_array_lists */ -#ifdef GL_INGR_color_clamp +#ifdef GL_INTEL_map_texture -#endif /* GL_INGR_color_clamp */ +static GLboolean _glewInit_GL_INTEL_map_texture () +{ + GLboolean r = GL_FALSE; -#ifdef GL_INGR_interlace_read + r = ((glMapTexture2DINTEL = (PFNGLMAPTEXTURE2DINTELPROC)glewGetProcAddress((const GLubyte*)"glMapTexture2DINTEL")) == NULL) || r; + r = ((glSyncTextureINTEL = (PFNGLSYNCTEXTUREINTELPROC)glewGetProcAddress((const GLubyte*)"glSyncTextureINTEL")) == NULL) || r; + r = ((glUnmapTexture2DINTEL = (PFNGLUNMAPTEXTURE2DINTELPROC)glewGetProcAddress((const GLubyte*)"glUnmapTexture2DINTEL")) == NULL) || r; -#endif /* GL_INGR_interlace_read */ + return r; +} + +#endif /* GL_INTEL_map_texture */ #ifdef GL_INTEL_parallel_arrays -static GLboolean _glewInit_GL_INTEL_parallel_arrays (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_INTEL_parallel_arrays () { GLboolean r = GL_FALSE; @@ -4110,9 +13884,31 @@ static GLboolean _glewInit_GL_INTEL_parallel_arrays (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_INTEL_parallel_arrays */ +#ifdef GL_INTEL_performance_query + +static GLboolean _glewInit_GL_INTEL_performance_query () +{ + GLboolean r = GL_FALSE; + + r = ((glBeginPerfQueryINTEL = (PFNGLBEGINPERFQUERYINTELPROC)glewGetProcAddress((const GLubyte*)"glBeginPerfQueryINTEL")) == NULL) || r; + r = ((glCreatePerfQueryINTEL = (PFNGLCREATEPERFQUERYINTELPROC)glewGetProcAddress((const GLubyte*)"glCreatePerfQueryINTEL")) == NULL) || r; + r = ((glDeletePerfQueryINTEL = (PFNGLDELETEPERFQUERYINTELPROC)glewGetProcAddress((const GLubyte*)"glDeletePerfQueryINTEL")) == NULL) || r; + r = ((glEndPerfQueryINTEL = (PFNGLENDPERFQUERYINTELPROC)glewGetProcAddress((const GLubyte*)"glEndPerfQueryINTEL")) == NULL) || r; + r = ((glGetFirstPerfQueryIdINTEL = (PFNGLGETFIRSTPERFQUERYIDINTELPROC)glewGetProcAddress((const GLubyte*)"glGetFirstPerfQueryIdINTEL")) == NULL) || r; + r = ((glGetNextPerfQueryIdINTEL = (PFNGLGETNEXTPERFQUERYIDINTELPROC)glewGetProcAddress((const GLubyte*)"glGetNextPerfQueryIdINTEL")) == NULL) || r; + r = ((glGetPerfCounterInfoINTEL = (PFNGLGETPERFCOUNTERINFOINTELPROC)glewGetProcAddress((const GLubyte*)"glGetPerfCounterInfoINTEL")) == NULL) || r; + r = ((glGetPerfQueryDataINTEL = (PFNGLGETPERFQUERYDATAINTELPROC)glewGetProcAddress((const GLubyte*)"glGetPerfQueryDataINTEL")) == NULL) || r; + r = ((glGetPerfQueryIdByNameINTEL = (PFNGLGETPERFQUERYIDBYNAMEINTELPROC)glewGetProcAddress((const GLubyte*)"glGetPerfQueryIdByNameINTEL")) == NULL) || r; + r = ((glGetPerfQueryInfoINTEL = (PFNGLGETPERFQUERYINFOINTELPROC)glewGetProcAddress((const GLubyte*)"glGetPerfQueryInfoINTEL")) == NULL) || r; + + return r; +} + +#endif /* GL_INTEL_performance_query */ + #ifdef GL_INTEL_texture_scissor -static GLboolean _glewInit_GL_INTEL_texture_scissor (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_INTEL_texture_scissor () { GLboolean r = GL_FALSE; @@ -4124,34 +13920,90 @@ static GLboolean _glewInit_GL_INTEL_texture_scissor (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_INTEL_texture_scissor */ -#ifdef GL_KTX_buffer_region +#ifdef GL_KHR_blend_equation_advanced -static GLboolean _glewInit_GL_KTX_buffer_region (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_KHR_blend_equation_advanced () { GLboolean r = GL_FALSE; - r = ((glBufferRegionEnabledEXT = (PFNGLBUFFERREGIONENABLEDEXTPROC)glewGetProcAddress((const GLubyte*)"glBufferRegionEnabledEXT")) == NULL) || r; - r = ((glDeleteBufferRegionEXT = (PFNGLDELETEBUFFERREGIONEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteBufferRegionEXT")) == NULL) || r; - r = ((glDrawBufferRegionEXT = (PFNGLDRAWBUFFERREGIONEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawBufferRegionEXT")) == NULL) || r; - r = ((glNewBufferRegionEXT = (PFNGLNEWBUFFERREGIONEXTPROC)glewGetProcAddress((const GLubyte*)"glNewBufferRegionEXT")) == NULL) || r; - r = ((glReadBufferRegionEXT = (PFNGLREADBUFFERREGIONEXTPROC)glewGetProcAddress((const GLubyte*)"glReadBufferRegionEXT")) == NULL) || r; + r = ((glBlendBarrierKHR = (PFNGLBLENDBARRIERKHRPROC)glewGetProcAddress((const GLubyte*)"glBlendBarrierKHR")) == NULL) || r; + + return r; +} + +#endif /* GL_KHR_blend_equation_advanced */ + +#ifdef GL_KHR_debug + +static GLboolean _glewInit_GL_KHR_debug () +{ + GLboolean r = GL_FALSE; + + r = ((glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallback")) == NULL) || r; + r = ((glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageControl")) == NULL) || r; + r = ((glDebugMessageInsert = (PFNGLDEBUGMESSAGEINSERTPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsert")) == NULL) || r; + r = ((glGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLog")) == NULL) || r; + r = ((glGetObjectLabel = (PFNGLGETOBJECTLABELPROC)glewGetProcAddress((const GLubyte*)"glGetObjectLabel")) == NULL) || r; + r = ((glGetObjectPtrLabel = (PFNGLGETOBJECTPTRLABELPROC)glewGetProcAddress((const GLubyte*)"glGetObjectPtrLabel")) == NULL) || r; + r = ((glObjectLabel = (PFNGLOBJECTLABELPROC)glewGetProcAddress((const GLubyte*)"glObjectLabel")) == NULL) || r; + r = ((glObjectPtrLabel = (PFNGLOBJECTPTRLABELPROC)glewGetProcAddress((const GLubyte*)"glObjectPtrLabel")) == NULL) || r; + r = ((glPopDebugGroup = (PFNGLPOPDEBUGGROUPPROC)glewGetProcAddress((const GLubyte*)"glPopDebugGroup")) == NULL) || r; + r = ((glPushDebugGroup = (PFNGLPUSHDEBUGGROUPPROC)glewGetProcAddress((const GLubyte*)"glPushDebugGroup")) == NULL) || r; + + return r; +} + +#endif /* GL_KHR_debug */ + +#ifdef GL_KHR_parallel_shader_compile + +static GLboolean _glewInit_GL_KHR_parallel_shader_compile () +{ + GLboolean r = GL_FALSE; + + r = ((glMaxShaderCompilerThreadsKHR = (PFNGLMAXSHADERCOMPILERTHREADSKHRPROC)glewGetProcAddress((const GLubyte*)"glMaxShaderCompilerThreadsKHR")) == NULL) || r; + + return r; +} + +#endif /* GL_KHR_parallel_shader_compile */ + +#ifdef GL_KHR_robustness + +static GLboolean _glewInit_GL_KHR_robustness () +{ + GLboolean r = GL_FALSE; + + r = ((glGetnUniformfv = (PFNGLGETNUNIFORMFVPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformfv")) == NULL) || r; + r = ((glGetnUniformiv = (PFNGLGETNUNIFORMIVPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformiv")) == NULL) || r; + r = ((glGetnUniformuiv = (PFNGLGETNUNIFORMUIVPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformuiv")) == NULL) || r; + r = ((glReadnPixels = (PFNGLREADNPIXELSPROC)glewGetProcAddress((const GLubyte*)"glReadnPixels")) == NULL) || r; + + return r; +} + +#endif /* GL_KHR_robustness */ + +#ifdef GL_KTX_buffer_region + +static GLboolean _glewInit_GL_KTX_buffer_region () +{ + GLboolean r = GL_FALSE; + + r = ((glBufferRegionEnabled = (PFNGLBUFFERREGIONENABLEDPROC)glewGetProcAddress((const GLubyte*)"glBufferRegionEnabled")) == NULL) || r; + r = ((glDeleteBufferRegion = (PFNGLDELETEBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glDeleteBufferRegion")) == NULL) || r; + r = ((glDrawBufferRegion = (PFNGLDRAWBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glDrawBufferRegion")) == NULL) || r; + r = ((glNewBufferRegion = (PFNGLNEWBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glNewBufferRegion")) == NULL) || r; + r = ((glReadBufferRegion = (PFNGLREADBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glReadBufferRegion")) == NULL) || r; return r; } #endif /* GL_KTX_buffer_region */ -#ifdef GL_MESAX_texture_stack - -#endif /* GL_MESAX_texture_stack */ - -#ifdef GL_MESA_pack_invert - -#endif /* GL_MESA_pack_invert */ - #ifdef GL_MESA_resize_buffers -static GLboolean _glewInit_GL_MESA_resize_buffers (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_MESA_resize_buffers () { GLboolean r = GL_FALSE; @@ -4164,7 +14016,7 @@ static GLboolean _glewInit_GL_MESA_resize_buffers (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_MESA_window_pos -static GLboolean _glewInit_GL_MESA_window_pos (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_MESA_window_pos () { GLboolean r = GL_FALSE; @@ -4198,21 +14050,240 @@ static GLboolean _glewInit_GL_MESA_window_pos (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_MESA_window_pos */ -#ifdef GL_MESA_ycbcr_texture +#ifdef GL_NVX_conditional_render -#endif /* GL_MESA_ycbcr_texture */ +static GLboolean _glewInit_GL_NVX_conditional_render () +{ + GLboolean r = GL_FALSE; -#ifdef GL_NV_blend_square + r = ((glBeginConditionalRenderNVX = (PFNGLBEGINCONDITIONALRENDERNVXPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRenderNVX")) == NULL) || r; + r = ((glEndConditionalRenderNVX = (PFNGLENDCONDITIONALRENDERNVXPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRenderNVX")) == NULL) || r; -#endif /* GL_NV_blend_square */ + return r; +} -#ifdef GL_NV_copy_depth_to_color +#endif /* GL_NVX_conditional_render */ -#endif /* GL_NV_copy_depth_to_color */ +#ifdef GL_NVX_linked_gpu_multicast + +static GLboolean _glewInit_GL_NVX_linked_gpu_multicast () +{ + GLboolean r = GL_FALSE; + + r = ((glLGPUCopyImageSubDataNVX = (PFNGLLGPUCOPYIMAGESUBDATANVXPROC)glewGetProcAddress((const GLubyte*)"glLGPUCopyImageSubDataNVX")) == NULL) || r; + r = ((glLGPUInterlockNVX = (PFNGLLGPUINTERLOCKNVXPROC)glewGetProcAddress((const GLubyte*)"glLGPUInterlockNVX")) == NULL) || r; + r = ((glLGPUNamedBufferSubDataNVX = (PFNGLLGPUNAMEDBUFFERSUBDATANVXPROC)glewGetProcAddress((const GLubyte*)"glLGPUNamedBufferSubDataNVX")) == NULL) || r; + + return r; +} + +#endif /* GL_NVX_linked_gpu_multicast */ + +#ifdef GL_NV_3dvision_settings + +static GLboolean _glewInit_GL_NV_3dvision_settings () +{ + GLboolean r = GL_FALSE; + + r = ((glStereoParameterfNV = (PFNGLSTEREOPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glStereoParameterfNV")) == NULL) || r; + r = ((glStereoParameteriNV = (PFNGLSTEREOPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glStereoParameteriNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_3dvision_settings */ + +#ifdef GL_NV_bindless_multi_draw_indirect + +static GLboolean _glewInit_GL_NV_bindless_multi_draw_indirect () +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysIndirectBindlessNV = (PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectBindlessNV")) == NULL) || r; + r = ((glMultiDrawElementsIndirectBindlessNV = (PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectBindlessNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_bindless_multi_draw_indirect */ + +#ifdef GL_NV_bindless_multi_draw_indirect_count + +static GLboolean _glewInit_GL_NV_bindless_multi_draw_indirect_count () +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysIndirectBindlessCountNV = (PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectBindlessCountNV")) == NULL) || r; + r = ((glMultiDrawElementsIndirectBindlessCountNV = (PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectBindlessCountNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_bindless_multi_draw_indirect_count */ + +#ifdef GL_NV_bindless_texture + +static GLboolean _glewInit_GL_NV_bindless_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glGetImageHandleNV = (PFNGLGETIMAGEHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetImageHandleNV")) == NULL) || r; + r = ((glGetTextureHandleNV = (PFNGLGETTEXTUREHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureHandleNV")) == NULL) || r; + r = ((glGetTextureSamplerHandleNV = (PFNGLGETTEXTURESAMPLERHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureSamplerHandleNV")) == NULL) || r; + r = ((glIsImageHandleResidentNV = (PFNGLISIMAGEHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsImageHandleResidentNV")) == NULL) || r; + r = ((glIsTextureHandleResidentNV = (PFNGLISTEXTUREHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsTextureHandleResidentNV")) == NULL) || r; + r = ((glMakeImageHandleNonResidentNV = (PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleNonResidentNV")) == NULL) || r; + r = ((glMakeImageHandleResidentNV = (PFNGLMAKEIMAGEHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleResidentNV")) == NULL) || r; + r = ((glMakeTextureHandleNonResidentNV = (PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleNonResidentNV")) == NULL) || r; + r = ((glMakeTextureHandleResidentNV = (PFNGLMAKETEXTUREHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleResidentNV")) == NULL) || r; + r = ((glProgramUniformHandleui64NV = (PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64NV")) == NULL) || r; + r = ((glProgramUniformHandleui64vNV = (PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64vNV")) == NULL) || r; + r = ((glUniformHandleui64NV = (PFNGLUNIFORMHANDLEUI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64NV")) == NULL) || r; + r = ((glUniformHandleui64vNV = (PFNGLUNIFORMHANDLEUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64vNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_bindless_texture */ + +#ifdef GL_NV_blend_equation_advanced + +static GLboolean _glewInit_GL_NV_blend_equation_advanced () +{ + GLboolean r = GL_FALSE; + + r = ((glBlendBarrierNV = (PFNGLBLENDBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glBlendBarrierNV")) == NULL) || r; + r = ((glBlendParameteriNV = (PFNGLBLENDPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glBlendParameteriNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_blend_equation_advanced */ + +#ifdef GL_NV_clip_space_w_scaling + +static GLboolean _glewInit_GL_NV_clip_space_w_scaling () +{ + GLboolean r = GL_FALSE; + + r = ((glViewportPositionWScaleNV = (PFNGLVIEWPORTPOSITIONWSCALENVPROC)glewGetProcAddress((const GLubyte*)"glViewportPositionWScaleNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_clip_space_w_scaling */ + +#ifdef GL_NV_command_list + +static GLboolean _glewInit_GL_NV_command_list () +{ + GLboolean r = GL_FALSE; + + r = ((glCallCommandListNV = (PFNGLCALLCOMMANDLISTNVPROC)glewGetProcAddress((const GLubyte*)"glCallCommandListNV")) == NULL) || r; + r = ((glCommandListSegmentsNV = (PFNGLCOMMANDLISTSEGMENTSNVPROC)glewGetProcAddress((const GLubyte*)"glCommandListSegmentsNV")) == NULL) || r; + r = ((glCompileCommandListNV = (PFNGLCOMPILECOMMANDLISTNVPROC)glewGetProcAddress((const GLubyte*)"glCompileCommandListNV")) == NULL) || r; + r = ((glCreateCommandListsNV = (PFNGLCREATECOMMANDLISTSNVPROC)glewGetProcAddress((const GLubyte*)"glCreateCommandListsNV")) == NULL) || r; + r = ((glCreateStatesNV = (PFNGLCREATESTATESNVPROC)glewGetProcAddress((const GLubyte*)"glCreateStatesNV")) == NULL) || r; + r = ((glDeleteCommandListsNV = (PFNGLDELETECOMMANDLISTSNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteCommandListsNV")) == NULL) || r; + r = ((glDeleteStatesNV = (PFNGLDELETESTATESNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteStatesNV")) == NULL) || r; + r = ((glDrawCommandsAddressNV = (PFNGLDRAWCOMMANDSADDRESSNVPROC)glewGetProcAddress((const GLubyte*)"glDrawCommandsAddressNV")) == NULL) || r; + r = ((glDrawCommandsNV = (PFNGLDRAWCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glDrawCommandsNV")) == NULL) || r; + r = ((glDrawCommandsStatesAddressNV = (PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC)glewGetProcAddress((const GLubyte*)"glDrawCommandsStatesAddressNV")) == NULL) || r; + r = ((glDrawCommandsStatesNV = (PFNGLDRAWCOMMANDSSTATESNVPROC)glewGetProcAddress((const GLubyte*)"glDrawCommandsStatesNV")) == NULL) || r; + r = ((glGetCommandHeaderNV = (PFNGLGETCOMMANDHEADERNVPROC)glewGetProcAddress((const GLubyte*)"glGetCommandHeaderNV")) == NULL) || r; + r = ((glGetStageIndexNV = (PFNGLGETSTAGEINDEXNVPROC)glewGetProcAddress((const GLubyte*)"glGetStageIndexNV")) == NULL) || r; + r = ((glIsCommandListNV = (PFNGLISCOMMANDLISTNVPROC)glewGetProcAddress((const GLubyte*)"glIsCommandListNV")) == NULL) || r; + r = ((glIsStateNV = (PFNGLISSTATENVPROC)glewGetProcAddress((const GLubyte*)"glIsStateNV")) == NULL) || r; + r = ((glListDrawCommandsStatesClientNV = (PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC)glewGetProcAddress((const GLubyte*)"glListDrawCommandsStatesClientNV")) == NULL) || r; + r = ((glStateCaptureNV = (PFNGLSTATECAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glStateCaptureNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_command_list */ + +#ifdef GL_NV_conditional_render + +static GLboolean _glewInit_GL_NV_conditional_render () +{ + GLboolean r = GL_FALSE; + + r = ((glBeginConditionalRenderNV = (PFNGLBEGINCONDITIONALRENDERNVPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRenderNV")) == NULL) || r; + r = ((glEndConditionalRenderNV = (PFNGLENDCONDITIONALRENDERNVPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRenderNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_conditional_render */ + +#ifdef GL_NV_conservative_raster + +static GLboolean _glewInit_GL_NV_conservative_raster () +{ + GLboolean r = GL_FALSE; + + r = ((glSubpixelPrecisionBiasNV = (PFNGLSUBPIXELPRECISIONBIASNVPROC)glewGetProcAddress((const GLubyte*)"glSubpixelPrecisionBiasNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_conservative_raster */ + +#ifdef GL_NV_conservative_raster_dilate + +static GLboolean _glewInit_GL_NV_conservative_raster_dilate () +{ + GLboolean r = GL_FALSE; + + r = ((glConservativeRasterParameterfNV = (PFNGLCONSERVATIVERASTERPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glConservativeRasterParameterfNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_conservative_raster_dilate */ + +#ifdef GL_NV_conservative_raster_pre_snap_triangles + +static GLboolean _glewInit_GL_NV_conservative_raster_pre_snap_triangles () +{ + GLboolean r = GL_FALSE; + + r = ((glConservativeRasterParameteriNV = (PFNGLCONSERVATIVERASTERPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glConservativeRasterParameteriNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_conservative_raster_pre_snap_triangles */ + +#ifdef GL_NV_copy_buffer + +static GLboolean _glewInit_GL_NV_copy_buffer () +{ + GLboolean r = GL_FALSE; + + r = ((glCopyBufferSubDataNV = (PFNGLCOPYBUFFERSUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glCopyBufferSubDataNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_copy_buffer */ + +#ifdef GL_NV_copy_image + +static GLboolean _glewInit_GL_NV_copy_image () +{ + GLboolean r = GL_FALSE; + + r = ((glCopyImageSubDataNV = (PFNGLCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glCopyImageSubDataNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_copy_image */ #ifdef GL_NV_depth_buffer_float -static GLboolean _glewInit_GL_NV_depth_buffer_float (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_NV_depth_buffer_float () { GLboolean r = GL_FALSE; @@ -4225,17 +14296,66 @@ static GLboolean _glewInit_GL_NV_depth_buffer_float (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_NV_depth_buffer_float */ -#ifdef GL_NV_depth_clamp +#ifdef GL_NV_draw_buffers -#endif /* GL_NV_depth_clamp */ +static GLboolean _glewInit_GL_NV_draw_buffers () +{ + GLboolean r = GL_FALSE; -#ifdef GL_NV_depth_range_unclamped + r = ((glDrawBuffersNV = (PFNGLDRAWBUFFERSNVPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersNV")) == NULL) || r; -#endif /* GL_NV_depth_range_unclamped */ + return r; +} + +#endif /* GL_NV_draw_buffers */ + +#ifdef GL_NV_draw_instanced + +static GLboolean _glewInit_GL_NV_draw_instanced () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstancedNV = (PFNGLDRAWARRAYSINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedNV")) == NULL) || r; + r = ((glDrawElementsInstancedNV = (PFNGLDRAWELEMENTSINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_draw_instanced */ + +#ifdef GL_NV_draw_texture + +static GLboolean _glewInit_GL_NV_draw_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawTextureNV = (PFNGLDRAWTEXTURENVPROC)glewGetProcAddress((const GLubyte*)"glDrawTextureNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_draw_texture */ + +#ifdef GL_NV_draw_vulkan_image + +static GLboolean _glewInit_GL_NV_draw_vulkan_image () +{ + GLboolean r = GL_FALSE; + + r = ((glDrawVkImageNV = (PFNGLDRAWVKIMAGENVPROC)glewGetProcAddress((const GLubyte*)"glDrawVkImageNV")) == NULL) || r; + r = ((glGetVkProcAddrNV = (PFNGLGETVKPROCADDRNVPROC)glewGetProcAddress((const GLubyte*)"glGetVkProcAddrNV")) == NULL) || r; + r = ((glSignalVkFenceNV = (PFNGLSIGNALVKFENCENVPROC)glewGetProcAddress((const GLubyte*)"glSignalVkFenceNV")) == NULL) || r; + r = ((glSignalVkSemaphoreNV = (PFNGLSIGNALVKSEMAPHORENVPROC)glewGetProcAddress((const GLubyte*)"glSignalVkSemaphoreNV")) == NULL) || r; + r = ((glWaitVkSemaphoreNV = (PFNGLWAITVKSEMAPHORENVPROC)glewGetProcAddress((const GLubyte*)"glWaitVkSemaphoreNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_draw_vulkan_image */ #ifdef GL_NV_evaluators -static GLboolean _glewInit_GL_NV_evaluators (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_NV_evaluators () { GLboolean r = GL_FALSE; @@ -4254,9 +14374,24 @@ static GLboolean _glewInit_GL_NV_evaluators (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_NV_evaluators */ +#ifdef GL_NV_explicit_multisample + +static GLboolean _glewInit_GL_NV_explicit_multisample () +{ + GLboolean r = GL_FALSE; + + r = ((glGetMultisamplefvNV = (PFNGLGETMULTISAMPLEFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMultisamplefvNV")) == NULL) || r; + r = ((glSampleMaskIndexedNV = (PFNGLSAMPLEMASKINDEXEDNVPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskIndexedNV")) == NULL) || r; + r = ((glTexRenderbufferNV = (PFNGLTEXRENDERBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"glTexRenderbufferNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_explicit_multisample */ + #ifdef GL_NV_fence -static GLboolean _glewInit_GL_NV_fence (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_NV_fence () { GLboolean r = GL_FALSE; @@ -4273,17 +14408,22 @@ static GLboolean _glewInit_GL_NV_fence (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_NV_fence */ -#ifdef GL_NV_float_buffer +#ifdef GL_NV_fragment_coverage_to_color -#endif /* GL_NV_float_buffer */ +static GLboolean _glewInit_GL_NV_fragment_coverage_to_color () +{ + GLboolean r = GL_FALSE; -#ifdef GL_NV_fog_distance + r = ((glFragmentCoverageColorNV = (PFNGLFRAGMENTCOVERAGECOLORNVPROC)glewGetProcAddress((const GLubyte*)"glFragmentCoverageColorNV")) == NULL) || r; -#endif /* GL_NV_fog_distance */ + return r; +} + +#endif /* GL_NV_fragment_coverage_to_color */ #ifdef GL_NV_fragment_program -static GLboolean _glewInit_GL_NV_fragment_program (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_NV_fragment_program () { GLboolean r = GL_FALSE; @@ -4299,21 +14439,35 @@ static GLboolean _glewInit_GL_NV_fragment_program (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_NV_fragment_program */ -#ifdef GL_NV_fragment_program2 +#ifdef GL_NV_framebuffer_blit -#endif /* GL_NV_fragment_program2 */ +static GLboolean _glewInit_GL_NV_framebuffer_blit () +{ + GLboolean r = GL_FALSE; -#ifdef GL_NV_fragment_program4 + r = ((glBlitFramebufferNV = (PFNGLBLITFRAMEBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebufferNV")) == NULL) || r; -#endif /* GL_NV_fragment_program4 */ + return r; +} -#ifdef GL_NV_fragment_program_option +#endif /* GL_NV_framebuffer_blit */ -#endif /* GL_NV_fragment_program_option */ +#ifdef GL_NV_framebuffer_multisample + +static GLboolean _glewInit_GL_NV_framebuffer_multisample () +{ + GLboolean r = GL_FALSE; + + r = ((glRenderbufferStorageMultisampleNV = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_framebuffer_multisample */ #ifdef GL_NV_framebuffer_multisample_coverage -static GLboolean _glewInit_GL_NV_framebuffer_multisample_coverage (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_NV_framebuffer_multisample_coverage () { GLboolean r = GL_FALSE; @@ -4326,7 +14480,7 @@ static GLboolean _glewInit_GL_NV_framebuffer_multisample_coverage (GLEW_CONTEXT_ #ifdef GL_NV_geometry_program4 -static GLboolean _glewInit_GL_NV_geometry_program4 (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_NV_geometry_program4 () { GLboolean r = GL_FALSE; @@ -4337,13 +14491,33 @@ static GLboolean _glewInit_GL_NV_geometry_program4 (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_NV_geometry_program4 */ -#ifdef GL_NV_geometry_shader4 +#ifdef GL_NV_gpu_multicast -#endif /* GL_NV_geometry_shader4 */ +static GLboolean _glewInit_GL_NV_gpu_multicast () +{ + GLboolean r = GL_FALSE; + + r = ((glMulticastBarrierNV = (PFNGLMULTICASTBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glMulticastBarrierNV")) == NULL) || r; + r = ((glMulticastBlitFramebufferNV = (PFNGLMULTICASTBLITFRAMEBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"glMulticastBlitFramebufferNV")) == NULL) || r; + r = ((glMulticastBufferSubDataNV = (PFNGLMULTICASTBUFFERSUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glMulticastBufferSubDataNV")) == NULL) || r; + r = ((glMulticastCopyBufferSubDataNV = (PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glMulticastCopyBufferSubDataNV")) == NULL) || r; + r = ((glMulticastCopyImageSubDataNV = (PFNGLMULTICASTCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glMulticastCopyImageSubDataNV")) == NULL) || r; + r = ((glMulticastFramebufferSampleLocationsfvNV = (PFNGLMULTICASTFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)glewGetProcAddress((const GLubyte*)"glMulticastFramebufferSampleLocationsfvNV")) == NULL) || r; + r = ((glMulticastGetQueryObjecti64vNV = (PFNGLMULTICASTGETQUERYOBJECTI64VNVPROC)glewGetProcAddress((const GLubyte*)"glMulticastGetQueryObjecti64vNV")) == NULL) || r; + r = ((glMulticastGetQueryObjectivNV = (PFNGLMULTICASTGETQUERYOBJECTIVNVPROC)glewGetProcAddress((const GLubyte*)"glMulticastGetQueryObjectivNV")) == NULL) || r; + r = ((glMulticastGetQueryObjectui64vNV = (PFNGLMULTICASTGETQUERYOBJECTUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glMulticastGetQueryObjectui64vNV")) == NULL) || r; + r = ((glMulticastGetQueryObjectuivNV = (PFNGLMULTICASTGETQUERYOBJECTUIVNVPROC)glewGetProcAddress((const GLubyte*)"glMulticastGetQueryObjectuivNV")) == NULL) || r; + r = ((glMulticastWaitSyncNV = (PFNGLMULTICASTWAITSYNCNVPROC)glewGetProcAddress((const GLubyte*)"glMulticastWaitSyncNV")) == NULL) || r; + r = ((glRenderGpuMaskNV = (PFNGLRENDERGPUMASKNVPROC)glewGetProcAddress((const GLubyte*)"glRenderGpuMaskNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_gpu_multicast */ #ifdef GL_NV_gpu_program4 -static GLboolean _glewInit_GL_NV_gpu_program4 (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_NV_gpu_program4 () { GLboolean r = GL_FALSE; @@ -4365,9 +14539,55 @@ static GLboolean _glewInit_GL_NV_gpu_program4 (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_NV_gpu_program4 */ +#ifdef GL_NV_gpu_shader5 + +static GLboolean _glewInit_GL_NV_gpu_shader5 () +{ + GLboolean r = GL_FALSE; + + r = ((glGetUniformi64vNV = (PFNGLGETUNIFORMI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformi64vNV")) == NULL) || r; + r = ((glGetUniformui64vNV = (PFNGLGETUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformui64vNV")) == NULL) || r; + r = ((glProgramUniform1i64NV = (PFNGLPROGRAMUNIFORM1I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64NV")) == NULL) || r; + r = ((glProgramUniform1i64vNV = (PFNGLPROGRAMUNIFORM1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64vNV")) == NULL) || r; + r = ((glProgramUniform1ui64NV = (PFNGLPROGRAMUNIFORM1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64NV")) == NULL) || r; + r = ((glProgramUniform1ui64vNV = (PFNGLPROGRAMUNIFORM1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64vNV")) == NULL) || r; + r = ((glProgramUniform2i64NV = (PFNGLPROGRAMUNIFORM2I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64NV")) == NULL) || r; + r = ((glProgramUniform2i64vNV = (PFNGLPROGRAMUNIFORM2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64vNV")) == NULL) || r; + r = ((glProgramUniform2ui64NV = (PFNGLPROGRAMUNIFORM2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64NV")) == NULL) || r; + r = ((glProgramUniform2ui64vNV = (PFNGLPROGRAMUNIFORM2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64vNV")) == NULL) || r; + r = ((glProgramUniform3i64NV = (PFNGLPROGRAMUNIFORM3I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64NV")) == NULL) || r; + r = ((glProgramUniform3i64vNV = (PFNGLPROGRAMUNIFORM3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64vNV")) == NULL) || r; + r = ((glProgramUniform3ui64NV = (PFNGLPROGRAMUNIFORM3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64NV")) == NULL) || r; + r = ((glProgramUniform3ui64vNV = (PFNGLPROGRAMUNIFORM3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64vNV")) == NULL) || r; + r = ((glProgramUniform4i64NV = (PFNGLPROGRAMUNIFORM4I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64NV")) == NULL) || r; + r = ((glProgramUniform4i64vNV = (PFNGLPROGRAMUNIFORM4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64vNV")) == NULL) || r; + r = ((glProgramUniform4ui64NV = (PFNGLPROGRAMUNIFORM4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64NV")) == NULL) || r; + r = ((glProgramUniform4ui64vNV = (PFNGLPROGRAMUNIFORM4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64vNV")) == NULL) || r; + r = ((glUniform1i64NV = (PFNGLUNIFORM1I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64NV")) == NULL) || r; + r = ((glUniform1i64vNV = (PFNGLUNIFORM1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64vNV")) == NULL) || r; + r = ((glUniform1ui64NV = (PFNGLUNIFORM1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64NV")) == NULL) || r; + r = ((glUniform1ui64vNV = (PFNGLUNIFORM1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64vNV")) == NULL) || r; + r = ((glUniform2i64NV = (PFNGLUNIFORM2I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64NV")) == NULL) || r; + r = ((glUniform2i64vNV = (PFNGLUNIFORM2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64vNV")) == NULL) || r; + r = ((glUniform2ui64NV = (PFNGLUNIFORM2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64NV")) == NULL) || r; + r = ((glUniform2ui64vNV = (PFNGLUNIFORM2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64vNV")) == NULL) || r; + r = ((glUniform3i64NV = (PFNGLUNIFORM3I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64NV")) == NULL) || r; + r = ((glUniform3i64vNV = (PFNGLUNIFORM3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64vNV")) == NULL) || r; + r = ((glUniform3ui64NV = (PFNGLUNIFORM3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64NV")) == NULL) || r; + r = ((glUniform3ui64vNV = (PFNGLUNIFORM3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64vNV")) == NULL) || r; + r = ((glUniform4i64NV = (PFNGLUNIFORM4I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64NV")) == NULL) || r; + r = ((glUniform4i64vNV = (PFNGLUNIFORM4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64vNV")) == NULL) || r; + r = ((glUniform4ui64NV = (PFNGLUNIFORM4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64NV")) == NULL) || r; + r = ((glUniform4ui64vNV = (PFNGLUNIFORM4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64vNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_gpu_shader5 */ + #ifdef GL_NV_half_float -static GLboolean _glewInit_GL_NV_half_float (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_NV_half_float () { GLboolean r = GL_FALSE; @@ -4423,17 +14643,53 @@ static GLboolean _glewInit_GL_NV_half_float (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_NV_half_float */ -#ifdef GL_NV_light_max_exponent +#ifdef GL_NV_instanced_arrays -#endif /* GL_NV_light_max_exponent */ +static GLboolean _glewInit_GL_NV_instanced_arrays () +{ + GLboolean r = GL_FALSE; -#ifdef GL_NV_multisample_filter_hint + r = ((glVertexAttribDivisorNV = (PFNGLVERTEXATTRIBDIVISORNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisorNV")) == NULL) || r; -#endif /* GL_NV_multisample_filter_hint */ + return r; +} + +#endif /* GL_NV_instanced_arrays */ + +#ifdef GL_NV_internalformat_sample_query + +static GLboolean _glewInit_GL_NV_internalformat_sample_query () +{ + GLboolean r = GL_FALSE; + + r = ((glGetInternalformatSampleivNV = (PFNGLGETINTERNALFORMATSAMPLEIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetInternalformatSampleivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_internalformat_sample_query */ + +#ifdef GL_NV_non_square_matrices + +static GLboolean _glewInit_GL_NV_non_square_matrices () +{ + GLboolean r = GL_FALSE; + + r = ((glUniformMatrix2x3fvNV = (PFNGLUNIFORMMATRIX2X3FVNVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x3fvNV")) == NULL) || r; + r = ((glUniformMatrix2x4fvNV = (PFNGLUNIFORMMATRIX2X4FVNVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x4fvNV")) == NULL) || r; + r = ((glUniformMatrix3x2fvNV = (PFNGLUNIFORMMATRIX3X2FVNVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x2fvNV")) == NULL) || r; + r = ((glUniformMatrix3x4fvNV = (PFNGLUNIFORMMATRIX3X4FVNVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x4fvNV")) == NULL) || r; + r = ((glUniformMatrix4x2fvNV = (PFNGLUNIFORMMATRIX4X2FVNVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x2fvNV")) == NULL) || r; + r = ((glUniformMatrix4x3fvNV = (PFNGLUNIFORMMATRIX4X3FVNVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x3fvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_non_square_matrices */ #ifdef GL_NV_occlusion_query -static GLboolean _glewInit_GL_NV_occlusion_query (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_NV_occlusion_query () { GLboolean r = GL_FALSE; @@ -4450,13 +14706,9 @@ static GLboolean _glewInit_GL_NV_occlusion_query (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_NV_occlusion_query */ -#ifdef GL_NV_packed_depth_stencil - -#endif /* GL_NV_packed_depth_stencil */ - #ifdef GL_NV_parameter_buffer_object -static GLboolean _glewInit_GL_NV_parameter_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_NV_parameter_buffer_object () { GLboolean r = GL_FALSE; @@ -4469,9 +14721,85 @@ static GLboolean _glewInit_GL_NV_parameter_buffer_object (GLEW_CONTEXT_ARG_DEF_I #endif /* GL_NV_parameter_buffer_object */ +#ifdef GL_NV_path_rendering + +static GLboolean _glewInit_GL_NV_path_rendering () +{ + GLboolean r = GL_FALSE; + + r = ((glCopyPathNV = (PFNGLCOPYPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCopyPathNV")) == NULL) || r; + r = ((glCoverFillPathInstancedNV = (PFNGLCOVERFILLPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glCoverFillPathInstancedNV")) == NULL) || r; + r = ((glCoverFillPathNV = (PFNGLCOVERFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCoverFillPathNV")) == NULL) || r; + r = ((glCoverStrokePathInstancedNV = (PFNGLCOVERSTROKEPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glCoverStrokePathInstancedNV")) == NULL) || r; + r = ((glCoverStrokePathNV = (PFNGLCOVERSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCoverStrokePathNV")) == NULL) || r; + r = ((glDeletePathsNV = (PFNGLDELETEPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glDeletePathsNV")) == NULL) || r; + r = ((glGenPathsNV = (PFNGLGENPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glGenPathsNV")) == NULL) || r; + r = ((glGetPathColorGenfvNV = (PFNGLGETPATHCOLORGENFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathColorGenfvNV")) == NULL) || r; + r = ((glGetPathColorGenivNV = (PFNGLGETPATHCOLORGENIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathColorGenivNV")) == NULL) || r; + r = ((glGetPathCommandsNV = (PFNGLGETPATHCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathCommandsNV")) == NULL) || r; + r = ((glGetPathCoordsNV = (PFNGLGETPATHCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathCoordsNV")) == NULL) || r; + r = ((glGetPathDashArrayNV = (PFNGLGETPATHDASHARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathDashArrayNV")) == NULL) || r; + r = ((glGetPathLengthNV = (PFNGLGETPATHLENGTHNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathLengthNV")) == NULL) || r; + r = ((glGetPathMetricRangeNV = (PFNGLGETPATHMETRICRANGENVPROC)glewGetProcAddress((const GLubyte*)"glGetPathMetricRangeNV")) == NULL) || r; + r = ((glGetPathMetricsNV = (PFNGLGETPATHMETRICSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathMetricsNV")) == NULL) || r; + r = ((glGetPathParameterfvNV = (PFNGLGETPATHPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathParameterfvNV")) == NULL) || r; + r = ((glGetPathParameterivNV = (PFNGLGETPATHPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathParameterivNV")) == NULL) || r; + r = ((glGetPathSpacingNV = (PFNGLGETPATHSPACINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathSpacingNV")) == NULL) || r; + r = ((glGetPathTexGenfvNV = (PFNGLGETPATHTEXGENFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathTexGenfvNV")) == NULL) || r; + r = ((glGetPathTexGenivNV = (PFNGLGETPATHTEXGENIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathTexGenivNV")) == NULL) || r; + r = ((glGetProgramResourcefvNV = (PFNGLGETPROGRAMRESOURCEFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourcefvNV")) == NULL) || r; + r = ((glInterpolatePathsNV = (PFNGLINTERPOLATEPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glInterpolatePathsNV")) == NULL) || r; + r = ((glIsPathNV = (PFNGLISPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPathNV")) == NULL) || r; + r = ((glIsPointInFillPathNV = (PFNGLISPOINTINFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPointInFillPathNV")) == NULL) || r; + r = ((glIsPointInStrokePathNV = (PFNGLISPOINTINSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPointInStrokePathNV")) == NULL) || r; + r = ((glMatrixLoad3x2fNV = (PFNGLMATRIXLOAD3X2FNVPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoad3x2fNV")) == NULL) || r; + r = ((glMatrixLoad3x3fNV = (PFNGLMATRIXLOAD3X3FNVPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoad3x3fNV")) == NULL) || r; + r = ((glMatrixLoadTranspose3x3fNV = (PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTranspose3x3fNV")) == NULL) || r; + r = ((glMatrixMult3x2fNV = (PFNGLMATRIXMULT3X2FNVPROC)glewGetProcAddress((const GLubyte*)"glMatrixMult3x2fNV")) == NULL) || r; + r = ((glMatrixMult3x3fNV = (PFNGLMATRIXMULT3X3FNVPROC)glewGetProcAddress((const GLubyte*)"glMatrixMult3x3fNV")) == NULL) || r; + r = ((glMatrixMultTranspose3x3fNV = (PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTranspose3x3fNV")) == NULL) || r; + r = ((glPathColorGenNV = (PFNGLPATHCOLORGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathColorGenNV")) == NULL) || r; + r = ((glPathCommandsNV = (PFNGLPATHCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathCommandsNV")) == NULL) || r; + r = ((glPathCoordsNV = (PFNGLPATHCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathCoordsNV")) == NULL) || r; + r = ((glPathCoverDepthFuncNV = (PFNGLPATHCOVERDEPTHFUNCNVPROC)glewGetProcAddress((const GLubyte*)"glPathCoverDepthFuncNV")) == NULL) || r; + r = ((glPathDashArrayNV = (PFNGLPATHDASHARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glPathDashArrayNV")) == NULL) || r; + r = ((glPathFogGenNV = (PFNGLPATHFOGGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathFogGenNV")) == NULL) || r; + r = ((glPathGlyphIndexArrayNV = (PFNGLPATHGLYPHINDEXARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphIndexArrayNV")) == NULL) || r; + r = ((glPathGlyphIndexRangeNV = (PFNGLPATHGLYPHINDEXRANGENVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphIndexRangeNV")) == NULL) || r; + r = ((glPathGlyphRangeNV = (PFNGLPATHGLYPHRANGENVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphRangeNV")) == NULL) || r; + r = ((glPathGlyphsNV = (PFNGLPATHGLYPHSNVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphsNV")) == NULL) || r; + r = ((glPathMemoryGlyphIndexArrayNV = (PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glPathMemoryGlyphIndexArrayNV")) == NULL) || r; + r = ((glPathParameterfNV = (PFNGLPATHPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterfNV")) == NULL) || r; + r = ((glPathParameterfvNV = (PFNGLPATHPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterfvNV")) == NULL) || r; + r = ((glPathParameteriNV = (PFNGLPATHPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glPathParameteriNV")) == NULL) || r; + r = ((glPathParameterivNV = (PFNGLPATHPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterivNV")) == NULL) || r; + r = ((glPathStencilDepthOffsetNV = (PFNGLPATHSTENCILDEPTHOFFSETNVPROC)glewGetProcAddress((const GLubyte*)"glPathStencilDepthOffsetNV")) == NULL) || r; + r = ((glPathStencilFuncNV = (PFNGLPATHSTENCILFUNCNVPROC)glewGetProcAddress((const GLubyte*)"glPathStencilFuncNV")) == NULL) || r; + r = ((glPathStringNV = (PFNGLPATHSTRINGNVPROC)glewGetProcAddress((const GLubyte*)"glPathStringNV")) == NULL) || r; + r = ((glPathSubCommandsNV = (PFNGLPATHSUBCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathSubCommandsNV")) == NULL) || r; + r = ((glPathSubCoordsNV = (PFNGLPATHSUBCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathSubCoordsNV")) == NULL) || r; + r = ((glPathTexGenNV = (PFNGLPATHTEXGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathTexGenNV")) == NULL) || r; + r = ((glPointAlongPathNV = (PFNGLPOINTALONGPATHNVPROC)glewGetProcAddress((const GLubyte*)"glPointAlongPathNV")) == NULL) || r; + r = ((glProgramPathFragmentInputGenNV = (PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC)glewGetProcAddress((const GLubyte*)"glProgramPathFragmentInputGenNV")) == NULL) || r; + r = ((glStencilFillPathInstancedNV = (PFNGLSTENCILFILLPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilFillPathInstancedNV")) == NULL) || r; + r = ((glStencilFillPathNV = (PFNGLSTENCILFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilFillPathNV")) == NULL) || r; + r = ((glStencilStrokePathInstancedNV = (PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilStrokePathInstancedNV")) == NULL) || r; + r = ((glStencilStrokePathNV = (PFNGLSTENCILSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilStrokePathNV")) == NULL) || r; + r = ((glStencilThenCoverFillPathInstancedNV = (PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilThenCoverFillPathInstancedNV")) == NULL) || r; + r = ((glStencilThenCoverFillPathNV = (PFNGLSTENCILTHENCOVERFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilThenCoverFillPathNV")) == NULL) || r; + r = ((glStencilThenCoverStrokePathInstancedNV = (PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilThenCoverStrokePathInstancedNV")) == NULL) || r; + r = ((glStencilThenCoverStrokePathNV = (PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilThenCoverStrokePathNV")) == NULL) || r; + r = ((glTransformPathNV = (PFNGLTRANSFORMPATHNVPROC)glewGetProcAddress((const GLubyte*)"glTransformPathNV")) == NULL) || r; + r = ((glWeightPathsNV = (PFNGLWEIGHTPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glWeightPathsNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_path_rendering */ + #ifdef GL_NV_pixel_data_range -static GLboolean _glewInit_GL_NV_pixel_data_range (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_NV_pixel_data_range () { GLboolean r = GL_FALSE; @@ -4485,7 +14813,7 @@ static GLboolean _glewInit_GL_NV_pixel_data_range (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_NV_point_sprite -static GLboolean _glewInit_GL_NV_point_sprite (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_NV_point_sprite () { GLboolean r = GL_FALSE; @@ -4497,9 +14825,40 @@ static GLboolean _glewInit_GL_NV_point_sprite (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_NV_point_sprite */ +#ifdef GL_NV_polygon_mode + +static GLboolean _glewInit_GL_NV_polygon_mode () +{ + GLboolean r = GL_FALSE; + + r = ((glPolygonModeNV = (PFNGLPOLYGONMODENVPROC)glewGetProcAddress((const GLubyte*)"glPolygonModeNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_polygon_mode */ + +#ifdef GL_NV_present_video + +static GLboolean _glewInit_GL_NV_present_video () +{ + GLboolean r = GL_FALSE; + + r = ((glGetVideoi64vNV = (PFNGLGETVIDEOI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoi64vNV")) == NULL) || r; + r = ((glGetVideoivNV = (PFNGLGETVIDEOIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoivNV")) == NULL) || r; + r = ((glGetVideoui64vNV = (PFNGLGETVIDEOUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoui64vNV")) == NULL) || r; + r = ((glGetVideouivNV = (PFNGLGETVIDEOUIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideouivNV")) == NULL) || r; + r = ((glPresentFrameDualFillNV = (PFNGLPRESENTFRAMEDUALFILLNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameDualFillNV")) == NULL) || r; + r = ((glPresentFrameKeyedNV = (PFNGLPRESENTFRAMEKEYEDNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameKeyedNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_present_video */ + #ifdef GL_NV_primitive_restart -static GLboolean _glewInit_GL_NV_primitive_restart (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_NV_primitive_restart () { GLboolean r = GL_FALSE; @@ -4513,7 +14872,7 @@ static GLboolean _glewInit_GL_NV_primitive_restart (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_NV_register_combiners -static GLboolean _glewInit_GL_NV_register_combiners (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_NV_register_combiners () { GLboolean r = GL_FALSE; @@ -4538,7 +14897,7 @@ static GLboolean _glewInit_GL_NV_register_combiners (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_NV_register_combiners2 -static GLboolean _glewInit_GL_NV_register_combiners2 (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_NV_register_combiners2 () { GLboolean r = GL_FALSE; @@ -4550,45 +14909,97 @@ static GLboolean _glewInit_GL_NV_register_combiners2 (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_NV_register_combiners2 */ -#ifdef GL_NV_texgen_emboss +#ifdef GL_NV_sample_locations -#endif /* GL_NV_texgen_emboss */ +static GLboolean _glewInit_GL_NV_sample_locations () +{ + GLboolean r = GL_FALSE; -#ifdef GL_NV_texgen_reflection + r = ((glFramebufferSampleLocationsfvNV = (PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)glewGetProcAddress((const GLubyte*)"glFramebufferSampleLocationsfvNV")) == NULL) || r; + r = ((glNamedFramebufferSampleLocationsfvNV = (PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferSampleLocationsfvNV")) == NULL) || r; -#endif /* GL_NV_texgen_reflection */ + return r; +} -#ifdef GL_NV_texture_compression_vtc +#endif /* GL_NV_sample_locations */ -#endif /* GL_NV_texture_compression_vtc */ +#ifdef GL_NV_shader_buffer_load -#ifdef GL_NV_texture_env_combine4 +static GLboolean _glewInit_GL_NV_shader_buffer_load () +{ + GLboolean r = GL_FALSE; -#endif /* GL_NV_texture_env_combine4 */ + r = ((glGetBufferParameterui64vNV = (PFNGLGETBUFFERPARAMETERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameterui64vNV")) == NULL) || r; + r = ((glGetIntegerui64vNV = (PFNGLGETINTEGERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerui64vNV")) == NULL) || r; + r = ((glGetNamedBufferParameterui64vNV = (PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameterui64vNV")) == NULL) || r; + r = ((glIsBufferResidentNV = (PFNGLISBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsBufferResidentNV")) == NULL) || r; + r = ((glIsNamedBufferResidentNV = (PFNGLISNAMEDBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsNamedBufferResidentNV")) == NULL) || r; + r = ((glMakeBufferNonResidentNV = (PFNGLMAKEBUFFERNONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeBufferNonResidentNV")) == NULL) || r; + r = ((glMakeBufferResidentNV = (PFNGLMAKEBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeBufferResidentNV")) == NULL) || r; + r = ((glMakeNamedBufferNonResidentNV = (PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeNamedBufferNonResidentNV")) == NULL) || r; + r = ((glMakeNamedBufferResidentNV = (PFNGLMAKENAMEDBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeNamedBufferResidentNV")) == NULL) || r; + r = ((glProgramUniformui64NV = (PFNGLPROGRAMUNIFORMUI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformui64NV")) == NULL) || r; + r = ((glProgramUniformui64vNV = (PFNGLPROGRAMUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformui64vNV")) == NULL) || r; + r = ((glUniformui64NV = (PFNGLUNIFORMUI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniformui64NV")) == NULL) || r; + r = ((glUniformui64vNV = (PFNGLUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniformui64vNV")) == NULL) || r; -#ifdef GL_NV_texture_expand_normal + return r; +} -#endif /* GL_NV_texture_expand_normal */ +#endif /* GL_NV_shader_buffer_load */ -#ifdef GL_NV_texture_rectangle +#ifdef GL_NV_texture_array -#endif /* GL_NV_texture_rectangle */ +static GLboolean _glewInit_GL_NV_texture_array () +{ + GLboolean r = GL_FALSE; -#ifdef GL_NV_texture_shader + r = ((glCompressedTexImage3DNV = (PFNGLCOMPRESSEDTEXIMAGE3DNVPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage3DNV")) == NULL) || r; + r = ((glCompressedTexSubImage3DNV = (PFNGLCOMPRESSEDTEXSUBIMAGE3DNVPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage3DNV")) == NULL) || r; + r = ((glCopyTexSubImage3DNV = (PFNGLCOPYTEXSUBIMAGE3DNVPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage3DNV")) == NULL) || r; + r = ((glFramebufferTextureLayerNV = (PFNGLFRAMEBUFFERTEXTURELAYERNVPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayerNV")) == NULL) || r; + r = ((glTexImage3DNV = (PFNGLTEXIMAGE3DNVPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DNV")) == NULL) || r; + r = ((glTexSubImage3DNV = (PFNGLTEXSUBIMAGE3DNVPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage3DNV")) == NULL) || r; -#endif /* GL_NV_texture_shader */ + return r; +} -#ifdef GL_NV_texture_shader2 +#endif /* GL_NV_texture_array */ -#endif /* GL_NV_texture_shader2 */ +#ifdef GL_NV_texture_barrier -#ifdef GL_NV_texture_shader3 +static GLboolean _glewInit_GL_NV_texture_barrier () +{ + GLboolean r = GL_FALSE; -#endif /* GL_NV_texture_shader3 */ + r = ((glTextureBarrierNV = (PFNGLTEXTUREBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glTextureBarrierNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_texture_barrier */ + +#ifdef GL_NV_texture_multisample + +static GLboolean _glewInit_GL_NV_texture_multisample () +{ + GLboolean r = GL_FALSE; + + r = ((glTexImage2DMultisampleCoverageNV = (PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTexImage2DMultisampleCoverageNV")) == NULL) || r; + r = ((glTexImage3DMultisampleCoverageNV = (PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DMultisampleCoverageNV")) == NULL) || r; + r = ((glTextureImage2DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DMultisampleCoverageNV")) == NULL) || r; + r = ((glTextureImage2DMultisampleNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DMultisampleNV")) == NULL) || r; + r = ((glTextureImage3DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DMultisampleCoverageNV")) == NULL) || r; + r = ((glTextureImage3DMultisampleNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DMultisampleNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_texture_multisample */ #ifdef GL_NV_transform_feedback -static GLboolean _glewInit_GL_NV_transform_feedback (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_NV_transform_feedback () { GLboolean r = GL_FALSE; @@ -4609,9 +15020,50 @@ static GLboolean _glewInit_GL_NV_transform_feedback (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_NV_transform_feedback */ +#ifdef GL_NV_transform_feedback2 + +static GLboolean _glewInit_GL_NV_transform_feedback2 () +{ + GLboolean r = GL_FALSE; + + r = ((glBindTransformFeedbackNV = (PFNGLBINDTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glBindTransformFeedbackNV")) == NULL) || r; + r = ((glDeleteTransformFeedbacksNV = (PFNGLDELETETRANSFORMFEEDBACKSNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteTransformFeedbacksNV")) == NULL) || r; + r = ((glDrawTransformFeedbackNV = (PFNGLDRAWTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackNV")) == NULL) || r; + r = ((glGenTransformFeedbacksNV = (PFNGLGENTRANSFORMFEEDBACKSNVPROC)glewGetProcAddress((const GLubyte*)"glGenTransformFeedbacksNV")) == NULL) || r; + r = ((glIsTransformFeedbackNV = (PFNGLISTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glIsTransformFeedbackNV")) == NULL) || r; + r = ((glPauseTransformFeedbackNV = (PFNGLPAUSETRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glPauseTransformFeedbackNV")) == NULL) || r; + r = ((glResumeTransformFeedbackNV = (PFNGLRESUMETRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glResumeTransformFeedbackNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_transform_feedback2 */ + +#ifdef GL_NV_vdpau_interop + +static GLboolean _glewInit_GL_NV_vdpau_interop () +{ + GLboolean r = GL_FALSE; + + r = ((glVDPAUFiniNV = (PFNGLVDPAUFININVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUFiniNV")) == NULL) || r; + r = ((glVDPAUGetSurfaceivNV = (PFNGLVDPAUGETSURFACEIVNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUGetSurfaceivNV")) == NULL) || r; + r = ((glVDPAUInitNV = (PFNGLVDPAUINITNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUInitNV")) == NULL) || r; + r = ((glVDPAUIsSurfaceNV = (PFNGLVDPAUISSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUIsSurfaceNV")) == NULL) || r; + r = ((glVDPAUMapSurfacesNV = (PFNGLVDPAUMAPSURFACESNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUMapSurfacesNV")) == NULL) || r; + r = ((glVDPAURegisterOutputSurfaceNV = (PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAURegisterOutputSurfaceNV")) == NULL) || r; + r = ((glVDPAURegisterVideoSurfaceNV = (PFNGLVDPAUREGISTERVIDEOSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAURegisterVideoSurfaceNV")) == NULL) || r; + r = ((glVDPAUSurfaceAccessNV = (PFNGLVDPAUSURFACEACCESSNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUSurfaceAccessNV")) == NULL) || r; + r = ((glVDPAUUnmapSurfacesNV = (PFNGLVDPAUUNMAPSURFACESNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUUnmapSurfacesNV")) == NULL) || r; + r = ((glVDPAUUnregisterSurfaceNV = (PFNGLVDPAUUNREGISTERSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUUnregisterSurfaceNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vdpau_interop */ + #ifdef GL_NV_vertex_array_range -static GLboolean _glewInit_GL_NV_vertex_array_range (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_NV_vertex_array_range () { GLboolean r = GL_FALSE; @@ -4623,13 +15075,64 @@ static GLboolean _glewInit_GL_NV_vertex_array_range (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_NV_vertex_array_range */ -#ifdef GL_NV_vertex_array_range2 +#ifdef GL_NV_vertex_attrib_integer_64bit -#endif /* GL_NV_vertex_array_range2 */ +static GLboolean _glewInit_GL_NV_vertex_attrib_integer_64bit () +{ + GLboolean r = GL_FALSE; + + r = ((glGetVertexAttribLi64vNV = (PFNGLGETVERTEXATTRIBLI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLi64vNV")) == NULL) || r; + r = ((glGetVertexAttribLui64vNV = (PFNGLGETVERTEXATTRIBLUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLui64vNV")) == NULL) || r; + r = ((glVertexAttribL1i64NV = (PFNGLVERTEXATTRIBL1I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1i64NV")) == NULL) || r; + r = ((glVertexAttribL1i64vNV = (PFNGLVERTEXATTRIBL1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1i64vNV")) == NULL) || r; + r = ((glVertexAttribL1ui64NV = (PFNGLVERTEXATTRIBL1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64NV")) == NULL) || r; + r = ((glVertexAttribL1ui64vNV = (PFNGLVERTEXATTRIBL1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64vNV")) == NULL) || r; + r = ((glVertexAttribL2i64NV = (PFNGLVERTEXATTRIBL2I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2i64NV")) == NULL) || r; + r = ((glVertexAttribL2i64vNV = (PFNGLVERTEXATTRIBL2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2i64vNV")) == NULL) || r; + r = ((glVertexAttribL2ui64NV = (PFNGLVERTEXATTRIBL2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2ui64NV")) == NULL) || r; + r = ((glVertexAttribL2ui64vNV = (PFNGLVERTEXATTRIBL2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2ui64vNV")) == NULL) || r; + r = ((glVertexAttribL3i64NV = (PFNGLVERTEXATTRIBL3I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3i64NV")) == NULL) || r; + r = ((glVertexAttribL3i64vNV = (PFNGLVERTEXATTRIBL3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3i64vNV")) == NULL) || r; + r = ((glVertexAttribL3ui64NV = (PFNGLVERTEXATTRIBL3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3ui64NV")) == NULL) || r; + r = ((glVertexAttribL3ui64vNV = (PFNGLVERTEXATTRIBL3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3ui64vNV")) == NULL) || r; + r = ((glVertexAttribL4i64NV = (PFNGLVERTEXATTRIBL4I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4i64NV")) == NULL) || r; + r = ((glVertexAttribL4i64vNV = (PFNGLVERTEXATTRIBL4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4i64vNV")) == NULL) || r; + r = ((glVertexAttribL4ui64NV = (PFNGLVERTEXATTRIBL4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4ui64NV")) == NULL) || r; + r = ((glVertexAttribL4ui64vNV = (PFNGLVERTEXATTRIBL4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4ui64vNV")) == NULL) || r; + r = ((glVertexAttribLFormatNV = (PFNGLVERTEXATTRIBLFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLFormatNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vertex_attrib_integer_64bit */ + +#ifdef GL_NV_vertex_buffer_unified_memory + +static GLboolean _glewInit_GL_NV_vertex_buffer_unified_memory () +{ + GLboolean r = GL_FALSE; + + r = ((glBufferAddressRangeNV = (PFNGLBUFFERADDRESSRANGENVPROC)glewGetProcAddress((const GLubyte*)"glBufferAddressRangeNV")) == NULL) || r; + r = ((glColorFormatNV = (PFNGLCOLORFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glColorFormatNV")) == NULL) || r; + r = ((glEdgeFlagFormatNV = (PFNGLEDGEFLAGFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagFormatNV")) == NULL) || r; + r = ((glFogCoordFormatNV = (PFNGLFOGCOORDFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordFormatNV")) == NULL) || r; + r = ((glGetIntegerui64i_vNV = (PFNGLGETINTEGERUI64I_VNVPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerui64i_vNV")) == NULL) || r; + r = ((glIndexFormatNV = (PFNGLINDEXFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glIndexFormatNV")) == NULL) || r; + r = ((glNormalFormatNV = (PFNGLNORMALFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glNormalFormatNV")) == NULL) || r; + r = ((glSecondaryColorFormatNV = (PFNGLSECONDARYCOLORFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorFormatNV")) == NULL) || r; + r = ((glTexCoordFormatNV = (PFNGLTEXCOORDFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordFormatNV")) == NULL) || r; + r = ((glVertexAttribFormatNV = (PFNGLVERTEXATTRIBFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribFormatNV")) == NULL) || r; + r = ((glVertexAttribIFormatNV = (PFNGLVERTEXATTRIBIFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIFormatNV")) == NULL) || r; + r = ((glVertexFormatNV = (PFNGLVERTEXFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexFormatNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vertex_buffer_unified_memory */ #ifdef GL_NV_vertex_program -static GLboolean _glewInit_GL_NV_vertex_program (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_NV_vertex_program () { GLboolean r = GL_FALSE; @@ -4703,91 +15206,323 @@ static GLboolean _glewInit_GL_NV_vertex_program (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_NV_vertex_program */ -#ifdef GL_NV_vertex_program1_1 +#ifdef GL_NV_video_capture -#endif /* GL_NV_vertex_program1_1 */ - -#ifdef GL_NV_vertex_program2 - -#endif /* GL_NV_vertex_program2 */ - -#ifdef GL_NV_vertex_program2_option - -#endif /* GL_NV_vertex_program2_option */ - -#ifdef GL_NV_vertex_program3 - -#endif /* GL_NV_vertex_program3 */ - -#ifdef GL_NV_vertex_program4 - -#endif /* GL_NV_vertex_program4 */ - -#ifdef GL_OES_byte_coordinates - -#endif /* GL_OES_byte_coordinates */ - -#ifdef GL_OES_compressed_paletted_texture - -#endif /* GL_OES_compressed_paletted_texture */ - -#ifdef GL_OES_read_format - -#endif /* GL_OES_read_format */ - -#ifdef GL_OES_single_precision - -static GLboolean _glewInit_GL_OES_single_precision (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_NV_video_capture () { GLboolean r = GL_FALSE; - r = ((glClearDepthfOES = (PFNGLCLEARDEPTHFOESPROC)glewGetProcAddress((const GLubyte*)"glClearDepthfOES")) == NULL) || r; - r = ((glClipPlanefOES = (PFNGLCLIPPLANEFOESPROC)glewGetProcAddress((const GLubyte*)"glClipPlanefOES")) == NULL) || r; - r = ((glDepthRangefOES = (PFNGLDEPTHRANGEFOESPROC)glewGetProcAddress((const GLubyte*)"glDepthRangefOES")) == NULL) || r; - r = ((glFrustumfOES = (PFNGLFRUSTUMFOESPROC)glewGetProcAddress((const GLubyte*)"glFrustumfOES")) == NULL) || r; - r = ((glGetClipPlanefOES = (PFNGLGETCLIPPLANEFOESPROC)glewGetProcAddress((const GLubyte*)"glGetClipPlanefOES")) == NULL) || r; - r = ((glOrthofOES = (PFNGLORTHOFOESPROC)glewGetProcAddress((const GLubyte*)"glOrthofOES")) == NULL) || r; + r = ((glBeginVideoCaptureNV = (PFNGLBEGINVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glBeginVideoCaptureNV")) == NULL) || r; + r = ((glBindVideoCaptureStreamBufferNV = (PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"glBindVideoCaptureStreamBufferNV")) == NULL) || r; + r = ((glBindVideoCaptureStreamTextureNV = (PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC)glewGetProcAddress((const GLubyte*)"glBindVideoCaptureStreamTextureNV")) == NULL) || r; + r = ((glEndVideoCaptureNV = (PFNGLENDVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glEndVideoCaptureNV")) == NULL) || r; + r = ((glGetVideoCaptureStreamdvNV = (PFNGLGETVIDEOCAPTURESTREAMDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamdvNV")) == NULL) || r; + r = ((glGetVideoCaptureStreamfvNV = (PFNGLGETVIDEOCAPTURESTREAMFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamfvNV")) == NULL) || r; + r = ((glGetVideoCaptureStreamivNV = (PFNGLGETVIDEOCAPTURESTREAMIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamivNV")) == NULL) || r; + r = ((glGetVideoCaptureivNV = (PFNGLGETVIDEOCAPTUREIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureivNV")) == NULL) || r; + r = ((glVideoCaptureNV = (PFNGLVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureNV")) == NULL) || r; + r = ((glVideoCaptureStreamParameterdvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterdvNV")) == NULL) || r; + r = ((glVideoCaptureStreamParameterfvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterfvNV")) == NULL) || r; + r = ((glVideoCaptureStreamParameterivNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterivNV")) == NULL) || r; return r; } -#endif /* GL_OES_single_precision */ +#endif /* GL_NV_video_capture */ -#ifdef GL_OML_interlace +#ifdef GL_NV_viewport_array -#endif /* GL_OML_interlace */ +static GLboolean _glewInit_GL_NV_viewport_array () +{ + GLboolean r = GL_FALSE; -#ifdef GL_OML_resample + r = ((glDepthRangeArrayfvNV = (PFNGLDEPTHRANGEARRAYFVNVPROC)glewGetProcAddress((const GLubyte*)"glDepthRangeArrayfvNV")) == NULL) || r; + r = ((glDepthRangeIndexedfNV = (PFNGLDEPTHRANGEINDEXEDFNVPROC)glewGetProcAddress((const GLubyte*)"glDepthRangeIndexedfNV")) == NULL) || r; + r = ((glDisableiNV = (PFNGLDISABLEINVPROC)glewGetProcAddress((const GLubyte*)"glDisableiNV")) == NULL) || r; + r = ((glEnableiNV = (PFNGLENABLEINVPROC)glewGetProcAddress((const GLubyte*)"glEnableiNV")) == NULL) || r; + r = ((glGetFloati_vNV = (PFNGLGETFLOATI_VNVPROC)glewGetProcAddress((const GLubyte*)"glGetFloati_vNV")) == NULL) || r; + r = ((glIsEnablediNV = (PFNGLISENABLEDINVPROC)glewGetProcAddress((const GLubyte*)"glIsEnablediNV")) == NULL) || r; + r = ((glScissorArrayvNV = (PFNGLSCISSORARRAYVNVPROC)glewGetProcAddress((const GLubyte*)"glScissorArrayvNV")) == NULL) || r; + r = ((glScissorIndexedNV = (PFNGLSCISSORINDEXEDNVPROC)glewGetProcAddress((const GLubyte*)"glScissorIndexedNV")) == NULL) || r; + r = ((glScissorIndexedvNV = (PFNGLSCISSORINDEXEDVNVPROC)glewGetProcAddress((const GLubyte*)"glScissorIndexedvNV")) == NULL) || r; + r = ((glViewportArrayvNV = (PFNGLVIEWPORTARRAYVNVPROC)glewGetProcAddress((const GLubyte*)"glViewportArrayvNV")) == NULL) || r; + r = ((glViewportIndexedfNV = (PFNGLVIEWPORTINDEXEDFNVPROC)glewGetProcAddress((const GLubyte*)"glViewportIndexedfNV")) == NULL) || r; + r = ((glViewportIndexedfvNV = (PFNGLVIEWPORTINDEXEDFVNVPROC)glewGetProcAddress((const GLubyte*)"glViewportIndexedfvNV")) == NULL) || r; -#endif /* GL_OML_resample */ + return r; +} -#ifdef GL_OML_subsample +#endif /* GL_NV_viewport_array */ -#endif /* GL_OML_subsample */ +#ifdef GL_NV_viewport_swizzle -#ifdef GL_PGI_misc_hints +static GLboolean _glewInit_GL_NV_viewport_swizzle () +{ + GLboolean r = GL_FALSE; -#endif /* GL_PGI_misc_hints */ + r = ((glViewportSwizzleNV = (PFNGLVIEWPORTSWIZZLENVPROC)glewGetProcAddress((const GLubyte*)"glViewportSwizzleNV")) == NULL) || r; -#ifdef GL_PGI_vertex_hints + return r; +} -#endif /* GL_PGI_vertex_hints */ +#endif /* GL_NV_viewport_swizzle */ -#ifdef GL_REND_screen_coordinates +#ifdef GL_OVR_multiview -#endif /* GL_REND_screen_coordinates */ +static GLboolean _glewInit_GL_OVR_multiview () +{ + GLboolean r = GL_FALSE; -#ifdef GL_S3_s3tc + r = ((glFramebufferTextureMultiviewOVR = (PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureMultiviewOVR")) == NULL) || r; -#endif /* GL_S3_s3tc */ + return r; +} -#ifdef GL_SGIS_color_range +#endif /* GL_OVR_multiview */ -#endif /* GL_SGIS_color_range */ +#ifdef GL_OVR_multiview_multisampled_render_to_texture + +static GLboolean _glewInit_GL_OVR_multiview_multisampled_render_to_texture () +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferTextureMultisampleMultiviewOVR = (PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVRPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureMultisampleMultiviewOVR")) == NULL) || r; + + return r; +} + +#endif /* GL_OVR_multiview_multisampled_render_to_texture */ + +#ifdef GL_QCOM_alpha_test + +static GLboolean _glewInit_GL_QCOM_alpha_test () +{ + GLboolean r = GL_FALSE; + + r = ((glAlphaFuncQCOM = (PFNGLALPHAFUNCQCOMPROC)glewGetProcAddress((const GLubyte*)"glAlphaFuncQCOM")) == NULL) || r; + + return r; +} + +#endif /* GL_QCOM_alpha_test */ + +#ifdef GL_QCOM_driver_control + +static GLboolean _glewInit_GL_QCOM_driver_control () +{ + GLboolean r = GL_FALSE; + + r = ((glDisableDriverControlQCOM = (PFNGLDISABLEDRIVERCONTROLQCOMPROC)glewGetProcAddress((const GLubyte*)"glDisableDriverControlQCOM")) == NULL) || r; + r = ((glEnableDriverControlQCOM = (PFNGLENABLEDRIVERCONTROLQCOMPROC)glewGetProcAddress((const GLubyte*)"glEnableDriverControlQCOM")) == NULL) || r; + r = ((glGetDriverControlStringQCOM = (PFNGLGETDRIVERCONTROLSTRINGQCOMPROC)glewGetProcAddress((const GLubyte*)"glGetDriverControlStringQCOM")) == NULL) || r; + r = ((glGetDriverControlsQCOM = (PFNGLGETDRIVERCONTROLSQCOMPROC)glewGetProcAddress((const GLubyte*)"glGetDriverControlsQCOM")) == NULL) || r; + + return r; +} + +#endif /* GL_QCOM_driver_control */ + +#ifdef GL_QCOM_extended_get + +static GLboolean _glewInit_GL_QCOM_extended_get () +{ + GLboolean r = GL_FALSE; + + r = ((glExtGetBufferPointervQCOM = (PFNGLEXTGETBUFFERPOINTERVQCOMPROC)glewGetProcAddress((const GLubyte*)"glExtGetBufferPointervQCOM")) == NULL) || r; + r = ((glExtGetBuffersQCOM = (PFNGLEXTGETBUFFERSQCOMPROC)glewGetProcAddress((const GLubyte*)"glExtGetBuffersQCOM")) == NULL) || r; + r = ((glExtGetFramebuffersQCOM = (PFNGLEXTGETFRAMEBUFFERSQCOMPROC)glewGetProcAddress((const GLubyte*)"glExtGetFramebuffersQCOM")) == NULL) || r; + r = ((glExtGetRenderbuffersQCOM = (PFNGLEXTGETRENDERBUFFERSQCOMPROC)glewGetProcAddress((const GLubyte*)"glExtGetRenderbuffersQCOM")) == NULL) || r; + r = ((glExtGetTexLevelParameterivQCOM = (PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC)glewGetProcAddress((const GLubyte*)"glExtGetTexLevelParameterivQCOM")) == NULL) || r; + r = ((glExtGetTexSubImageQCOM = (PFNGLEXTGETTEXSUBIMAGEQCOMPROC)glewGetProcAddress((const GLubyte*)"glExtGetTexSubImageQCOM")) == NULL) || r; + r = ((glExtGetTexturesQCOM = (PFNGLEXTGETTEXTURESQCOMPROC)glewGetProcAddress((const GLubyte*)"glExtGetTexturesQCOM")) == NULL) || r; + r = ((glExtTexObjectStateOverrideiQCOM = (PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC)glewGetProcAddress((const GLubyte*)"glExtTexObjectStateOverrideiQCOM")) == NULL) || r; + + return r; +} + +#endif /* GL_QCOM_extended_get */ + +#ifdef GL_QCOM_extended_get2 + +static GLboolean _glewInit_GL_QCOM_extended_get2 () +{ + GLboolean r = GL_FALSE; + + r = ((glExtGetProgramBinarySourceQCOM = (PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC)glewGetProcAddress((const GLubyte*)"glExtGetProgramBinarySourceQCOM")) == NULL) || r; + r = ((glExtGetProgramsQCOM = (PFNGLEXTGETPROGRAMSQCOMPROC)glewGetProcAddress((const GLubyte*)"glExtGetProgramsQCOM")) == NULL) || r; + r = ((glExtGetShadersQCOM = (PFNGLEXTGETSHADERSQCOMPROC)glewGetProcAddress((const GLubyte*)"glExtGetShadersQCOM")) == NULL) || r; + r = ((glExtIsProgramBinaryQCOM = (PFNGLEXTISPROGRAMBINARYQCOMPROC)glewGetProcAddress((const GLubyte*)"glExtIsProgramBinaryQCOM")) == NULL) || r; + + return r; +} + +#endif /* GL_QCOM_extended_get2 */ + +#ifdef GL_QCOM_framebuffer_foveated + +static GLboolean _glewInit_GL_QCOM_framebuffer_foveated () +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferFoveationConfigQCOM = (PFNGLFRAMEBUFFERFOVEATIONCONFIGQCOMPROC)glewGetProcAddress((const GLubyte*)"glFramebufferFoveationConfigQCOM")) == NULL) || r; + r = ((glFramebufferFoveationParametersQCOM = (PFNGLFRAMEBUFFERFOVEATIONPARAMETERSQCOMPROC)glewGetProcAddress((const GLubyte*)"glFramebufferFoveationParametersQCOM")) == NULL) || r; + + return r; +} + +#endif /* GL_QCOM_framebuffer_foveated */ + +#ifdef GL_QCOM_shader_framebuffer_fetch_noncoherent + +static GLboolean _glewInit_GL_QCOM_shader_framebuffer_fetch_noncoherent () +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferFetchBarrierQCOM = (PFNGLFRAMEBUFFERFETCHBARRIERQCOMPROC)glewGetProcAddress((const GLubyte*)"glFramebufferFetchBarrierQCOM")) == NULL) || r; + + return r; +} + +#endif /* GL_QCOM_shader_framebuffer_fetch_noncoherent */ + +#ifdef GL_QCOM_tiled_rendering + +static GLboolean _glewInit_GL_QCOM_tiled_rendering () +{ + GLboolean r = GL_FALSE; + + r = ((glEndTilingQCOM = (PFNGLENDTILINGQCOMPROC)glewGetProcAddress((const GLubyte*)"glEndTilingQCOM")) == NULL) || r; + r = ((glStartTilingQCOM = (PFNGLSTARTTILINGQCOMPROC)glewGetProcAddress((const GLubyte*)"glStartTilingQCOM")) == NULL) || r; + + return r; +} + +#endif /* GL_QCOM_tiled_rendering */ + +#ifdef GL_REGAL_ES1_0_compatibility + +static GLboolean _glewInit_GL_REGAL_ES1_0_compatibility () +{ + GLboolean r = GL_FALSE; + + r = ((glAlphaFuncx = (PFNGLALPHAFUNCXPROC)glewGetProcAddress((const GLubyte*)"glAlphaFuncx")) == NULL) || r; + r = ((glClearColorx = (PFNGLCLEARCOLORXPROC)glewGetProcAddress((const GLubyte*)"glClearColorx")) == NULL) || r; + r = ((glClearDepthx = (PFNGLCLEARDEPTHXPROC)glewGetProcAddress((const GLubyte*)"glClearDepthx")) == NULL) || r; + r = ((glColor4x = (PFNGLCOLOR4XPROC)glewGetProcAddress((const GLubyte*)"glColor4x")) == NULL) || r; + r = ((glDepthRangex = (PFNGLDEPTHRANGEXPROC)glewGetProcAddress((const GLubyte*)"glDepthRangex")) == NULL) || r; + r = ((glFogx = (PFNGLFOGXPROC)glewGetProcAddress((const GLubyte*)"glFogx")) == NULL) || r; + r = ((glFogxv = (PFNGLFOGXVPROC)glewGetProcAddress((const GLubyte*)"glFogxv")) == NULL) || r; + r = ((glFrustumf = (PFNGLFRUSTUMFPROC)glewGetProcAddress((const GLubyte*)"glFrustumf")) == NULL) || r; + r = ((glFrustumx = (PFNGLFRUSTUMXPROC)glewGetProcAddress((const GLubyte*)"glFrustumx")) == NULL) || r; + r = ((glLightModelx = (PFNGLLIGHTMODELXPROC)glewGetProcAddress((const GLubyte*)"glLightModelx")) == NULL) || r; + r = ((glLightModelxv = (PFNGLLIGHTMODELXVPROC)glewGetProcAddress((const GLubyte*)"glLightModelxv")) == NULL) || r; + r = ((glLightx = (PFNGLLIGHTXPROC)glewGetProcAddress((const GLubyte*)"glLightx")) == NULL) || r; + r = ((glLightxv = (PFNGLLIGHTXVPROC)glewGetProcAddress((const GLubyte*)"glLightxv")) == NULL) || r; + r = ((glLineWidthx = (PFNGLLINEWIDTHXPROC)glewGetProcAddress((const GLubyte*)"glLineWidthx")) == NULL) || r; + r = ((glLoadMatrixx = (PFNGLLOADMATRIXXPROC)glewGetProcAddress((const GLubyte*)"glLoadMatrixx")) == NULL) || r; + r = ((glMaterialx = (PFNGLMATERIALXPROC)glewGetProcAddress((const GLubyte*)"glMaterialx")) == NULL) || r; + r = ((glMaterialxv = (PFNGLMATERIALXVPROC)glewGetProcAddress((const GLubyte*)"glMaterialxv")) == NULL) || r; + r = ((glMultMatrixx = (PFNGLMULTMATRIXXPROC)glewGetProcAddress((const GLubyte*)"glMultMatrixx")) == NULL) || r; + r = ((glMultiTexCoord4x = (PFNGLMULTITEXCOORD4XPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4x")) == NULL) || r; + r = ((glNormal3x = (PFNGLNORMAL3XPROC)glewGetProcAddress((const GLubyte*)"glNormal3x")) == NULL) || r; + r = ((glOrthof = (PFNGLORTHOFPROC)glewGetProcAddress((const GLubyte*)"glOrthof")) == NULL) || r; + r = ((glOrthox = (PFNGLORTHOXPROC)glewGetProcAddress((const GLubyte*)"glOrthox")) == NULL) || r; + r = ((glPointSizex = (PFNGLPOINTSIZEXPROC)glewGetProcAddress((const GLubyte*)"glPointSizex")) == NULL) || r; + r = ((glPolygonOffsetx = (PFNGLPOLYGONOFFSETXPROC)glewGetProcAddress((const GLubyte*)"glPolygonOffsetx")) == NULL) || r; + r = ((glRotatex = (PFNGLROTATEXPROC)glewGetProcAddress((const GLubyte*)"glRotatex")) == NULL) || r; + r = ((glSampleCoveragex = (PFNGLSAMPLECOVERAGEXPROC)glewGetProcAddress((const GLubyte*)"glSampleCoveragex")) == NULL) || r; + r = ((glScalex = (PFNGLSCALEXPROC)glewGetProcAddress((const GLubyte*)"glScalex")) == NULL) || r; + r = ((glTexEnvx = (PFNGLTEXENVXPROC)glewGetProcAddress((const GLubyte*)"glTexEnvx")) == NULL) || r; + r = ((glTexEnvxv = (PFNGLTEXENVXVPROC)glewGetProcAddress((const GLubyte*)"glTexEnvxv")) == NULL) || r; + r = ((glTexParameterx = (PFNGLTEXPARAMETERXPROC)glewGetProcAddress((const GLubyte*)"glTexParameterx")) == NULL) || r; + r = ((glTranslatex = (PFNGLTRANSLATEXPROC)glewGetProcAddress((const GLubyte*)"glTranslatex")) == NULL) || r; + + return r; +} + +#endif /* GL_REGAL_ES1_0_compatibility */ + +#ifdef GL_REGAL_ES1_1_compatibility + +static GLboolean _glewInit_GL_REGAL_ES1_1_compatibility () +{ + GLboolean r = GL_FALSE; + + r = ((glClipPlanef = (PFNGLCLIPPLANEFPROC)glewGetProcAddress((const GLubyte*)"glClipPlanef")) == NULL) || r; + r = ((glClipPlanex = (PFNGLCLIPPLANEXPROC)glewGetProcAddress((const GLubyte*)"glClipPlanex")) == NULL) || r; + r = ((glGetClipPlanef = (PFNGLGETCLIPPLANEFPROC)glewGetProcAddress((const GLubyte*)"glGetClipPlanef")) == NULL) || r; + r = ((glGetClipPlanex = (PFNGLGETCLIPPLANEXPROC)glewGetProcAddress((const GLubyte*)"glGetClipPlanex")) == NULL) || r; + r = ((glGetFixedv = (PFNGLGETFIXEDVPROC)glewGetProcAddress((const GLubyte*)"glGetFixedv")) == NULL) || r; + r = ((glGetLightxv = (PFNGLGETLIGHTXVPROC)glewGetProcAddress((const GLubyte*)"glGetLightxv")) == NULL) || r; + r = ((glGetMaterialxv = (PFNGLGETMATERIALXVPROC)glewGetProcAddress((const GLubyte*)"glGetMaterialxv")) == NULL) || r; + r = ((glGetTexEnvxv = (PFNGLGETTEXENVXVPROC)glewGetProcAddress((const GLubyte*)"glGetTexEnvxv")) == NULL) || r; + r = ((glGetTexParameterxv = (PFNGLGETTEXPARAMETERXVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterxv")) == NULL) || r; + r = ((glPointParameterx = (PFNGLPOINTPARAMETERXPROC)glewGetProcAddress((const GLubyte*)"glPointParameterx")) == NULL) || r; + r = ((glPointParameterxv = (PFNGLPOINTPARAMETERXVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterxv")) == NULL) || r; + r = ((glPointSizePointerOES = (PFNGLPOINTSIZEPOINTEROESPROC)glewGetProcAddress((const GLubyte*)"glPointSizePointerOES")) == NULL) || r; + r = ((glTexParameterxv = (PFNGLTEXPARAMETERXVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterxv")) == NULL) || r; + + return r; +} + +#endif /* GL_REGAL_ES1_1_compatibility */ + +#ifdef GL_REGAL_error_string + +static GLboolean _glewInit_GL_REGAL_error_string () +{ + GLboolean r = GL_FALSE; + + r = ((glErrorStringREGAL = (PFNGLERRORSTRINGREGALPROC)glewGetProcAddress((const GLubyte*)"glErrorStringREGAL")) == NULL) || r; + + return r; +} + +#endif /* GL_REGAL_error_string */ + +#ifdef GL_REGAL_extension_query + +static GLboolean _glewInit_GL_REGAL_extension_query () +{ + GLboolean r = GL_FALSE; + + r = ((glGetExtensionREGAL = (PFNGLGETEXTENSIONREGALPROC)glewGetProcAddress((const GLubyte*)"glGetExtensionREGAL")) == NULL) || r; + r = ((glIsSupportedREGAL = (PFNGLISSUPPORTEDREGALPROC)glewGetProcAddress((const GLubyte*)"glIsSupportedREGAL")) == NULL) || r; + + return r; +} + +#endif /* GL_REGAL_extension_query */ + +#ifdef GL_REGAL_log + +static GLboolean _glewInit_GL_REGAL_log () +{ + GLboolean r = GL_FALSE; + + r = ((glLogMessageCallbackREGAL = (PFNGLLOGMESSAGECALLBACKREGALPROC)glewGetProcAddress((const GLubyte*)"glLogMessageCallbackREGAL")) == NULL) || r; + + return r; +} + +#endif /* GL_REGAL_log */ + +#ifdef GL_REGAL_proc_address + +static GLboolean _glewInit_GL_REGAL_proc_address () +{ + GLboolean r = GL_FALSE; + + r = ((glGetProcAddressREGAL = (PFNGLGETPROCADDRESSREGALPROC)glewGetProcAddress((const GLubyte*)"glGetProcAddressREGAL")) == NULL) || r; + + return r; +} + +#endif /* GL_REGAL_proc_address */ #ifdef GL_SGIS_detail_texture -static GLboolean _glewInit_GL_SGIS_detail_texture (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_SGIS_detail_texture () { GLboolean r = GL_FALSE; @@ -4801,7 +15536,7 @@ static GLboolean _glewInit_GL_SGIS_detail_texture (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_SGIS_fog_function -static GLboolean _glewInit_GL_SGIS_fog_function (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_SGIS_fog_function () { GLboolean r = GL_FALSE; @@ -4813,13 +15548,9 @@ static GLboolean _glewInit_GL_SGIS_fog_function (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_SGIS_fog_function */ -#ifdef GL_SGIS_generate_mipmap - -#endif /* GL_SGIS_generate_mipmap */ - #ifdef GL_SGIS_multisample -static GLboolean _glewInit_GL_SGIS_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_SGIS_multisample () { GLboolean r = GL_FALSE; @@ -4831,13 +15562,38 @@ static GLboolean _glewInit_GL_SGIS_multisample (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_SGIS_multisample */ -#ifdef GL_SGIS_pixel_texture +#ifdef GL_SGIS_multitexture -#endif /* GL_SGIS_pixel_texture */ +static GLboolean _glewInit_GL_SGIS_multitexture () +{ + GLboolean r = GL_FALSE; + + r = ((glInterleavedTextureCoordSetsSGIS = (PFNGLINTERLEAVEDTEXTURECOORDSETSSGISPROC)glewGetProcAddress((const GLubyte*)"glInterleavedTextureCoordSetsSGIS")) == NULL) || r; + r = ((glSelectTextureCoordSetSGIS = (PFNGLSELECTTEXTURECOORDSETSGISPROC)glewGetProcAddress((const GLubyte*)"glSelectTextureCoordSetSGIS")) == NULL) || r; + r = ((glSelectTextureSGIS = (PFNGLSELECTTEXTURESGISPROC)glewGetProcAddress((const GLubyte*)"glSelectTextureSGIS")) == NULL) || r; + r = ((glSelectTextureTransformSGIS = (PFNGLSELECTTEXTURETRANSFORMSGISPROC)glewGetProcAddress((const GLubyte*)"glSelectTextureTransformSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_multitexture */ + +#ifdef GL_SGIS_shared_multisample + +static GLboolean _glewInit_GL_SGIS_shared_multisample () +{ + GLboolean r = GL_FALSE; + + r = ((glMultisampleSubRectPosSGIS = (PFNGLMULTISAMPLESUBRECTPOSSGISPROC)glewGetProcAddress((const GLubyte*)"glMultisampleSubRectPosSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_shared_multisample */ #ifdef GL_SGIS_sharpen_texture -static GLboolean _glewInit_GL_SGIS_sharpen_texture (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_SGIS_sharpen_texture () { GLboolean r = GL_FALSE; @@ -4851,7 +15607,7 @@ static GLboolean _glewInit_GL_SGIS_sharpen_texture (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_SGIS_texture4D -static GLboolean _glewInit_GL_SGIS_texture4D (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_SGIS_texture4D () { GLboolean r = GL_FALSE; @@ -4863,17 +15619,9 @@ static GLboolean _glewInit_GL_SGIS_texture4D (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_SGIS_texture4D */ -#ifdef GL_SGIS_texture_border_clamp - -#endif /* GL_SGIS_texture_border_clamp */ - -#ifdef GL_SGIS_texture_edge_clamp - -#endif /* GL_SGIS_texture_edge_clamp */ - #ifdef GL_SGIS_texture_filter4 -static GLboolean _glewInit_GL_SGIS_texture_filter4 (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_SGIS_texture_filter4 () { GLboolean r = GL_FALSE; @@ -4885,17 +15633,9 @@ static GLboolean _glewInit_GL_SGIS_texture_filter4 (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_SGIS_texture_filter4 */ -#ifdef GL_SGIS_texture_lod - -#endif /* GL_SGIS_texture_lod */ - -#ifdef GL_SGIS_texture_select - -#endif /* GL_SGIS_texture_select */ - #ifdef GL_SGIX_async -static GLboolean _glewInit_GL_SGIX_async (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_SGIX_async () { GLboolean r = GL_FALSE; @@ -4911,29 +15651,23 @@ static GLboolean _glewInit_GL_SGIX_async (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_SGIX_async */ -#ifdef GL_SGIX_async_histogram +#ifdef GL_SGIX_datapipe -#endif /* GL_SGIX_async_histogram */ +static GLboolean _glewInit_GL_SGIX_datapipe () +{ + GLboolean r = GL_FALSE; -#ifdef GL_SGIX_async_pixel + r = ((glAddressSpace = (PFNGLADDRESSSPACEPROC)glewGetProcAddress((const GLubyte*)"glAddressSpace")) == NULL) || r; + r = ((glDataPipe = (PFNGLDATAPIPEPROC)glewGetProcAddress((const GLubyte*)"glDataPipe")) == NULL) || r; -#endif /* GL_SGIX_async_pixel */ + return r; +} -#ifdef GL_SGIX_blend_alpha_minmax - -#endif /* GL_SGIX_blend_alpha_minmax */ - -#ifdef GL_SGIX_clipmap - -#endif /* GL_SGIX_clipmap */ - -#ifdef GL_SGIX_depth_texture - -#endif /* GL_SGIX_depth_texture */ +#endif /* GL_SGIX_datapipe */ #ifdef GL_SGIX_flush_raster -static GLboolean _glewInit_GL_SGIX_flush_raster (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_SGIX_flush_raster () { GLboolean r = GL_FALSE; @@ -4944,13 +15678,23 @@ static GLboolean _glewInit_GL_SGIX_flush_raster (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_SGIX_flush_raster */ -#ifdef GL_SGIX_fog_offset +#ifdef GL_SGIX_fog_layers -#endif /* GL_SGIX_fog_offset */ +static GLboolean _glewInit_GL_SGIX_fog_layers () +{ + GLboolean r = GL_FALSE; + + r = ((glFogLayersSGIX = (PFNGLFOGLAYERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glFogLayersSGIX")) == NULL) || r; + r = ((glGetFogLayersSGIX = (PFNGLGETFOGLAYERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFogLayersSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_fog_layers */ #ifdef GL_SGIX_fog_texture -static GLboolean _glewInit_GL_SGIX_fog_texture (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_SGIX_fog_texture () { GLboolean r = GL_FALSE; @@ -4963,7 +15707,7 @@ static GLboolean _glewInit_GL_SGIX_fog_texture (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_SGIX_fragment_specular_lighting -static GLboolean _glewInit_GL_SGIX_fragment_specular_lighting (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_SGIX_fragment_specular_lighting () { GLboolean r = GL_FALSE; @@ -4992,7 +15736,7 @@ static GLboolean _glewInit_GL_SGIX_fragment_specular_lighting (GLEW_CONTEXT_ARG_ #ifdef GL_SGIX_framezoom -static GLboolean _glewInit_GL_SGIX_framezoom (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_SGIX_framezoom () { GLboolean r = GL_FALSE; @@ -5003,21 +15747,61 @@ static GLboolean _glewInit_GL_SGIX_framezoom (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_SGIX_framezoom */ -#ifdef GL_SGIX_interlace +#ifdef GL_SGIX_igloo_interface -#endif /* GL_SGIX_interlace */ +static GLboolean _glewInit_GL_SGIX_igloo_interface () +{ + GLboolean r = GL_FALSE; -#ifdef GL_SGIX_ir_instrument1 + r = ((glIglooInterfaceSGIX = (PFNGLIGLOOINTERFACESGIXPROC)glewGetProcAddress((const GLubyte*)"glIglooInterfaceSGIX")) == NULL) || r; -#endif /* GL_SGIX_ir_instrument1 */ + return r; +} -#ifdef GL_SGIX_list_priority +#endif /* GL_SGIX_igloo_interface */ -#endif /* GL_SGIX_list_priority */ +#ifdef GL_SGIX_mpeg1 + +static GLboolean _glewInit_GL_SGIX_mpeg1 () +{ + GLboolean r = GL_FALSE; + + r = ((glAllocMPEGPredictorsSGIX = (PFNGLALLOCMPEGPREDICTORSSGIXPROC)glewGetProcAddress((const GLubyte*)"glAllocMPEGPredictorsSGIX")) == NULL) || r; + r = ((glDeleteMPEGPredictorsSGIX = (PFNGLDELETEMPEGPREDICTORSSGIXPROC)glewGetProcAddress((const GLubyte*)"glDeleteMPEGPredictorsSGIX")) == NULL) || r; + r = ((glGenMPEGPredictorsSGIX = (PFNGLGENMPEGPREDICTORSSGIXPROC)glewGetProcAddress((const GLubyte*)"glGenMPEGPredictorsSGIX")) == NULL) || r; + r = ((glGetMPEGParameterfvSGIX = (PFNGLGETMPEGPARAMETERFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetMPEGParameterfvSGIX")) == NULL) || r; + r = ((glGetMPEGParameterivSGIX = (PFNGLGETMPEGPARAMETERIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetMPEGParameterivSGIX")) == NULL) || r; + r = ((glGetMPEGPredictorSGIX = (PFNGLGETMPEGPREDICTORSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetMPEGPredictorSGIX")) == NULL) || r; + r = ((glGetMPEGQuantTableubv = (PFNGLGETMPEGQUANTTABLEUBVPROC)glewGetProcAddress((const GLubyte*)"glGetMPEGQuantTableubv")) == NULL) || r; + r = ((glIsMPEGPredictorSGIX = (PFNGLISMPEGPREDICTORSGIXPROC)glewGetProcAddress((const GLubyte*)"glIsMPEGPredictorSGIX")) == NULL) || r; + r = ((glMPEGPredictorSGIX = (PFNGLMPEGPREDICTORSGIXPROC)glewGetProcAddress((const GLubyte*)"glMPEGPredictorSGIX")) == NULL) || r; + r = ((glMPEGQuantTableubv = (PFNGLMPEGQUANTTABLEUBVPROC)glewGetProcAddress((const GLubyte*)"glMPEGQuantTableubv")) == NULL) || r; + r = ((glSwapMPEGPredictorsSGIX = (PFNGLSWAPMPEGPREDICTORSSGIXPROC)glewGetProcAddress((const GLubyte*)"glSwapMPEGPredictorsSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_mpeg1 */ + +#ifdef GL_SGIX_nonlinear_lighting_pervertex + +static GLboolean _glewInit_GL_SGIX_nonlinear_lighting_pervertex () +{ + GLboolean r = GL_FALSE; + + r = ((glGetNonlinLightfvSGIX = (PFNGLGETNONLINLIGHTFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetNonlinLightfvSGIX")) == NULL) || r; + r = ((glGetNonlinMaterialfvSGIX = (PFNGLGETNONLINMATERIALFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetNonlinMaterialfvSGIX")) == NULL) || r; + r = ((glNonlinLightfvSGIX = (PFNGLNONLINLIGHTFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glNonlinLightfvSGIX")) == NULL) || r; + r = ((glNonlinMaterialfvSGIX = (PFNGLNONLINMATERIALFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glNonlinMaterialfvSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_nonlinear_lighting_pervertex */ #ifdef GL_SGIX_pixel_texture -static GLboolean _glewInit_GL_SGIX_pixel_texture (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_SGIX_pixel_texture () { GLboolean r = GL_FALSE; @@ -5028,13 +15812,37 @@ static GLboolean _glewInit_GL_SGIX_pixel_texture (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_SGIX_pixel_texture */ -#ifdef GL_SGIX_pixel_texture_bits +#ifdef GL_SGIX_polynomial_ffd -#endif /* GL_SGIX_pixel_texture_bits */ +static GLboolean _glewInit_GL_SGIX_polynomial_ffd () +{ + GLboolean r = GL_FALSE; + + r = ((glDeformSGIX = (PFNGLDEFORMSGIXPROC)glewGetProcAddress((const GLubyte*)"glDeformSGIX")) == NULL) || r; + r = ((glLoadIdentityDeformationMapSGIX = (PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC)glewGetProcAddress((const GLubyte*)"glLoadIdentityDeformationMapSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_polynomial_ffd */ + +#ifdef GL_SGIX_quad_mesh + +static GLboolean _glewInit_GL_SGIX_quad_mesh () +{ + GLboolean r = GL_FALSE; + + r = ((glMeshBreadthSGIX = (PFNGLMESHBREADTHSGIXPROC)glewGetProcAddress((const GLubyte*)"glMeshBreadthSGIX")) == NULL) || r; + r = ((glMeshStrideSGIX = (PFNGLMESHSTRIDESGIXPROC)glewGetProcAddress((const GLubyte*)"glMeshStrideSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_quad_mesh */ #ifdef GL_SGIX_reference_plane -static GLboolean _glewInit_GL_SGIX_reference_plane (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_SGIX_reference_plane () { GLboolean r = GL_FALSE; @@ -5045,21 +15853,9 @@ static GLboolean _glewInit_GL_SGIX_reference_plane (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_SGIX_reference_plane */ -#ifdef GL_SGIX_resample - -#endif /* GL_SGIX_resample */ - -#ifdef GL_SGIX_shadow - -#endif /* GL_SGIX_shadow */ - -#ifdef GL_SGIX_shadow_ambient - -#endif /* GL_SGIX_shadow_ambient */ - #ifdef GL_SGIX_sprite -static GLboolean _glewInit_GL_SGIX_sprite (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_SGIX_sprite () { GLboolean r = GL_FALSE; @@ -5075,7 +15871,7 @@ static GLboolean _glewInit_GL_SGIX_sprite (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_SGIX_tag_sample_buffer -static GLboolean _glewInit_GL_SGIX_tag_sample_buffer (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_SGIX_tag_sample_buffer () { GLboolean r = GL_FALSE; @@ -5086,49 +15882,41 @@ static GLboolean _glewInit_GL_SGIX_tag_sample_buffer (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_SGIX_tag_sample_buffer */ -#ifdef GL_SGIX_texture_add_env +#ifdef GL_SGIX_vector_ops -#endif /* GL_SGIX_texture_add_env */ +static GLboolean _glewInit_GL_SGIX_vector_ops () +{ + GLboolean r = GL_FALSE; -#ifdef GL_SGIX_texture_coordinate_clamp + r = ((glGetVectorOperationSGIX = (PFNGLGETVECTOROPERATIONSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetVectorOperationSGIX")) == NULL) || r; + r = ((glVectorOperationSGIX = (PFNGLVECTOROPERATIONSGIXPROC)glewGetProcAddress((const GLubyte*)"glVectorOperationSGIX")) == NULL) || r; -#endif /* GL_SGIX_texture_coordinate_clamp */ + return r; +} -#ifdef GL_SGIX_texture_lod_bias +#endif /* GL_SGIX_vector_ops */ -#endif /* GL_SGIX_texture_lod_bias */ +#ifdef GL_SGIX_vertex_array_object -#ifdef GL_SGIX_texture_multi_buffer +static GLboolean _glewInit_GL_SGIX_vertex_array_object () +{ + GLboolean r = GL_FALSE; -#endif /* GL_SGIX_texture_multi_buffer */ + r = ((glAreVertexArraysResidentSGIX = (PFNGLAREVERTEXARRAYSRESIDENTSGIXPROC)glewGetProcAddress((const GLubyte*)"glAreVertexArraysResidentSGIX")) == NULL) || r; + r = ((glBindVertexArraySGIX = (PFNGLBINDVERTEXARRAYSGIXPROC)glewGetProcAddress((const GLubyte*)"glBindVertexArraySGIX")) == NULL) || r; + r = ((glDeleteVertexArraysSGIX = (PFNGLDELETEVERTEXARRAYSSGIXPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexArraysSGIX")) == NULL) || r; + r = ((glGenVertexArraysSGIX = (PFNGLGENVERTEXARRAYSSGIXPROC)glewGetProcAddress((const GLubyte*)"glGenVertexArraysSGIX")) == NULL) || r; + r = ((glIsVertexArraySGIX = (PFNGLISVERTEXARRAYSGIXPROC)glewGetProcAddress((const GLubyte*)"glIsVertexArraySGIX")) == NULL) || r; + r = ((glPrioritizeVertexArraysSGIX = (PFNGLPRIORITIZEVERTEXARRAYSSGIXPROC)glewGetProcAddress((const GLubyte*)"glPrioritizeVertexArraysSGIX")) == NULL) || r; -#ifdef GL_SGIX_texture_range + return r; +} -#endif /* GL_SGIX_texture_range */ - -#ifdef GL_SGIX_texture_scale_bias - -#endif /* GL_SGIX_texture_scale_bias */ - -#ifdef GL_SGIX_vertex_preclip - -#endif /* GL_SGIX_vertex_preclip */ - -#ifdef GL_SGIX_vertex_preclip_hint - -#endif /* GL_SGIX_vertex_preclip_hint */ - -#ifdef GL_SGIX_ycrcb - -#endif /* GL_SGIX_ycrcb */ - -#ifdef GL_SGI_color_matrix - -#endif /* GL_SGI_color_matrix */ +#endif /* GL_SGIX_vertex_array_object */ #ifdef GL_SGI_color_table -static GLboolean _glewInit_GL_SGI_color_table (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_SGI_color_table () { GLboolean r = GL_FALSE; @@ -5145,13 +15933,28 @@ static GLboolean _glewInit_GL_SGI_color_table (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_SGI_color_table */ -#ifdef GL_SGI_texture_color_table +#ifdef GL_SGI_fft -#endif /* GL_SGI_texture_color_table */ +static GLboolean _glewInit_GL_SGI_fft () +{ + GLboolean r = GL_FALSE; + + r = ((glGetPixelTransformParameterfvSGI = (PFNGLGETPIXELTRANSFORMPARAMETERFVSGIPROC)glewGetProcAddress((const GLubyte*)"glGetPixelTransformParameterfvSGI")) == NULL) || r; + r = ((glGetPixelTransformParameterivSGI = (PFNGLGETPIXELTRANSFORMPARAMETERIVSGIPROC)glewGetProcAddress((const GLubyte*)"glGetPixelTransformParameterivSGI")) == NULL) || r; + r = ((glPixelTransformParameterfSGI = (PFNGLPIXELTRANSFORMPARAMETERFSGIPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterfSGI")) == NULL) || r; + r = ((glPixelTransformParameterfvSGI = (PFNGLPIXELTRANSFORMPARAMETERFVSGIPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterfvSGI")) == NULL) || r; + r = ((glPixelTransformParameteriSGI = (PFNGLPIXELTRANSFORMPARAMETERISGIPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameteriSGI")) == NULL) || r; + r = ((glPixelTransformParameterivSGI = (PFNGLPIXELTRANSFORMPARAMETERIVSGIPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterivSGI")) == NULL) || r; + r = ((glPixelTransformSGI = (PFNGLPIXELTRANSFORMSGIPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformSGI")) == NULL) || r; + + return r; +} + +#endif /* GL_SGI_fft */ #ifdef GL_SUNX_constant_data -static GLboolean _glewInit_GL_SUNX_constant_data (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_SUNX_constant_data () { GLboolean r = GL_FALSE; @@ -5162,13 +15965,9 @@ static GLboolean _glewInit_GL_SUNX_constant_data (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_SUNX_constant_data */ -#ifdef GL_SUN_convolution_border_modes - -#endif /* GL_SUN_convolution_border_modes */ - #ifdef GL_SUN_global_alpha -static GLboolean _glewInit_GL_SUN_global_alpha (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_SUN_global_alpha () { GLboolean r = GL_FALSE; @@ -5186,13 +15985,9 @@ static GLboolean _glewInit_GL_SUN_global_alpha (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_SUN_global_alpha */ -#ifdef GL_SUN_mesh_array - -#endif /* GL_SUN_mesh_array */ - #ifdef GL_SUN_read_video_pixels -static GLboolean _glewInit_GL_SUN_read_video_pixels (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_SUN_read_video_pixels () { GLboolean r = GL_FALSE; @@ -5203,13 +15998,9 @@ static GLboolean _glewInit_GL_SUN_read_video_pixels (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_SUN_read_video_pixels */ -#ifdef GL_SUN_slice_accum - -#endif /* GL_SUN_slice_accum */ - #ifdef GL_SUN_triangle_list -static GLboolean _glewInit_GL_SUN_triangle_list (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_SUN_triangle_list () { GLboolean r = GL_FALSE; @@ -5228,7 +16019,7 @@ static GLboolean _glewInit_GL_SUN_triangle_list (GLEW_CONTEXT_ARG_DEF_INIT) #ifdef GL_SUN_vertex -static GLboolean _glewInit_GL_SUN_vertex (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_SUN_vertex () { GLboolean r = GL_FALSE; @@ -5278,17 +16069,9 @@ static GLboolean _glewInit_GL_SUN_vertex (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_SUN_vertex */ -#ifdef GL_WIN_phong_shading - -#endif /* GL_WIN_phong_shading */ - -#ifdef GL_WIN_specular_fog - -#endif /* GL_WIN_specular_fog */ - #ifdef GL_WIN_swap_hint -static GLboolean _glewInit_GL_WIN_swap_hint (GLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GL_WIN_swap_hint () { GLboolean r = GL_FALSE; @@ -5301,1163 +16084,2748 @@ static GLboolean _glewInit_GL_WIN_swap_hint (GLEW_CONTEXT_ARG_DEF_INIT) /* ------------------------------------------------------------------------- */ -/* - * Search for name in the extensions string. Use of strstr() - * is not sufficient because extension names can be prefixes of - * other extension names. Could use strtok() but the constant - * string returned by glGetString might be in read-only memory. - */ -GLboolean glewGetExtension (const char* name) +static int _glewExtensionCompare(const char *s1, const char *s2) { - GLubyte* p; - GLubyte* end; - GLuint len = _glewStrLen((const GLubyte*)name); - p = (GLubyte*)glGetString(GL_EXTENSIONS); - if (0 == p) return GL_FALSE; - end = p + _glewStrLen(p); - while (p < end) + /* http://www.chanduthedev.com/2012/07/strcmp-implementation-in-c.html */ + while (*s1 || *s2) { - GLuint n = _glewStrCLen(p, ' '); - if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE; - p += n+1; + if (*s1 > *s2) + return 1; + if (*s1 < *s2) + return -1; + s1++; + s2++; } + return 0; +} + +static ptrdiff_t _glewBsearchExtension(const char* name) +{ + ptrdiff_t lo = 0, hi = sizeof(_glewExtensionLookup) / sizeof(char*) - 2; + + while (lo <= hi) + { + ptrdiff_t mid = (lo + hi) / 2; + const int cmp = _glewExtensionCompare(name, _glewExtensionLookup[mid]); + if (cmp < 0) hi = mid - 1; + else if (cmp > 0) lo = mid + 1; + else return mid; + } + return -1; +} + +static GLboolean *_glewGetExtensionString(const char *name) +{ + ptrdiff_t n = _glewBsearchExtension(name); + if (n >= 0) return &_glewExtensionString[n]; + return NULL; +} + +static GLboolean *_glewGetExtensionEnable(const char *name) +{ + ptrdiff_t n = _glewBsearchExtension(name); + if (n >= 0) return _glewExtensionEnabled[n]; + return NULL; +} + +static const char *_glewNextSpace(const char *i) +{ + const char *j = i; + if (j) + while (*j!=' ' && *j) ++j; + return j; +} + +static const char *_glewNextNonSpace(const char *i) +{ + const char *j = i; + if (j) + while (*j==' ') ++j; + return j; +} + +GLboolean GLEWAPIENTRY glewGetExtension (const char* name) +{ + GLboolean *enable = _glewGetExtensionString(name); + if (enable) + return *enable; return GL_FALSE; } /* ------------------------------------------------------------------------- */ -#ifndef GLEW_MX -static -#endif -GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) +typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGPROC) (GLenum name); +typedef void (GLAPIENTRY * PFNGLGETINTEGERVPROC) (GLenum pname, GLint *params); + +static GLenum GLEWAPIENTRY glewContextInit () { + PFNGLGETSTRINGPROC getString; const GLubyte* s; - GLuint dot, major, minor; - /* query opengl version */ - s = glGetString(GL_VERSION); - dot = _glewStrCLen(s, '.'); - major = dot-1; - minor = dot+1; - if (dot == 0 || s[minor] == '\0') + GLuint dot; + GLint major, minor; + size_t n; + + #ifdef _WIN32 + getString = glGetString; + #else + getString = (PFNGLGETSTRINGPROC) glewGetProcAddress((const GLubyte*)"glGetString"); + if (!getString) return GLEW_ERROR_NO_GL_VERSION; - if (s[major] == '1' && s[minor] == '0') + #endif + + /* query opengl version */ + s = getString(GL_VERSION); + dot = _glewStrCLen(s, '.'); + if (dot == 0) + return GLEW_ERROR_NO_GL_VERSION; + + major = s[dot-1]-'0'; + minor = s[dot+1]-'0'; + + if (minor < 0 || minor > 9) + minor = 0; + if (major<0 || major>9) + return GLEW_ERROR_NO_GL_VERSION; + + if (major == 1 && minor == 0) { return GLEW_ERROR_GL_VERSION_10_ONLY; } else { - CONST_CAST(GLEW_VERSION_1_1) = GL_TRUE; - if (s[major] >= '2') + GLEW_VERSION_4_6 = ( major > 4 ) || ( major == 4 && minor >= 6 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_4_5 = GLEW_VERSION_4_4 == GL_TRUE || ( major == 4 && minor >= 5 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_4_4 = GLEW_VERSION_4_5 == GL_TRUE || ( major == 4 && minor >= 4 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_4_3 = GLEW_VERSION_4_4 == GL_TRUE || ( major == 4 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_4_2 = GLEW_VERSION_4_3 == GL_TRUE || ( major == 4 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_4_1 = GLEW_VERSION_4_2 == GL_TRUE || ( major == 4 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_4_0 = GLEW_VERSION_4_1 == GL_TRUE || ( major == 4 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_3_3 = GLEW_VERSION_4_0 == GL_TRUE || ( major == 3 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_3_2 = GLEW_VERSION_3_3 == GL_TRUE || ( major == 3 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_3_1 = GLEW_VERSION_3_2 == GL_TRUE || ( major == 3 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_3_0 = GLEW_VERSION_3_1 == GL_TRUE || ( major == 3 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_2_1 = GLEW_VERSION_3_0 == GL_TRUE || ( major == 2 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_2_0 = GLEW_VERSION_2_1 == GL_TRUE || ( major == 2 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_1_5 = GLEW_VERSION_2_0 == GL_TRUE || ( major == 1 && minor >= 5 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_1_4 = GLEW_VERSION_1_5 == GL_TRUE || ( major == 1 && minor >= 4 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_1_3 = GLEW_VERSION_1_4 == GL_TRUE || ( major == 1 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_1_2_1 = GLEW_VERSION_1_3 == GL_TRUE ? GL_TRUE : GL_FALSE; + GLEW_VERSION_1_2 = GLEW_VERSION_1_2_1 == GL_TRUE || ( major == 1 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + GLEW_VERSION_1_1 = GLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + } + + for (n = 0; n < sizeof(_glewExtensionString) / sizeof(_glewExtensionString[0]); ++n) + _glewExtensionString[n] = GL_FALSE; + + if (GLEW_VERSION_3_0) + { + GLint n = 0; + GLint i; + PFNGLGETINTEGERVPROC getIntegerv; + PFNGLGETSTRINGIPROC getStringi; + const char *ext; + GLboolean *enable; + + #ifdef _WIN32 + getIntegerv = glGetIntegerv; + #else + getIntegerv = (PFNGLGETINTEGERVPROC) glewGetProcAddress((const GLubyte*)"glGetIntegerv"); + #endif + + if (getIntegerv) + getIntegerv(GL_NUM_EXTENSIONS, &n); + + /* glGetStringi is OpenGL 3.0 */ + getStringi = (PFNGLGETSTRINGIPROC) glewGetProcAddress((const GLubyte*)"glGetStringi"); + if (getStringi) + for (i = 0; i= '1') + end = extensions + _glewStrLen((const GLubyte *) extensions); + for (i=extensions; i= '5') - { - CONST_CAST(GLEW_VERSION_1_2) = GL_TRUE; - CONST_CAST(GLEW_VERSION_1_3) = GL_TRUE; - CONST_CAST(GLEW_VERSION_1_4) = GL_TRUE; - CONST_CAST(GLEW_VERSION_1_5) = GL_TRUE; - CONST_CAST(GLEW_VERSION_2_0) = GL_FALSE; - CONST_CAST(GLEW_VERSION_2_1) = GL_FALSE; - } - if (s[minor] == '4') - { - CONST_CAST(GLEW_VERSION_1_2) = GL_TRUE; - CONST_CAST(GLEW_VERSION_1_3) = GL_TRUE; - CONST_CAST(GLEW_VERSION_1_4) = GL_TRUE; - CONST_CAST(GLEW_VERSION_1_5) = GL_FALSE; - CONST_CAST(GLEW_VERSION_2_0) = GL_FALSE; - CONST_CAST(GLEW_VERSION_2_1) = GL_FALSE; - } - if (s[minor] == '3') - { - CONST_CAST(GLEW_VERSION_1_2) = GL_TRUE; - CONST_CAST(GLEW_VERSION_1_3) = GL_TRUE; - CONST_CAST(GLEW_VERSION_1_4) = GL_FALSE; - CONST_CAST(GLEW_VERSION_1_5) = GL_FALSE; - CONST_CAST(GLEW_VERSION_2_0) = GL_FALSE; - CONST_CAST(GLEW_VERSION_2_1) = GL_FALSE; - } - if (s[minor] == '2') - { - CONST_CAST(GLEW_VERSION_1_2) = GL_TRUE; - CONST_CAST(GLEW_VERSION_1_3) = GL_FALSE; - CONST_CAST(GLEW_VERSION_1_4) = GL_FALSE; - CONST_CAST(GLEW_VERSION_1_5) = GL_FALSE; - CONST_CAST(GLEW_VERSION_2_0) = GL_FALSE; - CONST_CAST(GLEW_VERSION_2_1) = GL_FALSE; - } - if (s[minor] < '2') - { - CONST_CAST(GLEW_VERSION_1_2) = GL_FALSE; - CONST_CAST(GLEW_VERSION_1_3) = GL_FALSE; - CONST_CAST(GLEW_VERSION_1_4) = GL_FALSE; - CONST_CAST(GLEW_VERSION_1_5) = GL_FALSE; - CONST_CAST(GLEW_VERSION_2_0) = GL_FALSE; - CONST_CAST(GLEW_VERSION_2_1) = GL_FALSE; + i = _glewNextNonSpace(i); + j = _glewNextSpace(i); + + /* Copy extension into NUL terminated string */ + if (j-i >= (ptrdiff_t) sizeof(ext)) + continue; + _glewStrCopy(ext, i, ' '); + + /* Based on extension string(s), glewGetExtension purposes */ + enable = _glewGetExtensionString(ext); + if (enable) + *enable = GL_TRUE; + + /* Based on extension string(s), experimental mode, glewIsSupported purposes */ + enable = _glewGetExtensionEnable(ext); + if (enable) + *enable = GL_TRUE; } } } - /* initialize extensions */ #ifdef GL_VERSION_1_2 - if (glewExperimental || GLEW_VERSION_1_2) CONST_CAST(GLEW_VERSION_1_2) = !_glewInit_GL_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_VERSION_1_2) GLEW_VERSION_1_2 = !_glewInit_GL_VERSION_1_2(); #endif /* GL_VERSION_1_2 */ #ifdef GL_VERSION_1_3 - if (glewExperimental || GLEW_VERSION_1_3) CONST_CAST(GLEW_VERSION_1_3) = !_glewInit_GL_VERSION_1_3(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_VERSION_1_3) GLEW_VERSION_1_3 = !_glewInit_GL_VERSION_1_3(); #endif /* GL_VERSION_1_3 */ #ifdef GL_VERSION_1_4 - if (glewExperimental || GLEW_VERSION_1_4) CONST_CAST(GLEW_VERSION_1_4) = !_glewInit_GL_VERSION_1_4(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_VERSION_1_4) GLEW_VERSION_1_4 = !_glewInit_GL_VERSION_1_4(); #endif /* GL_VERSION_1_4 */ #ifdef GL_VERSION_1_5 - if (glewExperimental || GLEW_VERSION_1_5) CONST_CAST(GLEW_VERSION_1_5) = !_glewInit_GL_VERSION_1_5(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_VERSION_1_5) GLEW_VERSION_1_5 = !_glewInit_GL_VERSION_1_5(); #endif /* GL_VERSION_1_5 */ #ifdef GL_VERSION_2_0 - if (glewExperimental || GLEW_VERSION_2_0) CONST_CAST(GLEW_VERSION_2_0) = !_glewInit_GL_VERSION_2_0(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_VERSION_2_0) GLEW_VERSION_2_0 = !_glewInit_GL_VERSION_2_0(); #endif /* GL_VERSION_2_0 */ #ifdef GL_VERSION_2_1 - if (glewExperimental || GLEW_VERSION_2_1) CONST_CAST(GLEW_VERSION_2_1) = !_glewInit_GL_VERSION_2_1(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_VERSION_2_1) GLEW_VERSION_2_1 = !_glewInit_GL_VERSION_2_1(); #endif /* GL_VERSION_2_1 */ -#ifdef GL_3DFX_multisample - CONST_CAST(GLEW_3DFX_multisample) = glewGetExtension("GL_3DFX_multisample"); -#endif /* GL_3DFX_multisample */ +#ifdef GL_VERSION_3_0 + if (glewExperimental || GLEW_VERSION_3_0) GLEW_VERSION_3_0 = !_glewInit_GL_VERSION_3_0(); +#endif /* GL_VERSION_3_0 */ +#ifdef GL_VERSION_3_1 + if (glewExperimental || GLEW_VERSION_3_1) GLEW_VERSION_3_1 = !_glewInit_GL_VERSION_3_1(); +#endif /* GL_VERSION_3_1 */ +#ifdef GL_VERSION_3_2 + if (glewExperimental || GLEW_VERSION_3_2) GLEW_VERSION_3_2 = !_glewInit_GL_VERSION_3_2(); +#endif /* GL_VERSION_3_2 */ +#ifdef GL_VERSION_3_3 + if (glewExperimental || GLEW_VERSION_3_3) GLEW_VERSION_3_3 = !_glewInit_GL_VERSION_3_3(); +#endif /* GL_VERSION_3_3 */ +#ifdef GL_VERSION_4_0 + if (glewExperimental || GLEW_VERSION_4_0) GLEW_VERSION_4_0 = !_glewInit_GL_VERSION_4_0(); +#endif /* GL_VERSION_4_0 */ +#ifdef GL_VERSION_4_5 + if (glewExperimental || GLEW_VERSION_4_5) GLEW_VERSION_4_5 = !_glewInit_GL_VERSION_4_5(); +#endif /* GL_VERSION_4_5 */ +#ifdef GL_VERSION_4_6 + if (glewExperimental || GLEW_VERSION_4_6) GLEW_VERSION_4_6 = !_glewInit_GL_VERSION_4_6(); +#endif /* GL_VERSION_4_6 */ #ifdef GL_3DFX_tbuffer - CONST_CAST(GLEW_3DFX_tbuffer) = glewGetExtension("GL_3DFX_tbuffer"); - if (glewExperimental || GLEW_3DFX_tbuffer) CONST_CAST(GLEW_3DFX_tbuffer) = !_glewInit_GL_3DFX_tbuffer(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_3DFX_tbuffer) GLEW_3DFX_tbuffer = !_glewInit_GL_3DFX_tbuffer(); #endif /* GL_3DFX_tbuffer */ -#ifdef GL_3DFX_texture_compression_FXT1 - CONST_CAST(GLEW_3DFX_texture_compression_FXT1) = glewGetExtension("GL_3DFX_texture_compression_FXT1"); -#endif /* GL_3DFX_texture_compression_FXT1 */ -#ifdef GL_APPLE_client_storage - CONST_CAST(GLEW_APPLE_client_storage) = glewGetExtension("GL_APPLE_client_storage"); -#endif /* GL_APPLE_client_storage */ +#ifdef GL_AMD_debug_output + if (glewExperimental || GLEW_AMD_debug_output) GLEW_AMD_debug_output = !_glewInit_GL_AMD_debug_output(); +#endif /* GL_AMD_debug_output */ +#ifdef GL_AMD_draw_buffers_blend + if (glewExperimental || GLEW_AMD_draw_buffers_blend) GLEW_AMD_draw_buffers_blend = !_glewInit_GL_AMD_draw_buffers_blend(); +#endif /* GL_AMD_draw_buffers_blend */ +#ifdef GL_AMD_framebuffer_sample_positions + if (glewExperimental || GLEW_AMD_framebuffer_sample_positions) GLEW_AMD_framebuffer_sample_positions = !_glewInit_GL_AMD_framebuffer_sample_positions(); +#endif /* GL_AMD_framebuffer_sample_positions */ +#ifdef GL_AMD_interleaved_elements + if (glewExperimental || GLEW_AMD_interleaved_elements) GLEW_AMD_interleaved_elements = !_glewInit_GL_AMD_interleaved_elements(); +#endif /* GL_AMD_interleaved_elements */ +#ifdef GL_AMD_multi_draw_indirect + if (glewExperimental || GLEW_AMD_multi_draw_indirect) GLEW_AMD_multi_draw_indirect = !_glewInit_GL_AMD_multi_draw_indirect(); +#endif /* GL_AMD_multi_draw_indirect */ +#ifdef GL_AMD_name_gen_delete + if (glewExperimental || GLEW_AMD_name_gen_delete) GLEW_AMD_name_gen_delete = !_glewInit_GL_AMD_name_gen_delete(); +#endif /* GL_AMD_name_gen_delete */ +#ifdef GL_AMD_occlusion_query_event + if (glewExperimental || GLEW_AMD_occlusion_query_event) GLEW_AMD_occlusion_query_event = !_glewInit_GL_AMD_occlusion_query_event(); +#endif /* GL_AMD_occlusion_query_event */ +#ifdef GL_AMD_performance_monitor + if (glewExperimental || GLEW_AMD_performance_monitor) GLEW_AMD_performance_monitor = !_glewInit_GL_AMD_performance_monitor(); +#endif /* GL_AMD_performance_monitor */ +#ifdef GL_AMD_sample_positions + if (glewExperimental || GLEW_AMD_sample_positions) GLEW_AMD_sample_positions = !_glewInit_GL_AMD_sample_positions(); +#endif /* GL_AMD_sample_positions */ +#ifdef GL_AMD_sparse_texture + if (glewExperimental || GLEW_AMD_sparse_texture) GLEW_AMD_sparse_texture = !_glewInit_GL_AMD_sparse_texture(); +#endif /* GL_AMD_sparse_texture */ +#ifdef GL_AMD_stencil_operation_extended + if (glewExperimental || GLEW_AMD_stencil_operation_extended) GLEW_AMD_stencil_operation_extended = !_glewInit_GL_AMD_stencil_operation_extended(); +#endif /* GL_AMD_stencil_operation_extended */ +#ifdef GL_AMD_vertex_shader_tessellator + if (glewExperimental || GLEW_AMD_vertex_shader_tessellator) GLEW_AMD_vertex_shader_tessellator = !_glewInit_GL_AMD_vertex_shader_tessellator(); +#endif /* GL_AMD_vertex_shader_tessellator */ +#ifdef GL_ANGLE_framebuffer_blit + if (glewExperimental || GLEW_ANGLE_framebuffer_blit) GLEW_ANGLE_framebuffer_blit = !_glewInit_GL_ANGLE_framebuffer_blit(); +#endif /* GL_ANGLE_framebuffer_blit */ +#ifdef GL_ANGLE_framebuffer_multisample + if (glewExperimental || GLEW_ANGLE_framebuffer_multisample) GLEW_ANGLE_framebuffer_multisample = !_glewInit_GL_ANGLE_framebuffer_multisample(); +#endif /* GL_ANGLE_framebuffer_multisample */ +#ifdef GL_ANGLE_instanced_arrays + if (glewExperimental || GLEW_ANGLE_instanced_arrays) GLEW_ANGLE_instanced_arrays = !_glewInit_GL_ANGLE_instanced_arrays(); +#endif /* GL_ANGLE_instanced_arrays */ +#ifdef GL_ANGLE_timer_query + if (glewExperimental || GLEW_ANGLE_timer_query) GLEW_ANGLE_timer_query = !_glewInit_GL_ANGLE_timer_query(); +#endif /* GL_ANGLE_timer_query */ +#ifdef GL_ANGLE_translated_shader_source + if (glewExperimental || GLEW_ANGLE_translated_shader_source) GLEW_ANGLE_translated_shader_source = !_glewInit_GL_ANGLE_translated_shader_source(); +#endif /* GL_ANGLE_translated_shader_source */ +#ifdef GL_APPLE_copy_texture_levels + if (glewExperimental || GLEW_APPLE_copy_texture_levels) GLEW_APPLE_copy_texture_levels = !_glewInit_GL_APPLE_copy_texture_levels(); +#endif /* GL_APPLE_copy_texture_levels */ #ifdef GL_APPLE_element_array - CONST_CAST(GLEW_APPLE_element_array) = glewGetExtension("GL_APPLE_element_array"); - if (glewExperimental || GLEW_APPLE_element_array) CONST_CAST(GLEW_APPLE_element_array) = !_glewInit_GL_APPLE_element_array(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_APPLE_element_array) GLEW_APPLE_element_array = !_glewInit_GL_APPLE_element_array(); #endif /* GL_APPLE_element_array */ #ifdef GL_APPLE_fence - CONST_CAST(GLEW_APPLE_fence) = glewGetExtension("GL_APPLE_fence"); - if (glewExperimental || GLEW_APPLE_fence) CONST_CAST(GLEW_APPLE_fence) = !_glewInit_GL_APPLE_fence(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_APPLE_fence) GLEW_APPLE_fence = !_glewInit_GL_APPLE_fence(); #endif /* GL_APPLE_fence */ -#ifdef GL_APPLE_float_pixels - CONST_CAST(GLEW_APPLE_float_pixels) = glewGetExtension("GL_APPLE_float_pixels"); -#endif /* GL_APPLE_float_pixels */ #ifdef GL_APPLE_flush_buffer_range - CONST_CAST(GLEW_APPLE_flush_buffer_range) = glewGetExtension("GL_APPLE_flush_buffer_range"); - if (glewExperimental || GLEW_APPLE_flush_buffer_range) CONST_CAST(GLEW_APPLE_flush_buffer_range) = !_glewInit_GL_APPLE_flush_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_APPLE_flush_buffer_range) GLEW_APPLE_flush_buffer_range = !_glewInit_GL_APPLE_flush_buffer_range(); #endif /* GL_APPLE_flush_buffer_range */ -#ifdef GL_APPLE_pixel_buffer - CONST_CAST(GLEW_APPLE_pixel_buffer) = glewGetExtension("GL_APPLE_pixel_buffer"); -#endif /* GL_APPLE_pixel_buffer */ -#ifdef GL_APPLE_specular_vector - CONST_CAST(GLEW_APPLE_specular_vector) = glewGetExtension("GL_APPLE_specular_vector"); -#endif /* GL_APPLE_specular_vector */ +#ifdef GL_APPLE_framebuffer_multisample + if (glewExperimental || GLEW_APPLE_framebuffer_multisample) GLEW_APPLE_framebuffer_multisample = !_glewInit_GL_APPLE_framebuffer_multisample(); +#endif /* GL_APPLE_framebuffer_multisample */ +#ifdef GL_APPLE_object_purgeable + if (glewExperimental || GLEW_APPLE_object_purgeable) GLEW_APPLE_object_purgeable = !_glewInit_GL_APPLE_object_purgeable(); +#endif /* GL_APPLE_object_purgeable */ +#ifdef GL_APPLE_sync + if (glewExperimental || GLEW_APPLE_sync) GLEW_APPLE_sync = !_glewInit_GL_APPLE_sync(); +#endif /* GL_APPLE_sync */ #ifdef GL_APPLE_texture_range - CONST_CAST(GLEW_APPLE_texture_range) = glewGetExtension("GL_APPLE_texture_range"); - if (glewExperimental || GLEW_APPLE_texture_range) CONST_CAST(GLEW_APPLE_texture_range) = !_glewInit_GL_APPLE_texture_range(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_APPLE_texture_range) GLEW_APPLE_texture_range = !_glewInit_GL_APPLE_texture_range(); #endif /* GL_APPLE_texture_range */ -#ifdef GL_APPLE_transform_hint - CONST_CAST(GLEW_APPLE_transform_hint) = glewGetExtension("GL_APPLE_transform_hint"); -#endif /* GL_APPLE_transform_hint */ #ifdef GL_APPLE_vertex_array_object - CONST_CAST(GLEW_APPLE_vertex_array_object) = glewGetExtension("GL_APPLE_vertex_array_object"); - if (glewExperimental || GLEW_APPLE_vertex_array_object) CONST_CAST(GLEW_APPLE_vertex_array_object) = !_glewInit_GL_APPLE_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_APPLE_vertex_array_object) GLEW_APPLE_vertex_array_object = !_glewInit_GL_APPLE_vertex_array_object(); #endif /* GL_APPLE_vertex_array_object */ #ifdef GL_APPLE_vertex_array_range - CONST_CAST(GLEW_APPLE_vertex_array_range) = glewGetExtension("GL_APPLE_vertex_array_range"); - if (glewExperimental || GLEW_APPLE_vertex_array_range) CONST_CAST(GLEW_APPLE_vertex_array_range) = !_glewInit_GL_APPLE_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_APPLE_vertex_array_range) GLEW_APPLE_vertex_array_range = !_glewInit_GL_APPLE_vertex_array_range(); #endif /* GL_APPLE_vertex_array_range */ -#ifdef GL_APPLE_ycbcr_422 - CONST_CAST(GLEW_APPLE_ycbcr_422) = glewGetExtension("GL_APPLE_ycbcr_422"); -#endif /* GL_APPLE_ycbcr_422 */ +#ifdef GL_APPLE_vertex_program_evaluators + if (glewExperimental || GLEW_APPLE_vertex_program_evaluators) GLEW_APPLE_vertex_program_evaluators = !_glewInit_GL_APPLE_vertex_program_evaluators(); +#endif /* GL_APPLE_vertex_program_evaluators */ +#ifdef GL_ARB_ES2_compatibility + if (glewExperimental || GLEW_ARB_ES2_compatibility) GLEW_ARB_ES2_compatibility = !_glewInit_GL_ARB_ES2_compatibility(); +#endif /* GL_ARB_ES2_compatibility */ +#ifdef GL_ARB_ES3_1_compatibility + if (glewExperimental || GLEW_ARB_ES3_1_compatibility) GLEW_ARB_ES3_1_compatibility = !_glewInit_GL_ARB_ES3_1_compatibility(); +#endif /* GL_ARB_ES3_1_compatibility */ +#ifdef GL_ARB_ES3_2_compatibility + if (glewExperimental || GLEW_ARB_ES3_2_compatibility) GLEW_ARB_ES3_2_compatibility = !_glewInit_GL_ARB_ES3_2_compatibility(); +#endif /* GL_ARB_ES3_2_compatibility */ +#ifdef GL_ARB_base_instance + if (glewExperimental || GLEW_ARB_base_instance) GLEW_ARB_base_instance = !_glewInit_GL_ARB_base_instance(); +#endif /* GL_ARB_base_instance */ +#ifdef GL_ARB_bindless_texture + if (glewExperimental || GLEW_ARB_bindless_texture) GLEW_ARB_bindless_texture = !_glewInit_GL_ARB_bindless_texture(); +#endif /* GL_ARB_bindless_texture */ +#ifdef GL_ARB_blend_func_extended + if (glewExperimental || GLEW_ARB_blend_func_extended) GLEW_ARB_blend_func_extended = !_glewInit_GL_ARB_blend_func_extended(); +#endif /* GL_ARB_blend_func_extended */ +#ifdef GL_ARB_buffer_storage + if (glewExperimental || GLEW_ARB_buffer_storage) GLEW_ARB_buffer_storage = !_glewInit_GL_ARB_buffer_storage(); +#endif /* GL_ARB_buffer_storage */ +#ifdef GL_ARB_cl_event + if (glewExperimental || GLEW_ARB_cl_event) GLEW_ARB_cl_event = !_glewInit_GL_ARB_cl_event(); +#endif /* GL_ARB_cl_event */ +#ifdef GL_ARB_clear_buffer_object + if (glewExperimental || GLEW_ARB_clear_buffer_object) GLEW_ARB_clear_buffer_object = !_glewInit_GL_ARB_clear_buffer_object(); +#endif /* GL_ARB_clear_buffer_object */ +#ifdef GL_ARB_clear_texture + if (glewExperimental || GLEW_ARB_clear_texture) GLEW_ARB_clear_texture = !_glewInit_GL_ARB_clear_texture(); +#endif /* GL_ARB_clear_texture */ +#ifdef GL_ARB_clip_control + if (glewExperimental || GLEW_ARB_clip_control) GLEW_ARB_clip_control = !_glewInit_GL_ARB_clip_control(); +#endif /* GL_ARB_clip_control */ #ifdef GL_ARB_color_buffer_float - CONST_CAST(GLEW_ARB_color_buffer_float) = glewGetExtension("GL_ARB_color_buffer_float"); - if (glewExperimental || GLEW_ARB_color_buffer_float) CONST_CAST(GLEW_ARB_color_buffer_float) = !_glewInit_GL_ARB_color_buffer_float(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ARB_color_buffer_float) GLEW_ARB_color_buffer_float = !_glewInit_GL_ARB_color_buffer_float(); #endif /* GL_ARB_color_buffer_float */ -#ifdef GL_ARB_depth_texture - CONST_CAST(GLEW_ARB_depth_texture) = glewGetExtension("GL_ARB_depth_texture"); -#endif /* GL_ARB_depth_texture */ +#ifdef GL_ARB_compute_shader + if (glewExperimental || GLEW_ARB_compute_shader) GLEW_ARB_compute_shader = !_glewInit_GL_ARB_compute_shader(); +#endif /* GL_ARB_compute_shader */ +#ifdef GL_ARB_compute_variable_group_size + if (glewExperimental || GLEW_ARB_compute_variable_group_size) GLEW_ARB_compute_variable_group_size = !_glewInit_GL_ARB_compute_variable_group_size(); +#endif /* GL_ARB_compute_variable_group_size */ +#ifdef GL_ARB_copy_buffer + if (glewExperimental || GLEW_ARB_copy_buffer) GLEW_ARB_copy_buffer = !_glewInit_GL_ARB_copy_buffer(); +#endif /* GL_ARB_copy_buffer */ +#ifdef GL_ARB_copy_image + if (glewExperimental || GLEW_ARB_copy_image) GLEW_ARB_copy_image = !_glewInit_GL_ARB_copy_image(); +#endif /* GL_ARB_copy_image */ +#ifdef GL_ARB_debug_output + if (glewExperimental || GLEW_ARB_debug_output) GLEW_ARB_debug_output = !_glewInit_GL_ARB_debug_output(); +#endif /* GL_ARB_debug_output */ +#ifdef GL_ARB_direct_state_access + if (glewExperimental || GLEW_ARB_direct_state_access) GLEW_ARB_direct_state_access = !_glewInit_GL_ARB_direct_state_access(); +#endif /* GL_ARB_direct_state_access */ #ifdef GL_ARB_draw_buffers - CONST_CAST(GLEW_ARB_draw_buffers) = glewGetExtension("GL_ARB_draw_buffers"); - if (glewExperimental || GLEW_ARB_draw_buffers) CONST_CAST(GLEW_ARB_draw_buffers) = !_glewInit_GL_ARB_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ARB_draw_buffers) GLEW_ARB_draw_buffers = !_glewInit_GL_ARB_draw_buffers(); #endif /* GL_ARB_draw_buffers */ -#ifdef GL_ARB_fragment_program - CONST_CAST(GLEW_ARB_fragment_program) = glewGetExtension("GL_ARB_fragment_program"); -#endif /* GL_ARB_fragment_program */ -#ifdef GL_ARB_fragment_program_shadow - CONST_CAST(GLEW_ARB_fragment_program_shadow) = glewGetExtension("GL_ARB_fragment_program_shadow"); -#endif /* GL_ARB_fragment_program_shadow */ -#ifdef GL_ARB_fragment_shader - CONST_CAST(GLEW_ARB_fragment_shader) = glewGetExtension("GL_ARB_fragment_shader"); -#endif /* GL_ARB_fragment_shader */ -#ifdef GL_ARB_half_float_pixel - CONST_CAST(GLEW_ARB_half_float_pixel) = glewGetExtension("GL_ARB_half_float_pixel"); -#endif /* GL_ARB_half_float_pixel */ +#ifdef GL_ARB_draw_buffers_blend + if (glewExperimental || GLEW_ARB_draw_buffers_blend) GLEW_ARB_draw_buffers_blend = !_glewInit_GL_ARB_draw_buffers_blend(); +#endif /* GL_ARB_draw_buffers_blend */ +#ifdef GL_ARB_draw_elements_base_vertex + if (glewExperimental || GLEW_ARB_draw_elements_base_vertex) GLEW_ARB_draw_elements_base_vertex = !_glewInit_GL_ARB_draw_elements_base_vertex(); +#endif /* GL_ARB_draw_elements_base_vertex */ +#ifdef GL_ARB_draw_indirect + if (glewExperimental || GLEW_ARB_draw_indirect) GLEW_ARB_draw_indirect = !_glewInit_GL_ARB_draw_indirect(); +#endif /* GL_ARB_draw_indirect */ +#ifdef GL_ARB_framebuffer_no_attachments + if (glewExperimental || GLEW_ARB_framebuffer_no_attachments) GLEW_ARB_framebuffer_no_attachments = !_glewInit_GL_ARB_framebuffer_no_attachments(); +#endif /* GL_ARB_framebuffer_no_attachments */ +#ifdef GL_ARB_framebuffer_object + if (glewExperimental || GLEW_ARB_framebuffer_object) GLEW_ARB_framebuffer_object = !_glewInit_GL_ARB_framebuffer_object(); +#endif /* GL_ARB_framebuffer_object */ +#ifdef GL_ARB_geometry_shader4 + if (glewExperimental || GLEW_ARB_geometry_shader4) GLEW_ARB_geometry_shader4 = !_glewInit_GL_ARB_geometry_shader4(); +#endif /* GL_ARB_geometry_shader4 */ +#ifdef GL_ARB_get_program_binary + if (glewExperimental || GLEW_ARB_get_program_binary) GLEW_ARB_get_program_binary = !_glewInit_GL_ARB_get_program_binary(); +#endif /* GL_ARB_get_program_binary */ +#ifdef GL_ARB_get_texture_sub_image + if (glewExperimental || GLEW_ARB_get_texture_sub_image) GLEW_ARB_get_texture_sub_image = !_glewInit_GL_ARB_get_texture_sub_image(); +#endif /* GL_ARB_get_texture_sub_image */ +#ifdef GL_ARB_gl_spirv + if (glewExperimental || GLEW_ARB_gl_spirv) GLEW_ARB_gl_spirv = !_glewInit_GL_ARB_gl_spirv(); +#endif /* GL_ARB_gl_spirv */ +#ifdef GL_ARB_gpu_shader_fp64 + if (glewExperimental || GLEW_ARB_gpu_shader_fp64) GLEW_ARB_gpu_shader_fp64 = !_glewInit_GL_ARB_gpu_shader_fp64(); +#endif /* GL_ARB_gpu_shader_fp64 */ +#ifdef GL_ARB_gpu_shader_int64 + if (glewExperimental || GLEW_ARB_gpu_shader_int64) GLEW_ARB_gpu_shader_int64 = !_glewInit_GL_ARB_gpu_shader_int64(); +#endif /* GL_ARB_gpu_shader_int64 */ #ifdef GL_ARB_imaging - CONST_CAST(GLEW_ARB_imaging) = glewGetExtension("GL_ARB_imaging"); - if (glewExperimental || GLEW_ARB_imaging) CONST_CAST(GLEW_ARB_imaging) = !_glewInit_GL_ARB_imaging(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ARB_imaging) GLEW_ARB_imaging = !_glewInit_GL_ARB_imaging(); #endif /* GL_ARB_imaging */ +#ifdef GL_ARB_indirect_parameters + if (glewExperimental || GLEW_ARB_indirect_parameters) GLEW_ARB_indirect_parameters = !_glewInit_GL_ARB_indirect_parameters(); +#endif /* GL_ARB_indirect_parameters */ +#ifdef GL_ARB_instanced_arrays + if (glewExperimental || GLEW_ARB_instanced_arrays) GLEW_ARB_instanced_arrays = !_glewInit_GL_ARB_instanced_arrays(); +#endif /* GL_ARB_instanced_arrays */ +#ifdef GL_ARB_internalformat_query + if (glewExperimental || GLEW_ARB_internalformat_query) GLEW_ARB_internalformat_query = !_glewInit_GL_ARB_internalformat_query(); +#endif /* GL_ARB_internalformat_query */ +#ifdef GL_ARB_internalformat_query2 + if (glewExperimental || GLEW_ARB_internalformat_query2) GLEW_ARB_internalformat_query2 = !_glewInit_GL_ARB_internalformat_query2(); +#endif /* GL_ARB_internalformat_query2 */ +#ifdef GL_ARB_invalidate_subdata + if (glewExperimental || GLEW_ARB_invalidate_subdata) GLEW_ARB_invalidate_subdata = !_glewInit_GL_ARB_invalidate_subdata(); +#endif /* GL_ARB_invalidate_subdata */ +#ifdef GL_ARB_map_buffer_range + if (glewExperimental || GLEW_ARB_map_buffer_range) GLEW_ARB_map_buffer_range = !_glewInit_GL_ARB_map_buffer_range(); +#endif /* GL_ARB_map_buffer_range */ #ifdef GL_ARB_matrix_palette - CONST_CAST(GLEW_ARB_matrix_palette) = glewGetExtension("GL_ARB_matrix_palette"); - if (glewExperimental || GLEW_ARB_matrix_palette) CONST_CAST(GLEW_ARB_matrix_palette) = !_glewInit_GL_ARB_matrix_palette(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ARB_matrix_palette) GLEW_ARB_matrix_palette = !_glewInit_GL_ARB_matrix_palette(); #endif /* GL_ARB_matrix_palette */ +#ifdef GL_ARB_multi_bind + if (glewExperimental || GLEW_ARB_multi_bind) GLEW_ARB_multi_bind = !_glewInit_GL_ARB_multi_bind(); +#endif /* GL_ARB_multi_bind */ +#ifdef GL_ARB_multi_draw_indirect + if (glewExperimental || GLEW_ARB_multi_draw_indirect) GLEW_ARB_multi_draw_indirect = !_glewInit_GL_ARB_multi_draw_indirect(); +#endif /* GL_ARB_multi_draw_indirect */ #ifdef GL_ARB_multisample - CONST_CAST(GLEW_ARB_multisample) = glewGetExtension("GL_ARB_multisample"); - if (glewExperimental || GLEW_ARB_multisample) CONST_CAST(GLEW_ARB_multisample) = !_glewInit_GL_ARB_multisample(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ARB_multisample) GLEW_ARB_multisample = !_glewInit_GL_ARB_multisample(); #endif /* GL_ARB_multisample */ #ifdef GL_ARB_multitexture - CONST_CAST(GLEW_ARB_multitexture) = glewGetExtension("GL_ARB_multitexture"); - if (glewExperimental || GLEW_ARB_multitexture) CONST_CAST(GLEW_ARB_multitexture) = !_glewInit_GL_ARB_multitexture(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ARB_multitexture) GLEW_ARB_multitexture = !_glewInit_GL_ARB_multitexture(); #endif /* GL_ARB_multitexture */ #ifdef GL_ARB_occlusion_query - CONST_CAST(GLEW_ARB_occlusion_query) = glewGetExtension("GL_ARB_occlusion_query"); - if (glewExperimental || GLEW_ARB_occlusion_query) CONST_CAST(GLEW_ARB_occlusion_query) = !_glewInit_GL_ARB_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ARB_occlusion_query) GLEW_ARB_occlusion_query = !_glewInit_GL_ARB_occlusion_query(); #endif /* GL_ARB_occlusion_query */ -#ifdef GL_ARB_pixel_buffer_object - CONST_CAST(GLEW_ARB_pixel_buffer_object) = glewGetExtension("GL_ARB_pixel_buffer_object"); -#endif /* GL_ARB_pixel_buffer_object */ +#ifdef GL_ARB_parallel_shader_compile + if (glewExperimental || GLEW_ARB_parallel_shader_compile) GLEW_ARB_parallel_shader_compile = !_glewInit_GL_ARB_parallel_shader_compile(); +#endif /* GL_ARB_parallel_shader_compile */ #ifdef GL_ARB_point_parameters - CONST_CAST(GLEW_ARB_point_parameters) = glewGetExtension("GL_ARB_point_parameters"); - if (glewExperimental || GLEW_ARB_point_parameters) CONST_CAST(GLEW_ARB_point_parameters) = !_glewInit_GL_ARB_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ARB_point_parameters) GLEW_ARB_point_parameters = !_glewInit_GL_ARB_point_parameters(); #endif /* GL_ARB_point_parameters */ -#ifdef GL_ARB_point_sprite - CONST_CAST(GLEW_ARB_point_sprite) = glewGetExtension("GL_ARB_point_sprite"); -#endif /* GL_ARB_point_sprite */ +#ifdef GL_ARB_polygon_offset_clamp + if (glewExperimental || GLEW_ARB_polygon_offset_clamp) GLEW_ARB_polygon_offset_clamp = !_glewInit_GL_ARB_polygon_offset_clamp(); +#endif /* GL_ARB_polygon_offset_clamp */ +#ifdef GL_ARB_program_interface_query + if (glewExperimental || GLEW_ARB_program_interface_query) GLEW_ARB_program_interface_query = !_glewInit_GL_ARB_program_interface_query(); +#endif /* GL_ARB_program_interface_query */ +#ifdef GL_ARB_provoking_vertex + if (glewExperimental || GLEW_ARB_provoking_vertex) GLEW_ARB_provoking_vertex = !_glewInit_GL_ARB_provoking_vertex(); +#endif /* GL_ARB_provoking_vertex */ +#ifdef GL_ARB_robustness + if (glewExperimental || GLEW_ARB_robustness) GLEW_ARB_robustness = !_glewInit_GL_ARB_robustness(); +#endif /* GL_ARB_robustness */ +#ifdef GL_ARB_sample_locations + if (glewExperimental || GLEW_ARB_sample_locations) GLEW_ARB_sample_locations = !_glewInit_GL_ARB_sample_locations(); +#endif /* GL_ARB_sample_locations */ +#ifdef GL_ARB_sample_shading + if (glewExperimental || GLEW_ARB_sample_shading) GLEW_ARB_sample_shading = !_glewInit_GL_ARB_sample_shading(); +#endif /* GL_ARB_sample_shading */ +#ifdef GL_ARB_sampler_objects + if (glewExperimental || GLEW_ARB_sampler_objects) GLEW_ARB_sampler_objects = !_glewInit_GL_ARB_sampler_objects(); +#endif /* GL_ARB_sampler_objects */ +#ifdef GL_ARB_separate_shader_objects + if (glewExperimental || GLEW_ARB_separate_shader_objects) GLEW_ARB_separate_shader_objects = !_glewInit_GL_ARB_separate_shader_objects(); +#endif /* GL_ARB_separate_shader_objects */ +#ifdef GL_ARB_shader_atomic_counters + if (glewExperimental || GLEW_ARB_shader_atomic_counters) GLEW_ARB_shader_atomic_counters = !_glewInit_GL_ARB_shader_atomic_counters(); +#endif /* GL_ARB_shader_atomic_counters */ +#ifdef GL_ARB_shader_image_load_store + if (glewExperimental || GLEW_ARB_shader_image_load_store) GLEW_ARB_shader_image_load_store = !_glewInit_GL_ARB_shader_image_load_store(); +#endif /* GL_ARB_shader_image_load_store */ #ifdef GL_ARB_shader_objects - CONST_CAST(GLEW_ARB_shader_objects) = glewGetExtension("GL_ARB_shader_objects"); - if (glewExperimental || GLEW_ARB_shader_objects) CONST_CAST(GLEW_ARB_shader_objects) = !_glewInit_GL_ARB_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ARB_shader_objects) GLEW_ARB_shader_objects = !_glewInit_GL_ARB_shader_objects(); #endif /* GL_ARB_shader_objects */ -#ifdef GL_ARB_shading_language_100 - CONST_CAST(GLEW_ARB_shading_language_100) = glewGetExtension("GL_ARB_shading_language_100"); -#endif /* GL_ARB_shading_language_100 */ -#ifdef GL_ARB_shadow - CONST_CAST(GLEW_ARB_shadow) = glewGetExtension("GL_ARB_shadow"); -#endif /* GL_ARB_shadow */ -#ifdef GL_ARB_shadow_ambient - CONST_CAST(GLEW_ARB_shadow_ambient) = glewGetExtension("GL_ARB_shadow_ambient"); -#endif /* GL_ARB_shadow_ambient */ -#ifdef GL_ARB_texture_border_clamp - CONST_CAST(GLEW_ARB_texture_border_clamp) = glewGetExtension("GL_ARB_texture_border_clamp"); -#endif /* GL_ARB_texture_border_clamp */ +#ifdef GL_ARB_shader_storage_buffer_object + if (glewExperimental || GLEW_ARB_shader_storage_buffer_object) GLEW_ARB_shader_storage_buffer_object = !_glewInit_GL_ARB_shader_storage_buffer_object(); +#endif /* GL_ARB_shader_storage_buffer_object */ +#ifdef GL_ARB_shader_subroutine + if (glewExperimental || GLEW_ARB_shader_subroutine) GLEW_ARB_shader_subroutine = !_glewInit_GL_ARB_shader_subroutine(); +#endif /* GL_ARB_shader_subroutine */ +#ifdef GL_ARB_shading_language_include + if (glewExperimental || GLEW_ARB_shading_language_include) GLEW_ARB_shading_language_include = !_glewInit_GL_ARB_shading_language_include(); +#endif /* GL_ARB_shading_language_include */ +#ifdef GL_ARB_sparse_buffer + if (glewExperimental || GLEW_ARB_sparse_buffer) GLEW_ARB_sparse_buffer = !_glewInit_GL_ARB_sparse_buffer(); +#endif /* GL_ARB_sparse_buffer */ +#ifdef GL_ARB_sparse_texture + if (glewExperimental || GLEW_ARB_sparse_texture) GLEW_ARB_sparse_texture = !_glewInit_GL_ARB_sparse_texture(); +#endif /* GL_ARB_sparse_texture */ +#ifdef GL_ARB_sync + if (glewExperimental || GLEW_ARB_sync) GLEW_ARB_sync = !_glewInit_GL_ARB_sync(); +#endif /* GL_ARB_sync */ +#ifdef GL_ARB_tessellation_shader + if (glewExperimental || GLEW_ARB_tessellation_shader) GLEW_ARB_tessellation_shader = !_glewInit_GL_ARB_tessellation_shader(); +#endif /* GL_ARB_tessellation_shader */ +#ifdef GL_ARB_texture_barrier + if (glewExperimental || GLEW_ARB_texture_barrier) GLEW_ARB_texture_barrier = !_glewInit_GL_ARB_texture_barrier(); +#endif /* GL_ARB_texture_barrier */ +#ifdef GL_ARB_texture_buffer_object + if (glewExperimental || GLEW_ARB_texture_buffer_object) GLEW_ARB_texture_buffer_object = !_glewInit_GL_ARB_texture_buffer_object(); +#endif /* GL_ARB_texture_buffer_object */ +#ifdef GL_ARB_texture_buffer_range + if (glewExperimental || GLEW_ARB_texture_buffer_range) GLEW_ARB_texture_buffer_range = !_glewInit_GL_ARB_texture_buffer_range(); +#endif /* GL_ARB_texture_buffer_range */ #ifdef GL_ARB_texture_compression - CONST_CAST(GLEW_ARB_texture_compression) = glewGetExtension("GL_ARB_texture_compression"); - if (glewExperimental || GLEW_ARB_texture_compression) CONST_CAST(GLEW_ARB_texture_compression) = !_glewInit_GL_ARB_texture_compression(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ARB_texture_compression) GLEW_ARB_texture_compression = !_glewInit_GL_ARB_texture_compression(); #endif /* GL_ARB_texture_compression */ -#ifdef GL_ARB_texture_cube_map - CONST_CAST(GLEW_ARB_texture_cube_map) = glewGetExtension("GL_ARB_texture_cube_map"); -#endif /* GL_ARB_texture_cube_map */ -#ifdef GL_ARB_texture_env_add - CONST_CAST(GLEW_ARB_texture_env_add) = glewGetExtension("GL_ARB_texture_env_add"); -#endif /* GL_ARB_texture_env_add */ -#ifdef GL_ARB_texture_env_combine - CONST_CAST(GLEW_ARB_texture_env_combine) = glewGetExtension("GL_ARB_texture_env_combine"); -#endif /* GL_ARB_texture_env_combine */ -#ifdef GL_ARB_texture_env_crossbar - CONST_CAST(GLEW_ARB_texture_env_crossbar) = glewGetExtension("GL_ARB_texture_env_crossbar"); -#endif /* GL_ARB_texture_env_crossbar */ -#ifdef GL_ARB_texture_env_dot3 - CONST_CAST(GLEW_ARB_texture_env_dot3) = glewGetExtension("GL_ARB_texture_env_dot3"); -#endif /* GL_ARB_texture_env_dot3 */ -#ifdef GL_ARB_texture_float - CONST_CAST(GLEW_ARB_texture_float) = glewGetExtension("GL_ARB_texture_float"); -#endif /* GL_ARB_texture_float */ -#ifdef GL_ARB_texture_mirrored_repeat - CONST_CAST(GLEW_ARB_texture_mirrored_repeat) = glewGetExtension("GL_ARB_texture_mirrored_repeat"); -#endif /* GL_ARB_texture_mirrored_repeat */ -#ifdef GL_ARB_texture_non_power_of_two - CONST_CAST(GLEW_ARB_texture_non_power_of_two) = glewGetExtension("GL_ARB_texture_non_power_of_two"); -#endif /* GL_ARB_texture_non_power_of_two */ -#ifdef GL_ARB_texture_rectangle - CONST_CAST(GLEW_ARB_texture_rectangle) = glewGetExtension("GL_ARB_texture_rectangle"); -#endif /* GL_ARB_texture_rectangle */ +#ifdef GL_ARB_texture_multisample + if (glewExperimental || GLEW_ARB_texture_multisample) GLEW_ARB_texture_multisample = !_glewInit_GL_ARB_texture_multisample(); +#endif /* GL_ARB_texture_multisample */ +#ifdef GL_ARB_texture_storage + if (glewExperimental || GLEW_ARB_texture_storage) GLEW_ARB_texture_storage = !_glewInit_GL_ARB_texture_storage(); +#endif /* GL_ARB_texture_storage */ +#ifdef GL_ARB_texture_storage_multisample + if (glewExperimental || GLEW_ARB_texture_storage_multisample) GLEW_ARB_texture_storage_multisample = !_glewInit_GL_ARB_texture_storage_multisample(); +#endif /* GL_ARB_texture_storage_multisample */ +#ifdef GL_ARB_texture_view + if (glewExperimental || GLEW_ARB_texture_view) GLEW_ARB_texture_view = !_glewInit_GL_ARB_texture_view(); +#endif /* GL_ARB_texture_view */ +#ifdef GL_ARB_timer_query + if (glewExperimental || GLEW_ARB_timer_query) GLEW_ARB_timer_query = !_glewInit_GL_ARB_timer_query(); +#endif /* GL_ARB_timer_query */ +#ifdef GL_ARB_transform_feedback2 + if (glewExperimental || GLEW_ARB_transform_feedback2) GLEW_ARB_transform_feedback2 = !_glewInit_GL_ARB_transform_feedback2(); +#endif /* GL_ARB_transform_feedback2 */ +#ifdef GL_ARB_transform_feedback3 + if (glewExperimental || GLEW_ARB_transform_feedback3) GLEW_ARB_transform_feedback3 = !_glewInit_GL_ARB_transform_feedback3(); +#endif /* GL_ARB_transform_feedback3 */ +#ifdef GL_ARB_transform_feedback_instanced + if (glewExperimental || GLEW_ARB_transform_feedback_instanced) GLEW_ARB_transform_feedback_instanced = !_glewInit_GL_ARB_transform_feedback_instanced(); +#endif /* GL_ARB_transform_feedback_instanced */ #ifdef GL_ARB_transpose_matrix - CONST_CAST(GLEW_ARB_transpose_matrix) = glewGetExtension("GL_ARB_transpose_matrix"); - if (glewExperimental || GLEW_ARB_transpose_matrix) CONST_CAST(GLEW_ARB_transpose_matrix) = !_glewInit_GL_ARB_transpose_matrix(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ARB_transpose_matrix) GLEW_ARB_transpose_matrix = !_glewInit_GL_ARB_transpose_matrix(); #endif /* GL_ARB_transpose_matrix */ +#ifdef GL_ARB_uniform_buffer_object + if (glewExperimental || GLEW_ARB_uniform_buffer_object) GLEW_ARB_uniform_buffer_object = !_glewInit_GL_ARB_uniform_buffer_object(); +#endif /* GL_ARB_uniform_buffer_object */ +#ifdef GL_ARB_vertex_array_object + if (glewExperimental || GLEW_ARB_vertex_array_object) GLEW_ARB_vertex_array_object = !_glewInit_GL_ARB_vertex_array_object(); +#endif /* GL_ARB_vertex_array_object */ +#ifdef GL_ARB_vertex_attrib_64bit + if (glewExperimental || GLEW_ARB_vertex_attrib_64bit) GLEW_ARB_vertex_attrib_64bit = !_glewInit_GL_ARB_vertex_attrib_64bit(); +#endif /* GL_ARB_vertex_attrib_64bit */ +#ifdef GL_ARB_vertex_attrib_binding + if (glewExperimental || GLEW_ARB_vertex_attrib_binding) GLEW_ARB_vertex_attrib_binding = !_glewInit_GL_ARB_vertex_attrib_binding(); +#endif /* GL_ARB_vertex_attrib_binding */ #ifdef GL_ARB_vertex_blend - CONST_CAST(GLEW_ARB_vertex_blend) = glewGetExtension("GL_ARB_vertex_blend"); - if (glewExperimental || GLEW_ARB_vertex_blend) CONST_CAST(GLEW_ARB_vertex_blend) = !_glewInit_GL_ARB_vertex_blend(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ARB_vertex_blend) GLEW_ARB_vertex_blend = !_glewInit_GL_ARB_vertex_blend(); #endif /* GL_ARB_vertex_blend */ #ifdef GL_ARB_vertex_buffer_object - CONST_CAST(GLEW_ARB_vertex_buffer_object) = glewGetExtension("GL_ARB_vertex_buffer_object"); - if (glewExperimental || GLEW_ARB_vertex_buffer_object) CONST_CAST(GLEW_ARB_vertex_buffer_object) = !_glewInit_GL_ARB_vertex_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ARB_vertex_buffer_object) GLEW_ARB_vertex_buffer_object = !_glewInit_GL_ARB_vertex_buffer_object(); #endif /* GL_ARB_vertex_buffer_object */ #ifdef GL_ARB_vertex_program - CONST_CAST(GLEW_ARB_vertex_program) = glewGetExtension("GL_ARB_vertex_program"); - if (glewExperimental || GLEW_ARB_vertex_program) CONST_CAST(GLEW_ARB_vertex_program) = !_glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ARB_vertex_program) GLEW_ARB_vertex_program = !_glewInit_GL_ARB_vertex_program(); #endif /* GL_ARB_vertex_program */ #ifdef GL_ARB_vertex_shader - CONST_CAST(GLEW_ARB_vertex_shader) = glewGetExtension("GL_ARB_vertex_shader"); - if (glewExperimental || GLEW_ARB_vertex_shader) CONST_CAST(GLEW_ARB_vertex_shader) = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ARB_vertex_shader) { GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(); _glewInit_GL_ARB_vertex_program(); } #endif /* GL_ARB_vertex_shader */ +#ifdef GL_ARB_vertex_type_2_10_10_10_rev + if (glewExperimental || GLEW_ARB_vertex_type_2_10_10_10_rev) GLEW_ARB_vertex_type_2_10_10_10_rev = !_glewInit_GL_ARB_vertex_type_2_10_10_10_rev(); +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ +#ifdef GL_ARB_viewport_array + if (glewExperimental || GLEW_ARB_viewport_array) GLEW_ARB_viewport_array = !_glewInit_GL_ARB_viewport_array(); +#endif /* GL_ARB_viewport_array */ #ifdef GL_ARB_window_pos - CONST_CAST(GLEW_ARB_window_pos) = glewGetExtension("GL_ARB_window_pos"); - if (glewExperimental || GLEW_ARB_window_pos) CONST_CAST(GLEW_ARB_window_pos) = !_glewInit_GL_ARB_window_pos(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ARB_window_pos) GLEW_ARB_window_pos = !_glewInit_GL_ARB_window_pos(); #endif /* GL_ARB_window_pos */ -#ifdef GL_ATIX_point_sprites - CONST_CAST(GLEW_ATIX_point_sprites) = glewGetExtension("GL_ATIX_point_sprites"); -#endif /* GL_ATIX_point_sprites */ -#ifdef GL_ATIX_texture_env_combine3 - CONST_CAST(GLEW_ATIX_texture_env_combine3) = glewGetExtension("GL_ATIX_texture_env_combine3"); -#endif /* GL_ATIX_texture_env_combine3 */ -#ifdef GL_ATIX_texture_env_route - CONST_CAST(GLEW_ATIX_texture_env_route) = glewGetExtension("GL_ATIX_texture_env_route"); -#endif /* GL_ATIX_texture_env_route */ -#ifdef GL_ATIX_vertex_shader_output_point_size - CONST_CAST(GLEW_ATIX_vertex_shader_output_point_size) = glewGetExtension("GL_ATIX_vertex_shader_output_point_size"); -#endif /* GL_ATIX_vertex_shader_output_point_size */ #ifdef GL_ATI_draw_buffers - CONST_CAST(GLEW_ATI_draw_buffers) = glewGetExtension("GL_ATI_draw_buffers"); - if (glewExperimental || GLEW_ATI_draw_buffers) CONST_CAST(GLEW_ATI_draw_buffers) = !_glewInit_GL_ATI_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ATI_draw_buffers) GLEW_ATI_draw_buffers = !_glewInit_GL_ATI_draw_buffers(); #endif /* GL_ATI_draw_buffers */ #ifdef GL_ATI_element_array - CONST_CAST(GLEW_ATI_element_array) = glewGetExtension("GL_ATI_element_array"); - if (glewExperimental || GLEW_ATI_element_array) CONST_CAST(GLEW_ATI_element_array) = !_glewInit_GL_ATI_element_array(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ATI_element_array) GLEW_ATI_element_array = !_glewInit_GL_ATI_element_array(); #endif /* GL_ATI_element_array */ #ifdef GL_ATI_envmap_bumpmap - CONST_CAST(GLEW_ATI_envmap_bumpmap) = glewGetExtension("GL_ATI_envmap_bumpmap"); - if (glewExperimental || GLEW_ATI_envmap_bumpmap) CONST_CAST(GLEW_ATI_envmap_bumpmap) = !_glewInit_GL_ATI_envmap_bumpmap(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ATI_envmap_bumpmap) GLEW_ATI_envmap_bumpmap = !_glewInit_GL_ATI_envmap_bumpmap(); #endif /* GL_ATI_envmap_bumpmap */ #ifdef GL_ATI_fragment_shader - CONST_CAST(GLEW_ATI_fragment_shader) = glewGetExtension("GL_ATI_fragment_shader"); - if (glewExperimental || GLEW_ATI_fragment_shader) CONST_CAST(GLEW_ATI_fragment_shader) = !_glewInit_GL_ATI_fragment_shader(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ATI_fragment_shader) GLEW_ATI_fragment_shader = !_glewInit_GL_ATI_fragment_shader(); #endif /* GL_ATI_fragment_shader */ #ifdef GL_ATI_map_object_buffer - CONST_CAST(GLEW_ATI_map_object_buffer) = glewGetExtension("GL_ATI_map_object_buffer"); - if (glewExperimental || GLEW_ATI_map_object_buffer) CONST_CAST(GLEW_ATI_map_object_buffer) = !_glewInit_GL_ATI_map_object_buffer(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ATI_map_object_buffer) GLEW_ATI_map_object_buffer = !_glewInit_GL_ATI_map_object_buffer(); #endif /* GL_ATI_map_object_buffer */ #ifdef GL_ATI_pn_triangles - CONST_CAST(GLEW_ATI_pn_triangles) = glewGetExtension("GL_ATI_pn_triangles"); - if (glewExperimental || GLEW_ATI_pn_triangles) CONST_CAST(GLEW_ATI_pn_triangles) = !_glewInit_GL_ATI_pn_triangles(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ATI_pn_triangles) GLEW_ATI_pn_triangles = !_glewInit_GL_ATI_pn_triangles(); #endif /* GL_ATI_pn_triangles */ #ifdef GL_ATI_separate_stencil - CONST_CAST(GLEW_ATI_separate_stencil) = glewGetExtension("GL_ATI_separate_stencil"); - if (glewExperimental || GLEW_ATI_separate_stencil) CONST_CAST(GLEW_ATI_separate_stencil) = !_glewInit_GL_ATI_separate_stencil(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ATI_separate_stencil) GLEW_ATI_separate_stencil = !_glewInit_GL_ATI_separate_stencil(); #endif /* GL_ATI_separate_stencil */ -#ifdef GL_ATI_shader_texture_lod - CONST_CAST(GLEW_ATI_shader_texture_lod) = glewGetExtension("GL_ATI_shader_texture_lod"); -#endif /* GL_ATI_shader_texture_lod */ -#ifdef GL_ATI_text_fragment_shader - CONST_CAST(GLEW_ATI_text_fragment_shader) = glewGetExtension("GL_ATI_text_fragment_shader"); -#endif /* GL_ATI_text_fragment_shader */ -#ifdef GL_ATI_texture_compression_3dc - CONST_CAST(GLEW_ATI_texture_compression_3dc) = glewGetExtension("GL_ATI_texture_compression_3dc"); -#endif /* GL_ATI_texture_compression_3dc */ -#ifdef GL_ATI_texture_env_combine3 - CONST_CAST(GLEW_ATI_texture_env_combine3) = glewGetExtension("GL_ATI_texture_env_combine3"); -#endif /* GL_ATI_texture_env_combine3 */ -#ifdef GL_ATI_texture_float - CONST_CAST(GLEW_ATI_texture_float) = glewGetExtension("GL_ATI_texture_float"); -#endif /* GL_ATI_texture_float */ -#ifdef GL_ATI_texture_mirror_once - CONST_CAST(GLEW_ATI_texture_mirror_once) = glewGetExtension("GL_ATI_texture_mirror_once"); -#endif /* GL_ATI_texture_mirror_once */ #ifdef GL_ATI_vertex_array_object - CONST_CAST(GLEW_ATI_vertex_array_object) = glewGetExtension("GL_ATI_vertex_array_object"); - if (glewExperimental || GLEW_ATI_vertex_array_object) CONST_CAST(GLEW_ATI_vertex_array_object) = !_glewInit_GL_ATI_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ATI_vertex_array_object) GLEW_ATI_vertex_array_object = !_glewInit_GL_ATI_vertex_array_object(); #endif /* GL_ATI_vertex_array_object */ #ifdef GL_ATI_vertex_attrib_array_object - CONST_CAST(GLEW_ATI_vertex_attrib_array_object) = glewGetExtension("GL_ATI_vertex_attrib_array_object"); - if (glewExperimental || GLEW_ATI_vertex_attrib_array_object) CONST_CAST(GLEW_ATI_vertex_attrib_array_object) = !_glewInit_GL_ATI_vertex_attrib_array_object(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ATI_vertex_attrib_array_object) GLEW_ATI_vertex_attrib_array_object = !_glewInit_GL_ATI_vertex_attrib_array_object(); #endif /* GL_ATI_vertex_attrib_array_object */ #ifdef GL_ATI_vertex_streams - CONST_CAST(GLEW_ATI_vertex_streams) = glewGetExtension("GL_ATI_vertex_streams"); - if (glewExperimental || GLEW_ATI_vertex_streams) CONST_CAST(GLEW_ATI_vertex_streams) = !_glewInit_GL_ATI_vertex_streams(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_ATI_vertex_streams) GLEW_ATI_vertex_streams = !_glewInit_GL_ATI_vertex_streams(); #endif /* GL_ATI_vertex_streams */ -#ifdef GL_EXT_422_pixels - CONST_CAST(GLEW_EXT_422_pixels) = glewGetExtension("GL_EXT_422_pixels"); -#endif /* GL_EXT_422_pixels */ -#ifdef GL_EXT_Cg_shader - CONST_CAST(GLEW_EXT_Cg_shader) = glewGetExtension("GL_EXT_Cg_shader"); -#endif /* GL_EXT_Cg_shader */ -#ifdef GL_EXT_abgr - CONST_CAST(GLEW_EXT_abgr) = glewGetExtension("GL_EXT_abgr"); -#endif /* GL_EXT_abgr */ -#ifdef GL_EXT_bgra - CONST_CAST(GLEW_EXT_bgra) = glewGetExtension("GL_EXT_bgra"); -#endif /* GL_EXT_bgra */ +#ifdef GL_EXT_base_instance + if (glewExperimental || GLEW_EXT_base_instance) GLEW_EXT_base_instance = !_glewInit_GL_EXT_base_instance(); +#endif /* GL_EXT_base_instance */ #ifdef GL_EXT_bindable_uniform - CONST_CAST(GLEW_EXT_bindable_uniform) = glewGetExtension("GL_EXT_bindable_uniform"); - if (glewExperimental || GLEW_EXT_bindable_uniform) CONST_CAST(GLEW_EXT_bindable_uniform) = !_glewInit_GL_EXT_bindable_uniform(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_bindable_uniform) GLEW_EXT_bindable_uniform = !_glewInit_GL_EXT_bindable_uniform(); #endif /* GL_EXT_bindable_uniform */ #ifdef GL_EXT_blend_color - CONST_CAST(GLEW_EXT_blend_color) = glewGetExtension("GL_EXT_blend_color"); - if (glewExperimental || GLEW_EXT_blend_color) CONST_CAST(GLEW_EXT_blend_color) = !_glewInit_GL_EXT_blend_color(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_blend_color) GLEW_EXT_blend_color = !_glewInit_GL_EXT_blend_color(); #endif /* GL_EXT_blend_color */ #ifdef GL_EXT_blend_equation_separate - CONST_CAST(GLEW_EXT_blend_equation_separate) = glewGetExtension("GL_EXT_blend_equation_separate"); - if (glewExperimental || GLEW_EXT_blend_equation_separate) CONST_CAST(GLEW_EXT_blend_equation_separate) = !_glewInit_GL_EXT_blend_equation_separate(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_blend_equation_separate) GLEW_EXT_blend_equation_separate = !_glewInit_GL_EXT_blend_equation_separate(); #endif /* GL_EXT_blend_equation_separate */ +#ifdef GL_EXT_blend_func_extended + if (glewExperimental || GLEW_EXT_blend_func_extended) GLEW_EXT_blend_func_extended = !_glewInit_GL_EXT_blend_func_extended(); +#endif /* GL_EXT_blend_func_extended */ #ifdef GL_EXT_blend_func_separate - CONST_CAST(GLEW_EXT_blend_func_separate) = glewGetExtension("GL_EXT_blend_func_separate"); - if (glewExperimental || GLEW_EXT_blend_func_separate) CONST_CAST(GLEW_EXT_blend_func_separate) = !_glewInit_GL_EXT_blend_func_separate(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_blend_func_separate) GLEW_EXT_blend_func_separate = !_glewInit_GL_EXT_blend_func_separate(); #endif /* GL_EXT_blend_func_separate */ -#ifdef GL_EXT_blend_logic_op - CONST_CAST(GLEW_EXT_blend_logic_op) = glewGetExtension("GL_EXT_blend_logic_op"); -#endif /* GL_EXT_blend_logic_op */ #ifdef GL_EXT_blend_minmax - CONST_CAST(GLEW_EXT_blend_minmax) = glewGetExtension("GL_EXT_blend_minmax"); - if (glewExperimental || GLEW_EXT_blend_minmax) CONST_CAST(GLEW_EXT_blend_minmax) = !_glewInit_GL_EXT_blend_minmax(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_blend_minmax) GLEW_EXT_blend_minmax = !_glewInit_GL_EXT_blend_minmax(); #endif /* GL_EXT_blend_minmax */ -#ifdef GL_EXT_blend_subtract - CONST_CAST(GLEW_EXT_blend_subtract) = glewGetExtension("GL_EXT_blend_subtract"); -#endif /* GL_EXT_blend_subtract */ -#ifdef GL_EXT_clip_volume_hint - CONST_CAST(GLEW_EXT_clip_volume_hint) = glewGetExtension("GL_EXT_clip_volume_hint"); -#endif /* GL_EXT_clip_volume_hint */ -#ifdef GL_EXT_cmyka - CONST_CAST(GLEW_EXT_cmyka) = glewGetExtension("GL_EXT_cmyka"); -#endif /* GL_EXT_cmyka */ +#ifdef GL_EXT_buffer_storage + if (glewExperimental || GLEW_EXT_buffer_storage) GLEW_EXT_buffer_storage = !_glewInit_GL_EXT_buffer_storage(); +#endif /* GL_EXT_buffer_storage */ +#ifdef GL_EXT_clear_texture + if (glewExperimental || GLEW_EXT_clear_texture) GLEW_EXT_clear_texture = !_glewInit_GL_EXT_clear_texture(); +#endif /* GL_EXT_clear_texture */ #ifdef GL_EXT_color_subtable - CONST_CAST(GLEW_EXT_color_subtable) = glewGetExtension("GL_EXT_color_subtable"); - if (glewExperimental || GLEW_EXT_color_subtable) CONST_CAST(GLEW_EXT_color_subtable) = !_glewInit_GL_EXT_color_subtable(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_color_subtable) GLEW_EXT_color_subtable = !_glewInit_GL_EXT_color_subtable(); #endif /* GL_EXT_color_subtable */ #ifdef GL_EXT_compiled_vertex_array - CONST_CAST(GLEW_EXT_compiled_vertex_array) = glewGetExtension("GL_EXT_compiled_vertex_array"); - if (glewExperimental || GLEW_EXT_compiled_vertex_array) CONST_CAST(GLEW_EXT_compiled_vertex_array) = !_glewInit_GL_EXT_compiled_vertex_array(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_compiled_vertex_array) GLEW_EXT_compiled_vertex_array = !_glewInit_GL_EXT_compiled_vertex_array(); #endif /* GL_EXT_compiled_vertex_array */ #ifdef GL_EXT_convolution - CONST_CAST(GLEW_EXT_convolution) = glewGetExtension("GL_EXT_convolution"); - if (glewExperimental || GLEW_EXT_convolution) CONST_CAST(GLEW_EXT_convolution) = !_glewInit_GL_EXT_convolution(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_convolution) GLEW_EXT_convolution = !_glewInit_GL_EXT_convolution(); #endif /* GL_EXT_convolution */ #ifdef GL_EXT_coordinate_frame - CONST_CAST(GLEW_EXT_coordinate_frame) = glewGetExtension("GL_EXT_coordinate_frame"); - if (glewExperimental || GLEW_EXT_coordinate_frame) CONST_CAST(GLEW_EXT_coordinate_frame) = !_glewInit_GL_EXT_coordinate_frame(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_coordinate_frame) GLEW_EXT_coordinate_frame = !_glewInit_GL_EXT_coordinate_frame(); #endif /* GL_EXT_coordinate_frame */ +#ifdef GL_EXT_copy_image + if (glewExperimental || GLEW_EXT_copy_image) GLEW_EXT_copy_image = !_glewInit_GL_EXT_copy_image(); +#endif /* GL_EXT_copy_image */ #ifdef GL_EXT_copy_texture - CONST_CAST(GLEW_EXT_copy_texture) = glewGetExtension("GL_EXT_copy_texture"); - if (glewExperimental || GLEW_EXT_copy_texture) CONST_CAST(GLEW_EXT_copy_texture) = !_glewInit_GL_EXT_copy_texture(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_copy_texture) GLEW_EXT_copy_texture = !_glewInit_GL_EXT_copy_texture(); #endif /* GL_EXT_copy_texture */ #ifdef GL_EXT_cull_vertex - CONST_CAST(GLEW_EXT_cull_vertex) = glewGetExtension("GL_EXT_cull_vertex"); - if (glewExperimental || GLEW_EXT_cull_vertex) CONST_CAST(GLEW_EXT_cull_vertex) = !_glewInit_GL_EXT_cull_vertex(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_cull_vertex) GLEW_EXT_cull_vertex = !_glewInit_GL_EXT_cull_vertex(); #endif /* GL_EXT_cull_vertex */ +#ifdef GL_EXT_debug_label + if (glewExperimental || GLEW_EXT_debug_label) GLEW_EXT_debug_label = !_glewInit_GL_EXT_debug_label(); +#endif /* GL_EXT_debug_label */ +#ifdef GL_EXT_debug_marker + if (glewExperimental || GLEW_EXT_debug_marker) GLEW_EXT_debug_marker = !_glewInit_GL_EXT_debug_marker(); +#endif /* GL_EXT_debug_marker */ #ifdef GL_EXT_depth_bounds_test - CONST_CAST(GLEW_EXT_depth_bounds_test) = glewGetExtension("GL_EXT_depth_bounds_test"); - if (glewExperimental || GLEW_EXT_depth_bounds_test) CONST_CAST(GLEW_EXT_depth_bounds_test) = !_glewInit_GL_EXT_depth_bounds_test(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_depth_bounds_test) GLEW_EXT_depth_bounds_test = !_glewInit_GL_EXT_depth_bounds_test(); #endif /* GL_EXT_depth_bounds_test */ +#ifdef GL_EXT_direct_state_access + if (glewExperimental || GLEW_EXT_direct_state_access) GLEW_EXT_direct_state_access = !_glewInit_GL_EXT_direct_state_access(); +#endif /* GL_EXT_direct_state_access */ +#ifdef GL_EXT_discard_framebuffer + if (glewExperimental || GLEW_EXT_discard_framebuffer) GLEW_EXT_discard_framebuffer = !_glewInit_GL_EXT_discard_framebuffer(); +#endif /* GL_EXT_discard_framebuffer */ +#ifdef GL_EXT_draw_buffers + if (glewExperimental || GLEW_EXT_draw_buffers) GLEW_EXT_draw_buffers = !_glewInit_GL_EXT_draw_buffers(); +#endif /* GL_EXT_draw_buffers */ #ifdef GL_EXT_draw_buffers2 - CONST_CAST(GLEW_EXT_draw_buffers2) = glewGetExtension("GL_EXT_draw_buffers2"); - if (glewExperimental || GLEW_EXT_draw_buffers2) CONST_CAST(GLEW_EXT_draw_buffers2) = !_glewInit_GL_EXT_draw_buffers2(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_draw_buffers2) GLEW_EXT_draw_buffers2 = !_glewInit_GL_EXT_draw_buffers2(); #endif /* GL_EXT_draw_buffers2 */ +#ifdef GL_EXT_draw_buffers_indexed + if (glewExperimental || GLEW_EXT_draw_buffers_indexed) GLEW_EXT_draw_buffers_indexed = !_glewInit_GL_EXT_draw_buffers_indexed(); +#endif /* GL_EXT_draw_buffers_indexed */ +#ifdef GL_EXT_draw_elements_base_vertex + if (glewExperimental || GLEW_EXT_draw_elements_base_vertex) GLEW_EXT_draw_elements_base_vertex = !_glewInit_GL_EXT_draw_elements_base_vertex(); +#endif /* GL_EXT_draw_elements_base_vertex */ #ifdef GL_EXT_draw_instanced - CONST_CAST(GLEW_EXT_draw_instanced) = glewGetExtension("GL_EXT_draw_instanced"); - if (glewExperimental || GLEW_EXT_draw_instanced) CONST_CAST(GLEW_EXT_draw_instanced) = !_glewInit_GL_EXT_draw_instanced(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_draw_instanced) GLEW_EXT_draw_instanced = !_glewInit_GL_EXT_draw_instanced(); #endif /* GL_EXT_draw_instanced */ #ifdef GL_EXT_draw_range_elements - CONST_CAST(GLEW_EXT_draw_range_elements) = glewGetExtension("GL_EXT_draw_range_elements"); - if (glewExperimental || GLEW_EXT_draw_range_elements) CONST_CAST(GLEW_EXT_draw_range_elements) = !_glewInit_GL_EXT_draw_range_elements(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_draw_range_elements) GLEW_EXT_draw_range_elements = !_glewInit_GL_EXT_draw_range_elements(); #endif /* GL_EXT_draw_range_elements */ +#ifdef GL_EXT_external_buffer + if (glewExperimental || GLEW_EXT_external_buffer) GLEW_EXT_external_buffer = !_glewInit_GL_EXT_external_buffer(); +#endif /* GL_EXT_external_buffer */ #ifdef GL_EXT_fog_coord - CONST_CAST(GLEW_EXT_fog_coord) = glewGetExtension("GL_EXT_fog_coord"); - if (glewExperimental || GLEW_EXT_fog_coord) CONST_CAST(GLEW_EXT_fog_coord) = !_glewInit_GL_EXT_fog_coord(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_fog_coord) GLEW_EXT_fog_coord = !_glewInit_GL_EXT_fog_coord(); #endif /* GL_EXT_fog_coord */ #ifdef GL_EXT_fragment_lighting - CONST_CAST(GLEW_EXT_fragment_lighting) = glewGetExtension("GL_EXT_fragment_lighting"); - if (glewExperimental || GLEW_EXT_fragment_lighting) CONST_CAST(GLEW_EXT_fragment_lighting) = !_glewInit_GL_EXT_fragment_lighting(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_fragment_lighting) GLEW_EXT_fragment_lighting = !_glewInit_GL_EXT_fragment_lighting(); #endif /* GL_EXT_fragment_lighting */ #ifdef GL_EXT_framebuffer_blit - CONST_CAST(GLEW_EXT_framebuffer_blit) = glewGetExtension("GL_EXT_framebuffer_blit"); - if (glewExperimental || GLEW_EXT_framebuffer_blit) CONST_CAST(GLEW_EXT_framebuffer_blit) = !_glewInit_GL_EXT_framebuffer_blit(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_framebuffer_blit) GLEW_EXT_framebuffer_blit = !_glewInit_GL_EXT_framebuffer_blit(); #endif /* GL_EXT_framebuffer_blit */ #ifdef GL_EXT_framebuffer_multisample - CONST_CAST(GLEW_EXT_framebuffer_multisample) = glewGetExtension("GL_EXT_framebuffer_multisample"); - if (glewExperimental || GLEW_EXT_framebuffer_multisample) CONST_CAST(GLEW_EXT_framebuffer_multisample) = !_glewInit_GL_EXT_framebuffer_multisample(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_framebuffer_multisample) GLEW_EXT_framebuffer_multisample = !_glewInit_GL_EXT_framebuffer_multisample(); #endif /* GL_EXT_framebuffer_multisample */ #ifdef GL_EXT_framebuffer_object - CONST_CAST(GLEW_EXT_framebuffer_object) = glewGetExtension("GL_EXT_framebuffer_object"); - if (glewExperimental || GLEW_EXT_framebuffer_object) CONST_CAST(GLEW_EXT_framebuffer_object) = !_glewInit_GL_EXT_framebuffer_object(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_framebuffer_object) GLEW_EXT_framebuffer_object = !_glewInit_GL_EXT_framebuffer_object(); #endif /* GL_EXT_framebuffer_object */ -#ifdef GL_EXT_framebuffer_sRGB - CONST_CAST(GLEW_EXT_framebuffer_sRGB) = glewGetExtension("GL_EXT_framebuffer_sRGB"); -#endif /* GL_EXT_framebuffer_sRGB */ #ifdef GL_EXT_geometry_shader4 - CONST_CAST(GLEW_EXT_geometry_shader4) = glewGetExtension("GL_EXT_geometry_shader4"); - if (glewExperimental || GLEW_EXT_geometry_shader4) CONST_CAST(GLEW_EXT_geometry_shader4) = !_glewInit_GL_EXT_geometry_shader4(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_geometry_shader4) GLEW_EXT_geometry_shader4 = !_glewInit_GL_EXT_geometry_shader4(); #endif /* GL_EXT_geometry_shader4 */ #ifdef GL_EXT_gpu_program_parameters - CONST_CAST(GLEW_EXT_gpu_program_parameters) = glewGetExtension("GL_EXT_gpu_program_parameters"); - if (glewExperimental || GLEW_EXT_gpu_program_parameters) CONST_CAST(GLEW_EXT_gpu_program_parameters) = !_glewInit_GL_EXT_gpu_program_parameters(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_gpu_program_parameters) GLEW_EXT_gpu_program_parameters = !_glewInit_GL_EXT_gpu_program_parameters(); #endif /* GL_EXT_gpu_program_parameters */ #ifdef GL_EXT_gpu_shader4 - CONST_CAST(GLEW_EXT_gpu_shader4) = glewGetExtension("GL_EXT_gpu_shader4"); - if (glewExperimental || GLEW_EXT_gpu_shader4) CONST_CAST(GLEW_EXT_gpu_shader4) = !_glewInit_GL_EXT_gpu_shader4(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_gpu_shader4) GLEW_EXT_gpu_shader4 = !_glewInit_GL_EXT_gpu_shader4(); #endif /* GL_EXT_gpu_shader4 */ #ifdef GL_EXT_histogram - CONST_CAST(GLEW_EXT_histogram) = glewGetExtension("GL_EXT_histogram"); - if (glewExperimental || GLEW_EXT_histogram) CONST_CAST(GLEW_EXT_histogram) = !_glewInit_GL_EXT_histogram(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_histogram) GLEW_EXT_histogram = !_glewInit_GL_EXT_histogram(); #endif /* GL_EXT_histogram */ -#ifdef GL_EXT_index_array_formats - CONST_CAST(GLEW_EXT_index_array_formats) = glewGetExtension("GL_EXT_index_array_formats"); -#endif /* GL_EXT_index_array_formats */ #ifdef GL_EXT_index_func - CONST_CAST(GLEW_EXT_index_func) = glewGetExtension("GL_EXT_index_func"); - if (glewExperimental || GLEW_EXT_index_func) CONST_CAST(GLEW_EXT_index_func) = !_glewInit_GL_EXT_index_func(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_index_func) GLEW_EXT_index_func = !_glewInit_GL_EXT_index_func(); #endif /* GL_EXT_index_func */ #ifdef GL_EXT_index_material - CONST_CAST(GLEW_EXT_index_material) = glewGetExtension("GL_EXT_index_material"); - if (glewExperimental || GLEW_EXT_index_material) CONST_CAST(GLEW_EXT_index_material) = !_glewInit_GL_EXT_index_material(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_index_material) GLEW_EXT_index_material = !_glewInit_GL_EXT_index_material(); #endif /* GL_EXT_index_material */ -#ifdef GL_EXT_index_texture - CONST_CAST(GLEW_EXT_index_texture) = glewGetExtension("GL_EXT_index_texture"); -#endif /* GL_EXT_index_texture */ +#ifdef GL_EXT_instanced_arrays + if (glewExperimental || GLEW_EXT_instanced_arrays) GLEW_EXT_instanced_arrays = !_glewInit_GL_EXT_instanced_arrays(); +#endif /* GL_EXT_instanced_arrays */ #ifdef GL_EXT_light_texture - CONST_CAST(GLEW_EXT_light_texture) = glewGetExtension("GL_EXT_light_texture"); - if (glewExperimental || GLEW_EXT_light_texture) CONST_CAST(GLEW_EXT_light_texture) = !_glewInit_GL_EXT_light_texture(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_light_texture) GLEW_EXT_light_texture = !_glewInit_GL_EXT_light_texture(); #endif /* GL_EXT_light_texture */ -#ifdef GL_EXT_misc_attribute - CONST_CAST(GLEW_EXT_misc_attribute) = glewGetExtension("GL_EXT_misc_attribute"); -#endif /* GL_EXT_misc_attribute */ +#ifdef GL_EXT_map_buffer_range + if (glewExperimental || GLEW_EXT_map_buffer_range) GLEW_EXT_map_buffer_range = !_glewInit_GL_EXT_map_buffer_range(); +#endif /* GL_EXT_map_buffer_range */ +#ifdef GL_EXT_memory_object + if (glewExperimental || GLEW_EXT_memory_object) GLEW_EXT_memory_object = !_glewInit_GL_EXT_memory_object(); +#endif /* GL_EXT_memory_object */ +#ifdef GL_EXT_memory_object_fd + if (glewExperimental || GLEW_EXT_memory_object_fd) GLEW_EXT_memory_object_fd = !_glewInit_GL_EXT_memory_object_fd(); +#endif /* GL_EXT_memory_object_fd */ +#ifdef GL_EXT_memory_object_win32 + if (glewExperimental || GLEW_EXT_memory_object_win32) GLEW_EXT_memory_object_win32 = !_glewInit_GL_EXT_memory_object_win32(); +#endif /* GL_EXT_memory_object_win32 */ #ifdef GL_EXT_multi_draw_arrays - CONST_CAST(GLEW_EXT_multi_draw_arrays) = glewGetExtension("GL_EXT_multi_draw_arrays"); - if (glewExperimental || GLEW_EXT_multi_draw_arrays) CONST_CAST(GLEW_EXT_multi_draw_arrays) = !_glewInit_GL_EXT_multi_draw_arrays(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_multi_draw_arrays) GLEW_EXT_multi_draw_arrays = !_glewInit_GL_EXT_multi_draw_arrays(); #endif /* GL_EXT_multi_draw_arrays */ +#ifdef GL_EXT_multi_draw_indirect + if (glewExperimental || GLEW_EXT_multi_draw_indirect) GLEW_EXT_multi_draw_indirect = !_glewInit_GL_EXT_multi_draw_indirect(); +#endif /* GL_EXT_multi_draw_indirect */ #ifdef GL_EXT_multisample - CONST_CAST(GLEW_EXT_multisample) = glewGetExtension("GL_EXT_multisample"); - if (glewExperimental || GLEW_EXT_multisample) CONST_CAST(GLEW_EXT_multisample) = !_glewInit_GL_EXT_multisample(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_multisample) GLEW_EXT_multisample = !_glewInit_GL_EXT_multisample(); #endif /* GL_EXT_multisample */ -#ifdef GL_EXT_packed_depth_stencil - CONST_CAST(GLEW_EXT_packed_depth_stencil) = glewGetExtension("GL_EXT_packed_depth_stencil"); -#endif /* GL_EXT_packed_depth_stencil */ -#ifdef GL_EXT_packed_float - CONST_CAST(GLEW_EXT_packed_float) = glewGetExtension("GL_EXT_packed_float"); -#endif /* GL_EXT_packed_float */ -#ifdef GL_EXT_packed_pixels - CONST_CAST(GLEW_EXT_packed_pixels) = glewGetExtension("GL_EXT_packed_pixels"); -#endif /* GL_EXT_packed_pixels */ +#ifdef GL_EXT_multisampled_render_to_texture + if (glewExperimental || GLEW_EXT_multisampled_render_to_texture) GLEW_EXT_multisampled_render_to_texture = !_glewInit_GL_EXT_multisampled_render_to_texture(); +#endif /* GL_EXT_multisampled_render_to_texture */ +#ifdef GL_EXT_multiview_draw_buffers + if (glewExperimental || GLEW_EXT_multiview_draw_buffers) GLEW_EXT_multiview_draw_buffers = !_glewInit_GL_EXT_multiview_draw_buffers(); +#endif /* GL_EXT_multiview_draw_buffers */ #ifdef GL_EXT_paletted_texture - CONST_CAST(GLEW_EXT_paletted_texture) = glewGetExtension("GL_EXT_paletted_texture"); - if (glewExperimental || GLEW_EXT_paletted_texture) CONST_CAST(GLEW_EXT_paletted_texture) = !_glewInit_GL_EXT_paletted_texture(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_paletted_texture) GLEW_EXT_paletted_texture = !_glewInit_GL_EXT_paletted_texture(); #endif /* GL_EXT_paletted_texture */ -#ifdef GL_EXT_pixel_buffer_object - CONST_CAST(GLEW_EXT_pixel_buffer_object) = glewGetExtension("GL_EXT_pixel_buffer_object"); -#endif /* GL_EXT_pixel_buffer_object */ #ifdef GL_EXT_pixel_transform - CONST_CAST(GLEW_EXT_pixel_transform) = glewGetExtension("GL_EXT_pixel_transform"); - if (glewExperimental || GLEW_EXT_pixel_transform) CONST_CAST(GLEW_EXT_pixel_transform) = !_glewInit_GL_EXT_pixel_transform(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_pixel_transform) GLEW_EXT_pixel_transform = !_glewInit_GL_EXT_pixel_transform(); #endif /* GL_EXT_pixel_transform */ -#ifdef GL_EXT_pixel_transform_color_table - CONST_CAST(GLEW_EXT_pixel_transform_color_table) = glewGetExtension("GL_EXT_pixel_transform_color_table"); -#endif /* GL_EXT_pixel_transform_color_table */ #ifdef GL_EXT_point_parameters - CONST_CAST(GLEW_EXT_point_parameters) = glewGetExtension("GL_EXT_point_parameters"); - if (glewExperimental || GLEW_EXT_point_parameters) CONST_CAST(GLEW_EXT_point_parameters) = !_glewInit_GL_EXT_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_point_parameters) GLEW_EXT_point_parameters = !_glewInit_GL_EXT_point_parameters(); #endif /* GL_EXT_point_parameters */ #ifdef GL_EXT_polygon_offset - CONST_CAST(GLEW_EXT_polygon_offset) = glewGetExtension("GL_EXT_polygon_offset"); - if (glewExperimental || GLEW_EXT_polygon_offset) CONST_CAST(GLEW_EXT_polygon_offset) = !_glewInit_GL_EXT_polygon_offset(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_polygon_offset) GLEW_EXT_polygon_offset = !_glewInit_GL_EXT_polygon_offset(); #endif /* GL_EXT_polygon_offset */ -#ifdef GL_EXT_rescale_normal - CONST_CAST(GLEW_EXT_rescale_normal) = glewGetExtension("GL_EXT_rescale_normal"); -#endif /* GL_EXT_rescale_normal */ +#ifdef GL_EXT_polygon_offset_clamp + if (glewExperimental || GLEW_EXT_polygon_offset_clamp) GLEW_EXT_polygon_offset_clamp = !_glewInit_GL_EXT_polygon_offset_clamp(); +#endif /* GL_EXT_polygon_offset_clamp */ +#ifdef GL_EXT_provoking_vertex + if (glewExperimental || GLEW_EXT_provoking_vertex) GLEW_EXT_provoking_vertex = !_glewInit_GL_EXT_provoking_vertex(); +#endif /* GL_EXT_provoking_vertex */ +#ifdef GL_EXT_raster_multisample + if (glewExperimental || GLEW_EXT_raster_multisample) GLEW_EXT_raster_multisample = !_glewInit_GL_EXT_raster_multisample(); +#endif /* GL_EXT_raster_multisample */ #ifdef GL_EXT_scene_marker - CONST_CAST(GLEW_EXT_scene_marker) = glewGetExtension("GL_EXT_scene_marker"); - if (glewExperimental || GLEW_EXT_scene_marker) CONST_CAST(GLEW_EXT_scene_marker) = !_glewInit_GL_EXT_scene_marker(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_scene_marker) GLEW_EXT_scene_marker = !_glewInit_GL_EXT_scene_marker(); #endif /* GL_EXT_scene_marker */ #ifdef GL_EXT_secondary_color - CONST_CAST(GLEW_EXT_secondary_color) = glewGetExtension("GL_EXT_secondary_color"); - if (glewExperimental || GLEW_EXT_secondary_color) CONST_CAST(GLEW_EXT_secondary_color) = !_glewInit_GL_EXT_secondary_color(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_secondary_color) GLEW_EXT_secondary_color = !_glewInit_GL_EXT_secondary_color(); #endif /* GL_EXT_secondary_color */ -#ifdef GL_EXT_separate_specular_color - CONST_CAST(GLEW_EXT_separate_specular_color) = glewGetExtension("GL_EXT_separate_specular_color"); -#endif /* GL_EXT_separate_specular_color */ -#ifdef GL_EXT_shadow_funcs - CONST_CAST(GLEW_EXT_shadow_funcs) = glewGetExtension("GL_EXT_shadow_funcs"); -#endif /* GL_EXT_shadow_funcs */ -#ifdef GL_EXT_shared_texture_palette - CONST_CAST(GLEW_EXT_shared_texture_palette) = glewGetExtension("GL_EXT_shared_texture_palette"); -#endif /* GL_EXT_shared_texture_palette */ -#ifdef GL_EXT_stencil_clear_tag - CONST_CAST(GLEW_EXT_stencil_clear_tag) = glewGetExtension("GL_EXT_stencil_clear_tag"); -#endif /* GL_EXT_stencil_clear_tag */ +#ifdef GL_EXT_semaphore + if (glewExperimental || GLEW_EXT_semaphore) GLEW_EXT_semaphore = !_glewInit_GL_EXT_semaphore(); +#endif /* GL_EXT_semaphore */ +#ifdef GL_EXT_semaphore_fd + if (glewExperimental || GLEW_EXT_semaphore_fd) GLEW_EXT_semaphore_fd = !_glewInit_GL_EXT_semaphore_fd(); +#endif /* GL_EXT_semaphore_fd */ +#ifdef GL_EXT_semaphore_win32 + if (glewExperimental || GLEW_EXT_semaphore_win32) GLEW_EXT_semaphore_win32 = !_glewInit_GL_EXT_semaphore_win32(); +#endif /* GL_EXT_semaphore_win32 */ +#ifdef GL_EXT_separate_shader_objects + if (glewExperimental || GLEW_EXT_separate_shader_objects) GLEW_EXT_separate_shader_objects = !_glewInit_GL_EXT_separate_shader_objects(); +#endif /* GL_EXT_separate_shader_objects */ +#ifdef GL_EXT_shader_image_load_store + if (glewExperimental || GLEW_EXT_shader_image_load_store) GLEW_EXT_shader_image_load_store = !_glewInit_GL_EXT_shader_image_load_store(); +#endif /* GL_EXT_shader_image_load_store */ +#ifdef GL_EXT_shader_pixel_local_storage2 + if (glewExperimental || GLEW_EXT_shader_pixel_local_storage2) GLEW_EXT_shader_pixel_local_storage2 = !_glewInit_GL_EXT_shader_pixel_local_storage2(); +#endif /* GL_EXT_shader_pixel_local_storage2 */ +#ifdef GL_EXT_sparse_texture + if (glewExperimental || GLEW_EXT_sparse_texture) GLEW_EXT_sparse_texture = !_glewInit_GL_EXT_sparse_texture(); +#endif /* GL_EXT_sparse_texture */ #ifdef GL_EXT_stencil_two_side - CONST_CAST(GLEW_EXT_stencil_two_side) = glewGetExtension("GL_EXT_stencil_two_side"); - if (glewExperimental || GLEW_EXT_stencil_two_side) CONST_CAST(GLEW_EXT_stencil_two_side) = !_glewInit_GL_EXT_stencil_two_side(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_stencil_two_side) GLEW_EXT_stencil_two_side = !_glewInit_GL_EXT_stencil_two_side(); #endif /* GL_EXT_stencil_two_side */ -#ifdef GL_EXT_stencil_wrap - CONST_CAST(GLEW_EXT_stencil_wrap) = glewGetExtension("GL_EXT_stencil_wrap"); -#endif /* GL_EXT_stencil_wrap */ #ifdef GL_EXT_subtexture - CONST_CAST(GLEW_EXT_subtexture) = glewGetExtension("GL_EXT_subtexture"); - if (glewExperimental || GLEW_EXT_subtexture) CONST_CAST(GLEW_EXT_subtexture) = !_glewInit_GL_EXT_subtexture(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_subtexture) GLEW_EXT_subtexture = !_glewInit_GL_EXT_subtexture(); #endif /* GL_EXT_subtexture */ -#ifdef GL_EXT_texture - CONST_CAST(GLEW_EXT_texture) = glewGetExtension("GL_EXT_texture"); -#endif /* GL_EXT_texture */ #ifdef GL_EXT_texture3D - CONST_CAST(GLEW_EXT_texture3D) = glewGetExtension("GL_EXT_texture3D"); - if (glewExperimental || GLEW_EXT_texture3D) CONST_CAST(GLEW_EXT_texture3D) = !_glewInit_GL_EXT_texture3D(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_texture3D) GLEW_EXT_texture3D = !_glewInit_GL_EXT_texture3D(); #endif /* GL_EXT_texture3D */ #ifdef GL_EXT_texture_array - CONST_CAST(GLEW_EXT_texture_array) = glewGetExtension("GL_EXT_texture_array"); + if (glewExperimental || GLEW_EXT_texture_array) GLEW_EXT_texture_array = !_glewInit_GL_EXT_texture_array(); #endif /* GL_EXT_texture_array */ #ifdef GL_EXT_texture_buffer_object - CONST_CAST(GLEW_EXT_texture_buffer_object) = glewGetExtension("GL_EXT_texture_buffer_object"); - if (glewExperimental || GLEW_EXT_texture_buffer_object) CONST_CAST(GLEW_EXT_texture_buffer_object) = !_glewInit_GL_EXT_texture_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_texture_buffer_object) GLEW_EXT_texture_buffer_object = !_glewInit_GL_EXT_texture_buffer_object(); #endif /* GL_EXT_texture_buffer_object */ -#ifdef GL_EXT_texture_compression_dxt1 - CONST_CAST(GLEW_EXT_texture_compression_dxt1) = glewGetExtension("GL_EXT_texture_compression_dxt1"); -#endif /* GL_EXT_texture_compression_dxt1 */ -#ifdef GL_EXT_texture_compression_latc - CONST_CAST(GLEW_EXT_texture_compression_latc) = glewGetExtension("GL_EXT_texture_compression_latc"); -#endif /* GL_EXT_texture_compression_latc */ -#ifdef GL_EXT_texture_compression_rgtc - CONST_CAST(GLEW_EXT_texture_compression_rgtc) = glewGetExtension("GL_EXT_texture_compression_rgtc"); -#endif /* GL_EXT_texture_compression_rgtc */ -#ifdef GL_EXT_texture_compression_s3tc - CONST_CAST(GLEW_EXT_texture_compression_s3tc) = glewGetExtension("GL_EXT_texture_compression_s3tc"); -#endif /* GL_EXT_texture_compression_s3tc */ -#ifdef GL_EXT_texture_cube_map - CONST_CAST(GLEW_EXT_texture_cube_map) = glewGetExtension("GL_EXT_texture_cube_map"); -#endif /* GL_EXT_texture_cube_map */ -#ifdef GL_EXT_texture_edge_clamp - CONST_CAST(GLEW_EXT_texture_edge_clamp) = glewGetExtension("GL_EXT_texture_edge_clamp"); -#endif /* GL_EXT_texture_edge_clamp */ -#ifdef GL_EXT_texture_env - CONST_CAST(GLEW_EXT_texture_env) = glewGetExtension("GL_EXT_texture_env"); -#endif /* GL_EXT_texture_env */ -#ifdef GL_EXT_texture_env_add - CONST_CAST(GLEW_EXT_texture_env_add) = glewGetExtension("GL_EXT_texture_env_add"); -#endif /* GL_EXT_texture_env_add */ -#ifdef GL_EXT_texture_env_combine - CONST_CAST(GLEW_EXT_texture_env_combine) = glewGetExtension("GL_EXT_texture_env_combine"); -#endif /* GL_EXT_texture_env_combine */ -#ifdef GL_EXT_texture_env_dot3 - CONST_CAST(GLEW_EXT_texture_env_dot3) = glewGetExtension("GL_EXT_texture_env_dot3"); -#endif /* GL_EXT_texture_env_dot3 */ -#ifdef GL_EXT_texture_filter_anisotropic - CONST_CAST(GLEW_EXT_texture_filter_anisotropic) = glewGetExtension("GL_EXT_texture_filter_anisotropic"); -#endif /* GL_EXT_texture_filter_anisotropic */ #ifdef GL_EXT_texture_integer - CONST_CAST(GLEW_EXT_texture_integer) = glewGetExtension("GL_EXT_texture_integer"); - if (glewExperimental || GLEW_EXT_texture_integer) CONST_CAST(GLEW_EXT_texture_integer) = !_glewInit_GL_EXT_texture_integer(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_texture_integer) GLEW_EXT_texture_integer = !_glewInit_GL_EXT_texture_integer(); #endif /* GL_EXT_texture_integer */ -#ifdef GL_EXT_texture_lod_bias - CONST_CAST(GLEW_EXT_texture_lod_bias) = glewGetExtension("GL_EXT_texture_lod_bias"); -#endif /* GL_EXT_texture_lod_bias */ -#ifdef GL_EXT_texture_mirror_clamp - CONST_CAST(GLEW_EXT_texture_mirror_clamp) = glewGetExtension("GL_EXT_texture_mirror_clamp"); -#endif /* GL_EXT_texture_mirror_clamp */ #ifdef GL_EXT_texture_object - CONST_CAST(GLEW_EXT_texture_object) = glewGetExtension("GL_EXT_texture_object"); - if (glewExperimental || GLEW_EXT_texture_object) CONST_CAST(GLEW_EXT_texture_object) = !_glewInit_GL_EXT_texture_object(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_texture_object) GLEW_EXT_texture_object = !_glewInit_GL_EXT_texture_object(); #endif /* GL_EXT_texture_object */ #ifdef GL_EXT_texture_perturb_normal - CONST_CAST(GLEW_EXT_texture_perturb_normal) = glewGetExtension("GL_EXT_texture_perturb_normal"); - if (glewExperimental || GLEW_EXT_texture_perturb_normal) CONST_CAST(GLEW_EXT_texture_perturb_normal) = !_glewInit_GL_EXT_texture_perturb_normal(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_texture_perturb_normal) GLEW_EXT_texture_perturb_normal = !_glewInit_GL_EXT_texture_perturb_normal(); #endif /* GL_EXT_texture_perturb_normal */ -#ifdef GL_EXT_texture_rectangle - CONST_CAST(GLEW_EXT_texture_rectangle) = glewGetExtension("GL_EXT_texture_rectangle"); -#endif /* GL_EXT_texture_rectangle */ -#ifdef GL_EXT_texture_sRGB - CONST_CAST(GLEW_EXT_texture_sRGB) = glewGetExtension("GL_EXT_texture_sRGB"); -#endif /* GL_EXT_texture_sRGB */ -#ifdef GL_EXT_texture_shared_exponent - CONST_CAST(GLEW_EXT_texture_shared_exponent) = glewGetExtension("GL_EXT_texture_shared_exponent"); -#endif /* GL_EXT_texture_shared_exponent */ +#ifdef GL_EXT_texture_storage + if (glewExperimental || GLEW_EXT_texture_storage) GLEW_EXT_texture_storage = !_glewInit_GL_EXT_texture_storage(); +#endif /* GL_EXT_texture_storage */ +#ifdef GL_EXT_texture_view + if (glewExperimental || GLEW_EXT_texture_view) GLEW_EXT_texture_view = !_glewInit_GL_EXT_texture_view(); +#endif /* GL_EXT_texture_view */ #ifdef GL_EXT_timer_query - CONST_CAST(GLEW_EXT_timer_query) = glewGetExtension("GL_EXT_timer_query"); - if (glewExperimental || GLEW_EXT_timer_query) CONST_CAST(GLEW_EXT_timer_query) = !_glewInit_GL_EXT_timer_query(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_timer_query) GLEW_EXT_timer_query = !_glewInit_GL_EXT_timer_query(); #endif /* GL_EXT_timer_query */ +#ifdef GL_EXT_transform_feedback + if (glewExperimental || GLEW_EXT_transform_feedback) GLEW_EXT_transform_feedback = !_glewInit_GL_EXT_transform_feedback(); +#endif /* GL_EXT_transform_feedback */ #ifdef GL_EXT_vertex_array - CONST_CAST(GLEW_EXT_vertex_array) = glewGetExtension("GL_EXT_vertex_array"); - if (glewExperimental || GLEW_EXT_vertex_array) CONST_CAST(GLEW_EXT_vertex_array) = !_glewInit_GL_EXT_vertex_array(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_vertex_array) GLEW_EXT_vertex_array = !_glewInit_GL_EXT_vertex_array(); #endif /* GL_EXT_vertex_array */ +#ifdef GL_EXT_vertex_array_setXXX + if (glewExperimental || GLEW_EXT_vertex_array_setXXX) GLEW_EXT_vertex_array_setXXX = !_glewInit_GL_EXT_vertex_array_setXXX(); +#endif /* GL_EXT_vertex_array_setXXX */ +#ifdef GL_EXT_vertex_attrib_64bit + if (glewExperimental || GLEW_EXT_vertex_attrib_64bit) GLEW_EXT_vertex_attrib_64bit = !_glewInit_GL_EXT_vertex_attrib_64bit(); +#endif /* GL_EXT_vertex_attrib_64bit */ #ifdef GL_EXT_vertex_shader - CONST_CAST(GLEW_EXT_vertex_shader) = glewGetExtension("GL_EXT_vertex_shader"); - if (glewExperimental || GLEW_EXT_vertex_shader) CONST_CAST(GLEW_EXT_vertex_shader) = !_glewInit_GL_EXT_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_vertex_shader) GLEW_EXT_vertex_shader = !_glewInit_GL_EXT_vertex_shader(); #endif /* GL_EXT_vertex_shader */ #ifdef GL_EXT_vertex_weighting - CONST_CAST(GLEW_EXT_vertex_weighting) = glewGetExtension("GL_EXT_vertex_weighting"); - if (glewExperimental || GLEW_EXT_vertex_weighting) CONST_CAST(GLEW_EXT_vertex_weighting) = !_glewInit_GL_EXT_vertex_weighting(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_EXT_vertex_weighting) GLEW_EXT_vertex_weighting = !_glewInit_GL_EXT_vertex_weighting(); #endif /* GL_EXT_vertex_weighting */ +#ifdef GL_EXT_win32_keyed_mutex + if (glewExperimental || GLEW_EXT_win32_keyed_mutex) GLEW_EXT_win32_keyed_mutex = !_glewInit_GL_EXT_win32_keyed_mutex(); +#endif /* GL_EXT_win32_keyed_mutex */ +#ifdef GL_EXT_window_rectangles + if (glewExperimental || GLEW_EXT_window_rectangles) GLEW_EXT_window_rectangles = !_glewInit_GL_EXT_window_rectangles(); +#endif /* GL_EXT_window_rectangles */ +#ifdef GL_EXT_x11_sync_object + if (glewExperimental || GLEW_EXT_x11_sync_object) GLEW_EXT_x11_sync_object = !_glewInit_GL_EXT_x11_sync_object(); +#endif /* GL_EXT_x11_sync_object */ #ifdef GL_GREMEDY_frame_terminator - CONST_CAST(GLEW_GREMEDY_frame_terminator) = glewGetExtension("GL_GREMEDY_frame_terminator"); - if (glewExperimental || GLEW_GREMEDY_frame_terminator) CONST_CAST(GLEW_GREMEDY_frame_terminator) = !_glewInit_GL_GREMEDY_frame_terminator(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_GREMEDY_frame_terminator) GLEW_GREMEDY_frame_terminator = !_glewInit_GL_GREMEDY_frame_terminator(); #endif /* GL_GREMEDY_frame_terminator */ #ifdef GL_GREMEDY_string_marker - CONST_CAST(GLEW_GREMEDY_string_marker) = glewGetExtension("GL_GREMEDY_string_marker"); - if (glewExperimental || GLEW_GREMEDY_string_marker) CONST_CAST(GLEW_GREMEDY_string_marker) = !_glewInit_GL_GREMEDY_string_marker(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_GREMEDY_string_marker) GLEW_GREMEDY_string_marker = !_glewInit_GL_GREMEDY_string_marker(); #endif /* GL_GREMEDY_string_marker */ -#ifdef GL_HP_convolution_border_modes - CONST_CAST(GLEW_HP_convolution_border_modes) = glewGetExtension("GL_HP_convolution_border_modes"); -#endif /* GL_HP_convolution_border_modes */ #ifdef GL_HP_image_transform - CONST_CAST(GLEW_HP_image_transform) = glewGetExtension("GL_HP_image_transform"); - if (glewExperimental || GLEW_HP_image_transform) CONST_CAST(GLEW_HP_image_transform) = !_glewInit_GL_HP_image_transform(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_HP_image_transform) GLEW_HP_image_transform = !_glewInit_GL_HP_image_transform(); #endif /* GL_HP_image_transform */ -#ifdef GL_HP_occlusion_test - CONST_CAST(GLEW_HP_occlusion_test) = glewGetExtension("GL_HP_occlusion_test"); -#endif /* GL_HP_occlusion_test */ -#ifdef GL_HP_texture_lighting - CONST_CAST(GLEW_HP_texture_lighting) = glewGetExtension("GL_HP_texture_lighting"); -#endif /* GL_HP_texture_lighting */ -#ifdef GL_IBM_cull_vertex - CONST_CAST(GLEW_IBM_cull_vertex) = glewGetExtension("GL_IBM_cull_vertex"); -#endif /* GL_IBM_cull_vertex */ #ifdef GL_IBM_multimode_draw_arrays - CONST_CAST(GLEW_IBM_multimode_draw_arrays) = glewGetExtension("GL_IBM_multimode_draw_arrays"); - if (glewExperimental || GLEW_IBM_multimode_draw_arrays) CONST_CAST(GLEW_IBM_multimode_draw_arrays) = !_glewInit_GL_IBM_multimode_draw_arrays(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_IBM_multimode_draw_arrays) GLEW_IBM_multimode_draw_arrays = !_glewInit_GL_IBM_multimode_draw_arrays(); #endif /* GL_IBM_multimode_draw_arrays */ -#ifdef GL_IBM_rasterpos_clip - CONST_CAST(GLEW_IBM_rasterpos_clip) = glewGetExtension("GL_IBM_rasterpos_clip"); -#endif /* GL_IBM_rasterpos_clip */ -#ifdef GL_IBM_static_data - CONST_CAST(GLEW_IBM_static_data) = glewGetExtension("GL_IBM_static_data"); -#endif /* GL_IBM_static_data */ -#ifdef GL_IBM_texture_mirrored_repeat - CONST_CAST(GLEW_IBM_texture_mirrored_repeat) = glewGetExtension("GL_IBM_texture_mirrored_repeat"); -#endif /* GL_IBM_texture_mirrored_repeat */ #ifdef GL_IBM_vertex_array_lists - CONST_CAST(GLEW_IBM_vertex_array_lists) = glewGetExtension("GL_IBM_vertex_array_lists"); - if (glewExperimental || GLEW_IBM_vertex_array_lists) CONST_CAST(GLEW_IBM_vertex_array_lists) = !_glewInit_GL_IBM_vertex_array_lists(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_IBM_vertex_array_lists) GLEW_IBM_vertex_array_lists = !_glewInit_GL_IBM_vertex_array_lists(); #endif /* GL_IBM_vertex_array_lists */ -#ifdef GL_INGR_color_clamp - CONST_CAST(GLEW_INGR_color_clamp) = glewGetExtension("GL_INGR_color_clamp"); -#endif /* GL_INGR_color_clamp */ -#ifdef GL_INGR_interlace_read - CONST_CAST(GLEW_INGR_interlace_read) = glewGetExtension("GL_INGR_interlace_read"); -#endif /* GL_INGR_interlace_read */ +#ifdef GL_INTEL_map_texture + if (glewExperimental || GLEW_INTEL_map_texture) GLEW_INTEL_map_texture = !_glewInit_GL_INTEL_map_texture(); +#endif /* GL_INTEL_map_texture */ #ifdef GL_INTEL_parallel_arrays - CONST_CAST(GLEW_INTEL_parallel_arrays) = glewGetExtension("GL_INTEL_parallel_arrays"); - if (glewExperimental || GLEW_INTEL_parallel_arrays) CONST_CAST(GLEW_INTEL_parallel_arrays) = !_glewInit_GL_INTEL_parallel_arrays(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_INTEL_parallel_arrays) GLEW_INTEL_parallel_arrays = !_glewInit_GL_INTEL_parallel_arrays(); #endif /* GL_INTEL_parallel_arrays */ +#ifdef GL_INTEL_performance_query + if (glewExperimental || GLEW_INTEL_performance_query) GLEW_INTEL_performance_query = !_glewInit_GL_INTEL_performance_query(); +#endif /* GL_INTEL_performance_query */ #ifdef GL_INTEL_texture_scissor - CONST_CAST(GLEW_INTEL_texture_scissor) = glewGetExtension("GL_INTEL_texture_scissor"); - if (glewExperimental || GLEW_INTEL_texture_scissor) CONST_CAST(GLEW_INTEL_texture_scissor) = !_glewInit_GL_INTEL_texture_scissor(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_INTEL_texture_scissor) GLEW_INTEL_texture_scissor = !_glewInit_GL_INTEL_texture_scissor(); #endif /* GL_INTEL_texture_scissor */ +#ifdef GL_KHR_blend_equation_advanced + if (glewExperimental || GLEW_KHR_blend_equation_advanced) GLEW_KHR_blend_equation_advanced = !_glewInit_GL_KHR_blend_equation_advanced(); +#endif /* GL_KHR_blend_equation_advanced */ +#ifdef GL_KHR_debug + if (glewExperimental || GLEW_KHR_debug) GLEW_KHR_debug = !_glewInit_GL_KHR_debug(); +#endif /* GL_KHR_debug */ +#ifdef GL_KHR_parallel_shader_compile + if (glewExperimental || GLEW_KHR_parallel_shader_compile) GLEW_KHR_parallel_shader_compile = !_glewInit_GL_KHR_parallel_shader_compile(); +#endif /* GL_KHR_parallel_shader_compile */ +#ifdef GL_KHR_robustness + if (glewExperimental || GLEW_KHR_robustness) GLEW_KHR_robustness = !_glewInit_GL_KHR_robustness(); +#endif /* GL_KHR_robustness */ #ifdef GL_KTX_buffer_region - CONST_CAST(GLEW_KTX_buffer_region) = glewGetExtension("GL_KTX_buffer_region"); - if (glewExperimental || GLEW_KTX_buffer_region) CONST_CAST(GLEW_KTX_buffer_region) = !_glewInit_GL_KTX_buffer_region(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_KTX_buffer_region) GLEW_KTX_buffer_region = !_glewInit_GL_KTX_buffer_region(); #endif /* GL_KTX_buffer_region */ -#ifdef GL_MESAX_texture_stack - CONST_CAST(GLEW_MESAX_texture_stack) = glewGetExtension("GL_MESAX_texture_stack"); -#endif /* GL_MESAX_texture_stack */ -#ifdef GL_MESA_pack_invert - CONST_CAST(GLEW_MESA_pack_invert) = glewGetExtension("GL_MESA_pack_invert"); -#endif /* GL_MESA_pack_invert */ #ifdef GL_MESA_resize_buffers - CONST_CAST(GLEW_MESA_resize_buffers) = glewGetExtension("GL_MESA_resize_buffers"); - if (glewExperimental || GLEW_MESA_resize_buffers) CONST_CAST(GLEW_MESA_resize_buffers) = !_glewInit_GL_MESA_resize_buffers(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_MESA_resize_buffers) GLEW_MESA_resize_buffers = !_glewInit_GL_MESA_resize_buffers(); #endif /* GL_MESA_resize_buffers */ #ifdef GL_MESA_window_pos - CONST_CAST(GLEW_MESA_window_pos) = glewGetExtension("GL_MESA_window_pos"); - if (glewExperimental || GLEW_MESA_window_pos) CONST_CAST(GLEW_MESA_window_pos) = !_glewInit_GL_MESA_window_pos(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_MESA_window_pos) GLEW_MESA_window_pos = !_glewInit_GL_MESA_window_pos(); #endif /* GL_MESA_window_pos */ -#ifdef GL_MESA_ycbcr_texture - CONST_CAST(GLEW_MESA_ycbcr_texture) = glewGetExtension("GL_MESA_ycbcr_texture"); -#endif /* GL_MESA_ycbcr_texture */ -#ifdef GL_NV_blend_square - CONST_CAST(GLEW_NV_blend_square) = glewGetExtension("GL_NV_blend_square"); -#endif /* GL_NV_blend_square */ -#ifdef GL_NV_copy_depth_to_color - CONST_CAST(GLEW_NV_copy_depth_to_color) = glewGetExtension("GL_NV_copy_depth_to_color"); -#endif /* GL_NV_copy_depth_to_color */ +#ifdef GL_NVX_conditional_render + if (glewExperimental || GLEW_NVX_conditional_render) GLEW_NVX_conditional_render = !_glewInit_GL_NVX_conditional_render(); +#endif /* GL_NVX_conditional_render */ +#ifdef GL_NVX_linked_gpu_multicast + if (glewExperimental || GLEW_NVX_linked_gpu_multicast) GLEW_NVX_linked_gpu_multicast = !_glewInit_GL_NVX_linked_gpu_multicast(); +#endif /* GL_NVX_linked_gpu_multicast */ +#ifdef GL_NV_3dvision_settings + if (glewExperimental || GLEW_NV_3dvision_settings) GLEW_NV_3dvision_settings = !_glewInit_GL_NV_3dvision_settings(); +#endif /* GL_NV_3dvision_settings */ +#ifdef GL_NV_bindless_multi_draw_indirect + if (glewExperimental || GLEW_NV_bindless_multi_draw_indirect) GLEW_NV_bindless_multi_draw_indirect = !_glewInit_GL_NV_bindless_multi_draw_indirect(); +#endif /* GL_NV_bindless_multi_draw_indirect */ +#ifdef GL_NV_bindless_multi_draw_indirect_count + if (glewExperimental || GLEW_NV_bindless_multi_draw_indirect_count) GLEW_NV_bindless_multi_draw_indirect_count = !_glewInit_GL_NV_bindless_multi_draw_indirect_count(); +#endif /* GL_NV_bindless_multi_draw_indirect_count */ +#ifdef GL_NV_bindless_texture + if (glewExperimental || GLEW_NV_bindless_texture) GLEW_NV_bindless_texture = !_glewInit_GL_NV_bindless_texture(); +#endif /* GL_NV_bindless_texture */ +#ifdef GL_NV_blend_equation_advanced + if (glewExperimental || GLEW_NV_blend_equation_advanced) GLEW_NV_blend_equation_advanced = !_glewInit_GL_NV_blend_equation_advanced(); +#endif /* GL_NV_blend_equation_advanced */ +#ifdef GL_NV_clip_space_w_scaling + if (glewExperimental || GLEW_NV_clip_space_w_scaling) GLEW_NV_clip_space_w_scaling = !_glewInit_GL_NV_clip_space_w_scaling(); +#endif /* GL_NV_clip_space_w_scaling */ +#ifdef GL_NV_command_list + if (glewExperimental || GLEW_NV_command_list) GLEW_NV_command_list = !_glewInit_GL_NV_command_list(); +#endif /* GL_NV_command_list */ +#ifdef GL_NV_conditional_render + if (glewExperimental || GLEW_NV_conditional_render) GLEW_NV_conditional_render = !_glewInit_GL_NV_conditional_render(); +#endif /* GL_NV_conditional_render */ +#ifdef GL_NV_conservative_raster + if (glewExperimental || GLEW_NV_conservative_raster) GLEW_NV_conservative_raster = !_glewInit_GL_NV_conservative_raster(); +#endif /* GL_NV_conservative_raster */ +#ifdef GL_NV_conservative_raster_dilate + if (glewExperimental || GLEW_NV_conservative_raster_dilate) GLEW_NV_conservative_raster_dilate = !_glewInit_GL_NV_conservative_raster_dilate(); +#endif /* GL_NV_conservative_raster_dilate */ +#ifdef GL_NV_conservative_raster_pre_snap_triangles + if (glewExperimental || GLEW_NV_conservative_raster_pre_snap_triangles) GLEW_NV_conservative_raster_pre_snap_triangles = !_glewInit_GL_NV_conservative_raster_pre_snap_triangles(); +#endif /* GL_NV_conservative_raster_pre_snap_triangles */ +#ifdef GL_NV_copy_buffer + if (glewExperimental || GLEW_NV_copy_buffer) GLEW_NV_copy_buffer = !_glewInit_GL_NV_copy_buffer(); +#endif /* GL_NV_copy_buffer */ +#ifdef GL_NV_copy_image + if (glewExperimental || GLEW_NV_copy_image) GLEW_NV_copy_image = !_glewInit_GL_NV_copy_image(); +#endif /* GL_NV_copy_image */ #ifdef GL_NV_depth_buffer_float - CONST_CAST(GLEW_NV_depth_buffer_float) = glewGetExtension("GL_NV_depth_buffer_float"); - if (glewExperimental || GLEW_NV_depth_buffer_float) CONST_CAST(GLEW_NV_depth_buffer_float) = !_glewInit_GL_NV_depth_buffer_float(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_NV_depth_buffer_float) GLEW_NV_depth_buffer_float = !_glewInit_GL_NV_depth_buffer_float(); #endif /* GL_NV_depth_buffer_float */ -#ifdef GL_NV_depth_clamp - CONST_CAST(GLEW_NV_depth_clamp) = glewGetExtension("GL_NV_depth_clamp"); -#endif /* GL_NV_depth_clamp */ -#ifdef GL_NV_depth_range_unclamped - CONST_CAST(GLEW_NV_depth_range_unclamped) = glewGetExtension("GL_NV_depth_range_unclamped"); -#endif /* GL_NV_depth_range_unclamped */ +#ifdef GL_NV_draw_buffers + if (glewExperimental || GLEW_NV_draw_buffers) GLEW_NV_draw_buffers = !_glewInit_GL_NV_draw_buffers(); +#endif /* GL_NV_draw_buffers */ +#ifdef GL_NV_draw_instanced + if (glewExperimental || GLEW_NV_draw_instanced) GLEW_NV_draw_instanced = !_glewInit_GL_NV_draw_instanced(); +#endif /* GL_NV_draw_instanced */ +#ifdef GL_NV_draw_texture + if (glewExperimental || GLEW_NV_draw_texture) GLEW_NV_draw_texture = !_glewInit_GL_NV_draw_texture(); +#endif /* GL_NV_draw_texture */ +#ifdef GL_NV_draw_vulkan_image + if (glewExperimental || GLEW_NV_draw_vulkan_image) GLEW_NV_draw_vulkan_image = !_glewInit_GL_NV_draw_vulkan_image(); +#endif /* GL_NV_draw_vulkan_image */ #ifdef GL_NV_evaluators - CONST_CAST(GLEW_NV_evaluators) = glewGetExtension("GL_NV_evaluators"); - if (glewExperimental || GLEW_NV_evaluators) CONST_CAST(GLEW_NV_evaluators) = !_glewInit_GL_NV_evaluators(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_NV_evaluators) GLEW_NV_evaluators = !_glewInit_GL_NV_evaluators(); #endif /* GL_NV_evaluators */ +#ifdef GL_NV_explicit_multisample + if (glewExperimental || GLEW_NV_explicit_multisample) GLEW_NV_explicit_multisample = !_glewInit_GL_NV_explicit_multisample(); +#endif /* GL_NV_explicit_multisample */ #ifdef GL_NV_fence - CONST_CAST(GLEW_NV_fence) = glewGetExtension("GL_NV_fence"); - if (glewExperimental || GLEW_NV_fence) CONST_CAST(GLEW_NV_fence) = !_glewInit_GL_NV_fence(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_NV_fence) GLEW_NV_fence = !_glewInit_GL_NV_fence(); #endif /* GL_NV_fence */ -#ifdef GL_NV_float_buffer - CONST_CAST(GLEW_NV_float_buffer) = glewGetExtension("GL_NV_float_buffer"); -#endif /* GL_NV_float_buffer */ -#ifdef GL_NV_fog_distance - CONST_CAST(GLEW_NV_fog_distance) = glewGetExtension("GL_NV_fog_distance"); -#endif /* GL_NV_fog_distance */ +#ifdef GL_NV_fragment_coverage_to_color + if (glewExperimental || GLEW_NV_fragment_coverage_to_color) GLEW_NV_fragment_coverage_to_color = !_glewInit_GL_NV_fragment_coverage_to_color(); +#endif /* GL_NV_fragment_coverage_to_color */ #ifdef GL_NV_fragment_program - CONST_CAST(GLEW_NV_fragment_program) = glewGetExtension("GL_NV_fragment_program"); - if (glewExperimental || GLEW_NV_fragment_program) CONST_CAST(GLEW_NV_fragment_program) = !_glewInit_GL_NV_fragment_program(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_NV_fragment_program) GLEW_NV_fragment_program = !_glewInit_GL_NV_fragment_program(); #endif /* GL_NV_fragment_program */ -#ifdef GL_NV_fragment_program2 - CONST_CAST(GLEW_NV_fragment_program2) = glewGetExtension("GL_NV_fragment_program2"); -#endif /* GL_NV_fragment_program2 */ -#ifdef GL_NV_fragment_program4 - CONST_CAST(GLEW_NV_fragment_program4) = glewGetExtension("GL_NV_fragment_program4"); -#endif /* GL_NV_fragment_program4 */ -#ifdef GL_NV_fragment_program_option - CONST_CAST(GLEW_NV_fragment_program_option) = glewGetExtension("GL_NV_fragment_program_option"); -#endif /* GL_NV_fragment_program_option */ +#ifdef GL_NV_framebuffer_blit + if (glewExperimental || GLEW_NV_framebuffer_blit) GLEW_NV_framebuffer_blit = !_glewInit_GL_NV_framebuffer_blit(); +#endif /* GL_NV_framebuffer_blit */ +#ifdef GL_NV_framebuffer_multisample + if (glewExperimental || GLEW_NV_framebuffer_multisample) GLEW_NV_framebuffer_multisample = !_glewInit_GL_NV_framebuffer_multisample(); +#endif /* GL_NV_framebuffer_multisample */ #ifdef GL_NV_framebuffer_multisample_coverage - CONST_CAST(GLEW_NV_framebuffer_multisample_coverage) = glewGetExtension("GL_NV_framebuffer_multisample_coverage"); - if (glewExperimental || GLEW_NV_framebuffer_multisample_coverage) CONST_CAST(GLEW_NV_framebuffer_multisample_coverage) = !_glewInit_GL_NV_framebuffer_multisample_coverage(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_NV_framebuffer_multisample_coverage) GLEW_NV_framebuffer_multisample_coverage = !_glewInit_GL_NV_framebuffer_multisample_coverage(); #endif /* GL_NV_framebuffer_multisample_coverage */ #ifdef GL_NV_geometry_program4 - CONST_CAST(GLEW_NV_geometry_program4) = glewGetExtension("GL_NV_geometry_program4"); - if (glewExperimental || GLEW_NV_geometry_program4) CONST_CAST(GLEW_NV_geometry_program4) = !_glewInit_GL_NV_geometry_program4(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_NV_geometry_program4) GLEW_NV_geometry_program4 = !_glewInit_GL_NV_geometry_program4(); #endif /* GL_NV_geometry_program4 */ -#ifdef GL_NV_geometry_shader4 - CONST_CAST(GLEW_NV_geometry_shader4) = glewGetExtension("GL_NV_geometry_shader4"); -#endif /* GL_NV_geometry_shader4 */ +#ifdef GL_NV_gpu_multicast + if (glewExperimental || GLEW_NV_gpu_multicast) GLEW_NV_gpu_multicast = !_glewInit_GL_NV_gpu_multicast(); +#endif /* GL_NV_gpu_multicast */ #ifdef GL_NV_gpu_program4 - CONST_CAST(GLEW_NV_gpu_program4) = glewGetExtension("GL_NV_gpu_program4"); - if (glewExperimental || GLEW_NV_gpu_program4) CONST_CAST(GLEW_NV_gpu_program4) = !_glewInit_GL_NV_gpu_program4(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_NV_gpu_program4) GLEW_NV_gpu_program4 = !_glewInit_GL_NV_gpu_program4(); #endif /* GL_NV_gpu_program4 */ +#ifdef GL_NV_gpu_shader5 + if (glewExperimental || GLEW_NV_gpu_shader5) GLEW_NV_gpu_shader5 = !_glewInit_GL_NV_gpu_shader5(); +#endif /* GL_NV_gpu_shader5 */ #ifdef GL_NV_half_float - CONST_CAST(GLEW_NV_half_float) = glewGetExtension("GL_NV_half_float"); - if (glewExperimental || GLEW_NV_half_float) CONST_CAST(GLEW_NV_half_float) = !_glewInit_GL_NV_half_float(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_NV_half_float) GLEW_NV_half_float = !_glewInit_GL_NV_half_float(); #endif /* GL_NV_half_float */ -#ifdef GL_NV_light_max_exponent - CONST_CAST(GLEW_NV_light_max_exponent) = glewGetExtension("GL_NV_light_max_exponent"); -#endif /* GL_NV_light_max_exponent */ -#ifdef GL_NV_multisample_filter_hint - CONST_CAST(GLEW_NV_multisample_filter_hint) = glewGetExtension("GL_NV_multisample_filter_hint"); -#endif /* GL_NV_multisample_filter_hint */ +#ifdef GL_NV_instanced_arrays + if (glewExperimental || GLEW_NV_instanced_arrays) GLEW_NV_instanced_arrays = !_glewInit_GL_NV_instanced_arrays(); +#endif /* GL_NV_instanced_arrays */ +#ifdef GL_NV_internalformat_sample_query + if (glewExperimental || GLEW_NV_internalformat_sample_query) GLEW_NV_internalformat_sample_query = !_glewInit_GL_NV_internalformat_sample_query(); +#endif /* GL_NV_internalformat_sample_query */ +#ifdef GL_NV_non_square_matrices + if (glewExperimental || GLEW_NV_non_square_matrices) GLEW_NV_non_square_matrices = !_glewInit_GL_NV_non_square_matrices(); +#endif /* GL_NV_non_square_matrices */ #ifdef GL_NV_occlusion_query - CONST_CAST(GLEW_NV_occlusion_query) = glewGetExtension("GL_NV_occlusion_query"); - if (glewExperimental || GLEW_NV_occlusion_query) CONST_CAST(GLEW_NV_occlusion_query) = !_glewInit_GL_NV_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_NV_occlusion_query) GLEW_NV_occlusion_query = !_glewInit_GL_NV_occlusion_query(); #endif /* GL_NV_occlusion_query */ -#ifdef GL_NV_packed_depth_stencil - CONST_CAST(GLEW_NV_packed_depth_stencil) = glewGetExtension("GL_NV_packed_depth_stencil"); -#endif /* GL_NV_packed_depth_stencil */ #ifdef GL_NV_parameter_buffer_object - CONST_CAST(GLEW_NV_parameter_buffer_object) = glewGetExtension("GL_NV_parameter_buffer_object"); - if (glewExperimental || GLEW_NV_parameter_buffer_object) CONST_CAST(GLEW_NV_parameter_buffer_object) = !_glewInit_GL_NV_parameter_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_NV_parameter_buffer_object) GLEW_NV_parameter_buffer_object = !_glewInit_GL_NV_parameter_buffer_object(); #endif /* GL_NV_parameter_buffer_object */ +#ifdef GL_NV_path_rendering + if (glewExperimental || GLEW_NV_path_rendering) GLEW_NV_path_rendering = !_glewInit_GL_NV_path_rendering(); +#endif /* GL_NV_path_rendering */ #ifdef GL_NV_pixel_data_range - CONST_CAST(GLEW_NV_pixel_data_range) = glewGetExtension("GL_NV_pixel_data_range"); - if (glewExperimental || GLEW_NV_pixel_data_range) CONST_CAST(GLEW_NV_pixel_data_range) = !_glewInit_GL_NV_pixel_data_range(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_NV_pixel_data_range) GLEW_NV_pixel_data_range = !_glewInit_GL_NV_pixel_data_range(); #endif /* GL_NV_pixel_data_range */ #ifdef GL_NV_point_sprite - CONST_CAST(GLEW_NV_point_sprite) = glewGetExtension("GL_NV_point_sprite"); - if (glewExperimental || GLEW_NV_point_sprite) CONST_CAST(GLEW_NV_point_sprite) = !_glewInit_GL_NV_point_sprite(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_NV_point_sprite) GLEW_NV_point_sprite = !_glewInit_GL_NV_point_sprite(); #endif /* GL_NV_point_sprite */ +#ifdef GL_NV_polygon_mode + if (glewExperimental || GLEW_NV_polygon_mode) GLEW_NV_polygon_mode = !_glewInit_GL_NV_polygon_mode(); +#endif /* GL_NV_polygon_mode */ +#ifdef GL_NV_present_video + if (glewExperimental || GLEW_NV_present_video) GLEW_NV_present_video = !_glewInit_GL_NV_present_video(); +#endif /* GL_NV_present_video */ #ifdef GL_NV_primitive_restart - CONST_CAST(GLEW_NV_primitive_restart) = glewGetExtension("GL_NV_primitive_restart"); - if (glewExperimental || GLEW_NV_primitive_restart) CONST_CAST(GLEW_NV_primitive_restart) = !_glewInit_GL_NV_primitive_restart(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_NV_primitive_restart) GLEW_NV_primitive_restart = !_glewInit_GL_NV_primitive_restart(); #endif /* GL_NV_primitive_restart */ #ifdef GL_NV_register_combiners - CONST_CAST(GLEW_NV_register_combiners) = glewGetExtension("GL_NV_register_combiners"); - if (glewExperimental || GLEW_NV_register_combiners) CONST_CAST(GLEW_NV_register_combiners) = !_glewInit_GL_NV_register_combiners(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_NV_register_combiners) GLEW_NV_register_combiners = !_glewInit_GL_NV_register_combiners(); #endif /* GL_NV_register_combiners */ #ifdef GL_NV_register_combiners2 - CONST_CAST(GLEW_NV_register_combiners2) = glewGetExtension("GL_NV_register_combiners2"); - if (glewExperimental || GLEW_NV_register_combiners2) CONST_CAST(GLEW_NV_register_combiners2) = !_glewInit_GL_NV_register_combiners2(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_NV_register_combiners2) GLEW_NV_register_combiners2 = !_glewInit_GL_NV_register_combiners2(); #endif /* GL_NV_register_combiners2 */ -#ifdef GL_NV_texgen_emboss - CONST_CAST(GLEW_NV_texgen_emboss) = glewGetExtension("GL_NV_texgen_emboss"); -#endif /* GL_NV_texgen_emboss */ -#ifdef GL_NV_texgen_reflection - CONST_CAST(GLEW_NV_texgen_reflection) = glewGetExtension("GL_NV_texgen_reflection"); -#endif /* GL_NV_texgen_reflection */ -#ifdef GL_NV_texture_compression_vtc - CONST_CAST(GLEW_NV_texture_compression_vtc) = glewGetExtension("GL_NV_texture_compression_vtc"); -#endif /* GL_NV_texture_compression_vtc */ -#ifdef GL_NV_texture_env_combine4 - CONST_CAST(GLEW_NV_texture_env_combine4) = glewGetExtension("GL_NV_texture_env_combine4"); -#endif /* GL_NV_texture_env_combine4 */ -#ifdef GL_NV_texture_expand_normal - CONST_CAST(GLEW_NV_texture_expand_normal) = glewGetExtension("GL_NV_texture_expand_normal"); -#endif /* GL_NV_texture_expand_normal */ -#ifdef GL_NV_texture_rectangle - CONST_CAST(GLEW_NV_texture_rectangle) = glewGetExtension("GL_NV_texture_rectangle"); -#endif /* GL_NV_texture_rectangle */ -#ifdef GL_NV_texture_shader - CONST_CAST(GLEW_NV_texture_shader) = glewGetExtension("GL_NV_texture_shader"); -#endif /* GL_NV_texture_shader */ -#ifdef GL_NV_texture_shader2 - CONST_CAST(GLEW_NV_texture_shader2) = glewGetExtension("GL_NV_texture_shader2"); -#endif /* GL_NV_texture_shader2 */ -#ifdef GL_NV_texture_shader3 - CONST_CAST(GLEW_NV_texture_shader3) = glewGetExtension("GL_NV_texture_shader3"); -#endif /* GL_NV_texture_shader3 */ +#ifdef GL_NV_sample_locations + if (glewExperimental || GLEW_NV_sample_locations) GLEW_NV_sample_locations = !_glewInit_GL_NV_sample_locations(); +#endif /* GL_NV_sample_locations */ +#ifdef GL_NV_shader_buffer_load + if (glewExperimental || GLEW_NV_shader_buffer_load) GLEW_NV_shader_buffer_load = !_glewInit_GL_NV_shader_buffer_load(); +#endif /* GL_NV_shader_buffer_load */ +#ifdef GL_NV_texture_array + if (glewExperimental || GLEW_NV_texture_array) GLEW_NV_texture_array = !_glewInit_GL_NV_texture_array(); +#endif /* GL_NV_texture_array */ +#ifdef GL_NV_texture_barrier + if (glewExperimental || GLEW_NV_texture_barrier) GLEW_NV_texture_barrier = !_glewInit_GL_NV_texture_barrier(); +#endif /* GL_NV_texture_barrier */ +#ifdef GL_NV_texture_multisample + if (glewExperimental || GLEW_NV_texture_multisample) GLEW_NV_texture_multisample = !_glewInit_GL_NV_texture_multisample(); +#endif /* GL_NV_texture_multisample */ #ifdef GL_NV_transform_feedback - CONST_CAST(GLEW_NV_transform_feedback) = glewGetExtension("GL_NV_transform_feedback"); - if (glewExperimental || GLEW_NV_transform_feedback) CONST_CAST(GLEW_NV_transform_feedback) = !_glewInit_GL_NV_transform_feedback(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_NV_transform_feedback) GLEW_NV_transform_feedback = !_glewInit_GL_NV_transform_feedback(); #endif /* GL_NV_transform_feedback */ +#ifdef GL_NV_transform_feedback2 + if (glewExperimental || GLEW_NV_transform_feedback2) GLEW_NV_transform_feedback2 = !_glewInit_GL_NV_transform_feedback2(); +#endif /* GL_NV_transform_feedback2 */ +#ifdef GL_NV_vdpau_interop + if (glewExperimental || GLEW_NV_vdpau_interop) GLEW_NV_vdpau_interop = !_glewInit_GL_NV_vdpau_interop(); +#endif /* GL_NV_vdpau_interop */ #ifdef GL_NV_vertex_array_range - CONST_CAST(GLEW_NV_vertex_array_range) = glewGetExtension("GL_NV_vertex_array_range"); - if (glewExperimental || GLEW_NV_vertex_array_range) CONST_CAST(GLEW_NV_vertex_array_range) = !_glewInit_GL_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_NV_vertex_array_range) GLEW_NV_vertex_array_range = !_glewInit_GL_NV_vertex_array_range(); #endif /* GL_NV_vertex_array_range */ -#ifdef GL_NV_vertex_array_range2 - CONST_CAST(GLEW_NV_vertex_array_range2) = glewGetExtension("GL_NV_vertex_array_range2"); -#endif /* GL_NV_vertex_array_range2 */ +#ifdef GL_NV_vertex_attrib_integer_64bit + if (glewExperimental || GLEW_NV_vertex_attrib_integer_64bit) GLEW_NV_vertex_attrib_integer_64bit = !_glewInit_GL_NV_vertex_attrib_integer_64bit(); +#endif /* GL_NV_vertex_attrib_integer_64bit */ +#ifdef GL_NV_vertex_buffer_unified_memory + if (glewExperimental || GLEW_NV_vertex_buffer_unified_memory) GLEW_NV_vertex_buffer_unified_memory = !_glewInit_GL_NV_vertex_buffer_unified_memory(); +#endif /* GL_NV_vertex_buffer_unified_memory */ #ifdef GL_NV_vertex_program - CONST_CAST(GLEW_NV_vertex_program) = glewGetExtension("GL_NV_vertex_program"); - if (glewExperimental || GLEW_NV_vertex_program) CONST_CAST(GLEW_NV_vertex_program) = !_glewInit_GL_NV_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_NV_vertex_program) GLEW_NV_vertex_program = !_glewInit_GL_NV_vertex_program(); #endif /* GL_NV_vertex_program */ -#ifdef GL_NV_vertex_program1_1 - CONST_CAST(GLEW_NV_vertex_program1_1) = glewGetExtension("GL_NV_vertex_program1_1"); -#endif /* GL_NV_vertex_program1_1 */ -#ifdef GL_NV_vertex_program2 - CONST_CAST(GLEW_NV_vertex_program2) = glewGetExtension("GL_NV_vertex_program2"); -#endif /* GL_NV_vertex_program2 */ -#ifdef GL_NV_vertex_program2_option - CONST_CAST(GLEW_NV_vertex_program2_option) = glewGetExtension("GL_NV_vertex_program2_option"); -#endif /* GL_NV_vertex_program2_option */ -#ifdef GL_NV_vertex_program3 - CONST_CAST(GLEW_NV_vertex_program3) = glewGetExtension("GL_NV_vertex_program3"); -#endif /* GL_NV_vertex_program3 */ -#ifdef GL_NV_vertex_program4 - CONST_CAST(GLEW_NV_vertex_program4) = glewGetExtension("GL_NV_vertex_program4"); -#endif /* GL_NV_vertex_program4 */ -#ifdef GL_OES_byte_coordinates - CONST_CAST(GLEW_OES_byte_coordinates) = glewGetExtension("GL_OES_byte_coordinates"); -#endif /* GL_OES_byte_coordinates */ -#ifdef GL_OES_compressed_paletted_texture - CONST_CAST(GLEW_OES_compressed_paletted_texture) = glewGetExtension("GL_OES_compressed_paletted_texture"); -#endif /* GL_OES_compressed_paletted_texture */ -#ifdef GL_OES_read_format - CONST_CAST(GLEW_OES_read_format) = glewGetExtension("GL_OES_read_format"); -#endif /* GL_OES_read_format */ -#ifdef GL_OES_single_precision - CONST_CAST(GLEW_OES_single_precision) = glewGetExtension("GL_OES_single_precision"); - if (glewExperimental || GLEW_OES_single_precision) CONST_CAST(GLEW_OES_single_precision) = !_glewInit_GL_OES_single_precision(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_OES_single_precision */ -#ifdef GL_OML_interlace - CONST_CAST(GLEW_OML_interlace) = glewGetExtension("GL_OML_interlace"); -#endif /* GL_OML_interlace */ -#ifdef GL_OML_resample - CONST_CAST(GLEW_OML_resample) = glewGetExtension("GL_OML_resample"); -#endif /* GL_OML_resample */ -#ifdef GL_OML_subsample - CONST_CAST(GLEW_OML_subsample) = glewGetExtension("GL_OML_subsample"); -#endif /* GL_OML_subsample */ -#ifdef GL_PGI_misc_hints - CONST_CAST(GLEW_PGI_misc_hints) = glewGetExtension("GL_PGI_misc_hints"); -#endif /* GL_PGI_misc_hints */ -#ifdef GL_PGI_vertex_hints - CONST_CAST(GLEW_PGI_vertex_hints) = glewGetExtension("GL_PGI_vertex_hints"); -#endif /* GL_PGI_vertex_hints */ -#ifdef GL_REND_screen_coordinates - CONST_CAST(GLEW_REND_screen_coordinates) = glewGetExtension("GL_REND_screen_coordinates"); -#endif /* GL_REND_screen_coordinates */ -#ifdef GL_S3_s3tc - CONST_CAST(GLEW_S3_s3tc) = glewGetExtension("GL_S3_s3tc"); -#endif /* GL_S3_s3tc */ -#ifdef GL_SGIS_color_range - CONST_CAST(GLEW_SGIS_color_range) = glewGetExtension("GL_SGIS_color_range"); -#endif /* GL_SGIS_color_range */ +#ifdef GL_NV_video_capture + if (glewExperimental || GLEW_NV_video_capture) GLEW_NV_video_capture = !_glewInit_GL_NV_video_capture(); +#endif /* GL_NV_video_capture */ +#ifdef GL_NV_viewport_array + if (glewExperimental || GLEW_NV_viewport_array) GLEW_NV_viewport_array = !_glewInit_GL_NV_viewport_array(); +#endif /* GL_NV_viewport_array */ +#ifdef GL_NV_viewport_swizzle + if (glewExperimental || GLEW_NV_viewport_swizzle) GLEW_NV_viewport_swizzle = !_glewInit_GL_NV_viewport_swizzle(); +#endif /* GL_NV_viewport_swizzle */ +#ifdef GL_OVR_multiview + if (glewExperimental || GLEW_OVR_multiview) GLEW_OVR_multiview = !_glewInit_GL_OVR_multiview(); +#endif /* GL_OVR_multiview */ +#ifdef GL_OVR_multiview_multisampled_render_to_texture + if (glewExperimental || GLEW_OVR_multiview_multisampled_render_to_texture) GLEW_OVR_multiview_multisampled_render_to_texture = !_glewInit_GL_OVR_multiview_multisampled_render_to_texture(); +#endif /* GL_OVR_multiview_multisampled_render_to_texture */ +#ifdef GL_QCOM_alpha_test + if (glewExperimental || GLEW_QCOM_alpha_test) GLEW_QCOM_alpha_test = !_glewInit_GL_QCOM_alpha_test(); +#endif /* GL_QCOM_alpha_test */ +#ifdef GL_QCOM_driver_control + if (glewExperimental || GLEW_QCOM_driver_control) GLEW_QCOM_driver_control = !_glewInit_GL_QCOM_driver_control(); +#endif /* GL_QCOM_driver_control */ +#ifdef GL_QCOM_extended_get + if (glewExperimental || GLEW_QCOM_extended_get) GLEW_QCOM_extended_get = !_glewInit_GL_QCOM_extended_get(); +#endif /* GL_QCOM_extended_get */ +#ifdef GL_QCOM_extended_get2 + if (glewExperimental || GLEW_QCOM_extended_get2) GLEW_QCOM_extended_get2 = !_glewInit_GL_QCOM_extended_get2(); +#endif /* GL_QCOM_extended_get2 */ +#ifdef GL_QCOM_framebuffer_foveated + if (glewExperimental || GLEW_QCOM_framebuffer_foveated) GLEW_QCOM_framebuffer_foveated = !_glewInit_GL_QCOM_framebuffer_foveated(); +#endif /* GL_QCOM_framebuffer_foveated */ +#ifdef GL_QCOM_shader_framebuffer_fetch_noncoherent + if (glewExperimental || GLEW_QCOM_shader_framebuffer_fetch_noncoherent) GLEW_QCOM_shader_framebuffer_fetch_noncoherent = !_glewInit_GL_QCOM_shader_framebuffer_fetch_noncoherent(); +#endif /* GL_QCOM_shader_framebuffer_fetch_noncoherent */ +#ifdef GL_QCOM_tiled_rendering + if (glewExperimental || GLEW_QCOM_tiled_rendering) GLEW_QCOM_tiled_rendering = !_glewInit_GL_QCOM_tiled_rendering(); +#endif /* GL_QCOM_tiled_rendering */ +#ifdef GL_REGAL_ES1_0_compatibility + if (glewExperimental || GLEW_REGAL_ES1_0_compatibility) GLEW_REGAL_ES1_0_compatibility = !_glewInit_GL_REGAL_ES1_0_compatibility(); +#endif /* GL_REGAL_ES1_0_compatibility */ +#ifdef GL_REGAL_ES1_1_compatibility + if (glewExperimental || GLEW_REGAL_ES1_1_compatibility) GLEW_REGAL_ES1_1_compatibility = !_glewInit_GL_REGAL_ES1_1_compatibility(); +#endif /* GL_REGAL_ES1_1_compatibility */ +#ifdef GL_REGAL_error_string + if (glewExperimental || GLEW_REGAL_error_string) GLEW_REGAL_error_string = !_glewInit_GL_REGAL_error_string(); +#endif /* GL_REGAL_error_string */ +#ifdef GL_REGAL_extension_query + if (glewExperimental || GLEW_REGAL_extension_query) GLEW_REGAL_extension_query = !_glewInit_GL_REGAL_extension_query(); +#endif /* GL_REGAL_extension_query */ +#ifdef GL_REGAL_log + if (glewExperimental || GLEW_REGAL_log) GLEW_REGAL_log = !_glewInit_GL_REGAL_log(); +#endif /* GL_REGAL_log */ +#ifdef GL_REGAL_proc_address + if (glewExperimental || GLEW_REGAL_proc_address) GLEW_REGAL_proc_address = !_glewInit_GL_REGAL_proc_address(); +#endif /* GL_REGAL_proc_address */ #ifdef GL_SGIS_detail_texture - CONST_CAST(GLEW_SGIS_detail_texture) = glewGetExtension("GL_SGIS_detail_texture"); - if (glewExperimental || GLEW_SGIS_detail_texture) CONST_CAST(GLEW_SGIS_detail_texture) = !_glewInit_GL_SGIS_detail_texture(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_SGIS_detail_texture) GLEW_SGIS_detail_texture = !_glewInit_GL_SGIS_detail_texture(); #endif /* GL_SGIS_detail_texture */ #ifdef GL_SGIS_fog_function - CONST_CAST(GLEW_SGIS_fog_function) = glewGetExtension("GL_SGIS_fog_function"); - if (glewExperimental || GLEW_SGIS_fog_function) CONST_CAST(GLEW_SGIS_fog_function) = !_glewInit_GL_SGIS_fog_function(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_SGIS_fog_function) GLEW_SGIS_fog_function = !_glewInit_GL_SGIS_fog_function(); #endif /* GL_SGIS_fog_function */ -#ifdef GL_SGIS_generate_mipmap - CONST_CAST(GLEW_SGIS_generate_mipmap) = glewGetExtension("GL_SGIS_generate_mipmap"); -#endif /* GL_SGIS_generate_mipmap */ #ifdef GL_SGIS_multisample - CONST_CAST(GLEW_SGIS_multisample) = glewGetExtension("GL_SGIS_multisample"); - if (glewExperimental || GLEW_SGIS_multisample) CONST_CAST(GLEW_SGIS_multisample) = !_glewInit_GL_SGIS_multisample(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_SGIS_multisample) GLEW_SGIS_multisample = !_glewInit_GL_SGIS_multisample(); #endif /* GL_SGIS_multisample */ -#ifdef GL_SGIS_pixel_texture - CONST_CAST(GLEW_SGIS_pixel_texture) = glewGetExtension("GL_SGIS_pixel_texture"); -#endif /* GL_SGIS_pixel_texture */ +#ifdef GL_SGIS_multitexture + if (glewExperimental || GLEW_SGIS_multitexture) GLEW_SGIS_multitexture = !_glewInit_GL_SGIS_multitexture(); +#endif /* GL_SGIS_multitexture */ +#ifdef GL_SGIS_shared_multisample + if (glewExperimental || GLEW_SGIS_shared_multisample) GLEW_SGIS_shared_multisample = !_glewInit_GL_SGIS_shared_multisample(); +#endif /* GL_SGIS_shared_multisample */ #ifdef GL_SGIS_sharpen_texture - CONST_CAST(GLEW_SGIS_sharpen_texture) = glewGetExtension("GL_SGIS_sharpen_texture"); - if (glewExperimental || GLEW_SGIS_sharpen_texture) CONST_CAST(GLEW_SGIS_sharpen_texture) = !_glewInit_GL_SGIS_sharpen_texture(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_SGIS_sharpen_texture) GLEW_SGIS_sharpen_texture = !_glewInit_GL_SGIS_sharpen_texture(); #endif /* GL_SGIS_sharpen_texture */ #ifdef GL_SGIS_texture4D - CONST_CAST(GLEW_SGIS_texture4D) = glewGetExtension("GL_SGIS_texture4D"); - if (glewExperimental || GLEW_SGIS_texture4D) CONST_CAST(GLEW_SGIS_texture4D) = !_glewInit_GL_SGIS_texture4D(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_SGIS_texture4D) GLEW_SGIS_texture4D = !_glewInit_GL_SGIS_texture4D(); #endif /* GL_SGIS_texture4D */ -#ifdef GL_SGIS_texture_border_clamp - CONST_CAST(GLEW_SGIS_texture_border_clamp) = glewGetExtension("GL_SGIS_texture_border_clamp"); -#endif /* GL_SGIS_texture_border_clamp */ -#ifdef GL_SGIS_texture_edge_clamp - CONST_CAST(GLEW_SGIS_texture_edge_clamp) = glewGetExtension("GL_SGIS_texture_edge_clamp"); -#endif /* GL_SGIS_texture_edge_clamp */ #ifdef GL_SGIS_texture_filter4 - CONST_CAST(GLEW_SGIS_texture_filter4) = glewGetExtension("GL_SGIS_texture_filter4"); - if (glewExperimental || GLEW_SGIS_texture_filter4) CONST_CAST(GLEW_SGIS_texture_filter4) = !_glewInit_GL_SGIS_texture_filter4(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_SGIS_texture_filter4) GLEW_SGIS_texture_filter4 = !_glewInit_GL_SGIS_texture_filter4(); #endif /* GL_SGIS_texture_filter4 */ -#ifdef GL_SGIS_texture_lod - CONST_CAST(GLEW_SGIS_texture_lod) = glewGetExtension("GL_SGIS_texture_lod"); -#endif /* GL_SGIS_texture_lod */ -#ifdef GL_SGIS_texture_select - CONST_CAST(GLEW_SGIS_texture_select) = glewGetExtension("GL_SGIS_texture_select"); -#endif /* GL_SGIS_texture_select */ #ifdef GL_SGIX_async - CONST_CAST(GLEW_SGIX_async) = glewGetExtension("GL_SGIX_async"); - if (glewExperimental || GLEW_SGIX_async) CONST_CAST(GLEW_SGIX_async) = !_glewInit_GL_SGIX_async(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_SGIX_async) GLEW_SGIX_async = !_glewInit_GL_SGIX_async(); #endif /* GL_SGIX_async */ -#ifdef GL_SGIX_async_histogram - CONST_CAST(GLEW_SGIX_async_histogram) = glewGetExtension("GL_SGIX_async_histogram"); -#endif /* GL_SGIX_async_histogram */ -#ifdef GL_SGIX_async_pixel - CONST_CAST(GLEW_SGIX_async_pixel) = glewGetExtension("GL_SGIX_async_pixel"); -#endif /* GL_SGIX_async_pixel */ -#ifdef GL_SGIX_blend_alpha_minmax - CONST_CAST(GLEW_SGIX_blend_alpha_minmax) = glewGetExtension("GL_SGIX_blend_alpha_minmax"); -#endif /* GL_SGIX_blend_alpha_minmax */ -#ifdef GL_SGIX_clipmap - CONST_CAST(GLEW_SGIX_clipmap) = glewGetExtension("GL_SGIX_clipmap"); -#endif /* GL_SGIX_clipmap */ -#ifdef GL_SGIX_depth_texture - CONST_CAST(GLEW_SGIX_depth_texture) = glewGetExtension("GL_SGIX_depth_texture"); -#endif /* GL_SGIX_depth_texture */ +#ifdef GL_SGIX_datapipe + if (glewExperimental || GLEW_SGIX_datapipe) GLEW_SGIX_datapipe = !_glewInit_GL_SGIX_datapipe(); +#endif /* GL_SGIX_datapipe */ #ifdef GL_SGIX_flush_raster - CONST_CAST(GLEW_SGIX_flush_raster) = glewGetExtension("GL_SGIX_flush_raster"); - if (glewExperimental || GLEW_SGIX_flush_raster) CONST_CAST(GLEW_SGIX_flush_raster) = !_glewInit_GL_SGIX_flush_raster(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_SGIX_flush_raster) GLEW_SGIX_flush_raster = !_glewInit_GL_SGIX_flush_raster(); #endif /* GL_SGIX_flush_raster */ -#ifdef GL_SGIX_fog_offset - CONST_CAST(GLEW_SGIX_fog_offset) = glewGetExtension("GL_SGIX_fog_offset"); -#endif /* GL_SGIX_fog_offset */ +#ifdef GL_SGIX_fog_layers + if (glewExperimental || GLEW_SGIX_fog_layers) GLEW_SGIX_fog_layers = !_glewInit_GL_SGIX_fog_layers(); +#endif /* GL_SGIX_fog_layers */ #ifdef GL_SGIX_fog_texture - CONST_CAST(GLEW_SGIX_fog_texture) = glewGetExtension("GL_SGIX_fog_texture"); - if (glewExperimental || GLEW_SGIX_fog_texture) CONST_CAST(GLEW_SGIX_fog_texture) = !_glewInit_GL_SGIX_fog_texture(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_SGIX_fog_texture) GLEW_SGIX_fog_texture = !_glewInit_GL_SGIX_fog_texture(); #endif /* GL_SGIX_fog_texture */ #ifdef GL_SGIX_fragment_specular_lighting - CONST_CAST(GLEW_SGIX_fragment_specular_lighting) = glewGetExtension("GL_SGIX_fragment_specular_lighting"); - if (glewExperimental || GLEW_SGIX_fragment_specular_lighting) CONST_CAST(GLEW_SGIX_fragment_specular_lighting) = !_glewInit_GL_SGIX_fragment_specular_lighting(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_SGIX_fragment_specular_lighting) GLEW_SGIX_fragment_specular_lighting = !_glewInit_GL_SGIX_fragment_specular_lighting(); #endif /* GL_SGIX_fragment_specular_lighting */ #ifdef GL_SGIX_framezoom - CONST_CAST(GLEW_SGIX_framezoom) = glewGetExtension("GL_SGIX_framezoom"); - if (glewExperimental || GLEW_SGIX_framezoom) CONST_CAST(GLEW_SGIX_framezoom) = !_glewInit_GL_SGIX_framezoom(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_SGIX_framezoom) GLEW_SGIX_framezoom = !_glewInit_GL_SGIX_framezoom(); #endif /* GL_SGIX_framezoom */ -#ifdef GL_SGIX_interlace - CONST_CAST(GLEW_SGIX_interlace) = glewGetExtension("GL_SGIX_interlace"); -#endif /* GL_SGIX_interlace */ -#ifdef GL_SGIX_ir_instrument1 - CONST_CAST(GLEW_SGIX_ir_instrument1) = glewGetExtension("GL_SGIX_ir_instrument1"); -#endif /* GL_SGIX_ir_instrument1 */ -#ifdef GL_SGIX_list_priority - CONST_CAST(GLEW_SGIX_list_priority) = glewGetExtension("GL_SGIX_list_priority"); -#endif /* GL_SGIX_list_priority */ +#ifdef GL_SGIX_igloo_interface + if (glewExperimental || GLEW_SGIX_igloo_interface) GLEW_SGIX_igloo_interface = !_glewInit_GL_SGIX_igloo_interface(); +#endif /* GL_SGIX_igloo_interface */ +#ifdef GL_SGIX_mpeg1 + if (glewExperimental || GLEW_SGIX_mpeg1) GLEW_SGIX_mpeg1 = !_glewInit_GL_SGIX_mpeg1(); +#endif /* GL_SGIX_mpeg1 */ +#ifdef GL_SGIX_nonlinear_lighting_pervertex + if (glewExperimental || GLEW_SGIX_nonlinear_lighting_pervertex) GLEW_SGIX_nonlinear_lighting_pervertex = !_glewInit_GL_SGIX_nonlinear_lighting_pervertex(); +#endif /* GL_SGIX_nonlinear_lighting_pervertex */ #ifdef GL_SGIX_pixel_texture - CONST_CAST(GLEW_SGIX_pixel_texture) = glewGetExtension("GL_SGIX_pixel_texture"); - if (glewExperimental || GLEW_SGIX_pixel_texture) CONST_CAST(GLEW_SGIX_pixel_texture) = !_glewInit_GL_SGIX_pixel_texture(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_SGIX_pixel_texture) GLEW_SGIX_pixel_texture = !_glewInit_GL_SGIX_pixel_texture(); #endif /* GL_SGIX_pixel_texture */ -#ifdef GL_SGIX_pixel_texture_bits - CONST_CAST(GLEW_SGIX_pixel_texture_bits) = glewGetExtension("GL_SGIX_pixel_texture_bits"); -#endif /* GL_SGIX_pixel_texture_bits */ +#ifdef GL_SGIX_polynomial_ffd + if (glewExperimental || GLEW_SGIX_polynomial_ffd) GLEW_SGIX_polynomial_ffd = !_glewInit_GL_SGIX_polynomial_ffd(); +#endif /* GL_SGIX_polynomial_ffd */ +#ifdef GL_SGIX_quad_mesh + if (glewExperimental || GLEW_SGIX_quad_mesh) GLEW_SGIX_quad_mesh = !_glewInit_GL_SGIX_quad_mesh(); +#endif /* GL_SGIX_quad_mesh */ #ifdef GL_SGIX_reference_plane - CONST_CAST(GLEW_SGIX_reference_plane) = glewGetExtension("GL_SGIX_reference_plane"); - if (glewExperimental || GLEW_SGIX_reference_plane) CONST_CAST(GLEW_SGIX_reference_plane) = !_glewInit_GL_SGIX_reference_plane(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_SGIX_reference_plane) GLEW_SGIX_reference_plane = !_glewInit_GL_SGIX_reference_plane(); #endif /* GL_SGIX_reference_plane */ -#ifdef GL_SGIX_resample - CONST_CAST(GLEW_SGIX_resample) = glewGetExtension("GL_SGIX_resample"); -#endif /* GL_SGIX_resample */ -#ifdef GL_SGIX_shadow - CONST_CAST(GLEW_SGIX_shadow) = glewGetExtension("GL_SGIX_shadow"); -#endif /* GL_SGIX_shadow */ -#ifdef GL_SGIX_shadow_ambient - CONST_CAST(GLEW_SGIX_shadow_ambient) = glewGetExtension("GL_SGIX_shadow_ambient"); -#endif /* GL_SGIX_shadow_ambient */ #ifdef GL_SGIX_sprite - CONST_CAST(GLEW_SGIX_sprite) = glewGetExtension("GL_SGIX_sprite"); - if (glewExperimental || GLEW_SGIX_sprite) CONST_CAST(GLEW_SGIX_sprite) = !_glewInit_GL_SGIX_sprite(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_SGIX_sprite) GLEW_SGIX_sprite = !_glewInit_GL_SGIX_sprite(); #endif /* GL_SGIX_sprite */ #ifdef GL_SGIX_tag_sample_buffer - CONST_CAST(GLEW_SGIX_tag_sample_buffer) = glewGetExtension("GL_SGIX_tag_sample_buffer"); - if (glewExperimental || GLEW_SGIX_tag_sample_buffer) CONST_CAST(GLEW_SGIX_tag_sample_buffer) = !_glewInit_GL_SGIX_tag_sample_buffer(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_SGIX_tag_sample_buffer) GLEW_SGIX_tag_sample_buffer = !_glewInit_GL_SGIX_tag_sample_buffer(); #endif /* GL_SGIX_tag_sample_buffer */ -#ifdef GL_SGIX_texture_add_env - CONST_CAST(GLEW_SGIX_texture_add_env) = glewGetExtension("GL_SGIX_texture_add_env"); -#endif /* GL_SGIX_texture_add_env */ -#ifdef GL_SGIX_texture_coordinate_clamp - CONST_CAST(GLEW_SGIX_texture_coordinate_clamp) = glewGetExtension("GL_SGIX_texture_coordinate_clamp"); -#endif /* GL_SGIX_texture_coordinate_clamp */ -#ifdef GL_SGIX_texture_lod_bias - CONST_CAST(GLEW_SGIX_texture_lod_bias) = glewGetExtension("GL_SGIX_texture_lod_bias"); -#endif /* GL_SGIX_texture_lod_bias */ -#ifdef GL_SGIX_texture_multi_buffer - CONST_CAST(GLEW_SGIX_texture_multi_buffer) = glewGetExtension("GL_SGIX_texture_multi_buffer"); -#endif /* GL_SGIX_texture_multi_buffer */ -#ifdef GL_SGIX_texture_range - CONST_CAST(GLEW_SGIX_texture_range) = glewGetExtension("GL_SGIX_texture_range"); -#endif /* GL_SGIX_texture_range */ -#ifdef GL_SGIX_texture_scale_bias - CONST_CAST(GLEW_SGIX_texture_scale_bias) = glewGetExtension("GL_SGIX_texture_scale_bias"); -#endif /* GL_SGIX_texture_scale_bias */ -#ifdef GL_SGIX_vertex_preclip - CONST_CAST(GLEW_SGIX_vertex_preclip) = glewGetExtension("GL_SGIX_vertex_preclip"); -#endif /* GL_SGIX_vertex_preclip */ -#ifdef GL_SGIX_vertex_preclip_hint - CONST_CAST(GLEW_SGIX_vertex_preclip_hint) = glewGetExtension("GL_SGIX_vertex_preclip_hint"); -#endif /* GL_SGIX_vertex_preclip_hint */ -#ifdef GL_SGIX_ycrcb - CONST_CAST(GLEW_SGIX_ycrcb) = glewGetExtension("GL_SGIX_ycrcb"); -#endif /* GL_SGIX_ycrcb */ -#ifdef GL_SGI_color_matrix - CONST_CAST(GLEW_SGI_color_matrix) = glewGetExtension("GL_SGI_color_matrix"); -#endif /* GL_SGI_color_matrix */ +#ifdef GL_SGIX_vector_ops + if (glewExperimental || GLEW_SGIX_vector_ops) GLEW_SGIX_vector_ops = !_glewInit_GL_SGIX_vector_ops(); +#endif /* GL_SGIX_vector_ops */ +#ifdef GL_SGIX_vertex_array_object + if (glewExperimental || GLEW_SGIX_vertex_array_object) GLEW_SGIX_vertex_array_object = !_glewInit_GL_SGIX_vertex_array_object(); +#endif /* GL_SGIX_vertex_array_object */ #ifdef GL_SGI_color_table - CONST_CAST(GLEW_SGI_color_table) = glewGetExtension("GL_SGI_color_table"); - if (glewExperimental || GLEW_SGI_color_table) CONST_CAST(GLEW_SGI_color_table) = !_glewInit_GL_SGI_color_table(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_SGI_color_table) GLEW_SGI_color_table = !_glewInit_GL_SGI_color_table(); #endif /* GL_SGI_color_table */ -#ifdef GL_SGI_texture_color_table - CONST_CAST(GLEW_SGI_texture_color_table) = glewGetExtension("GL_SGI_texture_color_table"); -#endif /* GL_SGI_texture_color_table */ +#ifdef GL_SGI_fft + if (glewExperimental || GLEW_SGI_fft) GLEW_SGI_fft = !_glewInit_GL_SGI_fft(); +#endif /* GL_SGI_fft */ #ifdef GL_SUNX_constant_data - CONST_CAST(GLEW_SUNX_constant_data) = glewGetExtension("GL_SUNX_constant_data"); - if (glewExperimental || GLEW_SUNX_constant_data) CONST_CAST(GLEW_SUNX_constant_data) = !_glewInit_GL_SUNX_constant_data(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_SUNX_constant_data) GLEW_SUNX_constant_data = !_glewInit_GL_SUNX_constant_data(); #endif /* GL_SUNX_constant_data */ -#ifdef GL_SUN_convolution_border_modes - CONST_CAST(GLEW_SUN_convolution_border_modes) = glewGetExtension("GL_SUN_convolution_border_modes"); -#endif /* GL_SUN_convolution_border_modes */ #ifdef GL_SUN_global_alpha - CONST_CAST(GLEW_SUN_global_alpha) = glewGetExtension("GL_SUN_global_alpha"); - if (glewExperimental || GLEW_SUN_global_alpha) CONST_CAST(GLEW_SUN_global_alpha) = !_glewInit_GL_SUN_global_alpha(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_SUN_global_alpha) GLEW_SUN_global_alpha = !_glewInit_GL_SUN_global_alpha(); #endif /* GL_SUN_global_alpha */ -#ifdef GL_SUN_mesh_array - CONST_CAST(GLEW_SUN_mesh_array) = glewGetExtension("GL_SUN_mesh_array"); -#endif /* GL_SUN_mesh_array */ #ifdef GL_SUN_read_video_pixels - CONST_CAST(GLEW_SUN_read_video_pixels) = glewGetExtension("GL_SUN_read_video_pixels"); - if (glewExperimental || GLEW_SUN_read_video_pixels) CONST_CAST(GLEW_SUN_read_video_pixels) = !_glewInit_GL_SUN_read_video_pixels(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_SUN_read_video_pixels) GLEW_SUN_read_video_pixels = !_glewInit_GL_SUN_read_video_pixels(); #endif /* GL_SUN_read_video_pixels */ -#ifdef GL_SUN_slice_accum - CONST_CAST(GLEW_SUN_slice_accum) = glewGetExtension("GL_SUN_slice_accum"); -#endif /* GL_SUN_slice_accum */ #ifdef GL_SUN_triangle_list - CONST_CAST(GLEW_SUN_triangle_list) = glewGetExtension("GL_SUN_triangle_list"); - if (glewExperimental || GLEW_SUN_triangle_list) CONST_CAST(GLEW_SUN_triangle_list) = !_glewInit_GL_SUN_triangle_list(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_SUN_triangle_list) GLEW_SUN_triangle_list = !_glewInit_GL_SUN_triangle_list(); #endif /* GL_SUN_triangle_list */ #ifdef GL_SUN_vertex - CONST_CAST(GLEW_SUN_vertex) = glewGetExtension("GL_SUN_vertex"); - if (glewExperimental || GLEW_SUN_vertex) CONST_CAST(GLEW_SUN_vertex) = !_glewInit_GL_SUN_vertex(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_SUN_vertex) GLEW_SUN_vertex = !_glewInit_GL_SUN_vertex(); #endif /* GL_SUN_vertex */ -#ifdef GL_WIN_phong_shading - CONST_CAST(GLEW_WIN_phong_shading) = glewGetExtension("GL_WIN_phong_shading"); -#endif /* GL_WIN_phong_shading */ -#ifdef GL_WIN_specular_fog - CONST_CAST(GLEW_WIN_specular_fog) = glewGetExtension("GL_WIN_specular_fog"); -#endif /* GL_WIN_specular_fog */ #ifdef GL_WIN_swap_hint - CONST_CAST(GLEW_WIN_swap_hint) = glewGetExtension("GL_WIN_swap_hint"); - if (glewExperimental || GLEW_WIN_swap_hint) CONST_CAST(GLEW_WIN_swap_hint) = !_glewInit_GL_WIN_swap_hint(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLEW_WIN_swap_hint) GLEW_WIN_swap_hint = !_glewInit_GL_WIN_swap_hint(); #endif /* GL_WIN_swap_hint */ +#ifdef GL_NV_fragment_program4 + GLEW_NV_fragment_program4 = GLEW_NV_gpu_program4; +#endif /* GL_NV_fragment_program4 */ +#ifdef GL_NV_geometry_program4 + GLEW_NV_geometry_program4 = GLEW_NV_gpu_program4; +#endif /* GL_NV_geometry_program4 */ +#ifdef GL_NV_tessellation_program5 + GLEW_NV_tessellation_program5 = GLEW_NV_gpu_program5; +#endif /* GL_NV_tessellation_program5 */ +#ifdef GL_NV_vertex_program4 + GLEW_NV_vertex_program4 = GLEW_NV_gpu_program4; +#endif /* GL_NV_vertex_program4 */ return GLEW_OK; } -#if defined(_WIN32) +#if defined(GLEW_OSMESA) -#if !defined(GLEW_MX) +#elif defined(GLEW_EGL) + +PFNEGLCHOOSECONFIGPROC __eglewChooseConfig = NULL; +PFNEGLCOPYBUFFERSPROC __eglewCopyBuffers = NULL; +PFNEGLCREATECONTEXTPROC __eglewCreateContext = NULL; +PFNEGLCREATEPBUFFERSURFACEPROC __eglewCreatePbufferSurface = NULL; +PFNEGLCREATEPIXMAPSURFACEPROC __eglewCreatePixmapSurface = NULL; +PFNEGLCREATEWINDOWSURFACEPROC __eglewCreateWindowSurface = NULL; +PFNEGLDESTROYCONTEXTPROC __eglewDestroyContext = NULL; +PFNEGLDESTROYSURFACEPROC __eglewDestroySurface = NULL; +PFNEGLGETCONFIGATTRIBPROC __eglewGetConfigAttrib = NULL; +PFNEGLGETCONFIGSPROC __eglewGetConfigs = NULL; +PFNEGLGETCURRENTDISPLAYPROC __eglewGetCurrentDisplay = NULL; +PFNEGLGETCURRENTSURFACEPROC __eglewGetCurrentSurface = NULL; +PFNEGLGETDISPLAYPROC __eglewGetDisplay = NULL; +PFNEGLGETERRORPROC __eglewGetError = NULL; +PFNEGLINITIALIZEPROC __eglewInitialize = NULL; +PFNEGLMAKECURRENTPROC __eglewMakeCurrent = NULL; +PFNEGLQUERYCONTEXTPROC __eglewQueryContext = NULL; +PFNEGLQUERYSTRINGPROC __eglewQueryString = NULL; +PFNEGLQUERYSURFACEPROC __eglewQuerySurface = NULL; +PFNEGLSWAPBUFFERSPROC __eglewSwapBuffers = NULL; +PFNEGLTERMINATEPROC __eglewTerminate = NULL; +PFNEGLWAITGLPROC __eglewWaitGL = NULL; +PFNEGLWAITNATIVEPROC __eglewWaitNative = NULL; + +PFNEGLBINDTEXIMAGEPROC __eglewBindTexImage = NULL; +PFNEGLRELEASETEXIMAGEPROC __eglewReleaseTexImage = NULL; +PFNEGLSURFACEATTRIBPROC __eglewSurfaceAttrib = NULL; +PFNEGLSWAPINTERVALPROC __eglewSwapInterval = NULL; + +PFNEGLBINDAPIPROC __eglewBindAPI = NULL; +PFNEGLCREATEPBUFFERFROMCLIENTBUFFERPROC __eglewCreatePbufferFromClientBuffer = NULL; +PFNEGLQUERYAPIPROC __eglewQueryAPI = NULL; +PFNEGLRELEASETHREADPROC __eglewReleaseThread = NULL; +PFNEGLWAITCLIENTPROC __eglewWaitClient = NULL; + +PFNEGLGETCURRENTCONTEXTPROC __eglewGetCurrentContext = NULL; + +PFNEGLCLIENTWAITSYNCPROC __eglewClientWaitSync = NULL; +PFNEGLCREATEIMAGEPROC __eglewCreateImage = NULL; +PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC __eglewCreatePlatformPixmapSurface = NULL; +PFNEGLCREATEPLATFORMWINDOWSURFACEPROC __eglewCreatePlatformWindowSurface = NULL; +PFNEGLCREATESYNCPROC __eglewCreateSync = NULL; +PFNEGLDESTROYIMAGEPROC __eglewDestroyImage = NULL; +PFNEGLDESTROYSYNCPROC __eglewDestroySync = NULL; +PFNEGLGETPLATFORMDISPLAYPROC __eglewGetPlatformDisplay = NULL; +PFNEGLGETSYNCATTRIBPROC __eglewGetSyncAttrib = NULL; +PFNEGLWAITSYNCPROC __eglewWaitSync = NULL; + +PFNEGLSETBLOBCACHEFUNCSANDROIDPROC __eglewSetBlobCacheFuncsANDROID = NULL; + +PFNEGLCREATENATIVECLIENTBUFFERANDROIDPROC __eglewCreateNativeClientBufferANDROID = NULL; + +PFNEGLDUPNATIVEFENCEFDANDROIDPROC __eglewDupNativeFenceFDANDROID = NULL; + +PFNEGLPRESENTATIONTIMEANDROIDPROC __eglewPresentationTimeANDROID = NULL; + +PFNEGLQUERYSURFACEPOINTERANGLEPROC __eglewQuerySurfacePointerANGLE = NULL; + +PFNEGLQUERYDEVICESEXTPROC __eglewQueryDevicesEXT = NULL; + +PFNEGLQUERYDEVICEATTRIBEXTPROC __eglewQueryDeviceAttribEXT = NULL; +PFNEGLQUERYDEVICESTRINGEXTPROC __eglewQueryDeviceStringEXT = NULL; +PFNEGLQUERYDISPLAYATTRIBEXTPROC __eglewQueryDisplayAttribEXT = NULL; + +PFNEGLQUERYDMABUFFORMATSEXTPROC __eglewQueryDmaBufFormatsEXT = NULL; +PFNEGLQUERYDMABUFMODIFIERSEXTPROC __eglewQueryDmaBufModifiersEXT = NULL; + +PFNEGLGETOUTPUTLAYERSEXTPROC __eglewGetOutputLayersEXT = NULL; +PFNEGLGETOUTPUTPORTSEXTPROC __eglewGetOutputPortsEXT = NULL; +PFNEGLOUTPUTLAYERATTRIBEXTPROC __eglewOutputLayerAttribEXT = NULL; +PFNEGLOUTPUTPORTATTRIBEXTPROC __eglewOutputPortAttribEXT = NULL; +PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC __eglewQueryOutputLayerAttribEXT = NULL; +PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC __eglewQueryOutputLayerStringEXT = NULL; +PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC __eglewQueryOutputPortAttribEXT = NULL; +PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC __eglewQueryOutputPortStringEXT = NULL; + +PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC __eglewCreatePlatformPixmapSurfaceEXT = NULL; +PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC __eglewCreatePlatformWindowSurfaceEXT = NULL; +PFNEGLGETPLATFORMDISPLAYEXTPROC __eglewGetPlatformDisplayEXT = NULL; + +PFNEGLSTREAMCONSUMEROUTPUTEXTPROC __eglewStreamConsumerOutputEXT = NULL; + +PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC __eglewSwapBuffersWithDamageEXT = NULL; + +PFNEGLCREATEPIXMAPSURFACEHIPROC __eglewCreatePixmapSurfaceHI = NULL; + +PFNEGLCREATESYNC64KHRPROC __eglewCreateSync64KHR = NULL; + +PFNEGLDEBUGMESSAGECONTROLKHRPROC __eglewDebugMessageControlKHR = NULL; +PFNEGLLABELOBJECTKHRPROC __eglewLabelObjectKHR = NULL; +PFNEGLQUERYDEBUGKHRPROC __eglewQueryDebugKHR = NULL; + +PFNEGLCREATEIMAGEKHRPROC __eglewCreateImageKHR = NULL; +PFNEGLDESTROYIMAGEKHRPROC __eglewDestroyImageKHR = NULL; + +PFNEGLLOCKSURFACEKHRPROC __eglewLockSurfaceKHR = NULL; +PFNEGLUNLOCKSURFACEKHRPROC __eglewUnlockSurfaceKHR = NULL; + +PFNEGLQUERYSURFACE64KHRPROC __eglewQuerySurface64KHR = NULL; + +PFNEGLSETDAMAGEREGIONKHRPROC __eglewSetDamageRegionKHR = NULL; + +PFNEGLCLIENTWAITSYNCKHRPROC __eglewClientWaitSyncKHR = NULL; +PFNEGLCREATESYNCKHRPROC __eglewCreateSyncKHR = NULL; +PFNEGLDESTROYSYNCKHRPROC __eglewDestroySyncKHR = NULL; +PFNEGLGETSYNCATTRIBKHRPROC __eglewGetSyncAttribKHR = NULL; +PFNEGLSIGNALSYNCKHRPROC __eglewSignalSyncKHR = NULL; + +PFNEGLCREATESTREAMKHRPROC __eglewCreateStreamKHR = NULL; +PFNEGLDESTROYSTREAMKHRPROC __eglewDestroyStreamKHR = NULL; +PFNEGLQUERYSTREAMKHRPROC __eglewQueryStreamKHR = NULL; +PFNEGLQUERYSTREAMU64KHRPROC __eglewQueryStreamu64KHR = NULL; +PFNEGLSTREAMATTRIBKHRPROC __eglewStreamAttribKHR = NULL; + +PFNEGLCREATESTREAMATTRIBKHRPROC __eglewCreateStreamAttribKHR = NULL; +PFNEGLQUERYSTREAMATTRIBKHRPROC __eglewQueryStreamAttribKHR = NULL; +PFNEGLSETSTREAMATTRIBKHRPROC __eglewSetStreamAttribKHR = NULL; +PFNEGLSTREAMCONSUMERACQUIREATTRIBKHRPROC __eglewStreamConsumerAcquireAttribKHR = NULL; +PFNEGLSTREAMCONSUMERRELEASEATTRIBKHRPROC __eglewStreamConsumerReleaseAttribKHR = NULL; + +PFNEGLSTREAMCONSUMERACQUIREKHRPROC __eglewStreamConsumerAcquireKHR = NULL; +PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC __eglewStreamConsumerGLTextureExternalKHR = NULL; +PFNEGLSTREAMCONSUMERRELEASEKHRPROC __eglewStreamConsumerReleaseKHR = NULL; + +PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC __eglewCreateStreamFromFileDescriptorKHR = NULL; +PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC __eglewGetStreamFileDescriptorKHR = NULL; + +PFNEGLQUERYSTREAMTIMEKHRPROC __eglewQueryStreamTimeKHR = NULL; + +PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC __eglewCreateStreamProducerSurfaceKHR = NULL; + +PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC __eglewSwapBuffersWithDamageKHR = NULL; + +PFNEGLWAITSYNCKHRPROC __eglewWaitSyncKHR = NULL; + +PFNEGLCREATEDRMIMAGEMESAPROC __eglewCreateDRMImageMESA = NULL; +PFNEGLEXPORTDRMIMAGEMESAPROC __eglewExportDRMImageMESA = NULL; + +PFNEGLEXPORTDMABUFIMAGEMESAPROC __eglewExportDMABUFImageMESA = NULL; +PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC __eglewExportDMABUFImageQueryMESA = NULL; + +PFNEGLSWAPBUFFERSREGIONNOKPROC __eglewSwapBuffersRegionNOK = NULL; + +PFNEGLSWAPBUFFERSREGION2NOKPROC __eglewSwapBuffersRegion2NOK = NULL; + +PFNEGLQUERYNATIVEDISPLAYNVPROC __eglewQueryNativeDisplayNV = NULL; +PFNEGLQUERYNATIVEPIXMAPNVPROC __eglewQueryNativePixmapNV = NULL; +PFNEGLQUERYNATIVEWINDOWNVPROC __eglewQueryNativeWindowNV = NULL; + +PFNEGLPOSTSUBBUFFERNVPROC __eglewPostSubBufferNV = NULL; + +PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALATTRIBSNVPROC __eglewStreamConsumerGLTextureExternalAttribsNV = NULL; + +PFNEGLQUERYDISPLAYATTRIBNVPROC __eglewQueryDisplayAttribNV = NULL; +PFNEGLQUERYSTREAMMETADATANVPROC __eglewQueryStreamMetadataNV = NULL; +PFNEGLSETSTREAMMETADATANVPROC __eglewSetStreamMetadataNV = NULL; + +PFNEGLRESETSTREAMNVPROC __eglewResetStreamNV = NULL; + +PFNEGLCREATESTREAMSYNCNVPROC __eglewCreateStreamSyncNV = NULL; + +PFNEGLCLIENTWAITSYNCNVPROC __eglewClientWaitSyncNV = NULL; +PFNEGLCREATEFENCESYNCNVPROC __eglewCreateFenceSyncNV = NULL; +PFNEGLDESTROYSYNCNVPROC __eglewDestroySyncNV = NULL; +PFNEGLFENCENVPROC __eglewFenceNV = NULL; +PFNEGLGETSYNCATTRIBNVPROC __eglewGetSyncAttribNV = NULL; +PFNEGLSIGNALSYNCNVPROC __eglewSignalSyncNV = NULL; + +PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC __eglewGetSystemTimeFrequencyNV = NULL; +PFNEGLGETSYSTEMTIMENVPROC __eglewGetSystemTimeNV = NULL; +GLboolean __EGLEW_VERSION_1_0 = GL_FALSE; +GLboolean __EGLEW_VERSION_1_1 = GL_FALSE; +GLboolean __EGLEW_VERSION_1_2 = GL_FALSE; +GLboolean __EGLEW_VERSION_1_3 = GL_FALSE; +GLboolean __EGLEW_VERSION_1_4 = GL_FALSE; +GLboolean __EGLEW_VERSION_1_5 = GL_FALSE; +GLboolean __EGLEW_ANDROID_blob_cache = GL_FALSE; +GLboolean __EGLEW_ANDROID_create_native_client_buffer = GL_FALSE; +GLboolean __EGLEW_ANDROID_framebuffer_target = GL_FALSE; +GLboolean __EGLEW_ANDROID_front_buffer_auto_refresh = GL_FALSE; +GLboolean __EGLEW_ANDROID_image_native_buffer = GL_FALSE; +GLboolean __EGLEW_ANDROID_native_fence_sync = GL_FALSE; +GLboolean __EGLEW_ANDROID_presentation_time = GL_FALSE; +GLboolean __EGLEW_ANDROID_recordable = GL_FALSE; +GLboolean __EGLEW_ANGLE_d3d_share_handle_client_buffer = GL_FALSE; +GLboolean __EGLEW_ANGLE_device_d3d = GL_FALSE; +GLboolean __EGLEW_ANGLE_query_surface_pointer = GL_FALSE; +GLboolean __EGLEW_ANGLE_surface_d3d_texture_2d_share_handle = GL_FALSE; +GLboolean __EGLEW_ANGLE_window_fixed_size = GL_FALSE; +GLboolean __EGLEW_ARM_implicit_external_sync = GL_FALSE; +GLboolean __EGLEW_ARM_pixmap_multisample_discard = GL_FALSE; +GLboolean __EGLEW_EXT_buffer_age = GL_FALSE; +GLboolean __EGLEW_EXT_client_extensions = GL_FALSE; +GLboolean __EGLEW_EXT_create_context_robustness = GL_FALSE; +GLboolean __EGLEW_EXT_device_base = GL_FALSE; +GLboolean __EGLEW_EXT_device_drm = GL_FALSE; +GLboolean __EGLEW_EXT_device_enumeration = GL_FALSE; +GLboolean __EGLEW_EXT_device_openwf = GL_FALSE; +GLboolean __EGLEW_EXT_device_query = GL_FALSE; +GLboolean __EGLEW_EXT_gl_colorspace_bt2020_linear = GL_FALSE; +GLboolean __EGLEW_EXT_gl_colorspace_bt2020_pq = GL_FALSE; +GLboolean __EGLEW_EXT_gl_colorspace_scrgb_linear = GL_FALSE; +GLboolean __EGLEW_EXT_image_dma_buf_import = GL_FALSE; +GLboolean __EGLEW_EXT_image_dma_buf_import_modifiers = GL_FALSE; +GLboolean __EGLEW_EXT_multiview_window = GL_FALSE; +GLboolean __EGLEW_EXT_output_base = GL_FALSE; +GLboolean __EGLEW_EXT_output_drm = GL_FALSE; +GLboolean __EGLEW_EXT_output_openwf = GL_FALSE; +GLboolean __EGLEW_EXT_pixel_format_float = GL_FALSE; +GLboolean __EGLEW_EXT_platform_base = GL_FALSE; +GLboolean __EGLEW_EXT_platform_device = GL_FALSE; +GLboolean __EGLEW_EXT_platform_wayland = GL_FALSE; +GLboolean __EGLEW_EXT_platform_x11 = GL_FALSE; +GLboolean __EGLEW_EXT_protected_content = GL_FALSE; +GLboolean __EGLEW_EXT_protected_surface = GL_FALSE; +GLboolean __EGLEW_EXT_stream_consumer_egloutput = GL_FALSE; +GLboolean __EGLEW_EXT_surface_SMPTE2086_metadata = GL_FALSE; +GLboolean __EGLEW_EXT_swap_buffers_with_damage = GL_FALSE; +GLboolean __EGLEW_EXT_yuv_surface = GL_FALSE; +GLboolean __EGLEW_HI_clientpixmap = GL_FALSE; +GLboolean __EGLEW_HI_colorformats = GL_FALSE; +GLboolean __EGLEW_IMG_context_priority = GL_FALSE; +GLboolean __EGLEW_IMG_image_plane_attribs = GL_FALSE; +GLboolean __EGLEW_KHR_cl_event = GL_FALSE; +GLboolean __EGLEW_KHR_cl_event2 = GL_FALSE; +GLboolean __EGLEW_KHR_client_get_all_proc_addresses = GL_FALSE; +GLboolean __EGLEW_KHR_config_attribs = GL_FALSE; +GLboolean __EGLEW_KHR_context_flush_control = GL_FALSE; +GLboolean __EGLEW_KHR_create_context = GL_FALSE; +GLboolean __EGLEW_KHR_create_context_no_error = GL_FALSE; +GLboolean __EGLEW_KHR_debug = GL_FALSE; +GLboolean __EGLEW_KHR_fence_sync = GL_FALSE; +GLboolean __EGLEW_KHR_get_all_proc_addresses = GL_FALSE; +GLboolean __EGLEW_KHR_gl_colorspace = GL_FALSE; +GLboolean __EGLEW_KHR_gl_renderbuffer_image = GL_FALSE; +GLboolean __EGLEW_KHR_gl_texture_2D_image = GL_FALSE; +GLboolean __EGLEW_KHR_gl_texture_3D_image = GL_FALSE; +GLboolean __EGLEW_KHR_gl_texture_cubemap_image = GL_FALSE; +GLboolean __EGLEW_KHR_image = GL_FALSE; +GLboolean __EGLEW_KHR_image_base = GL_FALSE; +GLboolean __EGLEW_KHR_image_pixmap = GL_FALSE; +GLboolean __EGLEW_KHR_lock_surface = GL_FALSE; +GLboolean __EGLEW_KHR_lock_surface2 = GL_FALSE; +GLboolean __EGLEW_KHR_lock_surface3 = GL_FALSE; +GLboolean __EGLEW_KHR_mutable_render_buffer = GL_FALSE; +GLboolean __EGLEW_KHR_no_config_context = GL_FALSE; +GLboolean __EGLEW_KHR_partial_update = GL_FALSE; +GLboolean __EGLEW_KHR_platform_android = GL_FALSE; +GLboolean __EGLEW_KHR_platform_gbm = GL_FALSE; +GLboolean __EGLEW_KHR_platform_wayland = GL_FALSE; +GLboolean __EGLEW_KHR_platform_x11 = GL_FALSE; +GLboolean __EGLEW_KHR_reusable_sync = GL_FALSE; +GLboolean __EGLEW_KHR_stream = GL_FALSE; +GLboolean __EGLEW_KHR_stream_attrib = GL_FALSE; +GLboolean __EGLEW_KHR_stream_consumer_gltexture = GL_FALSE; +GLboolean __EGLEW_KHR_stream_cross_process_fd = GL_FALSE; +GLboolean __EGLEW_KHR_stream_fifo = GL_FALSE; +GLboolean __EGLEW_KHR_stream_producer_aldatalocator = GL_FALSE; +GLboolean __EGLEW_KHR_stream_producer_eglsurface = GL_FALSE; +GLboolean __EGLEW_KHR_surfaceless_context = GL_FALSE; +GLboolean __EGLEW_KHR_swap_buffers_with_damage = GL_FALSE; +GLboolean __EGLEW_KHR_vg_parent_image = GL_FALSE; +GLboolean __EGLEW_KHR_wait_sync = GL_FALSE; +GLboolean __EGLEW_MESA_drm_image = GL_FALSE; +GLboolean __EGLEW_MESA_image_dma_buf_export = GL_FALSE; +GLboolean __EGLEW_MESA_platform_gbm = GL_FALSE; +GLboolean __EGLEW_MESA_platform_surfaceless = GL_FALSE; +GLboolean __EGLEW_NOK_swap_region = GL_FALSE; +GLboolean __EGLEW_NOK_swap_region2 = GL_FALSE; +GLboolean __EGLEW_NOK_texture_from_pixmap = GL_FALSE; +GLboolean __EGLEW_NV_3dvision_surface = GL_FALSE; +GLboolean __EGLEW_NV_coverage_sample = GL_FALSE; +GLboolean __EGLEW_NV_coverage_sample_resolve = GL_FALSE; +GLboolean __EGLEW_NV_cuda_event = GL_FALSE; +GLboolean __EGLEW_NV_depth_nonlinear = GL_FALSE; +GLboolean __EGLEW_NV_device_cuda = GL_FALSE; +GLboolean __EGLEW_NV_native_query = GL_FALSE; +GLboolean __EGLEW_NV_post_convert_rounding = GL_FALSE; +GLboolean __EGLEW_NV_post_sub_buffer = GL_FALSE; +GLboolean __EGLEW_NV_robustness_video_memory_purge = GL_FALSE; +GLboolean __EGLEW_NV_stream_consumer_gltexture_yuv = GL_FALSE; +GLboolean __EGLEW_NV_stream_cross_display = GL_FALSE; +GLboolean __EGLEW_NV_stream_cross_object = GL_FALSE; +GLboolean __EGLEW_NV_stream_cross_partition = GL_FALSE; +GLboolean __EGLEW_NV_stream_cross_process = GL_FALSE; +GLboolean __EGLEW_NV_stream_cross_system = GL_FALSE; +GLboolean __EGLEW_NV_stream_fifo_next = GL_FALSE; +GLboolean __EGLEW_NV_stream_fifo_synchronous = GL_FALSE; +GLboolean __EGLEW_NV_stream_frame_limits = GL_FALSE; +GLboolean __EGLEW_NV_stream_metadata = GL_FALSE; +GLboolean __EGLEW_NV_stream_remote = GL_FALSE; +GLboolean __EGLEW_NV_stream_reset = GL_FALSE; +GLboolean __EGLEW_NV_stream_socket = GL_FALSE; +GLboolean __EGLEW_NV_stream_socket_inet = GL_FALSE; +GLboolean __EGLEW_NV_stream_socket_unix = GL_FALSE; +GLboolean __EGLEW_NV_stream_sync = GL_FALSE; +GLboolean __EGLEW_NV_sync = GL_FALSE; +GLboolean __EGLEW_NV_system_time = GL_FALSE; +GLboolean __EGLEW_TIZEN_image_native_buffer = GL_FALSE; +GLboolean __EGLEW_TIZEN_image_native_surface = GL_FALSE; +#ifdef EGL_VERSION_1_0 + +static GLboolean _glewInit_EGL_VERSION_1_0 () +{ + GLboolean r = GL_FALSE; + + r = ((eglChooseConfig = (PFNEGLCHOOSECONFIGPROC)glewGetProcAddress((const GLubyte*)"eglChooseConfig")) == NULL) || r; + r = ((eglCopyBuffers = (PFNEGLCOPYBUFFERSPROC)glewGetProcAddress((const GLubyte*)"eglCopyBuffers")) == NULL) || r; + r = ((eglCreateContext = (PFNEGLCREATECONTEXTPROC)glewGetProcAddress((const GLubyte*)"eglCreateContext")) == NULL) || r; + r = ((eglCreatePbufferSurface = (PFNEGLCREATEPBUFFERSURFACEPROC)glewGetProcAddress((const GLubyte*)"eglCreatePbufferSurface")) == NULL) || r; + r = ((eglCreatePixmapSurface = (PFNEGLCREATEPIXMAPSURFACEPROC)glewGetProcAddress((const GLubyte*)"eglCreatePixmapSurface")) == NULL) || r; + r = ((eglCreateWindowSurface = (PFNEGLCREATEWINDOWSURFACEPROC)glewGetProcAddress((const GLubyte*)"eglCreateWindowSurface")) == NULL) || r; + r = ((eglDestroyContext = (PFNEGLDESTROYCONTEXTPROC)glewGetProcAddress((const GLubyte*)"eglDestroyContext")) == NULL) || r; + r = ((eglDestroySurface = (PFNEGLDESTROYSURFACEPROC)glewGetProcAddress((const GLubyte*)"eglDestroySurface")) == NULL) || r; + r = ((eglGetConfigAttrib = (PFNEGLGETCONFIGATTRIBPROC)glewGetProcAddress((const GLubyte*)"eglGetConfigAttrib")) == NULL) || r; + r = ((eglGetConfigs = (PFNEGLGETCONFIGSPROC)glewGetProcAddress((const GLubyte*)"eglGetConfigs")) == NULL) || r; + r = ((eglGetCurrentDisplay = (PFNEGLGETCURRENTDISPLAYPROC)glewGetProcAddress((const GLubyte*)"eglGetCurrentDisplay")) == NULL) || r; + r = ((eglGetCurrentSurface = (PFNEGLGETCURRENTSURFACEPROC)glewGetProcAddress((const GLubyte*)"eglGetCurrentSurface")) == NULL) || r; + r = ((eglGetDisplay = (PFNEGLGETDISPLAYPROC)glewGetProcAddress((const GLubyte*)"eglGetDisplay")) == NULL) || r; + r = ((eglGetError = (PFNEGLGETERRORPROC)glewGetProcAddress((const GLubyte*)"eglGetError")) == NULL) || r; + r = ((eglInitialize = (PFNEGLINITIALIZEPROC)glewGetProcAddress((const GLubyte*)"eglInitialize")) == NULL) || r; + r = ((eglMakeCurrent = (PFNEGLMAKECURRENTPROC)glewGetProcAddress((const GLubyte*)"eglMakeCurrent")) == NULL) || r; + r = ((eglQueryContext = (PFNEGLQUERYCONTEXTPROC)glewGetProcAddress((const GLubyte*)"eglQueryContext")) == NULL) || r; + r = ((eglQueryString = (PFNEGLQUERYSTRINGPROC)glewGetProcAddress((const GLubyte*)"eglQueryString")) == NULL) || r; + r = ((eglQuerySurface = (PFNEGLQUERYSURFACEPROC)glewGetProcAddress((const GLubyte*)"eglQuerySurface")) == NULL) || r; + r = ((eglSwapBuffers = (PFNEGLSWAPBUFFERSPROC)glewGetProcAddress((const GLubyte*)"eglSwapBuffers")) == NULL) || r; + r = ((eglTerminate = (PFNEGLTERMINATEPROC)glewGetProcAddress((const GLubyte*)"eglTerminate")) == NULL) || r; + r = ((eglWaitGL = (PFNEGLWAITGLPROC)glewGetProcAddress((const GLubyte*)"eglWaitGL")) == NULL) || r; + r = ((eglWaitNative = (PFNEGLWAITNATIVEPROC)glewGetProcAddress((const GLubyte*)"eglWaitNative")) == NULL) || r; + + return r; +} + +#endif /* EGL_VERSION_1_0 */ + +#ifdef EGL_VERSION_1_1 + +static GLboolean _glewInit_EGL_VERSION_1_1 () +{ + GLboolean r = GL_FALSE; + + r = ((eglBindTexImage = (PFNEGLBINDTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"eglBindTexImage")) == NULL) || r; + r = ((eglReleaseTexImage = (PFNEGLRELEASETEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"eglReleaseTexImage")) == NULL) || r; + r = ((eglSurfaceAttrib = (PFNEGLSURFACEATTRIBPROC)glewGetProcAddress((const GLubyte*)"eglSurfaceAttrib")) == NULL) || r; + r = ((eglSwapInterval = (PFNEGLSWAPINTERVALPROC)glewGetProcAddress((const GLubyte*)"eglSwapInterval")) == NULL) || r; + + return r; +} + +#endif /* EGL_VERSION_1_1 */ + +#ifdef EGL_VERSION_1_2 + +static GLboolean _glewInit_EGL_VERSION_1_2 () +{ + GLboolean r = GL_FALSE; + + r = ((eglBindAPI = (PFNEGLBINDAPIPROC)glewGetProcAddress((const GLubyte*)"eglBindAPI")) == NULL) || r; + r = ((eglCreatePbufferFromClientBuffer = (PFNEGLCREATEPBUFFERFROMCLIENTBUFFERPROC)glewGetProcAddress((const GLubyte*)"eglCreatePbufferFromClientBuffer")) == NULL) || r; + r = ((eglQueryAPI = (PFNEGLQUERYAPIPROC)glewGetProcAddress((const GLubyte*)"eglQueryAPI")) == NULL) || r; + r = ((eglReleaseThread = (PFNEGLRELEASETHREADPROC)glewGetProcAddress((const GLubyte*)"eglReleaseThread")) == NULL) || r; + r = ((eglWaitClient = (PFNEGLWAITCLIENTPROC)glewGetProcAddress((const GLubyte*)"eglWaitClient")) == NULL) || r; + + return r; +} + +#endif /* EGL_VERSION_1_2 */ + +#ifdef EGL_VERSION_1_4 + +static GLboolean _glewInit_EGL_VERSION_1_4 () +{ + GLboolean r = GL_FALSE; + + r = ((eglGetCurrentContext = (PFNEGLGETCURRENTCONTEXTPROC)glewGetProcAddress((const GLubyte*)"eglGetCurrentContext")) == NULL) || r; + + return r; +} + +#endif /* EGL_VERSION_1_4 */ + +#ifdef EGL_VERSION_1_5 + +static GLboolean _glewInit_EGL_VERSION_1_5 () +{ + GLboolean r = GL_FALSE; + + r = ((eglClientWaitSync = (PFNEGLCLIENTWAITSYNCPROC)glewGetProcAddress((const GLubyte*)"eglClientWaitSync")) == NULL) || r; + r = ((eglCreateImage = (PFNEGLCREATEIMAGEPROC)glewGetProcAddress((const GLubyte*)"eglCreateImage")) == NULL) || r; + r = ((eglCreatePlatformPixmapSurface = (PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC)glewGetProcAddress((const GLubyte*)"eglCreatePlatformPixmapSurface")) == NULL) || r; + r = ((eglCreatePlatformWindowSurface = (PFNEGLCREATEPLATFORMWINDOWSURFACEPROC)glewGetProcAddress((const GLubyte*)"eglCreatePlatformWindowSurface")) == NULL) || r; + r = ((eglCreateSync = (PFNEGLCREATESYNCPROC)glewGetProcAddress((const GLubyte*)"eglCreateSync")) == NULL) || r; + r = ((eglDestroyImage = (PFNEGLDESTROYIMAGEPROC)glewGetProcAddress((const GLubyte*)"eglDestroyImage")) == NULL) || r; + r = ((eglDestroySync = (PFNEGLDESTROYSYNCPROC)glewGetProcAddress((const GLubyte*)"eglDestroySync")) == NULL) || r; + r = ((eglGetPlatformDisplay = (PFNEGLGETPLATFORMDISPLAYPROC)glewGetProcAddress((const GLubyte*)"eglGetPlatformDisplay")) == NULL) || r; + r = ((eglGetSyncAttrib = (PFNEGLGETSYNCATTRIBPROC)glewGetProcAddress((const GLubyte*)"eglGetSyncAttrib")) == NULL) || r; + r = ((eglWaitSync = (PFNEGLWAITSYNCPROC)glewGetProcAddress((const GLubyte*)"eglWaitSync")) == NULL) || r; + + return r; +} + +#endif /* EGL_VERSION_1_5 */ + +#ifdef EGL_ANDROID_blob_cache + +static GLboolean _glewInit_EGL_ANDROID_blob_cache () +{ + GLboolean r = GL_FALSE; + + r = ((eglSetBlobCacheFuncsANDROID = (PFNEGLSETBLOBCACHEFUNCSANDROIDPROC)glewGetProcAddress((const GLubyte*)"eglSetBlobCacheFuncsANDROID")) == NULL) || r; + + return r; +} + +#endif /* EGL_ANDROID_blob_cache */ + +#ifdef EGL_ANDROID_create_native_client_buffer + +static GLboolean _glewInit_EGL_ANDROID_create_native_client_buffer () +{ + GLboolean r = GL_FALSE; + + r = ((eglCreateNativeClientBufferANDROID = (PFNEGLCREATENATIVECLIENTBUFFERANDROIDPROC)glewGetProcAddress((const GLubyte*)"eglCreateNativeClientBufferANDROID")) == NULL) || r; + + return r; +} + +#endif /* EGL_ANDROID_create_native_client_buffer */ + +#ifdef EGL_ANDROID_native_fence_sync + +static GLboolean _glewInit_EGL_ANDROID_native_fence_sync () +{ + GLboolean r = GL_FALSE; + + r = ((eglDupNativeFenceFDANDROID = (PFNEGLDUPNATIVEFENCEFDANDROIDPROC)glewGetProcAddress((const GLubyte*)"eglDupNativeFenceFDANDROID")) == NULL) || r; + + return r; +} + +#endif /* EGL_ANDROID_native_fence_sync */ + +#ifdef EGL_ANDROID_presentation_time + +static GLboolean _glewInit_EGL_ANDROID_presentation_time () +{ + GLboolean r = GL_FALSE; + + r = ((eglPresentationTimeANDROID = (PFNEGLPRESENTATIONTIMEANDROIDPROC)glewGetProcAddress((const GLubyte*)"eglPresentationTimeANDROID")) == NULL) || r; + + return r; +} + +#endif /* EGL_ANDROID_presentation_time */ + +#ifdef EGL_ANGLE_query_surface_pointer + +static GLboolean _glewInit_EGL_ANGLE_query_surface_pointer () +{ + GLboolean r = GL_FALSE; + + r = ((eglQuerySurfacePointerANGLE = (PFNEGLQUERYSURFACEPOINTERANGLEPROC)glewGetProcAddress((const GLubyte*)"eglQuerySurfacePointerANGLE")) == NULL) || r; + + return r; +} + +#endif /* EGL_ANGLE_query_surface_pointer */ + +#ifdef EGL_EXT_device_enumeration + +static GLboolean _glewInit_EGL_EXT_device_enumeration () +{ + GLboolean r = GL_FALSE; + + r = ((eglQueryDevicesEXT = (PFNEGLQUERYDEVICESEXTPROC)glewGetProcAddress((const GLubyte*)"eglQueryDevicesEXT")) == NULL) || r; + + return r; +} + +#endif /* EGL_EXT_device_enumeration */ + +#ifdef EGL_EXT_device_query + +static GLboolean _glewInit_EGL_EXT_device_query () +{ + GLboolean r = GL_FALSE; + + r = ((eglQueryDeviceAttribEXT = (PFNEGLQUERYDEVICEATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"eglQueryDeviceAttribEXT")) == NULL) || r; + r = ((eglQueryDeviceStringEXT = (PFNEGLQUERYDEVICESTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"eglQueryDeviceStringEXT")) == NULL) || r; + r = ((eglQueryDisplayAttribEXT = (PFNEGLQUERYDISPLAYATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"eglQueryDisplayAttribEXT")) == NULL) || r; + + return r; +} + +#endif /* EGL_EXT_device_query */ + +#ifdef EGL_EXT_image_dma_buf_import_modifiers + +static GLboolean _glewInit_EGL_EXT_image_dma_buf_import_modifiers () +{ + GLboolean r = GL_FALSE; + + r = ((eglQueryDmaBufFormatsEXT = (PFNEGLQUERYDMABUFFORMATSEXTPROC)glewGetProcAddress((const GLubyte*)"eglQueryDmaBufFormatsEXT")) == NULL) || r; + r = ((eglQueryDmaBufModifiersEXT = (PFNEGLQUERYDMABUFMODIFIERSEXTPROC)glewGetProcAddress((const GLubyte*)"eglQueryDmaBufModifiersEXT")) == NULL) || r; + + return r; +} + +#endif /* EGL_EXT_image_dma_buf_import_modifiers */ + +#ifdef EGL_EXT_output_base + +static GLboolean _glewInit_EGL_EXT_output_base () +{ + GLboolean r = GL_FALSE; + + r = ((eglGetOutputLayersEXT = (PFNEGLGETOUTPUTLAYERSEXTPROC)glewGetProcAddress((const GLubyte*)"eglGetOutputLayersEXT")) == NULL) || r; + r = ((eglGetOutputPortsEXT = (PFNEGLGETOUTPUTPORTSEXTPROC)glewGetProcAddress((const GLubyte*)"eglGetOutputPortsEXT")) == NULL) || r; + r = ((eglOutputLayerAttribEXT = (PFNEGLOUTPUTLAYERATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"eglOutputLayerAttribEXT")) == NULL) || r; + r = ((eglOutputPortAttribEXT = (PFNEGLOUTPUTPORTATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"eglOutputPortAttribEXT")) == NULL) || r; + r = ((eglQueryOutputLayerAttribEXT = (PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"eglQueryOutputLayerAttribEXT")) == NULL) || r; + r = ((eglQueryOutputLayerStringEXT = (PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"eglQueryOutputLayerStringEXT")) == NULL) || r; + r = ((eglQueryOutputPortAttribEXT = (PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"eglQueryOutputPortAttribEXT")) == NULL) || r; + r = ((eglQueryOutputPortStringEXT = (PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"eglQueryOutputPortStringEXT")) == NULL) || r; + + return r; +} + +#endif /* EGL_EXT_output_base */ + +#ifdef EGL_EXT_platform_base + +static GLboolean _glewInit_EGL_EXT_platform_base () +{ + GLboolean r = GL_FALSE; + + r = ((eglCreatePlatformPixmapSurfaceEXT = (PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC)glewGetProcAddress((const GLubyte*)"eglCreatePlatformPixmapSurfaceEXT")) == NULL) || r; + r = ((eglCreatePlatformWindowSurfaceEXT = (PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC)glewGetProcAddress((const GLubyte*)"eglCreatePlatformWindowSurfaceEXT")) == NULL) || r; + r = ((eglGetPlatformDisplayEXT = (PFNEGLGETPLATFORMDISPLAYEXTPROC)glewGetProcAddress((const GLubyte*)"eglGetPlatformDisplayEXT")) == NULL) || r; + + return r; +} + +#endif /* EGL_EXT_platform_base */ + +#ifdef EGL_EXT_stream_consumer_egloutput + +static GLboolean _glewInit_EGL_EXT_stream_consumer_egloutput () +{ + GLboolean r = GL_FALSE; + + r = ((eglStreamConsumerOutputEXT = (PFNEGLSTREAMCONSUMEROUTPUTEXTPROC)glewGetProcAddress((const GLubyte*)"eglStreamConsumerOutputEXT")) == NULL) || r; + + return r; +} + +#endif /* EGL_EXT_stream_consumer_egloutput */ + +#ifdef EGL_EXT_swap_buffers_with_damage + +static GLboolean _glewInit_EGL_EXT_swap_buffers_with_damage () +{ + GLboolean r = GL_FALSE; + + r = ((eglSwapBuffersWithDamageEXT = (PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"eglSwapBuffersWithDamageEXT")) == NULL) || r; + + return r; +} + +#endif /* EGL_EXT_swap_buffers_with_damage */ + +#ifdef EGL_HI_clientpixmap + +static GLboolean _glewInit_EGL_HI_clientpixmap () +{ + GLboolean r = GL_FALSE; + + r = ((eglCreatePixmapSurfaceHI = (PFNEGLCREATEPIXMAPSURFACEHIPROC)glewGetProcAddress((const GLubyte*)"eglCreatePixmapSurfaceHI")) == NULL) || r; + + return r; +} + +#endif /* EGL_HI_clientpixmap */ + +#ifdef EGL_KHR_cl_event2 + +static GLboolean _glewInit_EGL_KHR_cl_event2 () +{ + GLboolean r = GL_FALSE; + + r = ((eglCreateSync64KHR = (PFNEGLCREATESYNC64KHRPROC)glewGetProcAddress((const GLubyte*)"eglCreateSync64KHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_cl_event2 */ + +#ifdef EGL_KHR_debug + +static GLboolean _glewInit_EGL_KHR_debug () +{ + GLboolean r = GL_FALSE; + + r = ((eglDebugMessageControlKHR = (PFNEGLDEBUGMESSAGECONTROLKHRPROC)glewGetProcAddress((const GLubyte*)"eglDebugMessageControlKHR")) == NULL) || r; + r = ((eglLabelObjectKHR = (PFNEGLLABELOBJECTKHRPROC)glewGetProcAddress((const GLubyte*)"eglLabelObjectKHR")) == NULL) || r; + r = ((eglQueryDebugKHR = (PFNEGLQUERYDEBUGKHRPROC)glewGetProcAddress((const GLubyte*)"eglQueryDebugKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_debug */ + +#ifdef EGL_KHR_image + +static GLboolean _glewInit_EGL_KHR_image () +{ + GLboolean r = GL_FALSE; + + r = ((eglCreateImageKHR = (PFNEGLCREATEIMAGEKHRPROC)glewGetProcAddress((const GLubyte*)"eglCreateImageKHR")) == NULL) || r; + r = ((eglDestroyImageKHR = (PFNEGLDESTROYIMAGEKHRPROC)glewGetProcAddress((const GLubyte*)"eglDestroyImageKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_image */ + +#ifdef EGL_KHR_lock_surface + +static GLboolean _glewInit_EGL_KHR_lock_surface () +{ + GLboolean r = GL_FALSE; + + r = ((eglLockSurfaceKHR = (PFNEGLLOCKSURFACEKHRPROC)glewGetProcAddress((const GLubyte*)"eglLockSurfaceKHR")) == NULL) || r; + r = ((eglUnlockSurfaceKHR = (PFNEGLUNLOCKSURFACEKHRPROC)glewGetProcAddress((const GLubyte*)"eglUnlockSurfaceKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_lock_surface */ + +#ifdef EGL_KHR_lock_surface3 + +static GLboolean _glewInit_EGL_KHR_lock_surface3 () +{ + GLboolean r = GL_FALSE; + + r = ((eglQuerySurface64KHR = (PFNEGLQUERYSURFACE64KHRPROC)glewGetProcAddress((const GLubyte*)"eglQuerySurface64KHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_lock_surface3 */ + +#ifdef EGL_KHR_partial_update + +static GLboolean _glewInit_EGL_KHR_partial_update () +{ + GLboolean r = GL_FALSE; + + r = ((eglSetDamageRegionKHR = (PFNEGLSETDAMAGEREGIONKHRPROC)glewGetProcAddress((const GLubyte*)"eglSetDamageRegionKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_partial_update */ + +#ifdef EGL_KHR_reusable_sync + +static GLboolean _glewInit_EGL_KHR_reusable_sync () +{ + GLboolean r = GL_FALSE; + + r = ((eglClientWaitSyncKHR = (PFNEGLCLIENTWAITSYNCKHRPROC)glewGetProcAddress((const GLubyte*)"eglClientWaitSyncKHR")) == NULL) || r; + r = ((eglCreateSyncKHR = (PFNEGLCREATESYNCKHRPROC)glewGetProcAddress((const GLubyte*)"eglCreateSyncKHR")) == NULL) || r; + r = ((eglDestroySyncKHR = (PFNEGLDESTROYSYNCKHRPROC)glewGetProcAddress((const GLubyte*)"eglDestroySyncKHR")) == NULL) || r; + r = ((eglGetSyncAttribKHR = (PFNEGLGETSYNCATTRIBKHRPROC)glewGetProcAddress((const GLubyte*)"eglGetSyncAttribKHR")) == NULL) || r; + r = ((eglSignalSyncKHR = (PFNEGLSIGNALSYNCKHRPROC)glewGetProcAddress((const GLubyte*)"eglSignalSyncKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_reusable_sync */ + +#ifdef EGL_KHR_stream + +static GLboolean _glewInit_EGL_KHR_stream () +{ + GLboolean r = GL_FALSE; + + r = ((eglCreateStreamKHR = (PFNEGLCREATESTREAMKHRPROC)glewGetProcAddress((const GLubyte*)"eglCreateStreamKHR")) == NULL) || r; + r = ((eglDestroyStreamKHR = (PFNEGLDESTROYSTREAMKHRPROC)glewGetProcAddress((const GLubyte*)"eglDestroyStreamKHR")) == NULL) || r; + r = ((eglQueryStreamKHR = (PFNEGLQUERYSTREAMKHRPROC)glewGetProcAddress((const GLubyte*)"eglQueryStreamKHR")) == NULL) || r; + r = ((eglQueryStreamu64KHR = (PFNEGLQUERYSTREAMU64KHRPROC)glewGetProcAddress((const GLubyte*)"eglQueryStreamu64KHR")) == NULL) || r; + r = ((eglStreamAttribKHR = (PFNEGLSTREAMATTRIBKHRPROC)glewGetProcAddress((const GLubyte*)"eglStreamAttribKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_stream */ + +#ifdef EGL_KHR_stream_attrib + +static GLboolean _glewInit_EGL_KHR_stream_attrib () +{ + GLboolean r = GL_FALSE; + + r = ((eglCreateStreamAttribKHR = (PFNEGLCREATESTREAMATTRIBKHRPROC)glewGetProcAddress((const GLubyte*)"eglCreateStreamAttribKHR")) == NULL) || r; + r = ((eglQueryStreamAttribKHR = (PFNEGLQUERYSTREAMATTRIBKHRPROC)glewGetProcAddress((const GLubyte*)"eglQueryStreamAttribKHR")) == NULL) || r; + r = ((eglSetStreamAttribKHR = (PFNEGLSETSTREAMATTRIBKHRPROC)glewGetProcAddress((const GLubyte*)"eglSetStreamAttribKHR")) == NULL) || r; + r = ((eglStreamConsumerAcquireAttribKHR = (PFNEGLSTREAMCONSUMERACQUIREATTRIBKHRPROC)glewGetProcAddress((const GLubyte*)"eglStreamConsumerAcquireAttribKHR")) == NULL) || r; + r = ((eglStreamConsumerReleaseAttribKHR = (PFNEGLSTREAMCONSUMERRELEASEATTRIBKHRPROC)glewGetProcAddress((const GLubyte*)"eglStreamConsumerReleaseAttribKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_stream_attrib */ + +#ifdef EGL_KHR_stream_consumer_gltexture + +static GLboolean _glewInit_EGL_KHR_stream_consumer_gltexture () +{ + GLboolean r = GL_FALSE; + + r = ((eglStreamConsumerAcquireKHR = (PFNEGLSTREAMCONSUMERACQUIREKHRPROC)glewGetProcAddress((const GLubyte*)"eglStreamConsumerAcquireKHR")) == NULL) || r; + r = ((eglStreamConsumerGLTextureExternalKHR = (PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC)glewGetProcAddress((const GLubyte*)"eglStreamConsumerGLTextureExternalKHR")) == NULL) || r; + r = ((eglStreamConsumerReleaseKHR = (PFNEGLSTREAMCONSUMERRELEASEKHRPROC)glewGetProcAddress((const GLubyte*)"eglStreamConsumerReleaseKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_stream_consumer_gltexture */ + +#ifdef EGL_KHR_stream_cross_process_fd + +static GLboolean _glewInit_EGL_KHR_stream_cross_process_fd () +{ + GLboolean r = GL_FALSE; + + r = ((eglCreateStreamFromFileDescriptorKHR = (PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC)glewGetProcAddress((const GLubyte*)"eglCreateStreamFromFileDescriptorKHR")) == NULL) || r; + r = ((eglGetStreamFileDescriptorKHR = (PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC)glewGetProcAddress((const GLubyte*)"eglGetStreamFileDescriptorKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_stream_cross_process_fd */ + +#ifdef EGL_KHR_stream_fifo + +static GLboolean _glewInit_EGL_KHR_stream_fifo () +{ + GLboolean r = GL_FALSE; + + r = ((eglQueryStreamTimeKHR = (PFNEGLQUERYSTREAMTIMEKHRPROC)glewGetProcAddress((const GLubyte*)"eglQueryStreamTimeKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_stream_fifo */ + +#ifdef EGL_KHR_stream_producer_eglsurface + +static GLboolean _glewInit_EGL_KHR_stream_producer_eglsurface () +{ + GLboolean r = GL_FALSE; + + r = ((eglCreateStreamProducerSurfaceKHR = (PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC)glewGetProcAddress((const GLubyte*)"eglCreateStreamProducerSurfaceKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_stream_producer_eglsurface */ + +#ifdef EGL_KHR_swap_buffers_with_damage + +static GLboolean _glewInit_EGL_KHR_swap_buffers_with_damage () +{ + GLboolean r = GL_FALSE; + + r = ((eglSwapBuffersWithDamageKHR = (PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC)glewGetProcAddress((const GLubyte*)"eglSwapBuffersWithDamageKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_swap_buffers_with_damage */ + +#ifdef EGL_KHR_wait_sync + +static GLboolean _glewInit_EGL_KHR_wait_sync () +{ + GLboolean r = GL_FALSE; + + r = ((eglWaitSyncKHR = (PFNEGLWAITSYNCKHRPROC)glewGetProcAddress((const GLubyte*)"eglWaitSyncKHR")) == NULL) || r; + + return r; +} + +#endif /* EGL_KHR_wait_sync */ + +#ifdef EGL_MESA_drm_image + +static GLboolean _glewInit_EGL_MESA_drm_image () +{ + GLboolean r = GL_FALSE; + + r = ((eglCreateDRMImageMESA = (PFNEGLCREATEDRMIMAGEMESAPROC)glewGetProcAddress((const GLubyte*)"eglCreateDRMImageMESA")) == NULL) || r; + r = ((eglExportDRMImageMESA = (PFNEGLEXPORTDRMIMAGEMESAPROC)glewGetProcAddress((const GLubyte*)"eglExportDRMImageMESA")) == NULL) || r; + + return r; +} + +#endif /* EGL_MESA_drm_image */ + +#ifdef EGL_MESA_image_dma_buf_export + +static GLboolean _glewInit_EGL_MESA_image_dma_buf_export () +{ + GLboolean r = GL_FALSE; + + r = ((eglExportDMABUFImageMESA = (PFNEGLEXPORTDMABUFIMAGEMESAPROC)glewGetProcAddress((const GLubyte*)"eglExportDMABUFImageMESA")) == NULL) || r; + r = ((eglExportDMABUFImageQueryMESA = (PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC)glewGetProcAddress((const GLubyte*)"eglExportDMABUFImageQueryMESA")) == NULL) || r; + + return r; +} + +#endif /* EGL_MESA_image_dma_buf_export */ + +#ifdef EGL_NOK_swap_region + +static GLboolean _glewInit_EGL_NOK_swap_region () +{ + GLboolean r = GL_FALSE; + + r = ((eglSwapBuffersRegionNOK = (PFNEGLSWAPBUFFERSREGIONNOKPROC)glewGetProcAddress((const GLubyte*)"eglSwapBuffersRegionNOK")) == NULL) || r; + + return r; +} + +#endif /* EGL_NOK_swap_region */ + +#ifdef EGL_NOK_swap_region2 + +static GLboolean _glewInit_EGL_NOK_swap_region2 () +{ + GLboolean r = GL_FALSE; + + r = ((eglSwapBuffersRegion2NOK = (PFNEGLSWAPBUFFERSREGION2NOKPROC)glewGetProcAddress((const GLubyte*)"eglSwapBuffersRegion2NOK")) == NULL) || r; + + return r; +} + +#endif /* EGL_NOK_swap_region2 */ + +#ifdef EGL_NV_native_query + +static GLboolean _glewInit_EGL_NV_native_query () +{ + GLboolean r = GL_FALSE; + + r = ((eglQueryNativeDisplayNV = (PFNEGLQUERYNATIVEDISPLAYNVPROC)glewGetProcAddress((const GLubyte*)"eglQueryNativeDisplayNV")) == NULL) || r; + r = ((eglQueryNativePixmapNV = (PFNEGLQUERYNATIVEPIXMAPNVPROC)glewGetProcAddress((const GLubyte*)"eglQueryNativePixmapNV")) == NULL) || r; + r = ((eglQueryNativeWindowNV = (PFNEGLQUERYNATIVEWINDOWNVPROC)glewGetProcAddress((const GLubyte*)"eglQueryNativeWindowNV")) == NULL) || r; + + return r; +} + +#endif /* EGL_NV_native_query */ + +#ifdef EGL_NV_post_sub_buffer + +static GLboolean _glewInit_EGL_NV_post_sub_buffer () +{ + GLboolean r = GL_FALSE; + + r = ((eglPostSubBufferNV = (PFNEGLPOSTSUBBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"eglPostSubBufferNV")) == NULL) || r; + + return r; +} + +#endif /* EGL_NV_post_sub_buffer */ + +#ifdef EGL_NV_stream_consumer_gltexture_yuv + +static GLboolean _glewInit_EGL_NV_stream_consumer_gltexture_yuv () +{ + GLboolean r = GL_FALSE; + + r = ((eglStreamConsumerGLTextureExternalAttribsNV = (PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALATTRIBSNVPROC)glewGetProcAddress((const GLubyte*)"eglStreamConsumerGLTextureExternalAttribsNV")) == NULL) || r; + + return r; +} + +#endif /* EGL_NV_stream_consumer_gltexture_yuv */ + +#ifdef EGL_NV_stream_metadata + +static GLboolean _glewInit_EGL_NV_stream_metadata () +{ + GLboolean r = GL_FALSE; + + r = ((eglQueryDisplayAttribNV = (PFNEGLQUERYDISPLAYATTRIBNVPROC)glewGetProcAddress((const GLubyte*)"eglQueryDisplayAttribNV")) == NULL) || r; + r = ((eglQueryStreamMetadataNV = (PFNEGLQUERYSTREAMMETADATANVPROC)glewGetProcAddress((const GLubyte*)"eglQueryStreamMetadataNV")) == NULL) || r; + r = ((eglSetStreamMetadataNV = (PFNEGLSETSTREAMMETADATANVPROC)glewGetProcAddress((const GLubyte*)"eglSetStreamMetadataNV")) == NULL) || r; + + return r; +} + +#endif /* EGL_NV_stream_metadata */ + +#ifdef EGL_NV_stream_reset + +static GLboolean _glewInit_EGL_NV_stream_reset () +{ + GLboolean r = GL_FALSE; + + r = ((eglResetStreamNV = (PFNEGLRESETSTREAMNVPROC)glewGetProcAddress((const GLubyte*)"eglResetStreamNV")) == NULL) || r; + + return r; +} + +#endif /* EGL_NV_stream_reset */ + +#ifdef EGL_NV_stream_sync + +static GLboolean _glewInit_EGL_NV_stream_sync () +{ + GLboolean r = GL_FALSE; + + r = ((eglCreateStreamSyncNV = (PFNEGLCREATESTREAMSYNCNVPROC)glewGetProcAddress((const GLubyte*)"eglCreateStreamSyncNV")) == NULL) || r; + + return r; +} + +#endif /* EGL_NV_stream_sync */ + +#ifdef EGL_NV_sync + +static GLboolean _glewInit_EGL_NV_sync () +{ + GLboolean r = GL_FALSE; + + r = ((eglClientWaitSyncNV = (PFNEGLCLIENTWAITSYNCNVPROC)glewGetProcAddress((const GLubyte*)"eglClientWaitSyncNV")) == NULL) || r; + r = ((eglCreateFenceSyncNV = (PFNEGLCREATEFENCESYNCNVPROC)glewGetProcAddress((const GLubyte*)"eglCreateFenceSyncNV")) == NULL) || r; + r = ((eglDestroySyncNV = (PFNEGLDESTROYSYNCNVPROC)glewGetProcAddress((const GLubyte*)"eglDestroySyncNV")) == NULL) || r; + r = ((eglFenceNV = (PFNEGLFENCENVPROC)glewGetProcAddress((const GLubyte*)"eglFenceNV")) == NULL) || r; + r = ((eglGetSyncAttribNV = (PFNEGLGETSYNCATTRIBNVPROC)glewGetProcAddress((const GLubyte*)"eglGetSyncAttribNV")) == NULL) || r; + r = ((eglSignalSyncNV = (PFNEGLSIGNALSYNCNVPROC)glewGetProcAddress((const GLubyte*)"eglSignalSyncNV")) == NULL) || r; + + return r; +} + +#endif /* EGL_NV_sync */ + +#ifdef EGL_NV_system_time + +static GLboolean _glewInit_EGL_NV_system_time () +{ + GLboolean r = GL_FALSE; + + r = ((eglGetSystemTimeFrequencyNV = (PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC)glewGetProcAddress((const GLubyte*)"eglGetSystemTimeFrequencyNV")) == NULL) || r; + r = ((eglGetSystemTimeNV = (PFNEGLGETSYSTEMTIMENVPROC)glewGetProcAddress((const GLubyte*)"eglGetSystemTimeNV")) == NULL) || r; + + return r; +} + +#endif /* EGL_NV_system_time */ + + /* ------------------------------------------------------------------------ */ + +GLboolean GLEWAPIENTRY eglewGetExtension (const char* name) +{ + const GLubyte* start; + const GLubyte* end; + + start = (const GLubyte*) eglQueryString(eglGetCurrentDisplay(), EGL_EXTENSIONS); + if (0 == start) return GL_FALSE; + end = start + _glewStrLen(start); + return _glewSearchExtension(name, start, end); +} + +GLenum GLEWAPIENTRY eglewInit (EGLDisplay display) +{ + EGLint major, minor; + const GLubyte* extStart; + const GLubyte* extEnd; + PFNEGLINITIALIZEPROC initialize = NULL; + PFNEGLQUERYSTRINGPROC queryString = NULL; + + /* Load necessary entry points */ + initialize = (PFNEGLINITIALIZEPROC) glewGetProcAddress("eglInitialize"); + queryString = (PFNEGLQUERYSTRINGPROC) glewGetProcAddress("eglQueryString"); + if (!initialize || !queryString) + return 1; + + /* query EGK version */ + if (initialize(display, &major, &minor) != EGL_TRUE) + return 1; + + EGLEW_VERSION_1_5 = ( major > 1 ) || ( major == 1 && minor >= 5 ) ? GL_TRUE : GL_FALSE; + EGLEW_VERSION_1_4 = EGLEW_VERSION_1_5 == GL_TRUE || ( major == 1 && minor >= 4 ) ? GL_TRUE : GL_FALSE; + EGLEW_VERSION_1_3 = EGLEW_VERSION_1_4 == GL_TRUE || ( major == 1 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + EGLEW_VERSION_1_2 = EGLEW_VERSION_1_3 == GL_TRUE || ( major == 1 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + EGLEW_VERSION_1_1 = EGLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + EGLEW_VERSION_1_0 = EGLEW_VERSION_1_1 == GL_TRUE || ( major == 1 && minor >= 0 ) ? GL_TRUE : GL_FALSE; + + /* query EGL extension string */ + extStart = (const GLubyte*) queryString(display, EGL_EXTENSIONS); + if (extStart == 0) + extStart = (const GLubyte *)""; + extEnd = extStart + _glewStrLen(extStart); + + /* initialize extensions */ +#ifdef EGL_VERSION_1_0 + if (glewExperimental || EGLEW_VERSION_1_0) EGLEW_VERSION_1_0 = !_glewInit_EGL_VERSION_1_0(); +#endif /* EGL_VERSION_1_0 */ +#ifdef EGL_VERSION_1_1 + if (glewExperimental || EGLEW_VERSION_1_1) EGLEW_VERSION_1_1 = !_glewInit_EGL_VERSION_1_1(); +#endif /* EGL_VERSION_1_1 */ +#ifdef EGL_VERSION_1_2 + if (glewExperimental || EGLEW_VERSION_1_2) EGLEW_VERSION_1_2 = !_glewInit_EGL_VERSION_1_2(); +#endif /* EGL_VERSION_1_2 */ +#ifdef EGL_VERSION_1_4 + if (glewExperimental || EGLEW_VERSION_1_4) EGLEW_VERSION_1_4 = !_glewInit_EGL_VERSION_1_4(); +#endif /* EGL_VERSION_1_4 */ +#ifdef EGL_VERSION_1_5 + if (glewExperimental || EGLEW_VERSION_1_5) EGLEW_VERSION_1_5 = !_glewInit_EGL_VERSION_1_5(); +#endif /* EGL_VERSION_1_5 */ +#ifdef EGL_ANDROID_blob_cache + EGLEW_ANDROID_blob_cache = _glewSearchExtension("EGL_ANDROID_blob_cache", extStart, extEnd); + if (glewExperimental || EGLEW_ANDROID_blob_cache) EGLEW_ANDROID_blob_cache = !_glewInit_EGL_ANDROID_blob_cache(); +#endif /* EGL_ANDROID_blob_cache */ +#ifdef EGL_ANDROID_create_native_client_buffer + EGLEW_ANDROID_create_native_client_buffer = _glewSearchExtension("EGL_ANDROID_create_native_client_buffer", extStart, extEnd); + if (glewExperimental || EGLEW_ANDROID_create_native_client_buffer) EGLEW_ANDROID_create_native_client_buffer = !_glewInit_EGL_ANDROID_create_native_client_buffer(); +#endif /* EGL_ANDROID_create_native_client_buffer */ +#ifdef EGL_ANDROID_framebuffer_target + EGLEW_ANDROID_framebuffer_target = _glewSearchExtension("EGL_ANDROID_framebuffer_target", extStart, extEnd); +#endif /* EGL_ANDROID_framebuffer_target */ +#ifdef EGL_ANDROID_front_buffer_auto_refresh + EGLEW_ANDROID_front_buffer_auto_refresh = _glewSearchExtension("EGL_ANDROID_front_buffer_auto_refresh", extStart, extEnd); +#endif /* EGL_ANDROID_front_buffer_auto_refresh */ +#ifdef EGL_ANDROID_image_native_buffer + EGLEW_ANDROID_image_native_buffer = _glewSearchExtension("EGL_ANDROID_image_native_buffer", extStart, extEnd); +#endif /* EGL_ANDROID_image_native_buffer */ +#ifdef EGL_ANDROID_native_fence_sync + EGLEW_ANDROID_native_fence_sync = _glewSearchExtension("EGL_ANDROID_native_fence_sync", extStart, extEnd); + if (glewExperimental || EGLEW_ANDROID_native_fence_sync) EGLEW_ANDROID_native_fence_sync = !_glewInit_EGL_ANDROID_native_fence_sync(); +#endif /* EGL_ANDROID_native_fence_sync */ +#ifdef EGL_ANDROID_presentation_time + EGLEW_ANDROID_presentation_time = _glewSearchExtension("EGL_ANDROID_presentation_time", extStart, extEnd); + if (glewExperimental || EGLEW_ANDROID_presentation_time) EGLEW_ANDROID_presentation_time = !_glewInit_EGL_ANDROID_presentation_time(); +#endif /* EGL_ANDROID_presentation_time */ +#ifdef EGL_ANDROID_recordable + EGLEW_ANDROID_recordable = _glewSearchExtension("EGL_ANDROID_recordable", extStart, extEnd); +#endif /* EGL_ANDROID_recordable */ +#ifdef EGL_ANGLE_d3d_share_handle_client_buffer + EGLEW_ANGLE_d3d_share_handle_client_buffer = _glewSearchExtension("EGL_ANGLE_d3d_share_handle_client_buffer", extStart, extEnd); +#endif /* EGL_ANGLE_d3d_share_handle_client_buffer */ +#ifdef EGL_ANGLE_device_d3d + EGLEW_ANGLE_device_d3d = _glewSearchExtension("EGL_ANGLE_device_d3d", extStart, extEnd); +#endif /* EGL_ANGLE_device_d3d */ +#ifdef EGL_ANGLE_query_surface_pointer + EGLEW_ANGLE_query_surface_pointer = _glewSearchExtension("EGL_ANGLE_query_surface_pointer", extStart, extEnd); + if (glewExperimental || EGLEW_ANGLE_query_surface_pointer) EGLEW_ANGLE_query_surface_pointer = !_glewInit_EGL_ANGLE_query_surface_pointer(); +#endif /* EGL_ANGLE_query_surface_pointer */ +#ifdef EGL_ANGLE_surface_d3d_texture_2d_share_handle + EGLEW_ANGLE_surface_d3d_texture_2d_share_handle = _glewSearchExtension("EGL_ANGLE_surface_d3d_texture_2d_share_handle", extStart, extEnd); +#endif /* EGL_ANGLE_surface_d3d_texture_2d_share_handle */ +#ifdef EGL_ANGLE_window_fixed_size + EGLEW_ANGLE_window_fixed_size = _glewSearchExtension("EGL_ANGLE_window_fixed_size", extStart, extEnd); +#endif /* EGL_ANGLE_window_fixed_size */ +#ifdef EGL_ARM_implicit_external_sync + EGLEW_ARM_implicit_external_sync = _glewSearchExtension("EGL_ARM_implicit_external_sync", extStart, extEnd); +#endif /* EGL_ARM_implicit_external_sync */ +#ifdef EGL_ARM_pixmap_multisample_discard + EGLEW_ARM_pixmap_multisample_discard = _glewSearchExtension("EGL_ARM_pixmap_multisample_discard", extStart, extEnd); +#endif /* EGL_ARM_pixmap_multisample_discard */ +#ifdef EGL_EXT_buffer_age + EGLEW_EXT_buffer_age = _glewSearchExtension("EGL_EXT_buffer_age", extStart, extEnd); +#endif /* EGL_EXT_buffer_age */ +#ifdef EGL_EXT_client_extensions + EGLEW_EXT_client_extensions = _glewSearchExtension("EGL_EXT_client_extensions", extStart, extEnd); +#endif /* EGL_EXT_client_extensions */ +#ifdef EGL_EXT_create_context_robustness + EGLEW_EXT_create_context_robustness = _glewSearchExtension("EGL_EXT_create_context_robustness", extStart, extEnd); +#endif /* EGL_EXT_create_context_robustness */ +#ifdef EGL_EXT_device_base + EGLEW_EXT_device_base = _glewSearchExtension("EGL_EXT_device_base", extStart, extEnd); +#endif /* EGL_EXT_device_base */ +#ifdef EGL_EXT_device_drm + EGLEW_EXT_device_drm = _glewSearchExtension("EGL_EXT_device_drm", extStart, extEnd); +#endif /* EGL_EXT_device_drm */ +#ifdef EGL_EXT_device_enumeration + EGLEW_EXT_device_enumeration = _glewSearchExtension("EGL_EXT_device_enumeration", extStart, extEnd); + if (glewExperimental || EGLEW_EXT_device_enumeration) EGLEW_EXT_device_enumeration = !_glewInit_EGL_EXT_device_enumeration(); +#endif /* EGL_EXT_device_enumeration */ +#ifdef EGL_EXT_device_openwf + EGLEW_EXT_device_openwf = _glewSearchExtension("EGL_EXT_device_openwf", extStart, extEnd); +#endif /* EGL_EXT_device_openwf */ +#ifdef EGL_EXT_device_query + EGLEW_EXT_device_query = _glewSearchExtension("EGL_EXT_device_query", extStart, extEnd); + if (glewExperimental || EGLEW_EXT_device_query) EGLEW_EXT_device_query = !_glewInit_EGL_EXT_device_query(); +#endif /* EGL_EXT_device_query */ +#ifdef EGL_EXT_gl_colorspace_bt2020_linear + EGLEW_EXT_gl_colorspace_bt2020_linear = _glewSearchExtension("EGL_EXT_gl_colorspace_bt2020_linear", extStart, extEnd); +#endif /* EGL_EXT_gl_colorspace_bt2020_linear */ +#ifdef EGL_EXT_gl_colorspace_bt2020_pq + EGLEW_EXT_gl_colorspace_bt2020_pq = _glewSearchExtension("EGL_EXT_gl_colorspace_bt2020_pq", extStart, extEnd); +#endif /* EGL_EXT_gl_colorspace_bt2020_pq */ +#ifdef EGL_EXT_gl_colorspace_scrgb_linear + EGLEW_EXT_gl_colorspace_scrgb_linear = _glewSearchExtension("EGL_EXT_gl_colorspace_scrgb_linear", extStart, extEnd); +#endif /* EGL_EXT_gl_colorspace_scrgb_linear */ +#ifdef EGL_EXT_image_dma_buf_import + EGLEW_EXT_image_dma_buf_import = _glewSearchExtension("EGL_EXT_image_dma_buf_import", extStart, extEnd); +#endif /* EGL_EXT_image_dma_buf_import */ +#ifdef EGL_EXT_image_dma_buf_import_modifiers + EGLEW_EXT_image_dma_buf_import_modifiers = _glewSearchExtension("EGL_EXT_image_dma_buf_import_modifiers", extStart, extEnd); + if (glewExperimental || EGLEW_EXT_image_dma_buf_import_modifiers) EGLEW_EXT_image_dma_buf_import_modifiers = !_glewInit_EGL_EXT_image_dma_buf_import_modifiers(); +#endif /* EGL_EXT_image_dma_buf_import_modifiers */ +#ifdef EGL_EXT_multiview_window + EGLEW_EXT_multiview_window = _glewSearchExtension("EGL_EXT_multiview_window", extStart, extEnd); +#endif /* EGL_EXT_multiview_window */ +#ifdef EGL_EXT_output_base + EGLEW_EXT_output_base = _glewSearchExtension("EGL_EXT_output_base", extStart, extEnd); + if (glewExperimental || EGLEW_EXT_output_base) EGLEW_EXT_output_base = !_glewInit_EGL_EXT_output_base(); +#endif /* EGL_EXT_output_base */ +#ifdef EGL_EXT_output_drm + EGLEW_EXT_output_drm = _glewSearchExtension("EGL_EXT_output_drm", extStart, extEnd); +#endif /* EGL_EXT_output_drm */ +#ifdef EGL_EXT_output_openwf + EGLEW_EXT_output_openwf = _glewSearchExtension("EGL_EXT_output_openwf", extStart, extEnd); +#endif /* EGL_EXT_output_openwf */ +#ifdef EGL_EXT_pixel_format_float + EGLEW_EXT_pixel_format_float = _glewSearchExtension("EGL_EXT_pixel_format_float", extStart, extEnd); +#endif /* EGL_EXT_pixel_format_float */ +#ifdef EGL_EXT_platform_base + EGLEW_EXT_platform_base = _glewSearchExtension("EGL_EXT_platform_base", extStart, extEnd); + if (glewExperimental || EGLEW_EXT_platform_base) EGLEW_EXT_platform_base = !_glewInit_EGL_EXT_platform_base(); +#endif /* EGL_EXT_platform_base */ +#ifdef EGL_EXT_platform_device + EGLEW_EXT_platform_device = _glewSearchExtension("EGL_EXT_platform_device", extStart, extEnd); +#endif /* EGL_EXT_platform_device */ +#ifdef EGL_EXT_platform_wayland + EGLEW_EXT_platform_wayland = _glewSearchExtension("EGL_EXT_platform_wayland", extStart, extEnd); +#endif /* EGL_EXT_platform_wayland */ +#ifdef EGL_EXT_platform_x11 + EGLEW_EXT_platform_x11 = _glewSearchExtension("EGL_EXT_platform_x11", extStart, extEnd); +#endif /* EGL_EXT_platform_x11 */ +#ifdef EGL_EXT_protected_content + EGLEW_EXT_protected_content = _glewSearchExtension("EGL_EXT_protected_content", extStart, extEnd); +#endif /* EGL_EXT_protected_content */ +#ifdef EGL_EXT_protected_surface + EGLEW_EXT_protected_surface = _glewSearchExtension("EGL_EXT_protected_surface", extStart, extEnd); +#endif /* EGL_EXT_protected_surface */ +#ifdef EGL_EXT_stream_consumer_egloutput + EGLEW_EXT_stream_consumer_egloutput = _glewSearchExtension("EGL_EXT_stream_consumer_egloutput", extStart, extEnd); + if (glewExperimental || EGLEW_EXT_stream_consumer_egloutput) EGLEW_EXT_stream_consumer_egloutput = !_glewInit_EGL_EXT_stream_consumer_egloutput(); +#endif /* EGL_EXT_stream_consumer_egloutput */ +#ifdef EGL_EXT_surface_SMPTE2086_metadata + EGLEW_EXT_surface_SMPTE2086_metadata = _glewSearchExtension("EGL_EXT_surface_SMPTE2086_metadata", extStart, extEnd); +#endif /* EGL_EXT_surface_SMPTE2086_metadata */ +#ifdef EGL_EXT_swap_buffers_with_damage + EGLEW_EXT_swap_buffers_with_damage = _glewSearchExtension("EGL_EXT_swap_buffers_with_damage", extStart, extEnd); + if (glewExperimental || EGLEW_EXT_swap_buffers_with_damage) EGLEW_EXT_swap_buffers_with_damage = !_glewInit_EGL_EXT_swap_buffers_with_damage(); +#endif /* EGL_EXT_swap_buffers_with_damage */ +#ifdef EGL_EXT_yuv_surface + EGLEW_EXT_yuv_surface = _glewSearchExtension("EGL_EXT_yuv_surface", extStart, extEnd); +#endif /* EGL_EXT_yuv_surface */ +#ifdef EGL_HI_clientpixmap + EGLEW_HI_clientpixmap = _glewSearchExtension("EGL_HI_clientpixmap", extStart, extEnd); + if (glewExperimental || EGLEW_HI_clientpixmap) EGLEW_HI_clientpixmap = !_glewInit_EGL_HI_clientpixmap(); +#endif /* EGL_HI_clientpixmap */ +#ifdef EGL_HI_colorformats + EGLEW_HI_colorformats = _glewSearchExtension("EGL_HI_colorformats", extStart, extEnd); +#endif /* EGL_HI_colorformats */ +#ifdef EGL_IMG_context_priority + EGLEW_IMG_context_priority = _glewSearchExtension("EGL_IMG_context_priority", extStart, extEnd); +#endif /* EGL_IMG_context_priority */ +#ifdef EGL_IMG_image_plane_attribs + EGLEW_IMG_image_plane_attribs = _glewSearchExtension("EGL_IMG_image_plane_attribs", extStart, extEnd); +#endif /* EGL_IMG_image_plane_attribs */ +#ifdef EGL_KHR_cl_event + EGLEW_KHR_cl_event = _glewSearchExtension("EGL_KHR_cl_event", extStart, extEnd); +#endif /* EGL_KHR_cl_event */ +#ifdef EGL_KHR_cl_event2 + EGLEW_KHR_cl_event2 = _glewSearchExtension("EGL_KHR_cl_event2", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_cl_event2) EGLEW_KHR_cl_event2 = !_glewInit_EGL_KHR_cl_event2(); +#endif /* EGL_KHR_cl_event2 */ +#ifdef EGL_KHR_client_get_all_proc_addresses + EGLEW_KHR_client_get_all_proc_addresses = _glewSearchExtension("EGL_KHR_client_get_all_proc_addresses", extStart, extEnd); +#endif /* EGL_KHR_client_get_all_proc_addresses */ +#ifdef EGL_KHR_config_attribs + EGLEW_KHR_config_attribs = _glewSearchExtension("EGL_KHR_config_attribs", extStart, extEnd); +#endif /* EGL_KHR_config_attribs */ +#ifdef EGL_KHR_context_flush_control + EGLEW_KHR_context_flush_control = _glewSearchExtension("EGL_KHR_context_flush_control", extStart, extEnd); +#endif /* EGL_KHR_context_flush_control */ +#ifdef EGL_KHR_create_context + EGLEW_KHR_create_context = _glewSearchExtension("EGL_KHR_create_context", extStart, extEnd); +#endif /* EGL_KHR_create_context */ +#ifdef EGL_KHR_create_context_no_error + EGLEW_KHR_create_context_no_error = _glewSearchExtension("EGL_KHR_create_context_no_error", extStart, extEnd); +#endif /* EGL_KHR_create_context_no_error */ +#ifdef EGL_KHR_debug + EGLEW_KHR_debug = _glewSearchExtension("EGL_KHR_debug", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_debug) EGLEW_KHR_debug = !_glewInit_EGL_KHR_debug(); +#endif /* EGL_KHR_debug */ +#ifdef EGL_KHR_fence_sync + EGLEW_KHR_fence_sync = _glewSearchExtension("EGL_KHR_fence_sync", extStart, extEnd); +#endif /* EGL_KHR_fence_sync */ +#ifdef EGL_KHR_get_all_proc_addresses + EGLEW_KHR_get_all_proc_addresses = _glewSearchExtension("EGL_KHR_get_all_proc_addresses", extStart, extEnd); +#endif /* EGL_KHR_get_all_proc_addresses */ +#ifdef EGL_KHR_gl_colorspace + EGLEW_KHR_gl_colorspace = _glewSearchExtension("EGL_KHR_gl_colorspace", extStart, extEnd); +#endif /* EGL_KHR_gl_colorspace */ +#ifdef EGL_KHR_gl_renderbuffer_image + EGLEW_KHR_gl_renderbuffer_image = _glewSearchExtension("EGL_KHR_gl_renderbuffer_image", extStart, extEnd); +#endif /* EGL_KHR_gl_renderbuffer_image */ +#ifdef EGL_KHR_gl_texture_2D_image + EGLEW_KHR_gl_texture_2D_image = _glewSearchExtension("EGL_KHR_gl_texture_2D_image", extStart, extEnd); +#endif /* EGL_KHR_gl_texture_2D_image */ +#ifdef EGL_KHR_gl_texture_3D_image + EGLEW_KHR_gl_texture_3D_image = _glewSearchExtension("EGL_KHR_gl_texture_3D_image", extStart, extEnd); +#endif /* EGL_KHR_gl_texture_3D_image */ +#ifdef EGL_KHR_gl_texture_cubemap_image + EGLEW_KHR_gl_texture_cubemap_image = _glewSearchExtension("EGL_KHR_gl_texture_cubemap_image", extStart, extEnd); +#endif /* EGL_KHR_gl_texture_cubemap_image */ +#ifdef EGL_KHR_image + EGLEW_KHR_image = _glewSearchExtension("EGL_KHR_image", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_image) EGLEW_KHR_image = !_glewInit_EGL_KHR_image(); +#endif /* EGL_KHR_image */ +#ifdef EGL_KHR_image_base + EGLEW_KHR_image_base = _glewSearchExtension("EGL_KHR_image_base", extStart, extEnd); +#endif /* EGL_KHR_image_base */ +#ifdef EGL_KHR_image_pixmap + EGLEW_KHR_image_pixmap = _glewSearchExtension("EGL_KHR_image_pixmap", extStart, extEnd); +#endif /* EGL_KHR_image_pixmap */ +#ifdef EGL_KHR_lock_surface + EGLEW_KHR_lock_surface = _glewSearchExtension("EGL_KHR_lock_surface", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_lock_surface) EGLEW_KHR_lock_surface = !_glewInit_EGL_KHR_lock_surface(); +#endif /* EGL_KHR_lock_surface */ +#ifdef EGL_KHR_lock_surface2 + EGLEW_KHR_lock_surface2 = _glewSearchExtension("EGL_KHR_lock_surface2", extStart, extEnd); +#endif /* EGL_KHR_lock_surface2 */ +#ifdef EGL_KHR_lock_surface3 + EGLEW_KHR_lock_surface3 = _glewSearchExtension("EGL_KHR_lock_surface3", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_lock_surface3) EGLEW_KHR_lock_surface3 = !_glewInit_EGL_KHR_lock_surface3(); +#endif /* EGL_KHR_lock_surface3 */ +#ifdef EGL_KHR_mutable_render_buffer + EGLEW_KHR_mutable_render_buffer = _glewSearchExtension("EGL_KHR_mutable_render_buffer", extStart, extEnd); +#endif /* EGL_KHR_mutable_render_buffer */ +#ifdef EGL_KHR_no_config_context + EGLEW_KHR_no_config_context = _glewSearchExtension("EGL_KHR_no_config_context", extStart, extEnd); +#endif /* EGL_KHR_no_config_context */ +#ifdef EGL_KHR_partial_update + EGLEW_KHR_partial_update = _glewSearchExtension("EGL_KHR_partial_update", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_partial_update) EGLEW_KHR_partial_update = !_glewInit_EGL_KHR_partial_update(); +#endif /* EGL_KHR_partial_update */ +#ifdef EGL_KHR_platform_android + EGLEW_KHR_platform_android = _glewSearchExtension("EGL_KHR_platform_android", extStart, extEnd); +#endif /* EGL_KHR_platform_android */ +#ifdef EGL_KHR_platform_gbm + EGLEW_KHR_platform_gbm = _glewSearchExtension("EGL_KHR_platform_gbm", extStart, extEnd); +#endif /* EGL_KHR_platform_gbm */ +#ifdef EGL_KHR_platform_wayland + EGLEW_KHR_platform_wayland = _glewSearchExtension("EGL_KHR_platform_wayland", extStart, extEnd); +#endif /* EGL_KHR_platform_wayland */ +#ifdef EGL_KHR_platform_x11 + EGLEW_KHR_platform_x11 = _glewSearchExtension("EGL_KHR_platform_x11", extStart, extEnd); +#endif /* EGL_KHR_platform_x11 */ +#ifdef EGL_KHR_reusable_sync + EGLEW_KHR_reusable_sync = _glewSearchExtension("EGL_KHR_reusable_sync", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_reusable_sync) EGLEW_KHR_reusable_sync = !_glewInit_EGL_KHR_reusable_sync(); +#endif /* EGL_KHR_reusable_sync */ +#ifdef EGL_KHR_stream + EGLEW_KHR_stream = _glewSearchExtension("EGL_KHR_stream", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_stream) EGLEW_KHR_stream = !_glewInit_EGL_KHR_stream(); +#endif /* EGL_KHR_stream */ +#ifdef EGL_KHR_stream_attrib + EGLEW_KHR_stream_attrib = _glewSearchExtension("EGL_KHR_stream_attrib", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_stream_attrib) EGLEW_KHR_stream_attrib = !_glewInit_EGL_KHR_stream_attrib(); +#endif /* EGL_KHR_stream_attrib */ +#ifdef EGL_KHR_stream_consumer_gltexture + EGLEW_KHR_stream_consumer_gltexture = _glewSearchExtension("EGL_KHR_stream_consumer_gltexture", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_stream_consumer_gltexture) EGLEW_KHR_stream_consumer_gltexture = !_glewInit_EGL_KHR_stream_consumer_gltexture(); +#endif /* EGL_KHR_stream_consumer_gltexture */ +#ifdef EGL_KHR_stream_cross_process_fd + EGLEW_KHR_stream_cross_process_fd = _glewSearchExtension("EGL_KHR_stream_cross_process_fd", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_stream_cross_process_fd) EGLEW_KHR_stream_cross_process_fd = !_glewInit_EGL_KHR_stream_cross_process_fd(); +#endif /* EGL_KHR_stream_cross_process_fd */ +#ifdef EGL_KHR_stream_fifo + EGLEW_KHR_stream_fifo = _glewSearchExtension("EGL_KHR_stream_fifo", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_stream_fifo) EGLEW_KHR_stream_fifo = !_glewInit_EGL_KHR_stream_fifo(); +#endif /* EGL_KHR_stream_fifo */ +#ifdef EGL_KHR_stream_producer_aldatalocator + EGLEW_KHR_stream_producer_aldatalocator = _glewSearchExtension("EGL_KHR_stream_producer_aldatalocator", extStart, extEnd); +#endif /* EGL_KHR_stream_producer_aldatalocator */ +#ifdef EGL_KHR_stream_producer_eglsurface + EGLEW_KHR_stream_producer_eglsurface = _glewSearchExtension("EGL_KHR_stream_producer_eglsurface", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_stream_producer_eglsurface) EGLEW_KHR_stream_producer_eglsurface = !_glewInit_EGL_KHR_stream_producer_eglsurface(); +#endif /* EGL_KHR_stream_producer_eglsurface */ +#ifdef EGL_KHR_surfaceless_context + EGLEW_KHR_surfaceless_context = _glewSearchExtension("EGL_KHR_surfaceless_context", extStart, extEnd); +#endif /* EGL_KHR_surfaceless_context */ +#ifdef EGL_KHR_swap_buffers_with_damage + EGLEW_KHR_swap_buffers_with_damage = _glewSearchExtension("EGL_KHR_swap_buffers_with_damage", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_swap_buffers_with_damage) EGLEW_KHR_swap_buffers_with_damage = !_glewInit_EGL_KHR_swap_buffers_with_damage(); +#endif /* EGL_KHR_swap_buffers_with_damage */ +#ifdef EGL_KHR_vg_parent_image + EGLEW_KHR_vg_parent_image = _glewSearchExtension("EGL_KHR_vg_parent_image", extStart, extEnd); +#endif /* EGL_KHR_vg_parent_image */ +#ifdef EGL_KHR_wait_sync + EGLEW_KHR_wait_sync = _glewSearchExtension("EGL_KHR_wait_sync", extStart, extEnd); + if (glewExperimental || EGLEW_KHR_wait_sync) EGLEW_KHR_wait_sync = !_glewInit_EGL_KHR_wait_sync(); +#endif /* EGL_KHR_wait_sync */ +#ifdef EGL_MESA_drm_image + EGLEW_MESA_drm_image = _glewSearchExtension("EGL_MESA_drm_image", extStart, extEnd); + if (glewExperimental || EGLEW_MESA_drm_image) EGLEW_MESA_drm_image = !_glewInit_EGL_MESA_drm_image(); +#endif /* EGL_MESA_drm_image */ +#ifdef EGL_MESA_image_dma_buf_export + EGLEW_MESA_image_dma_buf_export = _glewSearchExtension("EGL_MESA_image_dma_buf_export", extStart, extEnd); + if (glewExperimental || EGLEW_MESA_image_dma_buf_export) EGLEW_MESA_image_dma_buf_export = !_glewInit_EGL_MESA_image_dma_buf_export(); +#endif /* EGL_MESA_image_dma_buf_export */ +#ifdef EGL_MESA_platform_gbm + EGLEW_MESA_platform_gbm = _glewSearchExtension("EGL_MESA_platform_gbm", extStart, extEnd); +#endif /* EGL_MESA_platform_gbm */ +#ifdef EGL_MESA_platform_surfaceless + EGLEW_MESA_platform_surfaceless = _glewSearchExtension("EGL_MESA_platform_surfaceless", extStart, extEnd); +#endif /* EGL_MESA_platform_surfaceless */ +#ifdef EGL_NOK_swap_region + EGLEW_NOK_swap_region = _glewSearchExtension("EGL_NOK_swap_region", extStart, extEnd); + if (glewExperimental || EGLEW_NOK_swap_region) EGLEW_NOK_swap_region = !_glewInit_EGL_NOK_swap_region(); +#endif /* EGL_NOK_swap_region */ +#ifdef EGL_NOK_swap_region2 + EGLEW_NOK_swap_region2 = _glewSearchExtension("EGL_NOK_swap_region2", extStart, extEnd); + if (glewExperimental || EGLEW_NOK_swap_region2) EGLEW_NOK_swap_region2 = !_glewInit_EGL_NOK_swap_region2(); +#endif /* EGL_NOK_swap_region2 */ +#ifdef EGL_NOK_texture_from_pixmap + EGLEW_NOK_texture_from_pixmap = _glewSearchExtension("EGL_NOK_texture_from_pixmap", extStart, extEnd); +#endif /* EGL_NOK_texture_from_pixmap */ +#ifdef EGL_NV_3dvision_surface + EGLEW_NV_3dvision_surface = _glewSearchExtension("EGL_NV_3dvision_surface", extStart, extEnd); +#endif /* EGL_NV_3dvision_surface */ +#ifdef EGL_NV_coverage_sample + EGLEW_NV_coverage_sample = _glewSearchExtension("EGL_NV_coverage_sample", extStart, extEnd); +#endif /* EGL_NV_coverage_sample */ +#ifdef EGL_NV_coverage_sample_resolve + EGLEW_NV_coverage_sample_resolve = _glewSearchExtension("EGL_NV_coverage_sample_resolve", extStart, extEnd); +#endif /* EGL_NV_coverage_sample_resolve */ +#ifdef EGL_NV_cuda_event + EGLEW_NV_cuda_event = _glewSearchExtension("EGL_NV_cuda_event", extStart, extEnd); +#endif /* EGL_NV_cuda_event */ +#ifdef EGL_NV_depth_nonlinear + EGLEW_NV_depth_nonlinear = _glewSearchExtension("EGL_NV_depth_nonlinear", extStart, extEnd); +#endif /* EGL_NV_depth_nonlinear */ +#ifdef EGL_NV_device_cuda + EGLEW_NV_device_cuda = _glewSearchExtension("EGL_NV_device_cuda", extStart, extEnd); +#endif /* EGL_NV_device_cuda */ +#ifdef EGL_NV_native_query + EGLEW_NV_native_query = _glewSearchExtension("EGL_NV_native_query", extStart, extEnd); + if (glewExperimental || EGLEW_NV_native_query) EGLEW_NV_native_query = !_glewInit_EGL_NV_native_query(); +#endif /* EGL_NV_native_query */ +#ifdef EGL_NV_post_convert_rounding + EGLEW_NV_post_convert_rounding = _glewSearchExtension("EGL_NV_post_convert_rounding", extStart, extEnd); +#endif /* EGL_NV_post_convert_rounding */ +#ifdef EGL_NV_post_sub_buffer + EGLEW_NV_post_sub_buffer = _glewSearchExtension("EGL_NV_post_sub_buffer", extStart, extEnd); + if (glewExperimental || EGLEW_NV_post_sub_buffer) EGLEW_NV_post_sub_buffer = !_glewInit_EGL_NV_post_sub_buffer(); +#endif /* EGL_NV_post_sub_buffer */ +#ifdef EGL_NV_robustness_video_memory_purge + EGLEW_NV_robustness_video_memory_purge = _glewSearchExtension("EGL_NV_robustness_video_memory_purge", extStart, extEnd); +#endif /* EGL_NV_robustness_video_memory_purge */ +#ifdef EGL_NV_stream_consumer_gltexture_yuv + EGLEW_NV_stream_consumer_gltexture_yuv = _glewSearchExtension("EGL_NV_stream_consumer_gltexture_yuv", extStart, extEnd); + if (glewExperimental || EGLEW_NV_stream_consumer_gltexture_yuv) EGLEW_NV_stream_consumer_gltexture_yuv = !_glewInit_EGL_NV_stream_consumer_gltexture_yuv(); +#endif /* EGL_NV_stream_consumer_gltexture_yuv */ +#ifdef EGL_NV_stream_cross_display + EGLEW_NV_stream_cross_display = _glewSearchExtension("EGL_NV_stream_cross_display", extStart, extEnd); +#endif /* EGL_NV_stream_cross_display */ +#ifdef EGL_NV_stream_cross_object + EGLEW_NV_stream_cross_object = _glewSearchExtension("EGL_NV_stream_cross_object", extStart, extEnd); +#endif /* EGL_NV_stream_cross_object */ +#ifdef EGL_NV_stream_cross_partition + EGLEW_NV_stream_cross_partition = _glewSearchExtension("EGL_NV_stream_cross_partition", extStart, extEnd); +#endif /* EGL_NV_stream_cross_partition */ +#ifdef EGL_NV_stream_cross_process + EGLEW_NV_stream_cross_process = _glewSearchExtension("EGL_NV_stream_cross_process", extStart, extEnd); +#endif /* EGL_NV_stream_cross_process */ +#ifdef EGL_NV_stream_cross_system + EGLEW_NV_stream_cross_system = _glewSearchExtension("EGL_NV_stream_cross_system", extStart, extEnd); +#endif /* EGL_NV_stream_cross_system */ +#ifdef EGL_NV_stream_fifo_next + EGLEW_NV_stream_fifo_next = _glewSearchExtension("EGL_NV_stream_fifo_next", extStart, extEnd); +#endif /* EGL_NV_stream_fifo_next */ +#ifdef EGL_NV_stream_fifo_synchronous + EGLEW_NV_stream_fifo_synchronous = _glewSearchExtension("EGL_NV_stream_fifo_synchronous", extStart, extEnd); +#endif /* EGL_NV_stream_fifo_synchronous */ +#ifdef EGL_NV_stream_frame_limits + EGLEW_NV_stream_frame_limits = _glewSearchExtension("EGL_NV_stream_frame_limits", extStart, extEnd); +#endif /* EGL_NV_stream_frame_limits */ +#ifdef EGL_NV_stream_metadata + EGLEW_NV_stream_metadata = _glewSearchExtension("EGL_NV_stream_metadata", extStart, extEnd); + if (glewExperimental || EGLEW_NV_stream_metadata) EGLEW_NV_stream_metadata = !_glewInit_EGL_NV_stream_metadata(); +#endif /* EGL_NV_stream_metadata */ +#ifdef EGL_NV_stream_remote + EGLEW_NV_stream_remote = _glewSearchExtension("EGL_NV_stream_remote", extStart, extEnd); +#endif /* EGL_NV_stream_remote */ +#ifdef EGL_NV_stream_reset + EGLEW_NV_stream_reset = _glewSearchExtension("EGL_NV_stream_reset", extStart, extEnd); + if (glewExperimental || EGLEW_NV_stream_reset) EGLEW_NV_stream_reset = !_glewInit_EGL_NV_stream_reset(); +#endif /* EGL_NV_stream_reset */ +#ifdef EGL_NV_stream_socket + EGLEW_NV_stream_socket = _glewSearchExtension("EGL_NV_stream_socket", extStart, extEnd); +#endif /* EGL_NV_stream_socket */ +#ifdef EGL_NV_stream_socket_inet + EGLEW_NV_stream_socket_inet = _glewSearchExtension("EGL_NV_stream_socket_inet", extStart, extEnd); +#endif /* EGL_NV_stream_socket_inet */ +#ifdef EGL_NV_stream_socket_unix + EGLEW_NV_stream_socket_unix = _glewSearchExtension("EGL_NV_stream_socket_unix", extStart, extEnd); +#endif /* EGL_NV_stream_socket_unix */ +#ifdef EGL_NV_stream_sync + EGLEW_NV_stream_sync = _glewSearchExtension("EGL_NV_stream_sync", extStart, extEnd); + if (glewExperimental || EGLEW_NV_stream_sync) EGLEW_NV_stream_sync = !_glewInit_EGL_NV_stream_sync(); +#endif /* EGL_NV_stream_sync */ +#ifdef EGL_NV_sync + EGLEW_NV_sync = _glewSearchExtension("EGL_NV_sync", extStart, extEnd); + if (glewExperimental || EGLEW_NV_sync) EGLEW_NV_sync = !_glewInit_EGL_NV_sync(); +#endif /* EGL_NV_sync */ +#ifdef EGL_NV_system_time + EGLEW_NV_system_time = _glewSearchExtension("EGL_NV_system_time", extStart, extEnd); + if (glewExperimental || EGLEW_NV_system_time) EGLEW_NV_system_time = !_glewInit_EGL_NV_system_time(); +#endif /* EGL_NV_system_time */ +#ifdef EGL_TIZEN_image_native_buffer + EGLEW_TIZEN_image_native_buffer = _glewSearchExtension("EGL_TIZEN_image_native_buffer", extStart, extEnd); +#endif /* EGL_TIZEN_image_native_buffer */ +#ifdef EGL_TIZEN_image_native_surface + EGLEW_TIZEN_image_native_surface = _glewSearchExtension("EGL_TIZEN_image_native_surface", extStart, extEnd); +#endif /* EGL_TIZEN_image_native_surface */ + + return GLEW_OK; +} + +#elif defined(_WIN32) PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL = NULL; +PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD = NULL; +PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD = NULL; +PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD = NULL; +PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD = NULL; +PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD = NULL; +PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD = NULL; +PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD = NULL; +PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD = NULL; +PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD = NULL; + PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB = NULL; PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB = NULL; PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB = NULL; PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB = NULL; +PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB = NULL; + PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB = NULL; PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB = NULL; @@ -6536,15 +18904,52 @@ PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D = NULL; PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D = NULL; PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D = NULL; +PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV = NULL; +PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV = NULL; +PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV = NULL; +PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV = NULL; +PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV = NULL; +PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV = NULL; +PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV = NULL; +PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV = NULL; + +PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV = NULL; + +PFNWGLDELAYBEFORESWAPNVPROC __wglewDelayBeforeSwapNV = NULL; + PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV = NULL; PFNWGLDELETEDCNVPROC __wglewDeleteDCNV = NULL; PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV = NULL; PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV = NULL; PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV = NULL; +PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV = NULL; +PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV = NULL; +PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV = NULL; + +PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV = NULL; +PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV = NULL; +PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV = NULL; +PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV = NULL; +PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV = NULL; +PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV = NULL; + PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV = NULL; PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV = NULL; +PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV = NULL; +PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV = NULL; +PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV = NULL; +PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV = NULL; +PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV = NULL; + +PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV = NULL; +PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV = NULL; +PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV = NULL; +PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV = NULL; +PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV = NULL; +PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV = NULL; + PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML = NULL; PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML = NULL; PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML = NULL; @@ -6553,16 +18958,28 @@ PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML = NULL; PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML = NULL; GLboolean __WGLEW_3DFX_multisample = GL_FALSE; GLboolean __WGLEW_3DL_stereo_control = GL_FALSE; +GLboolean __WGLEW_AMD_gpu_association = GL_FALSE; GLboolean __WGLEW_ARB_buffer_region = GL_FALSE; +GLboolean __WGLEW_ARB_context_flush_control = GL_FALSE; +GLboolean __WGLEW_ARB_create_context = GL_FALSE; +GLboolean __WGLEW_ARB_create_context_no_error = GL_FALSE; +GLboolean __WGLEW_ARB_create_context_profile = GL_FALSE; +GLboolean __WGLEW_ARB_create_context_robustness = GL_FALSE; GLboolean __WGLEW_ARB_extensions_string = GL_FALSE; +GLboolean __WGLEW_ARB_framebuffer_sRGB = GL_FALSE; GLboolean __WGLEW_ARB_make_current_read = GL_FALSE; GLboolean __WGLEW_ARB_multisample = GL_FALSE; GLboolean __WGLEW_ARB_pbuffer = GL_FALSE; GLboolean __WGLEW_ARB_pixel_format = GL_FALSE; GLboolean __WGLEW_ARB_pixel_format_float = GL_FALSE; GLboolean __WGLEW_ARB_render_texture = GL_FALSE; +GLboolean __WGLEW_ARB_robustness_application_isolation = GL_FALSE; +GLboolean __WGLEW_ARB_robustness_share_group_isolation = GL_FALSE; GLboolean __WGLEW_ATI_pixel_format_float = GL_FALSE; GLboolean __WGLEW_ATI_render_texture_rectangle = GL_FALSE; +GLboolean __WGLEW_EXT_colorspace = GL_FALSE; +GLboolean __WGLEW_EXT_create_context_es2_profile = GL_FALSE; +GLboolean __WGLEW_EXT_create_context_es_profile = GL_FALSE; GLboolean __WGLEW_EXT_depth_float = GL_FALSE; GLboolean __WGLEW_EXT_display_color_table = GL_FALSE; GLboolean __WGLEW_EXT_extensions_string = GL_FALSE; @@ -6573,28 +18990,31 @@ GLboolean __WGLEW_EXT_pbuffer = GL_FALSE; GLboolean __WGLEW_EXT_pixel_format = GL_FALSE; GLboolean __WGLEW_EXT_pixel_format_packed_float = GL_FALSE; GLboolean __WGLEW_EXT_swap_control = GL_FALSE; +GLboolean __WGLEW_EXT_swap_control_tear = GL_FALSE; GLboolean __WGLEW_I3D_digital_video_control = GL_FALSE; GLboolean __WGLEW_I3D_gamma = GL_FALSE; GLboolean __WGLEW_I3D_genlock = GL_FALSE; GLboolean __WGLEW_I3D_image_buffer = GL_FALSE; GLboolean __WGLEW_I3D_swap_frame_lock = GL_FALSE; GLboolean __WGLEW_I3D_swap_frame_usage = GL_FALSE; +GLboolean __WGLEW_NV_DX_interop = GL_FALSE; +GLboolean __WGLEW_NV_DX_interop2 = GL_FALSE; +GLboolean __WGLEW_NV_copy_image = GL_FALSE; +GLboolean __WGLEW_NV_delay_before_swap = GL_FALSE; GLboolean __WGLEW_NV_float_buffer = GL_FALSE; GLboolean __WGLEW_NV_gpu_affinity = GL_FALSE; +GLboolean __WGLEW_NV_multisample_coverage = GL_FALSE; +GLboolean __WGLEW_NV_present_video = GL_FALSE; GLboolean __WGLEW_NV_render_depth_texture = GL_FALSE; GLboolean __WGLEW_NV_render_texture_rectangle = GL_FALSE; +GLboolean __WGLEW_NV_swap_group = GL_FALSE; GLboolean __WGLEW_NV_vertex_array_range = GL_FALSE; +GLboolean __WGLEW_NV_video_capture = GL_FALSE; +GLboolean __WGLEW_NV_video_output = GL_FALSE; GLboolean __WGLEW_OML_sync_control = GL_FALSE; - -#endif /* !GLEW_MX */ - -#ifdef WGL_3DFX_multisample - -#endif /* WGL_3DFX_multisample */ - #ifdef WGL_3DL_stereo_control -static GLboolean _glewInit_WGL_3DL_stereo_control (WGLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_WGL_3DL_stereo_control () { GLboolean r = GL_FALSE; @@ -6605,9 +19025,30 @@ static GLboolean _glewInit_WGL_3DL_stereo_control (WGLEW_CONTEXT_ARG_DEF_INIT) #endif /* WGL_3DL_stereo_control */ +#ifdef WGL_AMD_gpu_association + +static GLboolean _glewInit_WGL_AMD_gpu_association () +{ + GLboolean r = GL_FALSE; + + r = ((wglBlitContextFramebufferAMD = (PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC)glewGetProcAddress((const GLubyte*)"wglBlitContextFramebufferAMD")) == NULL) || r; + r = ((wglCreateAssociatedContextAMD = (PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglCreateAssociatedContextAMD")) == NULL) || r; + r = ((wglCreateAssociatedContextAttribsAMD = (PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC)glewGetProcAddress((const GLubyte*)"wglCreateAssociatedContextAttribsAMD")) == NULL) || r; + r = ((wglDeleteAssociatedContextAMD = (PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglDeleteAssociatedContextAMD")) == NULL) || r; + r = ((wglGetContextGPUIDAMD = (PFNWGLGETCONTEXTGPUIDAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetContextGPUIDAMD")) == NULL) || r; + r = ((wglGetCurrentAssociatedContextAMD = (PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentAssociatedContextAMD")) == NULL) || r; + r = ((wglGetGPUIDsAMD = (PFNWGLGETGPUIDSAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetGPUIDsAMD")) == NULL) || r; + r = ((wglGetGPUInfoAMD = (PFNWGLGETGPUINFOAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetGPUInfoAMD")) == NULL) || r; + r = ((wglMakeAssociatedContextCurrentAMD = (PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC)glewGetProcAddress((const GLubyte*)"wglMakeAssociatedContextCurrentAMD")) == NULL) || r; + + return r; +} + +#endif /* WGL_AMD_gpu_association */ + #ifdef WGL_ARB_buffer_region -static GLboolean _glewInit_WGL_ARB_buffer_region (WGLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_WGL_ARB_buffer_region () { GLboolean r = GL_FALSE; @@ -6621,9 +19062,22 @@ static GLboolean _glewInit_WGL_ARB_buffer_region (WGLEW_CONTEXT_ARG_DEF_INIT) #endif /* WGL_ARB_buffer_region */ +#ifdef WGL_ARB_create_context + +static GLboolean _glewInit_WGL_ARB_create_context () +{ + GLboolean r = GL_FALSE; + + r = ((wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)glewGetProcAddress((const GLubyte*)"wglCreateContextAttribsARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_create_context */ + #ifdef WGL_ARB_extensions_string -static GLboolean _glewInit_WGL_ARB_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_WGL_ARB_extensions_string () { GLboolean r = GL_FALSE; @@ -6636,7 +19090,7 @@ static GLboolean _glewInit_WGL_ARB_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT #ifdef WGL_ARB_make_current_read -static GLboolean _glewInit_WGL_ARB_make_current_read (WGLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_WGL_ARB_make_current_read () { GLboolean r = GL_FALSE; @@ -6648,13 +19102,9 @@ static GLboolean _glewInit_WGL_ARB_make_current_read (WGLEW_CONTEXT_ARG_DEF_INIT #endif /* WGL_ARB_make_current_read */ -#ifdef WGL_ARB_multisample - -#endif /* WGL_ARB_multisample */ - #ifdef WGL_ARB_pbuffer -static GLboolean _glewInit_WGL_ARB_pbuffer (WGLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_WGL_ARB_pbuffer () { GLboolean r = GL_FALSE; @@ -6671,7 +19121,7 @@ static GLboolean _glewInit_WGL_ARB_pbuffer (WGLEW_CONTEXT_ARG_DEF_INIT) #ifdef WGL_ARB_pixel_format -static GLboolean _glewInit_WGL_ARB_pixel_format (WGLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_WGL_ARB_pixel_format () { GLboolean r = GL_FALSE; @@ -6684,13 +19134,9 @@ static GLboolean _glewInit_WGL_ARB_pixel_format (WGLEW_CONTEXT_ARG_DEF_INIT) #endif /* WGL_ARB_pixel_format */ -#ifdef WGL_ARB_pixel_format_float - -#endif /* WGL_ARB_pixel_format_float */ - #ifdef WGL_ARB_render_texture -static GLboolean _glewInit_WGL_ARB_render_texture (WGLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_WGL_ARB_render_texture () { GLboolean r = GL_FALSE; @@ -6703,21 +19149,9 @@ static GLboolean _glewInit_WGL_ARB_render_texture (WGLEW_CONTEXT_ARG_DEF_INIT) #endif /* WGL_ARB_render_texture */ -#ifdef WGL_ATI_pixel_format_float - -#endif /* WGL_ATI_pixel_format_float */ - -#ifdef WGL_ATI_render_texture_rectangle - -#endif /* WGL_ATI_render_texture_rectangle */ - -#ifdef WGL_EXT_depth_float - -#endif /* WGL_EXT_depth_float */ - #ifdef WGL_EXT_display_color_table -static GLboolean _glewInit_WGL_EXT_display_color_table (WGLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_WGL_EXT_display_color_table () { GLboolean r = GL_FALSE; @@ -6733,7 +19167,7 @@ static GLboolean _glewInit_WGL_EXT_display_color_table (WGLEW_CONTEXT_ARG_DEF_IN #ifdef WGL_EXT_extensions_string -static GLboolean _glewInit_WGL_EXT_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_WGL_EXT_extensions_string () { GLboolean r = GL_FALSE; @@ -6744,13 +19178,9 @@ static GLboolean _glewInit_WGL_EXT_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT #endif /* WGL_EXT_extensions_string */ -#ifdef WGL_EXT_framebuffer_sRGB - -#endif /* WGL_EXT_framebuffer_sRGB */ - #ifdef WGL_EXT_make_current_read -static GLboolean _glewInit_WGL_EXT_make_current_read (WGLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_WGL_EXT_make_current_read () { GLboolean r = GL_FALSE; @@ -6762,13 +19192,9 @@ static GLboolean _glewInit_WGL_EXT_make_current_read (WGLEW_CONTEXT_ARG_DEF_INIT #endif /* WGL_EXT_make_current_read */ -#ifdef WGL_EXT_multisample - -#endif /* WGL_EXT_multisample */ - #ifdef WGL_EXT_pbuffer -static GLboolean _glewInit_WGL_EXT_pbuffer (WGLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_WGL_EXT_pbuffer () { GLboolean r = GL_FALSE; @@ -6785,7 +19211,7 @@ static GLboolean _glewInit_WGL_EXT_pbuffer (WGLEW_CONTEXT_ARG_DEF_INIT) #ifdef WGL_EXT_pixel_format -static GLboolean _glewInit_WGL_EXT_pixel_format (WGLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_WGL_EXT_pixel_format () { GLboolean r = GL_FALSE; @@ -6798,13 +19224,9 @@ static GLboolean _glewInit_WGL_EXT_pixel_format (WGLEW_CONTEXT_ARG_DEF_INIT) #endif /* WGL_EXT_pixel_format */ -#ifdef WGL_EXT_pixel_format_packed_float - -#endif /* WGL_EXT_pixel_format_packed_float */ - #ifdef WGL_EXT_swap_control -static GLboolean _glewInit_WGL_EXT_swap_control (WGLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_WGL_EXT_swap_control () { GLboolean r = GL_FALSE; @@ -6818,7 +19240,7 @@ static GLboolean _glewInit_WGL_EXT_swap_control (WGLEW_CONTEXT_ARG_DEF_INIT) #ifdef WGL_I3D_digital_video_control -static GLboolean _glewInit_WGL_I3D_digital_video_control (WGLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_WGL_I3D_digital_video_control () { GLboolean r = GL_FALSE; @@ -6832,7 +19254,7 @@ static GLboolean _glewInit_WGL_I3D_digital_video_control (WGLEW_CONTEXT_ARG_DEF_ #ifdef WGL_I3D_gamma -static GLboolean _glewInit_WGL_I3D_gamma (WGLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_WGL_I3D_gamma () { GLboolean r = GL_FALSE; @@ -6848,7 +19270,7 @@ static GLboolean _glewInit_WGL_I3D_gamma (WGLEW_CONTEXT_ARG_DEF_INIT) #ifdef WGL_I3D_genlock -static GLboolean _glewInit_WGL_I3D_genlock (WGLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_WGL_I3D_genlock () { GLboolean r = GL_FALSE; @@ -6872,7 +19294,7 @@ static GLboolean _glewInit_WGL_I3D_genlock (WGLEW_CONTEXT_ARG_DEF_INIT) #ifdef WGL_I3D_image_buffer -static GLboolean _glewInit_WGL_I3D_image_buffer (WGLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_WGL_I3D_image_buffer () { GLboolean r = GL_FALSE; @@ -6888,7 +19310,7 @@ static GLboolean _glewInit_WGL_I3D_image_buffer (WGLEW_CONTEXT_ARG_DEF_INIT) #ifdef WGL_I3D_swap_frame_lock -static GLboolean _glewInit_WGL_I3D_swap_frame_lock (WGLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_WGL_I3D_swap_frame_lock () { GLboolean r = GL_FALSE; @@ -6904,7 +19326,7 @@ static GLboolean _glewInit_WGL_I3D_swap_frame_lock (WGLEW_CONTEXT_ARG_DEF_INIT) #ifdef WGL_I3D_swap_frame_usage -static GLboolean _glewInit_WGL_I3D_swap_frame_usage (WGLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_WGL_I3D_swap_frame_usage () { GLboolean r = GL_FALSE; @@ -6918,13 +19340,55 @@ static GLboolean _glewInit_WGL_I3D_swap_frame_usage (WGLEW_CONTEXT_ARG_DEF_INIT) #endif /* WGL_I3D_swap_frame_usage */ -#ifdef WGL_NV_float_buffer +#ifdef WGL_NV_DX_interop -#endif /* WGL_NV_float_buffer */ +static GLboolean _glewInit_WGL_NV_DX_interop () +{ + GLboolean r = GL_FALSE; + + r = ((wglDXCloseDeviceNV = (PFNWGLDXCLOSEDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglDXCloseDeviceNV")) == NULL) || r; + r = ((wglDXLockObjectsNV = (PFNWGLDXLOCKOBJECTSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXLockObjectsNV")) == NULL) || r; + r = ((wglDXObjectAccessNV = (PFNWGLDXOBJECTACCESSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXObjectAccessNV")) == NULL) || r; + r = ((wglDXOpenDeviceNV = (PFNWGLDXOPENDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglDXOpenDeviceNV")) == NULL) || r; + r = ((wglDXRegisterObjectNV = (PFNWGLDXREGISTEROBJECTNVPROC)glewGetProcAddress((const GLubyte*)"wglDXRegisterObjectNV")) == NULL) || r; + r = ((wglDXSetResourceShareHandleNV = (PFNWGLDXSETRESOURCESHAREHANDLENVPROC)glewGetProcAddress((const GLubyte*)"wglDXSetResourceShareHandleNV")) == NULL) || r; + r = ((wglDXUnlockObjectsNV = (PFNWGLDXUNLOCKOBJECTSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXUnlockObjectsNV")) == NULL) || r; + r = ((wglDXUnregisterObjectNV = (PFNWGLDXUNREGISTEROBJECTNVPROC)glewGetProcAddress((const GLubyte*)"wglDXUnregisterObjectNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_DX_interop */ + +#ifdef WGL_NV_copy_image + +static GLboolean _glewInit_WGL_NV_copy_image () +{ + GLboolean r = GL_FALSE; + + r = ((wglCopyImageSubDataNV = (PFNWGLCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"wglCopyImageSubDataNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_copy_image */ + +#ifdef WGL_NV_delay_before_swap + +static GLboolean _glewInit_WGL_NV_delay_before_swap () +{ + GLboolean r = GL_FALSE; + + r = ((wglDelayBeforeSwapNV = (PFNWGLDELAYBEFORESWAPNVPROC)glewGetProcAddress((const GLubyte*)"wglDelayBeforeSwapNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_delay_before_swap */ #ifdef WGL_NV_gpu_affinity -static GLboolean _glewInit_WGL_NV_gpu_affinity (WGLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_WGL_NV_gpu_affinity () { GLboolean r = GL_FALSE; @@ -6939,17 +19403,42 @@ static GLboolean _glewInit_WGL_NV_gpu_affinity (WGLEW_CONTEXT_ARG_DEF_INIT) #endif /* WGL_NV_gpu_affinity */ -#ifdef WGL_NV_render_depth_texture +#ifdef WGL_NV_present_video -#endif /* WGL_NV_render_depth_texture */ +static GLboolean _glewInit_WGL_NV_present_video () +{ + GLboolean r = GL_FALSE; -#ifdef WGL_NV_render_texture_rectangle + r = ((wglBindVideoDeviceNV = (PFNWGLBINDVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoDeviceNV")) == NULL) || r; + r = ((wglEnumerateVideoDevicesNV = (PFNWGLENUMERATEVIDEODEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumerateVideoDevicesNV")) == NULL) || r; + r = ((wglQueryCurrentContextNV = (PFNWGLQUERYCURRENTCONTEXTNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryCurrentContextNV")) == NULL) || r; -#endif /* WGL_NV_render_texture_rectangle */ + return r; +} + +#endif /* WGL_NV_present_video */ + +#ifdef WGL_NV_swap_group + +static GLboolean _glewInit_WGL_NV_swap_group () +{ + GLboolean r = GL_FALSE; + + r = ((wglBindSwapBarrierNV = (PFNWGLBINDSWAPBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"wglBindSwapBarrierNV")) == NULL) || r; + r = ((wglJoinSwapGroupNV = (PFNWGLJOINSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"wglJoinSwapGroupNV")) == NULL) || r; + r = ((wglQueryFrameCountNV = (PFNWGLQUERYFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameCountNV")) == NULL) || r; + r = ((wglQueryMaxSwapGroupsNV = (PFNWGLQUERYMAXSWAPGROUPSNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryMaxSwapGroupsNV")) == NULL) || r; + r = ((wglQuerySwapGroupNV = (PFNWGLQUERYSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"wglQuerySwapGroupNV")) == NULL) || r; + r = ((wglResetFrameCountNV = (PFNWGLRESETFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"wglResetFrameCountNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_swap_group */ #ifdef WGL_NV_vertex_array_range -static GLboolean _glewInit_WGL_NV_vertex_array_range (WGLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_WGL_NV_vertex_array_range () { GLboolean r = GL_FALSE; @@ -6961,9 +19450,44 @@ static GLboolean _glewInit_WGL_NV_vertex_array_range (WGLEW_CONTEXT_ARG_DEF_INIT #endif /* WGL_NV_vertex_array_range */ +#ifdef WGL_NV_video_capture + +static GLboolean _glewInit_WGL_NV_video_capture () +{ + GLboolean r = GL_FALSE; + + r = ((wglBindVideoCaptureDeviceNV = (PFNWGLBINDVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoCaptureDeviceNV")) == NULL) || r; + r = ((wglEnumerateVideoCaptureDevicesNV = (PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumerateVideoCaptureDevicesNV")) == NULL) || r; + r = ((wglLockVideoCaptureDeviceNV = (PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglLockVideoCaptureDeviceNV")) == NULL) || r; + r = ((wglQueryVideoCaptureDeviceNV = (PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglQueryVideoCaptureDeviceNV")) == NULL) || r; + r = ((wglReleaseVideoCaptureDeviceNV = (PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoCaptureDeviceNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_video_capture */ + +#ifdef WGL_NV_video_output + +static GLboolean _glewInit_WGL_NV_video_output () +{ + GLboolean r = GL_FALSE; + + r = ((wglBindVideoImageNV = (PFNWGLBINDVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoImageNV")) == NULL) || r; + r = ((wglGetVideoDeviceNV = (PFNWGLGETVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglGetVideoDeviceNV")) == NULL) || r; + r = ((wglGetVideoInfoNV = (PFNWGLGETVIDEOINFONVPROC)glewGetProcAddress((const GLubyte*)"wglGetVideoInfoNV")) == NULL) || r; + r = ((wglReleaseVideoDeviceNV = (PFNWGLRELEASEVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoDeviceNV")) == NULL) || r; + r = ((wglReleaseVideoImageNV = (PFNWGLRELEASEVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoImageNV")) == NULL) || r; + r = ((wglSendPbufferToVideoNV = (PFNWGLSENDPBUFFERTOVIDEONVPROC)glewGetProcAddress((const GLubyte*)"wglSendPbufferToVideoNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_video_output */ + #ifdef WGL_OML_sync_control -static GLboolean _glewInit_WGL_OML_sync_control (WGLEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_WGL_OML_sync_control () { GLboolean r = GL_FALSE; @@ -6984,166 +19508,246 @@ static GLboolean _glewInit_WGL_OML_sync_control (WGLEW_CONTEXT_ARG_DEF_INIT) static PFNWGLGETEXTENSIONSSTRINGARBPROC _wglewGetExtensionsStringARB = NULL; static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT = NULL; -GLboolean wglewGetExtension (const char* name) -{ - GLubyte* p; - GLubyte* end; - GLuint len = _glewStrLen((const GLubyte*)name); +GLboolean GLEWAPIENTRY wglewGetExtension (const char* name) +{ + const GLubyte* start; + const GLubyte* end; if (_wglewGetExtensionsStringARB == NULL) if (_wglewGetExtensionsStringEXT == NULL) return GL_FALSE; else - p = (GLubyte*)_wglewGetExtensionsStringEXT(); + start = (const GLubyte*)_wglewGetExtensionsStringEXT(); else - p = (GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC()); - if (0 == p) return GL_FALSE; - end = p + _glewStrLen(p); - while (p < end) - { - GLuint n = _glewStrCLen(p, ' '); - if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE; - p += n+1; - } - return GL_FALSE; + start = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC()); + if (start == 0) + return GL_FALSE; + end = start + _glewStrLen(start); + return _glewSearchExtension(name, start, end); } -GLenum wglewContextInit (WGLEW_CONTEXT_ARG_DEF_LIST) +GLenum GLEWAPIENTRY wglewInit () { GLboolean crippled; + const GLubyte* extStart; + const GLubyte* extEnd; /* find wgl extension string query functions */ _wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB"); _wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT"); + /* query wgl extension string */ + if (_wglewGetExtensionsStringARB == NULL) + if (_wglewGetExtensionsStringEXT == NULL) + extStart = (const GLubyte*)""; + else + extStart = (const GLubyte*)_wglewGetExtensionsStringEXT(); + else + extStart = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC()); + extEnd = extStart + _glewStrLen(extStart); /* initialize extensions */ crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL; #ifdef WGL_3DFX_multisample - CONST_CAST(WGLEW_3DFX_multisample) = wglewGetExtension("WGL_3DFX_multisample"); + WGLEW_3DFX_multisample = _glewSearchExtension("WGL_3DFX_multisample", extStart, extEnd); #endif /* WGL_3DFX_multisample */ #ifdef WGL_3DL_stereo_control - CONST_CAST(WGLEW_3DL_stereo_control) = wglewGetExtension("WGL_3DL_stereo_control"); - if (glewExperimental || WGLEW_3DL_stereo_control|| crippled) CONST_CAST(WGLEW_3DL_stereo_control)= !_glewInit_WGL_3DL_stereo_control(GLEW_CONTEXT_ARG_VAR_INIT); + WGLEW_3DL_stereo_control = _glewSearchExtension("WGL_3DL_stereo_control", extStart, extEnd); + if (glewExperimental || WGLEW_3DL_stereo_control|| crippled) WGLEW_3DL_stereo_control= !_glewInit_WGL_3DL_stereo_control(); #endif /* WGL_3DL_stereo_control */ +#ifdef WGL_AMD_gpu_association + WGLEW_AMD_gpu_association = _glewSearchExtension("WGL_AMD_gpu_association", extStart, extEnd); + if (glewExperimental || WGLEW_AMD_gpu_association|| crippled) WGLEW_AMD_gpu_association= !_glewInit_WGL_AMD_gpu_association(); +#endif /* WGL_AMD_gpu_association */ #ifdef WGL_ARB_buffer_region - CONST_CAST(WGLEW_ARB_buffer_region) = wglewGetExtension("WGL_ARB_buffer_region"); - if (glewExperimental || WGLEW_ARB_buffer_region|| crippled) CONST_CAST(WGLEW_ARB_buffer_region)= !_glewInit_WGL_ARB_buffer_region(GLEW_CONTEXT_ARG_VAR_INIT); + WGLEW_ARB_buffer_region = _glewSearchExtension("WGL_ARB_buffer_region", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_buffer_region|| crippled) WGLEW_ARB_buffer_region= !_glewInit_WGL_ARB_buffer_region(); #endif /* WGL_ARB_buffer_region */ +#ifdef WGL_ARB_context_flush_control + WGLEW_ARB_context_flush_control = _glewSearchExtension("WGL_ARB_context_flush_control", extStart, extEnd); +#endif /* WGL_ARB_context_flush_control */ +#ifdef WGL_ARB_create_context + WGLEW_ARB_create_context = _glewSearchExtension("WGL_ARB_create_context", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_create_context|| crippled) WGLEW_ARB_create_context= !_glewInit_WGL_ARB_create_context(); +#endif /* WGL_ARB_create_context */ +#ifdef WGL_ARB_create_context_no_error + WGLEW_ARB_create_context_no_error = _glewSearchExtension("WGL_ARB_create_context_no_error", extStart, extEnd); +#endif /* WGL_ARB_create_context_no_error */ +#ifdef WGL_ARB_create_context_profile + WGLEW_ARB_create_context_profile = _glewSearchExtension("WGL_ARB_create_context_profile", extStart, extEnd); +#endif /* WGL_ARB_create_context_profile */ +#ifdef WGL_ARB_create_context_robustness + WGLEW_ARB_create_context_robustness = _glewSearchExtension("WGL_ARB_create_context_robustness", extStart, extEnd); +#endif /* WGL_ARB_create_context_robustness */ #ifdef WGL_ARB_extensions_string - CONST_CAST(WGLEW_ARB_extensions_string) = wglewGetExtension("WGL_ARB_extensions_string"); - if (glewExperimental || WGLEW_ARB_extensions_string|| crippled) CONST_CAST(WGLEW_ARB_extensions_string)= !_glewInit_WGL_ARB_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT); + WGLEW_ARB_extensions_string = _glewSearchExtension("WGL_ARB_extensions_string", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_extensions_string|| crippled) WGLEW_ARB_extensions_string= !_glewInit_WGL_ARB_extensions_string(); #endif /* WGL_ARB_extensions_string */ +#ifdef WGL_ARB_framebuffer_sRGB + WGLEW_ARB_framebuffer_sRGB = _glewSearchExtension("WGL_ARB_framebuffer_sRGB", extStart, extEnd); +#endif /* WGL_ARB_framebuffer_sRGB */ #ifdef WGL_ARB_make_current_read - CONST_CAST(WGLEW_ARB_make_current_read) = wglewGetExtension("WGL_ARB_make_current_read"); - if (glewExperimental || WGLEW_ARB_make_current_read|| crippled) CONST_CAST(WGLEW_ARB_make_current_read)= !_glewInit_WGL_ARB_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); + WGLEW_ARB_make_current_read = _glewSearchExtension("WGL_ARB_make_current_read", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_make_current_read|| crippled) WGLEW_ARB_make_current_read= !_glewInit_WGL_ARB_make_current_read(); #endif /* WGL_ARB_make_current_read */ #ifdef WGL_ARB_multisample - CONST_CAST(WGLEW_ARB_multisample) = wglewGetExtension("WGL_ARB_multisample"); + WGLEW_ARB_multisample = _glewSearchExtension("WGL_ARB_multisample", extStart, extEnd); #endif /* WGL_ARB_multisample */ #ifdef WGL_ARB_pbuffer - CONST_CAST(WGLEW_ARB_pbuffer) = wglewGetExtension("WGL_ARB_pbuffer"); - if (glewExperimental || WGLEW_ARB_pbuffer|| crippled) CONST_CAST(WGLEW_ARB_pbuffer)= !_glewInit_WGL_ARB_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); + WGLEW_ARB_pbuffer = _glewSearchExtension("WGL_ARB_pbuffer", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_pbuffer|| crippled) WGLEW_ARB_pbuffer= !_glewInit_WGL_ARB_pbuffer(); #endif /* WGL_ARB_pbuffer */ #ifdef WGL_ARB_pixel_format - CONST_CAST(WGLEW_ARB_pixel_format) = wglewGetExtension("WGL_ARB_pixel_format"); - if (glewExperimental || WGLEW_ARB_pixel_format|| crippled) CONST_CAST(WGLEW_ARB_pixel_format)= !_glewInit_WGL_ARB_pixel_format(GLEW_CONTEXT_ARG_VAR_INIT); + WGLEW_ARB_pixel_format = _glewSearchExtension("WGL_ARB_pixel_format", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_pixel_format|| crippled) WGLEW_ARB_pixel_format= !_glewInit_WGL_ARB_pixel_format(); #endif /* WGL_ARB_pixel_format */ #ifdef WGL_ARB_pixel_format_float - CONST_CAST(WGLEW_ARB_pixel_format_float) = wglewGetExtension("WGL_ARB_pixel_format_float"); + WGLEW_ARB_pixel_format_float = _glewSearchExtension("WGL_ARB_pixel_format_float", extStart, extEnd); #endif /* WGL_ARB_pixel_format_float */ #ifdef WGL_ARB_render_texture - CONST_CAST(WGLEW_ARB_render_texture) = wglewGetExtension("WGL_ARB_render_texture"); - if (glewExperimental || WGLEW_ARB_render_texture|| crippled) CONST_CAST(WGLEW_ARB_render_texture)= !_glewInit_WGL_ARB_render_texture(GLEW_CONTEXT_ARG_VAR_INIT); + WGLEW_ARB_render_texture = _glewSearchExtension("WGL_ARB_render_texture", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_render_texture|| crippled) WGLEW_ARB_render_texture= !_glewInit_WGL_ARB_render_texture(); #endif /* WGL_ARB_render_texture */ +#ifdef WGL_ARB_robustness_application_isolation + WGLEW_ARB_robustness_application_isolation = _glewSearchExtension("WGL_ARB_robustness_application_isolation", extStart, extEnd); +#endif /* WGL_ARB_robustness_application_isolation */ +#ifdef WGL_ARB_robustness_share_group_isolation + WGLEW_ARB_robustness_share_group_isolation = _glewSearchExtension("WGL_ARB_robustness_share_group_isolation", extStart, extEnd); +#endif /* WGL_ARB_robustness_share_group_isolation */ #ifdef WGL_ATI_pixel_format_float - CONST_CAST(WGLEW_ATI_pixel_format_float) = wglewGetExtension("WGL_ATI_pixel_format_float"); + WGLEW_ATI_pixel_format_float = _glewSearchExtension("WGL_ATI_pixel_format_float", extStart, extEnd); #endif /* WGL_ATI_pixel_format_float */ #ifdef WGL_ATI_render_texture_rectangle - CONST_CAST(WGLEW_ATI_render_texture_rectangle) = wglewGetExtension("WGL_ATI_render_texture_rectangle"); + WGLEW_ATI_render_texture_rectangle = _glewSearchExtension("WGL_ATI_render_texture_rectangle", extStart, extEnd); #endif /* WGL_ATI_render_texture_rectangle */ +#ifdef WGL_EXT_colorspace + WGLEW_EXT_colorspace = _glewSearchExtension("WGL_EXT_colorspace", extStart, extEnd); +#endif /* WGL_EXT_colorspace */ +#ifdef WGL_EXT_create_context_es2_profile + WGLEW_EXT_create_context_es2_profile = _glewSearchExtension("WGL_EXT_create_context_es2_profile", extStart, extEnd); +#endif /* WGL_EXT_create_context_es2_profile */ +#ifdef WGL_EXT_create_context_es_profile + WGLEW_EXT_create_context_es_profile = _glewSearchExtension("WGL_EXT_create_context_es_profile", extStart, extEnd); +#endif /* WGL_EXT_create_context_es_profile */ #ifdef WGL_EXT_depth_float - CONST_CAST(WGLEW_EXT_depth_float) = wglewGetExtension("WGL_EXT_depth_float"); + WGLEW_EXT_depth_float = _glewSearchExtension("WGL_EXT_depth_float", extStart, extEnd); #endif /* WGL_EXT_depth_float */ #ifdef WGL_EXT_display_color_table - CONST_CAST(WGLEW_EXT_display_color_table) = wglewGetExtension("WGL_EXT_display_color_table"); - if (glewExperimental || WGLEW_EXT_display_color_table|| crippled) CONST_CAST(WGLEW_EXT_display_color_table)= !_glewInit_WGL_EXT_display_color_table(GLEW_CONTEXT_ARG_VAR_INIT); + WGLEW_EXT_display_color_table = _glewSearchExtension("WGL_EXT_display_color_table", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_display_color_table|| crippled) WGLEW_EXT_display_color_table= !_glewInit_WGL_EXT_display_color_table(); #endif /* WGL_EXT_display_color_table */ #ifdef WGL_EXT_extensions_string - CONST_CAST(WGLEW_EXT_extensions_string) = wglewGetExtension("WGL_EXT_extensions_string"); - if (glewExperimental || WGLEW_EXT_extensions_string|| crippled) CONST_CAST(WGLEW_EXT_extensions_string)= !_glewInit_WGL_EXT_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT); + WGLEW_EXT_extensions_string = _glewSearchExtension("WGL_EXT_extensions_string", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_extensions_string|| crippled) WGLEW_EXT_extensions_string= !_glewInit_WGL_EXT_extensions_string(); #endif /* WGL_EXT_extensions_string */ #ifdef WGL_EXT_framebuffer_sRGB - CONST_CAST(WGLEW_EXT_framebuffer_sRGB) = wglewGetExtension("WGL_EXT_framebuffer_sRGB"); + WGLEW_EXT_framebuffer_sRGB = _glewSearchExtension("WGL_EXT_framebuffer_sRGB", extStart, extEnd); #endif /* WGL_EXT_framebuffer_sRGB */ #ifdef WGL_EXT_make_current_read - CONST_CAST(WGLEW_EXT_make_current_read) = wglewGetExtension("WGL_EXT_make_current_read"); - if (glewExperimental || WGLEW_EXT_make_current_read|| crippled) CONST_CAST(WGLEW_EXT_make_current_read)= !_glewInit_WGL_EXT_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); + WGLEW_EXT_make_current_read = _glewSearchExtension("WGL_EXT_make_current_read", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_make_current_read|| crippled) WGLEW_EXT_make_current_read= !_glewInit_WGL_EXT_make_current_read(); #endif /* WGL_EXT_make_current_read */ #ifdef WGL_EXT_multisample - CONST_CAST(WGLEW_EXT_multisample) = wglewGetExtension("WGL_EXT_multisample"); + WGLEW_EXT_multisample = _glewSearchExtension("WGL_EXT_multisample", extStart, extEnd); #endif /* WGL_EXT_multisample */ #ifdef WGL_EXT_pbuffer - CONST_CAST(WGLEW_EXT_pbuffer) = wglewGetExtension("WGL_EXT_pbuffer"); - if (glewExperimental || WGLEW_EXT_pbuffer|| crippled) CONST_CAST(WGLEW_EXT_pbuffer)= !_glewInit_WGL_EXT_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); + WGLEW_EXT_pbuffer = _glewSearchExtension("WGL_EXT_pbuffer", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_pbuffer|| crippled) WGLEW_EXT_pbuffer= !_glewInit_WGL_EXT_pbuffer(); #endif /* WGL_EXT_pbuffer */ #ifdef WGL_EXT_pixel_format - CONST_CAST(WGLEW_EXT_pixel_format) = wglewGetExtension("WGL_EXT_pixel_format"); - if (glewExperimental || WGLEW_EXT_pixel_format|| crippled) CONST_CAST(WGLEW_EXT_pixel_format)= !_glewInit_WGL_EXT_pixel_format(GLEW_CONTEXT_ARG_VAR_INIT); + WGLEW_EXT_pixel_format = _glewSearchExtension("WGL_EXT_pixel_format", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_pixel_format|| crippled) WGLEW_EXT_pixel_format= !_glewInit_WGL_EXT_pixel_format(); #endif /* WGL_EXT_pixel_format */ #ifdef WGL_EXT_pixel_format_packed_float - CONST_CAST(WGLEW_EXT_pixel_format_packed_float) = wglewGetExtension("WGL_EXT_pixel_format_packed_float"); + WGLEW_EXT_pixel_format_packed_float = _glewSearchExtension("WGL_EXT_pixel_format_packed_float", extStart, extEnd); #endif /* WGL_EXT_pixel_format_packed_float */ #ifdef WGL_EXT_swap_control - CONST_CAST(WGLEW_EXT_swap_control) = wglewGetExtension("WGL_EXT_swap_control"); - if (glewExperimental || WGLEW_EXT_swap_control|| crippled) CONST_CAST(WGLEW_EXT_swap_control)= !_glewInit_WGL_EXT_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); + WGLEW_EXT_swap_control = _glewSearchExtension("WGL_EXT_swap_control", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_swap_control|| crippled) WGLEW_EXT_swap_control= !_glewInit_WGL_EXT_swap_control(); #endif /* WGL_EXT_swap_control */ +#ifdef WGL_EXT_swap_control_tear + WGLEW_EXT_swap_control_tear = _glewSearchExtension("WGL_EXT_swap_control_tear", extStart, extEnd); +#endif /* WGL_EXT_swap_control_tear */ #ifdef WGL_I3D_digital_video_control - CONST_CAST(WGLEW_I3D_digital_video_control) = wglewGetExtension("WGL_I3D_digital_video_control"); - if (glewExperimental || WGLEW_I3D_digital_video_control|| crippled) CONST_CAST(WGLEW_I3D_digital_video_control)= !_glewInit_WGL_I3D_digital_video_control(GLEW_CONTEXT_ARG_VAR_INIT); + WGLEW_I3D_digital_video_control = _glewSearchExtension("WGL_I3D_digital_video_control", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_digital_video_control|| crippled) WGLEW_I3D_digital_video_control= !_glewInit_WGL_I3D_digital_video_control(); #endif /* WGL_I3D_digital_video_control */ #ifdef WGL_I3D_gamma - CONST_CAST(WGLEW_I3D_gamma) = wglewGetExtension("WGL_I3D_gamma"); - if (glewExperimental || WGLEW_I3D_gamma|| crippled) CONST_CAST(WGLEW_I3D_gamma)= !_glewInit_WGL_I3D_gamma(GLEW_CONTEXT_ARG_VAR_INIT); + WGLEW_I3D_gamma = _glewSearchExtension("WGL_I3D_gamma", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_gamma|| crippled) WGLEW_I3D_gamma= !_glewInit_WGL_I3D_gamma(); #endif /* WGL_I3D_gamma */ #ifdef WGL_I3D_genlock - CONST_CAST(WGLEW_I3D_genlock) = wglewGetExtension("WGL_I3D_genlock"); - if (glewExperimental || WGLEW_I3D_genlock|| crippled) CONST_CAST(WGLEW_I3D_genlock)= !_glewInit_WGL_I3D_genlock(GLEW_CONTEXT_ARG_VAR_INIT); + WGLEW_I3D_genlock = _glewSearchExtension("WGL_I3D_genlock", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_genlock|| crippled) WGLEW_I3D_genlock= !_glewInit_WGL_I3D_genlock(); #endif /* WGL_I3D_genlock */ #ifdef WGL_I3D_image_buffer - CONST_CAST(WGLEW_I3D_image_buffer) = wglewGetExtension("WGL_I3D_image_buffer"); - if (glewExperimental || WGLEW_I3D_image_buffer|| crippled) CONST_CAST(WGLEW_I3D_image_buffer)= !_glewInit_WGL_I3D_image_buffer(GLEW_CONTEXT_ARG_VAR_INIT); + WGLEW_I3D_image_buffer = _glewSearchExtension("WGL_I3D_image_buffer", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_image_buffer|| crippled) WGLEW_I3D_image_buffer= !_glewInit_WGL_I3D_image_buffer(); #endif /* WGL_I3D_image_buffer */ #ifdef WGL_I3D_swap_frame_lock - CONST_CAST(WGLEW_I3D_swap_frame_lock) = wglewGetExtension("WGL_I3D_swap_frame_lock"); - if (glewExperimental || WGLEW_I3D_swap_frame_lock|| crippled) CONST_CAST(WGLEW_I3D_swap_frame_lock)= !_glewInit_WGL_I3D_swap_frame_lock(GLEW_CONTEXT_ARG_VAR_INIT); + WGLEW_I3D_swap_frame_lock = _glewSearchExtension("WGL_I3D_swap_frame_lock", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_swap_frame_lock|| crippled) WGLEW_I3D_swap_frame_lock= !_glewInit_WGL_I3D_swap_frame_lock(); #endif /* WGL_I3D_swap_frame_lock */ #ifdef WGL_I3D_swap_frame_usage - CONST_CAST(WGLEW_I3D_swap_frame_usage) = wglewGetExtension("WGL_I3D_swap_frame_usage"); - if (glewExperimental || WGLEW_I3D_swap_frame_usage|| crippled) CONST_CAST(WGLEW_I3D_swap_frame_usage)= !_glewInit_WGL_I3D_swap_frame_usage(GLEW_CONTEXT_ARG_VAR_INIT); + WGLEW_I3D_swap_frame_usage = _glewSearchExtension("WGL_I3D_swap_frame_usage", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_swap_frame_usage|| crippled) WGLEW_I3D_swap_frame_usage= !_glewInit_WGL_I3D_swap_frame_usage(); #endif /* WGL_I3D_swap_frame_usage */ +#ifdef WGL_NV_DX_interop + WGLEW_NV_DX_interop = _glewSearchExtension("WGL_NV_DX_interop", extStart, extEnd); + if (glewExperimental || WGLEW_NV_DX_interop|| crippled) WGLEW_NV_DX_interop= !_glewInit_WGL_NV_DX_interop(); +#endif /* WGL_NV_DX_interop */ +#ifdef WGL_NV_DX_interop2 + WGLEW_NV_DX_interop2 = _glewSearchExtension("WGL_NV_DX_interop2", extStart, extEnd); +#endif /* WGL_NV_DX_interop2 */ +#ifdef WGL_NV_copy_image + WGLEW_NV_copy_image = _glewSearchExtension("WGL_NV_copy_image", extStart, extEnd); + if (glewExperimental || WGLEW_NV_copy_image|| crippled) WGLEW_NV_copy_image= !_glewInit_WGL_NV_copy_image(); +#endif /* WGL_NV_copy_image */ +#ifdef WGL_NV_delay_before_swap + WGLEW_NV_delay_before_swap = _glewSearchExtension("WGL_NV_delay_before_swap", extStart, extEnd); + if (glewExperimental || WGLEW_NV_delay_before_swap|| crippled) WGLEW_NV_delay_before_swap= !_glewInit_WGL_NV_delay_before_swap(); +#endif /* WGL_NV_delay_before_swap */ #ifdef WGL_NV_float_buffer - CONST_CAST(WGLEW_NV_float_buffer) = wglewGetExtension("WGL_NV_float_buffer"); + WGLEW_NV_float_buffer = _glewSearchExtension("WGL_NV_float_buffer", extStart, extEnd); #endif /* WGL_NV_float_buffer */ #ifdef WGL_NV_gpu_affinity - CONST_CAST(WGLEW_NV_gpu_affinity) = wglewGetExtension("WGL_NV_gpu_affinity"); - if (glewExperimental || WGLEW_NV_gpu_affinity|| crippled) CONST_CAST(WGLEW_NV_gpu_affinity)= !_glewInit_WGL_NV_gpu_affinity(GLEW_CONTEXT_ARG_VAR_INIT); + WGLEW_NV_gpu_affinity = _glewSearchExtension("WGL_NV_gpu_affinity", extStart, extEnd); + if (glewExperimental || WGLEW_NV_gpu_affinity|| crippled) WGLEW_NV_gpu_affinity= !_glewInit_WGL_NV_gpu_affinity(); #endif /* WGL_NV_gpu_affinity */ +#ifdef WGL_NV_multisample_coverage + WGLEW_NV_multisample_coverage = _glewSearchExtension("WGL_NV_multisample_coverage", extStart, extEnd); +#endif /* WGL_NV_multisample_coverage */ +#ifdef WGL_NV_present_video + WGLEW_NV_present_video = _glewSearchExtension("WGL_NV_present_video", extStart, extEnd); + if (glewExperimental || WGLEW_NV_present_video|| crippled) WGLEW_NV_present_video= !_glewInit_WGL_NV_present_video(); +#endif /* WGL_NV_present_video */ #ifdef WGL_NV_render_depth_texture - CONST_CAST(WGLEW_NV_render_depth_texture) = wglewGetExtension("WGL_NV_render_depth_texture"); + WGLEW_NV_render_depth_texture = _glewSearchExtension("WGL_NV_render_depth_texture", extStart, extEnd); #endif /* WGL_NV_render_depth_texture */ #ifdef WGL_NV_render_texture_rectangle - CONST_CAST(WGLEW_NV_render_texture_rectangle) = wglewGetExtension("WGL_NV_render_texture_rectangle"); + WGLEW_NV_render_texture_rectangle = _glewSearchExtension("WGL_NV_render_texture_rectangle", extStart, extEnd); #endif /* WGL_NV_render_texture_rectangle */ +#ifdef WGL_NV_swap_group + WGLEW_NV_swap_group = _glewSearchExtension("WGL_NV_swap_group", extStart, extEnd); + if (glewExperimental || WGLEW_NV_swap_group|| crippled) WGLEW_NV_swap_group= !_glewInit_WGL_NV_swap_group(); +#endif /* WGL_NV_swap_group */ #ifdef WGL_NV_vertex_array_range - CONST_CAST(WGLEW_NV_vertex_array_range) = wglewGetExtension("WGL_NV_vertex_array_range"); - if (glewExperimental || WGLEW_NV_vertex_array_range|| crippled) CONST_CAST(WGLEW_NV_vertex_array_range)= !_glewInit_WGL_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); + WGLEW_NV_vertex_array_range = _glewSearchExtension("WGL_NV_vertex_array_range", extStart, extEnd); + if (glewExperimental || WGLEW_NV_vertex_array_range|| crippled) WGLEW_NV_vertex_array_range= !_glewInit_WGL_NV_vertex_array_range(); #endif /* WGL_NV_vertex_array_range */ +#ifdef WGL_NV_video_capture + WGLEW_NV_video_capture = _glewSearchExtension("WGL_NV_video_capture", extStart, extEnd); + if (glewExperimental || WGLEW_NV_video_capture|| crippled) WGLEW_NV_video_capture= !_glewInit_WGL_NV_video_capture(); +#endif /* WGL_NV_video_capture */ +#ifdef WGL_NV_video_output + WGLEW_NV_video_output = _glewSearchExtension("WGL_NV_video_output", extStart, extEnd); + if (glewExperimental || WGLEW_NV_video_output|| crippled) WGLEW_NV_video_output= !_glewInit_WGL_NV_video_output(); +#endif /* WGL_NV_video_output */ #ifdef WGL_OML_sync_control - CONST_CAST(WGLEW_OML_sync_control) = wglewGetExtension("WGL_OML_sync_control"); - if (glewExperimental || WGLEW_OML_sync_control|| crippled) CONST_CAST(WGLEW_OML_sync_control)= !_glewInit_WGL_OML_sync_control(GLEW_CONTEXT_ARG_VAR_INIT); + WGLEW_OML_sync_control = _glewSearchExtension("WGL_OML_sync_control", extStart, extEnd); + if (glewExperimental || WGLEW_OML_sync_control|| crippled) WGLEW_OML_sync_control= !_glewInit_WGL_OML_sync_control(); #endif /* WGL_OML_sync_control */ return GLEW_OK; } -#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) +#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay = NULL; @@ -7165,6 +19769,18 @@ PFNGLXQUERYCONTEXTPROC __glewXQueryContext = NULL; PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable = NULL; PFNGLXSELECTEVENTPROC __glewXSelectEvent = NULL; +PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC __glewXBlitContextFramebufferAMD = NULL; +PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC __glewXCreateAssociatedContextAMD = NULL; +PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __glewXCreateAssociatedContextAttribsAMD = NULL; +PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC __glewXDeleteAssociatedContextAMD = NULL; +PFNGLXGETCONTEXTGPUIDAMDPROC __glewXGetContextGPUIDAMD = NULL; +PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC __glewXGetCurrentAssociatedContextAMD = NULL; +PFNGLXGETGPUIDSAMDPROC __glewXGetGPUIDsAMD = NULL; +PFNGLXGETGPUINFOAMDPROC __glewXGetGPUInfoAMD = NULL; +PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __glewXMakeAssociatedContextCurrentAMD = NULL; + +PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB = NULL; + PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI = NULL; PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI = NULL; PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI = NULL; @@ -7174,6 +19790,8 @@ PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT = NULL; PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT = NULL; PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT = NULL; +PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT = NULL; + PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT = NULL; PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT = NULL; @@ -7183,20 +19801,56 @@ PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA = NULL; PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA = NULL; +PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC __glewXQueryCurrentRendererIntegerMESA = NULL; +PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC __glewXQueryCurrentRendererStringMESA = NULL; +PFNGLXQUERYRENDERERINTEGERMESAPROC __glewXQueryRendererIntegerMESA = NULL; +PFNGLXQUERYRENDERERSTRINGMESAPROC __glewXQueryRendererStringMESA = NULL; + PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA = NULL; PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA = NULL; +PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA = NULL; +PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA = NULL; + +PFNGLXCOPYBUFFERSUBDATANVPROC __glewXCopyBufferSubDataNV = NULL; +PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC __glewXNamedCopyBufferSubDataNV = NULL; + +PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV = NULL; + +PFNGLXDELAYBEFORESWAPNVPROC __glewXDelayBeforeSwapNV = NULL; + +PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV = NULL; +PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV = NULL; + +PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV = NULL; +PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV = NULL; +PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV = NULL; +PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV = NULL; +PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV = NULL; +PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV = NULL; + PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV = NULL; PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV = NULL; -#ifdef GLX_OML_sync_control +PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV = NULL; +PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV = NULL; +PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV = NULL; +PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV = NULL; +PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV = NULL; + +PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV = NULL; +PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV = NULL; +PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV = NULL; +PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV = NULL; +PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV = NULL; +PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV = NULL; + PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML = NULL; PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML = NULL; PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML = NULL; PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML = NULL; PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML = NULL; -#endif PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX = NULL; PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX = NULL; @@ -7246,37 +19900,62 @@ PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN = NULL; PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN = NULL; PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN = NULL; -#if !defined(GLEW_MX) - GLboolean __GLXEW_VERSION_1_0 = GL_FALSE; GLboolean __GLXEW_VERSION_1_1 = GL_FALSE; GLboolean __GLXEW_VERSION_1_2 = GL_FALSE; GLboolean __GLXEW_VERSION_1_3 = GL_FALSE; GLboolean __GLXEW_VERSION_1_4 = GL_FALSE; GLboolean __GLXEW_3DFX_multisample = GL_FALSE; +GLboolean __GLXEW_AMD_gpu_association = GL_FALSE; +GLboolean __GLXEW_ARB_context_flush_control = GL_FALSE; +GLboolean __GLXEW_ARB_create_context = GL_FALSE; +GLboolean __GLXEW_ARB_create_context_no_error = GL_FALSE; +GLboolean __GLXEW_ARB_create_context_profile = GL_FALSE; +GLboolean __GLXEW_ARB_create_context_robustness = GL_FALSE; GLboolean __GLXEW_ARB_fbconfig_float = GL_FALSE; +GLboolean __GLXEW_ARB_framebuffer_sRGB = GL_FALSE; GLboolean __GLXEW_ARB_get_proc_address = GL_FALSE; GLboolean __GLXEW_ARB_multisample = GL_FALSE; +GLboolean __GLXEW_ARB_robustness_application_isolation = GL_FALSE; +GLboolean __GLXEW_ARB_robustness_share_group_isolation = GL_FALSE; +GLboolean __GLXEW_ARB_vertex_buffer_object = GL_FALSE; GLboolean __GLXEW_ATI_pixel_format_float = GL_FALSE; GLboolean __GLXEW_ATI_render_texture = GL_FALSE; +GLboolean __GLXEW_EXT_buffer_age = GL_FALSE; +GLboolean __GLXEW_EXT_create_context_es2_profile = GL_FALSE; +GLboolean __GLXEW_EXT_create_context_es_profile = GL_FALSE; GLboolean __GLXEW_EXT_fbconfig_packed_float = GL_FALSE; GLboolean __GLXEW_EXT_framebuffer_sRGB = GL_FALSE; GLboolean __GLXEW_EXT_import_context = GL_FALSE; +GLboolean __GLXEW_EXT_libglvnd = GL_FALSE; GLboolean __GLXEW_EXT_scene_marker = GL_FALSE; +GLboolean __GLXEW_EXT_stereo_tree = GL_FALSE; +GLboolean __GLXEW_EXT_swap_control = GL_FALSE; +GLboolean __GLXEW_EXT_swap_control_tear = GL_FALSE; GLboolean __GLXEW_EXT_texture_from_pixmap = GL_FALSE; GLboolean __GLXEW_EXT_visual_info = GL_FALSE; GLboolean __GLXEW_EXT_visual_rating = GL_FALSE; +GLboolean __GLXEW_INTEL_swap_event = GL_FALSE; GLboolean __GLXEW_MESA_agp_offset = GL_FALSE; GLboolean __GLXEW_MESA_copy_sub_buffer = GL_FALSE; GLboolean __GLXEW_MESA_pixmap_colormap = GL_FALSE; +GLboolean __GLXEW_MESA_query_renderer = GL_FALSE; GLboolean __GLXEW_MESA_release_buffers = GL_FALSE; GLboolean __GLXEW_MESA_set_3dfx_mode = GL_FALSE; +GLboolean __GLXEW_MESA_swap_control = GL_FALSE; +GLboolean __GLXEW_NV_copy_buffer = GL_FALSE; +GLboolean __GLXEW_NV_copy_image = GL_FALSE; +GLboolean __GLXEW_NV_delay_before_swap = GL_FALSE; GLboolean __GLXEW_NV_float_buffer = GL_FALSE; +GLboolean __GLXEW_NV_multisample_coverage = GL_FALSE; +GLboolean __GLXEW_NV_present_video = GL_FALSE; +GLboolean __GLXEW_NV_robustness_video_memory_purge = GL_FALSE; +GLboolean __GLXEW_NV_swap_group = GL_FALSE; GLboolean __GLXEW_NV_vertex_array_range = GL_FALSE; +GLboolean __GLXEW_NV_video_capture = GL_FALSE; +GLboolean __GLXEW_NV_video_out = GL_FALSE; GLboolean __GLXEW_OML_swap_method = GL_FALSE; -#ifdef GLX_OML_sync_control GLboolean __GLXEW_OML_sync_control = GL_FALSE; -#endif GLboolean __GLXEW_SGIS_blended_overlay = GL_FALSE; GLboolean __GLXEW_SGIS_color_range = GL_FALSE; GLboolean __GLXEW_SGIS_multisample = GL_FALSE; @@ -7294,12 +19973,9 @@ GLboolean __GLXEW_SGI_swap_control = GL_FALSE; GLboolean __GLXEW_SGI_video_sync = GL_FALSE; GLboolean __GLXEW_SUN_get_transparent_index = GL_FALSE; GLboolean __GLXEW_SUN_video_resize = GL_FALSE; - -#endif /* !GLEW_MX */ - #ifdef GLX_VERSION_1_2 -static GLboolean _glewInit_GLX_VERSION_1_2 (GLXEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GLX_VERSION_1_2 () { GLboolean r = GL_FALSE; @@ -7312,7 +19988,7 @@ static GLboolean _glewInit_GLX_VERSION_1_2 (GLXEW_CONTEXT_ARG_DEF_INIT) #ifdef GLX_VERSION_1_3 -static GLboolean _glewInit_GLX_VERSION_1_3 (GLXEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GLX_VERSION_1_3 () { GLboolean r = GL_FALSE; @@ -7339,33 +20015,43 @@ static GLboolean _glewInit_GLX_VERSION_1_3 (GLXEW_CONTEXT_ARG_DEF_INIT) #endif /* GLX_VERSION_1_3 */ -#ifdef GLX_VERSION_1_4 +#ifdef GLX_AMD_gpu_association -#endif /* GLX_VERSION_1_4 */ +static GLboolean _glewInit_GLX_AMD_gpu_association () +{ + GLboolean r = GL_FALSE; -#ifdef GLX_3DFX_multisample + r = ((glXBlitContextFramebufferAMD = (PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC)glewGetProcAddress((const GLubyte*)"glXBlitContextFramebufferAMD")) == NULL) || r; + r = ((glXCreateAssociatedContextAMD = (PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"glXCreateAssociatedContextAMD")) == NULL) || r; + r = ((glXCreateAssociatedContextAttribsAMD = (PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC)glewGetProcAddress((const GLubyte*)"glXCreateAssociatedContextAttribsAMD")) == NULL) || r; + r = ((glXDeleteAssociatedContextAMD = (PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"glXDeleteAssociatedContextAMD")) == NULL) || r; + r = ((glXGetContextGPUIDAMD = (PFNGLXGETCONTEXTGPUIDAMDPROC)glewGetProcAddress((const GLubyte*)"glXGetContextGPUIDAMD")) == NULL) || r; + r = ((glXGetCurrentAssociatedContextAMD = (PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentAssociatedContextAMD")) == NULL) || r; + r = ((glXGetGPUIDsAMD = (PFNGLXGETGPUIDSAMDPROC)glewGetProcAddress((const GLubyte*)"glXGetGPUIDsAMD")) == NULL) || r; + r = ((glXGetGPUInfoAMD = (PFNGLXGETGPUINFOAMDPROC)glewGetProcAddress((const GLubyte*)"glXGetGPUInfoAMD")) == NULL) || r; + r = ((glXMakeAssociatedContextCurrentAMD = (PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC)glewGetProcAddress((const GLubyte*)"glXMakeAssociatedContextCurrentAMD")) == NULL) || r; -#endif /* GLX_3DFX_multisample */ + return r; +} -#ifdef GLX_ARB_fbconfig_float +#endif /* GLX_AMD_gpu_association */ -#endif /* GLX_ARB_fbconfig_float */ +#ifdef GLX_ARB_create_context -#ifdef GLX_ARB_get_proc_address +static GLboolean _glewInit_GLX_ARB_create_context () +{ + GLboolean r = GL_FALSE; -#endif /* GLX_ARB_get_proc_address */ + r = ((glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)glewGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB")) == NULL) || r; -#ifdef GLX_ARB_multisample + return r; +} -#endif /* GLX_ARB_multisample */ - -#ifdef GLX_ATI_pixel_format_float - -#endif /* GLX_ATI_pixel_format_float */ +#endif /* GLX_ARB_create_context */ #ifdef GLX_ATI_render_texture -static GLboolean _glewInit_GLX_ATI_render_texture (GLXEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GLX_ATI_render_texture () { GLboolean r = GL_FALSE; @@ -7378,17 +20064,9 @@ static GLboolean _glewInit_GLX_ATI_render_texture (GLXEW_CONTEXT_ARG_DEF_INIT) #endif /* GLX_ATI_render_texture */ -#ifdef GLX_EXT_fbconfig_packed_float - -#endif /* GLX_EXT_fbconfig_packed_float */ - -#ifdef GLX_EXT_framebuffer_sRGB - -#endif /* GLX_EXT_framebuffer_sRGB */ - #ifdef GLX_EXT_import_context -static GLboolean _glewInit_GLX_EXT_import_context (GLXEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GLX_EXT_import_context () { GLboolean r = GL_FALSE; @@ -7402,13 +20080,22 @@ static GLboolean _glewInit_GLX_EXT_import_context (GLXEW_CONTEXT_ARG_DEF_INIT) #endif /* GLX_EXT_import_context */ -#ifdef GLX_EXT_scene_marker +#ifdef GLX_EXT_swap_control -#endif /* GLX_EXT_scene_marker */ +static GLboolean _glewInit_GLX_EXT_swap_control () +{ + GLboolean r = GL_FALSE; + + r = ((glXSwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalEXT")) == NULL) || r; + + return r; +} + +#endif /* GLX_EXT_swap_control */ #ifdef GLX_EXT_texture_from_pixmap -static GLboolean _glewInit_GLX_EXT_texture_from_pixmap (GLXEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GLX_EXT_texture_from_pixmap () { GLboolean r = GL_FALSE; @@ -7420,17 +20107,9 @@ static GLboolean _glewInit_GLX_EXT_texture_from_pixmap (GLXEW_CONTEXT_ARG_DEF_IN #endif /* GLX_EXT_texture_from_pixmap */ -#ifdef GLX_EXT_visual_info - -#endif /* GLX_EXT_visual_info */ - -#ifdef GLX_EXT_visual_rating - -#endif /* GLX_EXT_visual_rating */ - #ifdef GLX_MESA_agp_offset -static GLboolean _glewInit_GLX_MESA_agp_offset (GLXEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GLX_MESA_agp_offset () { GLboolean r = GL_FALSE; @@ -7443,7 +20122,7 @@ static GLboolean _glewInit_GLX_MESA_agp_offset (GLXEW_CONTEXT_ARG_DEF_INIT) #ifdef GLX_MESA_copy_sub_buffer -static GLboolean _glewInit_GLX_MESA_copy_sub_buffer (GLXEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GLX_MESA_copy_sub_buffer () { GLboolean r = GL_FALSE; @@ -7456,7 +20135,7 @@ static GLboolean _glewInit_GLX_MESA_copy_sub_buffer (GLXEW_CONTEXT_ARG_DEF_INIT) #ifdef GLX_MESA_pixmap_colormap -static GLboolean _glewInit_GLX_MESA_pixmap_colormap (GLXEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GLX_MESA_pixmap_colormap () { GLboolean r = GL_FALSE; @@ -7467,9 +20146,25 @@ static GLboolean _glewInit_GLX_MESA_pixmap_colormap (GLXEW_CONTEXT_ARG_DEF_INIT) #endif /* GLX_MESA_pixmap_colormap */ +#ifdef GLX_MESA_query_renderer + +static GLboolean _glewInit_GLX_MESA_query_renderer () +{ + GLboolean r = GL_FALSE; + + r = ((glXQueryCurrentRendererIntegerMESA = (PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC)glewGetProcAddress((const GLubyte*)"glXQueryCurrentRendererIntegerMESA")) == NULL) || r; + r = ((glXQueryCurrentRendererStringMESA = (PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC)glewGetProcAddress((const GLubyte*)"glXQueryCurrentRendererStringMESA")) == NULL) || r; + r = ((glXQueryRendererIntegerMESA = (PFNGLXQUERYRENDERERINTEGERMESAPROC)glewGetProcAddress((const GLubyte*)"glXQueryRendererIntegerMESA")) == NULL) || r; + r = ((glXQueryRendererStringMESA = (PFNGLXQUERYRENDERERSTRINGMESAPROC)glewGetProcAddress((const GLubyte*)"glXQueryRendererStringMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_query_renderer */ + #ifdef GLX_MESA_release_buffers -static GLboolean _glewInit_GLX_MESA_release_buffers (GLXEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GLX_MESA_release_buffers () { GLboolean r = GL_FALSE; @@ -7482,7 +20177,7 @@ static GLboolean _glewInit_GLX_MESA_release_buffers (GLXEW_CONTEXT_ARG_DEF_INIT) #ifdef GLX_MESA_set_3dfx_mode -static GLboolean _glewInit_GLX_MESA_set_3dfx_mode (GLXEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GLX_MESA_set_3dfx_mode () { GLboolean r = GL_FALSE; @@ -7493,13 +20188,95 @@ static GLboolean _glewInit_GLX_MESA_set_3dfx_mode (GLXEW_CONTEXT_ARG_DEF_INIT) #endif /* GLX_MESA_set_3dfx_mode */ -#ifdef GLX_NV_float_buffer +#ifdef GLX_MESA_swap_control -#endif /* GLX_NV_float_buffer */ +static GLboolean _glewInit_GLX_MESA_swap_control () +{ + GLboolean r = GL_FALSE; + + r = ((glXGetSwapIntervalMESA = (PFNGLXGETSWAPINTERVALMESAPROC)glewGetProcAddress((const GLubyte*)"glXGetSwapIntervalMESA")) == NULL) || r; + r = ((glXSwapIntervalMESA = (PFNGLXSWAPINTERVALMESAPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_swap_control */ + +#ifdef GLX_NV_copy_buffer + +static GLboolean _glewInit_GLX_NV_copy_buffer () +{ + GLboolean r = GL_FALSE; + + r = ((glXCopyBufferSubDataNV = (PFNGLXCOPYBUFFERSUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glXCopyBufferSubDataNV")) == NULL) || r; + r = ((glXNamedCopyBufferSubDataNV = (PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glXNamedCopyBufferSubDataNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_copy_buffer */ + +#ifdef GLX_NV_copy_image + +static GLboolean _glewInit_GLX_NV_copy_image () +{ + GLboolean r = GL_FALSE; + + r = ((glXCopyImageSubDataNV = (PFNGLXCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glXCopyImageSubDataNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_copy_image */ + +#ifdef GLX_NV_delay_before_swap + +static GLboolean _glewInit_GLX_NV_delay_before_swap () +{ + GLboolean r = GL_FALSE; + + r = ((glXDelayBeforeSwapNV = (PFNGLXDELAYBEFORESWAPNVPROC)glewGetProcAddress((const GLubyte*)"glXDelayBeforeSwapNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_delay_before_swap */ + +#ifdef GLX_NV_present_video + +static GLboolean _glewInit_GLX_NV_present_video () +{ + GLboolean r = GL_FALSE; + + r = ((glXBindVideoDeviceNV = (PFNGLXBINDVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoDeviceNV")) == NULL) || r; + r = ((glXEnumerateVideoDevicesNV = (PFNGLXENUMERATEVIDEODEVICESNVPROC)glewGetProcAddress((const GLubyte*)"glXEnumerateVideoDevicesNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_present_video */ + +#ifdef GLX_NV_swap_group + +static GLboolean _glewInit_GLX_NV_swap_group () +{ + GLboolean r = GL_FALSE; + + r = ((glXBindSwapBarrierNV = (PFNGLXBINDSWAPBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glXBindSwapBarrierNV")) == NULL) || r; + r = ((glXJoinSwapGroupNV = (PFNGLXJOINSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"glXJoinSwapGroupNV")) == NULL) || r; + r = ((glXQueryFrameCountNV = (PFNGLXQUERYFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glXQueryFrameCountNV")) == NULL) || r; + r = ((glXQueryMaxSwapGroupsNV = (PFNGLXQUERYMAXSWAPGROUPSNVPROC)glewGetProcAddress((const GLubyte*)"glXQueryMaxSwapGroupsNV")) == NULL) || r; + r = ((glXQuerySwapGroupNV = (PFNGLXQUERYSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"glXQuerySwapGroupNV")) == NULL) || r; + r = ((glXResetFrameCountNV = (PFNGLXRESETFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glXResetFrameCountNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_swap_group */ #ifdef GLX_NV_vertex_array_range -static GLboolean _glewInit_GLX_NV_vertex_array_range (GLXEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GLX_NV_vertex_array_range () { GLboolean r = GL_FALSE; @@ -7511,14 +20288,44 @@ static GLboolean _glewInit_GLX_NV_vertex_array_range (GLXEW_CONTEXT_ARG_DEF_INIT #endif /* GLX_NV_vertex_array_range */ -#ifdef GLX_OML_swap_method +#ifdef GLX_NV_video_capture -#endif /* GLX_OML_swap_method */ +static GLboolean _glewInit_GLX_NV_video_capture () +{ + GLboolean r = GL_FALSE; -#if defined(GLX_OML_sync_control) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) -#include + r = ((glXBindVideoCaptureDeviceNV = (PFNGLXBINDVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoCaptureDeviceNV")) == NULL) || r; + r = ((glXEnumerateVideoCaptureDevicesNV = (PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"glXEnumerateVideoCaptureDevicesNV")) == NULL) || r; + r = ((glXLockVideoCaptureDeviceNV = (PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXLockVideoCaptureDeviceNV")) == NULL) || r; + r = ((glXQueryVideoCaptureDeviceNV = (PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXQueryVideoCaptureDeviceNV")) == NULL) || r; + r = ((glXReleaseVideoCaptureDeviceNV = (PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoCaptureDeviceNV")) == NULL) || r; -static GLboolean _glewInit_GLX_OML_sync_control (GLXEW_CONTEXT_ARG_DEF_INIT) + return r; +} + +#endif /* GLX_NV_video_capture */ + +#ifdef GLX_NV_video_out + +static GLboolean _glewInit_GLX_NV_video_out () +{ + GLboolean r = GL_FALSE; + + r = ((glXBindVideoImageNV = (PFNGLXBINDVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoImageNV")) == NULL) || r; + r = ((glXGetVideoDeviceNV = (PFNGLXGETVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoDeviceNV")) == NULL) || r; + r = ((glXGetVideoInfoNV = (PFNGLXGETVIDEOINFONVPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoInfoNV")) == NULL) || r; + r = ((glXReleaseVideoDeviceNV = (PFNGLXRELEASEVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoDeviceNV")) == NULL) || r; + r = ((glXReleaseVideoImageNV = (PFNGLXRELEASEVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoImageNV")) == NULL) || r; + r = ((glXSendPbufferToVideoNV = (PFNGLXSENDPBUFFERTOVIDEONVPROC)glewGetProcAddress((const GLubyte*)"glXSendPbufferToVideoNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_video_out */ + +#ifdef GLX_OML_sync_control + +static GLboolean _glewInit_GLX_OML_sync_control () { GLboolean r = GL_FALSE; @@ -7533,25 +20340,9 @@ static GLboolean _glewInit_GLX_OML_sync_control (GLXEW_CONTEXT_ARG_DEF_INIT) #endif /* GLX_OML_sync_control */ -#ifdef GLX_SGIS_blended_overlay - -#endif /* GLX_SGIS_blended_overlay */ - -#ifdef GLX_SGIS_color_range - -#endif /* GLX_SGIS_color_range */ - -#ifdef GLX_SGIS_multisample - -#endif /* GLX_SGIS_multisample */ - -#ifdef GLX_SGIS_shared_multisample - -#endif /* GLX_SGIS_shared_multisample */ - #ifdef GLX_SGIX_fbconfig -static GLboolean _glewInit_GLX_SGIX_fbconfig (GLXEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GLX_SGIX_fbconfig () { GLboolean r = GL_FALSE; @@ -7569,7 +20360,7 @@ static GLboolean _glewInit_GLX_SGIX_fbconfig (GLXEW_CONTEXT_ARG_DEF_INIT) #ifdef GLX_SGIX_hyperpipe -static GLboolean _glewInit_GLX_SGIX_hyperpipe (GLXEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GLX_SGIX_hyperpipe () { GLboolean r = GL_FALSE; @@ -7589,7 +20380,7 @@ static GLboolean _glewInit_GLX_SGIX_hyperpipe (GLXEW_CONTEXT_ARG_DEF_INIT) #ifdef GLX_SGIX_pbuffer -static GLboolean _glewInit_GLX_SGIX_pbuffer (GLXEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GLX_SGIX_pbuffer () { GLboolean r = GL_FALSE; @@ -7606,7 +20397,7 @@ static GLboolean _glewInit_GLX_SGIX_pbuffer (GLXEW_CONTEXT_ARG_DEF_INIT) #ifdef GLX_SGIX_swap_barrier -static GLboolean _glewInit_GLX_SGIX_swap_barrier (GLXEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GLX_SGIX_swap_barrier () { GLboolean r = GL_FALSE; @@ -7620,7 +20411,7 @@ static GLboolean _glewInit_GLX_SGIX_swap_barrier (GLXEW_CONTEXT_ARG_DEF_INIT) #ifdef GLX_SGIX_swap_group -static GLboolean _glewInit_GLX_SGIX_swap_group (GLXEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GLX_SGIX_swap_group () { GLboolean r = GL_FALSE; @@ -7633,7 +20424,7 @@ static GLboolean _glewInit_GLX_SGIX_swap_group (GLXEW_CONTEXT_ARG_DEF_INIT) #ifdef GLX_SGIX_video_resize -static GLboolean _glewInit_GLX_SGIX_video_resize (GLXEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GLX_SGIX_video_resize () { GLboolean r = GL_FALSE; @@ -7648,13 +20439,9 @@ static GLboolean _glewInit_GLX_SGIX_video_resize (GLXEW_CONTEXT_ARG_DEF_INIT) #endif /* GLX_SGIX_video_resize */ -#ifdef GLX_SGIX_visual_select_group - -#endif /* GLX_SGIX_visual_select_group */ - #ifdef GLX_SGI_cushion -static GLboolean _glewInit_GLX_SGI_cushion (GLXEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GLX_SGI_cushion () { GLboolean r = GL_FALSE; @@ -7667,7 +20454,7 @@ static GLboolean _glewInit_GLX_SGI_cushion (GLXEW_CONTEXT_ARG_DEF_INIT) #ifdef GLX_SGI_make_current_read -static GLboolean _glewInit_GLX_SGI_make_current_read (GLXEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GLX_SGI_make_current_read () { GLboolean r = GL_FALSE; @@ -7681,7 +20468,7 @@ static GLboolean _glewInit_GLX_SGI_make_current_read (GLXEW_CONTEXT_ARG_DEF_INIT #ifdef GLX_SGI_swap_control -static GLboolean _glewInit_GLX_SGI_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GLX_SGI_swap_control () { GLboolean r = GL_FALSE; @@ -7694,7 +20481,7 @@ static GLboolean _glewInit_GLX_SGI_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT) #ifdef GLX_SGI_video_sync -static GLboolean _glewInit_GLX_SGI_video_sync (GLXEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GLX_SGI_video_sync () { GLboolean r = GL_FALSE; @@ -7708,7 +20495,7 @@ static GLboolean _glewInit_GLX_SGI_video_sync (GLXEW_CONTEXT_ARG_DEF_INIT) #ifdef GLX_SUN_get_transparent_index -static GLboolean _glewInit_GLX_SUN_get_transparent_index (GLXEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GLX_SUN_get_transparent_index () { GLboolean r = GL_FALSE; @@ -7721,7 +20508,7 @@ static GLboolean _glewInit_GLX_SUN_get_transparent_index (GLXEW_CONTEXT_ARG_DEF_ #ifdef GLX_SUN_video_resize -static GLboolean _glewInit_GLX_SUN_video_resize (GLXEW_CONTEXT_ARG_DEF_INIT) +static GLboolean _glewInit_GLX_SUN_video_resize () { GLboolean r = GL_FALSE; @@ -7736,207 +20523,310 @@ static GLboolean _glewInit_GLX_SUN_video_resize (GLXEW_CONTEXT_ARG_DEF_INIT) /* ------------------------------------------------------------------------ */ GLboolean glxewGetExtension (const char* name) -{ - GLubyte* p; - GLubyte* end; - GLuint len = _glewStrLen((const GLubyte*)name); -/* if (glXQueryExtensionsString == NULL || glXGetCurrentDisplay == NULL) return GL_FALSE; */ -/* p = (GLubyte*)glXQueryExtensionsString(glXGetCurrentDisplay(), DefaultScreen(glXGetCurrentDisplay())); */ - if (glXGetClientString == NULL || glXGetCurrentDisplay == NULL) return GL_FALSE; - p = (GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); - if (0 == p) return GL_FALSE; - end = p + _glewStrLen(p); - while (p < end) - { - GLuint n = _glewStrCLen(p, ' '); - if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE; - p += n+1; - } - return GL_FALSE; +{ + const GLubyte* start; + const GLubyte* end; + + if (glXGetCurrentDisplay == NULL) return GL_FALSE; + start = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); + if (0 == start) return GL_FALSE; + end = start + _glewStrLen(start); + return _glewSearchExtension(name, start, end); } -GLenum glxewContextInit (GLXEW_CONTEXT_ARG_DEF_LIST) +GLenum glxewInit () { + Display* display; int major, minor; + const GLubyte* extStart; + const GLubyte* extEnd; /* initialize core GLX 1.2 */ - if (_glewInit_GLX_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT)) return GLEW_ERROR_GLX_VERSION_11_ONLY; + if (_glewInit_GLX_VERSION_1_2()) return GLEW_ERROR_GLX_VERSION_11_ONLY; + /* check for a display */ + display = glXGetCurrentDisplay(); + if (display == NULL) return GLEW_ERROR_NO_GLX_DISPLAY; /* initialize flags */ - CONST_CAST(GLXEW_VERSION_1_0) = GL_TRUE; - CONST_CAST(GLXEW_VERSION_1_1) = GL_TRUE; - CONST_CAST(GLXEW_VERSION_1_2) = GL_TRUE; - CONST_CAST(GLXEW_VERSION_1_3) = GL_TRUE; - CONST_CAST(GLXEW_VERSION_1_4) = GL_TRUE; + GLXEW_VERSION_1_0 = GL_TRUE; + GLXEW_VERSION_1_1 = GL_TRUE; + GLXEW_VERSION_1_2 = GL_TRUE; + GLXEW_VERSION_1_3 = GL_TRUE; + GLXEW_VERSION_1_4 = GL_TRUE; /* query GLX version */ - glXQueryVersion(glXGetCurrentDisplay(), &major, &minor); + glXQueryVersion(display, &major, &minor); if (major == 1 && minor <= 3) { switch (minor) { case 3: - CONST_CAST(GLXEW_VERSION_1_4) = GL_FALSE; + GLXEW_VERSION_1_4 = GL_FALSE; break; case 2: - CONST_CAST(GLXEW_VERSION_1_4) = GL_FALSE; - CONST_CAST(GLXEW_VERSION_1_3) = GL_FALSE; + GLXEW_VERSION_1_4 = GL_FALSE; + GLXEW_VERSION_1_3 = GL_FALSE; break; default: return GLEW_ERROR_GLX_VERSION_11_ONLY; break; } } + /* query GLX extension string */ + extStart = 0; + if (glXGetCurrentDisplay != NULL) + extStart = (const GLubyte*)glXGetClientString(display, GLX_EXTENSIONS); + if (extStart == 0) + extStart = (const GLubyte *)""; + extEnd = extStart + _glewStrLen(extStart); /* initialize extensions */ #ifdef GLX_VERSION_1_3 - if (glewExperimental || GLXEW_VERSION_1_3) CONST_CAST(GLXEW_VERSION_1_3) = !_glewInit_GLX_VERSION_1_3(GLEW_CONTEXT_ARG_VAR_INIT); + if (glewExperimental || GLXEW_VERSION_1_3) GLXEW_VERSION_1_3 = !_glewInit_GLX_VERSION_1_3(); #endif /* GLX_VERSION_1_3 */ #ifdef GLX_3DFX_multisample - CONST_CAST(GLXEW_3DFX_multisample) = glxewGetExtension("GLX_3DFX_multisample"); + GLXEW_3DFX_multisample = _glewSearchExtension("GLX_3DFX_multisample", extStart, extEnd); #endif /* GLX_3DFX_multisample */ +#ifdef GLX_AMD_gpu_association + GLXEW_AMD_gpu_association = _glewSearchExtension("GLX_AMD_gpu_association", extStart, extEnd); + if (glewExperimental || GLXEW_AMD_gpu_association) GLXEW_AMD_gpu_association = !_glewInit_GLX_AMD_gpu_association(); +#endif /* GLX_AMD_gpu_association */ +#ifdef GLX_ARB_context_flush_control + GLXEW_ARB_context_flush_control = _glewSearchExtension("GLX_ARB_context_flush_control", extStart, extEnd); +#endif /* GLX_ARB_context_flush_control */ +#ifdef GLX_ARB_create_context + GLXEW_ARB_create_context = _glewSearchExtension("GLX_ARB_create_context", extStart, extEnd); + if (glewExperimental || GLXEW_ARB_create_context) GLXEW_ARB_create_context = !_glewInit_GLX_ARB_create_context(); +#endif /* GLX_ARB_create_context */ +#ifdef GLX_ARB_create_context_no_error + GLXEW_ARB_create_context_no_error = _glewSearchExtension("GLX_ARB_create_context_no_error", extStart, extEnd); +#endif /* GLX_ARB_create_context_no_error */ +#ifdef GLX_ARB_create_context_profile + GLXEW_ARB_create_context_profile = _glewSearchExtension("GLX_ARB_create_context_profile", extStart, extEnd); +#endif /* GLX_ARB_create_context_profile */ +#ifdef GLX_ARB_create_context_robustness + GLXEW_ARB_create_context_robustness = _glewSearchExtension("GLX_ARB_create_context_robustness", extStart, extEnd); +#endif /* GLX_ARB_create_context_robustness */ #ifdef GLX_ARB_fbconfig_float - CONST_CAST(GLXEW_ARB_fbconfig_float) = glxewGetExtension("GLX_ARB_fbconfig_float"); + GLXEW_ARB_fbconfig_float = _glewSearchExtension("GLX_ARB_fbconfig_float", extStart, extEnd); #endif /* GLX_ARB_fbconfig_float */ +#ifdef GLX_ARB_framebuffer_sRGB + GLXEW_ARB_framebuffer_sRGB = _glewSearchExtension("GLX_ARB_framebuffer_sRGB", extStart, extEnd); +#endif /* GLX_ARB_framebuffer_sRGB */ #ifdef GLX_ARB_get_proc_address - CONST_CAST(GLXEW_ARB_get_proc_address) = glxewGetExtension("GLX_ARB_get_proc_address"); + GLXEW_ARB_get_proc_address = _glewSearchExtension("GLX_ARB_get_proc_address", extStart, extEnd); #endif /* GLX_ARB_get_proc_address */ #ifdef GLX_ARB_multisample - CONST_CAST(GLXEW_ARB_multisample) = glxewGetExtension("GLX_ARB_multisample"); + GLXEW_ARB_multisample = _glewSearchExtension("GLX_ARB_multisample", extStart, extEnd); #endif /* GLX_ARB_multisample */ +#ifdef GLX_ARB_robustness_application_isolation + GLXEW_ARB_robustness_application_isolation = _glewSearchExtension("GLX_ARB_robustness_application_isolation", extStart, extEnd); +#endif /* GLX_ARB_robustness_application_isolation */ +#ifdef GLX_ARB_robustness_share_group_isolation + GLXEW_ARB_robustness_share_group_isolation = _glewSearchExtension("GLX_ARB_robustness_share_group_isolation", extStart, extEnd); +#endif /* GLX_ARB_robustness_share_group_isolation */ +#ifdef GLX_ARB_vertex_buffer_object + GLXEW_ARB_vertex_buffer_object = _glewSearchExtension("GLX_ARB_vertex_buffer_object", extStart, extEnd); +#endif /* GLX_ARB_vertex_buffer_object */ #ifdef GLX_ATI_pixel_format_float - CONST_CAST(GLXEW_ATI_pixel_format_float) = glxewGetExtension("GLX_ATI_pixel_format_float"); + GLXEW_ATI_pixel_format_float = _glewSearchExtension("GLX_ATI_pixel_format_float", extStart, extEnd); #endif /* GLX_ATI_pixel_format_float */ #ifdef GLX_ATI_render_texture - CONST_CAST(GLXEW_ATI_render_texture) = glxewGetExtension("GLX_ATI_render_texture"); - if (glewExperimental || GLXEW_ATI_render_texture) CONST_CAST(GLXEW_ATI_render_texture) = !_glewInit_GLX_ATI_render_texture(GLEW_CONTEXT_ARG_VAR_INIT); + GLXEW_ATI_render_texture = _glewSearchExtension("GLX_ATI_render_texture", extStart, extEnd); + if (glewExperimental || GLXEW_ATI_render_texture) GLXEW_ATI_render_texture = !_glewInit_GLX_ATI_render_texture(); #endif /* GLX_ATI_render_texture */ +#ifdef GLX_EXT_buffer_age + GLXEW_EXT_buffer_age = _glewSearchExtension("GLX_EXT_buffer_age", extStart, extEnd); +#endif /* GLX_EXT_buffer_age */ +#ifdef GLX_EXT_create_context_es2_profile + GLXEW_EXT_create_context_es2_profile = _glewSearchExtension("GLX_EXT_create_context_es2_profile", extStart, extEnd); +#endif /* GLX_EXT_create_context_es2_profile */ +#ifdef GLX_EXT_create_context_es_profile + GLXEW_EXT_create_context_es_profile = _glewSearchExtension("GLX_EXT_create_context_es_profile", extStart, extEnd); +#endif /* GLX_EXT_create_context_es_profile */ #ifdef GLX_EXT_fbconfig_packed_float - CONST_CAST(GLXEW_EXT_fbconfig_packed_float) = glxewGetExtension("GLX_EXT_fbconfig_packed_float"); + GLXEW_EXT_fbconfig_packed_float = _glewSearchExtension("GLX_EXT_fbconfig_packed_float", extStart, extEnd); #endif /* GLX_EXT_fbconfig_packed_float */ #ifdef GLX_EXT_framebuffer_sRGB - CONST_CAST(GLXEW_EXT_framebuffer_sRGB) = glxewGetExtension("GLX_EXT_framebuffer_sRGB"); + GLXEW_EXT_framebuffer_sRGB = _glewSearchExtension("GLX_EXT_framebuffer_sRGB", extStart, extEnd); #endif /* GLX_EXT_framebuffer_sRGB */ #ifdef GLX_EXT_import_context - CONST_CAST(GLXEW_EXT_import_context) = glxewGetExtension("GLX_EXT_import_context"); - if (glewExperimental || GLXEW_EXT_import_context) CONST_CAST(GLXEW_EXT_import_context) = !_glewInit_GLX_EXT_import_context(GLEW_CONTEXT_ARG_VAR_INIT); + GLXEW_EXT_import_context = _glewSearchExtension("GLX_EXT_import_context", extStart, extEnd); + if (glewExperimental || GLXEW_EXT_import_context) GLXEW_EXT_import_context = !_glewInit_GLX_EXT_import_context(); #endif /* GLX_EXT_import_context */ +#ifdef GLX_EXT_libglvnd + GLXEW_EXT_libglvnd = _glewSearchExtension("GLX_EXT_libglvnd", extStart, extEnd); +#endif /* GLX_EXT_libglvnd */ #ifdef GLX_EXT_scene_marker - CONST_CAST(GLXEW_EXT_scene_marker) = glxewGetExtension("GLX_EXT_scene_marker"); + GLXEW_EXT_scene_marker = _glewSearchExtension("GLX_EXT_scene_marker", extStart, extEnd); #endif /* GLX_EXT_scene_marker */ +#ifdef GLX_EXT_stereo_tree + GLXEW_EXT_stereo_tree = _glewSearchExtension("GLX_EXT_stereo_tree", extStart, extEnd); +#endif /* GLX_EXT_stereo_tree */ +#ifdef GLX_EXT_swap_control + GLXEW_EXT_swap_control = _glewSearchExtension("GLX_EXT_swap_control", extStart, extEnd); + if (glewExperimental || GLXEW_EXT_swap_control) GLXEW_EXT_swap_control = !_glewInit_GLX_EXT_swap_control(); +#endif /* GLX_EXT_swap_control */ +#ifdef GLX_EXT_swap_control_tear + GLXEW_EXT_swap_control_tear = _glewSearchExtension("GLX_EXT_swap_control_tear", extStart, extEnd); +#endif /* GLX_EXT_swap_control_tear */ #ifdef GLX_EXT_texture_from_pixmap - CONST_CAST(GLXEW_EXT_texture_from_pixmap) = glxewGetExtension("GLX_EXT_texture_from_pixmap"); - if (glewExperimental || GLXEW_EXT_texture_from_pixmap) CONST_CAST(GLXEW_EXT_texture_from_pixmap) = !_glewInit_GLX_EXT_texture_from_pixmap(GLEW_CONTEXT_ARG_VAR_INIT); + GLXEW_EXT_texture_from_pixmap = _glewSearchExtension("GLX_EXT_texture_from_pixmap", extStart, extEnd); + if (glewExperimental || GLXEW_EXT_texture_from_pixmap) GLXEW_EXT_texture_from_pixmap = !_glewInit_GLX_EXT_texture_from_pixmap(); #endif /* GLX_EXT_texture_from_pixmap */ #ifdef GLX_EXT_visual_info - CONST_CAST(GLXEW_EXT_visual_info) = glxewGetExtension("GLX_EXT_visual_info"); + GLXEW_EXT_visual_info = _glewSearchExtension("GLX_EXT_visual_info", extStart, extEnd); #endif /* GLX_EXT_visual_info */ #ifdef GLX_EXT_visual_rating - CONST_CAST(GLXEW_EXT_visual_rating) = glxewGetExtension("GLX_EXT_visual_rating"); + GLXEW_EXT_visual_rating = _glewSearchExtension("GLX_EXT_visual_rating", extStart, extEnd); #endif /* GLX_EXT_visual_rating */ +#ifdef GLX_INTEL_swap_event + GLXEW_INTEL_swap_event = _glewSearchExtension("GLX_INTEL_swap_event", extStart, extEnd); +#endif /* GLX_INTEL_swap_event */ #ifdef GLX_MESA_agp_offset - CONST_CAST(GLXEW_MESA_agp_offset) = glxewGetExtension("GLX_MESA_agp_offset"); - if (glewExperimental || GLXEW_MESA_agp_offset) CONST_CAST(GLXEW_MESA_agp_offset) = !_glewInit_GLX_MESA_agp_offset(GLEW_CONTEXT_ARG_VAR_INIT); + GLXEW_MESA_agp_offset = _glewSearchExtension("GLX_MESA_agp_offset", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_agp_offset) GLXEW_MESA_agp_offset = !_glewInit_GLX_MESA_agp_offset(); #endif /* GLX_MESA_agp_offset */ #ifdef GLX_MESA_copy_sub_buffer - CONST_CAST(GLXEW_MESA_copy_sub_buffer) = glxewGetExtension("GLX_MESA_copy_sub_buffer"); - if (glewExperimental || GLXEW_MESA_copy_sub_buffer) CONST_CAST(GLXEW_MESA_copy_sub_buffer) = !_glewInit_GLX_MESA_copy_sub_buffer(GLEW_CONTEXT_ARG_VAR_INIT); + GLXEW_MESA_copy_sub_buffer = _glewSearchExtension("GLX_MESA_copy_sub_buffer", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_copy_sub_buffer) GLXEW_MESA_copy_sub_buffer = !_glewInit_GLX_MESA_copy_sub_buffer(); #endif /* GLX_MESA_copy_sub_buffer */ #ifdef GLX_MESA_pixmap_colormap - CONST_CAST(GLXEW_MESA_pixmap_colormap) = glxewGetExtension("GLX_MESA_pixmap_colormap"); - if (glewExperimental || GLXEW_MESA_pixmap_colormap) CONST_CAST(GLXEW_MESA_pixmap_colormap) = !_glewInit_GLX_MESA_pixmap_colormap(GLEW_CONTEXT_ARG_VAR_INIT); + GLXEW_MESA_pixmap_colormap = _glewSearchExtension("GLX_MESA_pixmap_colormap", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_pixmap_colormap) GLXEW_MESA_pixmap_colormap = !_glewInit_GLX_MESA_pixmap_colormap(); #endif /* GLX_MESA_pixmap_colormap */ +#ifdef GLX_MESA_query_renderer + GLXEW_MESA_query_renderer = _glewSearchExtension("GLX_MESA_query_renderer", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_query_renderer) GLXEW_MESA_query_renderer = !_glewInit_GLX_MESA_query_renderer(); +#endif /* GLX_MESA_query_renderer */ #ifdef GLX_MESA_release_buffers - CONST_CAST(GLXEW_MESA_release_buffers) = glxewGetExtension("GLX_MESA_release_buffers"); - if (glewExperimental || GLXEW_MESA_release_buffers) CONST_CAST(GLXEW_MESA_release_buffers) = !_glewInit_GLX_MESA_release_buffers(GLEW_CONTEXT_ARG_VAR_INIT); + GLXEW_MESA_release_buffers = _glewSearchExtension("GLX_MESA_release_buffers", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_release_buffers) GLXEW_MESA_release_buffers = !_glewInit_GLX_MESA_release_buffers(); #endif /* GLX_MESA_release_buffers */ #ifdef GLX_MESA_set_3dfx_mode - CONST_CAST(GLXEW_MESA_set_3dfx_mode) = glxewGetExtension("GLX_MESA_set_3dfx_mode"); - if (glewExperimental || GLXEW_MESA_set_3dfx_mode) CONST_CAST(GLXEW_MESA_set_3dfx_mode) = !_glewInit_GLX_MESA_set_3dfx_mode(GLEW_CONTEXT_ARG_VAR_INIT); + GLXEW_MESA_set_3dfx_mode = _glewSearchExtension("GLX_MESA_set_3dfx_mode", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_set_3dfx_mode) GLXEW_MESA_set_3dfx_mode = !_glewInit_GLX_MESA_set_3dfx_mode(); #endif /* GLX_MESA_set_3dfx_mode */ +#ifdef GLX_MESA_swap_control + GLXEW_MESA_swap_control = _glewSearchExtension("GLX_MESA_swap_control", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_swap_control) GLXEW_MESA_swap_control = !_glewInit_GLX_MESA_swap_control(); +#endif /* GLX_MESA_swap_control */ +#ifdef GLX_NV_copy_buffer + GLXEW_NV_copy_buffer = _glewSearchExtension("GLX_NV_copy_buffer", extStart, extEnd); + if (glewExperimental || GLXEW_NV_copy_buffer) GLXEW_NV_copy_buffer = !_glewInit_GLX_NV_copy_buffer(); +#endif /* GLX_NV_copy_buffer */ +#ifdef GLX_NV_copy_image + GLXEW_NV_copy_image = _glewSearchExtension("GLX_NV_copy_image", extStart, extEnd); + if (glewExperimental || GLXEW_NV_copy_image) GLXEW_NV_copy_image = !_glewInit_GLX_NV_copy_image(); +#endif /* GLX_NV_copy_image */ +#ifdef GLX_NV_delay_before_swap + GLXEW_NV_delay_before_swap = _glewSearchExtension("GLX_NV_delay_before_swap", extStart, extEnd); + if (glewExperimental || GLXEW_NV_delay_before_swap) GLXEW_NV_delay_before_swap = !_glewInit_GLX_NV_delay_before_swap(); +#endif /* GLX_NV_delay_before_swap */ #ifdef GLX_NV_float_buffer - CONST_CAST(GLXEW_NV_float_buffer) = glxewGetExtension("GLX_NV_float_buffer"); + GLXEW_NV_float_buffer = _glewSearchExtension("GLX_NV_float_buffer", extStart, extEnd); #endif /* GLX_NV_float_buffer */ +#ifdef GLX_NV_multisample_coverage + GLXEW_NV_multisample_coverage = _glewSearchExtension("GLX_NV_multisample_coverage", extStart, extEnd); +#endif /* GLX_NV_multisample_coverage */ +#ifdef GLX_NV_present_video + GLXEW_NV_present_video = _glewSearchExtension("GLX_NV_present_video", extStart, extEnd); + if (glewExperimental || GLXEW_NV_present_video) GLXEW_NV_present_video = !_glewInit_GLX_NV_present_video(); +#endif /* GLX_NV_present_video */ +#ifdef GLX_NV_robustness_video_memory_purge + GLXEW_NV_robustness_video_memory_purge = _glewSearchExtension("GLX_NV_robustness_video_memory_purge", extStart, extEnd); +#endif /* GLX_NV_robustness_video_memory_purge */ +#ifdef GLX_NV_swap_group + GLXEW_NV_swap_group = _glewSearchExtension("GLX_NV_swap_group", extStart, extEnd); + if (glewExperimental || GLXEW_NV_swap_group) GLXEW_NV_swap_group = !_glewInit_GLX_NV_swap_group(); +#endif /* GLX_NV_swap_group */ #ifdef GLX_NV_vertex_array_range - CONST_CAST(GLXEW_NV_vertex_array_range) = glxewGetExtension("GLX_NV_vertex_array_range"); - if (glewExperimental || GLXEW_NV_vertex_array_range) CONST_CAST(GLXEW_NV_vertex_array_range) = !_glewInit_GLX_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); + GLXEW_NV_vertex_array_range = _glewSearchExtension("GLX_NV_vertex_array_range", extStart, extEnd); + if (glewExperimental || GLXEW_NV_vertex_array_range) GLXEW_NV_vertex_array_range = !_glewInit_GLX_NV_vertex_array_range(); #endif /* GLX_NV_vertex_array_range */ +#ifdef GLX_NV_video_capture + GLXEW_NV_video_capture = _glewSearchExtension("GLX_NV_video_capture", extStart, extEnd); + if (glewExperimental || GLXEW_NV_video_capture) GLXEW_NV_video_capture = !_glewInit_GLX_NV_video_capture(); +#endif /* GLX_NV_video_capture */ +#ifdef GLX_NV_video_out + GLXEW_NV_video_out = _glewSearchExtension("GLX_NV_video_out", extStart, extEnd); + if (glewExperimental || GLXEW_NV_video_out) GLXEW_NV_video_out = !_glewInit_GLX_NV_video_out(); +#endif /* GLX_NV_video_out */ #ifdef GLX_OML_swap_method - CONST_CAST(GLXEW_OML_swap_method) = glxewGetExtension("GLX_OML_swap_method"); + GLXEW_OML_swap_method = _glewSearchExtension("GLX_OML_swap_method", extStart, extEnd); #endif /* GLX_OML_swap_method */ -#if defined(GLX_OML_sync_control) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) -#include - CONST_CAST(GLXEW_OML_sync_control) = glxewGetExtension("GLX_OML_sync_control"); - if (glewExperimental || GLXEW_OML_sync_control) CONST_CAST(GLXEW_OML_sync_control) = !_glewInit_GLX_OML_sync_control(GLEW_CONTEXT_ARG_VAR_INIT); +#ifdef GLX_OML_sync_control + GLXEW_OML_sync_control = _glewSearchExtension("GLX_OML_sync_control", extStart, extEnd); + if (glewExperimental || GLXEW_OML_sync_control) GLXEW_OML_sync_control = !_glewInit_GLX_OML_sync_control(); #endif /* GLX_OML_sync_control */ #ifdef GLX_SGIS_blended_overlay - CONST_CAST(GLXEW_SGIS_blended_overlay) = glxewGetExtension("GLX_SGIS_blended_overlay"); + GLXEW_SGIS_blended_overlay = _glewSearchExtension("GLX_SGIS_blended_overlay", extStart, extEnd); #endif /* GLX_SGIS_blended_overlay */ #ifdef GLX_SGIS_color_range - CONST_CAST(GLXEW_SGIS_color_range) = glxewGetExtension("GLX_SGIS_color_range"); + GLXEW_SGIS_color_range = _glewSearchExtension("GLX_SGIS_color_range", extStart, extEnd); #endif /* GLX_SGIS_color_range */ #ifdef GLX_SGIS_multisample - CONST_CAST(GLXEW_SGIS_multisample) = glxewGetExtension("GLX_SGIS_multisample"); + GLXEW_SGIS_multisample = _glewSearchExtension("GLX_SGIS_multisample", extStart, extEnd); #endif /* GLX_SGIS_multisample */ #ifdef GLX_SGIS_shared_multisample - CONST_CAST(GLXEW_SGIS_shared_multisample) = glxewGetExtension("GLX_SGIS_shared_multisample"); + GLXEW_SGIS_shared_multisample = _glewSearchExtension("GLX_SGIS_shared_multisample", extStart, extEnd); #endif /* GLX_SGIS_shared_multisample */ #ifdef GLX_SGIX_fbconfig - CONST_CAST(GLXEW_SGIX_fbconfig) = glxewGetExtension("GLX_SGIX_fbconfig"); - if (glewExperimental || GLXEW_SGIX_fbconfig) CONST_CAST(GLXEW_SGIX_fbconfig) = !_glewInit_GLX_SGIX_fbconfig(GLEW_CONTEXT_ARG_VAR_INIT); + GLXEW_SGIX_fbconfig = _glewSearchExtension("GLX_SGIX_fbconfig", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_fbconfig) GLXEW_SGIX_fbconfig = !_glewInit_GLX_SGIX_fbconfig(); #endif /* GLX_SGIX_fbconfig */ #ifdef GLX_SGIX_hyperpipe - CONST_CAST(GLXEW_SGIX_hyperpipe) = glxewGetExtension("GLX_SGIX_hyperpipe"); - if (glewExperimental || GLXEW_SGIX_hyperpipe) CONST_CAST(GLXEW_SGIX_hyperpipe) = !_glewInit_GLX_SGIX_hyperpipe(GLEW_CONTEXT_ARG_VAR_INIT); + GLXEW_SGIX_hyperpipe = _glewSearchExtension("GLX_SGIX_hyperpipe", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_hyperpipe) GLXEW_SGIX_hyperpipe = !_glewInit_GLX_SGIX_hyperpipe(); #endif /* GLX_SGIX_hyperpipe */ #ifdef GLX_SGIX_pbuffer - CONST_CAST(GLXEW_SGIX_pbuffer) = glxewGetExtension("GLX_SGIX_pbuffer"); - if (glewExperimental || GLXEW_SGIX_pbuffer) CONST_CAST(GLXEW_SGIX_pbuffer) = !_glewInit_GLX_SGIX_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); + GLXEW_SGIX_pbuffer = _glewSearchExtension("GLX_SGIX_pbuffer", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_pbuffer) GLXEW_SGIX_pbuffer = !_glewInit_GLX_SGIX_pbuffer(); #endif /* GLX_SGIX_pbuffer */ #ifdef GLX_SGIX_swap_barrier - CONST_CAST(GLXEW_SGIX_swap_barrier) = glxewGetExtension("GLX_SGIX_swap_barrier"); - if (glewExperimental || GLXEW_SGIX_swap_barrier) CONST_CAST(GLXEW_SGIX_swap_barrier) = !_glewInit_GLX_SGIX_swap_barrier(GLEW_CONTEXT_ARG_VAR_INIT); + GLXEW_SGIX_swap_barrier = _glewSearchExtension("GLX_SGIX_swap_barrier", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_swap_barrier) GLXEW_SGIX_swap_barrier = !_glewInit_GLX_SGIX_swap_barrier(); #endif /* GLX_SGIX_swap_barrier */ #ifdef GLX_SGIX_swap_group - CONST_CAST(GLXEW_SGIX_swap_group) = glxewGetExtension("GLX_SGIX_swap_group"); - if (glewExperimental || GLXEW_SGIX_swap_group) CONST_CAST(GLXEW_SGIX_swap_group) = !_glewInit_GLX_SGIX_swap_group(GLEW_CONTEXT_ARG_VAR_INIT); + GLXEW_SGIX_swap_group = _glewSearchExtension("GLX_SGIX_swap_group", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_swap_group) GLXEW_SGIX_swap_group = !_glewInit_GLX_SGIX_swap_group(); #endif /* GLX_SGIX_swap_group */ #ifdef GLX_SGIX_video_resize - CONST_CAST(GLXEW_SGIX_video_resize) = glxewGetExtension("GLX_SGIX_video_resize"); - if (glewExperimental || GLXEW_SGIX_video_resize) CONST_CAST(GLXEW_SGIX_video_resize) = !_glewInit_GLX_SGIX_video_resize(GLEW_CONTEXT_ARG_VAR_INIT); + GLXEW_SGIX_video_resize = _glewSearchExtension("GLX_SGIX_video_resize", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_video_resize) GLXEW_SGIX_video_resize = !_glewInit_GLX_SGIX_video_resize(); #endif /* GLX_SGIX_video_resize */ #ifdef GLX_SGIX_visual_select_group - CONST_CAST(GLXEW_SGIX_visual_select_group) = glxewGetExtension("GLX_SGIX_visual_select_group"); + GLXEW_SGIX_visual_select_group = _glewSearchExtension("GLX_SGIX_visual_select_group", extStart, extEnd); #endif /* GLX_SGIX_visual_select_group */ #ifdef GLX_SGI_cushion - CONST_CAST(GLXEW_SGI_cushion) = glxewGetExtension("GLX_SGI_cushion"); - if (glewExperimental || GLXEW_SGI_cushion) CONST_CAST(GLXEW_SGI_cushion) = !_glewInit_GLX_SGI_cushion(GLEW_CONTEXT_ARG_VAR_INIT); + GLXEW_SGI_cushion = _glewSearchExtension("GLX_SGI_cushion", extStart, extEnd); + if (glewExperimental || GLXEW_SGI_cushion) GLXEW_SGI_cushion = !_glewInit_GLX_SGI_cushion(); #endif /* GLX_SGI_cushion */ #ifdef GLX_SGI_make_current_read - CONST_CAST(GLXEW_SGI_make_current_read) = glxewGetExtension("GLX_SGI_make_current_read"); - if (glewExperimental || GLXEW_SGI_make_current_read) CONST_CAST(GLXEW_SGI_make_current_read) = !_glewInit_GLX_SGI_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); + GLXEW_SGI_make_current_read = _glewSearchExtension("GLX_SGI_make_current_read", extStart, extEnd); + if (glewExperimental || GLXEW_SGI_make_current_read) GLXEW_SGI_make_current_read = !_glewInit_GLX_SGI_make_current_read(); #endif /* GLX_SGI_make_current_read */ #ifdef GLX_SGI_swap_control - CONST_CAST(GLXEW_SGI_swap_control) = glxewGetExtension("GLX_SGI_swap_control"); - if (glewExperimental || GLXEW_SGI_swap_control) CONST_CAST(GLXEW_SGI_swap_control) = !_glewInit_GLX_SGI_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); + GLXEW_SGI_swap_control = _glewSearchExtension("GLX_SGI_swap_control", extStart, extEnd); + if (glewExperimental || GLXEW_SGI_swap_control) GLXEW_SGI_swap_control = !_glewInit_GLX_SGI_swap_control(); #endif /* GLX_SGI_swap_control */ #ifdef GLX_SGI_video_sync - CONST_CAST(GLXEW_SGI_video_sync) = glxewGetExtension("GLX_SGI_video_sync"); - if (glewExperimental || GLXEW_SGI_video_sync) CONST_CAST(GLXEW_SGI_video_sync) = !_glewInit_GLX_SGI_video_sync(GLEW_CONTEXT_ARG_VAR_INIT); + GLXEW_SGI_video_sync = _glewSearchExtension("GLX_SGI_video_sync", extStart, extEnd); + if (glewExperimental || GLXEW_SGI_video_sync) GLXEW_SGI_video_sync = !_glewInit_GLX_SGI_video_sync(); #endif /* GLX_SGI_video_sync */ #ifdef GLX_SUN_get_transparent_index - CONST_CAST(GLXEW_SUN_get_transparent_index) = glxewGetExtension("GLX_SUN_get_transparent_index"); - if (glewExperimental || GLXEW_SUN_get_transparent_index) CONST_CAST(GLXEW_SUN_get_transparent_index) = !_glewInit_GLX_SUN_get_transparent_index(GLEW_CONTEXT_ARG_VAR_INIT); + GLXEW_SUN_get_transparent_index = _glewSearchExtension("GLX_SUN_get_transparent_index", extStart, extEnd); + if (glewExperimental || GLXEW_SUN_get_transparent_index) GLXEW_SUN_get_transparent_index = !_glewInit_GLX_SUN_get_transparent_index(); #endif /* GLX_SUN_get_transparent_index */ #ifdef GLX_SUN_video_resize - CONST_CAST(GLXEW_SUN_video_resize) = glxewGetExtension("GLX_SUN_video_resize"); - if (glewExperimental || GLXEW_SUN_video_resize) CONST_CAST(GLXEW_SUN_video_resize) = !_glewInit_GLX_SUN_video_resize(GLEW_CONTEXT_ARG_VAR_INIT); + GLXEW_SUN_video_resize = _glewSearchExtension("GLX_SUN_video_resize", extStart, extEnd); + if (glewExperimental || GLXEW_SUN_video_resize) GLXEW_SUN_video_resize = !_glewInit_GLX_SUN_video_resize(); #endif /* GLX_SUN_video_resize */ return GLEW_OK; } -#endif /* !__APPLE__ || GLEW_APPLE_GLX */ +#endif /* !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) */ /* ------------------------------------------------------------------------ */ -const GLubyte* glewGetErrorString (GLenum error) +const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error) { static const GLubyte* _glewErrorString[] = { @@ -7946,57 +20836,64 @@ const GLubyte* glewGetErrorString (GLenum error) (const GLubyte*)"GLX 1.2 and up are not supported", (const GLubyte*)"Unknown error" }; - const int max_error = sizeof(_glewErrorString)/sizeof(*_glewErrorString) - 1; - return _glewErrorString[(int)error > max_error ? max_error : (int)error]; + const size_t max_error = sizeof(_glewErrorString)/sizeof(*_glewErrorString) - 1; + return _glewErrorString[(size_t)error > max_error ? max_error : (size_t)error]; } -const GLubyte* glewGetString (GLenum name) +const GLubyte * GLEWAPIENTRY glewGetString (GLenum name) { static const GLubyte* _glewString[] = { (const GLubyte*)NULL, - (const GLubyte*)"1.5.0", + (const GLubyte*)"2.1.0", + (const GLubyte*)"2", (const GLubyte*)"1", - (const GLubyte*)"5", (const GLubyte*)"0" }; - const int max_string = sizeof(_glewString)/sizeof(*_glewString) - 1; - return _glewString[(int)name > max_string ? 0 : (int)name]; + const size_t max_string = sizeof(_glewString)/sizeof(*_glewString) - 1; + return _glewString[(size_t)name > max_string ? 0 : (size_t)name]; } /* ------------------------------------------------------------------------ */ GLboolean glewExperimental = GL_FALSE; -#if !defined(GLEW_MX) - -#if defined(_WIN32) -extern GLenum wglewContextInit (void); -#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */ -extern GLenum glxewContextInit (void); -#endif /* _WIN32 */ - -GLenum glewInit () +GLenum GLEWAPIENTRY glewInit (void) { GLenum r; - if ( (r = glewContextInit()) ) return r; -#if defined(_WIN32) - return wglewContextInit(); +#if defined(GLEW_EGL) + PFNEGLGETCURRENTDISPLAYPROC getCurrentDisplay = NULL; +#endif + r = glewContextInit(); + if ( r != 0 ) return r; +#if defined(GLEW_EGL) + getCurrentDisplay = (PFNEGLGETCURRENTDISPLAYPROC) glewGetProcAddress("eglGetCurrentDisplay"); + return eglewInit(getCurrentDisplay()); +#elif defined(GLEW_OSMESA) || defined(__ANDROID__) || defined(__native_client__) || defined(__HAIKU__) + return r; +#elif defined(_WIN32) + return wglewInit(); #elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */ - return glxewContextInit(); + return glxewInit(); #else return r; #endif /* _WIN32 */ } -#endif /* !GLEW_MX */ -#ifdef GLEW_MX -GLboolean glewContextIsSupported (GLEWContext* ctx, const char* name) -#else -GLboolean glewIsSupported (const char* name) -#endif +#if defined(_WIN32) && defined(GLEW_BUILD) && defined(__GNUC__) +/* GCC requires a DLL entry point even without any standard library included. */ +/* Types extracted from windows.h to avoid polluting the rest of the file. */ +int __stdcall DllMainCRTStartup(void* instance, unsigned reason, void* reserved) { - GLubyte* pos = (GLubyte*)name; + (void) instance; + (void) reason; + (void) reserved; + return 1; +} +#endif +GLboolean GLEWAPIENTRY glewIsSupported (const char* name) +{ + const GLubyte* pos = (const GLubyte*)name; GLuint len = _glewStrLen(pos); GLboolean ret = GL_TRUE; while (ret && len > 0) @@ -8012,6 +20909,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_VERSION_1_2_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2_1", 5)) + { + ret = GLEW_VERSION_1_2_1; + continue; + } +#endif #ifdef GL_VERSION_1_3 if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_3", 3)) { @@ -8046,6 +20950,83 @@ GLboolean glewIsSupported (const char* name) ret = GLEW_VERSION_2_1; continue; } +#endif +#ifdef GL_VERSION_3_0 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_0", 3)) + { + ret = GLEW_VERSION_3_0; + continue; + } +#endif +#ifdef GL_VERSION_3_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_1", 3)) + { + ret = GLEW_VERSION_3_1; + continue; + } +#endif +#ifdef GL_VERSION_3_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_2", 3)) + { + ret = GLEW_VERSION_3_2; + continue; + } +#endif +#ifdef GL_VERSION_3_3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_3", 3)) + { + ret = GLEW_VERSION_3_3; + continue; + } +#endif +#ifdef GL_VERSION_4_0 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_0", 3)) + { + ret = GLEW_VERSION_4_0; + continue; + } +#endif +#ifdef GL_VERSION_4_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_1", 3)) + { + ret = GLEW_VERSION_4_1; + continue; + } +#endif +#ifdef GL_VERSION_4_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_2", 3)) + { + ret = GLEW_VERSION_4_2; + continue; + } +#endif +#ifdef GL_VERSION_4_3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_3", 3)) + { + ret = GLEW_VERSION_4_3; + continue; + } +#endif +#ifdef GL_VERSION_4_4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_4", 3)) + { + ret = GLEW_VERSION_4_4; + continue; + } +#endif +#ifdef GL_VERSION_4_5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_5", 3)) + { + ret = GLEW_VERSION_4_5; + continue; + } +#endif +#ifdef GL_VERSION_4_6 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_6", 3)) + { + ret = GLEW_VERSION_4_6; + continue; + } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) @@ -8070,10 +21051,376 @@ GLboolean glewIsSupported (const char* name) ret = GLEW_3DFX_texture_compression_FXT1; continue; } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) + { +#ifdef GL_AMD_blend_minmax_factor + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_minmax_factor", 19)) + { + ret = GLEW_AMD_blend_minmax_factor; + continue; + } +#endif +#ifdef GL_AMD_compressed_3DC_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_3DC_texture", 22)) + { + ret = GLEW_AMD_compressed_3DC_texture; + continue; + } +#endif +#ifdef GL_AMD_compressed_ATC_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_ATC_texture", 22)) + { + ret = GLEW_AMD_compressed_ATC_texture; + continue; + } +#endif +#ifdef GL_AMD_conservative_depth + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_depth", 18)) + { + ret = GLEW_AMD_conservative_depth; + continue; + } +#endif +#ifdef GL_AMD_debug_output + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_output", 12)) + { + ret = GLEW_AMD_debug_output; + continue; + } +#endif +#ifdef GL_AMD_depth_clamp_separate + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp_separate", 20)) + { + ret = GLEW_AMD_depth_clamp_separate; + continue; + } +#endif +#ifdef GL_AMD_draw_buffers_blend + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers_blend", 18)) + { + ret = GLEW_AMD_draw_buffers_blend; + continue; + } +#endif +#ifdef GL_AMD_framebuffer_sample_positions + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sample_positions", 28)) + { + ret = GLEW_AMD_framebuffer_sample_positions; + continue; + } +#endif +#ifdef GL_AMD_gcn_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gcn_shader", 10)) + { + ret = GLEW_AMD_gcn_shader; + continue; + } +#endif +#ifdef GL_AMD_gpu_shader_half_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader_half_float", 21)) + { + ret = GLEW_AMD_gpu_shader_half_float; + continue; + } +#endif +#ifdef GL_AMD_gpu_shader_int16 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader_int16", 16)) + { + ret = GLEW_AMD_gpu_shader_int16; + continue; + } +#endif +#ifdef GL_AMD_gpu_shader_int64 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader_int64", 16)) + { + ret = GLEW_AMD_gpu_shader_int64; + continue; + } +#endif +#ifdef GL_AMD_interleaved_elements + if (_glewStrSame3(&pos, &len, (const GLubyte*)"interleaved_elements", 20)) + { + ret = GLEW_AMD_interleaved_elements; + continue; + } +#endif +#ifdef GL_AMD_multi_draw_indirect + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_indirect", 19)) + { + ret = GLEW_AMD_multi_draw_indirect; + continue; + } +#endif +#ifdef GL_AMD_name_gen_delete + if (_glewStrSame3(&pos, &len, (const GLubyte*)"name_gen_delete", 15)) + { + ret = GLEW_AMD_name_gen_delete; + continue; + } +#endif +#ifdef GL_AMD_occlusion_query_event + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query_event", 21)) + { + ret = GLEW_AMD_occlusion_query_event; + continue; + } +#endif +#ifdef GL_AMD_performance_monitor + if (_glewStrSame3(&pos, &len, (const GLubyte*)"performance_monitor", 19)) + { + ret = GLEW_AMD_performance_monitor; + continue; + } +#endif +#ifdef GL_AMD_pinned_memory + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pinned_memory", 13)) + { + ret = GLEW_AMD_pinned_memory; + continue; + } +#endif +#ifdef GL_AMD_program_binary_Z400 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"program_binary_Z400", 19)) + { + ret = GLEW_AMD_program_binary_Z400; + continue; + } +#endif +#ifdef GL_AMD_query_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"query_buffer_object", 19)) + { + ret = GLEW_AMD_query_buffer_object; + continue; + } +#endif +#ifdef GL_AMD_sample_positions + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_positions", 16)) + { + ret = GLEW_AMD_sample_positions; + continue; + } +#endif +#ifdef GL_AMD_seamless_cubemap_per_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cubemap_per_texture", 28)) + { + ret = GLEW_AMD_seamless_cubemap_per_texture; + continue; + } +#endif +#ifdef GL_AMD_shader_atomic_counter_ops + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_counter_ops", 25)) + { + ret = GLEW_AMD_shader_atomic_counter_ops; + continue; + } +#endif +#ifdef GL_AMD_shader_ballot + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_ballot", 13)) + { + ret = GLEW_AMD_shader_ballot; + continue; + } +#endif +#ifdef GL_AMD_shader_explicit_vertex_parameter + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_explicit_vertex_parameter", 32)) + { + ret = GLEW_AMD_shader_explicit_vertex_parameter; + continue; + } +#endif +#ifdef GL_AMD_shader_stencil_export + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_stencil_export", 21)) + { + ret = GLEW_AMD_shader_stencil_export; + continue; + } +#endif +#ifdef GL_AMD_shader_stencil_value_export + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_stencil_value_export", 27)) + { + ret = GLEW_AMD_shader_stencil_value_export; + continue; + } +#endif +#ifdef GL_AMD_shader_trinary_minmax + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_trinary_minmax", 21)) + { + ret = GLEW_AMD_shader_trinary_minmax; + continue; + } +#endif +#ifdef GL_AMD_sparse_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture", 14)) + { + ret = GLEW_AMD_sparse_texture; + continue; + } +#endif +#ifdef GL_AMD_stencil_operation_extended + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_operation_extended", 26)) + { + ret = GLEW_AMD_stencil_operation_extended; + continue; + } +#endif +#ifdef GL_AMD_texture_gather_bias_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_gather_bias_lod", 23)) + { + ret = GLEW_AMD_texture_gather_bias_lod; + continue; + } +#endif +#ifdef GL_AMD_texture_texture4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_texture4", 16)) + { + ret = GLEW_AMD_texture_texture4; + continue; + } +#endif +#ifdef GL_AMD_transform_feedback3_lines_triangles + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback3_lines_triangles", 35)) + { + ret = GLEW_AMD_transform_feedback3_lines_triangles; + continue; + } +#endif +#ifdef GL_AMD_transform_feedback4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback4", 19)) + { + ret = GLEW_AMD_transform_feedback4; + continue; + } +#endif +#ifdef GL_AMD_vertex_shader_layer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_layer", 19)) + { + ret = GLEW_AMD_vertex_shader_layer; + continue; + } +#endif +#ifdef GL_AMD_vertex_shader_tessellator + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_tessellator", 25)) + { + ret = GLEW_AMD_vertex_shader_tessellator; + continue; + } +#endif +#ifdef GL_AMD_vertex_shader_viewport_index + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_viewport_index", 28)) + { + ret = GLEW_AMD_vertex_shader_viewport_index; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ANDROID_", 8)) + { +#ifdef GL_ANDROID_extension_pack_es31a + if (_glewStrSame3(&pos, &len, (const GLubyte*)"extension_pack_es31a", 20)) + { + ret = GLEW_ANDROID_extension_pack_es31a; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ANGLE_", 6)) + { +#ifdef GL_ANGLE_depth_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13)) + { + ret = GLEW_ANGLE_depth_texture; + continue; + } +#endif +#ifdef GL_ANGLE_framebuffer_blit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_blit", 16)) + { + ret = GLEW_ANGLE_framebuffer_blit; + continue; + } +#endif +#ifdef GL_ANGLE_framebuffer_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample", 23)) + { + ret = GLEW_ANGLE_framebuffer_multisample; + continue; + } +#endif +#ifdef GL_ANGLE_instanced_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"instanced_arrays", 16)) + { + ret = GLEW_ANGLE_instanced_arrays; + continue; + } +#endif +#ifdef GL_ANGLE_pack_reverse_row_order + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pack_reverse_row_order", 22)) + { + ret = GLEW_ANGLE_pack_reverse_row_order; + continue; + } +#endif +#ifdef GL_ANGLE_program_binary + if (_glewStrSame3(&pos, &len, (const GLubyte*)"program_binary", 14)) + { + ret = GLEW_ANGLE_program_binary; + continue; + } +#endif +#ifdef GL_ANGLE_texture_compression_dxt1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt1", 24)) + { + ret = GLEW_ANGLE_texture_compression_dxt1; + continue; + } +#endif +#ifdef GL_ANGLE_texture_compression_dxt3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt3", 24)) + { + ret = GLEW_ANGLE_texture_compression_dxt3; + continue; + } +#endif +#ifdef GL_ANGLE_texture_compression_dxt5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt5", 24)) + { + ret = GLEW_ANGLE_texture_compression_dxt5; + continue; + } +#endif +#ifdef GL_ANGLE_texture_usage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_usage", 13)) + { + ret = GLEW_ANGLE_texture_usage; + continue; + } +#endif +#ifdef GL_ANGLE_timer_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11)) + { + ret = GLEW_ANGLE_timer_query; + continue; + } +#endif +#ifdef GL_ANGLE_translated_shader_source + if (_glewStrSame3(&pos, &len, (const GLubyte*)"translated_shader_source", 24)) + { + ret = GLEW_ANGLE_translated_shader_source; + continue; + } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"APPLE_", 6)) { +#ifdef GL_APPLE_aux_depth_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"aux_depth_stencil", 17)) + { + ret = GLEW_APPLE_aux_depth_stencil; + continue; + } +#endif #ifdef GL_APPLE_client_storage if (_glewStrSame3(&pos, &len, (const GLubyte*)"client_storage", 14)) { @@ -8081,6 +21428,27 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_APPLE_clip_distance + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clip_distance", 13)) + { + ret = GLEW_APPLE_clip_distance; + continue; + } +#endif +#ifdef GL_APPLE_color_buffer_packed_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_buffer_packed_float", 25)) + { + ret = GLEW_APPLE_color_buffer_packed_float; + continue; + } +#endif +#ifdef GL_APPLE_copy_texture_levels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_texture_levels", 19)) + { + ret = GLEW_APPLE_copy_texture_levels; + continue; + } +#endif #ifdef GL_APPLE_element_array if (_glewStrSame3(&pos, &len, (const GLubyte*)"element_array", 13)) { @@ -8109,6 +21477,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_APPLE_framebuffer_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample", 23)) + { + ret = GLEW_APPLE_framebuffer_multisample; + continue; + } +#endif +#ifdef GL_APPLE_object_purgeable + if (_glewStrSame3(&pos, &len, (const GLubyte*)"object_purgeable", 16)) + { + ret = GLEW_APPLE_object_purgeable; + continue; + } +#endif #ifdef GL_APPLE_pixel_buffer if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer", 12)) { @@ -8116,6 +21498,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_APPLE_rgb_422 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"rgb_422", 7)) + { + ret = GLEW_APPLE_rgb_422; + continue; + } +#endif +#ifdef GL_APPLE_row_bytes + if (_glewStrSame3(&pos, &len, (const GLubyte*)"row_bytes", 9)) + { + ret = GLEW_APPLE_row_bytes; + continue; + } +#endif #ifdef GL_APPLE_specular_vector if (_glewStrSame3(&pos, &len, (const GLubyte*)"specular_vector", 15)) { @@ -8123,6 +21519,41 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_APPLE_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync", 4)) + { + ret = GLEW_APPLE_sync; + continue; + } +#endif +#ifdef GL_APPLE_texture_2D_limited_npot + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_2D_limited_npot", 23)) + { + ret = GLEW_APPLE_texture_2D_limited_npot; + continue; + } +#endif +#ifdef GL_APPLE_texture_format_BGRA8888 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_format_BGRA8888", 23)) + { + ret = GLEW_APPLE_texture_format_BGRA8888; + continue; + } +#endif +#ifdef GL_APPLE_texture_max_level + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_max_level", 17)) + { + ret = GLEW_APPLE_texture_max_level; + continue; + } +#endif +#ifdef GL_APPLE_texture_packed_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_packed_float", 20)) + { + ret = GLEW_APPLE_texture_packed_float; + continue; + } +#endif #ifdef GL_APPLE_texture_range if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_range", 13)) { @@ -8151,6 +21582,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_APPLE_vertex_program_evaluators + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program_evaluators", 25)) + { + ret = GLEW_APPLE_vertex_program_evaluators; + continue; + } +#endif #ifdef GL_APPLE_ycbcr_422 if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycbcr_422", 9)) { @@ -8161,6 +21599,97 @@ GLboolean glewIsSupported (const char* name) } if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) { +#ifdef GL_ARB_ES2_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES2_compatibility", 17)) + { + ret = GLEW_ARB_ES2_compatibility; + continue; + } +#endif +#ifdef GL_ARB_ES3_1_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES3_1_compatibility", 19)) + { + ret = GLEW_ARB_ES3_1_compatibility; + continue; + } +#endif +#ifdef GL_ARB_ES3_2_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES3_2_compatibility", 19)) + { + ret = GLEW_ARB_ES3_2_compatibility; + continue; + } +#endif +#ifdef GL_ARB_ES3_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES3_compatibility", 17)) + { + ret = GLEW_ARB_ES3_compatibility; + continue; + } +#endif +#ifdef GL_ARB_arrays_of_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"arrays_of_arrays", 16)) + { + ret = GLEW_ARB_arrays_of_arrays; + continue; + } +#endif +#ifdef GL_ARB_base_instance + if (_glewStrSame3(&pos, &len, (const GLubyte*)"base_instance", 13)) + { + ret = GLEW_ARB_base_instance; + continue; + } +#endif +#ifdef GL_ARB_bindless_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindless_texture", 16)) + { + ret = GLEW_ARB_bindless_texture; + continue; + } +#endif +#ifdef GL_ARB_blend_func_extended + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_func_extended", 19)) + { + ret = GLEW_ARB_blend_func_extended; + continue; + } +#endif +#ifdef GL_ARB_buffer_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_storage", 14)) + { + ret = GLEW_ARB_buffer_storage; + continue; + } +#endif +#ifdef GL_ARB_cl_event + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cl_event", 8)) + { + ret = GLEW_ARB_cl_event; + continue; + } +#endif +#ifdef GL_ARB_clear_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clear_buffer_object", 19)) + { + ret = GLEW_ARB_clear_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_clear_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clear_texture", 13)) + { + ret = GLEW_ARB_clear_texture; + continue; + } +#endif +#ifdef GL_ARB_clip_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clip_control", 12)) + { + ret = GLEW_ARB_clip_control; + continue; + } +#endif #ifdef GL_ARB_color_buffer_float if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_buffer_float", 18)) { @@ -8168,6 +21697,90 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compatibility", 13)) + { + ret = GLEW_ARB_compatibility; + continue; + } +#endif +#ifdef GL_ARB_compressed_texture_pixel_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_texture_pixel_storage", 32)) + { + ret = GLEW_ARB_compressed_texture_pixel_storage; + continue; + } +#endif +#ifdef GL_ARB_compute_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compute_shader", 14)) + { + ret = GLEW_ARB_compute_shader; + continue; + } +#endif +#ifdef GL_ARB_compute_variable_group_size + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compute_variable_group_size", 27)) + { + ret = GLEW_ARB_compute_variable_group_size; + continue; + } +#endif +#ifdef GL_ARB_conditional_render_inverted + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conditional_render_inverted", 27)) + { + ret = GLEW_ARB_conditional_render_inverted; + continue; + } +#endif +#ifdef GL_ARB_conservative_depth + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_depth", 18)) + { + ret = GLEW_ARB_conservative_depth; + continue; + } +#endif +#ifdef GL_ARB_copy_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_buffer", 11)) + { + ret = GLEW_ARB_copy_buffer; + continue; + } +#endif +#ifdef GL_ARB_copy_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) + { + ret = GLEW_ARB_copy_image; + continue; + } +#endif +#ifdef GL_ARB_cull_distance + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cull_distance", 13)) + { + ret = GLEW_ARB_cull_distance; + continue; + } +#endif +#ifdef GL_ARB_debug_output + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_output", 12)) + { + ret = GLEW_ARB_debug_output; + continue; + } +#endif +#ifdef GL_ARB_depth_buffer_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_buffer_float", 18)) + { + ret = GLEW_ARB_depth_buffer_float; + continue; + } +#endif +#ifdef GL_ARB_depth_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp", 11)) + { + ret = GLEW_ARB_depth_clamp; + continue; + } +#endif #ifdef GL_ARB_depth_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13)) { @@ -8175,6 +21788,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_derivative_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"derivative_control", 18)) + { + ret = GLEW_ARB_derivative_control; + continue; + } +#endif +#ifdef GL_ARB_direct_state_access + if (_glewStrSame3(&pos, &len, (const GLubyte*)"direct_state_access", 19)) + { + ret = GLEW_ARB_direct_state_access; + continue; + } +#endif #ifdef GL_ARB_draw_buffers if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers", 12)) { @@ -8182,6 +21809,69 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_draw_buffers_blend + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers_blend", 18)) + { + ret = GLEW_ARB_draw_buffers_blend; + continue; + } +#endif +#ifdef GL_ARB_draw_elements_base_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_elements_base_vertex", 25)) + { + ret = GLEW_ARB_draw_elements_base_vertex; + continue; + } +#endif +#ifdef GL_ARB_draw_indirect + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_indirect", 13)) + { + ret = GLEW_ARB_draw_indirect; + continue; + } +#endif +#ifdef GL_ARB_draw_instanced + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_instanced", 14)) + { + ret = GLEW_ARB_draw_instanced; + continue; + } +#endif +#ifdef GL_ARB_enhanced_layouts + if (_glewStrSame3(&pos, &len, (const GLubyte*)"enhanced_layouts", 16)) + { + ret = GLEW_ARB_enhanced_layouts; + continue; + } +#endif +#ifdef GL_ARB_explicit_attrib_location + if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_attrib_location", 24)) + { + ret = GLEW_ARB_explicit_attrib_location; + continue; + } +#endif +#ifdef GL_ARB_explicit_uniform_location + if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_uniform_location", 25)) + { + ret = GLEW_ARB_explicit_uniform_location; + continue; + } +#endif +#ifdef GL_ARB_fragment_coord_conventions + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_coord_conventions", 26)) + { + ret = GLEW_ARB_fragment_coord_conventions; + continue; + } +#endif +#ifdef GL_ARB_fragment_layer_viewport + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_layer_viewport", 23)) + { + ret = GLEW_ARB_fragment_layer_viewport; + continue; + } +#endif #ifdef GL_ARB_fragment_program if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program", 16)) { @@ -8203,6 +21893,83 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_fragment_shader_interlock + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader_interlock", 25)) + { + ret = GLEW_ARB_fragment_shader_interlock; + continue; + } +#endif +#ifdef GL_ARB_framebuffer_no_attachments + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_no_attachments", 26)) + { + ret = GLEW_ARB_framebuffer_no_attachments; + continue; + } +#endif +#ifdef GL_ARB_framebuffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_object", 18)) + { + ret = GLEW_ARB_framebuffer_object; + continue; + } +#endif +#ifdef GL_ARB_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = GLEW_ARB_framebuffer_sRGB; + continue; + } +#endif +#ifdef GL_ARB_geometry_shader4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) + { + ret = GLEW_ARB_geometry_shader4; + continue; + } +#endif +#ifdef GL_ARB_get_program_binary + if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_program_binary", 18)) + { + ret = GLEW_ARB_get_program_binary; + continue; + } +#endif +#ifdef GL_ARB_get_texture_sub_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_texture_sub_image", 21)) + { + ret = GLEW_ARB_get_texture_sub_image; + continue; + } +#endif +#ifdef GL_ARB_gl_spirv + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gl_spirv", 8)) + { + ret = GLEW_ARB_gl_spirv; + continue; + } +#endif +#ifdef GL_ARB_gpu_shader5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader5", 11)) + { + ret = GLEW_ARB_gpu_shader5; + continue; + } +#endif +#ifdef GL_ARB_gpu_shader_fp64 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader_fp64", 15)) + { + ret = GLEW_ARB_gpu_shader_fp64; + continue; + } +#endif +#ifdef GL_ARB_gpu_shader_int64 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader_int64", 16)) + { + ret = GLEW_ARB_gpu_shader_int64; + continue; + } +#endif #ifdef GL_ARB_half_float_pixel if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float_pixel", 16)) { @@ -8210,6 +21977,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_half_float_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float_vertex", 17)) + { + ret = GLEW_ARB_half_float_vertex; + continue; + } +#endif #ifdef GL_ARB_imaging if (_glewStrSame3(&pos, &len, (const GLubyte*)"imaging", 7)) { @@ -8217,6 +21991,55 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_indirect_parameters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"indirect_parameters", 19)) + { + ret = GLEW_ARB_indirect_parameters; + continue; + } +#endif +#ifdef GL_ARB_instanced_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"instanced_arrays", 16)) + { + ret = GLEW_ARB_instanced_arrays; + continue; + } +#endif +#ifdef GL_ARB_internalformat_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"internalformat_query", 20)) + { + ret = GLEW_ARB_internalformat_query; + continue; + } +#endif +#ifdef GL_ARB_internalformat_query2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"internalformat_query2", 21)) + { + ret = GLEW_ARB_internalformat_query2; + continue; + } +#endif +#ifdef GL_ARB_invalidate_subdata + if (_glewStrSame3(&pos, &len, (const GLubyte*)"invalidate_subdata", 18)) + { + ret = GLEW_ARB_invalidate_subdata; + continue; + } +#endif +#ifdef GL_ARB_map_buffer_alignment + if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_buffer_alignment", 20)) + { + ret = GLEW_ARB_map_buffer_alignment; + continue; + } +#endif +#ifdef GL_ARB_map_buffer_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_buffer_range", 16)) + { + ret = GLEW_ARB_map_buffer_range; + continue; + } +#endif #ifdef GL_ARB_matrix_palette if (_glewStrSame3(&pos, &len, (const GLubyte*)"matrix_palette", 14)) { @@ -8224,6 +22047,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_multi_bind + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_bind", 10)) + { + ret = GLEW_ARB_multi_bind; + continue; + } +#endif +#ifdef GL_ARB_multi_draw_indirect + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_indirect", 19)) + { + ret = GLEW_ARB_multi_draw_indirect; + continue; + } +#endif #ifdef GL_ARB_multisample if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) { @@ -8245,6 +22082,27 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_occlusion_query2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query2", 16)) + { + ret = GLEW_ARB_occlusion_query2; + continue; + } +#endif +#ifdef GL_ARB_parallel_shader_compile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"parallel_shader_compile", 23)) + { + ret = GLEW_ARB_parallel_shader_compile; + continue; + } +#endif +#ifdef GL_ARB_pipeline_statistics_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pipeline_statistics_query", 25)) + { + ret = GLEW_ARB_pipeline_statistics_query; + continue; + } +#endif #ifdef GL_ARB_pixel_buffer_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer_object", 19)) { @@ -8266,6 +22124,174 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_polygon_offset_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"polygon_offset_clamp", 20)) + { + ret = GLEW_ARB_polygon_offset_clamp; + continue; + } +#endif +#ifdef GL_ARB_post_depth_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"post_depth_coverage", 19)) + { + ret = GLEW_ARB_post_depth_coverage; + continue; + } +#endif +#ifdef GL_ARB_program_interface_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"program_interface_query", 23)) + { + ret = GLEW_ARB_program_interface_query; + continue; + } +#endif +#ifdef GL_ARB_provoking_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"provoking_vertex", 16)) + { + ret = GLEW_ARB_provoking_vertex; + continue; + } +#endif +#ifdef GL_ARB_query_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"query_buffer_object", 19)) + { + ret = GLEW_ARB_query_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_robust_buffer_access_behavior + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robust_buffer_access_behavior", 29)) + { + ret = GLEW_ARB_robust_buffer_access_behavior; + continue; + } +#endif +#ifdef GL_ARB_robustness + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness", 10)) + { + ret = GLEW_ARB_robustness; + continue; + } +#endif +#ifdef GL_ARB_robustness_application_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_application_isolation", 32)) + { + ret = GLEW_ARB_robustness_application_isolation; + continue; + } +#endif +#ifdef GL_ARB_robustness_share_group_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_share_group_isolation", 32)) + { + ret = GLEW_ARB_robustness_share_group_isolation; + continue; + } +#endif +#ifdef GL_ARB_sample_locations + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_locations", 16)) + { + ret = GLEW_ARB_sample_locations; + continue; + } +#endif +#ifdef GL_ARB_sample_shading + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_shading", 14)) + { + ret = GLEW_ARB_sample_shading; + continue; + } +#endif +#ifdef GL_ARB_sampler_objects + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sampler_objects", 15)) + { + ret = GLEW_ARB_sampler_objects; + continue; + } +#endif +#ifdef GL_ARB_seamless_cube_map + if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cube_map", 17)) + { + ret = GLEW_ARB_seamless_cube_map; + continue; + } +#endif +#ifdef GL_ARB_seamless_cubemap_per_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cubemap_per_texture", 28)) + { + ret = GLEW_ARB_seamless_cubemap_per_texture; + continue; + } +#endif +#ifdef GL_ARB_separate_shader_objects + if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_shader_objects", 23)) + { + ret = GLEW_ARB_separate_shader_objects; + continue; + } +#endif +#ifdef GL_ARB_shader_atomic_counter_ops + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_counter_ops", 25)) + { + ret = GLEW_ARB_shader_atomic_counter_ops; + continue; + } +#endif +#ifdef GL_ARB_shader_atomic_counters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_counters", 22)) + { + ret = GLEW_ARB_shader_atomic_counters; + continue; + } +#endif +#ifdef GL_ARB_shader_ballot + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_ballot", 13)) + { + ret = GLEW_ARB_shader_ballot; + continue; + } +#endif +#ifdef GL_ARB_shader_bit_encoding + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_bit_encoding", 19)) + { + ret = GLEW_ARB_shader_bit_encoding; + continue; + } +#endif +#ifdef GL_ARB_shader_clock + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_clock", 12)) + { + ret = GLEW_ARB_shader_clock; + continue; + } +#endif +#ifdef GL_ARB_shader_draw_parameters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_draw_parameters", 22)) + { + ret = GLEW_ARB_shader_draw_parameters; + continue; + } +#endif +#ifdef GL_ARB_shader_group_vote + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_group_vote", 17)) + { + ret = GLEW_ARB_shader_group_vote; + continue; + } +#endif +#ifdef GL_ARB_shader_image_load_store + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_load_store", 23)) + { + ret = GLEW_ARB_shader_image_load_store; + continue; + } +#endif +#ifdef GL_ARB_shader_image_size + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_size", 17)) + { + ret = GLEW_ARB_shader_image_size; + continue; + } +#endif #ifdef GL_ARB_shader_objects if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_objects", 14)) { @@ -8273,6 +22299,55 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_shader_precision + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_precision", 16)) + { + ret = GLEW_ARB_shader_precision; + continue; + } +#endif +#ifdef GL_ARB_shader_stencil_export + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_stencil_export", 21)) + { + ret = GLEW_ARB_shader_stencil_export; + continue; + } +#endif +#ifdef GL_ARB_shader_storage_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_storage_buffer_object", 28)) + { + ret = GLEW_ARB_shader_storage_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_shader_subroutine + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_subroutine", 17)) + { + ret = GLEW_ARB_shader_subroutine; + continue; + } +#endif +#ifdef GL_ARB_shader_texture_image_samples + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_image_samples", 28)) + { + ret = GLEW_ARB_shader_texture_image_samples; + continue; + } +#endif +#ifdef GL_ARB_shader_texture_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_lod", 18)) + { + ret = GLEW_ARB_shader_texture_lod; + continue; + } +#endif +#ifdef GL_ARB_shader_viewport_layer_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_viewport_layer_array", 27)) + { + ret = GLEW_ARB_shader_viewport_layer_array; + continue; + } +#endif #ifdef GL_ARB_shading_language_100 if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_100", 20)) { @@ -8280,6 +22355,27 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_shading_language_420pack + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_420pack", 24)) + { + ret = GLEW_ARB_shading_language_420pack; + continue; + } +#endif +#ifdef GL_ARB_shading_language_include + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_include", 24)) + { + ret = GLEW_ARB_shading_language_include; + continue; + } +#endif +#ifdef GL_ARB_shading_language_packing + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_packing", 24)) + { + ret = GLEW_ARB_shading_language_packing; + continue; + } +#endif #ifdef GL_ARB_shadow if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow", 6)) { @@ -8294,6 +22390,69 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_sparse_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_buffer", 13)) + { + ret = GLEW_ARB_sparse_buffer; + continue; + } +#endif +#ifdef GL_ARB_sparse_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture", 14)) + { + ret = GLEW_ARB_sparse_texture; + continue; + } +#endif +#ifdef GL_ARB_sparse_texture2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture2", 15)) + { + ret = GLEW_ARB_sparse_texture2; + continue; + } +#endif +#ifdef GL_ARB_sparse_texture_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture_clamp", 20)) + { + ret = GLEW_ARB_sparse_texture_clamp; + continue; + } +#endif +#ifdef GL_ARB_spirv_extensions + if (_glewStrSame3(&pos, &len, (const GLubyte*)"spirv_extensions", 16)) + { + ret = GLEW_ARB_spirv_extensions; + continue; + } +#endif +#ifdef GL_ARB_stencil_texturing + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_texturing", 17)) + { + ret = GLEW_ARB_stencil_texturing; + continue; + } +#endif +#ifdef GL_ARB_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync", 4)) + { + ret = GLEW_ARB_sync; + continue; + } +#endif +#ifdef GL_ARB_tessellation_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tessellation_shader", 19)) + { + ret = GLEW_ARB_tessellation_shader; + continue; + } +#endif +#ifdef GL_ARB_texture_barrier + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_barrier", 15)) + { + ret = GLEW_ARB_texture_barrier; + continue; + } +#endif #ifdef GL_ARB_texture_border_clamp if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_border_clamp", 20)) { @@ -8301,6 +22460,27 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_texture_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object", 21)) + { + ret = GLEW_ARB_texture_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_texture_buffer_object_rgb32 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object_rgb32", 27)) + { + ret = GLEW_ARB_texture_buffer_object_rgb32; + continue; + } +#endif +#ifdef GL_ARB_texture_buffer_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_range", 20)) + { + ret = GLEW_ARB_texture_buffer_range; + continue; + } +#endif #ifdef GL_ARB_texture_compression if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression", 19)) { @@ -8308,6 +22488,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_texture_compression_bptc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_bptc", 24)) + { + ret = GLEW_ARB_texture_compression_bptc; + continue; + } +#endif +#ifdef GL_ARB_texture_compression_rgtc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_rgtc", 24)) + { + ret = GLEW_ARB_texture_compression_rgtc; + continue; + } +#endif #ifdef GL_ARB_texture_cube_map if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map", 16)) { @@ -8315,6 +22509,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_texture_cube_map_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map_array", 22)) + { + ret = GLEW_ARB_texture_cube_map_array; + continue; + } +#endif #ifdef GL_ARB_texture_env_add if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_add", 15)) { @@ -8343,6 +22544,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_texture_filter_anisotropic + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter_anisotropic", 26)) + { + ret = GLEW_ARB_texture_filter_anisotropic; + continue; + } +#endif +#ifdef GL_ARB_texture_filter_minmax + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter_minmax", 21)) + { + ret = GLEW_ARB_texture_filter_minmax; + continue; + } +#endif #ifdef GL_ARB_texture_float if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_float", 13)) { @@ -8350,6 +22565,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_texture_gather + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_gather", 14)) + { + ret = GLEW_ARB_texture_gather; + continue; + } +#endif +#ifdef GL_ARB_texture_mirror_clamp_to_edge + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_clamp_to_edge", 28)) + { + ret = GLEW_ARB_texture_mirror_clamp_to_edge; + continue; + } +#endif #ifdef GL_ARB_texture_mirrored_repeat if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirrored_repeat", 23)) { @@ -8357,6 +22586,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_texture_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multisample", 19)) + { + ret = GLEW_ARB_texture_multisample; + continue; + } +#endif #ifdef GL_ARB_texture_non_power_of_two if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_non_power_of_two", 24)) { @@ -8364,6 +22600,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_texture_query_levels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_query_levels", 20)) + { + ret = GLEW_ARB_texture_query_levels; + continue; + } +#endif +#ifdef GL_ARB_texture_query_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_query_lod", 17)) + { + ret = GLEW_ARB_texture_query_lod; + continue; + } +#endif #ifdef GL_ARB_texture_rectangle if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) { @@ -8371,6 +22621,90 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_texture_rg + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rg", 10)) + { + ret = GLEW_ARB_texture_rg; + continue; + } +#endif +#ifdef GL_ARB_texture_rgb10_a2ui + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rgb10_a2ui", 18)) + { + ret = GLEW_ARB_texture_rgb10_a2ui; + continue; + } +#endif +#ifdef GL_ARB_texture_stencil8 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_stencil8", 16)) + { + ret = GLEW_ARB_texture_stencil8; + continue; + } +#endif +#ifdef GL_ARB_texture_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_storage", 15)) + { + ret = GLEW_ARB_texture_storage; + continue; + } +#endif +#ifdef GL_ARB_texture_storage_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_storage_multisample", 27)) + { + ret = GLEW_ARB_texture_storage_multisample; + continue; + } +#endif +#ifdef GL_ARB_texture_swizzle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_swizzle", 15)) + { + ret = GLEW_ARB_texture_swizzle; + continue; + } +#endif +#ifdef GL_ARB_texture_view + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_view", 12)) + { + ret = GLEW_ARB_texture_view; + continue; + } +#endif +#ifdef GL_ARB_timer_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11)) + { + ret = GLEW_ARB_timer_query; + continue; + } +#endif +#ifdef GL_ARB_transform_feedback2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback2", 19)) + { + ret = GLEW_ARB_transform_feedback2; + continue; + } +#endif +#ifdef GL_ARB_transform_feedback3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback3", 19)) + { + ret = GLEW_ARB_transform_feedback3; + continue; + } +#endif +#ifdef GL_ARB_transform_feedback_instanced + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback_instanced", 28)) + { + ret = GLEW_ARB_transform_feedback_instanced; + continue; + } +#endif +#ifdef GL_ARB_transform_feedback_overflow_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback_overflow_query", 33)) + { + ret = GLEW_ARB_transform_feedback_overflow_query; + continue; + } +#endif #ifdef GL_ARB_transpose_matrix if (_glewStrSame3(&pos, &len, (const GLubyte*)"transpose_matrix", 16)) { @@ -8378,6 +22712,41 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_uniform_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"uniform_buffer_object", 21)) + { + ret = GLEW_ARB_uniform_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_vertex_array_bgra + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_bgra", 17)) + { + ret = GLEW_ARB_vertex_array_bgra; + continue; + } +#endif +#ifdef GL_ARB_vertex_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) + { + ret = GLEW_ARB_vertex_array_object; + continue; + } +#endif +#ifdef GL_ARB_vertex_attrib_64bit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_64bit", 19)) + { + ret = GLEW_ARB_vertex_attrib_64bit; + continue; + } +#endif +#ifdef GL_ARB_vertex_attrib_binding + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_binding", 21)) + { + ret = GLEW_ARB_vertex_attrib_binding; + continue; + } +#endif #ifdef GL_ARB_vertex_blend if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_blend", 12)) { @@ -8406,12 +22775,71 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_vertex_type_10f_11f_11f_rev + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_type_10f_11f_11f_rev", 27)) + { + ret = GLEW_ARB_vertex_type_10f_11f_11f_rev; + continue; + } +#endif +#ifdef GL_ARB_vertex_type_2_10_10_10_rev + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_type_2_10_10_10_rev", 26)) + { + ret = GLEW_ARB_vertex_type_2_10_10_10_rev; + continue; + } +#endif +#ifdef GL_ARB_viewport_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"viewport_array", 14)) + { + ret = GLEW_ARB_viewport_array; + continue; + } +#endif #ifdef GL_ARB_window_pos if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_pos", 10)) { ret = GLEW_ARB_window_pos; continue; } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARM_", 4)) + { +#ifdef GL_ARM_mali_program_binary + if (_glewStrSame3(&pos, &len, (const GLubyte*)"mali_program_binary", 19)) + { + ret = GLEW_ARM_mali_program_binary; + continue; + } +#endif +#ifdef GL_ARM_mali_shader_binary + if (_glewStrSame3(&pos, &len, (const GLubyte*)"mali_shader_binary", 18)) + { + ret = GLEW_ARM_mali_shader_binary; + continue; + } +#endif +#ifdef GL_ARM_rgba8 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"rgba8", 5)) + { + ret = GLEW_ARM_rgba8; + continue; + } +#endif +#ifdef GL_ARM_shader_framebuffer_fetch + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_framebuffer_fetch", 24)) + { + ret = GLEW_ARM_shader_framebuffer_fetch; + continue; + } +#endif +#ifdef GL_ARM_shader_framebuffer_fetch_depth_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_framebuffer_fetch_depth_stencil", 38)) + { + ret = GLEW_ARM_shader_framebuffer_fetch_depth_stencil; + continue; + } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATIX_", 5)) @@ -8482,6 +22910,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ATI_meminfo + if (_glewStrSame3(&pos, &len, (const GLubyte*)"meminfo", 7)) + { + ret = GLEW_ATI_meminfo; + continue; + } +#endif #ifdef GL_ATI_pn_triangles if (_glewStrSame3(&pos, &len, (const GLubyte*)"pn_triangles", 12)) { @@ -8558,6 +22993,23 @@ GLboolean glewIsSupported (const char* name) ret = GLEW_ATI_vertex_streams; continue; } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"EGL_", 4)) + { +#ifdef GL_EGL_KHR_context_flush_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"KHR_context_flush_control", 25)) + { + ret = GLEW_EGL_KHR_context_flush_control; + continue; + } +#endif +#ifdef GL_EGL_NV_robustness_video_memory_purge + if (_glewStrSame3(&pos, &len, (const GLubyte*)"NV_robustness_video_memory_purge", 32)) + { + ret = GLEW_EGL_NV_robustness_video_memory_purge; + continue; + } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) @@ -8576,6 +23028,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_EGL_image_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"EGL_image_array", 15)) + { + ret = GLEW_EXT_EGL_image_array; + continue; + } +#endif +#ifdef GL_EXT_YUV_target + if (_glewStrSame3(&pos, &len, (const GLubyte*)"YUV_target", 10)) + { + ret = GLEW_EXT_YUV_target; + continue; + } +#endif #ifdef GL_EXT_abgr if (_glewStrSame3(&pos, &len, (const GLubyte*)"abgr", 4)) { @@ -8583,6 +23049,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_base_instance + if (_glewStrSame3(&pos, &len, (const GLubyte*)"base_instance", 13)) + { + ret = GLEW_EXT_base_instance; + continue; + } +#endif #ifdef GL_EXT_bgra if (_glewStrSame3(&pos, &len, (const GLubyte*)"bgra", 4)) { @@ -8611,6 +23084,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_blend_func_extended + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_func_extended", 19)) + { + ret = GLEW_EXT_blend_func_extended; + continue; + } +#endif #ifdef GL_EXT_blend_func_separate if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_func_separate", 19)) { @@ -8639,6 +23119,27 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_buffer_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_storage", 14)) + { + ret = GLEW_EXT_buffer_storage; + continue; + } +#endif +#ifdef GL_EXT_clear_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clear_texture", 13)) + { + ret = GLEW_EXT_clear_texture; + continue; + } +#endif +#ifdef GL_EXT_clip_cull_distance + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clip_cull_distance", 18)) + { + ret = GLEW_EXT_clip_cull_distance; + continue; + } +#endif #ifdef GL_EXT_clip_volume_hint if (_glewStrSame3(&pos, &len, (const GLubyte*)"clip_volume_hint", 16)) { @@ -8653,6 +23154,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_color_buffer_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_buffer_float", 18)) + { + ret = GLEW_EXT_color_buffer_float; + continue; + } +#endif +#ifdef GL_EXT_color_buffer_half_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_buffer_half_float", 23)) + { + ret = GLEW_EXT_color_buffer_half_float; + continue; + } +#endif #ifdef GL_EXT_color_subtable if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_subtable", 14)) { @@ -8667,6 +23182,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_compressed_ETC1_RGB8_sub_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_ETC1_RGB8_sub_texture", 32)) + { + ret = GLEW_EXT_compressed_ETC1_RGB8_sub_texture; + continue; + } +#endif +#ifdef GL_EXT_conservative_depth + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_depth", 18)) + { + ret = GLEW_EXT_conservative_depth; + continue; + } +#endif #ifdef GL_EXT_convolution if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution", 11)) { @@ -8681,6 +23210,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_copy_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) + { + ret = GLEW_EXT_copy_image; + continue; + } +#endif #ifdef GL_EXT_copy_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_texture", 12)) { @@ -8695,6 +23231,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_debug_label + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_label", 11)) + { + ret = GLEW_EXT_debug_label; + continue; + } +#endif +#ifdef GL_EXT_debug_marker + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_marker", 12)) + { + ret = GLEW_EXT_debug_marker; + continue; + } +#endif #ifdef GL_EXT_depth_bounds_test if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_bounds_test", 17)) { @@ -8702,6 +23252,27 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_direct_state_access + if (_glewStrSame3(&pos, &len, (const GLubyte*)"direct_state_access", 19)) + { + ret = GLEW_EXT_direct_state_access; + continue; + } +#endif +#ifdef GL_EXT_discard_framebuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"discard_framebuffer", 19)) + { + ret = GLEW_EXT_discard_framebuffer; + continue; + } +#endif +#ifdef GL_EXT_draw_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers", 12)) + { + ret = GLEW_EXT_draw_buffers; + continue; + } +#endif #ifdef GL_EXT_draw_buffers2 if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers2", 13)) { @@ -8709,6 +23280,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_draw_buffers_indexed + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers_indexed", 20)) + { + ret = GLEW_EXT_draw_buffers_indexed; + continue; + } +#endif +#ifdef GL_EXT_draw_elements_base_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_elements_base_vertex", 25)) + { + ret = GLEW_EXT_draw_elements_base_vertex; + continue; + } +#endif #ifdef GL_EXT_draw_instanced if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_instanced", 14)) { @@ -8723,6 +23308,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_external_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"external_buffer", 15)) + { + ret = GLEW_EXT_external_buffer; + continue; + } +#endif +#ifdef GL_EXT_float_blend + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_blend", 11)) + { + ret = GLEW_EXT_float_blend; + continue; + } +#endif #ifdef GL_EXT_fog_coord if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_coord", 9)) { @@ -8730,6 +23329,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_frag_depth + if (_glewStrSame3(&pos, &len, (const GLubyte*)"frag_depth", 10)) + { + ret = GLEW_EXT_frag_depth; + continue; + } +#endif #ifdef GL_EXT_fragment_lighting if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_lighting", 17)) { @@ -8751,6 +23357,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_framebuffer_multisample_blit_scaled + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample_blit_scaled", 35)) + { + ret = GLEW_EXT_framebuffer_multisample_blit_scaled; + continue; + } +#endif #ifdef GL_EXT_framebuffer_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_object", 18)) { @@ -8765,6 +23378,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_geometry_point_size + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_point_size", 19)) + { + ret = GLEW_EXT_geometry_point_size; + continue; + } +#endif +#ifdef GL_EXT_geometry_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader", 15)) + { + ret = GLEW_EXT_geometry_shader; + continue; + } +#endif #ifdef GL_EXT_geometry_shader4 if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) { @@ -8786,6 +23413,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_gpu_shader5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader5", 11)) + { + ret = GLEW_EXT_gpu_shader5; + continue; + } +#endif #ifdef GL_EXT_histogram if (_glewStrSame3(&pos, &len, (const GLubyte*)"histogram", 9)) { @@ -8821,6 +23455,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_instanced_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"instanced_arrays", 16)) + { + ret = GLEW_EXT_instanced_arrays; + continue; + } +#endif #ifdef GL_EXT_light_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"light_texture", 13)) { @@ -8828,6 +23469,34 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_map_buffer_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_buffer_range", 16)) + { + ret = GLEW_EXT_map_buffer_range; + continue; + } +#endif +#ifdef GL_EXT_memory_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"memory_object", 13)) + { + ret = GLEW_EXT_memory_object; + continue; + } +#endif +#ifdef GL_EXT_memory_object_fd + if (_glewStrSame3(&pos, &len, (const GLubyte*)"memory_object_fd", 16)) + { + ret = GLEW_EXT_memory_object_fd; + continue; + } +#endif +#ifdef GL_EXT_memory_object_win32 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"memory_object_win32", 19)) + { + ret = GLEW_EXT_memory_object_win32; + continue; + } +#endif #ifdef GL_EXT_misc_attribute if (_glewStrSame3(&pos, &len, (const GLubyte*)"misc_attribute", 14)) { @@ -8842,6 +23511,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_multi_draw_indirect + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_indirect", 19)) + { + ret = GLEW_EXT_multi_draw_indirect; + continue; + } +#endif +#ifdef GL_EXT_multiple_textures + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multiple_textures", 17)) + { + ret = GLEW_EXT_multiple_textures; + continue; + } +#endif #ifdef GL_EXT_multisample if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) { @@ -8849,6 +23532,34 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_multisample_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_compatibility", 25)) + { + ret = GLEW_EXT_multisample_compatibility; + continue; + } +#endif +#ifdef GL_EXT_multisampled_render_to_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisampled_render_to_texture", 30)) + { + ret = GLEW_EXT_multisampled_render_to_texture; + continue; + } +#endif +#ifdef GL_EXT_multisampled_render_to_texture2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisampled_render_to_texture2", 31)) + { + ret = GLEW_EXT_multisampled_render_to_texture2; + continue; + } +#endif +#ifdef GL_EXT_multiview_draw_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multiview_draw_buffers", 22)) + { + ret = GLEW_EXT_multiview_draw_buffers; + continue; + } +#endif #ifdef GL_EXT_packed_depth_stencil if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_depth_stencil", 20)) { @@ -8912,6 +23623,55 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_polygon_offset_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"polygon_offset_clamp", 20)) + { + ret = GLEW_EXT_polygon_offset_clamp; + continue; + } +#endif +#ifdef GL_EXT_post_depth_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"post_depth_coverage", 19)) + { + ret = GLEW_EXT_post_depth_coverage; + continue; + } +#endif +#ifdef GL_EXT_provoking_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"provoking_vertex", 16)) + { + ret = GLEW_EXT_provoking_vertex; + continue; + } +#endif +#ifdef GL_EXT_pvrtc_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pvrtc_sRGB", 10)) + { + ret = GLEW_EXT_pvrtc_sRGB; + continue; + } +#endif +#ifdef GL_EXT_raster_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"raster_multisample", 18)) + { + ret = GLEW_EXT_raster_multisample; + continue; + } +#endif +#ifdef GL_EXT_read_format_bgra + if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_format_bgra", 16)) + { + ret = GLEW_EXT_read_format_bgra; + continue; + } +#endif +#ifdef GL_EXT_render_snorm + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_snorm", 12)) + { + ret = GLEW_EXT_render_snorm; + continue; + } +#endif #ifdef GL_EXT_rescale_normal if (_glewStrSame3(&pos, &len, (const GLubyte*)"rescale_normal", 14)) { @@ -8919,6 +23679,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sRGB", 4)) + { + ret = GLEW_EXT_sRGB; + continue; + } +#endif +#ifdef GL_EXT_sRGB_write_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sRGB_write_control", 18)) + { + ret = GLEW_EXT_sRGB_write_control; + continue; + } +#endif #ifdef GL_EXT_scene_marker if (_glewStrSame3(&pos, &len, (const GLubyte*)"scene_marker", 12)) { @@ -8933,6 +23707,34 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_semaphore + if (_glewStrSame3(&pos, &len, (const GLubyte*)"semaphore", 9)) + { + ret = GLEW_EXT_semaphore; + continue; + } +#endif +#ifdef GL_EXT_semaphore_fd + if (_glewStrSame3(&pos, &len, (const GLubyte*)"semaphore_fd", 12)) + { + ret = GLEW_EXT_semaphore_fd; + continue; + } +#endif +#ifdef GL_EXT_semaphore_win32 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"semaphore_win32", 15)) + { + ret = GLEW_EXT_semaphore_win32; + continue; + } +#endif +#ifdef GL_EXT_separate_shader_objects + if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_shader_objects", 23)) + { + ret = GLEW_EXT_separate_shader_objects; + continue; + } +#endif #ifdef GL_EXT_separate_specular_color if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_specular_color", 23)) { @@ -8940,6 +23742,83 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_shader_framebuffer_fetch + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_framebuffer_fetch", 24)) + { + ret = GLEW_EXT_shader_framebuffer_fetch; + continue; + } +#endif +#ifdef GL_EXT_shader_group_vote + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_group_vote", 17)) + { + ret = GLEW_EXT_shader_group_vote; + continue; + } +#endif +#ifdef GL_EXT_shader_image_load_formatted + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_load_formatted", 27)) + { + ret = GLEW_EXT_shader_image_load_formatted; + continue; + } +#endif +#ifdef GL_EXT_shader_image_load_store + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_load_store", 23)) + { + ret = GLEW_EXT_shader_image_load_store; + continue; + } +#endif +#ifdef GL_EXT_shader_implicit_conversions + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_implicit_conversions", 27)) + { + ret = GLEW_EXT_shader_implicit_conversions; + continue; + } +#endif +#ifdef GL_EXT_shader_integer_mix + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_integer_mix", 18)) + { + ret = GLEW_EXT_shader_integer_mix; + continue; + } +#endif +#ifdef GL_EXT_shader_io_blocks + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_io_blocks", 16)) + { + ret = GLEW_EXT_shader_io_blocks; + continue; + } +#endif +#ifdef GL_EXT_shader_non_constant_global_initializers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_non_constant_global_initializers", 39)) + { + ret = GLEW_EXT_shader_non_constant_global_initializers; + continue; + } +#endif +#ifdef GL_EXT_shader_pixel_local_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_pixel_local_storage", 26)) + { + ret = GLEW_EXT_shader_pixel_local_storage; + continue; + } +#endif +#ifdef GL_EXT_shader_pixel_local_storage2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_pixel_local_storage2", 27)) + { + ret = GLEW_EXT_shader_pixel_local_storage2; + continue; + } +#endif +#ifdef GL_EXT_shader_texture_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_lod", 18)) + { + ret = GLEW_EXT_shader_texture_lod; + continue; + } +#endif #ifdef GL_EXT_shadow_funcs if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_funcs", 12)) { @@ -8947,6 +23826,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_shadow_samplers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_samplers", 15)) + { + ret = GLEW_EXT_shadow_samplers; + continue; + } +#endif #ifdef GL_EXT_shared_texture_palette if (_glewStrSame3(&pos, &len, (const GLubyte*)"shared_texture_palette", 22)) { @@ -8954,6 +23840,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_sparse_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture", 14)) + { + ret = GLEW_EXT_sparse_texture; + continue; + } +#endif +#ifdef GL_EXT_sparse_texture2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture2", 15)) + { + ret = GLEW_EXT_sparse_texture2; + continue; + } +#endif #ifdef GL_EXT_stencil_clear_tag if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_clear_tag", 17)) { @@ -9010,6 +23910,27 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_texture_compression_astc_decode_mode + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_astc_decode_mode", 36)) + { + ret = GLEW_EXT_texture_compression_astc_decode_mode; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_astc_decode_mode_rgb9e5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_astc_decode_mode_rgb9e5", 43)) + { + ret = GLEW_EXT_texture_compression_astc_decode_mode_rgb9e5; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_bptc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_bptc", 24)) + { + ret = GLEW_EXT_texture_compression_bptc; + continue; + } +#endif #ifdef GL_EXT_texture_compression_dxt1 if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt1", 24)) { @@ -9045,6 +23966,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_texture_cube_map_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map_array", 22)) + { + ret = GLEW_EXT_texture_cube_map_array; + continue; + } +#endif #ifdef GL_EXT_texture_edge_clamp if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_edge_clamp", 18)) { @@ -9087,6 +24015,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_texture_filter_minmax + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter_minmax", 21)) + { + ret = GLEW_EXT_texture_filter_minmax; + continue; + } +#endif +#ifdef GL_EXT_texture_format_BGRA8888 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_format_BGRA8888", 23)) + { + ret = GLEW_EXT_texture_format_BGRA8888; + continue; + } +#endif #ifdef GL_EXT_texture_integer if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_integer", 15)) { @@ -9108,6 +24050,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_texture_norm16 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_norm16", 14)) + { + ret = GLEW_EXT_texture_norm16; + continue; + } +#endif #ifdef GL_EXT_texture_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_object", 14)) { @@ -9129,6 +24078,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_texture_rg + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rg", 10)) + { + ret = GLEW_EXT_texture_rg; + continue; + } +#endif #ifdef GL_EXT_texture_sRGB if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB", 12)) { @@ -9136,6 +24092,27 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_texture_sRGB_R8 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB_R8", 15)) + { + ret = GLEW_EXT_texture_sRGB_R8; + continue; + } +#endif +#ifdef GL_EXT_texture_sRGB_RG8 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB_RG8", 16)) + { + ret = GLEW_EXT_texture_sRGB_RG8; + continue; + } +#endif +#ifdef GL_EXT_texture_sRGB_decode + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB_decode", 19)) + { + ret = GLEW_EXT_texture_sRGB_decode; + continue; + } +#endif #ifdef GL_EXT_texture_shared_exponent if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shared_exponent", 23)) { @@ -9143,6 +24120,41 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_texture_snorm + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_snorm", 13)) + { + ret = GLEW_EXT_texture_snorm; + continue; + } +#endif +#ifdef GL_EXT_texture_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_storage", 15)) + { + ret = GLEW_EXT_texture_storage; + continue; + } +#endif +#ifdef GL_EXT_texture_swizzle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_swizzle", 15)) + { + ret = GLEW_EXT_texture_swizzle; + continue; + } +#endif +#ifdef GL_EXT_texture_type_2_10_10_10_REV + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_type_2_10_10_10_REV", 27)) + { + ret = GLEW_EXT_texture_type_2_10_10_10_REV; + continue; + } +#endif +#ifdef GL_EXT_texture_view + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_view", 12)) + { + ret = GLEW_EXT_texture_view; + continue; + } +#endif #ifdef GL_EXT_timer_query if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11)) { @@ -9150,6 +24162,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_transform_feedback + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback", 18)) + { + ret = GLEW_EXT_transform_feedback; + continue; + } +#endif +#ifdef GL_EXT_unpack_subimage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"unpack_subimage", 15)) + { + ret = GLEW_EXT_unpack_subimage; + continue; + } +#endif #ifdef GL_EXT_vertex_array if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array", 12)) { @@ -9157,6 +24183,27 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_vertex_array_bgra + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_bgra", 17)) + { + ret = GLEW_EXT_vertex_array_bgra; + continue; + } +#endif +#ifdef GL_EXT_vertex_array_setXXX + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_setXXX", 19)) + { + ret = GLEW_EXT_vertex_array_setXXX; + continue; + } +#endif +#ifdef GL_EXT_vertex_attrib_64bit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_64bit", 19)) + { + ret = GLEW_EXT_vertex_attrib_64bit; + continue; + } +#endif #ifdef GL_EXT_vertex_shader if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader", 13)) { @@ -9170,6 +24217,27 @@ GLboolean glewIsSupported (const char* name) ret = GLEW_EXT_vertex_weighting; continue; } +#endif +#ifdef GL_EXT_win32_keyed_mutex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"win32_keyed_mutex", 17)) + { + ret = GLEW_EXT_win32_keyed_mutex; + continue; + } +#endif +#ifdef GL_EXT_window_rectangles + if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_rectangles", 17)) + { + ret = GLEW_EXT_window_rectangles; + continue; + } +#endif +#ifdef GL_EXT_x11_sync_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"x11_sync_object", 15)) + { + ret = GLEW_EXT_x11_sync_object; + continue; + } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"GREMEDY_", 8)) @@ -9284,6 +24352,34 @@ GLboolean glewIsSupported (const char* name) } if (_glewStrSame2(&pos, &len, (const GLubyte*)"INTEL_", 6)) { +#ifdef GL_INTEL_conservative_rasterization + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_rasterization", 26)) + { + ret = GLEW_INTEL_conservative_rasterization; + continue; + } +#endif +#ifdef GL_INTEL_fragment_shader_ordering + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader_ordering", 24)) + { + ret = GLEW_INTEL_fragment_shader_ordering; + continue; + } +#endif +#ifdef GL_INTEL_framebuffer_CMAA + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_CMAA", 16)) + { + ret = GLEW_INTEL_framebuffer_CMAA; + continue; + } +#endif +#ifdef GL_INTEL_map_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_texture", 11)) + { + ret = GLEW_INTEL_map_texture; + continue; + } +#endif #ifdef GL_INTEL_parallel_arrays if (_glewStrSame3(&pos, &len, (const GLubyte*)"parallel_arrays", 15)) { @@ -9291,12 +24387,99 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_INTEL_performance_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"performance_query", 17)) + { + ret = GLEW_INTEL_performance_query; + continue; + } +#endif #ifdef GL_INTEL_texture_scissor if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_scissor", 15)) { ret = GLEW_INTEL_texture_scissor; continue; } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"KHR_", 4)) + { +#ifdef GL_KHR_blend_equation_advanced + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_advanced", 23)) + { + ret = GLEW_KHR_blend_equation_advanced; + continue; + } +#endif +#ifdef GL_KHR_blend_equation_advanced_coherent + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_advanced_coherent", 32)) + { + ret = GLEW_KHR_blend_equation_advanced_coherent; + continue; + } +#endif +#ifdef GL_KHR_context_flush_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"context_flush_control", 21)) + { + ret = GLEW_KHR_context_flush_control; + continue; + } +#endif +#ifdef GL_KHR_debug + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug", 5)) + { + ret = GLEW_KHR_debug; + continue; + } +#endif +#ifdef GL_KHR_no_error + if (_glewStrSame3(&pos, &len, (const GLubyte*)"no_error", 8)) + { + ret = GLEW_KHR_no_error; + continue; + } +#endif +#ifdef GL_KHR_parallel_shader_compile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"parallel_shader_compile", 23)) + { + ret = GLEW_KHR_parallel_shader_compile; + continue; + } +#endif +#ifdef GL_KHR_robust_buffer_access_behavior + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robust_buffer_access_behavior", 29)) + { + ret = GLEW_KHR_robust_buffer_access_behavior; + continue; + } +#endif +#ifdef GL_KHR_robustness + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness", 10)) + { + ret = GLEW_KHR_robustness; + continue; + } +#endif +#ifdef GL_KHR_texture_compression_astc_hdr + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_astc_hdr", 28)) + { + ret = GLEW_KHR_texture_compression_astc_hdr; + continue; + } +#endif +#ifdef GL_KHR_texture_compression_astc_ldr + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_astc_ldr", 28)) + { + ret = GLEW_KHR_texture_compression_astc_ldr; + continue; + } +#endif +#ifdef GL_KHR_texture_compression_astc_sliced_3d + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_astc_sliced_3d", 34)) + { + ret = GLEW_KHR_texture_compression_astc_sliced_3d; + continue; + } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"KTX_", 4)) @@ -9335,6 +24518,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_MESA_shader_integer_functions + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_integer_functions", 24)) + { + ret = GLEW_MESA_shader_integer_functions; + continue; + } +#endif #ifdef GL_MESA_window_pos if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_pos", 10)) { @@ -9348,10 +24538,111 @@ GLboolean glewIsSupported (const char* name) ret = GLEW_MESA_ycbcr_texture; continue; } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NVX_", 4)) + { +#ifdef GL_NVX_blend_equation_advanced_multi_draw_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_advanced_multi_draw_buffers", 42)) + { + ret = GLEW_NVX_blend_equation_advanced_multi_draw_buffers; + continue; + } +#endif +#ifdef GL_NVX_conditional_render + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conditional_render", 18)) + { + ret = GLEW_NVX_conditional_render; + continue; + } +#endif +#ifdef GL_NVX_gpu_memory_info + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_memory_info", 15)) + { + ret = GLEW_NVX_gpu_memory_info; + continue; + } +#endif +#ifdef GL_NVX_linked_gpu_multicast + if (_glewStrSame3(&pos, &len, (const GLubyte*)"linked_gpu_multicast", 20)) + { + ret = GLEW_NVX_linked_gpu_multicast; + continue; + } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) { +#ifdef GL_NV_3dvision_settings + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3dvision_settings", 17)) + { + ret = GLEW_NV_3dvision_settings; + continue; + } +#endif +#ifdef GL_NV_EGL_stream_consumer_external + if (_glewStrSame3(&pos, &len, (const GLubyte*)"EGL_stream_consumer_external", 28)) + { + ret = GLEW_NV_EGL_stream_consumer_external; + continue; + } +#endif +#ifdef GL_NV_alpha_to_coverage_dither_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"alpha_to_coverage_dither_control", 32)) + { + ret = GLEW_NV_alpha_to_coverage_dither_control; + continue; + } +#endif +#ifdef GL_NV_bgr + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bgr", 3)) + { + ret = GLEW_NV_bgr; + continue; + } +#endif +#ifdef GL_NV_bindless_multi_draw_indirect + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindless_multi_draw_indirect", 28)) + { + ret = GLEW_NV_bindless_multi_draw_indirect; + continue; + } +#endif +#ifdef GL_NV_bindless_multi_draw_indirect_count + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindless_multi_draw_indirect_count", 34)) + { + ret = GLEW_NV_bindless_multi_draw_indirect_count; + continue; + } +#endif +#ifdef GL_NV_bindless_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindless_texture", 16)) + { + ret = GLEW_NV_bindless_texture; + continue; + } +#endif +#ifdef GL_NV_blend_equation_advanced + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_advanced", 23)) + { + ret = GLEW_NV_blend_equation_advanced; + continue; + } +#endif +#ifdef GL_NV_blend_equation_advanced_coherent + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_advanced_coherent", 32)) + { + ret = GLEW_NV_blend_equation_advanced_coherent; + continue; + } +#endif +#ifdef GL_NV_blend_minmax_factor + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_minmax_factor", 19)) + { + ret = GLEW_NV_blend_minmax_factor; + continue; + } +#endif #ifdef GL_NV_blend_square if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_square", 12)) { @@ -9359,6 +24650,62 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_clip_space_w_scaling + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clip_space_w_scaling", 20)) + { + ret = GLEW_NV_clip_space_w_scaling; + continue; + } +#endif +#ifdef GL_NV_command_list + if (_glewStrSame3(&pos, &len, (const GLubyte*)"command_list", 12)) + { + ret = GLEW_NV_command_list; + continue; + } +#endif +#ifdef GL_NV_compute_program5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compute_program5", 16)) + { + ret = GLEW_NV_compute_program5; + continue; + } +#endif +#ifdef GL_NV_conditional_render + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conditional_render", 18)) + { + ret = GLEW_NV_conditional_render; + continue; + } +#endif +#ifdef GL_NV_conservative_raster + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_raster", 19)) + { + ret = GLEW_NV_conservative_raster; + continue; + } +#endif +#ifdef GL_NV_conservative_raster_dilate + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_raster_dilate", 26)) + { + ret = GLEW_NV_conservative_raster_dilate; + continue; + } +#endif +#ifdef GL_NV_conservative_raster_pre_snap_triangles + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_raster_pre_snap_triangles", 38)) + { + ret = GLEW_NV_conservative_raster_pre_snap_triangles; + continue; + } +#endif +#ifdef GL_NV_copy_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_buffer", 11)) + { + ret = GLEW_NV_copy_buffer; + continue; + } +#endif #ifdef GL_NV_copy_depth_to_color if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_depth_to_color", 19)) { @@ -9366,6 +24713,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_copy_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) + { + ret = GLEW_NV_copy_image; + continue; + } +#endif +#ifdef GL_NV_deep_texture3D + if (_glewStrSame3(&pos, &len, (const GLubyte*)"deep_texture3D", 14)) + { + ret = GLEW_NV_deep_texture3D; + continue; + } +#endif #ifdef GL_NV_depth_buffer_float if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_buffer_float", 18)) { @@ -9387,6 +24748,34 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_draw_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers", 12)) + { + ret = GLEW_NV_draw_buffers; + continue; + } +#endif +#ifdef GL_NV_draw_instanced + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_instanced", 14)) + { + ret = GLEW_NV_draw_instanced; + continue; + } +#endif +#ifdef GL_NV_draw_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_texture", 12)) + { + ret = GLEW_NV_draw_texture; + continue; + } +#endif +#ifdef GL_NV_draw_vulkan_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_vulkan_image", 17)) + { + ret = GLEW_NV_draw_vulkan_image; + continue; + } +#endif #ifdef GL_NV_evaluators if (_glewStrSame3(&pos, &len, (const GLubyte*)"evaluators", 10)) { @@ -9394,6 +24783,27 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_explicit_attrib_location + if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_attrib_location", 24)) + { + ret = GLEW_NV_explicit_attrib_location; + continue; + } +#endif +#ifdef GL_NV_explicit_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_multisample", 20)) + { + ret = GLEW_NV_explicit_multisample; + continue; + } +#endif +#ifdef GL_NV_fbo_color_attachments + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbo_color_attachments", 21)) + { + ret = GLEW_NV_fbo_color_attachments; + continue; + } +#endif #ifdef GL_NV_fence if (_glewStrSame3(&pos, &len, (const GLubyte*)"fence", 5)) { @@ -9401,6 +24811,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_fill_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fill_rectangle", 14)) + { + ret = GLEW_NV_fill_rectangle; + continue; + } +#endif #ifdef GL_NV_float_buffer if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) { @@ -9415,6 +24832,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_fragment_coverage_to_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_coverage_to_color", 26)) + { + ret = GLEW_NV_fragment_coverage_to_color; + continue; + } +#endif #ifdef GL_NV_fragment_program if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program", 16)) { @@ -9443,6 +24867,34 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_fragment_shader_interlock + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader_interlock", 25)) + { + ret = GLEW_NV_fragment_shader_interlock; + continue; + } +#endif +#ifdef GL_NV_framebuffer_blit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_blit", 16)) + { + ret = GLEW_NV_framebuffer_blit; + continue; + } +#endif +#ifdef GL_NV_framebuffer_mixed_samples + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_mixed_samples", 25)) + { + ret = GLEW_NV_framebuffer_mixed_samples; + continue; + } +#endif +#ifdef GL_NV_framebuffer_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample", 23)) + { + ret = GLEW_NV_framebuffer_multisample; + continue; + } +#endif #ifdef GL_NV_framebuffer_multisample_coverage if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample_coverage", 32)) { @@ -9450,6 +24902,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_generate_mipmap_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"generate_mipmap_sRGB", 20)) + { + ret = GLEW_NV_generate_mipmap_sRGB; + continue; + } +#endif #ifdef GL_NV_geometry_program4 if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_program4", 17)) { @@ -9464,6 +24923,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_geometry_shader_passthrough + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader_passthrough", 27)) + { + ret = GLEW_NV_geometry_shader_passthrough; + continue; + } +#endif +#ifdef GL_NV_gpu_multicast + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_multicast", 13)) + { + ret = GLEW_NV_gpu_multicast; + continue; + } +#endif #ifdef GL_NV_gpu_program4 if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program4", 12)) { @@ -9471,6 +24944,34 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_gpu_program5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program5", 12)) + { + ret = GLEW_NV_gpu_program5; + continue; + } +#endif +#ifdef GL_NV_gpu_program5_mem_extended + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program5_mem_extended", 25)) + { + ret = GLEW_NV_gpu_program5_mem_extended; + continue; + } +#endif +#ifdef GL_NV_gpu_program_fp64 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program_fp64", 16)) + { + ret = GLEW_NV_gpu_program_fp64; + continue; + } +#endif +#ifdef GL_NV_gpu_shader5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader5", 11)) + { + ret = GLEW_NV_gpu_shader5; + continue; + } +#endif #ifdef GL_NV_half_float if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float", 10)) { @@ -9478,6 +24979,27 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_image_formats + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_formats", 13)) + { + ret = GLEW_NV_image_formats; + continue; + } +#endif +#ifdef GL_NV_instanced_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"instanced_arrays", 16)) + { + ret = GLEW_NV_instanced_arrays; + continue; + } +#endif +#ifdef GL_NV_internalformat_sample_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"internalformat_sample_query", 27)) + { + ret = GLEW_NV_internalformat_sample_query; + continue; + } +#endif #ifdef GL_NV_light_max_exponent if (_glewStrSame3(&pos, &len, (const GLubyte*)"light_max_exponent", 18)) { @@ -9485,6 +25007,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_multisample_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) + { + ret = GLEW_NV_multisample_coverage; + continue; + } +#endif #ifdef GL_NV_multisample_filter_hint if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_filter_hint", 23)) { @@ -9492,6 +25021,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_non_square_matrices + if (_glewStrSame3(&pos, &len, (const GLubyte*)"non_square_matrices", 19)) + { + ret = GLEW_NV_non_square_matrices; + continue; + } +#endif #ifdef GL_NV_occlusion_query if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query", 15)) { @@ -9499,6 +25035,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_pack_subimage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pack_subimage", 13)) + { + ret = GLEW_NV_pack_subimage; + continue; + } +#endif #ifdef GL_NV_packed_depth_stencil if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_depth_stencil", 20)) { @@ -9506,6 +25049,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_packed_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_float", 12)) + { + ret = GLEW_NV_packed_float; + continue; + } +#endif +#ifdef GL_NV_packed_float_linear + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_float_linear", 19)) + { + ret = GLEW_NV_packed_float_linear; + continue; + } +#endif #ifdef GL_NV_parameter_buffer_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"parameter_buffer_object", 23)) { @@ -9513,6 +25070,34 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_parameter_buffer_object2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"parameter_buffer_object2", 24)) + { + ret = GLEW_NV_parameter_buffer_object2; + continue; + } +#endif +#ifdef GL_NV_path_rendering + if (_glewStrSame3(&pos, &len, (const GLubyte*)"path_rendering", 14)) + { + ret = GLEW_NV_path_rendering; + continue; + } +#endif +#ifdef GL_NV_path_rendering_shared_edge + if (_glewStrSame3(&pos, &len, (const GLubyte*)"path_rendering_shared_edge", 26)) + { + ret = GLEW_NV_path_rendering_shared_edge; + continue; + } +#endif +#ifdef GL_NV_pixel_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer_object", 19)) + { + ret = GLEW_NV_pixel_buffer_object; + continue; + } +#endif #ifdef GL_NV_pixel_data_range if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_data_range", 16)) { @@ -9520,6 +25105,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_platform_binary + if (_glewStrSame3(&pos, &len, (const GLubyte*)"platform_binary", 15)) + { + ret = GLEW_NV_platform_binary; + continue; + } +#endif #ifdef GL_NV_point_sprite if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprite", 12)) { @@ -9527,6 +25119,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_polygon_mode + if (_glewStrSame3(&pos, &len, (const GLubyte*)"polygon_mode", 12)) + { + ret = GLEW_NV_polygon_mode; + continue; + } +#endif +#ifdef GL_NV_present_video + if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) + { + ret = GLEW_NV_present_video; + continue; + } +#endif #ifdef GL_NV_primitive_restart if (_glewStrSame3(&pos, &len, (const GLubyte*)"primitive_restart", 17)) { @@ -9534,6 +25140,27 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_read_depth + if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_depth", 10)) + { + ret = GLEW_NV_read_depth; + continue; + } +#endif +#ifdef GL_NV_read_depth_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_depth_stencil", 18)) + { + ret = GLEW_NV_read_depth_stencil; + continue; + } +#endif +#ifdef GL_NV_read_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_stencil", 12)) + { + ret = GLEW_NV_read_stencil; + continue; + } +#endif #ifdef GL_NV_register_combiners if (_glewStrSame3(&pos, &len, (const GLubyte*)"register_combiners", 18)) { @@ -9548,6 +25175,132 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_robustness_video_memory_purge + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_video_memory_purge", 29)) + { + ret = GLEW_NV_robustness_video_memory_purge; + continue; + } +#endif +#ifdef GL_NV_sRGB_formats + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sRGB_formats", 12)) + { + ret = GLEW_NV_sRGB_formats; + continue; + } +#endif +#ifdef GL_NV_sample_locations + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_locations", 16)) + { + ret = GLEW_NV_sample_locations; + continue; + } +#endif +#ifdef GL_NV_sample_mask_override_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_mask_override_coverage", 29)) + { + ret = GLEW_NV_sample_mask_override_coverage; + continue; + } +#endif +#ifdef GL_NV_shader_atomic_counters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_counters", 22)) + { + ret = GLEW_NV_shader_atomic_counters; + continue; + } +#endif +#ifdef GL_NV_shader_atomic_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_float", 19)) + { + ret = GLEW_NV_shader_atomic_float; + continue; + } +#endif +#ifdef GL_NV_shader_atomic_float64 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_float64", 21)) + { + ret = GLEW_NV_shader_atomic_float64; + continue; + } +#endif +#ifdef GL_NV_shader_atomic_fp16_vector + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_fp16_vector", 25)) + { + ret = GLEW_NV_shader_atomic_fp16_vector; + continue; + } +#endif +#ifdef GL_NV_shader_atomic_int64 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_int64", 19)) + { + ret = GLEW_NV_shader_atomic_int64; + continue; + } +#endif +#ifdef GL_NV_shader_buffer_load + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_buffer_load", 18)) + { + ret = GLEW_NV_shader_buffer_load; + continue; + } +#endif +#ifdef GL_NV_shader_noperspective_interpolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_noperspective_interpolation", 34)) + { + ret = GLEW_NV_shader_noperspective_interpolation; + continue; + } +#endif +#ifdef GL_NV_shader_storage_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_storage_buffer_object", 28)) + { + ret = GLEW_NV_shader_storage_buffer_object; + continue; + } +#endif +#ifdef GL_NV_shader_thread_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_thread_group", 19)) + { + ret = GLEW_NV_shader_thread_group; + continue; + } +#endif +#ifdef GL_NV_shader_thread_shuffle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_thread_shuffle", 21)) + { + ret = GLEW_NV_shader_thread_shuffle; + continue; + } +#endif +#ifdef GL_NV_shadow_samplers_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_samplers_array", 21)) + { + ret = GLEW_NV_shadow_samplers_array; + continue; + } +#endif +#ifdef GL_NV_shadow_samplers_cube + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_samplers_cube", 20)) + { + ret = GLEW_NV_shadow_samplers_cube; + continue; + } +#endif +#ifdef GL_NV_stereo_view_rendering + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stereo_view_rendering", 21)) + { + ret = GLEW_NV_stereo_view_rendering; + continue; + } +#endif +#ifdef GL_NV_tessellation_program5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tessellation_program5", 21)) + { + ret = GLEW_NV_tessellation_program5; + continue; + } +#endif #ifdef GL_NV_texgen_emboss if (_glewStrSame3(&pos, &len, (const GLubyte*)"texgen_emboss", 13)) { @@ -9562,6 +25315,48 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_texture_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_array", 13)) + { + ret = GLEW_NV_texture_array; + continue; + } +#endif +#ifdef GL_NV_texture_barrier + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_barrier", 15)) + { + ret = GLEW_NV_texture_barrier; + continue; + } +#endif +#ifdef GL_NV_texture_border_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_border_clamp", 20)) + { + ret = GLEW_NV_texture_border_clamp; + continue; + } +#endif +#ifdef GL_NV_texture_compression_latc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_latc", 24)) + { + ret = GLEW_NV_texture_compression_latc; + continue; + } +#endif +#ifdef GL_NV_texture_compression_s3tc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_s3tc", 24)) + { + ret = GLEW_NV_texture_compression_s3tc; + continue; + } +#endif +#ifdef GL_NV_texture_compression_s3tc_update + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_s3tc_update", 31)) + { + ret = GLEW_NV_texture_compression_s3tc_update; + continue; + } +#endif #ifdef GL_NV_texture_compression_vtc if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_vtc", 23)) { @@ -9583,6 +25378,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_texture_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multisample", 19)) + { + ret = GLEW_NV_texture_multisample; + continue; + } +#endif +#ifdef GL_NV_texture_npot_2D_mipmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_npot_2D_mipmap", 22)) + { + ret = GLEW_NV_texture_npot_2D_mipmap; + continue; + } +#endif #ifdef GL_NV_texture_rectangle if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) { @@ -9590,6 +25399,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_texture_rectangle_compressed + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle_compressed", 28)) + { + ret = GLEW_NV_texture_rectangle_compressed; + continue; + } +#endif #ifdef GL_NV_texture_shader if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader", 14)) { @@ -9618,6 +25434,27 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_transform_feedback2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback2", 19)) + { + ret = GLEW_NV_transform_feedback2; + continue; + } +#endif +#ifdef GL_NV_uniform_buffer_unified_memory + if (_glewStrSame3(&pos, &len, (const GLubyte*)"uniform_buffer_unified_memory", 29)) + { + ret = GLEW_NV_uniform_buffer_unified_memory; + continue; + } +#endif +#ifdef GL_NV_vdpau_interop + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vdpau_interop", 13)) + { + ret = GLEW_NV_vdpau_interop; + continue; + } +#endif #ifdef GL_NV_vertex_array_range if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) { @@ -9632,6 +25469,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_vertex_attrib_integer_64bit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_integer_64bit", 27)) + { + ret = GLEW_NV_vertex_attrib_integer_64bit; + continue; + } +#endif +#ifdef GL_NV_vertex_buffer_unified_memory + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_unified_memory", 28)) + { + ret = GLEW_NV_vertex_buffer_unified_memory; + continue; + } +#endif #ifdef GL_NV_vertex_program if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program", 14)) { @@ -9673,6 +25524,34 @@ GLboolean glewIsSupported (const char* name) ret = GLEW_NV_vertex_program4; continue; } +#endif +#ifdef GL_NV_video_capture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13)) + { + ret = GLEW_NV_video_capture; + continue; + } +#endif +#ifdef GL_NV_viewport_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"viewport_array", 14)) + { + ret = GLEW_NV_viewport_array; + continue; + } +#endif +#ifdef GL_NV_viewport_array2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"viewport_array2", 15)) + { + ret = GLEW_NV_viewport_array2; + continue; + } +#endif +#ifdef GL_NV_viewport_swizzle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"viewport_swizzle", 16)) + { + ret = GLEW_NV_viewport_swizzle; + continue; + } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"OES_", 4)) @@ -9683,27 +25562,6 @@ GLboolean glewIsSupported (const char* name) ret = GLEW_OES_byte_coordinates; continue; } -#endif -#ifdef GL_OES_compressed_paletted_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_paletted_texture", 27)) - { - ret = GLEW_OES_compressed_paletted_texture; - continue; - } -#endif -#ifdef GL_OES_read_format - if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_format", 11)) - { - ret = GLEW_OES_read_format; - continue; - } -#endif -#ifdef GL_OES_single_precision - if (_glewStrSame3(&pos, &len, (const GLubyte*)"single_precision", 16)) - { - ret = GLEW_OES_single_precision; - continue; - } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) @@ -9728,6 +25586,30 @@ GLboolean glewIsSupported (const char* name) ret = GLEW_OML_subsample; continue; } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"OVR_", 4)) + { +#ifdef GL_OVR_multiview + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multiview", 9)) + { + ret = GLEW_OVR_multiview; + continue; + } +#endif +#ifdef GL_OVR_multiview2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multiview2", 10)) + { + ret = GLEW_OVR_multiview2; + continue; + } +#endif +#ifdef GL_OVR_multiview_multisampled_render_to_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multiview_multisampled_render_to_texture", 40)) + { + ret = GLEW_OVR_multiview_multisampled_render_to_texture; + continue; + } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"PGI_", 4)) @@ -9745,6 +25627,131 @@ GLboolean glewIsSupported (const char* name) ret = GLEW_PGI_vertex_hints; continue; } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"QCOM_", 5)) + { +#ifdef GL_QCOM_alpha_test + if (_glewStrSame3(&pos, &len, (const GLubyte*)"alpha_test", 10)) + { + ret = GLEW_QCOM_alpha_test; + continue; + } +#endif +#ifdef GL_QCOM_binning_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"binning_control", 15)) + { + ret = GLEW_QCOM_binning_control; + continue; + } +#endif +#ifdef GL_QCOM_driver_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"driver_control", 14)) + { + ret = GLEW_QCOM_driver_control; + continue; + } +#endif +#ifdef GL_QCOM_extended_get + if (_glewStrSame3(&pos, &len, (const GLubyte*)"extended_get", 12)) + { + ret = GLEW_QCOM_extended_get; + continue; + } +#endif +#ifdef GL_QCOM_extended_get2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"extended_get2", 13)) + { + ret = GLEW_QCOM_extended_get2; + continue; + } +#endif +#ifdef GL_QCOM_framebuffer_foveated + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_foveated", 20)) + { + ret = GLEW_QCOM_framebuffer_foveated; + continue; + } +#endif +#ifdef GL_QCOM_perfmon_global_mode + if (_glewStrSame3(&pos, &len, (const GLubyte*)"perfmon_global_mode", 19)) + { + ret = GLEW_QCOM_perfmon_global_mode; + continue; + } +#endif +#ifdef GL_QCOM_shader_framebuffer_fetch_noncoherent + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_framebuffer_fetch_noncoherent", 36)) + { + ret = GLEW_QCOM_shader_framebuffer_fetch_noncoherent; + continue; + } +#endif +#ifdef GL_QCOM_tiled_rendering + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tiled_rendering", 15)) + { + ret = GLEW_QCOM_tiled_rendering; + continue; + } +#endif +#ifdef GL_QCOM_writeonly_rendering + if (_glewStrSame3(&pos, &len, (const GLubyte*)"writeonly_rendering", 19)) + { + ret = GLEW_QCOM_writeonly_rendering; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"REGAL_", 6)) + { +#ifdef GL_REGAL_ES1_0_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES1_0_compatibility", 19)) + { + ret = GLEW_REGAL_ES1_0_compatibility; + continue; + } +#endif +#ifdef GL_REGAL_ES1_1_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES1_1_compatibility", 19)) + { + ret = GLEW_REGAL_ES1_1_compatibility; + continue; + } +#endif +#ifdef GL_REGAL_enable + if (_glewStrSame3(&pos, &len, (const GLubyte*)"enable", 6)) + { + ret = GLEW_REGAL_enable; + continue; + } +#endif +#ifdef GL_REGAL_error_string + if (_glewStrSame3(&pos, &len, (const GLubyte*)"error_string", 12)) + { + ret = GLEW_REGAL_error_string; + continue; + } +#endif +#ifdef GL_REGAL_extension_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"extension_query", 15)) + { + ret = GLEW_REGAL_extension_query; + continue; + } +#endif +#ifdef GL_REGAL_log + if (_glewStrSame3(&pos, &len, (const GLubyte*)"log", 3)) + { + ret = GLEW_REGAL_log; + continue; + } +#endif +#ifdef GL_REGAL_proc_address + if (_glewStrSame3(&pos, &len, (const GLubyte*)"proc_address", 12)) + { + ret = GLEW_REGAL_proc_address; + continue; + } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"REND_", 5)) @@ -9769,6 +25776,13 @@ GLboolean glewIsSupported (const char* name) } if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIS_", 5)) { +#ifdef GL_SGIS_clip_band_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clip_band_hint", 14)) + { + ret = GLEW_SGIS_clip_band_hint; + continue; + } +#endif #ifdef GL_SGIS_color_range if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_range", 11)) { @@ -9797,6 +25811,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_SGIS_line_texgen + if (_glewStrSame3(&pos, &len, (const GLubyte*)"line_texgen", 11)) + { + ret = GLEW_SGIS_line_texgen; + continue; + } +#endif #ifdef GL_SGIS_multisample if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) { @@ -9804,6 +25825,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_SGIS_multitexture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multitexture", 12)) + { + ret = GLEW_SGIS_multitexture; + continue; + } +#endif #ifdef GL_SGIS_pixel_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture", 13)) { @@ -9811,6 +25839,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_SGIS_point_line_texgen + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_line_texgen", 17)) + { + ret = GLEW_SGIS_point_line_texgen; + continue; + } +#endif +#ifdef GL_SGIS_shared_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shared_multisample", 18)) + { + ret = GLEW_SGIS_shared_multisample; + continue; + } +#endif #ifdef GL_SGIS_sharpen_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"sharpen_texture", 15)) { @@ -9884,6 +25926,27 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_SGIX_bali_g_instruments + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bali_g_instruments", 18)) + { + ret = GLEW_SGIX_bali_g_instruments; + continue; + } +#endif +#ifdef GL_SGIX_bali_r_instruments + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bali_r_instruments", 18)) + { + ret = GLEW_SGIX_bali_r_instruments; + continue; + } +#endif +#ifdef GL_SGIX_bali_timer_instruments + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bali_timer_instruments", 22)) + { + ret = GLEW_SGIX_bali_timer_instruments; + continue; + } +#endif #ifdef GL_SGIX_blend_alpha_minmax if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_alpha_minmax", 18)) { @@ -9891,6 +25954,27 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_SGIX_blend_cadd + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_cadd", 10)) + { + ret = GLEW_SGIX_blend_cadd; + continue; + } +#endif +#ifdef GL_SGIX_blend_cmultiply + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_cmultiply", 15)) + { + ret = GLEW_SGIX_blend_cmultiply; + continue; + } +#endif +#ifdef GL_SGIX_calligraphic_fragment + if (_glewStrSame3(&pos, &len, (const GLubyte*)"calligraphic_fragment", 21)) + { + ret = GLEW_SGIX_calligraphic_fragment; + continue; + } +#endif #ifdef GL_SGIX_clipmap if (_glewStrSame3(&pos, &len, (const GLubyte*)"clipmap", 7)) { @@ -9898,6 +25982,69 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_SGIX_color_matrix_accuracy + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_matrix_accuracy", 21)) + { + ret = GLEW_SGIX_color_matrix_accuracy; + continue; + } +#endif +#ifdef GL_SGIX_color_table_index_mode + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_table_index_mode", 22)) + { + ret = GLEW_SGIX_color_table_index_mode; + continue; + } +#endif +#ifdef GL_SGIX_complex_polar + if (_glewStrSame3(&pos, &len, (const GLubyte*)"complex_polar", 13)) + { + ret = GLEW_SGIX_complex_polar; + continue; + } +#endif +#ifdef GL_SGIX_convolution_accuracy + if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_accuracy", 20)) + { + ret = GLEW_SGIX_convolution_accuracy; + continue; + } +#endif +#ifdef GL_SGIX_cube_map + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cube_map", 8)) + { + ret = GLEW_SGIX_cube_map; + continue; + } +#endif +#ifdef GL_SGIX_cylinder_texgen + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cylinder_texgen", 15)) + { + ret = GLEW_SGIX_cylinder_texgen; + continue; + } +#endif +#ifdef GL_SGIX_datapipe + if (_glewStrSame3(&pos, &len, (const GLubyte*)"datapipe", 8)) + { + ret = GLEW_SGIX_datapipe; + continue; + } +#endif +#ifdef GL_SGIX_decimation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"decimation", 10)) + { + ret = GLEW_SGIX_decimation; + continue; + } +#endif +#ifdef GL_SGIX_depth_pass_instrument + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_pass_instrument", 21)) + { + ret = GLEW_SGIX_depth_pass_instrument; + continue; + } +#endif #ifdef GL_SGIX_depth_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13)) { @@ -9905,6 +26052,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_SGIX_dvc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"dvc", 3)) + { + ret = GLEW_SGIX_dvc; + continue; + } +#endif #ifdef GL_SGIX_flush_raster if (_glewStrSame3(&pos, &len, (const GLubyte*)"flush_raster", 12)) { @@ -9912,6 +26066,27 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_SGIX_fog_blend + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_blend", 9)) + { + ret = GLEW_SGIX_fog_blend; + continue; + } +#endif +#ifdef GL_SGIX_fog_factor_to_alpha + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_factor_to_alpha", 19)) + { + ret = GLEW_SGIX_fog_factor_to_alpha; + continue; + } +#endif +#ifdef GL_SGIX_fog_layers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_layers", 10)) + { + ret = GLEW_SGIX_fog_layers; + continue; + } +#endif #ifdef GL_SGIX_fog_offset if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_offset", 10)) { @@ -9919,6 +26094,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_SGIX_fog_patchy + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_patchy", 10)) + { + ret = GLEW_SGIX_fog_patchy; + continue; + } +#endif +#ifdef GL_SGIX_fog_scale + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_scale", 9)) + { + ret = GLEW_SGIX_fog_scale; + continue; + } +#endif #ifdef GL_SGIX_fog_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_texture", 11)) { @@ -9926,6 +26115,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_SGIX_fragment_lighting_space + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_lighting_space", 23)) + { + ret = GLEW_SGIX_fragment_lighting_space; + continue; + } +#endif #ifdef GL_SGIX_fragment_specular_lighting if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_specular_lighting", 26)) { @@ -9933,6 +26129,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_SGIX_fragments_instrument + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragments_instrument", 20)) + { + ret = GLEW_SGIX_fragments_instrument; + continue; + } +#endif #ifdef GL_SGIX_framezoom if (_glewStrSame3(&pos, &len, (const GLubyte*)"framezoom", 9)) { @@ -9940,6 +26143,41 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_SGIX_icc_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"icc_texture", 11)) + { + ret = GLEW_SGIX_icc_texture; + continue; + } +#endif +#ifdef GL_SGIX_igloo_interface + if (_glewStrSame3(&pos, &len, (const GLubyte*)"igloo_interface", 15)) + { + ret = GLEW_SGIX_igloo_interface; + continue; + } +#endif +#ifdef GL_SGIX_image_compression + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_compression", 17)) + { + ret = GLEW_SGIX_image_compression; + continue; + } +#endif +#ifdef GL_SGIX_impact_pixel_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"impact_pixel_texture", 20)) + { + ret = GLEW_SGIX_impact_pixel_texture; + continue; + } +#endif +#ifdef GL_SGIX_instrument_error + if (_glewStrSame3(&pos, &len, (const GLubyte*)"instrument_error", 16)) + { + ret = GLEW_SGIX_instrument_error; + continue; + } +#endif #ifdef GL_SGIX_interlace if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace", 9)) { @@ -9954,6 +26192,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_SGIX_line_quality_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"line_quality_hint", 17)) + { + ret = GLEW_SGIX_line_quality_hint; + continue; + } +#endif #ifdef GL_SGIX_list_priority if (_glewStrSame3(&pos, &len, (const GLubyte*)"list_priority", 13)) { @@ -9961,6 +26206,48 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_SGIX_mpeg1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"mpeg1", 5)) + { + ret = GLEW_SGIX_mpeg1; + continue; + } +#endif +#ifdef GL_SGIX_mpeg2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"mpeg2", 5)) + { + ret = GLEW_SGIX_mpeg2; + continue; + } +#endif +#ifdef GL_SGIX_nonlinear_lighting_pervertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"nonlinear_lighting_pervertex", 28)) + { + ret = GLEW_SGIX_nonlinear_lighting_pervertex; + continue; + } +#endif +#ifdef GL_SGIX_nurbs_eval + if (_glewStrSame3(&pos, &len, (const GLubyte*)"nurbs_eval", 10)) + { + ret = GLEW_SGIX_nurbs_eval; + continue; + } +#endif +#ifdef GL_SGIX_occlusion_instrument + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_instrument", 20)) + { + ret = GLEW_SGIX_occlusion_instrument; + continue; + } +#endif +#ifdef GL_SGIX_packed_6bytes + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_6bytes", 13)) + { + ret = GLEW_SGIX_packed_6bytes; + continue; + } +#endif #ifdef GL_SGIX_pixel_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture", 13)) { @@ -9975,6 +26262,34 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_SGIX_pixel_texture_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture_lod", 17)) + { + ret = GLEW_SGIX_pixel_texture_lod; + continue; + } +#endif +#ifdef GL_SGIX_pixel_tiles + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_tiles", 11)) + { + ret = GLEW_SGIX_pixel_tiles; + continue; + } +#endif +#ifdef GL_SGIX_polynomial_ffd + if (_glewStrSame3(&pos, &len, (const GLubyte*)"polynomial_ffd", 14)) + { + ret = GLEW_SGIX_polynomial_ffd; + continue; + } +#endif +#ifdef GL_SGIX_quad_mesh + if (_glewStrSame3(&pos, &len, (const GLubyte*)"quad_mesh", 9)) + { + ret = GLEW_SGIX_quad_mesh; + continue; + } +#endif #ifdef GL_SGIX_reference_plane if (_glewStrSame3(&pos, &len, (const GLubyte*)"reference_plane", 15)) { @@ -9989,6 +26304,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_SGIX_scalebias_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"scalebias_hint", 14)) + { + ret = GLEW_SGIX_scalebias_hint; + continue; + } +#endif #ifdef GL_SGIX_shadow if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow", 6)) { @@ -10003,6 +26325,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_SGIX_slim + if (_glewStrSame3(&pos, &len, (const GLubyte*)"slim", 4)) + { + ret = GLEW_SGIX_slim; + continue; + } +#endif +#ifdef GL_SGIX_spotlight_cutoff + if (_glewStrSame3(&pos, &len, (const GLubyte*)"spotlight_cutoff", 16)) + { + ret = GLEW_SGIX_spotlight_cutoff; + continue; + } +#endif #ifdef GL_SGIX_sprite if (_glewStrSame3(&pos, &len, (const GLubyte*)"sprite", 6)) { @@ -10010,6 +26346,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_SGIX_subdiv_patch + if (_glewStrSame3(&pos, &len, (const GLubyte*)"subdiv_patch", 12)) + { + ret = GLEW_SGIX_subdiv_patch; + continue; + } +#endif +#ifdef GL_SGIX_subsample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"subsample", 9)) + { + ret = GLEW_SGIX_subsample; + continue; + } +#endif #ifdef GL_SGIX_tag_sample_buffer if (_glewStrSame3(&pos, &len, (const GLubyte*)"tag_sample_buffer", 17)) { @@ -10038,6 +26388,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_SGIX_texture_mipmap_anisotropic + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mipmap_anisotropic", 26)) + { + ret = GLEW_SGIX_texture_mipmap_anisotropic; + continue; + } +#endif #ifdef GL_SGIX_texture_multi_buffer if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multi_buffer", 20)) { @@ -10045,6 +26402,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_SGIX_texture_phase + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_phase", 13)) + { + ret = GLEW_SGIX_texture_phase; + continue; + } +#endif #ifdef GL_SGIX_texture_range if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_range", 13)) { @@ -10059,6 +26423,27 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_SGIX_texture_supersample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_supersample", 19)) + { + ret = GLEW_SGIX_texture_supersample; + continue; + } +#endif +#ifdef GL_SGIX_vector_ops + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vector_ops", 10)) + { + ret = GLEW_SGIX_vector_ops; + continue; + } +#endif +#ifdef GL_SGIX_vertex_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) + { + ret = GLEW_SGIX_vertex_array_object; + continue; + } +#endif #ifdef GL_SGIX_vertex_preclip if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_preclip", 14)) { @@ -10079,6 +26464,20 @@ GLboolean glewIsSupported (const char* name) ret = GLEW_SGIX_ycrcb; continue; } +#endif +#ifdef GL_SGIX_ycrcb_subsample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycrcb_subsample", 15)) + { + ret = GLEW_SGIX_ycrcb_subsample; + continue; + } +#endif +#ifdef GL_SGIX_ycrcba + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycrcba", 6)) + { + ret = GLEW_SGIX_ycrcba; + continue; + } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGI_", 4)) @@ -10097,6 +26496,27 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_SGI_complex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"complex", 7)) + { + ret = GLEW_SGI_complex; + continue; + } +#endif +#ifdef GL_SGI_complex_type + if (_glewStrSame3(&pos, &len, (const GLubyte*)"complex_type", 12)) + { + ret = GLEW_SGI_complex_type; + continue; + } +#endif +#ifdef GL_SGI_fft + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fft", 3)) + { + ret = GLEW_SGI_fft; + continue; + } +#endif #ifdef GL_SGI_texture_color_table if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_color_table", 19)) { @@ -10176,6 +26596,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_WIN_scene_markerXXX + if (_glewStrSame3(&pos, &len, (const GLubyte*)"scene_markerXXX", 15)) + { + ret = GLEW_WIN_scene_markerXXX; + continue; + } +#endif #ifdef GL_WIN_specular_fog if (_glewStrSame3(&pos, &len, (const GLubyte*)"specular_fog", 12)) { @@ -10197,15 +26624,11 @@ GLboolean glewIsSupported (const char* name) return ret; } -#if defined(_WIN32) +#if defined(_WIN32) && !defined(GLEW_EGL) && !defined(GLEW_OSMESA) -#if defined(GLEW_MX) -GLboolean wglewContextIsSupported (WGLEWContext* ctx, const char* name) -#else -GLboolean wglewIsSupported (const char* name) -#endif +GLboolean GLEWAPIENTRY wglewIsSupported (const char* name) { - GLubyte* pos = (GLubyte*)name; + const GLubyte* pos = (const GLubyte*)name; GLuint len = _glewStrLen(pos); GLboolean ret = GL_TRUE; while (ret && len > 0) @@ -10230,6 +26653,16 @@ GLboolean wglewIsSupported (const char* name) ret = WGLEW_3DL_stereo_control; continue; } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) + { +#ifdef WGL_AMD_gpu_association + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_association", 15)) + { + ret = WGLEW_AMD_gpu_association; + continue; + } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) @@ -10241,6 +26674,41 @@ GLboolean wglewIsSupported (const char* name) continue; } #endif +#ifdef WGL_ARB_context_flush_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"context_flush_control", 21)) + { + ret = WGLEW_ARB_context_flush_control; + continue; + } +#endif +#ifdef WGL_ARB_create_context + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context", 14)) + { + ret = WGLEW_ARB_create_context; + continue; + } +#endif +#ifdef WGL_ARB_create_context_no_error + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_no_error", 23)) + { + ret = WGLEW_ARB_create_context_no_error; + continue; + } +#endif +#ifdef WGL_ARB_create_context_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_profile", 22)) + { + ret = WGLEW_ARB_create_context_profile; + continue; + } +#endif +#ifdef WGL_ARB_create_context_robustness + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_robustness", 25)) + { + ret = WGLEW_ARB_create_context_robustness; + continue; + } +#endif #ifdef WGL_ARB_extensions_string if (_glewStrSame3(&pos, &len, (const GLubyte*)"extensions_string", 17)) { @@ -10248,6 +26716,13 @@ GLboolean wglewIsSupported (const char* name) continue; } #endif +#ifdef WGL_ARB_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = WGLEW_ARB_framebuffer_sRGB; + continue; + } +#endif #ifdef WGL_ARB_make_current_read if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) { @@ -10289,6 +26764,20 @@ GLboolean wglewIsSupported (const char* name) ret = WGLEW_ARB_render_texture; continue; } +#endif +#ifdef WGL_ARB_robustness_application_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_application_isolation", 32)) + { + ret = WGLEW_ARB_robustness_application_isolation; + continue; + } +#endif +#ifdef WGL_ARB_robustness_share_group_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_share_group_isolation", 32)) + { + ret = WGLEW_ARB_robustness_share_group_isolation; + continue; + } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) @@ -10310,6 +26799,27 @@ GLboolean wglewIsSupported (const char* name) } if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) { +#ifdef WGL_EXT_colorspace + if (_glewStrSame3(&pos, &len, (const GLubyte*)"colorspace", 10)) + { + ret = WGLEW_EXT_colorspace; + continue; + } +#endif +#ifdef WGL_EXT_create_context_es2_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es2_profile", 26)) + { + ret = WGLEW_EXT_create_context_es2_profile; + continue; + } +#endif +#ifdef WGL_EXT_create_context_es_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es_profile", 25)) + { + ret = WGLEW_EXT_create_context_es_profile; + continue; + } +#endif #ifdef WGL_EXT_depth_float if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_float", 11)) { @@ -10379,6 +26889,13 @@ GLboolean wglewIsSupported (const char* name) ret = WGLEW_EXT_swap_control; continue; } +#endif +#ifdef WGL_EXT_swap_control_tear + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control_tear", 17)) + { + ret = WGLEW_EXT_swap_control_tear; + continue; + } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"I3D_", 4)) @@ -10428,6 +26945,34 @@ GLboolean wglewIsSupported (const char* name) } if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) { +#ifdef WGL_NV_DX_interop + if (_glewStrSame3(&pos, &len, (const GLubyte*)"DX_interop", 10)) + { + ret = WGLEW_NV_DX_interop; + continue; + } +#endif +#ifdef WGL_NV_DX_interop2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"DX_interop2", 11)) + { + ret = WGLEW_NV_DX_interop2; + continue; + } +#endif +#ifdef WGL_NV_copy_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) + { + ret = WGLEW_NV_copy_image; + continue; + } +#endif +#ifdef WGL_NV_delay_before_swap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"delay_before_swap", 17)) + { + ret = WGLEW_NV_delay_before_swap; + continue; + } +#endif #ifdef WGL_NV_float_buffer if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) { @@ -10442,6 +26987,20 @@ GLboolean wglewIsSupported (const char* name) continue; } #endif +#ifdef WGL_NV_multisample_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) + { + ret = WGLEW_NV_multisample_coverage; + continue; + } +#endif +#ifdef WGL_NV_present_video + if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) + { + ret = WGLEW_NV_present_video; + continue; + } +#endif #ifdef WGL_NV_render_depth_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_depth_texture", 20)) { @@ -10456,12 +27015,33 @@ GLboolean wglewIsSupported (const char* name) continue; } #endif +#ifdef WGL_NV_swap_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) + { + ret = WGLEW_NV_swap_group; + continue; + } +#endif #ifdef WGL_NV_vertex_array_range if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) { ret = WGLEW_NV_vertex_array_range; continue; } +#endif +#ifdef WGL_NV_video_capture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13)) + { + ret = WGLEW_NV_video_capture; + continue; + } +#endif +#ifdef WGL_NV_video_output + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_output", 12)) + { + ret = WGLEW_NV_video_output; + continue; + } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) @@ -10480,15 +27060,11 @@ GLboolean wglewIsSupported (const char* name) return ret; } -#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) +#elif !defined(GLEW_OSMESA) && !defined(GLEW_EGL) && !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX) -#if defined(GLEW_MX) -GLboolean glxewContextIsSupported (GLXEWContext* ctx, const char* name) -#else GLboolean glxewIsSupported (const char* name) -#endif { - GLubyte* pos = (GLubyte*)name; + const GLubyte* pos = (const GLubyte*)name; GLuint len = _glewStrLen(pos); GLboolean ret = GL_TRUE; while (ret && len > 0) @@ -10527,10 +27103,55 @@ GLboolean glxewIsSupported (const char* name) ret = GLXEW_3DFX_multisample; continue; } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) + { +#ifdef GLX_AMD_gpu_association + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_association", 15)) + { + ret = GLXEW_AMD_gpu_association; + continue; + } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) { +#ifdef GLX_ARB_context_flush_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"context_flush_control", 21)) + { + ret = GLXEW_ARB_context_flush_control; + continue; + } +#endif +#ifdef GLX_ARB_create_context + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context", 14)) + { + ret = GLXEW_ARB_create_context; + continue; + } +#endif +#ifdef GLX_ARB_create_context_no_error + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_no_error", 23)) + { + ret = GLXEW_ARB_create_context_no_error; + continue; + } +#endif +#ifdef GLX_ARB_create_context_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_profile", 22)) + { + ret = GLXEW_ARB_create_context_profile; + continue; + } +#endif +#ifdef GLX_ARB_create_context_robustness + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_robustness", 25)) + { + ret = GLXEW_ARB_create_context_robustness; + continue; + } +#endif #ifdef GLX_ARB_fbconfig_float if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig_float", 14)) { @@ -10538,6 +27159,13 @@ GLboolean glxewIsSupported (const char* name) continue; } #endif +#ifdef GLX_ARB_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = GLXEW_ARB_framebuffer_sRGB; + continue; + } +#endif #ifdef GLX_ARB_get_proc_address if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_proc_address", 16)) { @@ -10551,6 +27179,27 @@ GLboolean glxewIsSupported (const char* name) ret = GLXEW_ARB_multisample; continue; } +#endif +#ifdef GLX_ARB_robustness_application_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_application_isolation", 32)) + { + ret = GLXEW_ARB_robustness_application_isolation; + continue; + } +#endif +#ifdef GLX_ARB_robustness_share_group_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_share_group_isolation", 32)) + { + ret = GLXEW_ARB_robustness_share_group_isolation; + continue; + } +#endif +#ifdef GLX_ARB_vertex_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_object", 20)) + { + ret = GLXEW_ARB_vertex_buffer_object; + continue; + } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) @@ -10572,6 +27221,27 @@ GLboolean glxewIsSupported (const char* name) } if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) { +#ifdef GLX_EXT_buffer_age + if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_age", 10)) + { + ret = GLXEW_EXT_buffer_age; + continue; + } +#endif +#ifdef GLX_EXT_create_context_es2_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es2_profile", 26)) + { + ret = GLXEW_EXT_create_context_es2_profile; + continue; + } +#endif +#ifdef GLX_EXT_create_context_es_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es_profile", 25)) + { + ret = GLXEW_EXT_create_context_es_profile; + continue; + } +#endif #ifdef GLX_EXT_fbconfig_packed_float if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig_packed_float", 21)) { @@ -10593,6 +27263,13 @@ GLboolean glxewIsSupported (const char* name) continue; } #endif +#ifdef GLX_EXT_libglvnd + if (_glewStrSame3(&pos, &len, (const GLubyte*)"libglvnd", 8)) + { + ret = GLXEW_EXT_libglvnd; + continue; + } +#endif #ifdef GLX_EXT_scene_marker if (_glewStrSame3(&pos, &len, (const GLubyte*)"scene_marker", 12)) { @@ -10600,6 +27277,27 @@ GLboolean glxewIsSupported (const char* name) continue; } #endif +#ifdef GLX_EXT_stereo_tree + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stereo_tree", 11)) + { + ret = GLXEW_EXT_stereo_tree; + continue; + } +#endif +#ifdef GLX_EXT_swap_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) + { + ret = GLXEW_EXT_swap_control; + continue; + } +#endif +#ifdef GLX_EXT_swap_control_tear + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control_tear", 17)) + { + ret = GLXEW_EXT_swap_control_tear; + continue; + } +#endif #ifdef GLX_EXT_texture_from_pixmap if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_from_pixmap", 19)) { @@ -10620,6 +27318,16 @@ GLboolean glxewIsSupported (const char* name) ret = GLXEW_EXT_visual_rating; continue; } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"INTEL_", 6)) + { +#ifdef GLX_INTEL_swap_event + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_event", 10)) + { + ret = GLXEW_INTEL_swap_event; + continue; + } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESA_", 5)) @@ -10645,6 +27353,13 @@ GLboolean glxewIsSupported (const char* name) continue; } #endif +#ifdef GLX_MESA_query_renderer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"query_renderer", 14)) + { + ret = GLXEW_MESA_query_renderer; + continue; + } +#endif #ifdef GLX_MESA_release_buffers if (_glewStrSame3(&pos, &len, (const GLubyte*)"release_buffers", 15)) { @@ -10658,10 +27373,38 @@ GLboolean glxewIsSupported (const char* name) ret = GLXEW_MESA_set_3dfx_mode; continue; } +#endif +#ifdef GLX_MESA_swap_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) + { + ret = GLXEW_MESA_swap_control; + continue; + } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) { +#ifdef GLX_NV_copy_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_buffer", 11)) + { + ret = GLXEW_NV_copy_buffer; + continue; + } +#endif +#ifdef GLX_NV_copy_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) + { + ret = GLXEW_NV_copy_image; + continue; + } +#endif +#ifdef GLX_NV_delay_before_swap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"delay_before_swap", 17)) + { + ret = GLXEW_NV_delay_before_swap; + continue; + } +#endif #ifdef GLX_NV_float_buffer if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) { @@ -10669,12 +27412,54 @@ GLboolean glxewIsSupported (const char* name) continue; } #endif +#ifdef GLX_NV_multisample_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) + { + ret = GLXEW_NV_multisample_coverage; + continue; + } +#endif +#ifdef GLX_NV_present_video + if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) + { + ret = GLXEW_NV_present_video; + continue; + } +#endif +#ifdef GLX_NV_robustness_video_memory_purge + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_video_memory_purge", 29)) + { + ret = GLXEW_NV_robustness_video_memory_purge; + continue; + } +#endif +#ifdef GLX_NV_swap_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) + { + ret = GLXEW_NV_swap_group; + continue; + } +#endif #ifdef GLX_NV_vertex_array_range if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) { ret = GLXEW_NV_vertex_array_range; continue; } +#endif +#ifdef GLX_NV_video_capture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13)) + { + ret = GLXEW_NV_video_capture; + continue; + } +#endif +#ifdef GLX_NV_video_out + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_out", 9)) + { + ret = GLXEW_NV_video_out; + continue; + } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) @@ -10686,8 +27471,7 @@ GLboolean glxewIsSupported (const char* name) continue; } #endif -#if defined(GLX_OML_sync_control) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) -#include +#ifdef GLX_OML_sync_control if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync_control", 12)) { ret = GLXEW_OML_sync_control; @@ -10832,4 +27616,967 @@ GLboolean glxewIsSupported (const char* name) return ret; } +#elif defined(GLEW_EGL) + +GLboolean GLEWAPIENTRY eglewIsSupported (const char* name) +{ + const GLubyte* pos = (const GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if(_glewStrSame1(&pos, &len, (const GLubyte*)"EGL_", 4)) + { + if (_glewStrSame2(&pos, &len, (const GLubyte*)"VERSION_", 8)) + { +#ifdef EGL_VERSION_1_0 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_0", 3)) + { + ret = EGLEW_VERSION_1_0; + continue; + } +#endif +#ifdef EGL_VERSION_1_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_1", 3)) + { + ret = EGLEW_VERSION_1_1; + continue; + } +#endif +#ifdef EGL_VERSION_1_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2", 3)) + { + ret = EGLEW_VERSION_1_2; + continue; + } +#endif +#ifdef EGL_VERSION_1_3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_3", 3)) + { + ret = EGLEW_VERSION_1_3; + continue; + } +#endif +#ifdef EGL_VERSION_1_4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_4", 3)) + { + ret = EGLEW_VERSION_1_4; + continue; + } +#endif +#ifdef EGL_VERSION_1_5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_5", 3)) + { + ret = EGLEW_VERSION_1_5; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ANDROID_", 8)) + { +#ifdef EGL_ANDROID_blob_cache + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blob_cache", 10)) + { + ret = EGLEW_ANDROID_blob_cache; + continue; + } +#endif +#ifdef EGL_ANDROID_create_native_client_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_native_client_buffer", 27)) + { + ret = EGLEW_ANDROID_create_native_client_buffer; + continue; + } +#endif +#ifdef EGL_ANDROID_framebuffer_target + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_target", 18)) + { + ret = EGLEW_ANDROID_framebuffer_target; + continue; + } +#endif +#ifdef EGL_ANDROID_front_buffer_auto_refresh + if (_glewStrSame3(&pos, &len, (const GLubyte*)"front_buffer_auto_refresh", 25)) + { + ret = EGLEW_ANDROID_front_buffer_auto_refresh; + continue; + } +#endif +#ifdef EGL_ANDROID_image_native_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_native_buffer", 19)) + { + ret = EGLEW_ANDROID_image_native_buffer; + continue; + } +#endif +#ifdef EGL_ANDROID_native_fence_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"native_fence_sync", 17)) + { + ret = EGLEW_ANDROID_native_fence_sync; + continue; + } +#endif +#ifdef EGL_ANDROID_presentation_time + if (_glewStrSame3(&pos, &len, (const GLubyte*)"presentation_time", 17)) + { + ret = EGLEW_ANDROID_presentation_time; + continue; + } +#endif +#ifdef EGL_ANDROID_recordable + if (_glewStrSame3(&pos, &len, (const GLubyte*)"recordable", 10)) + { + ret = EGLEW_ANDROID_recordable; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ANGLE_", 6)) + { +#ifdef EGL_ANGLE_d3d_share_handle_client_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"d3d_share_handle_client_buffer", 30)) + { + ret = EGLEW_ANGLE_d3d_share_handle_client_buffer; + continue; + } +#endif +#ifdef EGL_ANGLE_device_d3d + if (_glewStrSame3(&pos, &len, (const GLubyte*)"device_d3d", 10)) + { + ret = EGLEW_ANGLE_device_d3d; + continue; + } +#endif +#ifdef EGL_ANGLE_query_surface_pointer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"query_surface_pointer", 21)) + { + ret = EGLEW_ANGLE_query_surface_pointer; + continue; + } +#endif +#ifdef EGL_ANGLE_surface_d3d_texture_2d_share_handle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"surface_d3d_texture_2d_share_handle", 35)) + { + ret = EGLEW_ANGLE_surface_d3d_texture_2d_share_handle; + continue; + } +#endif +#ifdef EGL_ANGLE_window_fixed_size + if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_fixed_size", 17)) + { + ret = EGLEW_ANGLE_window_fixed_size; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARM_", 4)) + { +#ifdef EGL_ARM_implicit_external_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"implicit_external_sync", 22)) + { + ret = EGLEW_ARM_implicit_external_sync; + continue; + } +#endif +#ifdef EGL_ARM_pixmap_multisample_discard + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixmap_multisample_discard", 26)) + { + ret = EGLEW_ARM_pixmap_multisample_discard; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) + { +#ifdef EGL_EXT_buffer_age + if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_age", 10)) + { + ret = EGLEW_EXT_buffer_age; + continue; + } +#endif +#ifdef EGL_EXT_client_extensions + if (_glewStrSame3(&pos, &len, (const GLubyte*)"client_extensions", 17)) + { + ret = EGLEW_EXT_client_extensions; + continue; + } +#endif +#ifdef EGL_EXT_create_context_robustness + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_robustness", 25)) + { + ret = EGLEW_EXT_create_context_robustness; + continue; + } +#endif +#ifdef EGL_EXT_device_base + if (_glewStrSame3(&pos, &len, (const GLubyte*)"device_base", 11)) + { + ret = EGLEW_EXT_device_base; + continue; + } +#endif +#ifdef EGL_EXT_device_drm + if (_glewStrSame3(&pos, &len, (const GLubyte*)"device_drm", 10)) + { + ret = EGLEW_EXT_device_drm; + continue; + } +#endif +#ifdef EGL_EXT_device_enumeration + if (_glewStrSame3(&pos, &len, (const GLubyte*)"device_enumeration", 18)) + { + ret = EGLEW_EXT_device_enumeration; + continue; + } +#endif +#ifdef EGL_EXT_device_openwf + if (_glewStrSame3(&pos, &len, (const GLubyte*)"device_openwf", 13)) + { + ret = EGLEW_EXT_device_openwf; + continue; + } +#endif +#ifdef EGL_EXT_device_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"device_query", 12)) + { + ret = EGLEW_EXT_device_query; + continue; + } +#endif +#ifdef EGL_EXT_gl_colorspace_bt2020_linear + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gl_colorspace_bt2020_linear", 27)) + { + ret = EGLEW_EXT_gl_colorspace_bt2020_linear; + continue; + } +#endif +#ifdef EGL_EXT_gl_colorspace_bt2020_pq + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gl_colorspace_bt2020_pq", 23)) + { + ret = EGLEW_EXT_gl_colorspace_bt2020_pq; + continue; + } +#endif +#ifdef EGL_EXT_gl_colorspace_scrgb_linear + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gl_colorspace_scrgb_linear", 26)) + { + ret = EGLEW_EXT_gl_colorspace_scrgb_linear; + continue; + } +#endif +#ifdef EGL_EXT_image_dma_buf_import + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_dma_buf_import", 20)) + { + ret = EGLEW_EXT_image_dma_buf_import; + continue; + } +#endif +#ifdef EGL_EXT_image_dma_buf_import_modifiers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_dma_buf_import_modifiers", 30)) + { + ret = EGLEW_EXT_image_dma_buf_import_modifiers; + continue; + } +#endif +#ifdef EGL_EXT_multiview_window + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multiview_window", 16)) + { + ret = EGLEW_EXT_multiview_window; + continue; + } +#endif +#ifdef EGL_EXT_output_base + if (_glewStrSame3(&pos, &len, (const GLubyte*)"output_base", 11)) + { + ret = EGLEW_EXT_output_base; + continue; + } +#endif +#ifdef EGL_EXT_output_drm + if (_glewStrSame3(&pos, &len, (const GLubyte*)"output_drm", 10)) + { + ret = EGLEW_EXT_output_drm; + continue; + } +#endif +#ifdef EGL_EXT_output_openwf + if (_glewStrSame3(&pos, &len, (const GLubyte*)"output_openwf", 13)) + { + ret = EGLEW_EXT_output_openwf; + continue; + } +#endif +#ifdef EGL_EXT_pixel_format_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) + { + ret = EGLEW_EXT_pixel_format_float; + continue; + } +#endif +#ifdef EGL_EXT_platform_base + if (_glewStrSame3(&pos, &len, (const GLubyte*)"platform_base", 13)) + { + ret = EGLEW_EXT_platform_base; + continue; + } +#endif +#ifdef EGL_EXT_platform_device + if (_glewStrSame3(&pos, &len, (const GLubyte*)"platform_device", 15)) + { + ret = EGLEW_EXT_platform_device; + continue; + } +#endif +#ifdef EGL_EXT_platform_wayland + if (_glewStrSame3(&pos, &len, (const GLubyte*)"platform_wayland", 16)) + { + ret = EGLEW_EXT_platform_wayland; + continue; + } +#endif +#ifdef EGL_EXT_platform_x11 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"platform_x11", 12)) + { + ret = EGLEW_EXT_platform_x11; + continue; + } +#endif +#ifdef EGL_EXT_protected_content + if (_glewStrSame3(&pos, &len, (const GLubyte*)"protected_content", 17)) + { + ret = EGLEW_EXT_protected_content; + continue; + } +#endif +#ifdef EGL_EXT_protected_surface + if (_glewStrSame3(&pos, &len, (const GLubyte*)"protected_surface", 17)) + { + ret = EGLEW_EXT_protected_surface; + continue; + } +#endif +#ifdef EGL_EXT_stream_consumer_egloutput + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_consumer_egloutput", 25)) + { + ret = EGLEW_EXT_stream_consumer_egloutput; + continue; + } +#endif +#ifdef EGL_EXT_surface_SMPTE2086_metadata + if (_glewStrSame3(&pos, &len, (const GLubyte*)"surface_SMPTE2086_metadata", 26)) + { + ret = EGLEW_EXT_surface_SMPTE2086_metadata; + continue; + } +#endif +#ifdef EGL_EXT_swap_buffers_with_damage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_buffers_with_damage", 24)) + { + ret = EGLEW_EXT_swap_buffers_with_damage; + continue; + } +#endif +#ifdef EGL_EXT_yuv_surface + if (_glewStrSame3(&pos, &len, (const GLubyte*)"yuv_surface", 11)) + { + ret = EGLEW_EXT_yuv_surface; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"HI_", 3)) + { +#ifdef EGL_HI_clientpixmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clientpixmap", 12)) + { + ret = EGLEW_HI_clientpixmap; + continue; + } +#endif +#ifdef EGL_HI_colorformats + if (_glewStrSame3(&pos, &len, (const GLubyte*)"colorformats", 12)) + { + ret = EGLEW_HI_colorformats; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"IMG_", 4)) + { +#ifdef EGL_IMG_context_priority + if (_glewStrSame3(&pos, &len, (const GLubyte*)"context_priority", 16)) + { + ret = EGLEW_IMG_context_priority; + continue; + } +#endif +#ifdef EGL_IMG_image_plane_attribs + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_plane_attribs", 19)) + { + ret = EGLEW_IMG_image_plane_attribs; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"KHR_", 4)) + { +#ifdef EGL_KHR_cl_event + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cl_event", 8)) + { + ret = EGLEW_KHR_cl_event; + continue; + } +#endif +#ifdef EGL_KHR_cl_event2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cl_event2", 9)) + { + ret = EGLEW_KHR_cl_event2; + continue; + } +#endif +#ifdef EGL_KHR_client_get_all_proc_addresses + if (_glewStrSame3(&pos, &len, (const GLubyte*)"client_get_all_proc_addresses", 29)) + { + ret = EGLEW_KHR_client_get_all_proc_addresses; + continue; + } +#endif +#ifdef EGL_KHR_config_attribs + if (_glewStrSame3(&pos, &len, (const GLubyte*)"config_attribs", 14)) + { + ret = EGLEW_KHR_config_attribs; + continue; + } +#endif +#ifdef EGL_KHR_context_flush_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"context_flush_control", 21)) + { + ret = EGLEW_KHR_context_flush_control; + continue; + } +#endif +#ifdef EGL_KHR_create_context + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context", 14)) + { + ret = EGLEW_KHR_create_context; + continue; + } +#endif +#ifdef EGL_KHR_create_context_no_error + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_no_error", 23)) + { + ret = EGLEW_KHR_create_context_no_error; + continue; + } +#endif +#ifdef EGL_KHR_debug + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug", 5)) + { + ret = EGLEW_KHR_debug; + continue; + } +#endif +#ifdef EGL_KHR_fence_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fence_sync", 10)) + { + ret = EGLEW_KHR_fence_sync; + continue; + } +#endif +#ifdef EGL_KHR_get_all_proc_addresses + if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_all_proc_addresses", 22)) + { + ret = EGLEW_KHR_get_all_proc_addresses; + continue; + } +#endif +#ifdef EGL_KHR_gl_colorspace + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gl_colorspace", 13)) + { + ret = EGLEW_KHR_gl_colorspace; + continue; + } +#endif +#ifdef EGL_KHR_gl_renderbuffer_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gl_renderbuffer_image", 21)) + { + ret = EGLEW_KHR_gl_renderbuffer_image; + continue; + } +#endif +#ifdef EGL_KHR_gl_texture_2D_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gl_texture_2D_image", 19)) + { + ret = EGLEW_KHR_gl_texture_2D_image; + continue; + } +#endif +#ifdef EGL_KHR_gl_texture_3D_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gl_texture_3D_image", 19)) + { + ret = EGLEW_KHR_gl_texture_3D_image; + continue; + } +#endif +#ifdef EGL_KHR_gl_texture_cubemap_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gl_texture_cubemap_image", 24)) + { + ret = EGLEW_KHR_gl_texture_cubemap_image; + continue; + } +#endif +#ifdef EGL_KHR_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image", 5)) + { + ret = EGLEW_KHR_image; + continue; + } +#endif +#ifdef EGL_KHR_image_base + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_base", 10)) + { + ret = EGLEW_KHR_image_base; + continue; + } +#endif +#ifdef EGL_KHR_image_pixmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_pixmap", 12)) + { + ret = EGLEW_KHR_image_pixmap; + continue; + } +#endif +#ifdef EGL_KHR_lock_surface + if (_glewStrSame3(&pos, &len, (const GLubyte*)"lock_surface", 12)) + { + ret = EGLEW_KHR_lock_surface; + continue; + } +#endif +#ifdef EGL_KHR_lock_surface2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"lock_surface2", 13)) + { + ret = EGLEW_KHR_lock_surface2; + continue; + } +#endif +#ifdef EGL_KHR_lock_surface3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"lock_surface3", 13)) + { + ret = EGLEW_KHR_lock_surface3; + continue; + } +#endif +#ifdef EGL_KHR_mutable_render_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"mutable_render_buffer", 21)) + { + ret = EGLEW_KHR_mutable_render_buffer; + continue; + } +#endif +#ifdef EGL_KHR_no_config_context + if (_glewStrSame3(&pos, &len, (const GLubyte*)"no_config_context", 17)) + { + ret = EGLEW_KHR_no_config_context; + continue; + } +#endif +#ifdef EGL_KHR_partial_update + if (_glewStrSame3(&pos, &len, (const GLubyte*)"partial_update", 14)) + { + ret = EGLEW_KHR_partial_update; + continue; + } +#endif +#ifdef EGL_KHR_platform_android + if (_glewStrSame3(&pos, &len, (const GLubyte*)"platform_android", 16)) + { + ret = EGLEW_KHR_platform_android; + continue; + } +#endif +#ifdef EGL_KHR_platform_gbm + if (_glewStrSame3(&pos, &len, (const GLubyte*)"platform_gbm", 12)) + { + ret = EGLEW_KHR_platform_gbm; + continue; + } +#endif +#ifdef EGL_KHR_platform_wayland + if (_glewStrSame3(&pos, &len, (const GLubyte*)"platform_wayland", 16)) + { + ret = EGLEW_KHR_platform_wayland; + continue; + } +#endif +#ifdef EGL_KHR_platform_x11 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"platform_x11", 12)) + { + ret = EGLEW_KHR_platform_x11; + continue; + } +#endif +#ifdef EGL_KHR_reusable_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"reusable_sync", 13)) + { + ret = EGLEW_KHR_reusable_sync; + continue; + } +#endif +#ifdef EGL_KHR_stream + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream", 6)) + { + ret = EGLEW_KHR_stream; + continue; + } +#endif +#ifdef EGL_KHR_stream_attrib + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_attrib", 13)) + { + ret = EGLEW_KHR_stream_attrib; + continue; + } +#endif +#ifdef EGL_KHR_stream_consumer_gltexture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_consumer_gltexture", 25)) + { + ret = EGLEW_KHR_stream_consumer_gltexture; + continue; + } +#endif +#ifdef EGL_KHR_stream_cross_process_fd + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_cross_process_fd", 23)) + { + ret = EGLEW_KHR_stream_cross_process_fd; + continue; + } +#endif +#ifdef EGL_KHR_stream_fifo + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_fifo", 11)) + { + ret = EGLEW_KHR_stream_fifo; + continue; + } +#endif +#ifdef EGL_KHR_stream_producer_aldatalocator + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_producer_aldatalocator", 29)) + { + ret = EGLEW_KHR_stream_producer_aldatalocator; + continue; + } +#endif +#ifdef EGL_KHR_stream_producer_eglsurface + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_producer_eglsurface", 26)) + { + ret = EGLEW_KHR_stream_producer_eglsurface; + continue; + } +#endif +#ifdef EGL_KHR_surfaceless_context + if (_glewStrSame3(&pos, &len, (const GLubyte*)"surfaceless_context", 19)) + { + ret = EGLEW_KHR_surfaceless_context; + continue; + } +#endif +#ifdef EGL_KHR_swap_buffers_with_damage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_buffers_with_damage", 24)) + { + ret = EGLEW_KHR_swap_buffers_with_damage; + continue; + } +#endif +#ifdef EGL_KHR_vg_parent_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vg_parent_image", 15)) + { + ret = EGLEW_KHR_vg_parent_image; + continue; + } +#endif +#ifdef EGL_KHR_wait_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"wait_sync", 9)) + { + ret = EGLEW_KHR_wait_sync; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESA_", 5)) + { +#ifdef EGL_MESA_drm_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"drm_image", 9)) + { + ret = EGLEW_MESA_drm_image; + continue; + } +#endif +#ifdef EGL_MESA_image_dma_buf_export + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_dma_buf_export", 20)) + { + ret = EGLEW_MESA_image_dma_buf_export; + continue; + } +#endif +#ifdef EGL_MESA_platform_gbm + if (_glewStrSame3(&pos, &len, (const GLubyte*)"platform_gbm", 12)) + { + ret = EGLEW_MESA_platform_gbm; + continue; + } +#endif +#ifdef EGL_MESA_platform_surfaceless + if (_glewStrSame3(&pos, &len, (const GLubyte*)"platform_surfaceless", 20)) + { + ret = EGLEW_MESA_platform_surfaceless; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NOK_", 4)) + { +#ifdef EGL_NOK_swap_region + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_region", 11)) + { + ret = EGLEW_NOK_swap_region; + continue; + } +#endif +#ifdef EGL_NOK_swap_region2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_region2", 12)) + { + ret = EGLEW_NOK_swap_region2; + continue; + } +#endif +#ifdef EGL_NOK_texture_from_pixmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_from_pixmap", 19)) + { + ret = EGLEW_NOK_texture_from_pixmap; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) + { +#ifdef EGL_NV_3dvision_surface + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3dvision_surface", 16)) + { + ret = EGLEW_NV_3dvision_surface; + continue; + } +#endif +#ifdef EGL_NV_coverage_sample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"coverage_sample", 15)) + { + ret = EGLEW_NV_coverage_sample; + continue; + } +#endif +#ifdef EGL_NV_coverage_sample_resolve + if (_glewStrSame3(&pos, &len, (const GLubyte*)"coverage_sample_resolve", 23)) + { + ret = EGLEW_NV_coverage_sample_resolve; + continue; + } +#endif +#ifdef EGL_NV_cuda_event + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cuda_event", 10)) + { + ret = EGLEW_NV_cuda_event; + continue; + } +#endif +#ifdef EGL_NV_depth_nonlinear + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_nonlinear", 15)) + { + ret = EGLEW_NV_depth_nonlinear; + continue; + } +#endif +#ifdef EGL_NV_device_cuda + if (_glewStrSame3(&pos, &len, (const GLubyte*)"device_cuda", 11)) + { + ret = EGLEW_NV_device_cuda; + continue; + } +#endif +#ifdef EGL_NV_native_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"native_query", 12)) + { + ret = EGLEW_NV_native_query; + continue; + } +#endif +#ifdef EGL_NV_post_convert_rounding + if (_glewStrSame3(&pos, &len, (const GLubyte*)"post_convert_rounding", 21)) + { + ret = EGLEW_NV_post_convert_rounding; + continue; + } +#endif +#ifdef EGL_NV_post_sub_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"post_sub_buffer", 15)) + { + ret = EGLEW_NV_post_sub_buffer; + continue; + } +#endif +#ifdef EGL_NV_robustness_video_memory_purge + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_video_memory_purge", 29)) + { + ret = EGLEW_NV_robustness_video_memory_purge; + continue; + } +#endif +#ifdef EGL_NV_stream_consumer_gltexture_yuv + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_consumer_gltexture_yuv", 29)) + { + ret = EGLEW_NV_stream_consumer_gltexture_yuv; + continue; + } +#endif +#ifdef EGL_NV_stream_cross_display + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_cross_display", 20)) + { + ret = EGLEW_NV_stream_cross_display; + continue; + } +#endif +#ifdef EGL_NV_stream_cross_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_cross_object", 19)) + { + ret = EGLEW_NV_stream_cross_object; + continue; + } +#endif +#ifdef EGL_NV_stream_cross_partition + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_cross_partition", 22)) + { + ret = EGLEW_NV_stream_cross_partition; + continue; + } +#endif +#ifdef EGL_NV_stream_cross_process + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_cross_process", 20)) + { + ret = EGLEW_NV_stream_cross_process; + continue; + } +#endif +#ifdef EGL_NV_stream_cross_system + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_cross_system", 19)) + { + ret = EGLEW_NV_stream_cross_system; + continue; + } +#endif +#ifdef EGL_NV_stream_fifo_next + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_fifo_next", 16)) + { + ret = EGLEW_NV_stream_fifo_next; + continue; + } +#endif +#ifdef EGL_NV_stream_fifo_synchronous + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_fifo_synchronous", 23)) + { + ret = EGLEW_NV_stream_fifo_synchronous; + continue; + } +#endif +#ifdef EGL_NV_stream_frame_limits + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_frame_limits", 19)) + { + ret = EGLEW_NV_stream_frame_limits; + continue; + } +#endif +#ifdef EGL_NV_stream_metadata + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_metadata", 15)) + { + ret = EGLEW_NV_stream_metadata; + continue; + } +#endif +#ifdef EGL_NV_stream_remote + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_remote", 13)) + { + ret = EGLEW_NV_stream_remote; + continue; + } +#endif +#ifdef EGL_NV_stream_reset + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_reset", 12)) + { + ret = EGLEW_NV_stream_reset; + continue; + } +#endif +#ifdef EGL_NV_stream_socket + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_socket", 13)) + { + ret = EGLEW_NV_stream_socket; + continue; + } +#endif +#ifdef EGL_NV_stream_socket_inet + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_socket_inet", 18)) + { + ret = EGLEW_NV_stream_socket_inet; + continue; + } +#endif +#ifdef EGL_NV_stream_socket_unix + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_socket_unix", 18)) + { + ret = EGLEW_NV_stream_socket_unix; + continue; + } +#endif +#ifdef EGL_NV_stream_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stream_sync", 11)) + { + ret = EGLEW_NV_stream_sync; + continue; + } +#endif +#ifdef EGL_NV_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync", 4)) + { + ret = EGLEW_NV_sync; + continue; + } +#endif +#ifdef EGL_NV_system_time + if (_glewStrSame3(&pos, &len, (const GLubyte*)"system_time", 11)) + { + ret = EGLEW_NV_system_time; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"TIZEN_", 6)) + { +#ifdef EGL_TIZEN_image_native_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_native_buffer", 19)) + { + ret = EGLEW_TIZEN_image_native_buffer; + continue; + } +#endif +#ifdef EGL_TIZEN_image_native_surface + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_native_surface", 20)) + { + ret = EGLEW_TIZEN_image_native_surface; + continue; + } +#endif + } + } + ret = (len == 0); + } + return ret; +} + #endif /* _WIN32 */ diff --git a/test_conformance/gl/helpers.cpp b/test_conformance/gl/helpers.cpp index 864059ba..16441a47 100644 --- a/test_conformance/gl/helpers.cpp +++ b/test_conformance/gl/helpers.cpp @@ -368,7 +368,7 @@ char * convert_to_expected( void * inputBuffer, size_t numPixels, ExplicitType i cl_float *outData = new cl_float[ numPixels * channelNum ]; for( size_t i = 0; i < numPixels * channelNum; i++ ) { - outData[ i ] = convert_half_to_float(src[ i ]); + outData[i] = cl_half_to_float(src[i]); } return (char *)outData; } diff --git a/test_conformance/gl/main.cpp b/test_conformance/gl/main.cpp index 6338cd7a..203e915e 100644 --- a/test_conformance/gl/main.cpp +++ b/test_conformance/gl/main.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -23,9 +23,9 @@ #endif #include "procs.h" -#include "../../test_common/gl/setup.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/parseParameters.h" +#include "gl/setup.h" +#include "harness/testHarness.h" +#include "harness/parseParameters.h" #if !defined(_WIN32) #include @@ -153,11 +153,9 @@ test_definition test_list32[] = { const int test_num = ARRAY_SIZE( test_list ); const int test_num32 = ARRAY_SIZE( test_list32 ); -cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT; -bool gTestRounding = true; - int main(int argc, const char *argv[]) { + gTestRounding = true; int error = 0; int numErrors = 0; @@ -165,12 +163,10 @@ int main(int argc, const char *argv[]) argc = parseCustomParam(argc, argv); if (argc == -1) { - test_finish (); return -1; } cl_device_type requestedDeviceType = CL_DEVICE_TYPE_DEFAULT; - checkDeviceTypeOverride(&requestedDeviceType); /* Do we have a CPU/GPU specification? */ if( argc > 1 ) @@ -210,7 +206,6 @@ int main(int argc, const char *argv[]) log_info( "Note: Any 3.2 test names must follow 2.1 test names on the command line.\n" ); log_info( "Use environment variables to specify desired device.\n" ); - test_finish(); return 0; } @@ -231,11 +226,9 @@ int main(int argc, const char *argv[]) int supported = glEnv->SupportsCLGLInterop( requestedDeviceType ); if( supported == 0 ) { log_info("Test not run because GL-CL interop is not supported for any devices of the requested type.\n"); - test_finish(); return 0; } else if ( supported == -1 ) { log_error("Unable to setup the test or failed to determine if CL-GL interop is supported.\n"); - test_finish(); return -1; } @@ -251,7 +244,6 @@ int main(int argc, const char *argv[]) // At least one device supports CL-GL interop, so init the test. if( glEnv->Init( &argc, (char **)argv, CL_FALSE ) ) { log_error("Failed to initialize the GL environment for this test.\n"); - test_finish(); return -1; } @@ -260,7 +252,6 @@ int main(int argc, const char *argv[]) if( sCurrentContext == NULL ) { log_error( "ERROR: Unable to obtain CL context from GL\n" ); - test_finish(); return -1; } @@ -271,19 +262,16 @@ int main(int argc, const char *argv[]) if( error != CL_SUCCESS ) { print_error( error, "Unable to get device count from context" ); - test_finish(); return -1; } deviceIDs = (cl_device_id *)malloc(numDevices); if (deviceIDs == NULL) { print_error( error, "malloc failed" ); - test_finish(); return -1; } error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, numDevices, deviceIDs, NULL); if( error != CL_SUCCESS ) { print_error( error, "Unable to get device list from context" ); - test_finish(); return -1; } @@ -291,7 +279,6 @@ int main(int argc, const char *argv[]) if (numDevices < 1) { log_error("No devices found.\n"); - test_finish(); return -1; } @@ -301,7 +288,6 @@ int main(int argc, const char *argv[]) for( size_t i = 0; i < numDevices; i++ ) { log_info( "\nTesting OpenGL 2.x\n" ); if( printDeviceHeader( deviceIDs[ i ] ) != CL_SUCCESS ) { - test_finish(); return -1; } @@ -325,7 +311,6 @@ int main(int argc, const char *argv[]) // At least one device supports CL-GL interop, so init the test. if( glEnv->Init( &argc, (char **)argv, CL_TRUE ) ) { log_error("Failed to initialize the GL environment for this test.\n"); - test_finish(); return -1; } @@ -333,7 +318,6 @@ int main(int argc, const char *argv[]) sCurrentContext = glEnv->CreateCLContext(); if( sCurrentContext == NULL ) { log_error( "ERROR: Unable to obtain CL context from GL\n" ); - test_finish(); return -1; } @@ -343,19 +327,16 @@ int main(int argc, const char *argv[]) error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, 0, NULL, &numDevices); if( error != CL_SUCCESS ) { print_error( error, "Unable to get device count from context" ); - test_finish(); return -1; } deviceIDs = (cl_device_id *)malloc(numDevices); if (deviceIDs == NULL) { print_error( error, "malloc failed" ); - test_finish(); return -1; } error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, numDevices, deviceIDs, NULL); if( error != CL_SUCCESS ) { print_error( error, "Unable to get device list from context" ); - test_finish(); return -1; } @@ -363,7 +344,6 @@ int main(int argc, const char *argv[]) if (numDevices < 1) { log_error("No devices found.\n"); - test_finish(); return -1; } @@ -374,7 +354,6 @@ int main(int argc, const char *argv[]) for( size_t i = 0; i < numDevices; i++ ) { log_info( "\nTesting OpenGL 3.2\n" ); if( printDeviceHeader( deviceIDs[ i ] ) != CL_SUCCESS ) { - test_finish(); return -1; } diff --git a/test_conformance/gl/procs.h b/test_conformance/gl/procs.h index 57c5eefa..b14e22dc 100644 --- a/test_conformance/gl/procs.h +++ b/test_conformance/gl/procs.h @@ -14,7 +14,7 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/mt19937.h" +#include "harness/mt19937.h" #pragma mark - diff --git a/test_conformance/gl/testBase.h b/test_conformance/gl/testBase.h index 6d445f7c..1ac0f50b 100644 --- a/test_conformance/gl/testBase.h +++ b/test_conformance/gl/testBase.h @@ -16,7 +16,7 @@ #ifndef _testBase_h #define _testBase_h -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -25,21 +25,21 @@ #if !defined (__APPLE__) #include -#include "../../test_common/gl/gl_headers.h" +#include "gl/gl_headers.h" #include #else -#include "../../test_common/gl/gl_headers.h" +#include "gl/gl_headers.h" #endif -#include "../../test_common/harness/imageHelpers.h" -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/threadTesting.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/mt19937.h" +#include "harness/imageHelpers.h" +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" +#include "harness/threadTesting.h" +#include "harness/typeWrappers.h" +#include "harness/conversions.h" +#include "harness/mt19937.h" -#include "../../test_common/gl/helpers.h" +#include "gl/helpers.h" extern const char *get_kernel_suffix( cl_image_format *format ); extern const char *get_write_conversion( cl_image_format *format, ExplicitType type); diff --git a/test_conformance/gl/test_buffers.cpp b/test_conformance/gl/test_buffers.cpp index afe7e32e..f11590fb 100644 --- a/test_conformance/gl/test_buffers.cpp +++ b/test_conformance/gl/test_buffers.cpp @@ -14,15 +14,13 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/conversions.h" +#include "harness/typeWrappers.h" #if !defined (__APPLE__) #include #endif -extern "C" { extern cl_uint gRandomSeed; }; - static const char *bufferKernelPattern = "__kernel void sample_test( __global %s%s *source, __global %s%s *clDest, __global %s%s *glDest )\n" "{\n" diff --git a/test_conformance/gl/test_fence_sync.cpp b/test_conformance/gl/test_fence_sync.cpp index 3a6857bd..00bf2cc9 100644 --- a/test_conformance/gl/test_fence_sync.cpp +++ b/test_conformance/gl/test_fence_sync.cpp @@ -14,8 +14,8 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/gl/setup.h" -#include "../../test_common/harness/genericThread.h" +#include "gl/setup.h" +#include "harness/genericThread.h" #if defined( __APPLE__ ) #include @@ -74,7 +74,7 @@ static void InitSyncFns( void ) glGetInteger64vFunc = (glGetInteger64vPtr)glutGetProcAddress( "glGetInteger64v" ); glGetSyncivFunc = (glGetSyncivPtr)glutGetProcAddress( "glGetSynciv" ); } - +#ifndef GL_ARB_sync #define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 #define GL_OBJECT_TYPE 0x9112 @@ -97,6 +97,7 @@ static void InitSyncFns( void ) #define GL_TIMEOUT_EXPIRED 0x911B #define GL_CONDITION_SATISFIED 0x911C #define GL_WAIT_FAILED 0x911D +#endif #define USING_ARB_sync 1 #endif @@ -285,7 +286,7 @@ public: virtual void * IRun( void ) { cl_int error = run_cl_kernel( mKernel, mQueue, mStream0, mStream1, mRowIdx, mFenceEvent, mNumThreads ); - return (void *)error; + return (void *)(uintptr_t)error; } }; @@ -669,7 +670,6 @@ int test_fence_sync( cl_device_id device, cl_context context, cl_command_queue q if( err != CL_SUCCESS ) { print_error( err, "Unable to get device count from context" ); - test_finish(); return -1; } vs_count = (GLint)device_cb / sizeof(cl_device_id); diff --git a/test_conformance/gl/test_image_methods.cpp b/test_conformance/gl/test_image_methods.cpp index 0d0e5c7e..a841e2d2 100644 --- a/test_conformance/gl/test_image_methods.cpp +++ b/test_conformance/gl/test_image_methods.cpp @@ -19,7 +19,7 @@ using namespace std; -typedef struct image_kernel_data +struct image_kernel_data { cl_int width; cl_int height; diff --git a/test_conformance/gl/test_images_2D.cpp b/test_conformance/gl/test_images_2D.cpp index 5af48ea8..fbff31c4 100644 --- a/test_conformance/gl/test_images_2D.cpp +++ b/test_conformance/gl/test_images_2D.cpp @@ -26,8 +26,6 @@ using namespace std; -extern "C" { extern cl_uint gRandomSeed; } - #pragma mark - #pragma mark _2D read tests diff --git a/test_conformance/gl/test_images_3D.cpp b/test_conformance/gl/test_images_3D.cpp index a8c80f6e..8abaa096 100644 --- a/test_conformance/gl/test_images_3D.cpp +++ b/test_conformance/gl/test_images_3D.cpp @@ -26,8 +26,6 @@ using namespace std; -extern "C" { extern cl_uint gRandomSeed; }; - #pragma mark - #pragma mark _3D read test diff --git a/test_conformance/gl/test_images_depth.cpp b/test_conformance/gl/test_images_depth.cpp index 09152850..f6cded47 100644 --- a/test_conformance/gl/test_images_depth.cpp +++ b/test_conformance/gl/test_images_depth.cpp @@ -27,8 +27,6 @@ using namespace std; -extern "C" { extern cl_uint gRandomSeed; } - #pragma mark - #pragma mark _2D depth read tests diff --git a/test_conformance/gl/test_images_getinfo_common.cpp b/test_conformance/gl/test_images_getinfo_common.cpp index bc21496a..345b5950 100644 --- a/test_conformance/gl/test_images_getinfo_common.cpp +++ b/test_conformance/gl/test_images_getinfo_common.cpp @@ -23,8 +23,6 @@ #include #endif -extern "C" { extern cl_uint gRandomSeed; }; - extern int supportsHalf(cl_context context, bool* supports_half); static int test_image_info( cl_context context, cl_command_queue queue, diff --git a/test_conformance/gl/test_images_read_common.cpp b/test_conformance/gl/test_images_read_common.cpp index 1d0529d5..112c7891 100644 --- a/test_conformance/gl/test_images_read_common.cpp +++ b/test_conformance/gl/test_images_read_common.cpp @@ -23,8 +23,6 @@ #include #endif -extern "C" { extern cl_uint gRandomSeed; }; - extern int supportsHalf(cl_context context, bool* supports_half); extern int supportsMsaa(cl_context context, bool* supports_msaa); extern int supportsDepth(cl_context context, bool* supports_depth); @@ -253,7 +251,7 @@ int test_cl_image_read( cl_context context, cl_command_queue queue, programPtr = kernelSource; if( create_single_kernel_helper( context, &program, &kernel, 1, - (const char **)&programPtr, "sample_test" ) ) + (const char **)&programPtr, "sample_test", "" ) ) { return -1; } @@ -278,12 +276,7 @@ int test_cl_image_read( cl_context context, cl_command_queue queue, test_error( error, "Unable to create output buffer" ); /* Assign streams and execute */ - cl_sampler_properties properties[] = { - CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE, - CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_NONE, - CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST, - 0 }; - clSamplerWrapper sampler = clCreateSamplerWithProperties( context, properties, &error ); + clSamplerWrapper sampler = clCreateSampler( context, CL_FALSE, CL_ADDRESS_NONE, CL_FILTER_NEAREST, &error ); test_error( error, "Unable to create sampler" ); error = clSetKernelArg( kernel, 0, sizeof( streams[ 0 ] ), &streams[ 0 ] ); diff --git a/test_conformance/gl/test_images_write_common.cpp b/test_conformance/gl/test_images_write_common.cpp index 1345f46f..9bbb257b 100644 --- a/test_conformance/gl/test_images_write_common.cpp +++ b/test_conformance/gl/test_images_write_common.cpp @@ -24,8 +24,6 @@ #include #endif -extern "C" { extern cl_uint gRandomSeed; }; - #pragma mark - #pragma mark Write test kernels @@ -98,6 +96,7 @@ static const char *kernelpattern_image_write_1Darray_half = "}\n"; static const char *kernelpattern_image_write_3D = +"#pragma OPENCL EXTENSION cl_khr_3d_image_writes : enable\n" "__kernel void sample_test( __global %s4 *source, write_only image3d_t dest )\n" "{\n" " int tidX = get_global_id(0);\n" @@ -111,6 +110,7 @@ static const char *kernelpattern_image_write_3D = "}\n"; static const char *kernelpattern_image_write_3D_half = +"#pragma OPENCL EXTENSION cl_khr_3d_image_writes : enable\n" "__kernel void sample_test( __global half4 *source, write_only image3d_t dest )\n" "{\n" " int tidX = get_global_id(0);\n" @@ -334,7 +334,7 @@ int test_cl_image_write( cl_context context, cl_command_queue queue, programPtr = kernelSource; if( create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, - (const char **)&programPtr, "sample_test", "-cl-std=CL2.0" ) ) + (const char **)&programPtr, "sample_test", "" ) ) { return -1; } @@ -364,12 +364,7 @@ int test_cl_image_write( cl_context context, cl_command_queue queue, channelSize * 4 * width * height * depth, *outSourceBuffer, &error ); test_error( error, "Unable to create output buffer" ); - cl_sampler_properties properties[] = { - CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE, - CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_NONE, - CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST, - 0 }; - clSamplerWrapper sampler = clCreateSamplerWithProperties( context, properties, &error ); + clSamplerWrapper sampler = clCreateSampler(context, CL_FALSE, CL_ADDRESS_NONE, CL_FILTER_NEAREST, &error); test_error( error, "Unable to create sampler" ); error = clSetKernelArg( kernel, 0, sizeof( inStream ), &inStream ); @@ -442,22 +437,7 @@ int supportsHalf(cl_context context, bool* supports_half) error = clGetContextInfo(context, CL_CONTEXT_DEVICES, numDev * sizeof(cl_device_id), devices, NULL); test_error(error, "clGetContextInfo for CL_CONTEXT_DEVICES failed"); - // Get the extensions string for the device - error = clGetDeviceInfo(devices[0], CL_DEVICE_EXTENSIONS, 0, NULL, &size); - test_error(error, "clGetDeviceInfo for CL_DEVICE_EXTENSIONS size failed"); - - char *extensions = new char[size+1]; - if (extensions == 0) { - log_error("Failed to allocate memory for extensions string.\n"); - return -1; - } - memset( extensions, CHAR_MIN, sizeof(char)*(size+1) ); - - error = clGetDeviceInfo(devices[0], CL_DEVICE_EXTENSIONS, sizeof(char)*size, extensions, NULL); - test_error(error, "clGetDeviceInfo for CL_DEVICE_EXTENSIONS failed"); - - *supports_half = strstr(extensions, "cl_khr_fp16"); - delete [] extensions; + *supports_half = is_extension_available(devices[0], "cl_khr_fp16"); delete [] devices; return error; @@ -476,22 +456,7 @@ int supportsMsaa(cl_context context, bool* supports_msaa) error = clGetContextInfo(context, CL_CONTEXT_DEVICES, numDev * sizeof(cl_device_id), devices, NULL); test_error(error, "clGetContextInfo for CL_CONTEXT_DEVICES failed"); - // Get the extensions string for the device - error = clGetDeviceInfo(devices[0], CL_DEVICE_EXTENSIONS, 0, NULL, &size); - test_error(error, "clGetDeviceInfo for CL_DEVICE_EXTENSIONS size failed"); - - char *extensions = new char[size+1]; - if (extensions == 0) { - log_error("Failed to allocate memory for extensions string.\n"); - return -1; - } - memset( extensions, CHAR_MIN, sizeof(char)*(size+1) ); - - error = clGetDeviceInfo(devices[0], CL_DEVICE_EXTENSIONS, sizeof(char)*size, extensions, NULL); - test_error(error, "clGetDeviceInfo for CL_DEVICE_EXTENSIONS failed"); - - *supports_msaa = strstr(extensions, "cl_khr_gl_msaa_sharing"); - delete [] extensions; + *supports_msaa = is_extension_available(devices[0], "cl_khr_gl_msaa_sharing"); delete [] devices; return error; @@ -510,22 +475,7 @@ int supportsDepth(cl_context context, bool* supports_depth) error = clGetContextInfo(context, CL_CONTEXT_DEVICES, numDev * sizeof(cl_device_id), devices, NULL); test_error(error, "clGetContextInfo for CL_CONTEXT_DEVICES failed"); - // Get the extensions string for the device - error = clGetDeviceInfo(devices[0], CL_DEVICE_EXTENSIONS, 0, NULL, &size); - test_error(error, "clGetDeviceInfo for CL_DEVICE_EXTENSIONS size failed"); - - char *extensions = new char[size+1]; - if (extensions == 0) { - log_error("Failed to allocate memory for extensions string.\n"); - return -1; - } - memset( extensions, CHAR_MIN, sizeof(char)*(size+1) ); - - error = clGetDeviceInfo(devices[0], CL_DEVICE_EXTENSIONS, sizeof(char)*size, extensions, NULL); - test_error(error, "clGetDeviceInfo for CL_DEVICE_EXTENSIONS failed"); - - *supports_depth = strstr(extensions, "cl_khr_gl_depth_images"); - delete [] extensions; + *supports_depth = is_extension_available(devices[0], "cl_khr_gl_depth_images"); delete [] devices; return error; @@ -813,16 +763,16 @@ int test_images_write_common(cl_device_id device, cl_context context, get_base_gl_target(targets[ tidx ]) == GL_TEXTURE_2D_MULTISAMPLE_ARRAY) { bool supports_msaa; - error = supportsMsaa(context, &supports_msaa); - if( error != 0 ) return error; + int errorInGetInfo = supportsMsaa(context, &supports_msaa); + if (errorInGetInfo != 0) return errorInGetInfo; if (!supports_msaa) return 0; } if (formats[ fidx ].formattype == GL_DEPTH_COMPONENT || formats[ fidx ].formattype == GL_DEPTH_STENCIL) { bool supports_depth; - error = supportsDepth(context, &supports_depth); - if( error != 0 ) return error; + int errorInGetInfo = supportsDepth(context, &supports_depth); + if (errorInGetInfo != 0) return errorInGetInfo; if (!supports_depth) return 0; } #endif diff --git a/test_conformance/gl/test_renderbuffer.cpp b/test_conformance/gl/test_renderbuffer.cpp index c7f6e702..d75b4e84 100644 --- a/test_conformance/gl/test_renderbuffer.cpp +++ b/test_conformance/gl/test_renderbuffer.cpp @@ -52,8 +52,6 @@ gluCheckExtension(const GLubyte *extension, const GLubyte *extensions) #endif -extern "C" { extern cl_uint gRandomSeed; }; - // This is defined in the write common code: extern int test_cl_image_write( cl_context context, cl_command_queue queue, GLenum target, cl_mem clImage, size_t width, size_t height, size_t depth, diff --git a/test_conformance/gl/test_renderbuffer_info.cpp b/test_conformance/gl/test_renderbuffer_info.cpp index 61a8adfa..bb5ce848 100644 --- a/test_conformance/gl/test_renderbuffer_info.cpp +++ b/test_conformance/gl/test_renderbuffer_info.cpp @@ -21,8 +21,6 @@ #include #endif -extern "C" {extern cl_uint gRandomSeed;}; - static int test_renderbuffer_object_info( cl_context context, cl_command_queue queue, GLsizei width, GLsizei height, GLenum attachment, GLenum format, GLenum internalFormat, diff --git a/test_conformance/gles/CMakeLists.txt b/test_conformance/gles/CMakeLists.txt index c5294e82..f3674903 100644 --- a/test_conformance/gles/CMakeLists.txt +++ b/test_conformance/gles/CMakeLists.txt @@ -13,16 +13,6 @@ set (${MODULE_NAME}_SOURCES helpers.cpp setup_egl.cpp ../../test_common/gles/helpers.cpp - ../../test_common/harness/genericThread.cpp - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/threadTesting.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/mt19937.c - ../../test_common/harness/conversions.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c ) if(ANDROID) diff --git a/test_conformance/gles/main.cpp b/test_conformance/gles/main.cpp index 4d3b353b..d0c12c91 100644 --- a/test_conformance/gles/main.cpp +++ b/test_conformance/gles/main.cpp @@ -28,8 +28,8 @@ #endif #include "procs.h" -#include "../../test_common/gles/setup.h" -#include "../../test_common/harness/testHarness.h" +#include "gles/setup.h" +#include "harness/testHarness.h" #if !defined(_WIN32) #include @@ -120,7 +120,6 @@ int main(int argc, const char *argv[]) log_info( "Note: Any 3.2 test names must follow 2.1 test names on the command line." ); log_info( "Use environment variables to specify desired device." ); - test_finish(); return 0; } @@ -135,7 +134,6 @@ int main(int argc, const char *argv[]) { printf("Requested device type is CL_DEVICE_TYPE_CPU\n"); log_info("Invalid CL device type. GL tests can only run on a GPU device.\n"); - test_finish(); return 0; } }//for @@ -157,12 +155,10 @@ int main(int argc, const char *argv[]) int supported = glEnv->SupportsCLGLInterop( requestedDeviceType ); if( supported == 0 ) { log_info("Test not run because GL-CL interop is not supported for any devices of the requested type.\n"); - test_finish(); error = 0; goto cleanup; } else if ( supported == -1 ) { log_error("Failed to determine if CL-GL interop is supported.\n"); - test_finish(); error = -1; goto cleanup; } @@ -173,7 +169,6 @@ int main(int argc, const char *argv[]) // At least one device supports CL-GL interop, so init the test. if( glEnv->Init( &argc, (char **)argv, CL_FALSE ) ) { log_error("Failed to initialize the GL environment for this test.\n"); - test_finish(); error = -1; goto cleanup; } @@ -183,7 +178,6 @@ int main(int argc, const char *argv[]) if( sCurrentContext == NULL ) { log_error( "ERROR: Unable to obtain CL context from GL\n" ); - test_finish(); error = -1; goto cleanup; } @@ -195,7 +189,6 @@ int main(int argc, const char *argv[]) if( error != CL_SUCCESS ) { print_error( error, "Unable to get device count from context" ); - test_finish(); error = -1; goto cleanup; } @@ -203,7 +196,6 @@ int main(int argc, const char *argv[]) if (numDevices < 1) { log_error("No devices found.\n"); - test_finish(); error = -1; goto cleanup; } @@ -211,7 +203,6 @@ int main(int argc, const char *argv[]) error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, sizeof( deviceIDs ), deviceIDs, NULL); if( error != CL_SUCCESS ) { print_error( error, "Unable to get device list from context" ); - test_finish(); error = -1; goto cleanup; } @@ -222,7 +213,6 @@ int main(int argc, const char *argv[]) for( size_t i = 0; i < numDevices; i++ ) { log_info( "\nTesting OpenGL 2.x\n" ); if( printDeviceHeader( deviceIDs[ i ] ) != CL_SUCCESS ) { - test_finish(); error = -1; goto cleanup; } @@ -286,7 +276,6 @@ int main(int argc, const char *argv[]) // At least one device supports CL-GL interop, so init the test. if( glEnv->Init( &argc, (char **)argv, CL_TRUE ) ) { log_error("Failed to initialize the GL environment for this test.\n"); - test_finish(); error = -1; goto cleanup; } @@ -295,7 +284,6 @@ int main(int argc, const char *argv[]) sCurrentContext = glEnv->CreateCLContext(); if( sCurrentContext == NULL ) { log_error( "ERROR: Unable to obtain CL context from GL\n" ); - test_finish(); error = -1; goto cleanup; } @@ -306,7 +294,6 @@ int main(int argc, const char *argv[]) error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, 0, NULL, &numDevices); if( error != CL_SUCCESS ) { print_error( error, "Unable to get device count from context" ); - test_finish(); error = -1; goto cleanup; } @@ -314,7 +301,6 @@ int main(int argc, const char *argv[]) if (numDevices < 1) { log_error("No devices found.\n"); - test_finish(); error = -1; goto cleanup; } @@ -322,7 +308,6 @@ int main(int argc, const char *argv[]) error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, sizeof( deviceIDs ), deviceIDs, NULL); if( error != CL_SUCCESS ) { print_error( error, "Unable to get device list from context" ); - test_finish(); error = -1; goto cleanup; } @@ -334,13 +319,11 @@ int main(int argc, const char *argv[]) for( size_t i = 0; i < numDevices; i++ ) { log_info( "\nTesting OpenGL 3.2\n" ); if( printDeviceHeader( deviceIDs[ i ] ) != CL_SUCCESS ) { - test_finish(); error = -1; goto cleanup; } #ifdef GL_ES_VERSION_2_0 log_info("Cannot test OpenGL 3.2! This test was built for OpenGL ES 2.0\n"); - test_finish(); error = -1; goto cleanup; #else diff --git a/test_conformance/gles/procs.h b/test_conformance/gles/procs.h index 9df80d6c..bc4a1c84 100644 --- a/test_conformance/gles/procs.h +++ b/test_conformance/gles/procs.h @@ -14,7 +14,7 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/mt19937.h" +#include "harness/mt19937.h" extern int test_buffers( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements ); diff --git a/test_conformance/gles/setup_egl.cpp b/test_conformance/gles/setup_egl.cpp index c72f7f27..6bb53cf9 100644 --- a/test_conformance/gles/setup_egl.cpp +++ b/test_conformance/gles/setup_egl.cpp @@ -15,7 +15,7 @@ // #include "setup.h" #include "testBase.h" -#include "../../test_common/harness/errorHelpers.h" +#include "harness/errorHelpers.h" #include #include @@ -163,15 +163,8 @@ public: } // Check all devices, search for one that supports cl_khr_gl_sharing - char extensions[8192]; for (int i=0; i<(int)num_of_devices; i++) { - error = clGetDeviceInfo(devices[i], CL_DEVICE_EXTENSIONS, sizeof(extensions), extensions, NULL); - if (error) { - print_error(error, "clGetDeviceInfo failed"); - return -1; - } - - if (strstr(extensions, "cl_khr_gl_sharing ") == NULL) { + if (!is_extension_available(devices[i], "cl_khr_gl_sharing"){ log_info("Device %d of %d does not support required extension cl_khr_gl_sharing.\n", i+1, num_of_devices); } else { log_info("Device %d of %d supports required extension cl_khr_gl_sharing.\n", i+1, num_of_devices); diff --git a/test_conformance/gles/testBase.h b/test_conformance/gles/testBase.h index 2bb59a61..09e8a836 100644 --- a/test_conformance/gles/testBase.h +++ b/test_conformance/gles/testBase.h @@ -30,23 +30,23 @@ #if !defined (__APPLE__) #include -#include "../../test_common/gles/gl_headers.h" +#include "gles/gl_headers.h" #include #else -#include "../../test_common/gl/gl_headers.h" +#include "gl/gl_headers.h" #endif -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/threadTesting.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/mt19937.h" +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" +#include "harness/threadTesting.h" +#include "harness/typeWrappers.h" +#include "harness/conversions.h" +#include "harness/mt19937.h" #ifdef GL_ES_VERSION_2_0 -#include "../../test_common/gles/helpers.h" +#include "gles/helpers.h" #else -#include "../../test_common/gl/helpers.h" +#include "gl/helpers.h" #endif extern const char *get_kernel_suffix( cl_image_format *format ); diff --git a/test_conformance/gles/test_buffers.cpp b/test_conformance/gles/test_buffers.cpp index 31d81d64..a2d67322 100644 --- a/test_conformance/gles/test_buffers.cpp +++ b/test_conformance/gles/test_buffers.cpp @@ -15,8 +15,8 @@ // #include "testBase.h" #include "testHarness.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/conversions.h" +#include "harness/typeWrappers.h" #include #include @@ -24,8 +24,6 @@ #include #endif -extern "C" { extern cl_uint gRandomSeed; }; - static const char *bufferKernelPattern = "__kernel void sample_test( __global %s%s *source, __global %s%s *clDest, __global %s%s *glDest )\n" "{\n" diff --git a/test_conformance/gles/test_fence_sync.cpp b/test_conformance/gles/test_fence_sync.cpp index 1c117943..7683b9c7 100644 --- a/test_conformance/gles/test_fence_sync.cpp +++ b/test_conformance/gles/test_fence_sync.cpp @@ -17,7 +17,7 @@ #include "testBase.h" #include "setup.h" -#include "../../test_common/harness/genericThread.h" +#include "harness/genericThread.h" #ifndef GLsync // For OpenGL before 3.2, we look for the ARB_sync extension and try to use that diff --git a/test_conformance/gles/test_images_2D.cpp b/test_conformance/gles/test_images_2D.cpp index f2c66fd7..c1a17fc8 100644 --- a/test_conformance/gles/test_images_2D.cpp +++ b/test_conformance/gles/test_images_2D.cpp @@ -17,8 +17,6 @@ #include "gl_headers.h" -extern "C" { extern cl_uint gRandomSeed; } - static const char *imageReadKernelPattern = "#pragma OPENCL EXTENSION cl_khr_fp16 : enable\n" /* added support for half floats */ "__kernel void sample_test( read_only image2d_t source, sampler_t sampler, __global %s4 *results )\n" diff --git a/test_conformance/gles/test_images_2D_info.cpp b/test_conformance/gles/test_images_2D_info.cpp index ce6717e6..857ab203 100644 --- a/test_conformance/gles/test_images_2D_info.cpp +++ b/test_conformance/gles/test_images_2D_info.cpp @@ -17,8 +17,6 @@ #include "gl_headers.h" -extern "C" {extern cl_uint gRandomSeed;}; - static int test_image_read( cl_context context, cl_command_queue queue, GLenum glTarget, GLuint glTexture, size_t imageWidth, size_t imageHeight, cl_image_format *outFormat, ExplicitType *outType, void **outResultBuffer ) diff --git a/test_conformance/gles/test_images_3D.cpp b/test_conformance/gles/test_images_3D.cpp index 7babc91e..9bfb2a59 100644 --- a/test_conformance/gles/test_images_3D.cpp +++ b/test_conformance/gles/test_images_3D.cpp @@ -17,8 +17,6 @@ #include "gl_headers.h" -extern "C" { extern cl_uint gRandomSeed; }; - static const char *imageReadKernelPattern = "__kernel void sample_test( read_only image3d_t source, sampler_t sampler, __global %s4 *results )\n" "{\n" diff --git a/test_conformance/gles/test_images_3D_info.cpp b/test_conformance/gles/test_images_3D_info.cpp index f2e98c01..a93985ee 100644 --- a/test_conformance/gles/test_images_3D_info.cpp +++ b/test_conformance/gles/test_images_3D_info.cpp @@ -16,8 +16,6 @@ #include "gl_headers.h" #include "testBase.h" -extern "C" {extern cl_uint gRandomSeed;}; - static int test_image_read( cl_context context, cl_command_queue queue, GLenum glTarget, GLuint glTexture, size_t imageWidth, size_t imageHeight, size_t imageDepth, cl_image_format *outFormat, ExplicitType *outType, void **outResultBuffer ) { diff --git a/test_conformance/gles/test_renderbuffer.cpp b/test_conformance/gles/test_renderbuffer.cpp index b4c6f148..20127aca 100644 --- a/test_conformance/gles/test_renderbuffer.cpp +++ b/test_conformance/gles/test_renderbuffer.cpp @@ -18,8 +18,6 @@ #include "gl_headers.h" -extern "C" { extern cl_uint gRandomSeed; }; - extern int test_cl_image_write( cl_context context, cl_command_queue queue, cl_mem clImage, size_t imageWidth, size_t imageHeight, cl_image_format *outFormat, ExplicitType *outType, void **outSourceBuffer, MTdata d ); diff --git a/test_conformance/gles/test_renderbuffer_info.cpp b/test_conformance/gles/test_renderbuffer_info.cpp index 4724187d..78331bc8 100644 --- a/test_conformance/gles/test_renderbuffer_info.cpp +++ b/test_conformance/gles/test_renderbuffer_info.cpp @@ -16,8 +16,6 @@ #include "gl_headers.h" #include "testBase.h" -extern "C" {extern cl_uint gRandomSeed;}; - static int test_renderbuffer_object_info( cl_context context, cl_command_queue queue, GLsizei width, GLsizei height, GLenum attachment, GLenum rbFormat, GLenum rbType, diff --git a/test_conformance/half/CMakeLists.txt b/test_conformance/half/CMakeLists.txt index 4b151270..494b4eb8 100644 --- a/test_conformance/half/CMakeLists.txt +++ b/test_conformance/half/CMakeLists.txt @@ -1,18 +1,10 @@ set(MODULE_NAME HALF) set(${MODULE_NAME}_SOURCES - cl_utils.c - Test_vLoadHalf.c - Test_roundTrip.c - Test_vStoreHalf.c main.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/mingw_compat.c - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/ThreadPool.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/testHarness.c - ../../test_common/harness/crc32.c + cl_utils.cpp + Test_vLoadHalf.cpp + Test_roundTrip.cpp + Test_vStoreHalf.cpp main.cpp ) include(../CMakeCommon.txt) diff --git a/test_conformance/half/Test_half.xcodeproj/project.pbxproj b/test_conformance/half/Test_half.xcodeproj/project.pbxproj deleted file mode 100644 index d3860565..00000000 --- a/test_conformance/half/Test_half.xcodeproj/project.pbxproj +++ /dev/null @@ -1,292 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 44; - objects = { - -/* Begin PBXBuildFile section */ - 3B1B765F0DE342BC00837A59 /* Test_vStoreHalf.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B1B765E0DE342BC00837A59 /* Test_vStoreHalf.c */; }; - 3B6173C40DE2B14800384A2C /* Test_roundTrip.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B6173C30DE2B14800384A2C /* Test_roundTrip.c */; }; - 3BA6BFB80DE21DB9008685CF /* Test_vLoadHalf.c in Sources */ = {isa = PBXBuildFile; fileRef = 3BA6BFB70DE21DB9008685CF /* Test_vLoadHalf.c */; }; - 3BA6BFBB0DE21EFA008685CF /* cl_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = 3BA6BFBA0DE21EFA008685CF /* cl_utils.c */; }; - 3BA6BFF30DE229C5008685CF /* OpenCL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BA6BFF20DE229C5008685CF /* OpenCL.framework */; }; - 8DD76FAC0486AB0100D96B5E /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* main.c */; settings = {ATTRIBUTES = (); }; }; - 8DD76FB00486AB0100D96B5E /* Test_half.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = C6A0FF2C0290799A04C91782 /* Test_half.1 */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 8DD76FAF0486AB0100D96B5E /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 8; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - 8DD76FB00486AB0100D96B5E /* Test_half.1 in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 1; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 08FB7796FE84155DC02AAC07 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = ""; }; - 3B1B765E0DE342BC00837A59 /* Test_vStoreHalf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Test_vStoreHalf.c; sourceTree = ""; }; - 3B1B77910DE3896E00837A59 /* builtins.cl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = builtins.cl; path = ../../../compute/OpenCL/cl_headers/private/builtins.cl; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.c; }; - 3B6173C30DE2B14800384A2C /* Test_roundTrip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Test_roundTrip.c; sourceTree = ""; }; - 3BA6BFB70DE21DB9008685CF /* Test_vLoadHalf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Test_vLoadHalf.c; sourceTree = ""; }; - 3BA6BFB90DE21EFA008685CF /* cl_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cl_utils.h; sourceTree = ""; }; - 3BA6BFBA0DE21EFA008685CF /* cl_utils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cl_utils.c; sourceTree = ""; }; - 3BA6BFF20DE229C5008685CF /* OpenCL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenCL.framework; path = /System/Library/Frameworks/OpenCL.framework; sourceTree = ""; }; - 3BA6C00A0DE22A95008685CF /* test_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = test_config.h; sourceTree = ""; }; - 3BA6C0770DE24F41008685CF /* tests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tests.h; sourceTree = ""; }; - 8DD76FB20486AB0100D96B5E /* Test_half */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Test_half; sourceTree = BUILT_PRODUCTS_DIR; }; - C6A0FF2C0290799A04C91782 /* Test_half.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = Test_half.1; sourceTree = ""; }; - FFB9F1420E5E155400F45584 /* ATF.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ATF.framework; path = /Library/Frameworks/ATF.framework; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8DD76FAD0486AB0100D96B5E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 3BA6BFF30DE229C5008685CF /* OpenCL.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 08FB7794FE84155DC02AAC07 /* Test_half */ = { - isa = PBXGroup; - children = ( - 3BA6C00A0DE22A95008685CF /* test_config.h */, - 3BA6C0770DE24F41008685CF /* tests.h */, - 08FB7796FE84155DC02AAC07 /* main.c */, - 08FB7795FE84155DC02AAC07 /* Source */, - 3BA6BFF80DE229CC008685CF /* Resources */, - 3B1B77910DE3896E00837A59 /* builtins.cl */, - C6A0FF2B0290797F04C91782 /* Documentation */, - 1AB674ADFE9D54B511CA2CBB /* Products */, - FFB9F1420E5E155400F45584 /* ATF.framework */, - ); - name = Test_half; - sourceTree = ""; - }; - 08FB7795FE84155DC02AAC07 /* Source */ = { - isa = PBXGroup; - children = ( - 3BA6BFB90DE21EFA008685CF /* cl_utils.h */, - 3BA6BFBA0DE21EFA008685CF /* cl_utils.c */, - 3BA6BFB70DE21DB9008685CF /* Test_vLoadHalf.c */, - 3B6173C30DE2B14800384A2C /* Test_roundTrip.c */, - 3B1B765E0DE342BC00837A59 /* Test_vStoreHalf.c */, - ); - name = Source; - sourceTree = ""; - }; - 1AB674ADFE9D54B511CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8DD76FB20486AB0100D96B5E /* Test_half */, - ); - name = Products; - sourceTree = ""; - }; - 3BA6BFF80DE229CC008685CF /* Resources */ = { - isa = PBXGroup; - children = ( - 3BA6BFF20DE229C5008685CF /* OpenCL.framework */, - ); - name = Resources; - sourceTree = ""; - }; - C6A0FF2B0290797F04C91782 /* Documentation */ = { - isa = PBXGroup; - children = ( - C6A0FF2C0290799A04C91782 /* Test_half.1 */, - ); - name = Documentation; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8DD76FA90486AB0100D96B5E /* Test_half */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1DEB928508733DD80010E9CD /* Build configuration list for PBXNativeTarget "Test_half" */; - buildPhases = ( - 8DD76FAB0486AB0100D96B5E /* Sources */, - 8DD76FAD0486AB0100D96B5E /* Frameworks */, - 8DD76FAF0486AB0100D96B5E /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Test_half; - productInstallPath = "$(HOME)/bin"; - productName = Test_half; - productReference = 8DD76FB20486AB0100D96B5E /* Test_half */; - productType = "com.apple.product-type.tool"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 08FB7793FE84155DC02AAC07 /* Project object */ = { - isa = PBXProject; - buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "Test_half" */; - compatibilityVersion = "Xcode 3.0"; - hasScannedForEncodings = 1; - mainGroup = 08FB7794FE84155DC02AAC07 /* Test_half */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 8DD76FA90486AB0100D96B5E /* Test_half */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 8DD76FAB0486AB0100D96B5E /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8DD76FAC0486AB0100D96B5E /* main.c in Sources */, - 3BA6BFB80DE21DB9008685CF /* Test_vLoadHalf.c in Sources */, - 3BA6BFBB0DE21EFA008685CF /* cl_utils.c in Sources */, - 3B6173C40DE2B14800384A2C /* Test_roundTrip.c in Sources */, - 3B1B765F0DE342BC00837A59 /* Test_vStoreHalf.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1DEB928608733DD80010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INSTALL_PATH = /usr/local/bin; - PRODUCT_NAME = Test_half; - ZERO_LINK = YES; - }; - name = Debug; - }; - 1DEB928708733DD80010E9CD /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_MODEL_TUNING = G5; - INSTALL_PATH = /usr/local/bin; - PRODUCT_NAME = Test_half; - }; - name = Release; - }; - 1DEB928A08733DD80010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)"; - ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc"; - ATF_Config_Comment = "Set ATF_DEFAULT to non-empty to link to ATF iff the BUILD_WITH_ATF env var is set"; - ATF_DEFAULT = SKIPPING; - ATF_DEFINES = "$(ATF_DEFINES_$(SKIPPING_ATF))"; - ATF_DEFINES_ = "USE_ATF=1"; - ATF_LINK = "$(ATF_LINK_$(SKIPPING_ATF))"; - ATF_LINK_ = "-framework ATF"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = _DEBUG; - GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_NEWLINE = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; - GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; - GCC_WARN_MISSING_PARENTHESES = NO; - GCC_WARN_PEDANTIC = YES; - GCC_WARN_SHADOW = YES; - GCC_WARN_SIGN_COMPARE = YES; - GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; - GCC_WARN_UNINITIALIZED_AUTOS = NO; - GCC_WARN_UNKNOWN_PRAGMAS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_LABEL = YES; - GCC_WARN_UNUSED_PARAMETER = YES; - GCC_WARN_UNUSED_VALUE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PREBINDING = NO; - SKIPPING_ATF = SKIPPING; - VALID_ARCHS = "i386 x86_64"; - }; - name = Debug; - }; - 1DEB928B08733DD80010E9CD /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - ppc, - i386, - ); - ATF_Config_Comment = "Set ATF_DEFAULT to non-empty to link to ATF iff the BUILD_WITH_ATF env var is set"; - ATF_DEFAULT = SKIPPING; - ATF_DEFINES = "$(ATF_DEFINES_$(SKIPPING_ATF))"; - ATF_DEFINES_ = "USE_ATF=1"; - ATF_LINK = "$(ATF_LINK_$(SKIPPING_ATF))"; - ATF_LINK_ = "-framework ATF"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_NEWLINE = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; - GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; - GCC_WARN_MISSING_PARENTHESES = NO; - GCC_WARN_PEDANTIC = NO; - GCC_WARN_SHADOW = YES; - GCC_WARN_SIGN_COMPARE = YES; - GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; - GCC_WARN_UNINITIALIZED_AUTOS = NO; - GCC_WARN_UNKNOWN_PRAGMAS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_LABEL = YES; - GCC_WARN_UNUSED_PARAMETER = YES; - GCC_WARN_UNUSED_VALUE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PREBINDING = NO; - SKIPPING_ATF = SKIPPING; - VALID_ARCHS = "i386 x86_64"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1DEB928508733DD80010E9CD /* Build configuration list for PBXNativeTarget "Test_half" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB928608733DD80010E9CD /* Debug */, - 1DEB928708733DD80010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "Test_half" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB928A08733DD80010E9CD /* Debug */, - 1DEB928B08733DD80010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; -} diff --git a/test_conformance/half/Test_roundTrip.c b/test_conformance/half/Test_roundTrip.cpp similarity index 99% rename from test_conformance/half/Test_roundTrip.c rename to test_conformance/half/Test_roundTrip.cpp index 7770593b..69fc7e41 100644 --- a/test_conformance/half/Test_roundTrip.c +++ b/test_conformance/half/Test_roundTrip.cpp @@ -16,7 +16,7 @@ #include #include "cl_utils.h" #include "tests.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" int test_roundTrip( cl_device_id device, cl_context context, cl_command_queue queue, int num_elements ) { @@ -33,10 +33,6 @@ int test_roundTrip( cl_device_id device, cl_context context, cl_command_queue qu memset( min_time, -1, sizeof( min_time ) ); memset( min_double_time, -1, sizeof( min_double_time ) ); - vlog( "Testing roundTrip\n" ); - fflush( stdout ); - - for( vectorSize = kMinVectorSize; vectorSize < kLastVectorSizeToTest; vectorSize++) { const char *source[] = { @@ -300,7 +296,7 @@ int test_roundTrip( cl_device_id device, cl_context context, cl_command_queue qu } } - vlog( "\tPassed\n" ); + vlog( "\n" ); loopCount = 100; if( gReportTimes ) diff --git a/test_conformance/half/Test_vLoadHalf.c b/test_conformance/half/Test_vLoadHalf.cpp similarity index 87% rename from test_conformance/half/Test_vLoadHalf.c rename to test_conformance/half/Test_vLoadHalf.cpp index 5c400044..3682d3e6 100644 --- a/test_conformance/half/Test_vLoadHalf.c +++ b/test_conformance/half/Test_vLoadHalf.cpp @@ -13,68 +13,27 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/compat.h" +#include "harness/testHarness.h" #include #include "cl_utils.h" #include "tests.h" -extern const char *addressSpaceNames[]; - -static inline float half2float( cl_ushort us ) -{ - uint32_t u = us; - uint32_t sign = (u << 16) & 0x80000000; - int32_t exponent = (u & 0x7c00) >> 10; - uint32_t mantissa = (u & 0x03ff) << 13; - union{ unsigned int u; float f;}uu; - - if( exponent == 0 ) - { - if( mantissa == 0 ) - return sign ? -0.0f : 0.0f; - - int shift = __builtin_clz( mantissa ) - 8; - exponent -= shift-1; - mantissa <<= shift; - mantissa &= 0x007fffff; - } - else - if( exponent == 31) - { - uu.u = mantissa | sign; - if( mantissa ) - uu.u |= 0x7fc00000; - else - uu.u |= 0x7f800000; - - return uu.f; - } - - exponent += 127 - 15; - exponent <<= 23; - - exponent |= mantissa; - uu.u = exponent | sign; - - return uu.f; -} +#include int Test_vLoadHalf_private( cl_device_id device, bool aligned ) { cl_int error; int vectorSize; - cl_program programs[kVectorSizeCount+kStrangeVectorSizeCount][4] = {{0}}; - cl_kernel kernels[kVectorSizeCount+kStrangeVectorSizeCount][4] = {{0}}; + cl_program programs[kVectorSizeCount+kStrangeVectorSizeCount][AS_NumAddressSpaces] = {{0}}; + cl_kernel kernels[kVectorSizeCount+kStrangeVectorSizeCount][AS_NumAddressSpaces] = {{0}}; uint64_t time[kVectorSizeCount+kStrangeVectorSizeCount] = {0}; uint64_t min_time[kVectorSizeCount+kStrangeVectorSizeCount] = {0}; size_t q; memset( min_time, -1, sizeof( min_time ) ); - vlog( "Testing vload%s_half\n", aligned ? "a" : "" ); - fflush( stdout ); const char *vector_size_names[] = {"1", "2", "4", "8", "16", "3"}; int minVectorSize = kMinVectorSize; @@ -301,8 +260,8 @@ int Test_vLoadHalf_private( cl_device_id device, bool aligned ) if(g_arrVecSizes[vectorSize] != 3) { - programs[vectorSize][0] = MakeProgram( device, source, sizeof( source) / sizeof( source[0]) ); - if( NULL == programs[ vectorSize ][0] ) { + programs[vectorSize][AS_Global] = MakeProgram( device, source, sizeof( source) / sizeof( source[0]) ); + if( NULL == programs[ vectorSize ][AS_Global] ) { gFailCount++; vlog_error( "\t\tFAILED -- Failed to create program.\n" ); for ( q= 0; q < sizeof( source) / sizeof( source[0]); q++) @@ -311,8 +270,8 @@ int Test_vLoadHalf_private( cl_device_id device, bool aligned ) } else { } } else if(aligned) { - programs[vectorSize][0] = MakeProgram( device, sourceV3aligned, sizeof( sourceV3aligned) / sizeof( sourceV3aligned[0]) ); - if( NULL == programs[ vectorSize ][0] ) { + programs[vectorSize][AS_Global] = MakeProgram( device, sourceV3aligned, sizeof( sourceV3aligned) / sizeof( sourceV3aligned[0]) ); + if( NULL == programs[ vectorSize ][AS_Global] ) { gFailCount++; vlog_error( "\t\tFAILED -- Failed to create program.\n" ); for ( q= 0; q < sizeof( sourceV3aligned) / sizeof( sourceV3aligned[0]); q++) @@ -321,8 +280,8 @@ int Test_vLoadHalf_private( cl_device_id device, bool aligned ) } else { } } else { - programs[vectorSize][0] = MakeProgram( device, sourceV3, sizeof( sourceV3) / sizeof( sourceV3[0]) ); - if( NULL == programs[ vectorSize ][0] ) { + programs[vectorSize][AS_Global] = MakeProgram( device, sourceV3, sizeof( sourceV3) / sizeof( sourceV3[0]) ); + if( NULL == programs[ vectorSize ][AS_Global] ) { gFailCount++; vlog_error( "\t\tFAILED -- Failed to create program.\n" ); for ( q= 0; q < sizeof( sourceV3) / sizeof( sourceV3[0]); q++) @@ -331,8 +290,8 @@ int Test_vLoadHalf_private( cl_device_id device, bool aligned ) } } - kernels[ vectorSize ][0] = clCreateKernel( programs[ vectorSize ][0], "test", &error ); - if( NULL == kernels[vectorSize][0] ) + kernels[ vectorSize ][AS_Global] = clCreateKernel( programs[ vectorSize ][AS_Global], "test", &error ); + if( NULL == kernels[vectorSize][AS_Global] ) { gFailCount++; vlog_error( "\t\tFAILED -- Failed to create kernel. (%d)\n", error ); @@ -356,8 +315,8 @@ int Test_vLoadHalf_private( cl_device_id device, bool aligned ) source_ptr = source_private2; source_size = sizeof( source_private2) / sizeof( source_private2[0]); } - programs[vectorSize][1] = MakeProgram( device, source_ptr, source_size ); - if( NULL == programs[ vectorSize ][1] ) + programs[vectorSize][AS_Private] = MakeProgram( device, source_ptr, source_size ); + if( NULL == programs[ vectorSize ][AS_Private] ) { gFailCount++; vlog_error( "\t\tFAILED -- Failed to create private program.\n" ); @@ -366,8 +325,8 @@ int Test_vLoadHalf_private( cl_device_id device, bool aligned ) return -1; } - kernels[ vectorSize ][1] = clCreateKernel( programs[ vectorSize ][1], "test", &error ); - if( NULL == kernels[vectorSize][1] ) + kernels[ vectorSize ][AS_Private] = clCreateKernel( programs[ vectorSize ][AS_Private], "test", &error ); + if( NULL == kernels[vectorSize][AS_Private] ) { gFailCount++; vlog_error( "\t\tFAILED -- Failed to create private kernel. (%d)\n", error ); @@ -389,8 +348,8 @@ int Test_vLoadHalf_private( cl_device_id device, bool aligned ) source_ptr = source_local2; source_size = sizeof( source_local2) / sizeof( source_local2[0]); } - programs[vectorSize][2] = MakeProgram( device, source_ptr, source_size ); - if( NULL == programs[ vectorSize ][2] ) + programs[vectorSize][AS_Local] = MakeProgram( device, source_ptr, source_size ); + if( NULL == programs[ vectorSize ][AS_Local] ) { gFailCount++; vlog_error( "\t\tFAILED -- Failed to create local program.\n" ); @@ -399,8 +358,8 @@ int Test_vLoadHalf_private( cl_device_id device, bool aligned ) return -1; } - kernels[ vectorSize ][2] = clCreateKernel( programs[ vectorSize ][2], "test", &error ); - if( NULL == kernels[vectorSize][2] ) + kernels[ vectorSize ][AS_Local] = clCreateKernel( programs[ vectorSize ][AS_Local], "test", &error ); + if( NULL == kernels[vectorSize][AS_Local] ) { gFailCount++; vlog_error( "\t\tFAILED -- Failed to create local kernel. (%d)\n", error ); @@ -409,8 +368,8 @@ int Test_vLoadHalf_private( cl_device_id device, bool aligned ) if(g_arrVecSizes[vectorSize] == 3) { if(aligned) { - programs[vectorSize][3] = MakeProgram( device, source_constantV3aligned, sizeof(source_constantV3aligned) / sizeof( source_constantV3aligned[0]) ); - if( NULL == programs[ vectorSize ][3] ) + programs[vectorSize][AS_Constant] = MakeProgram( device, source_constantV3aligned, sizeof(source_constantV3aligned) / sizeof( source_constantV3aligned[0]) ); + if( NULL == programs[ vectorSize ][AS_Constant] ) { gFailCount++; vlog_error( "\t\tFAILED -- Failed to create constant program.\n" ); @@ -419,8 +378,8 @@ int Test_vLoadHalf_private( cl_device_id device, bool aligned ) return -1; } } else { - programs[vectorSize][3] = MakeProgram( device, source_constantV3, sizeof(source_constantV3) / sizeof( source_constantV3[0]) ); - if( NULL == programs[ vectorSize ][3] ) + programs[vectorSize][AS_Constant] = MakeProgram( device, source_constantV3, sizeof(source_constantV3) / sizeof( source_constantV3[0]) ); + if( NULL == programs[ vectorSize ][AS_Constant] ) { gFailCount++; vlog_error( "\t\tFAILED -- Failed to create constant program.\n" ); @@ -430,8 +389,8 @@ int Test_vLoadHalf_private( cl_device_id device, bool aligned ) } } } else { - programs[vectorSize][3] = MakeProgram( device, source_constant, sizeof(source_constant) / sizeof( source_constant[0]) ); - if( NULL == programs[ vectorSize ][3] ) + programs[vectorSize][AS_Constant] = MakeProgram( device, source_constant, sizeof(source_constant) / sizeof( source_constant[0]) ); + if( NULL == programs[ vectorSize ][AS_Constant] ) { gFailCount++; vlog_error( "\t\tFAILED -- Failed to create constant program.\n" ); @@ -441,8 +400,8 @@ int Test_vLoadHalf_private( cl_device_id device, bool aligned ) } } - kernels[ vectorSize ][3] = clCreateKernel( programs[ vectorSize ][3], "test", &error ); - if( NULL == kernels[vectorSize][3] ) + kernels[ vectorSize ][AS_Constant] = clCreateKernel( programs[ vectorSize ][AS_Constant], "test", &error ); + if( NULL == kernels[vectorSize][AS_Constant] ) { gFailCount++; vlog_error( "\t\tFAILED -- Failed to create constant kernel. (%d)\n", error ); @@ -486,14 +445,13 @@ int Test_vLoadHalf_private( cl_device_id device, bool aligned ) //create the reference result const unsigned short *s = (const unsigned short *)gIn_half; float *d = (float *)gOut_single_reference; - for( j = 0; j < count; j++ ) - d[j] = half2float( s[j] ); + for (j = 0; j < count; j++) d[j] = cl_half_to_float(s[j]); //Check the vector lengths for( vectorSize = minVectorSize; vectorSize < kLastVectorSizeToTest; vectorSize++) { // here we loop through vector sizes, 3 is last - for ( addressSpace = 0; addressSpace < 4; addressSpace++) { + for ( addressSpace = 0; addressSpace < AS_NumAddressSpaces; addressSpace++) { uint32_t pattern = 0x7fffdead; /* @@ -590,7 +548,7 @@ int Test_vLoadHalf_private( cl_device_id device, bool aligned ) } } - vlog( "\tPassed\n" ); + vlog( "\n" ); if( gReportTimes ) { @@ -606,7 +564,7 @@ exit: //clean up for( vectorSize = minVectorSize; vectorSize < kLastVectorSizeToTest; vectorSize++) { - for ( addressSpace = 0; addressSpace < 3; addressSpace++) { + for ( addressSpace = 0; addressSpace < AS_NumAddressSpaces; addressSpace++) { clReleaseKernel( kernels[ vectorSize ][addressSpace] ); clReleaseProgram( programs[ vectorSize ][addressSpace] ); } diff --git a/test_conformance/half/Test_vStoreHalf.c b/test_conformance/half/Test_vStoreHalf.cpp similarity index 86% rename from test_conformance/half/Test_vStoreHalf.c rename to test_conformance/half/Test_vStoreHalf.cpp index 50269bb9..658694fa 100644 --- a/test_conformance/half/Test_vStoreHalf.c +++ b/test_conformance/half/Test_vStoreHalf.cpp @@ -13,15 +13,15 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/compat.h" +#include "harness/kernelHelpers.h" +#include "harness/testHarness.h" #include #include "cl_utils.h" #include "tests.h" -extern const char *addressSpaceNames[]; +#include typedef struct ComputeReferenceInfoF_ { @@ -210,406 +210,44 @@ CheckD(cl_uint jid, cl_uint tid, void *userInfo) return ret; } -static cl_ushort float2half_rte( float f ); -static cl_ushort float2half_rtz( float f ); -static cl_ushort float2half_rtp( float f ); -static cl_ushort float2half_rtn( float f ); -static cl_ushort double2half_rte( double f ); -static cl_ushort double2half_rtz( double f ); -static cl_ushort double2half_rtp( double f ); -static cl_ushort double2half_rtn( double f ); - -static cl_ushort -float2half_rte( float f ) +static cl_ushort float2half_rte(float f) { - union{ float f; cl_uint u; } u = {f}; - cl_uint sign = (u.u >> 16) & 0x8000; - float x = fabsf(f); - - //Nan - if( x != x ) - { - u.u >>= (24-11); - u.u &= 0x7fff; - u.u |= 0x0200; //silence the NaN - return u.u | sign; - } - - // overflow - if( x >= MAKE_HEX_FLOAT(0x1.ffep15f, 0x1ffeL, 3) ) - return 0x7c00 | sign; - - // underflow - if( x <= MAKE_HEX_FLOAT(0x1.0p-25f, 0x1L, -25) ) - return sign; // The halfway case can return 0x0001 or 0. 0 is even. - - // very small - if( x < MAKE_HEX_FLOAT(0x1.8p-24f, 0x18L, -28) ) - return sign | 1; - - // half denormal - if( x < MAKE_HEX_FLOAT(0x1.0p-14f, 0x1L, -14) ) - { - u.f = x * MAKE_HEX_FLOAT(0x1.0p-125f, 0x1L, -125); - return sign | u.u; - } - - u.f *= MAKE_HEX_FLOAT(0x1.0p13f, 0x1L, 13); - u.u &= 0x7f800000; - x += u.f; - u.f = x - u.f; - u.f *= MAKE_HEX_FLOAT(0x1.0p-112f, 0x1L, -112); - - return (u.u >> (24-11)) | sign; + return cl_half_from_float(f, CL_HALF_RTE); } -static cl_ushort -float2half_rtz( float f ) +static cl_ushort float2half_rtz(float f) { - union{ float f; cl_uint u; } u = {f}; - cl_uint sign = (u.u >> 16) & 0x8000; - float x = fabsf(f); - - //Nan - if( x != x ) - { - u.u >>= (24-11); - u.u &= 0x7fff; - u.u |= 0x0200; //silence the NaN - return u.u | sign; - } - - // overflow - if( x >= MAKE_HEX_FLOAT(0x1.0p16f, 0x1L, 16) ) - { - if( x == INFINITY ) - return 0x7c00 | sign; - - return 0x7bff | sign; - } - - // underflow - if( x < MAKE_HEX_FLOAT(0x1.0p-24f, 0x1L, -24) ) - return sign; // The halfway case can return 0x0001 or 0. 0 is even. - - // half denormal - if( x < MAKE_HEX_FLOAT(0x1.0p-14f, 0x1L, -14) ) - { - x *= MAKE_HEX_FLOAT(0x1.0p24f, 0x1L, 24); - return (cl_ushort)((int) x | sign); - } - - u.u &= 0xFFFFE000U; - u.u -= 0x38000000U; - - return (u.u >> (24-11)) | sign; + return cl_half_from_float(f, CL_HALF_RTZ); } -static cl_ushort -float2half_rtp( float f ) +static cl_ushort float2half_rtp(float f) { - union{ float f; cl_uint u; } u = {f}; - cl_uint sign = (u.u >> 16) & 0x8000; - float x = fabsf(f); - - //Nan - if( x != x ) - { - u.u >>= (24-11); - u.u &= 0x7fff; - u.u |= 0x0200; //silence the NaN - return u.u | sign; - } - - // overflow - if( f > MAKE_HEX_FLOAT(0x1.ffcp15f, 0x1ffcL, 3) ) - return 0x7c00; - - if( f <= MAKE_HEX_FLOAT(-0x1.0p16f, -0x1L, 16) ) - { - if( f == -INFINITY ) - return 0xfc00; - - return 0xfbff; - } - - // underflow - if( x < MAKE_HEX_FLOAT(0x1.0p-24f, 0x1L, -24) ) - { - if( f > 0 ) - return 1; - return sign; - } - - // half denormal - if( x < MAKE_HEX_FLOAT(0x1.0p-14f, 0x1L, -14) ) - { - x *= MAKE_HEX_FLOAT(0x1.0p24f, 0x1L, 24); - int r = (int) x; - r += (float) r != x && f > 0.0f; - - return (cl_ushort)( r | sign); - } - - float g = u.f; - u.u &= 0xFFFFE000U; - if( g > u.f ) - u.u += 0x00002000U; - u.u -= 0x38000000U; - - return (u.u >> (24-11)) | sign; + return cl_half_from_float(f, CL_HALF_RTP); } - -static cl_ushort -float2half_rtn( float f ) +static cl_ushort float2half_rtn(float f) { - union{ float f; cl_uint u; } u = {f}; - cl_uint sign = (u.u >> 16) & 0x8000; - float x = fabsf(f); - - //Nan - if( x != x ) - { - u.u >>= (24-11); - u.u &= 0x7fff; - u.u |= 0x0200; //silence the NaN - return u.u | sign; - } - - // overflow - if( f >= MAKE_HEX_FLOAT(0x1.0p16f, 0x1L, 16) ) - { - if( f == INFINITY ) - return 0x7c00; - - return 0x7bff; - } - - if( f < MAKE_HEX_FLOAT(-0x1.ffcp15f, -0x1ffcL, 3) ) - return 0xfc00; - - // underflow - if( x < MAKE_HEX_FLOAT(0x1.0p-24f, 0x1L, -24) ) - { - if( f < 0 ) - return 0x8001; - return sign; - } - - // half denormal - if( x < MAKE_HEX_FLOAT(0x1.0p-14f, 0x1L, -14) ) - { - x *= MAKE_HEX_FLOAT(0x1.0p24f, 0x1L, 24); - int r = (int) x; - r += (float) r != x && f < 0.0f; - - return (cl_ushort)( r | sign); - } - - u.u &= 0xFFFFE000U; - if( u.f > f ) - u.u += 0x00002000U; - u.u -= 0x38000000U; - - return (u.u >> (24-11)) | sign; + return cl_half_from_float(f, CL_HALF_RTN); } -static cl_ushort -double2half_rte( double f ) +static cl_ushort double2half_rte(double f) { - union{ double f; cl_ulong u; } u = {f}; - cl_ulong sign = (u.u >> 48) & 0x8000; - double x = fabs(f); - - //Nan - if( x != x ) - { - u.u >>= (53-11); - u.u &= 0x7fff; - u.u |= 0x0200; //silence the NaN - return u.u | sign; - } - - // overflow - if( x >= MAKE_HEX_DOUBLE(0x1.ffep15, 0x1ffeLL, 3) ) - return 0x7c00 | sign; - - // underflow - if( x <= MAKE_HEX_DOUBLE(0x1.0p-25, 0x1LL, -25) ) - return sign; // The halfway case can return 0x0001 or 0. 0 is even. - - // very small - if( x < MAKE_HEX_DOUBLE(0x1.8p-24, 0x18LL, -28) ) - return sign | 1; - - // half denormal - if( x < MAKE_HEX_DOUBLE(0x1.0p-14, 0x1LL, -14) ) - { - u.f = x * MAKE_HEX_DOUBLE(0x1.0p-1050, 0x1LL, -1050); - return sign | u.u; - } - - u.f *= MAKE_HEX_DOUBLE(0x1.0p42, 0x1LL, 42); - u.u &= 0x7ff0000000000000ULL; - x += u.f; - u.f = x - u.f; - u.f *= MAKE_HEX_DOUBLE(0x1.0p-1008, 0x1LL, -1008); - - return (u.u >> (53-11)) | sign; + return cl_half_from_double(f, CL_HALF_RTE); } -static cl_ushort -double2half_rtz( double f ) +static cl_ushort double2half_rtz(double f) { - union{ double f; cl_ulong u; } u = {f}; - cl_ulong sign = (u.u >> 48) & 0x8000; - double x = fabs(f); - - //Nan - if( x != x ) - { - u.u >>= (53-11); - u.u &= 0x7fff; - u.u |= 0x0200; //silence the NaN - return u.u | sign; - } - - if( x == INFINITY ) - return 0x7c00 | sign; - - // overflow - if( x >= MAKE_HEX_DOUBLE(0x1.0p16, 0x1LL, 16) ) - return 0x7bff | sign; - - // underflow - if( x < MAKE_HEX_DOUBLE(0x1.0p-24, 0x1LL, -24) ) - return sign; // The halfway case can return 0x0001 or 0. 0 is even. - - // half denormal - if( x < MAKE_HEX_DOUBLE(0x1.0p-14, 0x1LL, -14) ) - { - x *= MAKE_HEX_FLOAT(0x1.0p24f, 0x1L, 24); - return (cl_ushort)((int) x | sign); - } - - u.u &= 0xFFFFFC0000000000ULL; - u.u -= 0x3F00000000000000ULL; - - return (u.u >> (53-11)) | sign; + return cl_half_from_double(f, CL_HALF_RTZ); } -static cl_ushort -double2half_rtp( double f ) +static cl_ushort double2half_rtp(double f) { - union{ double f; cl_ulong u; } u = {f}; - cl_ulong sign = (u.u >> 48) & 0x8000; - double x = fabs(f); - - //Nan - if( x != x ) - { - u.u >>= (53-11); - u.u &= 0x7fff; - u.u |= 0x0200; //silence the NaN - return u.u | sign; - } - - // overflow - if( f > MAKE_HEX_DOUBLE(0x1.ffcp15, 0x1ffcLL, 3) ) - return 0x7c00; - - if( f <= MAKE_HEX_DOUBLE(-0x1.0p16, -0x1LL, 16) ) - { - if( f == -INFINITY ) - return 0xfc00; - - return 0xfbff; - } - - // underflow - if( x < MAKE_HEX_DOUBLE(0x1.0p-24, 0x1LL, -24) ) - { - if( f > 0 ) - return 1; - return sign; - } - - // half denormal - if( x < MAKE_HEX_DOUBLE(0x1.0p-14, 0x1LL, -14) ) - { - x *= MAKE_HEX_FLOAT(0x1.0p24f, 0x1L, 24); - int r = (int) x; - if( 0 == sign ) - r += (double) r != x; - - return (cl_ushort)( r | sign); - } - - double g = u.f; - u.u &= 0xFFFFFC0000000000ULL; - if( g != u.f && 0 == sign) - u.u += 0x0000040000000000ULL; - u.u -= 0x3F00000000000000ULL; - - return (u.u >> (53-11)) | sign; + return cl_half_from_double(f, CL_HALF_RTP); } - -static cl_ushort -double2half_rtn( double f ) +static cl_ushort double2half_rtn(double f) { - union{ double f; cl_ulong u; } u = {f}; - cl_ulong sign = (u.u >> 48) & 0x8000; - double x = fabs(f); - - //Nan - if( x != x ) - { - u.u >>= (53-11); - u.u &= 0x7fff; - u.u |= 0x0200; //silence the NaN - return u.u | sign; - } - - // overflow - if( f >= MAKE_HEX_DOUBLE(0x1.0p16, 0x1LL, 16) ) - { - if( f == INFINITY ) - return 0x7c00; - - return 0x7bff; - } - - if( f < MAKE_HEX_DOUBLE(-0x1.ffcp15, -0x1ffcLL, 3) ) - return 0xfc00; - - // underflow - if( x < MAKE_HEX_DOUBLE(0x1.0p-24, 0x1LL, -24) ) - { - if( f < 0 ) - return 0x8001; - return sign; - } - - // half denormal - if( x < MAKE_HEX_DOUBLE(0x1.0p-14, 0x1LL, -14) ) - { - x *= MAKE_HEX_DOUBLE(0x1.0p24, 0x1LL, 24); - int r = (int) x; - if( sign ) - r += (double) r != x; - - return (cl_ushort)( r | sign); - } - - double g = u.f; - u.u &= 0xFFFFFC0000000000ULL; - if( g < u.f && sign) - u.u += 0x0000040000000000ULL; - u.u -= 0x3F00000000000000ULL; - - return (u.u >> (53-11)) | sign; + return cl_half_from_double(f, CL_HALF_RTN); } int test_vstore_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ) @@ -695,9 +333,6 @@ int Test_vStoreHalf_private( cl_device_id device, f2h referenceFunc, d2h doubleR uint64_t min_double_time[kVectorSizeCount+kStrangeVectorSizeCount] = {0}; memset( min_double_time, -1, sizeof( min_double_time ) ); - vlog( "Testing vstore_half%s\n", roundName ); - fflush( stdout ); - bool aligned= false; for( vectorSize = kMinVectorSize; vectorSize < kLastVectorSizeToTest; vectorSize++) @@ -1288,22 +923,6 @@ int Test_vStoreHalf_private( cl_device_id device, f2h referenceFunc, d2h doubleR } } - if( 0 == gFailCount ) - { - if( gWimpyMode ) - { - vlog( "\tfloat: Wimp Passed\n" ); - if( gTestDouble ) - vlog( "\tdouble: Wimp Passed\n" ); - } - else - { - vlog( "\tfloat Passed\n" ); - if( gTestDouble ) - vlog( "\tdouble Passed\n" ); - } - } - if( gReportTimes ) { for( vectorSize = kMinVectorSize; vectorSize < kLastVectorSizeToTest; vectorSize++) @@ -1358,9 +977,6 @@ int Test_vStoreaHalf_private( cl_device_id device, f2h referenceFunc, d2h double bool aligned = true; - vlog( "Testing vstorea_half%s\n", roundName ); - fflush( stdout ); - int minVectorSize = kMinVectorSize; // There is no aligned scalar vstorea_half if( 0 == minVectorSize ) @@ -1893,20 +1509,6 @@ int Test_vStoreaHalf_private( cl_device_id device, f2h referenceFunc, d2h double } } - if( gWimpyMode ) - { - vlog( "\tfloat: Wimp Passed\n" ); - - if( gTestDouble ) - vlog( "\tdouble: Wimp Passed\n" ); - } - else - { - vlog( "\tfloat Passed\n" ); - if( gTestDouble ) - vlog( "\tdouble Passed\n" ); - } - if( gReportTimes ) { for( vectorSize = minVectorSize; vectorSize < kLastVectorSizeToTest; vectorSize++) diff --git a/test_conformance/half/cl_utils.c b/test_conformance/half/cl_utils.cpp similarity index 92% rename from test_conformance/half/cl_utils.c rename to test_conformance/half/cl_utils.cpp index 7875f1d7..68f7b9cd 100644 --- a/test_conformance/half/cl_utils.c +++ b/test_conformance/half/cl_utils.cpp @@ -22,9 +22,9 @@ #include "test_config.h" #include "string.h" -#include "../../test_common/harness/kernelHelpers.h" +#include "harness/kernelHelpers.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" #define HALF_MIN 1.0p-14 @@ -58,7 +58,6 @@ uint32_t gDeviceFrequency = 0; uint32_t gComputeDevices = 0; size_t gMaxThreadGroupSize = 0; size_t gWorkGroupSize = 0; -int gFailCount = 0; bool gWimpyMode = false; int gWimpyReductionFactor = 512; int gTestDouble = 0; @@ -96,31 +95,9 @@ test_status InitCL( cl_device_id device ) gDeviceFrequency = 1; // Check extensions - size_t extSize = 0; - int hasDouble = 0; - if((error = clGetDeviceInfo( device, CL_DEVICE_EXTENSIONS, 0, NULL, &extSize))) - { vlog_error( "Unable to get device extension string to see if double present. (%d) \n", error ); } - else - { - char *ext = (char *)malloc( extSize ); - if( NULL == ext ) - { vlog_error( "malloc failed at %s:%d\nUnable to determine if double present.\n", __FILE__, __LINE__ ); } - else - { - if((error = clGetDeviceInfo( device, CL_DEVICE_EXTENSIONS, extSize, ext, NULL))) - { vlog_error( "Unable to get device extension string to see if double present. (%d) \n", error ); } - else - { - if( strstr( ext, "cl_khr_fp64" )) - hasDouble = 1; - } - free(ext); - } - } + int hasDouble = is_extension_available(device, "cl_khr_fp64"); gTestDouble ^= hasDouble; - - //detect whether profile of the device is embedded char profile[64] = ""; if( (error = clGetDeviceInfo( device, CL_DEVICE_PROFILE, sizeof(profile), profile, NULL ) ) ) @@ -142,10 +119,10 @@ test_status InitCL( cl_device_id device ) return TEST_FAIL; } - gQueue = clCreateCommandQueueWithProperties(gContext, device, 0, &error); + gQueue = clCreateCommandQueue(gContext, device, 0, &error); if( NULL == gQueue ) { - vlog_error( "clCreateContext failed. (%d)\n", error ); + vlog_error( "clCreateCommandQueue failed. (%d)\n", error ); return TEST_FAIL; } diff --git a/test_conformance/half/cl_utils.h b/test_conformance/half/cl_utils.h index 7df9e9a6..50d8af3d 100644 --- a/test_conformance/half/cl_utils.h +++ b/test_conformance/half/cl_utils.h @@ -16,8 +16,9 @@ #ifndef CL_UTILS_H #define CL_UTILS_H -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/compat.h" +#include "harness/testHarness.h" +#include "harness/compat.h" +#include "harness/conversions.h" #include @@ -29,9 +30,9 @@ #ifdef __MINGW32__ #define __mingw_printf printf #endif -#include "../../test_common/harness/errorHelpers.h" +#include "harness/errorHelpers.h" -#include "../../test_common/harness/ThreadPool.h" +#include "harness/ThreadPool.h" @@ -66,7 +67,6 @@ extern uint32_t gDeviceFrequency; extern uint32_t gComputeDevices; extern size_t gMaxThreadGroupSize; extern size_t gWorkGroupSize; -extern int gFailCount; extern int gTestDouble; extern int gReportTimes; @@ -94,9 +94,6 @@ void ReleaseCL( void ); int RunKernel( cl_device_id device, cl_kernel kernel, void *inBuf, void *outBuf, uint32_t blockCount , int extraArg); cl_program MakeProgram( cl_device_id device, const char *source[], int count ); -#define STRING( _x ) STRINGIFY( _x ) -#define STRINGIFY(x) #x - static inline float as_float(cl_uint u) { union { cl_uint u; float f; }v; v.u = u; return v.f; } static inline double as_double(cl_ulong u) { union { cl_ulong u; double d; }v; v.u = u; return v.d; } @@ -113,42 +110,6 @@ static inline cl_ulong DoubleFromUInt( cl_uint bits ) return u; } -static inline int IsHalfSubnormal( uint16_t x ) -{ - return ((x&0x7fffU)-1U) < 0x03ffU; -} - -// prevent silent failures due to missing FLT_RADIX -#ifndef FLT_RADIX - #error FLT_RADIX is not defined by float.h -#endif - -static inline int IsFloatSubnormal( double x ) -{ -#if 2 == FLT_RADIX - // Do this in integer to avoid problems with FTZ behavior - union{ float d; uint32_t u;}u; - u.d = fabsf((float) x); - return (u.u-1) < 0x007fffffU; -#else - // rely on floating point hardware for non-radix2 non-IEEE-754 hardware -- will fail if you flush subnormals to zero - return fabs(x) < (double) FLT_MIN && x != 0.0; -#endif -} - -static inline int IsDoubleSubnormal( long double x ) -{ -#if 2 == FLT_RADIX - // Do this in integer to avoid problems with FTZ behavior - union{ double d; uint64_t u;}u; - u.d = fabs((double)x); - return (u.u-1) < 0x000fffffffffffffULL; -#else - // rely on floating point hardware for non-radix2 non-IEEE-754 hardware -- will fail if you flush subnormals to zero - return fabs(x) < (double) DBL_MIN && x != 0.0; -#endif -} - #endif /* CL_UTILS_H */ diff --git a/test_conformance/half/main.c b/test_conformance/half/main.cpp similarity index 84% rename from test_conformance/half/main.c rename to test_conformance/half/main.cpp index a68b5f9e..6600cc58 100644 --- a/test_conformance/half/main.c +++ b/test_conformance/half/main.cpp @@ -19,16 +19,16 @@ #if !defined (_WIN32) #include -#if !defined(__ANDROID__) +#if defined(__APPLE__) #include #endif #include #include #endif -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/mingw_compat.h" -#include "../../test_common/harness/parseParameters.h" +#include "harness/testHarness.h" +#include "harness/mingw_compat.h" +#include "harness/parseParameters.h" #if defined (__MINGW32__) #include #endif @@ -39,7 +39,7 @@ const char ** argList = NULL; size_t argCount = 0; char appName[64] = "ctest"; -const char *addressSpaceNames[] = {"global", "private", "local", "constant"}; +const char *addressSpaceNames[AS_NumAddressSpaces] = {"global", "private", "local", "constant"}; #pragma mark - #pragma mark Declarations @@ -47,7 +47,6 @@ const char *addressSpaceNames[] = {"global", "private", "local", "constant"}; static int ParseArgs( int argc, const char **argv ); static void PrintUsage( void ); -static void PrintArch(void); int g_arrVecSizes[kVectorSizeCount+kStrangeVectorSizeCount]; @@ -96,7 +95,6 @@ int main (int argc, const char **argv ) argc = parseCustomParam(argc, argv); if (argc == -1) { - test_finish(); return -1; } @@ -111,7 +109,7 @@ int main (int argc, const char **argv ) } fflush( stdout ); - error = runTestHarnessWithCheck( argCount, argList, test_num, test_list, false, true, 0, InitCL ); + error = runTestHarnessWithCheck( argCount, argList, test_num, test_list, true, 0, InitCL ); exit: if(gQueue) @@ -123,11 +121,6 @@ exit: } } - if(gFailCount > 0) - { - vlog_error("FAILED %d sub-tests.\n", gFailCount); - } - ReleaseCL(); return error; } @@ -256,33 +249,3 @@ static void PrintUsage( void ) } } -static void PrintArch( void ) -{ - vlog( "sizeof( void*) = %ld\n", sizeof( void *) ); - -#if defined( __APPLE__ ) -#if defined( __ppc__ ) - vlog( "ARCH:\tppc\n" ); -#elif defined( __ppc64__ ) - vlog( "ARCH:\tppc64\n" ); -#elif defined( __i386__ ) - vlog( "ARCH:\ti386\n" ); -#elif defined( __x86_64__ ) - vlog( "ARCH:\tx86_64\n" ); -#elif defined( __arm__ ) - vlog( "ARCH:\tarm\n" ); -#elif defined( __aarch64__ ) - vlog( "\tARCH:\taarch64\n" ); -#else -#error unknown arch -#endif - - int type = 0; - size_t typeSize = sizeof( type ); - sysctlbyname( "hw.cputype", &type, &typeSize, NULL, 0 ); - vlog( "cpu type:\t%d\n", type ); - typeSize = sizeof( type ); - sysctlbyname( "hw.cpusubtype", &type, &typeSize, NULL, 0 ); - vlog( "cpu subtype:\t%d\n", type ); -#endif -} diff --git a/test_conformance/half/test_config.h b/test_conformance/half/test_config.h index a81f429d..8452fab6 100644 --- a/test_conformance/half/test_config.h +++ b/test_conformance/half/test_config.h @@ -16,6 +16,8 @@ #ifndef TEST_CONFIG_H #define TEST_CONFIG_H +#include + #define MULTITHREAD 1 #define kVectorSizeCount 5 diff --git a/test_conformance/half/tests.h b/test_conformance/half/tests.h index be1c28e4..a8b8328f 100644 --- a/test_conformance/half/tests.h +++ b/test_conformance/half/tests.h @@ -16,6 +16,19 @@ #ifndef TESTS_H #define TESTS_H +#include + +typedef enum +{ + AS_Global, + AS_Private, + AS_Local, + AS_Constant, + AS_NumAddressSpaces +} AddressSpaceEnum; + +extern const char *addressSpaceNames[AS_NumAddressSpaces]; + int test_vload_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); int test_vloada_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); diff --git a/test_conformance/headers/CMakeLists.txt b/test_conformance/headers/CMakeLists.txt deleted file mode 100644 index 46705e6b..00000000 --- a/test_conformance/headers/CMakeLists.txt +++ /dev/null @@ -1,102 +0,0 @@ -set(HEADERS_SOURCES - test_headers.c - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c -) - -set_source_files_properties(${HEADERS_SOURCES} PROPERTIES LANGUAGE CXX) - -set(HEADERS_OUT ${CONFORMANCE_PREFIX}headers${CONFORMANCE_SUFFIX}) - -add_executable( - ${HEADERS_OUT} - ${HEADERS_SOURCES} -) - -set_property(TARGET ${HEADERS_OUT} PROPERTY FOLDER "CONFORMANCE${CONFORMANCE_SUFFIX}") - -TARGET_LINK_LIBRARIES(${HEADERS_OUT} ${CLConform_LIBRARIES}) - -######################################################################################## - -set(CL_H_SOURCES - test_cl.h.c -) - -set_source_files_properties(${CL_H_SOURCES} PROPERTIES LANGUAGE CXX) - -set(CL_H_OUT ${CONFORMANCE_PREFIX}cl_h${CONFORMANCE_SUFFIX}) - -add_executable( - ${CL_H_OUT} - ${CL_H_SOURCES} -) - -set_property(TARGET ${CL_H_OUT} PROPERTY FOLDER "CONFORMANCE${CONFORMANCE_SUFFIX}") - -TARGET_LINK_LIBRARIES(${CL_H_OUT} ${CLConform_LIBRARIES}) - -######################################################################################## - -set(CL_PLATFORM_H_SOURCES - test_cl_platform.h.c -) - -set_source_files_properties(${CL_PLATFORM_H_SOURCES} PROPERTIES LANGUAGE CXX) - -set(CL_PLATFORM_H_OUT ${CONFORMANCE_PREFIX}cl_platform_h${CONFORMANCE_SUFFIX}) - -add_executable( - ${CL_PLATFORM_H_OUT} - ${CL_PLATFORM_H_SOURCES} -) - -set_property(TARGET ${CL_PLATFORM_H_OUT} PROPERTY FOLDER "CONFORMANCE${CONFORMANCE_SUFFIX}") - -TARGET_LINK_LIBRARIES(${CL_PLATFORM_H_OUT} ${CLConform_LIBRARIES}) - -######################################################################################## - -set(CL_GL_H_SOURCES - test_cl_gl.h.c -) - -set_source_files_properties(${CL_GL_H_SOURCES} PROPERTIES LANGUAGE CXX) - -set(CL_GL_H_OUT ${CONFORMANCE_PREFIX}cl_gl_h${CONFORMANCE_SUFFIX}) - -add_executable( - ${CL_GL_H_OUT} - ${CL_GL_H_SOURCES} -) - -set_property(TARGET ${CL_GL_H_OUT} PROPERTY FOLDER "CONFORMANCE${CONFORMANCE_SUFFIX}") - -TARGET_LINK_LIBRARIES(${CL_GL_H_OUT} ${CLConform_LIBRARIES}) - -######################################################################################## - -set(OPENCL_H_SOURCES - test_opencl.h.c -) - -set_source_files_properties(${OPENCL_H_SOURCES} PROPERTIES LANGUAGE CXX) - -set(OPENCL_H_OUT ${CONFORMANCE_PREFIX}opencl_h${CONFORMANCE_SUFFIX}) - -add_executable( - ${OPENCL_H_OUT} - ${OPENCL_H_SOURCES} -) - -set_property(TARGET ${OPENCL_H_OUT} PROPERTY FOLDER "CONFORMANCE${CONFORMANCE_SUFFIX}") - -TARGET_LINK_LIBRARIES(${OPENCL_H_OUT} ${CLConform_LIBRARIES}) - -######################################################################################## - -# end of file # diff --git a/test_conformance/headers/README.txt b/test_conformance/headers/README.txt deleted file mode 100644 index 52bfea7a..00000000 --- a/test_conformance/headers/README.txt +++ /dev/null @@ -1,26 +0,0 @@ -test_conformance/headers README -=============================== - -The test_headers.c test is designed to make sure that the various -cl_typen types work and conform to expectation for recent versions -of cl_platform.h. Conforming to these expectations make use of -these types practical for developers writing portable code. - -The various tests ending in .h.c are there to verify that the various -OpenCL headers can compile stand alone. That is to ensure that they -may be used a la carte. This provides developers a lifeline in the case -that some unneeded part of OpenCL (e.g. cl/gl sharing) brings in a pile -of symbols (e.g. all of OpenGL) that collides with other headers needed -by the application. It is also poor form to require headers to be -included in a particular order, especially if multiple systems require -they be included in mutually incompatible order. So, here we require -that each header can be used standalone so that the order is irrelevant. - -In the .h.c tests, we also check to make sure that the headers don't -cause spurious warnings. These tests are intended to be compiled using -the most stringent compiler flags available for the platform, within -reason. All warnings should be errors and extra warnings that it is -expected developers are likely to use should be turned on. The current -Makefile includes such flags for a GCC compiler. Implementors are -expected to modify these flags and make system as necessary to conform -to the local build environment. diff --git a/test_conformance/headers/test_cl.h.c b/test_conformance/headers/test_cl.h.c deleted file mode 100644 index 1fabcba9..00000000 --- a/test_conformance/headers/test_cl.h.c +++ /dev/null @@ -1,27 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#if defined( __APPLE__ ) - #include -#else - #include -#endif -#include - -int main( void ) -{ - printf("cl.h standalone test PASSED.\n"); - return 0; -} diff --git a/test_conformance/headers/test_cl_gl.h.c b/test_conformance/headers/test_cl_gl.h.c deleted file mode 100644 index d20dfc07..00000000 --- a/test_conformance/headers/test_cl_gl.h.c +++ /dev/null @@ -1,27 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#if defined( __APPLE__ ) - #include -#else - #include -#endif -#include - -int main( void ) -{ - printf("cl_gl.h standalone test PASSED.\n"); - return 0; -} diff --git a/test_conformance/headers/test_cl_platform.h.c b/test_conformance/headers/test_cl_platform.h.c deleted file mode 100644 index 7fdd6ff7..00000000 --- a/test_conformance/headers/test_cl_platform.h.c +++ /dev/null @@ -1,27 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#if defined( __APPLE__ ) - #include -#else - #include -#endif -#include - -int main( void ) -{ - printf("cl_platform.h standalone test PASSED.\n"); - return 0; -} diff --git a/test_conformance/headers/test_headers.c b/test_conformance/headers/test_headers.c deleted file mode 100644 index 9d40a9fc..00000000 --- a/test_conformance/headers/test_headers.c +++ /dev/null @@ -1,659 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#if defined( __APPLE__ ) - #include -#else - #include -#endif -#include -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/testHarness.h" - - -int test_char( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); -int test_uchar(cl_device_id deviceID , cl_context context, cl_command_queue queue, int num_elements); -int test_short( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); -int test_ushort( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); -int test_int( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); -int test_uint( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); -int test_long( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); -int test_ulong( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); -int test_float( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); -int test_double( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); - -int test_char( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ) -{ -/* char */ - /* Constructor */ - cl_char a = 0; - cl_char2 a2 = {{ 0, 1 }}; - cl_char4 a4 = {{ 0, 1, 2, 3 }}; - cl_char8 a8 = {{ 0, 1, 2, 3, 4, 5, 6, 7 }}; - cl_char16 a16 = {{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }}; - - /* assignment */ - cl_char b = a; - cl_char2 b2 = a2; - cl_char4 b4 = a4; - cl_char8 b8 = a8; - cl_char16 b16 = a16; - - log_info("\nVerifying assignment:\n" ); - log_info("b: %d\n", b ); - log_info("b2: %d %d \n", b2.s[0], b2.s[1] ); - log_info("b4: %d %d %d %d\n", b4.s[0], b4.s[1], b4.s[2], b4.s[3] ); - log_info("b8: %d %d %d %d %d %d %d %d\n", b8.s[0], b8.s[1], b8.s[2], b8.s[3], b8.s[4], b8.s[5], b8.s[6], b8.s[7] ); - log_info("b16: %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n", b16.s[0], b16.s[1], b16.s[2], b16.s[3], b16.s[4], b16.s[5], b16.s[6], b16.s[7], - b16.s[8], b16.s[9], b16.s[10], b16.s[11], b16.s[12], b16.s[13], b16.s[14], b16.s[15]); - - /* vector access */ - log_info("\nVerifying vector access:\n" ); -#if defined( __CL_CHAR2__ ) - __cl_char2 v2 = b2.v2; - log_info("__cl_char2: %d %d \n", ((cl_char*)&v2)[0], ((cl_char*)&v2)[1] ); -#else - log_info( "__cl_char2 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_CHAR4__ ) - __cl_char4 v4 = b4.v4; - log_info("__cl_char4: %d %d %d %d \n", ((cl_char*)&v4)[0], ((cl_char*)&v4)[1], ((cl_char*)&v4)[2], ((cl_char*)&v4)[3] ); -#else - log_info( "__cl_char4 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_CHAR8__ ) - __cl_char8 v8 = b8.v8; - log_info("__cl_char8: %d %d %d %d %d %d %d %d \n", ((cl_char*)&v8)[0], ((cl_char*)&v8)[1], ((cl_char*)&v8)[2], ((cl_char*)&v8)[3], ((cl_char*)&v8)[4], ((cl_char*)&v8)[5], ((cl_char*)&v8)[6], ((cl_char*)&v8)[7] ); -#else - log_info( "__cl_char8 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_CHAR16__ ) - __cl_char16 v16 = b16.v16; - log_info("__cl_char16: %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d \n", ((cl_char*)&v16)[0], ((cl_char*)&v16)[1], ((cl_char*)&v16)[2], ((cl_char*)&v16)[3], ((cl_char*)&v16)[4], ((cl_char*)&v16)[5], ((cl_char*)&v16)[6], ((cl_char*)&v16)[7], - ((cl_char*)&v16)[8], ((cl_char*)&v16)[9], ((cl_char*)&v16)[10], ((cl_char*)&v16)[11], ((cl_char*)&v16)[12], ((cl_char*)&v16)[13], ((cl_char*)&v16)[14], ((cl_char*)&v16)[15]); -#else - log_info( "__cl_char16 SIMD vectors not supported on this architecture.\n" ); -#endif - - log_info( "\n" ); - return 0; -} - -int test_uchar( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ) -{ -/* uchar */ - /* Constructor */ - cl_uchar a = 0; - cl_uchar2 a2 = {{ 0, 1 }}; - cl_uchar4 a4 = {{ 0, 1, 2, 3 }}; - cl_uchar8 a8 = {{ 0, 1, 2, 3, 4, 5, 6, 7 }}; - cl_uchar16 a16 = {{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }}; - - /* assignment */ - cl_uchar b = a; - cl_uchar2 b2 = a2; - cl_uchar4 b4 = a4; - cl_uchar8 b8 = a8; - cl_uchar16 b16 = a16; - - log_info("\nVerifying assignment:\n" ); - log_info("b: %d\n", b ); - log_info("b2: %d %d \n", b2.s[0], b2.s[1] ); - log_info("b4: %d %d %d %d\n", b4.s[0], b4.s[1], b4.s[2], b4.s[3] ); - log_info("b8: %d %d %d %d %d %d %d %d\n", b8.s[0], b8.s[1], b8.s[2], b8.s[3], b8.s[4], b8.s[5], b8.s[6], b8.s[7] ); - log_info("b16: %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n", b16.s[0], b16.s[1], b16.s[2], b16.s[3], b16.s[4], b16.s[5], b16.s[6], b16.s[7], - b16.s[8], b16.s[9], b16.s[10], b16.s[11], b16.s[12], b16.s[13], b16.s[14], b16.s[15]); - - /* vector access */ - log_info("\nVerifying vector access:\n" ); -#if defined( __CL_UCHAR2__ ) - __cl_uchar2 v2 = b2.v2; - log_info("__cl_uchar2: %d %d \n", ((uchar*)&v2)[0], ((cl_uchar*)&v2)[1] ); -#else - log_info( "__cl_uchar2 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_UCHAR4__ ) - __cl_uchar4 v4 = b4.v4; - log_info("__cl_uchar4: %d %d %d %d \n", ((uchar*)&v4)[0], ((cl_uchar*)&v4)[1], ((cl_uchar*)&v4)[2], ((cl_uchar*)&v4)[3] ); -#else - log_info( "__cl_uchar4 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_UCHAR8__ ) - __cl_uchar8 v8 = b8.v8; - log_info("__cl_uchar8: %d %d %d %d %d %d %d %d \n", ((cl_uchar*)&v8)[0], ((cl_uchar*)&v8)[1], ((cl_uchar*)&v8)[2], ((cl_uchar*)&v8)[3], ((cl_uchar*)&v8)[4], ((cl_uchar*)&v8)[5], ((cl_uchar*)&v8)[6], ((cl_uchar*)&v8)[7] ); -#else - log_info( "__cl_uchar8 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_UCHAR16__ ) - __cl_uchar16 v16 = b16.v16; - log_info("__cl_uchar16: %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d \n", ((cl_uchar*)&v16)[0], ((cl_uchar*)&v16)[1], ((cl_uchar*)&v16)[2], ((cl_uchar*)&v16)[3], ((cl_uchar*)&v16)[4], ((cl_uchar*)&v16)[5], ((cl_uchar*)&v16)[6], ((cl_uchar*)&v16)[7], - ((cl_uchar*)&v16)[8], ((cl_uchar*)&v16)[9], ((cl_uchar*)&v16)[10], ((cl_uchar*)&v16)[11], ((cl_uchar*)&v16)[12], ((cl_uchar*)&v16)[13], ((cl_uchar*)&v16)[14], ((cl_uchar*)&v16)[15]); -#else - log_info( "__cl_uchar16 SIMD vectors not supported on this architecture.\n" ); -#endif - - log_info( "\n" ); - return 0; -} - -int test_short( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ) -{ -/* short */ - /* Constructor */ - cl_short a = 0; - cl_short2 a2 = {{ 0, 1 }}; - cl_short4 a4 = {{ 0, 1, 2, 3 }}; - cl_short8 a8 = {{ 0, 1, 2, 3, 4, 5, 6, 7 }}; - cl_short16 a16 = {{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }}; - - /* assignment */ - cl_short b = a; - cl_short2 b2 = a2; - cl_short4 b4 = a4; - cl_short8 b8 = a8; - cl_short16 b16 = a16; - - log_info("\nVerifying assignment:\n" ); - log_info("b: %d\n", b ); - log_info("b2: %d %d \n", b2.s[0], b2.s[1] ); - log_info("b4: %d %d %d %d\n", b4.s[0], b4.s[1], b4.s[2], b4.s[3] ); - log_info("b8: %d %d %d %d %d %d %d %d\n", b8.s[0], b8.s[1], b8.s[2], b8.s[3], b8.s[4], b8.s[5], b8.s[6], b8.s[7] ); - log_info("b16: %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n", b16.s[0], b16.s[1], b16.s[2], b16.s[3], b16.s[4], b16.s[5], b16.s[6], b16.s[7], - b16.s[8], b16.s[9], b16.s[10], b16.s[11], b16.s[12], b16.s[13], b16.s[14], b16.s[15]); - - /* vector access */ - log_info("\nVerifying vector access:\n" ); -#if defined( __CL_SHORT2__ ) - __cl_short2 v2 = b2.v2; - log_info("__cl_short2: %d %d \n", ((cl_short*)&v2)[0], ((cl_short*)&v2)[1] ); -#else - log_info( "__cl_short2 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_SHORT4__ ) - __cl_short4 v4 = b4.v4; - log_info("__cl_short4: %d %d %d %d \n", ((cl_short*)&v4)[0], ((cl_short*)&v4)[1], ((cl_short*)&v4)[2], ((cl_short*)&v4)[3] ); -#else - log_info( "__cl_short4 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_SHORT8__ ) - __cl_short8 v8 = b8.v8; - log_info("__cl_short8: %d %d %d %d %d %d %d %d \n", ((cl_short*)&v8)[0], ((cl_short*)&v8)[1], ((cl_short*)&v8)[2], ((cl_short*)&v8)[3], ((cl_short*)&v8)[4], ((cl_short*)&v8)[5], ((cl_short*)&v8)[6], ((cl_short*)&v8)[7] ); -#else - log_info( "__cl_short8 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_SHORT16__ ) - __cl_short16 v16 = b16.v16; - log_info("__cl_short16: %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d \n", ((cl_short*)&v16)[0], ((cl_short*)&v16)[1], ((cl_short*)&v16)[2], ((cl_short*)&v16)[3], ((cl_short*)&v16)[4], ((cl_short*)&v16)[5], ((cl_short*)&v16)[6], ((cl_short*)&v16)[7], - ((cl_short*)&v16)[8], ((cl_short*)&v16)[9], ((cl_short*)&v16)[10], ((cl_short*)&v16)[11], ((cl_short*)&v16)[12], ((cl_short*)&v16)[13], ((cl_short*)&v16)[14], ((cl_short*)&v16)[15]); -#else - log_info( "__cl_short16 SIMD vectors not supported on this architecture.\n" ); -#endif - - log_info( "\n" ); - return 0; -} - -int test_ushort( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ) -{ -/* ushort */ - /* Constructor */ - cl_ushort a = 0; - cl_ushort2 a2 = {{ 0, 1 }}; - cl_ushort4 a4 = {{ 0, 1, 2, 3 }}; - cl_ushort8 a8 = {{ 0, 1, 2, 3, 4, 5, 6, 7 }}; - cl_ushort16 a16 = {{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }}; - - /* assignment */ - cl_ushort b = a; - cl_ushort2 b2 = a2; - cl_ushort4 b4 = a4; - cl_ushort8 b8 = a8; - cl_ushort16 b16 = a16; - - log_info("\nVerifying assignment:\n" ); - log_info("b: %d\n", b ); - log_info("b2: %d %d \n", b2.s[0], b2.s[1] ); - log_info("b4: %d %d %d %d\n", b4.s[0], b4.s[1], b4.s[2], b4.s[3] ); - log_info("b8: %d %d %d %d %d %d %d %d\n", b8.s[0], b8.s[1], b8.s[2], b8.s[3], b8.s[4], b8.s[5], b8.s[6], b8.s[7] ); - log_info("b16: %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n", b16.s[0], b16.s[1], b16.s[2], b16.s[3], b16.s[4], b16.s[5], b16.s[6], b16.s[7], - b16.s[8], b16.s[9], b16.s[10], b16.s[11], b16.s[12], b16.s[13], b16.s[14], b16.s[15]); - - /* vector access */ - log_info("\nVerifying vector access:\n" ); -#if defined( __CL_USHORT2__ ) - __cl_ushort2 v2 = b2.v2; - log_info("__cl_ushort2: %d %d \n", ((unsigned short*)&v2)[0], ((unsigned short*)&v2)[1] ); -#else - log_info( "__cl_ushort2 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_USHORT4__ ) - __cl_ushort4 v4 = b4.v4; - log_info("__cl_ushort4: %d %d %d %d \n", ((unsigned short*)&v4)[0], ((unsigned short*)&v4)[1], ((unsigned short*)&v4)[2], ((unsigned short*)&v4)[3] ); -#else - log_info( "__cl_ushort4 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_USHORT8__ ) - __cl_ushort8 v8 = b8.v8; - log_info("__cl_ushort8: %d %d %d %d %d %d %d %d \n", ((unsigned short*)&v8)[0], ((unsigned short*)&v8)[1], ((unsigned short*)&v8)[2], ((unsigned short*)&v8)[3], ((unsigned short*)&v8)[4], ((unsigned short*)&v8)[5], ((unsigned short*)&v8)[6], ((unsigned short*)&v8)[7] ); -#else - log_info( "__cl_ushort8 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_USHORT16__ ) - __cl_ushort16 v16 = b16.v16; - log_info("__cl_ushort16: %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d \n", ((unsigned short*)&v16)[0], ((unsigned short*)&v16)[1], ((unsigned short*)&v16)[2], ((unsigned short*)&v16)[3], ((unsigned short*)&v16)[4], ((unsigned short*)&v16)[5], ((unsigned short*)&v16)[6], ((unsigned short*)&v16)[7], - ((unsigned short*)&v16)[8], ((unsigned short*)&v16)[9], ((unsigned short*)&v16)[10], ((unsigned short*)&v16)[11], ((unsigned short*)&v16)[12], ((unsigned short*)&v16)[13], ((unsigned short*)&v16)[14], ((unsigned short*)&v16)[15]); -#else - log_info( "__cl_ushort16 SIMD vectors not supported on this architecture.\n" ); -#endif - - log_info( "\n" ); - return 0; -} - -int test_int(cl_device_id deviceID , cl_context context, cl_command_queue queue, int num_elements) -{ -/* int */ - /* Constructor */ - cl_int a = 0; - cl_int2 a2 = {{ 0, 1 }}; - cl_int4 a4 = {{ 0, 1, 2, 3 }}; - cl_int8 a8 = {{ 0, 1, 2, 3, 4, 5, 6, 7 }}; - cl_int16 a16 = {{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }}; - - /* assignment */ - cl_int b = a; - cl_int2 b2 = a2; - cl_int4 b4 = a4; - cl_int8 b8 = a8; - cl_int16 b16 = a16; - - log_info("\nVerifying assignment:\n" ); - log_info("b: %d\n", b ); - log_info("b2: %d %d \n", b2.s[0], b2.s[1] ); - log_info("b4: %d %d %d %d\n", b4.s[0], b4.s[1], b4.s[2], b4.s[3] ); - log_info("b8: %d %d %d %d %d %d %d %d\n", b8.s[0], b8.s[1], b8.s[2], b8.s[3], b8.s[4], b8.s[5], b8.s[6], b8.s[7] ); - log_info("b16: %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n", b16.s[0], b16.s[1], b16.s[2], b16.s[3], b16.s[4], b16.s[5], b16.s[6], b16.s[7], - b16.s[8], b16.s[9], b16.s[10], b16.s[11], b16.s[12], b16.s[13], b16.s[14], b16.s[15]); - - /* vector access */ - log_info("\nVerifying vector access:\n" ); -#if defined( __CL_INT2__ ) - __cl_int2 v2 = b2.v2; - log_info("__cl_int2: %d %d \n", ((cl_int*)&v2)[0], ((cl_int*)&v2)[1] ); -#else - log_info( "__cl_int2 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_INT4__ ) - __cl_int4 v4 = b4.v4; - log_info("__cl_int4: %d %d %d %d \n", ((cl_int*)&v4)[0], ((cl_int*)&v4)[1], ((cl_int*)&v4)[2], ((cl_int*)&v4)[3] ); -#else - log_info( "__cl_int4 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_INT8__ ) - __cl_int8 v8 = b8.v8; - log_info("__cl_int8: %d %d %d %d %d %d %d %d \n", ((cl_int*)&v8)[0], ((cl_int*)&v8)[1], ((cl_int*)&v8)[2], ((cl_int*)&v8)[3], ((cl_int*)&v8)[4], ((cl_int*)&v8)[5], ((cl_int*)&v8)[6], ((cl_int*)&v8)[7] ); -#else - log_info( "__cl_int8 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_INT16__ ) - __cl_int16 v16 = b16.v16; - log_info("__cl_int16: %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d \n", ((cl_int*)&v16)[0], ((cl_int*)&v16)[1], ((cl_int*)&v16)[2], ((cl_int*)&v16)[3], ((cl_int*)&v16)[4], ((cl_int*)&v16)[5], ((cl_int*)&v16)[6], ((cl_int*)&v16)[7], - ((cl_int*)&v16)[8], ((cl_int*)&v16)[9], ((cl_int*)&v16)[10], ((cl_int*)&v16)[11], ((cl_int*)&v16)[12], ((cl_int*)&v16)[13], ((cl_int*)&v16)[14], ((cl_int*)&v16)[15]); -#else - log_info( "__cl_int16 SIMD vectors not supported on this architecture.\n" ); -#endif - - log_info( "\n" ); - return 0; -} - -int test_uint( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ) -{ -/* uint */ - /* Constructor */ - cl_uint a = 0; - cl_uint2 a2 = {{ 0, 1 }}; - cl_uint4 a4 = {{ 0, 1, 2, 3 }}; - cl_uint8 a8 = {{ 0, 1, 2, 3, 4, 5, 6, 7 }}; - cl_uint16 a16 = {{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }}; - - /* assignment */ - cl_uint b = a; - cl_uint2 b2 = a2; - cl_uint4 b4 = a4; - cl_uint8 b8 = a8; - cl_uint16 b16 = a16; - - log_info("\nVerifying assignment:\n" ); - log_info("b: %d\n", b ); - log_info("b2: %d %d \n", b2.s[0], b2.s[1] ); - log_info("b4: %d %d %d %d\n", b4.s[0], b4.s[1], b4.s[2], b4.s[3] ); - log_info("b8: %d %d %d %d %d %d %d %d\n", b8.s[0], b8.s[1], b8.s[2], b8.s[3], b8.s[4], b8.s[5], b8.s[6], b8.s[7] ); - log_info("b16: %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n", b16.s[0], b16.s[1], b16.s[2], b16.s[3], b16.s[4], b16.s[5], b16.s[6], b16.s[7], - b16.s[8], b16.s[9], b16.s[10], b16.s[11], b16.s[12], b16.s[13], b16.s[14], b16.s[15]); - - /* vector access */ - log_info("\nVerifying vector access:\n" ); -#if defined( __CL_UINT2__ ) - __cl_uint2 v2 = b2.v2; - log_info("__cl_uint2: %d %d \n", ((cl_uint*)&v2)[0], ((cl_uint*)&v2)[1] ); -#else - log_info( "__cl_uint2 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_UINT4__ ) - __cl_uint4 v4 = b4.v4; - log_info("__cl_uint4: %d %d %d %d \n", ((cl_uint*)&v4)[0], ((cl_uint*)&v4)[1], ((cl_uint*)&v4)[2], ((cl_uint*)&v4)[3] ); -#else - log_info( "__cl_uint4 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_UINT8__ ) - __cl_uint8 v8 = b8.v8; - log_info("__cl_uint8: %d %d %d %d %d %d %d %d \n", ((cl_uint*)&v8)[0], ((cl_uint*)&v8)[1], ((cl_uint*)&v8)[2], ((cl_uint*)&v8)[3], ((cl_uint*)&v8)[4], ((cl_uint*)&v8)[5], ((cl_uint*)&v8)[6], ((cl_uint*)&v8)[7] ); -#else - log_info( "__cl_uint8 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_UINT16__ ) - __cl_uint16 v16 = b16.v16; - log_info("__cl_uint16: %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d \n", ((cl_uint*)&v16)[0], ((cl_uint*)&v16)[1], ((cl_uint*)&v16)[2], ((cl_uint*)&v16)[3], ((cl_uint*)&v16)[4], ((cl_uint*)&v16)[5], ((cl_uint*)&v16)[6], ((cl_uint*)&v16)[7], - ((cl_uint*)&v16)[8], ((cl_uint*)&v16)[9], ((cl_uint*)&v16)[10], ((cl_uint*)&v16)[11], ((cl_uint*)&v16)[12], ((cl_uint*)&v16)[13], ((cl_uint*)&v16)[14], ((cl_uint*)&v16)[15]); -#else - log_info( "__cl_uint16 SIMD vectors not supported on this architecture.\n" ); -#endif - - log_info( "\n" ); - return 0; -} - -int test_long( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ) -{ -/* long */ - /* Constructor */ - cl_long a = 0; - cl_long2 a2 = {{ 0, 1 }}; - cl_long4 a4 = {{ 0, 1, 2, 3 }}; - cl_long8 a8 = {{ 0, 1, 2, 3, 4, 5, 6, 7 }}; - cl_long16 a16 = {{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }}; - - /* assignment */ - cl_long b = a; - cl_long2 b2 = a2; - cl_long4 b4 = a4; - cl_long8 b8 = a8; - cl_long16 b16 = a16; - - log_info("\nVerifying assignment:\n" ); - log_info("b: %lld\n", b ); - log_info("b2: %lld %lld \n", b2.s[0], b2.s[1] ); - log_info("b4: %lld %lld %lld %lld\n", b4.s[0], b4.s[1], b4.s[2], b4.s[3] ); - log_info("b8: %lld %lld %lld %lld %lld %lld %lld %lld\n", b8.s[0], b8.s[1], b8.s[2], b8.s[3], b8.s[4], b8.s[5], b8.s[6], b8.s[7] ); - log_info("b16: %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld\n", b16.s[0], b16.s[1], b16.s[2], b16.s[3], b16.s[4], b16.s[5], b16.s[6], b16.s[7], - b16.s[8], b16.s[9], b16.s[10], b16.s[11], b16.s[12], b16.s[13], b16.s[14], b16.s[15]); - - /* vector access */ - log_info("\nVerifying vector access:\n" ); -#if defined( __CL_LONG2__ ) - __cl_long2 v2 = b2.v2; - log_info("__cl_long2: %lld %lld \n", ((cl_long*)&v2)[0], ((cl_long*)&v2)[1] ); -#else - log_info( "__cl_long2 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_LONG4__ ) - __cl_long4 v4 = b4.v4; - log_info("__cl_long4: %lld %lld %lld %lld \n", ((cl_long*)&v4)[0], ((cl_long*)&v4)[1], ((cl_long*)&v4)[2], ((cl_long*)&v4)[3] ); -#else - log_info( "__cl_long4 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_LONG8__ ) - __cl_long8 v8 = b8.v8; - log_info("__cl_long8: %lld %lld %lld %lld %lld %lld %lld %lld \n", ((cl_long*)&v8)[0], ((cl_long*)&v8)[1], ((cl_long*)&v8)[2], ((cl_long*)&v8)[3], ((cl_long*)&v8)[4], ((cl_long*)&v8)[5], ((cl_long*)&v8)[6], ((cl_long*)&v8)[7] ); -#else - log_info( "__cl_long8 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_LONG16__ ) - __cl_long16 v16 = b16.v16; - log_info("__cl_long16: %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld \n", ((cl_long*)&v16)[0], ((cl_long*)&v16)[1], ((cl_long*)&v16)[2], ((cl_long*)&v16)[3], ((cl_long*)&v16)[4], ((cl_long*)&v16)[5], ((cl_long*)&v16)[6], ((cl_long*)&v16)[7], - ((cl_long*)&v16)[8], ((cl_long*)&v16)[9], ((cl_long*)&v16)[10], ((cl_long*)&v16)[11], ((cl_long*)&v16)[12], ((cl_long*)&v16)[13], ((cl_long*)&v16)[14], ((cl_long*)&v16)[15]); -#else - log_info( "__cl_long16 SIMD vectors not supported on this architecture.\n" ); -#endif - - log_info( "\n" ); - return 0; -} - -int test_ulong( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ) -{ -/* ulong */ - /* Constructor */ - cl_ulong a = 0; - cl_ulong2 a2 = {{ 0, 1 }}; - cl_ulong4 a4 = {{ 0, 1, 2, 3 }}; - cl_ulong8 a8 = {{ 0, 1, 2, 3, 4, 5, 6, 7 }}; - cl_ulong16 a16 = {{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }}; - - /* assignment */ - cl_ulong b = a; - cl_ulong2 b2 = a2; - cl_ulong4 b4 = a4; - cl_ulong8 b8 = a8; - cl_ulong16 b16 = a16; - - log_info("\nVerifying assignment:\n" ); - log_info("b: %lld\n", b ); - log_info("b2: %lld %lld \n", b2.s[0], b2.s[1] ); - log_info("b4: %lld %lld %lld %lld\n", b4.s[0], b4.s[1], b4.s[2], b4.s[3] ); - log_info("b8: %lld %lld %lld %lld %lld %lld %lld %lld\n", b8.s[0], b8.s[1], b8.s[2], b8.s[3], b8.s[4], b8.s[5], b8.s[6], b8.s[7] ); - log_info("b16: %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld\n", b16.s[0], b16.s[1], b16.s[2], b16.s[3], b16.s[4], b16.s[5], b16.s[6], b16.s[7], - b16.s[8], b16.s[9], b16.s[10], b16.s[11], b16.s[12], b16.s[13], b16.s[14], b16.s[15]); - - /* vector access */ - log_info("\nVerifying vector access:\n" ); -#if defined( __CL_ULONG2__ ) - __cl_ulong2 v2 = b2.v2; - log_info("__cl_ulong2: %lld %lld \n", ((cl_ulong*)&v2)[0], ((cl_ulong*)&v2)[1] ); -#else - log_info( "__cl_ulong2 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_ULONG4__ ) - __cl_ulong4 v4 = b4.v4; - log_info("__cl_ulong4: %lld %lld %lld %lld \n", ((cl_ulong*)&v4)[0], ((cl_ulong*)&v4)[1], ((cl_ulong*)&v4)[2], ((cl_ulong*)&v4)[3] ); -#else - log_info( "__cl_ulong4 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_ULONG8__ ) - __cl_ulong8 v8 = b8.v8; - log_info("__cl_ulong8: %lld %lld %lld %lld %lld %lld %lld %lld \n", ((cl_ulong*)&v8)[0], ((cl_ulong*)&v8)[1], ((cl_ulong*)&v8)[2], ((cl_ulong*)&v8)[3], ((cl_ulong*)&v8)[4], ((cl_ulong*)&v8)[5], ((cl_ulong*)&v8)[6], ((cl_ulong*)&v8)[7] ); -#else - log_info( "__cl_ulong8 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_ULONG16__ ) - __cl_ulong16 v16 = b16.v16; - log_info("__cl_ulong16: %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld \n", ((cl_ulong*)&v16)[0], ((cl_ulong*)&v16)[1], ((cl_ulong*)&v16)[2], ((cl_ulong*)&v16)[3], ((cl_ulong*)&v16)[4], ((cl_ulong*)&v16)[5], ((cl_ulong*)&v16)[6], ((cl_ulong*)&v16)[7], - ((cl_ulong*)&v16)[8], ((cl_ulong*)&v16)[9], ((cl_ulong*)&v16)[10], ((cl_ulong*)&v16)[11], ((cl_ulong*)&v16)[12], ((cl_ulong*)&v16)[13], ((cl_ulong*)&v16)[14], ((cl_ulong*)&v16)[15]); -#else - log_info( "__cl_ulong16 SIMD vectors not supported on this architecture.\n" ); -#endif - - log_info( "\n" ); - return 0; -} - -int test_float( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ) -{ -/* float */ - /* Constructor */ - cl_float a = 0.0f; - cl_float2 a2 = {{ 0.0f, 1.0f }}; - cl_float4 a4 = {{ 0.0f, 1.0f, 2.0f, 3.0f }}; - cl_float8 a8 = {{ 0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f }}; - cl_float16 a16 = {{ 0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f }}; - - /* assignment */ - cl_float b = a; - cl_float2 b2 = a2; - cl_float4 b4 = a4; - cl_float8 b8 = a8; - cl_float16 b16 = a16; - - log_info("\nVerifying assignment:\n" ); - log_info("b: %f\n", b ); - log_info("b2: %f %f \n", b2.s[0], b2.s[1] ); - log_info("b4: %f %f %f %f\n", b4.s[0], b4.s[1], b4.s[2], b4.s[3] ); - log_info("b8: %f %f %f %f %f %f %f %f\n", b8.s[0], b8.s[1], b8.s[2], b8.s[3], b8.s[4], b8.s[5], b8.s[6], b8.s[7] ); - log_info("b16: %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f\n", b16.s[0], b16.s[1], b16.s[2], b16.s[3], b16.s[4], b16.s[5], b16.s[6], b16.s[7], - b16.s[8], b16.s[9], b16.s[10], b16.s[11], b16.s[12], b16.s[13], b16.s[14], b16.s[15]); - - /* vector access */ - log_info("\nVerifying vector access:\n" ); -#if defined( __CL_FLOAT2__ ) - __cl_float2 v2 = b2.v2; - log_info("__cl_float2: %f %f \n", ((cl_float*)&v2)[0], ((cl_float*)&v2)[1] ); -#else - log_info( "__cl_float2 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_FLOAT4__ ) - { - __cl_float4 v4 = b4.v4; - log_info("__cl_float4: %f %f %f %f \n", ((cl_float*)&v4)[0], ((cl_float*)&v4)[1], ((cl_float*)&v4)[2], ((cl_float*)&v4)[3] ); - } -#else - log_info( "__cl_float4 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_FLOAT8__ ) - __cl_float8 v8 = b8.v8; - log_info("__cl_float8: %f %f %f %f %f %f %f %f \n", ((cl_float*)&v8)[0], ((cl_float*)&v8)[1], ((cl_float*)&v8)[2], ((cl_float*)&v8)[3], ((cl_float*)&v8)[4], ((cl_float*)&v8)[5], ((cl_float*)&v8)[6], ((cl_float*)&v8)[7] ); -#else - log_info( "__cl_float8 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_FLOAT16__ ) - __cl_float16 v16 = b16.v16; - log_info("__cl_float16: %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f \n", ((cl_float*)&v16)[0], ((cl_float*)&v16)[1], ((cl_float*)&v16)[2], ((cl_float*)&v16)[3], ((cl_float*)&v16)[4], ((cl_float*)&v16)[5], ((cl_float*)&v16)[6], ((cl_float*)&v16)[7], - ((cl_float*)&v16)[8], ((cl_float*)&v16)[9], ((cl_float*)&v16)[10], ((cl_float*)&v16)[11], ((cl_float*)&v16)[12], ((cl_float*)&v16)[13], ((cl_float*)&v16)[14], ((cl_float*)&v16)[15]); -#else - log_info( "__cl_float16 SIMD vectors not supported on this architecture.\n" ); -#endif - - log_info( "\n" ); - return 0; -} - -int test_double( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ) -{ -/* double */ - /* Constructor */ - cl_double a = 0.0f; - cl_double2 a2 = {{ 0.0f, 1.0f }}; - cl_double4 a4 = {{ 0.0f, 1.0f, 2.0f, 3.0f }}; - cl_double8 a8 = {{ 0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f }}; - cl_double16 a16 = {{ 0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f }}; - - /* assignment */ - cl_double b = a; - cl_double2 b2 = a2; - cl_double4 b4 = a4; - cl_double8 b8 = a8; - cl_double16 b16 = a16; - - log_info("\nVerifying assignment:\n" ); - log_info("b: %f\n", b ); - log_info("b2: %f %f \n", b2.s[0], b2.s[1] ); - log_info("b4: %f %f %f %f\n", b4.s[0], b4.s[1], b4.s[2], b4.s[3] ); - log_info("b8: %f %f %f %f %f %f %f %f\n", b8.s[0], b8.s[1], b8.s[2], b8.s[3], b8.s[4], b8.s[5], b8.s[6], b8.s[7] ); - log_info("b16: %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f\n", b16.s[0], b16.s[1], b16.s[2], b16.s[3], b16.s[4], b16.s[5], b16.s[6], b16.s[7], - b16.s[8], b16.s[9], b16.s[10], b16.s[11], b16.s[12], b16.s[13], b16.s[14], b16.s[15]); - - /* vector access */ - log_info("\nVerifying vector access:\n" ); -#if defined( __CL_DOUBLE2__ ) - __cl_double2 v2 = b2.v2; - log_info("__cl_double2: %f %f \n", ((cl_double*)&v2)[0], ((cl_double*)&v2)[1] ); -#else - log_info( "__cl_double2 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_DOUBLE4__ ) - __cl_double4 v4 = b4.v4; - log_info("__cl_double4: %f %f %f %f \n", ((cl_double*)&v4)[0], ((cl_double*)&v4)[1], ((cl_double*)&v4)[2], ((cl_double*)&v4)[3] ); -#else - log_info( "__cl_double4 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_DOUBLE8__ ) - __cl_double8 v8 = b8.v8; - log_info("__cl_double8: %f %f %f %f %f %f %f %f \n", ((cl_double*)&v8)[0], ((cl_double*)&v8)[1], ((cl_double*)&v8)[2], ((cl_double*)&v8)[3], ((cl_double*)&v8)[4], ((cl_double*)&v8)[5], ((cl_double*)&v8)[6], ((cl_double*)&v8)[7] ); -#else - log_info( "__cl_double8 SIMD vectors not supported on this architecture.\n" ); -#endif - -#if defined( __CL_DOUBLE16__ ) - __cl_double16 v16 = b16.v16; - log_info("__cl_double16: %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f \n", ((cl_double*)&v16)[0], ((cl_double*)&v16)[1], ((cl_double*)&v16)[2], ((cl_double*)&v16)[3], ((cl_double*)&v16)[4], ((cl_double*)&v16)[5], ((cl_double*)&v16)[6], ((cl_double*)&v16)[7], - ((cl_double*)&v16)[8], ((cl_double*)&v16)[9], ((cl_double*)&v16)[10], ((cl_double*)&v16)[11], ((cl_double*)&v16)[12], ((cl_double*)&v16)[13], ((cl_double*)&v16)[14], ((cl_double*)&v16)[15]); -#else - log_info( "__cl_double16 SIMD vectors not supported on this architecture.\n" ); -#endif - - log_info( "\n" ); - return 0; -} - -test_definition test_list[] = { - ADD_TEST( char ), - ADD_TEST( uchar ), - ADD_TEST( short ), - ADD_TEST( ushort ), - ADD_TEST( int ), - ADD_TEST( uint ), - ADD_TEST( long ), - ADD_TEST( ulong ), - ADD_TEST( float ), - ADD_TEST( double ), -}; - -const int test_num = ARRAY_SIZE( test_list ); - -int main(int argc, const char** argv) -{ - log_info( "\nChecking operations on cl_types.\nNumbers, where presented, should walk upward from 0, with step of 1:\n" ); - - return runTestHarness( argc, argv, test_num, test_list, false, true, 0 ); -} diff --git a/test_conformance/headers/test_opencl.h.c b/test_conformance/headers/test_opencl.h.c deleted file mode 100644 index d7318387..00000000 --- a/test_conformance/headers/test_opencl.h.c +++ /dev/null @@ -1,27 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#if defined( __APPLE__ ) - #include -#else - #include -#endif -#include - -int main( void ) -{ - printf("opencl.h standalone test PASSED.\n"); - return 0; -} diff --git a/test_conformance/images/clCopyImage/CMakeLists.txt b/test_conformance/images/clCopyImage/CMakeLists.txt index b876fdc7..d8aace41 100644 --- a/test_conformance/images/clCopyImage/CMakeLists.txt +++ b/test_conformance/images/clCopyImage/CMakeLists.txt @@ -12,17 +12,7 @@ set(${MODULE_NAME}_SOURCES test_copy_3D_2D_array.cpp test_copy_generic.cpp test_loops.cpp - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/threadTesting.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/imageHelpers.cpp - ../../../test_common/harness/mt19937.c - ../../../test_common/harness/conversions.c - ../../../test_common/harness/typeWrappers.cpp - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c + ../common.cpp ) include(../../CMakeCommon.txt) diff --git a/test_conformance/images/clCopyImage/main.cpp b/test_conformance/images/clCopyImage/main.cpp index 417619eb..04a8f51d 100644 --- a/test_conformance/images/clCopyImage/main.cpp +++ b/test_conformance/images/clCopyImage/main.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../../test_common/harness/compat.h" +#include "../harness/compat.h" #include #include @@ -24,19 +24,17 @@ #endif #include "../testBase.h" -#include "../../../test_common/harness/testHarness.h" +#include "../harness/testHarness.h" bool gDebugTrace; bool gTestSmallImages; bool gTestMaxImages; bool gUseRamp; -bool gTestRounding; bool gEnablePitch; bool gTestMipmaps; int gTypesToTest; cl_channel_type gChannelTypeToUse = (cl_channel_type)-1; cl_channel_order gChannelOrderToUse = (cl_channel_order)-1; -cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT; extern int test_image_set( cl_device_id device, cl_context context, cl_command_queue queue, MethodsToTest testMethod ); @@ -110,8 +108,6 @@ int main(int argc, const char *argv[]) cl_channel_type chanType; cl_channel_order chanOrder; - checkDeviceTypeOverride( &gDeviceType ); - const char ** argList = (const char **)calloc( argc, sizeof( char*) ); if( NULL == argList ) @@ -126,16 +122,7 @@ int main(int argc, const char *argv[]) // Parse arguments for( int i = 1; i < argc; i++ ) { - if( strcmp( argv[i], "cpu" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_CPU" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_CPU; - else if( strcmp( argv[i], "gpu" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_GPU" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_GPU; - else if( strcmp( argv[i], "accelerator" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_ACCELERATOR" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_ACCELERATOR; - else if( strcmp( argv[i], "CL_DEVICE_TYPE_DEFAULT" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_DEFAULT; - - else if( strcmp( argv[i], "test_mipmaps" ) == 0 ) + if( strcmp( argv[i], "test_mipmaps" ) == 0 ) { gTestMipmaps = true; // Don't test pitches with mipmaps, at least currently. @@ -177,21 +164,7 @@ int main(int argc, const char *argv[]) int ret = runTestHarness( argCount, argList, test_num, test_list, true, false, 0 ); - if (gTestFailure == 0) { - if (gTestCount > 1) - log_info("PASSED %d of %d sub-tests.\n", gTestCount, gTestCount); - else - log_info("PASSED sub-test.\n"); - } else if (gTestFailure > 0) { - if (gTestCount > 1) - log_error("FAILED %d of %d sub-tests.\n", gTestFailure, gTestCount); - else - log_error("FAILED sub-test.\n"); - } - - // Clean up free(argList); - return ret; } diff --git a/test_conformance/images/clCopyImage/test_copy_1D.cpp b/test_conformance/images/clCopyImage/test_copy_1D.cpp index c35c1455..ab223202 100644 --- a/test_conformance/images/clCopyImage/test_copy_1D.cpp +++ b/test_conformance/images/clCopyImage/test_copy_1D.cpp @@ -18,7 +18,7 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding, gTestMipmaps; +extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps; extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; extern uint64_t gRoundingStartValue; diff --git a/test_conformance/images/clCopyImage/test_copy_1D_array.cpp b/test_conformance/images/clCopyImage/test_copy_1D_array.cpp index e9e6e9c3..62eed3fd 100644 --- a/test_conformance/images/clCopyImage/test_copy_1D_array.cpp +++ b/test_conformance/images/clCopyImage/test_copy_1D_array.cpp @@ -18,7 +18,7 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding, gTestMipmaps; +extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps; extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; extern uint64_t gRoundingStartValue; diff --git a/test_conformance/images/clCopyImage/test_copy_2D.cpp b/test_conformance/images/clCopyImage/test_copy_2D.cpp index 94236934..7af2fe3e 100644 --- a/test_conformance/images/clCopyImage/test_copy_2D.cpp +++ b/test_conformance/images/clCopyImage/test_copy_2D.cpp @@ -18,7 +18,7 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding, gTestMipmaps; +extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps; extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; extern uint64_t gRoundingStartValue; diff --git a/test_conformance/images/clCopyImage/test_copy_2D_2D_array.cpp b/test_conformance/images/clCopyImage/test_copy_2D_2D_array.cpp index e35b9b24..f784230f 100644 --- a/test_conformance/images/clCopyImage/test_copy_2D_2D_array.cpp +++ b/test_conformance/images/clCopyImage/test_copy_2D_2D_array.cpp @@ -14,11 +14,12 @@ // limitations under the License. // #include "../testBase.h" +#include "../common.h" #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gTestMaxImages, gTestRounding, gEnablePitch, gTestMipmaps; +extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gTestMaxImages, gEnablePitch, gTestMipmaps; extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; extern uint64_t gRoundingStartValue; @@ -26,17 +27,6 @@ extern uint64_t gRoundingStartValue; extern int test_copy_image_generic( cl_context context, cl_command_queue queue, image_descriptor *srcImageInfo, image_descriptor *dstImageInfo, const size_t sourcePos[], const size_t destPos[], const size_t regionSize[], MTdata d ); - -static size_t random_in_ranges( size_t minimum, size_t rangeA, size_t rangeB, MTdata d ) -{ - if( rangeB < rangeA ) - rangeA = rangeB; - if( rangeA < minimum ) - return rangeA; - return (size_t)random_in_range( (int)minimum, (int)rangeA - 1, d ); -} - - static void set_image_dimensions( image_descriptor *imageInfo, size_t width, size_t height, size_t arraySize, size_t rowPadding, size_t slicePadding ) { size_t pixelSize = get_pixel_size( imageInfo->format ); @@ -176,7 +166,8 @@ int test_copy_image_size_2D_2D_array( cl_context context, cl_command_queue queue sourcePos[ 0 ] = ( srcImageInfo->width > regionSize[ 0 ] ) ? (size_t)random_in_range( 0, (int)( srcImageInfo->width - regionSize[ 0 ] - 1 ), d ) : 0; sourcePos[ 1 ] = ( srcImageInfo->height > regionSize[ 1 ] ) ? (size_t)random_in_range( 0, (int)( srcImageInfo->height - regionSize[ 1 ] - 1 ), d ) : 0; sourcePos[ 2 ] = ( srcImageInfo->arraySize > 0 ) ? (size_t)random_in_range( 0, (int)( srcImageInfo->arraySize - 1 ), d ) : gTestMipmaps ? twoImage_lod : 0; - if ( gTestMipmaps ) + if (gTestMipmaps) + { if( srcImageInfo->arraySize > 0 ) { sourcePos[ 0 ] = ( threeImage_width_lod > regionSize[ 0 ] ) ? (size_t)random_in_range( 0, (int)( threeImage_width_lod - regionSize[ 0 ] - 1 ), d ) : 0; @@ -189,11 +180,13 @@ int test_copy_image_size_2D_2D_array( cl_context context, cl_command_queue queue sourcePos[ 1 ] = ( twoImage_height_lod > regionSize[ 1 ] ) ? (size_t)random_in_range( 0, (int)( twoImage_height_lod - regionSize[ 1 ] - 1 ), d ) : 0; } + } destPos[ 0 ] = ( dstImageInfo->width > regionSize[ 0 ] ) ? (size_t)random_in_range( 0, (int)( dstImageInfo->width - regionSize[ 0 ] - 1 ), d ) : 0; destPos[ 1 ] = ( dstImageInfo->height > regionSize[ 1 ] ) ? (size_t)random_in_range( 0, (int)( dstImageInfo->height - regionSize[ 1 ] - 1 ), d ) : 0; destPos[ 2 ] = ( dstImageInfo->arraySize > 0 ) ? (size_t)random_in_range( 0, (int)( dstImageInfo->arraySize - 1 ), d ) : gTestMipmaps ? twoImage_lod : 0; - if ( gTestMipmaps ) + if (gTestMipmaps) + { if( dstImageInfo->arraySize > 0 ) { destPos[ 0 ] = ( threeImage_width_lod > regionSize[ 0 ] ) ? (size_t)random_in_range( 0, (int)( threeImage_width_lod - regionSize[ 0 ] - 1 ), d ) : 0; @@ -206,6 +199,7 @@ int test_copy_image_size_2D_2D_array( cl_context context, cl_command_queue queue destPos[ 1 ] = ( twoImage_height_lod > regionSize[ 1 ] ) ? (size_t)random_in_range( 0, (int)( twoImage_height_lod - regionSize[ 1 ] - 1 ), d ) : 0; } + } // Go for it! retCode = test_copy_image_generic( context, queue, srcImageInfo, dstImageInfo, sourcePos, destPos, regionSize, d ); diff --git a/test_conformance/images/clCopyImage/test_copy_2D_3D.cpp b/test_conformance/images/clCopyImage/test_copy_2D_3D.cpp index 1908c0a4..d341455e 100644 --- a/test_conformance/images/clCopyImage/test_copy_2D_3D.cpp +++ b/test_conformance/images/clCopyImage/test_copy_2D_3D.cpp @@ -14,11 +14,12 @@ // limitations under the License. // #include "../testBase.h" +#include "../common.h" #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gTestMaxImages, gTestRounding, gEnablePitch, gTestMipmaps; +extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gTestMaxImages, gEnablePitch, gTestMipmaps; extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; extern uint64_t gRoundingStartValue; @@ -26,17 +27,6 @@ extern uint64_t gRoundingStartValue; extern int test_copy_image_generic( cl_context context, cl_command_queue queue, image_descriptor *srcImageInfo, image_descriptor *dstImageInfo, const size_t sourcePos[], const size_t destPos[], const size_t regionSize[], MTdata d ); - -static size_t random_in_ranges( size_t minimum, size_t rangeA, size_t rangeB, MTdata d ) -{ - if( rangeB < rangeA ) - rangeA = rangeB; - if( rangeA < minimum ) - return rangeA; - return (size_t)random_in_range( (int)minimum, (int)rangeA - 1, d ); -} - - static void set_image_dimensions( image_descriptor *imageInfo, size_t width, size_t height, size_t depth, size_t rowPadding, size_t slicePadding ) { size_t pixelSize = get_pixel_size( imageInfo->format ); @@ -177,7 +167,8 @@ int test_copy_image_size_2D_3D( cl_context context, cl_command_queue queue, imag sourcePos[ 1 ] = ( srcImageInfo->height > regionSize[ 1 ] ) ? (size_t)random_in_range( 0, (int)( srcImageInfo->height - regionSize[ 1 ] - 1 ), d ) : 0; sourcePos[ 2 ] = ( srcImageInfo->depth > 0 ) ? (size_t)random_in_range( 0, (int)( srcImageInfo->depth - 1 ), d ) : 0; - if ( gTestMipmaps ) + if (gTestMipmaps) + { if( srcImageInfo->depth > 0 ) { sourcePos[ 0 ] = ( threeImage_width_lod > regionSize[ 0 ] ) ? (size_t)random_in_range( 0, (int)( threeImage_width_lod - regionSize[ 0 ] - 1 ), d ) : 0; @@ -191,12 +182,14 @@ int test_copy_image_size_2D_3D( cl_context context, cl_command_queue queue, imag sourcePos[ 1 ] = ( twoImage_height_lod > regionSize[ 1 ] ) ? (size_t)random_in_range( 0, (int)( twoImage_height_lod - regionSize[ 1 ] - 1 ), d ) : 0; } + } destPos[ 0 ] = ( dstImageInfo->width > regionSize[ 0 ] ) ? (size_t)random_in_range( 0, (int)( dstImageInfo->width - regionSize[ 0 ] - 1 ), d ) : 0; destPos[ 1 ] = ( dstImageInfo->height > regionSize[ 1 ] ) ? (size_t)random_in_range( 0, (int)( dstImageInfo->height - regionSize[ 1 ] - 1 ), d ) : 0; destPos[ 2 ] = ( dstImageInfo->depth > 0 ) ? (size_t)random_in_range( 0, (int)( dstImageInfo->depth - 1 ), d ) : 0; - if ( gTestMipmaps ) + if (gTestMipmaps) + { if( dstImageInfo->depth > 0 ) { destPos[ 0 ] = ( threeImage_width_lod > regionSize[ 0 ] ) ? (size_t)random_in_range( 0, (int)( threeImage_width_lod - regionSize[ 0 ] - 1 ), d ) : 0; @@ -210,6 +203,7 @@ int test_copy_image_size_2D_3D( cl_context context, cl_command_queue queue, imag destPos[ 1 ] = ( twoImage_height_lod > regionSize[ 1 ] ) ? (size_t)random_in_range( 0, (int)( twoImage_height_lod - regionSize[ 1 ] - 1 ), d ) : 0; } + } // Go for it! retCode = test_copy_image_generic( context, queue, srcImageInfo, dstImageInfo, sourcePos, destPos, regionSize, d ); diff --git a/test_conformance/images/clCopyImage/test_copy_2D_array.cpp b/test_conformance/images/clCopyImage/test_copy_2D_array.cpp index f75daccd..5624245a 100644 --- a/test_conformance/images/clCopyImage/test_copy_2D_array.cpp +++ b/test_conformance/images/clCopyImage/test_copy_2D_array.cpp @@ -18,7 +18,7 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gTestMaxImages, gEnablePitch, gTestRounding, gTestMipmaps; +extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gTestMaxImages, gEnablePitch, gTestMipmaps; extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; diff --git a/test_conformance/images/clCopyImage/test_copy_3D.cpp b/test_conformance/images/clCopyImage/test_copy_3D.cpp index 8ca9110d..fb176233 100644 --- a/test_conformance/images/clCopyImage/test_copy_3D.cpp +++ b/test_conformance/images/clCopyImage/test_copy_3D.cpp @@ -18,7 +18,7 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gTestMaxImages, gEnablePitch, gTestRounding, gTestMipmaps; +extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gTestMaxImages, gEnablePitch, gTestMipmaps; extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; diff --git a/test_conformance/images/clCopyImage/test_copy_3D_2D_array.cpp b/test_conformance/images/clCopyImage/test_copy_3D_2D_array.cpp index 270b6103..b3b32230 100644 --- a/test_conformance/images/clCopyImage/test_copy_3D_2D_array.cpp +++ b/test_conformance/images/clCopyImage/test_copy_3D_2D_array.cpp @@ -14,11 +14,12 @@ // limitations under the License. // #include "../testBase.h" +#include "../common.h" #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gTestMaxImages, gTestRounding, gEnablePitch, gTestMipmaps; +extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gTestMaxImages, gEnablePitch, gTestMipmaps; extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; extern uint64_t gRoundingStartValue; @@ -26,17 +27,6 @@ extern uint64_t gRoundingStartValue; extern int test_copy_image_generic( cl_context context, cl_command_queue queue, image_descriptor *srcImageInfo, image_descriptor *dstImageInfo, const size_t sourcePos[], const size_t destPos[], const size_t regionSize[], MTdata d ); - -static size_t random_in_ranges( size_t minimum, size_t rangeA, size_t rangeB, MTdata d ) -{ - if( rangeB < rangeA ) - rangeA = rangeB; - if( rangeA < minimum ) - return rangeA; - return (size_t)random_in_range( (int)minimum, (int)rangeA - 1, d ); -} - - static void set_image_dimensions( image_descriptor *imageInfo, size_t width, size_t height, size_t depth, size_t arraySize, size_t rowPadding, size_t slicePadding ) { size_t pixelSize = get_pixel_size( imageInfo->format ); @@ -320,7 +310,7 @@ int test_copy_image_set_3D_2D_array(cl_device_id device, cl_context context, cl_ size_t sizes2Darray[100][3]; // Try to allocate a bit smaller images because we need the 3D ones as well for the copy. - get_max_sizes(&numbeOfSizes, 100, sizes2Darray, maxWidth, maxHeight, maxDepth, maxArraySize, maxAllocSize/2, memSize/2, CL_MEM_OBJECT_IMAGE3D, srcImageInfo.format); + get_max_sizes(&numbeOfSizes, 100, sizes2Darray, maxWidth, maxHeight, maxDepth, maxArraySize, maxAllocSize/2, memSize/2, CL_MEM_OBJECT_IMAGE2D_ARRAY, srcImageInfo.format); get_max_sizes(&numbeOfSizes, 100, sizes3D, max3DWidth, max3DHeight, maxDepth, maxArraySize, maxAllocSize/2, memSize/2, CL_MEM_OBJECT_IMAGE3D, dstImageInfo.format); for( size_t idx = 0; idx < numbeOfSizes; idx++ ) diff --git a/test_conformance/images/clCopyImage/test_copy_generic.cpp b/test_conformance/images/clCopyImage/test_copy_generic.cpp index 7fe46a15..5a8f3d31 100644 --- a/test_conformance/images/clCopyImage/test_copy_generic.cpp +++ b/test_conformance/images/clCopyImage/test_copy_generic.cpp @@ -18,20 +18,11 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gTestMaxImages, gTestRounding, gEnablePitch, gTestMipmaps; +extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gTestMaxImages, gEnablePitch, gTestMipmaps; extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; extern uint64_t gRoundingStartValue; -size_t random_in_ranges( size_t minimum, size_t rangeA, size_t rangeB, MTdata d ) -{ - if( rangeB < rangeA ) - rangeA = rangeB; - if( rangeA < minimum ) - return rangeA; - return (size_t)random_in_range( (int)minimum, (int)rangeA - 1, d ); -} - static void CL_CALLBACK free_pitch_buffer( cl_mem image, void *buf ) { free( buf ); diff --git a/test_conformance/images/clCopyImage/test_loops.cpp b/test_conformance/images/clCopyImage/test_loops.cpp index acc5ef13..1cb79e98 100644 --- a/test_conformance/images/clCopyImage/test_loops.cpp +++ b/test_conformance/images/clCopyImage/test_loops.cpp @@ -14,6 +14,7 @@ // limitations under the License. // #include "../testBase.h" +#include "../common.h" extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; @@ -36,79 +37,6 @@ extern int test_copy_image_set_2D_3D( cl_device_id device, cl_context context, c extern int test_copy_image_set_2D_2D_array( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format, bool reverse ); extern int test_copy_image_set_3D_2D_array( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format, bool reverse ); - -int filter_formats( cl_image_format *formatList, bool *filterFlags, unsigned int formatCount, cl_channel_type *channelDataTypesToFilter ) -{ - int numSupported = 0; - for( unsigned int j = 0; j < formatCount; j++ ) - { - // If this format has been previously filtered, remove the filter - if( filterFlags[ j ] ) - filterFlags[ j ] = false; - - // Have we already discarded this via the command line? - if( gChannelTypeToUse != (cl_channel_type)-1 && gChannelTypeToUse != formatList[ j ].image_channel_data_type ) - { - filterFlags[ j ] = true; - continue; - } - - // Have we already discarded the channel order via the command line? - if( gChannelOrderToUse != (cl_channel_order)-1 && gChannelOrderToUse != formatList[ j ].image_channel_order ) - { - filterFlags[ j ] = true; - continue; - } - - // Is given format standard channel order and type given by spec. We don't want to test it if this is vendor extension - if( !IsChannelOrderSupported( formatList[ j ].image_channel_order ) || !IsChannelTypeSupported( formatList[ j ].image_channel_data_type ) ) - { - filterFlags[ j ] = true; - continue; - } - - // We don't filter by channel type - if( !channelDataTypesToFilter ) - { - numSupported++; - continue; - } - - // Is the format supported? - int i; - for( i = 0; channelDataTypesToFilter[ i ] != (cl_channel_type)-1; i++ ) - { - if( formatList[ j ].image_channel_data_type == channelDataTypesToFilter[ i ] ) - { - numSupported++; - break; - } - } - if( channelDataTypesToFilter[ i ] == (cl_channel_type)-1 ) - { - // Format is NOT supported, so mark it as such - filterFlags[ j ] = true; - } - } - return numSupported; -} - -int get_format_list( cl_context context, cl_mem_object_type imageType, cl_image_format * &outFormatList, unsigned int &outFormatCount, cl_mem_flags flags ) -{ - int error; - - cl_image_format tempList[ 128 ]; - error = clGetSupportedImageFormats( context, (cl_mem_flags)flags, - imageType, 128, tempList, &outFormatCount ); - test_error( error, "Unable to get count of supported image formats" ); - - outFormatList = new cl_image_format[ outFormatCount ]; - error = clGetSupportedImageFormats( context, (cl_mem_flags)flags, - imageType, outFormatCount, outFormatList, NULL ); - test_error( error, "Unable to get list of supported image formats" ); - return 0; -} - int test_image_type( cl_device_id device, cl_context context, cl_command_queue queue, MethodsToTest testMethod, cl_mem_flags flags ) { const char *name; @@ -243,7 +171,7 @@ int test_image_type( cl_device_id device, cl_context context, cl_command_queue q test_return = test_copy_image_set_3D_2D_array( device, context, queue, &formatList[ i ], false); if (test_return) { - gTestFailure++; + gFailCount++; log_error( "FAILED: " ); print_header( &formatList[ i ], true ); log_info( "\n" ); diff --git a/test_conformance/images/clFillImage/CMakeLists.txt b/test_conformance/images/clFillImage/CMakeLists.txt index 274de2d7..a4de3212 100644 --- a/test_conformance/images/clFillImage/CMakeLists.txt +++ b/test_conformance/images/clFillImage/CMakeLists.txt @@ -11,17 +11,7 @@ set(${MODULE_NAME}_SOURCES test_loops.cpp test_fill_3D.cpp # test_fill_2D_3D.cpp - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/threadTesting.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/imageHelpers.cpp - ../../../test_common/harness/mt19937.c - ../../../test_common/harness/conversions.c - ../../../test_common/harness/typeWrappers.cpp - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c + ../common.cpp ) diff --git a/test_conformance/images/clFillImage/main.cpp b/test_conformance/images/clFillImage/main.cpp index 0cb863f2..23d9e4cc 100644 --- a/test_conformance/images/clFillImage/main.cpp +++ b/test_conformance/images/clFillImage/main.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../../test_common/harness/compat.h" +#include "../harness/compat.h" #include #include @@ -24,17 +24,15 @@ #endif #include "../testBase.h" -#include "../../../test_common/harness/testHarness.h" +#include "../harness/testHarness.h" bool gDebugTrace; bool gTestSmallImages; bool gTestMaxImages; -bool gTestRounding; bool gEnablePitch; int gTypesToTest; cl_channel_type gChannelTypeToUse = (cl_channel_type)-1; cl_channel_order gChannelOrderToUse = (cl_channel_order)-1; -cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT; extern int test_image_set( cl_device_id device, cl_context context, cl_command_queue queue, MethodsToTest testMethod ); static void printUsage( const char *execName ); @@ -77,8 +75,6 @@ int main(int argc, const char *argv[]) cl_channel_type chanType; cl_channel_order chanOrder; - checkDeviceTypeOverride( &gDeviceType ); - const char ** argList = (const char **)calloc( argc, sizeof( char*) ); if( NULL == argList ) @@ -93,16 +89,7 @@ int main(int argc, const char *argv[]) // Parse arguments for ( int i = 1; i < argc; i++ ) { - if ( strcmp( argv[i], "cpu" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_CPU" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_CPU; - else if ( strcmp( argv[i], "gpu" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_GPU" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_GPU; - else if ( strcmp( argv[i], "accelerator" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_ACCELERATOR" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_ACCELERATOR; - else if ( strcmp( argv[i], "CL_DEVICE_TYPE_DEFAULT" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_DEFAULT; - - else if ( strcmp( argv[i], "debug_trace" ) == 0 ) + if ( strcmp( argv[i], "debug_trace" ) == 0 ) gDebugTrace = true; else if ( strcmp( argv[i], "small_images" ) == 0 ) @@ -146,19 +133,6 @@ int main(int argc, const char *argv[]) int ret = runTestHarness( argCount, argList, test_num, test_list, true, false, 0 ); - if (gTestFailure == 0) { - if (gTestCount > 1) - log_info("PASSED %d of %d sub-tests.\n", gTestCount, gTestCount); - else - log_info("PASSED sub-test.\n"); - } - else if (gTestFailure > 0) { - if (gTestCount > 1) - log_error("FAILED %d of %d sub-tests.\n", gTestFailure, gTestCount); - else - log_error("FAILED sub-test.\n"); - } - free(argList); return ret; } diff --git a/test_conformance/images/clFillImage/test_fill_1D.cpp b/test_conformance/images/clFillImage/test_fill_1D.cpp index 767596b0..51eb822b 100644 --- a/test_conformance/images/clFillImage/test_fill_1D.cpp +++ b/test_conformance/images/clFillImage/test_fill_1D.cpp @@ -18,7 +18,7 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding; +extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages; extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; extern uint64_t gRoundingStartValue; diff --git a/test_conformance/images/clFillImage/test_fill_1D_array.cpp b/test_conformance/images/clFillImage/test_fill_1D_array.cpp index 9885cb33..edbcacd9 100644 --- a/test_conformance/images/clFillImage/test_fill_1D_array.cpp +++ b/test_conformance/images/clFillImage/test_fill_1D_array.cpp @@ -18,7 +18,7 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding; +extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages; extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; extern uint64_t gRoundingStartValue; diff --git a/test_conformance/images/clFillImage/test_fill_2D.cpp b/test_conformance/images/clFillImage/test_fill_2D.cpp index a4f25aed..8e76e86c 100644 --- a/test_conformance/images/clFillImage/test_fill_2D.cpp +++ b/test_conformance/images/clFillImage/test_fill_2D.cpp @@ -18,7 +18,7 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding; +extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages; extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; extern uint64_t gRoundingStartValue; diff --git a/test_conformance/images/clFillImage/test_fill_2D_array.cpp b/test_conformance/images/clFillImage/test_fill_2D_array.cpp index b952bdcb..260b869f 100644 --- a/test_conformance/images/clFillImage/test_fill_2D_array.cpp +++ b/test_conformance/images/clFillImage/test_fill_2D_array.cpp @@ -18,7 +18,7 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gTestMaxImages, gEnablePitch, gTestRounding; +extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gTestMaxImages, gEnablePitch; extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; @@ -150,9 +150,27 @@ int test_fill_image_set_2D_array( cl_device_id device, cl_context context, cl_co imageInfo.slicePitch = imageInfo.rowPitch * (imageInfo.height + slicePadding); - log_info( "Testing %d x %d x %d\n", (int)sizes[ idx ][ 0 ], (int)sizes[ idx ][ 1 ], (int)sizes[ idx ][ 2 ] ); - if ( gDebugTrace ) - log_info( " at max size %d,%d,%d\n", (int)sizes[ idx ][ 0 ], (int)sizes[ idx ][ 1 ], (int)sizes[ idx ][ 2 ] ); + // Loop until we get a size that a) will fit in the max alloc size and b) that an allocation of that + // image, the result array, plus offset arrays, will fit in the global ram space + cl_ulong size = (cl_ulong)imageInfo.slicePitch * (cl_ulong)imageInfo.arraySize * 4 * 4; + + while (size > maxAllocSize || (size * 3) > memSize) { + if (imageInfo.arraySize == 1) { + // arraySize cannot be 0. + break; + } + imageInfo.arraySize--; + size = (cl_ulong)imageInfo.slicePitch * (cl_ulong)imageInfo.arraySize * 4 * 4; + } + + while (size > maxAllocSize || (size * 3) > memSize) { + imageInfo.height--; + imageInfo.slicePitch = imageInfo.height * imageInfo.rowPitch; + size = (cl_ulong)imageInfo.slicePitch * (cl_ulong)imageInfo.arraySize * 4 * 4; + } + + log_info( "Testing %d x %d x %d\n", (int)imageInfo.width, (int)imageInfo.height, (int)imageInfo.arraySize); + if ( test_fill_image_2D_array( context, queue, &imageInfo, outputType, seed ) ) return -1; } diff --git a/test_conformance/images/clFillImage/test_fill_3D.cpp b/test_conformance/images/clFillImage/test_fill_3D.cpp index 3fa8f4ed..298db0e7 100644 --- a/test_conformance/images/clFillImage/test_fill_3D.cpp +++ b/test_conformance/images/clFillImage/test_fill_3D.cpp @@ -18,7 +18,7 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gTestMaxImages, gEnablePitch, gTestRounding; +extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gTestMaxImages, gEnablePitch; extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; diff --git a/test_conformance/images/clFillImage/test_fill_generic.cpp b/test_conformance/images/clFillImage/test_fill_generic.cpp index c98c2adf..6b59bada 100644 --- a/test_conformance/images/clFillImage/test_fill_generic.cpp +++ b/test_conformance/images/clFillImage/test_fill_generic.cpp @@ -18,7 +18,7 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gTestMaxImages, gTestRounding, gEnablePitch; +extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gTestMaxImages, gEnablePitch; extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; extern uint64_t gRoundingStartValue; @@ -194,12 +194,26 @@ cl_mem create_image( cl_context context, cl_command_queue queue, BufferOwningPtr } else { // Else copy one scan line at a time. + size_t dstPitch2D = 0; + switch (imageInfo->type) + { + case CL_MEM_OBJECT_IMAGE3D: + case CL_MEM_OBJECT_IMAGE2D_ARRAY: + case CL_MEM_OBJECT_IMAGE2D: + dstPitch2D = mappedRow; + break; + case CL_MEM_OBJECT_IMAGE1D_ARRAY: + case CL_MEM_OBJECT_IMAGE1D: + dstPitch2D = mappedSlice; + break; + } + for ( size_t z = 0; z < depth; z++ ) { for ( size_t y = 0; y < height; y++ ) { memcpy( dst, src, imageInfo->width * get_pixel_size(imageInfo->format) ); - dst += mappedRow; + dst += dstPitch2D; src += scanlineSize; } @@ -417,7 +431,7 @@ int test_fill_image_generic( cl_context context, cl_command_queue queue, image_d if (error != CL_SUCCESS) { log_error( "ERROR: Unable to map image for verification: %s\n", IGetErrorString( error ) ); - return NULL; + return -1; } // Verify scanline by scanline, since the pitches are different @@ -531,6 +545,9 @@ int test_fill_image_generic( cl_context context, cl_command_queue queue, image_d total_matched += scanlineSize; sourcePtr += imageInfo->rowPitch; + if((imageInfo->type == CL_MEM_OBJECT_IMAGE1D_ARRAY || imageInfo->type == CL_MEM_OBJECT_IMAGE1D)) + destPtr += mappedSlice; + else destPtr += mappedRow; } @@ -543,7 +560,7 @@ int test_fill_image_generic( cl_context context, cl_command_queue queue, image_d if (error != CL_SUCCESS) { log_error( "ERROR: Unable to unmap image after verify: %s\n", IGetErrorString( error ) ); - return NULL; + return -1; } imgHost.reset(0x0); diff --git a/test_conformance/images/clFillImage/test_loops.cpp b/test_conformance/images/clFillImage/test_loops.cpp index 03234e7d..0a4c571f 100644 --- a/test_conformance/images/clFillImage/test_loops.cpp +++ b/test_conformance/images/clFillImage/test_loops.cpp @@ -14,6 +14,7 @@ // limitations under the License. // #include "../testBase.h" +#include "../common.h" extern bool gDebugTrace; extern cl_filter_mode gFilterModeToUse; @@ -29,114 +30,45 @@ extern int test_fill_image_set_2D( cl_device_id device, cl_context context, cl_c extern int test_fill_image_set_3D( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format, ExplicitType outputType ); extern int test_fill_image_set_1D_array( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format, ExplicitType outputType ); extern int test_fill_image_set_2D_array( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format, ExplicitType outputType ); - - -int filter_formats( cl_image_format *formatList, bool *filterFlags, unsigned int formatCount, cl_channel_type *channelDataTypesToFilter ) -{ - int numSupported = 0; - for ( unsigned int j = 0; j < formatCount; j++ ) - { - // If this format has been previously filtered, remove the filter - if ( filterFlags[ j ] ) - filterFlags[ j ] = false; - - // Have we already discarded this via the command line? - if ( gChannelTypeToUse != (cl_channel_type)-1 && gChannelTypeToUse != formatList[ j ].image_channel_data_type ) - { - filterFlags[ j ] = true; - continue; - } - - // Have we already discarded the channel order via the command line? - if ( gChannelOrderToUse != (cl_channel_order)-1 && gChannelOrderToUse != formatList[ j ].image_channel_order ) - { - filterFlags[ j ] = true; - continue; - } - - // Is given format standard channel order and type given by spec. We don't want to test it if this is vendor extension - if( !IsChannelOrderSupported( formatList[ j ].image_channel_order ) || !IsChannelTypeSupported( formatList[ j ].image_channel_data_type ) ) - { - filterFlags[ j ] = true; - continue; - } - - // We don't filter by channel type - if( !channelDataTypesToFilter ) - { - numSupported++; - continue; - } - - // Is the format supported? - int i; - for ( i = 0; channelDataTypesToFilter[ i ] != (cl_channel_type)-1; i++ ) - { - if ( formatList[ j ].image_channel_data_type == channelDataTypesToFilter[ i ] ) - { - numSupported++; - break; - } - } - if ( channelDataTypesToFilter[ i ] == (cl_channel_type)-1 ) - { - // Format is NOT supported, so mark it as such - filterFlags[ j ] = true; - } - - - } - return numSupported; -} - - -int get_format_list( cl_context context, cl_mem_object_type image_type, cl_image_format * &outFormatList, - unsigned int &outFormatCount, cl_mem_flags flags ) -{ - int error; - - cl_image_format tempList[ 128 ]; - error = clGetSupportedImageFormats( context, (cl_mem_flags)flags, - image_type, 128, tempList, &outFormatCount ); - test_error( error, "Unable to get count of supported image formats" ); - - outFormatList = new cl_image_format[ outFormatCount ]; - error = clGetSupportedImageFormats( context, (cl_mem_flags)flags, - image_type, outFormatCount, outFormatList, NULL ); - test_error( error, "Unable to get list of supported image formats" ); - return 0; -} - +typedef int (*test_func)(cl_device_id device, cl_context context, + cl_command_queue queue, cl_image_format *format, + ExplicitType outputType); int test_image_type( cl_device_id device, cl_context context, cl_command_queue queue, MethodsToTest testMethod, cl_mem_flags flags ) { const char *name; cl_mem_object_type imageType; + test_func test_fn; if ( testMethod == k1D ) { name = "1D Image Fill"; imageType = CL_MEM_OBJECT_IMAGE1D; + test_fn = &test_fill_image_set_1D; } else if ( testMethod == k2D ) { name = "2D Image Fill"; imageType = CL_MEM_OBJECT_IMAGE2D; + test_fn = &test_fill_image_set_2D; } else if ( testMethod == k1DArray ) { name = "1D Image Array Fill"; imageType = CL_MEM_OBJECT_IMAGE1D_ARRAY; + test_fn = &test_fill_image_set_1D_array; } else if ( testMethod == k2DArray ) { name = "2D Image Array Fill"; imageType = CL_MEM_OBJECT_IMAGE2D_ARRAY; + test_fn = &test_fill_image_set_2D_array; } else if ( testMethod == k3D ) { name = "3D Image Fill"; imageType = CL_MEM_OBJECT_IMAGE3D; + test_fn = &test_fill_image_set_3D; } log_info( "Running %s tests...\n", name ); @@ -159,157 +91,49 @@ int test_image_type( cl_device_id device, cl_context context, cl_command_queue q } memset( filterFlags, 0, sizeof( bool ) * numFormats ); - /////// float tests /////// - - if( gTypesToTest & kTestFloat ) + for (auto test : imageTestTypes) { - cl_channel_type floatFormats[] = { CL_UNORM_SHORT_565, CL_UNORM_SHORT_555, CL_UNORM_INT_101010, -#ifdef OBSOLETE_FORAMT - CL_UNORM_SHORT_565_REV, CL_UNORM_SHORT_555_REV, CL_UNORM_INT_8888, CL_UNORM_INT_8888_REV, CL_UNORM_INT_101010_REV, -#endif -#ifdef CL_SFIXED14_APPLE - CL_SFIXED14_APPLE, -#endif - CL_UNORM_INT8, CL_SNORM_INT8, - CL_UNORM_INT16, CL_SNORM_INT16, CL_FLOAT, CL_HALF_FLOAT, (cl_channel_type)-1 }; - if( filter_formats( formatList, filterFlags, numFormats, floatFormats ) == 0 ) + if (gTypesToTest & test.type) { - log_info( "No formats supported for float type\n" ); - } - else - { - // Run the format list - for ( unsigned int i = 0; i < numFormats; i++ ) + if (filter_formats(formatList, filterFlags, numFormats, + test.channelTypes) + == 0) { - int test_return = 0; - if ( filterFlags[i] ) + log_info("No formats supported for %s type\n", test.name); + } + else + { + // Run the format list + for (unsigned int i = 0; i < numFormats; i++) { - continue; + if (filterFlags[i]) + { + continue; + } + + print_header(&formatList[i], false); + + gTestCount++; + + int test_return = + test_fn(device, context, queue, &formatList[i], + test.explicitType); + if (test_return) + { + gFailCount++; + log_error("FAILED: "); + print_header(&formatList[i], true); + log_info("\n"); + } + + ret += test_return; } - - print_header( &formatList[ i ], false ); - - gTestCount++; - - if ( testMethod == k1D ) - test_return = test_fill_image_set_1D( device, context, queue, &formatList[ i ], kFloat ); - else if ( testMethod == k2D ) - test_return = test_fill_image_set_2D( device, context, queue, &formatList[ i ], kFloat ); - else if ( testMethod == k1DArray ) - test_return = test_fill_image_set_1D_array( device, context, queue, &formatList[ i ], kFloat ); - else if ( testMethod == k2DArray ) - test_return = test_fill_image_set_2D_array( device, context, queue, &formatList[ i ], kFloat ); - else if ( testMethod == k3D ) - test_return = test_fill_image_set_3D( device, context, queue, &formatList[ i ], kFloat ); - - if (test_return) - { - gTestFailure++; - log_error( "FAILED: " ); - print_header( &formatList[ i ], true ); - log_info( "\n" ); - } - - ret += test_return; } } } - /////// int tests /////// - if( gTypesToTest & kTestInt ) - { - cl_channel_type intFormats[] = { CL_SIGNED_INT8, CL_SIGNED_INT16, CL_SIGNED_INT32, (cl_channel_type)-1 }; - if( filter_formats( formatList, filterFlags, numFormats, intFormats ) == 0 ) - { - log_info( "No formats supported for integer type\n" ); - } - else - { - // Run the format list - for ( unsigned int i = 0; i < numFormats; i++ ) - { - int test_return = 0; - if ( filterFlags[i] ) - { - continue; - } - - print_header( &formatList[ i ], false ); - - gTestCount++; - - if ( testMethod == k1D ) - test_return = test_fill_image_set_1D( device, context, queue, &formatList[ i ], kInt ); - else if ( testMethod == k2D ) - test_return = test_fill_image_set_2D( device, context, queue, &formatList[ i ], kInt ); - else if ( testMethod == k1DArray ) - test_return = test_fill_image_set_1D_array( device, context, queue, &formatList[ i ], kInt ); - else if ( testMethod == k2DArray ) - test_return = test_fill_image_set_2D_array( device, context, queue, &formatList[ i ], kInt ); - else if ( testMethod == k3D ) - test_return = test_fill_image_set_3D( device, context, queue, &formatList[ i ], kInt ); - - if (test_return) { - gTestFailure++; - log_error( "FAILED: " ); - print_header( &formatList[ i ], true ); - log_info( "\n" ); - } - - ret += test_return; - } - } - } - - /////// uint tests /////// - - if( gTypesToTest & kTestUInt ) - { - cl_channel_type uintFormats[] = { CL_UNSIGNED_INT8, CL_UNSIGNED_INT16, CL_UNSIGNED_INT32, (cl_channel_type)-1 }; - if( filter_formats( formatList, filterFlags, numFormats, uintFormats ) == 0 ) - { - log_info( "No formats supported for unsigned int type\n" ); - } - else - { - // Run the format list - for ( unsigned int i = 0; i < numFormats; i++ ) - { - int test_return = 0; - if ( filterFlags[i] ) - { - continue; - } - - print_header( &formatList[ i ], false ); - - gTestCount++; - - if ( testMethod == k1D ) - test_return = test_fill_image_set_1D( device, context, queue, &formatList[ i ], kUInt ); - else if ( testMethod == k2D ) - test_return = test_fill_image_set_2D( device, context, queue, &formatList[ i ], kUInt ); - else if ( testMethod == k1DArray ) - test_return = test_fill_image_set_1D_array( device, context, queue, &formatList[ i ], kUInt ); - else if ( testMethod == k2DArray ) - test_return = test_fill_image_set_2D_array( device, context, queue, &formatList[ i ], kUInt ); - else if ( testMethod == k3D ) - test_return = test_fill_image_set_3D( device, context, queue, &formatList[ i ], kUInt ); - - if (test_return) { - gTestFailure++; - log_error( "FAILED: " ); - print_header( &formatList[ i ], true ); - log_info( "\n" ); - } - - ret += test_return; - } - } - } - - delete filterFlags; - delete formatList; + delete[] filterFlags; + delete[] formatList; return ret; } diff --git a/test_conformance/images/clGetInfo/CMakeLists.txt b/test_conformance/images/clGetInfo/CMakeLists.txt index 7722f788..f71c49ce 100644 --- a/test_conformance/images/clGetInfo/CMakeLists.txt +++ b/test_conformance/images/clGetInfo/CMakeLists.txt @@ -7,17 +7,7 @@ set(${MODULE_NAME}_SOURCES test_2D.cpp test_loops.cpp test_3D.cpp - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/threadTesting.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/imageHelpers.cpp - ../../../test_common/harness/mt19937.c - ../../../test_common/harness/conversions.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/typeWrappers.cpp - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c + ../common.cpp ) include(../../CMakeCommon.txt) diff --git a/test_conformance/images/clGetInfo/main.cpp b/test_conformance/images/clGetInfo/main.cpp index 3c8d9e95..cea2ad66 100644 --- a/test_conformance/images/clGetInfo/main.cpp +++ b/test_conformance/images/clGetInfo/main.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../../test_common/harness/compat.h" +#include "../harness/compat.h" #include #include @@ -28,10 +28,9 @@ bool gDebugTrace; bool gTestSmallImages; bool gTestMaxImages; -bool gTestRounding; int gTypesToTest; cl_channel_type gChannelTypeToUse = (cl_channel_type)-1; -cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT; +cl_channel_order gChannelOrderToUse = (cl_channel_order)-1; extern int test_image_set( cl_device_id device, cl_context context, cl_mem_object_type image_type ); static void printUsage( const char *execName ); @@ -79,8 +78,6 @@ int main(int argc, const char *argv[]) { cl_channel_type chanType; - checkDeviceTypeOverride( &gDeviceType ); - const char ** argList = (const char **)calloc( argc, sizeof( char*) ); if( NULL == argList ) @@ -95,16 +92,7 @@ int main(int argc, const char *argv[]) // Parse arguments for( int i = 1; i < argc; i++ ) { - if( strcmp( argv[i], "cpu" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_CPU" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_CPU; - else if( strcmp( argv[i], "gpu" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_GPU" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_GPU; - else if( strcmp( argv[i], "accelerator" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_ACCELERATOR" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_ACCELERATOR; - else if( strcmp( argv[i], "CL_DEVICE_TYPE_DEFAULT" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_DEFAULT; - - else if( strcmp( argv[i], "debug_trace" ) == 0 ) + if( strcmp( argv[i], "debug_trace" ) == 0 ) gDebugTrace = true; else if( strcmp( argv[i], "small_images" ) == 0 ) @@ -131,19 +119,6 @@ int main(int argc, const char *argv[]) int ret = runTestHarness( argCount, argList, test_num, test_list, true, false, 0 ); - if (gTestFailure == 0) { - if (gTestCount > 1) - log_info("PASSED %d of %d sub-tests.\n", gTestCount, gTestCount); - else - log_info("PASSED sub-test.\n"); - } else if (gTestFailure > 0) { - if (gTestCount > 1) - log_error("FAILED %d of %d sub-tests.\n", gTestFailure, gTestCount); - else - log_error("FAILED sub-test.\n"); - } - - free(argList); return ret; } diff --git a/test_conformance/images/clGetInfo/test_2D.cpp b/test_conformance/images/clGetInfo/test_2D.cpp index 4a72735d..49537075 100644 --- a/test_conformance/images/clGetInfo/test_2D.cpp +++ b/test_conformance/images/clGetInfo/test_2D.cpp @@ -132,7 +132,7 @@ int test_get_image_info_single( cl_context context, image_descriptor *imageInfo, size_t outSlicePitch; error = clGetImageInfo( image, CL_IMAGE_SLICE_PITCH, sizeof( outSlicePitch ), &outSlicePitch, NULL ); - test_error( error, "Unable to get image info (row pitch)" ); + test_error( error, "Unable to get image info (slice pitch)" ); if( imageInfo->type == CL_MEM_OBJECT_IMAGE1D && outSlicePitch != 0 ) { log_error( "ERROR: slice pitch returned is invalid! (expected %d, got %d)\n", diff --git a/test_conformance/images/clGetInfo/test_loops.cpp b/test_conformance/images/clGetInfo/test_loops.cpp index 07d0edb4..e64ec3b9 100644 --- a/test_conformance/images/clGetInfo/test_loops.cpp +++ b/test_conformance/images/clGetInfo/test_loops.cpp @@ -14,6 +14,10 @@ // limitations under the License. // #include "../testBase.h" +#include "../common.h" +#include "harness/imageHelpers.h" +#include +#include extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; @@ -30,101 +34,28 @@ extern int test_get_image_info_3D( cl_device_id device, cl_context context, cl_i extern int test_get_image_info_1D_array( cl_device_id device, cl_context context, cl_image_format *format, cl_mem_flags flags ); extern int test_get_image_info_2D_array( cl_device_id device, cl_context context, cl_image_format *format, cl_mem_flags flags ); -static const char *str_1d_image = "1D"; -static const char *str_2d_image = "2D"; -static const char *str_3d_image = "3D"; -static const char *str_1d_image_array = "1D array"; -static const char *str_2d_image_array = "2D array"; - -static const char *convert_image_type_to_string(cl_mem_object_type image_type) +static bool check_minimum_supported(cl_image_format *formatList, + unsigned int numFormats, + cl_mem_flags flags, + cl_mem_object_type image_type, + cl_device_id device) { - const char *p; - switch (image_type) - { - case CL_MEM_OBJECT_IMAGE1D: - p = str_1d_image; - break; - case CL_MEM_OBJECT_IMAGE2D: - p = str_2d_image; - break; - case CL_MEM_OBJECT_IMAGE3D: - p = str_3d_image; - break; - case CL_MEM_OBJECT_IMAGE1D_ARRAY: - p = str_1d_image_array; - break; - case CL_MEM_OBJECT_IMAGE2D_ARRAY: - p = str_2d_image_array; - break; - } - return p; -} + bool passed = true; + Version version = get_device_cl_version(device); + std::vector formatsToSupport; + build_required_image_formats(flags, image_type, device, formatsToSupport); + for (auto &format: formatsToSupport) + { + if( !find_format( formatList, numFormats, &format ) ) + { + log_error( "ERROR: Format required by OpenCL %s is not supported: ", version.to_string().c_str() ); + print_header( &format, true ); + passed = false; + } + } -int filter_formats( cl_image_format *formatList, bool *filterFlags, unsigned int formatCount, cl_channel_type *channelDataTypesToFilter ) -{ - int numSupported = 0; - for( unsigned int j = 0; j < formatCount; j++ ) - { - // If this format has been previously filtered, remove the filter - if( filterFlags[ j ] ) - filterFlags[ j ] = false; - - // Have we already discarded this via the command line? - if( gChannelTypeToUse != (cl_channel_type)-1 && gChannelTypeToUse != formatList[ j ].image_channel_data_type ) - { - filterFlags[ j ] = true; - continue; - } - - // Is given format standard channel order and type given by spec. We don't want to test it if this is vendor extension - if( !IsChannelOrderSupported( formatList[ j ].image_channel_order ) || !IsChannelTypeSupported( formatList[ j ].image_channel_data_type ) ) - { - filterFlags[ j ] = true; - continue; - } - - // We don't filter by channel type - if( !channelDataTypesToFilter ) - { - numSupported++; - continue; - } - - // Is the format supported? - int i; - for( i = 0; channelDataTypesToFilter[ i ] != (cl_channel_type)-1; i++ ) - { - if( formatList[ j ].image_channel_data_type == channelDataTypesToFilter[ i ] ) - { - numSupported++; - break; - } - } - if( channelDataTypesToFilter[ i ] == (cl_channel_type)-1 ) - { - // Format is NOT supported, so mark it as such - filterFlags[ j ] = true; - } - } - return numSupported; -} - -int get_format_list( cl_context context, cl_mem_object_type image_type, cl_image_format * &outFormatList, - unsigned int &outFormatCount, cl_mem_flags flags ) -{ - int error; - - cl_image_format tempList[ 128 ]; - error = clGetSupportedImageFormats( context, (cl_mem_flags)flags, - image_type, 128, tempList, &outFormatCount ); - test_error( error, "Unable to get count of supported image formats" ); - - outFormatList = new cl_image_format[ outFormatCount ]; - error = clGetSupportedImageFormats( context, (cl_mem_flags)flags, - image_type, outFormatCount, outFormatList, NULL ); - test_error( error, "Unable to get list of supported image formats" ); - return 0; + return passed; } int test_image_type( cl_device_id device, cl_context context, cl_mem_object_type image_type, cl_mem_flags flags ) @@ -147,7 +78,7 @@ int test_image_type( cl_device_id device, cl_context context, cl_mem_object_type log_info("No requirement for 3D write in OpenCL 1.2. Not checking formats.\n"); } else { log_info("Checking for required OpenCL 1.2 formats.\n"); - if (check_minimum_supported( formatList, numFormats, flags ) == false) { + if (check_minimum_supported( formatList, numFormats, flags, image_type, device ) == false) { ret++; } else { log_info("All required formats present.\n"); @@ -199,7 +130,7 @@ int test_image_type( cl_device_id device, cl_context context, cl_mem_object_type } if (test_return) { - gTestFailure++; + gFailCount++; log_error( "FAILED: " ); print_header( &formatList[ i ], true ); log_info( "\n" ); diff --git a/test_conformance/images/clReadWriteImage/CMakeLists.txt b/test_conformance/images/clReadWriteImage/CMakeLists.txt index 557d94df..9308bbfe 100644 --- a/test_conformance/images/clReadWriteImage/CMakeLists.txt +++ b/test_conformance/images/clReadWriteImage/CMakeLists.txt @@ -8,17 +8,7 @@ set(${MODULE_NAME}_SOURCES test_read_2D_array.cpp test_loops.cpp test_read_3D.cpp - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/threadTesting.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/imageHelpers.cpp - ../../../test_common/harness/mt19937.c - ../../../test_common/harness/conversions.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/typeWrappers.cpp - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c + ../common.cpp ) include(../../CMakeCommon.txt) diff --git a/test_conformance/images/clReadWriteImage/main.cpp b/test_conformance/images/clReadWriteImage/main.cpp index a74b198e..d8d096ee 100644 --- a/test_conformance/images/clReadWriteImage/main.cpp +++ b/test_conformance/images/clReadWriteImage/main.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../../test_common/harness/compat.h" +#include "../harness/compat.h" #include #include @@ -29,12 +29,11 @@ bool gDebugTrace; bool gTestSmallImages; bool gTestMaxImages; bool gUseRamp; -bool gTestRounding; bool gTestMipmaps; int gTypesToTest; cl_channel_type gChannelTypeToUse = (cl_channel_type)-1; +cl_channel_order gChannelOrderToUse = (cl_channel_order)-1; bool gEnablePitch = false; -cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT; #define MAX_ALLOWED_STD_DEVIATION_IN_MB 8.0 @@ -77,8 +76,6 @@ int main(int argc, const char *argv[]) { cl_channel_type chanType; - checkDeviceTypeOverride( &gDeviceType ); - const char ** argList = (const char **)calloc( argc, sizeof( char*) ); if( NULL == argList ) @@ -93,16 +90,7 @@ int main(int argc, const char *argv[]) // Parse arguments for( int i = 1; i < argc; i++ ) { - if( strcmp( argv[i], "cpu" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_CPU" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_CPU; - else if( strcmp( argv[i], "gpu" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_GPU" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_GPU; - else if( strcmp( argv[i], "accelerator" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_ACCELERATOR" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_ACCELERATOR; - else if( strcmp( argv[i], "CL_DEVICE_TYPE_DEFAULT" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_DEFAULT; - - else if( strcmp( argv[i], "debug_trace" ) == 0 ) + if( strcmp( argv[i], "debug_trace" ) == 0 ) gDebugTrace = true; else if( strcmp( argv[i], "small_images" ) == 0 ) @@ -138,18 +126,6 @@ int main(int argc, const char *argv[]) int ret = runTestHarness( argCount, argList, test_num, test_list, true, false, 0 ); - if (gTestFailure == 0) { - if (gTestCount > 1) - log_info("PASSED %d of %d sub-tests.\n", gTestCount, gTestCount); - else - log_info("PASSED sub-test.\n"); - } else if (gTestFailure > 0) { - if (gTestCount > 1) - log_error("FAILED %d of %d sub-tests.\n", gTestFailure, gTestCount); - else - log_error("FAILED sub-test.\n"); - } - free(argList); return ret; } diff --git a/test_conformance/images/clReadWriteImage/test_loops.cpp b/test_conformance/images/clReadWriteImage/test_loops.cpp index 53f50c7d..e8ca8c8f 100644 --- a/test_conformance/images/clReadWriteImage/test_loops.cpp +++ b/test_conformance/images/clReadWriteImage/test_loops.cpp @@ -14,6 +14,7 @@ // limitations under the License. // #include "../testBase.h" +#include "../common.h" extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; @@ -31,102 +32,6 @@ extern int test_read_image_set_3D( cl_device_id device, cl_context context, cl_c extern int test_read_image_set_1D_array( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format ); extern int test_read_image_set_2D_array( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format ); -static const char *str_1d_image = "1D"; -static const char *str_2d_image = "2D"; -static const char *str_3d_image = "3D"; -static const char *str_1d_image_array = "1D array"; -static const char *str_2d_image_array = "2D array"; - -static const char *convert_image_type_to_string(cl_mem_object_type imageType) -{ - const char *p; - switch (imageType) - { - case CL_MEM_OBJECT_IMAGE1D: - p = str_1d_image; - break; - case CL_MEM_OBJECT_IMAGE2D: - p = str_2d_image; - break; - case CL_MEM_OBJECT_IMAGE3D: - p = str_3d_image; - break; - case CL_MEM_OBJECT_IMAGE1D_ARRAY: - p = str_1d_image_array; - break; - case CL_MEM_OBJECT_IMAGE2D_ARRAY: - p = str_2d_image_array; - break; - } - return p; -} - - -int filter_formats( cl_image_format *formatList, bool *filterFlags, unsigned int formatCount, cl_channel_type *channelDataTypesToFilter ) -{ - int numSupported = 0; - for( unsigned int j = 0; j < formatCount; j++ ) - { - // If this format has been previously filtered, remove the filter - if( filterFlags[ j ] ) - filterFlags[ j ] = false; - - // Have we already discarded this via the command line? - if( gChannelTypeToUse != (cl_channel_type)-1 && gChannelTypeToUse != formatList[ j ].image_channel_data_type ) - { - filterFlags[ j ] = true; - continue; - } - - // Is given format standard channel order and type given by spec. We don't want to test it if this is vendor extension - if( !IsChannelOrderSupported( formatList[ j ].image_channel_order ) || !IsChannelTypeSupported( formatList[ j ].image_channel_data_type ) ) - { - filterFlags[ j ] = true; - continue; - } - - // We don't filter by channel type - if( !channelDataTypesToFilter ) - { - numSupported++; - continue; - } - - // Is the format supported? - int i; - for( i = 0; channelDataTypesToFilter[ i ] != (cl_channel_type)-1; i++ ) - { - if( formatList[ j ].image_channel_data_type == channelDataTypesToFilter[ i ] ) - { - numSupported++; - break; - } - } - if( channelDataTypesToFilter[ i ] == (cl_channel_type)-1 ) - { - // Format is NOT supported, so mark it as such - filterFlags[ j ] = true; - } - } - return numSupported; -} - -int get_format_list( cl_context context, cl_mem_object_type imageType, cl_image_format * &outFormatList, unsigned int &outFormatCount, cl_mem_flags flags ) -{ - int error; - - cl_image_format tempList[ 128 ]; - error = clGetSupportedImageFormats( context, (cl_mem_flags)flags, - imageType, 128, tempList, &outFormatCount ); - test_error( error, "Unable to get count of supported image formats" ); - - outFormatList = new cl_image_format[ outFormatCount ]; - error = clGetSupportedImageFormats( context, (cl_mem_flags)flags, - imageType, outFormatCount, outFormatList, NULL ); - test_error( error, "Unable to get list of supported image formats" ); - return 0; -} - int test_image_type( cl_device_id device, cl_context context, cl_command_queue queue, cl_mem_object_type imageType, cl_mem_flags flags ) { log_info( "Running %s %s %s-only tests...\n", gTestMipmaps?"mipmapped":"",convert_image_type_to_string(imageType), flags == CL_MEM_READ_ONLY ? "read" : "write" ); @@ -195,7 +100,7 @@ int test_image_type( cl_device_id device, cl_context context, cl_command_queue q } if (test_return) { - gTestFailure++; + gFailCount++; log_error( "FAILED: " ); print_header( &formatList[ i ], true ); log_info( "\n" ); @@ -204,8 +109,8 @@ int test_image_type( cl_device_id device, cl_context context, cl_command_queue q ret += test_return; } - delete filterFlags; - delete formatList; + delete[] filterFlags; + delete[] formatList; return ret; } diff --git a/test_conformance/images/clReadWriteImage/test_read_1D.cpp b/test_conformance/images/clReadWriteImage/test_read_1D.cpp index e85e7c7d..7d9eb845 100644 --- a/test_conformance/images/clReadWriteImage/test_read_1D.cpp +++ b/test_conformance/images/clReadWriteImage/test_read_1D.cpp @@ -18,7 +18,7 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding, gTestMipmaps; +extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps; extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; extern uint64_t gRoundingStartValue; diff --git a/test_conformance/images/clReadWriteImage/test_read_1D_array.cpp b/test_conformance/images/clReadWriteImage/test_read_1D_array.cpp index 059ed122..3f845564 100644 --- a/test_conformance/images/clReadWriteImage/test_read_1D_array.cpp +++ b/test_conformance/images/clReadWriteImage/test_read_1D_array.cpp @@ -18,7 +18,7 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding, gTestMipmaps; +extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps; extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; extern uint64_t gRoundingStartValue; diff --git a/test_conformance/images/clReadWriteImage/test_read_2D.cpp b/test_conformance/images/clReadWriteImage/test_read_2D.cpp index 4388a8d0..0eae51b5 100644 --- a/test_conformance/images/clReadWriteImage/test_read_2D.cpp +++ b/test_conformance/images/clReadWriteImage/test_read_2D.cpp @@ -18,7 +18,7 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding, gTestMipmaps; +extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps; extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; extern uint64_t gRoundingStartValue; diff --git a/test_conformance/images/clReadWriteImage/test_read_2D_array.cpp b/test_conformance/images/clReadWriteImage/test_read_2D_array.cpp index 99cd27c7..547e5eb4 100644 --- a/test_conformance/images/clReadWriteImage/test_read_2D_array.cpp +++ b/test_conformance/images/clReadWriteImage/test_read_2D_array.cpp @@ -18,7 +18,7 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding, gTestMipmaps; +extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps; extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; diff --git a/test_conformance/images/clReadWriteImage/test_read_3D.cpp b/test_conformance/images/clReadWriteImage/test_read_3D.cpp index 34df35a3..16baeebf 100644 --- a/test_conformance/images/clReadWriteImage/test_read_3D.cpp +++ b/test_conformance/images/clReadWriteImage/test_read_3D.cpp @@ -18,7 +18,7 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding, gTestMipmaps; +extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps; extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; diff --git a/test_conformance/images/common.cpp b/test_conformance/images/common.cpp new file mode 100644 index 00000000..9e542612 --- /dev/null +++ b/test_conformance/images/common.cpp @@ -0,0 +1,167 @@ +// +// Copyright (c) 2020 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "common.h" + +cl_channel_type floatFormats[] = { + CL_UNORM_SHORT_565, + CL_UNORM_SHORT_555, + CL_UNORM_INT_101010, +#ifdef OBSOLETE_FORAMT + CL_UNORM_SHORT_565_REV, + CL_UNORM_SHORT_555_REV, + CL_UNORM_INT_8888, + CL_UNORM_INT_8888_REV, + CL_UNORM_INT_101010_REV, +#endif +#ifdef CL_SFIXED14_APPLE + CL_SFIXED14_APPLE, +#endif + CL_UNORM_INT8, + CL_SNORM_INT8, + CL_UNORM_INT16, + CL_SNORM_INT16, + CL_FLOAT, + CL_HALF_FLOAT, + (cl_channel_type)-1, +}; + +cl_channel_type intFormats[] = { + CL_SIGNED_INT8, + CL_SIGNED_INT16, + CL_SIGNED_INT32, + (cl_channel_type)-1, +}; + +cl_channel_type uintFormats[] = { + CL_UNSIGNED_INT8, + CL_UNSIGNED_INT16, + CL_UNSIGNED_INT32, + (cl_channel_type)-1, +}; + +std::array imageTestTypes = { { + { kTestInt, kInt, intFormats, "int" }, + { kTestUInt, kUInt, uintFormats, "uint" }, + { kTestFloat, kFloat, floatFormats, "float" }, +} }; + +const char *convert_image_type_to_string(cl_mem_object_type image_type) +{ + switch (image_type) + { + case CL_MEM_OBJECT_IMAGE1D: return "1D"; + case CL_MEM_OBJECT_IMAGE2D: return "2D"; + case CL_MEM_OBJECT_IMAGE3D: return "3D"; + case CL_MEM_OBJECT_IMAGE1D_ARRAY: return "1D array"; + case CL_MEM_OBJECT_IMAGE2D_ARRAY: return "2D array"; + case CL_MEM_OBJECT_IMAGE1D_BUFFER: return "1D image buffer"; + default: return "unrecognized object type"; + } +} + +int filter_formats(cl_image_format *formatList, bool *filterFlags, + unsigned int formatCount, + cl_channel_type *channelDataTypesToFilter, + bool testMipmaps /*=false*/) +{ + int numSupported = 0; + for (unsigned int j = 0; j < formatCount; j++) + { + // If this format has been previously filtered, remove the filter + if (filterFlags[j]) filterFlags[j] = false; + + // skip mipmap tests for CL_DEPTH formats (re# Khronos Bug 13762) + if (testMipmaps && (formatList[j].image_channel_order == CL_DEPTH)) + { + log_info("Skip mipmap tests for CL_DEPTH format\n"); + filterFlags[j] = true; + continue; + } + + // Have we already discarded the channel type via the command line? + if (gChannelTypeToUse != (cl_channel_type)-1 + && gChannelTypeToUse != formatList[j].image_channel_data_type) + { + filterFlags[j] = true; + continue; + } + + // Have we already discarded the channel order via the command line? + if (gChannelOrderToUse != (cl_channel_order)-1 + && gChannelOrderToUse != formatList[j].image_channel_order) + { + filterFlags[j] = true; + continue; + } + + // Is given format standard channel order and type given by spec. We + // don't want to test it if this is vendor extension + if (!IsChannelOrderSupported(formatList[j].image_channel_order) + || !IsChannelTypeSupported(formatList[j].image_channel_data_type)) + { + filterFlags[j] = true; + continue; + } + + if (!channelDataTypesToFilter) + { + numSupported++; + continue; + } + + // Is the format supported? + int i; + for (i = 0; channelDataTypesToFilter[i] != (cl_channel_type)-1; i++) + { + if (formatList[j].image_channel_data_type + == channelDataTypesToFilter[i]) + { + numSupported++; + break; + } + } + if (channelDataTypesToFilter[i] == (cl_channel_type)-1) + { + // Format is NOT supported, so mark it as such + filterFlags[j] = true; + } + } + return numSupported; +} + +int get_format_list(cl_context context, cl_mem_object_type imageType, + cl_image_format *&outFormatList, + unsigned int &outFormatCount, cl_mem_flags flags) +{ + int error = clGetSupportedImageFormats(context, flags, imageType, 0, NULL, + &outFormatCount); + test_error(error, "Unable to get count of supported image formats"); + + outFormatList = + (outFormatCount > 0) ? new cl_image_format[outFormatCount] : NULL; + + error = clGetSupportedImageFormats(context, flags, imageType, + outFormatCount, outFormatList, NULL); + test_error(error, "Unable to get list of supported image formats"); + return 0; +} + +size_t random_in_ranges(size_t minimum, size_t rangeA, size_t rangeB, MTdata d) +{ + if (rangeB < rangeA) rangeA = rangeB; + if (rangeA < minimum) return rangeA; + return (size_t)random_in_range((int)minimum, (int)rangeA - 1, d); +} diff --git a/test_conformance/images/common.h b/test_conformance/images/common.h new file mode 100644 index 00000000..114623e4 --- /dev/null +++ b/test_conformance/images/common.h @@ -0,0 +1,53 @@ +// +// Copyright (c) 2020 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#ifndef IMAGES_COMMON_H +#define IMAGES_COMMON_H + +#include "testBase.h" +#include "harness/kernelHelpers.h" +#include "harness/errorHelpers.h" +#include "harness/conversions.h" + +#include + +extern cl_channel_type gChannelTypeToUse; +extern cl_channel_order gChannelOrderToUse; + +extern cl_channel_type floatFormats[]; +extern cl_channel_type intFormats[]; +extern cl_channel_type uintFormats[]; + +struct ImageTestTypes +{ + TypesToTest type; + ExplicitType explicitType; + cl_channel_type *channelTypes; + const char *name; +}; + +extern std::array imageTestTypes; + +const char *convert_image_type_to_string(cl_mem_object_type imageType); +int filter_formats(cl_image_format *formatList, bool *filterFlags, + unsigned int formatCount, + cl_channel_type *channelDataTypesToFilter, + bool testMipmaps = false); +int get_format_list(cl_context context, cl_mem_object_type imageType, + cl_image_format *&outFormatList, + unsigned int &outFormatCount, cl_mem_flags flags); +size_t random_in_ranges(size_t minimum, size_t rangeA, size_t rangeB, MTdata d); + +#endif // IMAGES_COMMON_H diff --git a/test_conformance/images/kernel_image_methods/CMakeLists.txt b/test_conformance/images/kernel_image_methods/CMakeLists.txt index e0477424..b06e7d5c 100644 --- a/test_conformance/images/kernel_image_methods/CMakeLists.txt +++ b/test_conformance/images/kernel_image_methods/CMakeLists.txt @@ -8,17 +8,7 @@ set(${MODULE_NAME}_SOURCES test_2D_array.cpp test_loops.cpp test_3D.cpp - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/threadTesting.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/imageHelpers.cpp - ../../../test_common/harness/mt19937.c - ../../../test_common/harness/conversions.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/typeWrappers.cpp - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c + ../common.cpp ) include(../../CMakeCommon.txt) diff --git a/test_conformance/images/kernel_image_methods/main.cpp b/test_conformance/images/kernel_image_methods/main.cpp index d9f6c029..ef6bd2cb 100644 --- a/test_conformance/images/kernel_image_methods/main.cpp +++ b/test_conformance/images/kernel_image_methods/main.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -13,8 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../../test_common/harness/compat.h" -#include "../../../test_common/harness/parseParameters.h" +#include "../harness/compat.h" +#include "../harness/parseParameters.h" #include #include @@ -29,10 +29,11 @@ bool gDebugTrace; bool gTestSmallImages; bool gTestMaxImages; -bool gTestRounding; int gTypesToTest; +bool gDeviceLt20 = false; + cl_channel_type gChannelTypeToUse = (cl_channel_type)-1; -cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT; +cl_channel_order gChannelOrderToUse = (cl_channel_order)-1; extern int test_image_set( cl_device_id device, cl_context context, cl_command_queue queue, cl_mem_object_type imageType ); @@ -78,11 +79,8 @@ int main(int argc, const char *argv[]) argc = parseCustomParam(argc, argv); if (argc == -1) { - test_finish(); return -1; } - - checkDeviceTypeOverride( &gDeviceType ); const char ** argList = (const char **)calloc( argc, sizeof( char*) ); @@ -98,16 +96,7 @@ int main(int argc, const char *argv[]) // Parse arguments for( int i = 1; i < argc; i++ ) { - if( strcmp( argv[i], "cpu" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_CPU" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_CPU; - else if( strcmp( argv[i], "gpu" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_GPU" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_GPU; - else if( strcmp( argv[i], "accelerator" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_ACCELERATOR" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_ACCELERATOR; - else if( strcmp( argv[i], "CL_DEVICE_TYPE_DEFAULT" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_DEFAULT; - - else if( strcmp( argv[i], "debug_trace" ) == 0 ) + if( strcmp( argv[i], "debug_trace" ) == 0 ) gDebugTrace = true; else if( strcmp( argv[i], "small_images" ) == 0 ) @@ -134,20 +123,8 @@ int main(int argc, const char *argv[]) int ret = runTestHarness( argCount, argList, test_num, test_list, true, false, 0 ); - if (gTestFailure == 0) { - if (gTestCount > 1) - log_info("PASSED %d of %d sub-tests.\n", gTestCount, gTestCount); - else - log_info("PASSED sub-test.\n"); - } else if (gTestFailure > 0) { - if (gTestCount > 1) - log_error("FAILED %d of %d sub-tests.\n", gTestFailure, gTestCount); - else - log_error("FAILED sub-test.\n"); - } - - free(argList); - return ret; + free(argList); + return ret; } static void printUsage( const char *execName ) diff --git a/test_conformance/images/kernel_image_methods/test_1D.cpp b/test_conformance/images/kernel_image_methods/test_1D.cpp index 7265a9be..757a4a00 100644 --- a/test_conformance/images/kernel_image_methods/test_1D.cpp +++ b/test_conformance/images/kernel_image_methods/test_1D.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -18,9 +18,9 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gTestSmallImages, gTestMaxImages; +extern bool gDebugTrace, gTestSmallImages, gTestMaxImages, gDeviceLt20; -typedef struct image_kernel_data +struct image_kernel_data { cl_int width; cl_int channelType; @@ -65,7 +65,6 @@ static int test_get_1Dimage_info_single( cl_context context, cl_command_queue qu // Construct testing source if( gDebugTrace ) log_info( " - Creating 1D image %d ...\n", (int)imageInfo->width ); - image = create_image_1d( context, (cl_mem_flags)(CL_MEM_READ_ONLY), imageInfo->format, imageInfo->width, 0, NULL, NULL, &error ); if( image == NULL ) { @@ -94,7 +93,7 @@ static int test_get_1Dimage_info_single( cl_context context, cl_command_queue qu if (error) print_error(error, "clFinish failed.\n"); const char *ptr = programSrc; - error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" ); + error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0" ); test_error( error, "Unable to create kernel to test against" ); // Create an output buffer diff --git a/test_conformance/images/kernel_image_methods/test_1D_array.cpp b/test_conformance/images/kernel_image_methods/test_1D_array.cpp index 2c1b33cb..f5e778b6 100644 --- a/test_conformance/images/kernel_image_methods/test_1D_array.cpp +++ b/test_conformance/images/kernel_image_methods/test_1D_array.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -18,9 +18,9 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gTestSmallImages, gTestMaxImages; +extern bool gDebugTrace, gTestSmallImages, gTestMaxImages, gDeviceLt20; -typedef struct image_kernel_data +struct image_kernel_data { cl_int width; cl_int arraySize; @@ -97,7 +97,7 @@ int test_get_1Dimage_array_info_single( cl_context context, cl_command_queue que if (error) print_error(error, "clFinish failed.\n"); const char *ptr = programSrc; - error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" ); + error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0"); test_error( error, "Unable to create kernel to test against" ); // Create an output buffer diff --git a/test_conformance/images/kernel_image_methods/test_2D.cpp b/test_conformance/images/kernel_image_methods/test_2D.cpp index ca89b49f..64b9f265 100644 --- a/test_conformance/images/kernel_image_methods/test_2D.cpp +++ b/test_conformance/images/kernel_image_methods/test_2D.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -18,9 +18,9 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gTestSmallImages, gTestMaxImages; +extern bool gDebugTrace, gTestSmallImages, gTestMaxImages, gDeviceLt20; -typedef struct image_kernel_data +struct image_kernel_data { cl_int width; cl_int height; @@ -121,7 +121,7 @@ int test_get_image_info_single( cl_context context, cl_command_queue queue, imag if (error) print_error(error, "clFinish failed.\n"); const char *ptr = programSrc; - error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" ); + error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0" ); test_error( error, "Unable to create kernel to test against" ); // Create an output buffer diff --git a/test_conformance/images/kernel_image_methods/test_2D_array.cpp b/test_conformance/images/kernel_image_methods/test_2D_array.cpp index 47099f80..85b8a7a3 100644 --- a/test_conformance/images/kernel_image_methods/test_2D_array.cpp +++ b/test_conformance/images/kernel_image_methods/test_2D_array.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -18,9 +18,9 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gTestSmallImages, gTestMaxImages; +extern bool gDebugTrace, gTestSmallImages, gTestMaxImages, gDeviceLt20; -typedef struct image_kernel_data +struct image_kernel_data { cl_int width; cl_int height; @@ -101,7 +101,7 @@ int test_get_2Dimage_array_info_single( cl_context context, cl_command_queue que if (error) print_error(error, "clFinish failed.\n"); const char *ptr = programSrc; - error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" ); + error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0" ); test_error( error, "Unable to create kernel to test against" ); // Create an output buffer diff --git a/test_conformance/images/kernel_image_methods/test_3D.cpp b/test_conformance/images/kernel_image_methods/test_3D.cpp index b3cee0d3..390bf8f6 100644 --- a/test_conformance/images/kernel_image_methods/test_3D.cpp +++ b/test_conformance/images/kernel_image_methods/test_3D.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -18,7 +18,7 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gTestSmallImages, gTestMaxImages; +extern bool gDebugTrace, gTestSmallImages, gTestMaxImages, gDeviceLt20; extern int test_get_image_info_single( cl_context context, cl_command_queue queue, image_descriptor *imageInfo, MTdata d ); diff --git a/test_conformance/images/kernel_image_methods/test_loops.cpp b/test_conformance/images/kernel_image_methods/test_loops.cpp index 4160ae61..3b56d3ef 100644 --- a/test_conformance/images/kernel_image_methods/test_loops.cpp +++ b/test_conformance/images/kernel_image_methods/test_loops.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -14,13 +14,14 @@ // limitations under the License. // #include "../testBase.h" +#include "../common.h" extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; extern int gTypesToTest; extern int gNormalizedModeToUse; extern cl_channel_type gChannelTypeToUse; - +extern bool gDeviceLt20; extern bool gDebugTrace; @@ -30,100 +31,6 @@ extern int test_get_image_info_3D( cl_device_id device, cl_context context, cl_c extern int test_get_image_info_1D_array( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format ); extern int test_get_image_info_2D_array( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format ); -static const char *str_1d_image = "1D"; -static const char *str_2d_image = "2D"; -static const char *str_3d_image = "3D"; -static const char *str_1d_image_array = "1D array"; -static const char *str_2d_image_array = "2D array"; - -static const char *convert_image_type_to_string(cl_mem_object_type imageType) -{ - const char *p; - switch (imageType) - { - case CL_MEM_OBJECT_IMAGE1D: - p = str_1d_image; - break; - case CL_MEM_OBJECT_IMAGE2D: - p = str_2d_image; - break; - case CL_MEM_OBJECT_IMAGE3D: - p = str_3d_image; - break; - case CL_MEM_OBJECT_IMAGE1D_ARRAY: - p = str_1d_image_array; - break; - case CL_MEM_OBJECT_IMAGE2D_ARRAY: - p = str_2d_image_array; - break; - } - return p; -} - - -int filter_formats( cl_image_format *formatList, bool *filterFlags, unsigned int formatCount, cl_channel_type *channelDataTypesToFilter ) -{ - int numSupported = 0; - for( unsigned int j = 0; j < formatCount; j++ ) - { - // If this format has been previously filtered, remove the filter - if( filterFlags[ j ] ) - filterFlags[ j ] = false; - - // Have we already discarded this via the command line? - if( gChannelTypeToUse != (cl_channel_type)-1 && gChannelTypeToUse != formatList[ j ].image_channel_data_type ) - { - filterFlags[ j ] = true; - continue; - } - - // Is given format standard channel order and type given by spec. We don't want to test it if this is vendor extension - if( !IsChannelOrderSupported( formatList[ j ].image_channel_order ) || !IsChannelTypeSupported( formatList[ j ].image_channel_data_type ) ) - { - filterFlags[ j ] = true; - continue; - } - - // We don't filter by channel type - if( !channelDataTypesToFilter ) - { - numSupported++; - continue; - } - - // Is the format supported? - int i; - for( i = 0; channelDataTypesToFilter[ i ] != (cl_channel_type)-1; i++ ) - { - if( formatList[ j ].image_channel_data_type == channelDataTypesToFilter[ i ] ) - { - numSupported++; - break; - } - } - if( channelDataTypesToFilter[ i ] == (cl_channel_type)-1 ) - { - // Format is NOT supported, so mark it as such - filterFlags[ j ] = true; - } - } - return numSupported; -} - -int get_format_list( cl_context context, cl_mem_object_type imageType, cl_image_format * &outFormatList, unsigned int &outFormatCount, cl_mem_flags flags ) -{ - int error = clGetSupportedImageFormats( context, (cl_mem_flags)flags, - imageType, 0, NULL, &outFormatCount ); - test_error( error, "Unable to get count of supported image formats" ); - - outFormatList = new cl_image_format[ outFormatCount ]; - error = clGetSupportedImageFormats( context, (cl_mem_flags)flags, - imageType, outFormatCount, outFormatList, NULL ); - test_error( error, "Unable to get list of supported image formats" ); - return 0; -} - - int test_image_type( cl_device_id device, cl_context context, cl_command_queue queue, cl_mem_object_type imageType, cl_mem_flags flags ) { log_info( "Running %s %s-only tests...\n", convert_image_type_to_string(imageType), flags == CL_MEM_READ_ONLY ? "read" : "write" ); @@ -181,7 +88,7 @@ int test_image_type( cl_device_id device, cl_context context, cl_command_queue q } if (test_return) { - gTestFailure++; + gFailCount++; log_error( "FAILED: " ); print_header( &formatList[ i ], true ); log_info( "\n" ); @@ -199,16 +106,22 @@ int test_image_type( cl_device_id device, cl_context context, cl_command_queue q int test_image_set( cl_device_id device, cl_context context, cl_command_queue queue, cl_mem_object_type imageType ) { int version_check; - if ((version_check = check_opencl_version(device,1,2))) { - switch (imageType) { - case CL_MEM_OBJECT_IMAGE1D: - test_missing_feature(version_check, "image_1D"); - case CL_MEM_OBJECT_IMAGE1D_ARRAY: - test_missing_feature(version_check, "image_1D_array"); - case CL_MEM_OBJECT_IMAGE2D_ARRAY: - test_missing_feature(version_check, "image_2D_array"); + auto version = get_device_cl_version(device); + if (version < Version(2, 0)) { + gDeviceLt20 = true; + } + + if ((version_check = (version < Version(1, 2)))) + { + switch (imageType) { + case CL_MEM_OBJECT_IMAGE1D: + test_missing_feature(version_check, "image_1D"); + case CL_MEM_OBJECT_IMAGE1D_ARRAY: + test_missing_feature(version_check, "image_1D_array"); + case CL_MEM_OBJECT_IMAGE2D_ARRAY: + test_missing_feature(version_check, "image_2D_array"); + } } - } int ret = 0; ret += test_image_type( device, context, queue, imageType, CL_MEM_READ_ONLY ); diff --git a/test_conformance/images/kernel_read_write/CMakeLists.txt b/test_conformance/images/kernel_read_write/CMakeLists.txt index 808f285f..595f024a 100644 --- a/test_conformance/images/kernel_read_write/CMakeLists.txt +++ b/test_conformance/images/kernel_read_write/CMakeLists.txt @@ -2,6 +2,7 @@ set(MODULE_NAME IMAGE_STREAMS) set(${MODULE_NAME}_SOURCES main.cpp + test_common.cpp test_iterations.cpp test_loops.cpp test_read_1D.cpp @@ -13,17 +14,7 @@ set(${MODULE_NAME}_SOURCES test_write_1D_array.cpp test_write_2D_array.cpp test_write_3D.cpp - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/threadTesting.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/imageHelpers.cpp - ../../../test_common/harness/mt19937.c - ../../../test_common/harness/conversions.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/typeWrappers.cpp - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c + ../common.cpp ) include(../../CMakeCommon.txt) diff --git a/test_conformance/images/kernel_read_write/main.cpp b/test_conformance/images/kernel_read_write/main.cpp index 30570b73..51d5c071 100644 --- a/test_conformance/images/kernel_read_write/main.cpp +++ b/test_conformance/images/kernel_read_write/main.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../../test_common/harness/compat.h" +#include "../harness/compat.h" #include #include @@ -24,8 +24,8 @@ #endif #include "../testBase.h" -#include "../../../test_common/harness/fpcontrol.h" -#include "../../../test_common/harness/parseParameters.h" +#include "../harness/fpcontrol.h" +#include "../harness/parseParameters.h" #include @@ -41,9 +41,9 @@ bool gExtraValidateInfo; bool gDisableOffsets; bool gTestSmallImages; bool gTestMaxImages; -bool gTestRounding; bool gTestImage2DFromBuffer; bool gTestMipmaps; +bool gDeviceLt20 = false; cl_filter_mode gFilterModeToUse = (cl_filter_mode)-1; // Default is CL_MEM_USE_HOST_PTR for the test cl_mem_flags gMemFlagsToUse = CL_MEM_USE_HOST_PTR; @@ -54,7 +54,6 @@ int gNormalizedModeToUse = 7; cl_channel_type gChannelTypeToUse = (cl_channel_type)-1; cl_channel_order gChannelOrderToUse = (cl_channel_order)-1; bool gEnablePitch = false; -cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT; int gtestTypesToRun = 0; static int testTypesToRun; @@ -118,6 +117,10 @@ static int doTest( cl_device_id device, cl_context context, cl_command_queue que bool tDisableOffsets = false; bool tNormalizedModeToUse = false; cl_filter_mode tFilterModeToUse = (cl_filter_mode)-1; + auto version = get_device_cl_version(device); + if (version < Version(2, 0)) { + gDeviceLt20 = true; + } if( testTypesToRun & kReadTests ) { @@ -174,6 +177,13 @@ static int doTest( cl_device_id device, cl_context context, cl_command_queue que } } + if (testTypesToRun & kReadWriteTests) { + if (gDeviceLt20) { + log_info("TEST skipped, Opencl 2.0 + requried for this test"); + return ret; + } + } + if( ( testTypesToRun & kReadWriteTests ) && !gTestMipmaps ) { gtestTypesToRun = kReadWriteTests; @@ -270,13 +280,9 @@ int main(int argc, const char *argv[]) argc = parseCustomParam(argc, argv); if (argc == -1) { - test_finish(); return -1; } - //Check CL_DEVICE_TYPE environment variable - checkDeviceTypeOverride( &gDeviceType ); - const char ** argList = (const char **)calloc( argc, sizeof( char*) ); if( NULL == argList ) @@ -291,16 +297,7 @@ int main(int argc, const char *argv[]) // Parse arguments for( int i = 1; i < argc; i++ ) { - if( strcmp( argv[i], "cpu" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_CPU" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_CPU; - else if( strcmp( argv[i], "gpu" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_GPU" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_GPU; - else if( strcmp( argv[i], "accelerator" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_ACCELERATOR" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_ACCELERATOR; - else if( strcmp( argv[i], "CL_DEVICE_TYPE_DEFAULT" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_DEFAULT; - - else if( strcmp( argv[i], "debug_trace" ) == 0 ) + if( strcmp( argv[i], "debug_trace" ) == 0 ) gDebugTrace = true; else if( strcmp( argv[i], "CL_FILTER_NEAREST" ) == 0 || strcmp( argv[i], "NEAREST" ) == 0 ) @@ -395,35 +392,6 @@ int main(int argc, const char *argv[]) if( gTypesToTest == 0 ) gTypesToTest = kTestAllTypes; -#if defined( __APPLE__ ) -#if defined( __i386__ ) || defined( __x86_64__ ) -#define kHasSSE3 0x00000008 -#define kHasSupplementalSSE3 0x00000100 -#define kHasSSE4_1 0x00000400 -#define kHasSSE4_2 0x00000800 - /* check our environment for a hint to disable SSE variants */ - { - const char *env = getenv( "CL_MAX_SSE" ); - if( env ) - { - extern int _cpu_capabilities; - int mask = 0; - if( 0 == strcmp( env, "SSE4.1" ) ) - mask = kHasSSE4_2; - else if( 0 == strcmp( env, "SSSE3" ) ) - mask = kHasSSE4_2 | kHasSSE4_1; - else if( 0 == strcmp( env, "SSE3" ) ) - mask = kHasSSE4_2 | kHasSSE4_1 | kHasSupplementalSSE3; - else if( 0 == strcmp( env, "SSE2" ) ) - mask = kHasSSE4_2 | kHasSSE4_1 | kHasSupplementalSSE3 | kHasSSE3; - - log_info( "*** Environment: CL_MAX_SSE = %s ***\n", env ); - _cpu_capabilities &= ~mask; - } - } -#endif -#endif - if( gTestSmallImages ) log_info( "Note: Using small test images\n" ); @@ -443,18 +411,6 @@ int main(int argc, const char *argv[]) // Restore FP state before leaving RestoreFPState(&oldMode); - if (gTestFailure == 0) { - if (gTestCount > 1) - log_info("PASSED %d of %d sub-tests.\n", gTestCount, gTestCount); - else - log_info("PASSED sub-test.\n"); - } else if (gTestFailure > 0) { - if (gTestCount > 1) - log_error("FAILED %d of %d sub-tests.\n", gTestFailure, gTestCount); - else - log_error("FAILED sub-test.\n"); - } - free(argList); return ret; } diff --git a/test_conformance/images/kernel_read_write/test_common.cpp b/test_conformance/images/kernel_read_write/test_common.cpp new file mode 100644 index 00000000..5182601b --- /dev/null +++ b/test_conformance/images/kernel_read_write/test_common.cpp @@ -0,0 +1,19 @@ + +#include "test_common.h" + +cl_sampler create_sampler(cl_context context, image_sampler_data *sdata, bool test_mipmaps, cl_int *error) { + cl_sampler sampler = nullptr; + if (test_mipmaps) { + cl_sampler_properties properties[] = { + CL_SAMPLER_NORMALIZED_COORDS, sdata->normalized_coords, + CL_SAMPLER_ADDRESSING_MODE, sdata->addressing_mode, + CL_SAMPLER_FILTER_MODE, sdata->filter_mode, + CL_SAMPLER_MIP_FILTER_MODE, sdata->filter_mode, + 0}; + sampler = clCreateSamplerWithProperties(context, properties, error); + } else { + sampler = clCreateSampler(context, sdata->normalized_coords, sdata->addressing_mode, sdata->filter_mode, error); + } + return sampler; +} + diff --git a/test_conformance/images/kernel_read_write/test_common.h b/test_conformance/images/kernel_read_write/test_common.h new file mode 100644 index 00000000..1a1a8a1a --- /dev/null +++ b/test_conformance/images/kernel_read_write/test_common.h @@ -0,0 +1,7 @@ + +#include "../testBase.h" + +#define ABS_ERROR(result, expected) (fabs(expected - result)) + +extern cl_sampler create_sampler(cl_context context, image_sampler_data *sdata, bool test_mipmaps, cl_int *error); + diff --git a/test_conformance/images/kernel_read_write/test_iterations.cpp b/test_conformance/images/kernel_read_write/test_iterations.cpp index afb879fb..0b7d4243 100644 --- a/test_conformance/images/kernel_read_write/test_iterations.cpp +++ b/test_conformance/images/kernel_read_write/test_iterations.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../testBase.h" +#include "test_common.h" #include #if defined( __APPLE__ ) @@ -25,14 +25,14 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gExtraValidateInfo, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding, gTestImage2DFromBuffer, gTestMipmaps; -extern cl_device_type gDeviceType; +extern bool gDebugTrace, gExtraValidateInfo, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestImage2DFromBuffer, gTestMipmaps; extern bool gUseKernelSamplers; extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; extern uint64_t gRoundingStartValue; extern cl_mem_flags gMemFlagsToUse; extern int gtestTypesToRun; +extern bool gDeviceLt20; #define MAX_TRIES 1 #define MAX_CLAMPED 1 @@ -85,8 +85,6 @@ static const char *lodOffsetSource = static const char *offsetSource = " int offset = tidY*get_image_width(input) + tidX;\n"; -#define ABS_ERROR( result, expected ) ( fabsf( (float)expected - (float)result ) ) - extern void read_image_pixel_float( void *imageData, image_descriptor *imageInfo, int x, int y, int z, float *outData ); template int determine_validation_error( void *imagePtr, image_descriptor *imageInfo, image_sampler_data *imageSampler, @@ -453,7 +451,7 @@ int validate_image_2D_depth_results(void *imageValues, void *resultValues, doubl xOffsetValues[ j ], yOffsetValues[ j ], 0.0f, norm_offset_x, norm_offset_y, 0.0f, imageSampler, expected, 0, &containsDenormals ); - float err1 = fabsf( resultPtr[0] - expected[0] ); + float err1 = ABS_ERROR(resultPtr[0], expected[0]); // Clamp to the minimum absolute error for the format if (err1 > 0 && err1 < formatAbsoluteError) { err1 = 0.0f; } float maxErr1 = MAX( maxErr * maxPixel.p[0], FLT_MIN ); @@ -472,7 +470,7 @@ int validate_image_2D_depth_results(void *imageValues, void *resultValues, doubl xOffsetValues[ j ], yOffsetValues[ j ], 0.f, norm_offset_x, norm_offset_y, 0.0f, imageSampler, expected, 0, NULL ); - err1 = fabsf( resultPtr[0] - expected[0] ); + err1 = ABS_ERROR(resultPtr[0], expected[0]); } } @@ -505,7 +503,7 @@ int validate_image_2D_depth_results(void *imageValues, void *resultValues, doubl xOffsetValues[ j ], yOffsetValues[ j ], 0.f, norm_offset_x, norm_offset_y, 0.0f, imageSampler, expected, 0, &containsDenormals ); - float err1 = fabsf( resultPtr[0] - expected[0] ); + float err1 = ABS_ERROR(resultPtr[0], expected[0]); float maxErr1 = MAX( maxErr * maxPixel.p[0], FLT_MIN ); @@ -520,7 +518,7 @@ int validate_image_2D_depth_results(void *imageValues, void *resultValues, doubl xOffsetValues[ j ], yOffsetValues[ j ], 0.f, norm_offset_x, norm_offset_y, 0.0f, imageSampler, expected, 0, NULL ); - err1 = fabsf( resultPtr[0] - expected[0] ); + err1 = ABS_ERROR(resultPtr[0], expected[0]); } } if( ! (err1 <= maxErr1) ) @@ -611,10 +609,10 @@ int validate_image_2D_results(void *imageValues, void *resultValues, double form xOffsetValues[ j ], yOffsetValues[ j ], 0.0f, norm_offset_x, norm_offset_y, 0.0f, imageSampler, expected, 0, &containsDenormals ); - float err1 = fabsf( resultPtr[0] - expected[0] ); - float err2 = fabsf( resultPtr[1] - expected[1] ); - float err3 = fabsf( resultPtr[2] - expected[2] ); - float err4 = fabsf( resultPtr[3] - expected[3] ); + float err1 = ABS_ERROR(resultPtr[0], expected[0]); + float err2 = ABS_ERROR(resultPtr[1], expected[1]); + float err3 = ABS_ERROR(resultPtr[2], expected[2]); + float err4 = ABS_ERROR(resultPtr[3], expected[3]); // Clamp to the minimum absolute error for the format if (err1 > 0 && err1 < formatAbsoluteError) { err1 = 0.0f; } if (err2 > 0 && err2 < formatAbsoluteError) { err2 = 0.0f; } @@ -648,10 +646,10 @@ int validate_image_2D_results(void *imageValues, void *resultValues, double form xOffsetValues[ j ], yOffsetValues[ j ], 0.f, norm_offset_x, norm_offset_y, 0.0f, imageSampler, expected, 0, NULL ); - err1 = fabsf( resultPtr[0] - expected[0] ); - err2 = fabsf( resultPtr[1] - expected[1] ); - err3 = fabsf( resultPtr[2] - expected[2] ); - err4 = fabsf( resultPtr[3] - expected[3] ); + err1 = ABS_ERROR(resultPtr[0], expected[0]); + err2 = ABS_ERROR(resultPtr[1], expected[1]); + err3 = ABS_ERROR(resultPtr[2], expected[2]); + err4 = ABS_ERROR(resultPtr[3], expected[3]); } } @@ -689,10 +687,10 @@ int validate_image_2D_results(void *imageValues, void *resultValues, double form xOffsetValues[ j ], yOffsetValues[ j ], 0.f, norm_offset_x, norm_offset_y, 0.0f, imageSampler, expected, 0, &containsDenormals ); - float err1 = fabsf( resultPtr[0] - expected[0] ); - float err2 = fabsf( resultPtr[1] - expected[1] ); - float err3 = fabsf( resultPtr[2] - expected[2] ); - float err4 = fabsf( resultPtr[3] - expected[3] ); + float err1 = ABS_ERROR(resultPtr[0], expected[0]); + float err2 = ABS_ERROR(resultPtr[1], expected[1]); + float err3 = ABS_ERROR(resultPtr[2], expected[2]); + float err4 = ABS_ERROR(resultPtr[3], expected[3]); float maxErr1 = MAX( maxErr * maxPixel.p[0], FLT_MIN ); float maxErr2 = MAX( maxErr * maxPixel.p[1], FLT_MIN ); float maxErr3 = MAX( maxErr * maxPixel.p[2], FLT_MIN ); @@ -719,10 +717,10 @@ int validate_image_2D_results(void *imageValues, void *resultValues, double form xOffsetValues[ j ], yOffsetValues[ j ], 0.f, norm_offset_x, norm_offset_y, 0.0f, imageSampler, expected, 0, NULL ); - err1 = fabsf( resultPtr[0] - expected[0] ); - err2 = fabsf( resultPtr[1] - expected[1] ); - err3 = fabsf( resultPtr[2] - expected[2] ); - err4 = fabsf( resultPtr[3] - expected[3] ); + err1 = ABS_ERROR(resultPtr[0], expected[0]); + err2 = ABS_ERROR(resultPtr[1], expected[1]); + err3 = ABS_ERROR(resultPtr[2], expected[2]); + err4 = ABS_ERROR(resultPtr[3], expected[3]); } } if( ! (err1 <= maxErr1) || ! (err2 <= maxErr2) || @@ -1008,10 +1006,13 @@ int validate_image_2D_sRGB_results(void *imageValues, void *resultValues, double maxPixel = sample_image_pixel_float_offset( imageValues, imageInfo, xOffsetValues[ j ], yOffsetValues[ j ], 0.0f, norm_offset_x, norm_offset_y, 0.0f, imageSampler, expected, 0, &containsDenormals ); - float err1 = fabsf( sRGBmap( resultPtr[0] ) - sRGBmap( expected[0] ) ); - float err2 = fabsf( sRGBmap( resultPtr[1] ) - sRGBmap( expected[1] ) ); - float err3 = fabsf( sRGBmap( resultPtr[2] ) - sRGBmap( expected[2] ) ); - float err4 = fabsf( resultPtr[3] - expected[3] ); + float err1 = ABS_ERROR(sRGBmap(resultPtr[0]), + sRGBmap(expected[0])); + float err2 = ABS_ERROR(sRGBmap(resultPtr[1]), + sRGBmap(expected[1])); + float err3 = ABS_ERROR(sRGBmap(resultPtr[2]), + sRGBmap(expected[2])); + float err4 = ABS_ERROR(resultPtr[3], expected[3]); float maxErr = 0.5; // Check if the result matches. @@ -1034,10 +1035,13 @@ int validate_image_2D_sRGB_results(void *imageValues, void *resultValues, double xOffsetValues[ j ], yOffsetValues[ j ], 0.f, norm_offset_x, norm_offset_y, 0.0f, imageSampler, expected, 0, NULL ); - err1 = fabsf( sRGBmap( resultPtr[0] ) - sRGBmap( expected[0] ) ); - err2 = fabsf( sRGBmap( resultPtr[1] ) - sRGBmap( expected[1] ) ); - err3 = fabsf( sRGBmap( resultPtr[2] ) - sRGBmap( expected[2] ) ); - err4 = fabsf( resultPtr[3] - expected[3] ); + err1 = ABS_ERROR(sRGBmap(resultPtr[0]), + sRGBmap(expected[0])); + err2 = ABS_ERROR(sRGBmap(resultPtr[1]), + sRGBmap(expected[1])); + err3 = ABS_ERROR(sRGBmap(resultPtr[2]), + sRGBmap(expected[2])); + err4 = ABS_ERROR(resultPtr[3], expected[3]); } } @@ -1075,10 +1079,13 @@ int validate_image_2D_sRGB_results(void *imageValues, void *resultValues, double xOffsetValues[ j ], yOffsetValues[ j ], 0.f, norm_offset_x, norm_offset_y, 0.0f, imageSampler, expected, 0, &containsDenormals ); - float err1 = fabsf( sRGBmap( resultPtr[0] ) - sRGBmap( expected[0] ) ); - float err2 = fabsf( sRGBmap( resultPtr[1] ) - sRGBmap( expected[1] ) ); - float err3 = fabsf( sRGBmap( resultPtr[2] ) - sRGBmap( expected[2] ) ); - float err4 = fabsf( resultPtr[3] - expected[3] ); + float err1 = ABS_ERROR(sRGBmap(resultPtr[0]), + sRGBmap(expected[0])); + float err2 = ABS_ERROR(sRGBmap(resultPtr[1]), + sRGBmap(expected[1])); + float err3 = ABS_ERROR(sRGBmap(resultPtr[2]), + sRGBmap(expected[2])); + float err4 = ABS_ERROR(resultPtr[3], expected[3]); float maxErr = 0.6; if( ! (err1 <= maxErr) || ! (err2 <= maxErr) || @@ -1099,10 +1106,13 @@ int validate_image_2D_sRGB_results(void *imageValues, void *resultValues, double xOffsetValues[ j ], yOffsetValues[ j ], 0.f, norm_offset_x, norm_offset_y, 0.0f, imageSampler, expected, 0, NULL ); - err1 = fabsf( sRGBmap( resultPtr[0] ) - sRGBmap( expected[0] ) ); - err2 = fabsf( sRGBmap( resultPtr[1] ) - sRGBmap( expected[1] ) ); - err3 = fabsf( sRGBmap( resultPtr[2] ) - sRGBmap( expected[2] ) ); - err4 = fabsf( resultPtr[3] - expected[3] ); + err1 = ABS_ERROR(sRGBmap(resultPtr[0]), + sRGBmap(expected[0])); + err2 = ABS_ERROR(sRGBmap(resultPtr[1]), + sRGBmap(expected[1])); + err3 = ABS_ERROR(sRGBmap(resultPtr[2]), + sRGBmap(expected[2])); + err4 = ABS_ERROR(resultPtr[3], expected[3]); } } if( ! (err1 <= maxErr) || ! (err2 <= maxErr) || @@ -1151,6 +1161,45 @@ int validate_image_2D_sRGB_results(void *imageValues, void *resultValues, double return 0; } +bool validate_float_write_results( float *expected, float *actual, image_descriptor *imageInfo ) +{ + bool pass = true; + // Compare floats + if( memcmp( expected, actual, sizeof( cl_float ) * get_format_channel_count( imageInfo->format ) ) != 0 ) + { + // 8.3.3 Fix up cases where we have NaNs or flushed denorms; "all other values must be preserved" + for ( size_t j = 0; j < get_format_channel_count( imageInfo->format ); j++ ) + { + if ( isnan( expected[j] ) && isnan( actual[j] ) ) + continue; + if ( IsFloatSubnormal( expected[j] ) && actual[j] == 0.0f ) + continue; + pass = false; + break; + } + } + return pass; +} + +bool validate_half_write_results( cl_half *expected, cl_half *actual, image_descriptor *imageInfo ) +{ + bool pass = true; + // Compare half floats + if (memcmp(expected, actual, sizeof( cl_half ) * get_format_channel_count(imageInfo->format)) != 0) { + + // 8.3.2 Fix up cases where we have NaNs or generated half denormals + for ( size_t j = 0; j < get_format_channel_count( imageInfo->format ); j++ ) { + if ( is_half_nan( expected[j] ) && is_half_nan( actual[j] ) ) + continue; + if ( is_half_denorm( expected[j] ) && is_half_zero( actual[j] ) ) + continue; + pass = false; + break; + } + } + return pass; +} + int test_read_image_2D( cl_context context, cl_command_queue queue, cl_kernel kernel, image_descriptor *imageInfo, image_sampler_data *imageSampler, bool useFloatCoords, ExplicitType outputType, MTdata d ) @@ -1387,17 +1436,8 @@ int test_read_image_2D( cl_context context, cl_command_queue queue, cl_kernel ke test_error( error, "Unable to create result buffer" ); // Create sampler to use - cl_sampler_properties properties[] = { - CL_SAMPLER_NORMALIZED_COORDS, imageSampler->normalized_coords, - CL_SAMPLER_ADDRESSING_MODE, imageSampler->addressing_mode, - CL_SAMPLER_FILTER_MODE, imageSampler->filter_mode, - 0, 0, 0 }; - if (gTestMipmaps) { - properties[6] = CL_SAMPLER_MIP_FILTER_MODE; - properties[7] = imageSampler->filter_mode; - } - actualSampler = clCreateSamplerWithProperties(context, properties, &error ); - test_error( error, "Unable to create image sampler" ); + actualSampler = create_sampler(context, imageSampler, gTestMipmaps, &error); + test_error(error, "Unable to create image sampler"); // Set arguments int idx = 0; @@ -1623,7 +1663,7 @@ int test_read_image_set_2D( cl_device_id device, cl_context context, cl_command_ gTestMipmaps?", lod":" "); ptr = programSrc; - error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" ); + error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0"); test_error( error, "Unable to create testing kernel" ); if( gTestSmallImages ) diff --git a/test_conformance/images/kernel_read_write/test_loops.cpp b/test_conformance/images/kernel_read_write/test_loops.cpp index 618b2e73..1789df04 100644 --- a/test_conformance/images/kernel_read_write/test_loops.cpp +++ b/test_conformance/images/kernel_read_write/test_loops.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -14,153 +14,70 @@ // limitations under the License. // #include "../testBase.h" +#include "../common.h" -extern cl_filter_mode gFilterModeToUse; +extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; -extern int gTypesToTest; -extern int gNormalizedModeToUse; -extern cl_channel_type gChannelTypeToUse; -extern cl_channel_order gChannelOrderToUse; +extern int gTypesToTest; +extern int gNormalizedModeToUse; +extern cl_channel_type gChannelTypeToUse; +extern cl_channel_order gChannelOrderToUse; extern bool gDebugTrace; extern bool gTestMipmaps; -extern int gtestTypesToRun; +extern int gtestTypesToRun; +extern bool gDeviceLt20; -extern int test_read_image_set_1D( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format, image_sampler_data *imageSampler, - bool floatCoords, ExplicitType outputType ); -extern int test_read_image_set_2D( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format, image_sampler_data *imageSampler, - bool floatCoords, ExplicitType outputType ); -extern int test_read_image_set_3D( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format, image_sampler_data *imageSampler, - bool floatCoords, ExplicitType outputType ); -extern int test_read_image_set_1D_array( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format, image_sampler_data *imageSampler, - bool floatCoords, ExplicitType outputType ); -extern int test_read_image_set_2D_array( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format, image_sampler_data *imageSampler, - bool floatCoords, ExplicitType outputType ); +extern int test_read_image_set_1D(cl_device_id device, cl_context context, + cl_command_queue queue, + cl_image_format *format, + image_sampler_data *imageSampler, + bool floatCoords, ExplicitType outputType); +extern int test_read_image_set_2D(cl_device_id device, cl_context context, + cl_command_queue queue, + cl_image_format *format, + image_sampler_data *imageSampler, + bool floatCoords, ExplicitType outputType); +extern int test_read_image_set_3D(cl_device_id device, cl_context context, + cl_command_queue queue, + cl_image_format *format, + image_sampler_data *imageSampler, + bool floatCoords, ExplicitType outputType); +extern int test_read_image_set_1D_array(cl_device_id device, cl_context context, + cl_command_queue queue, + cl_image_format *format, + image_sampler_data *imageSampler, + bool floatCoords, + ExplicitType outputType); +extern int test_read_image_set_2D_array(cl_device_id device, cl_context context, + cl_command_queue queue, + cl_image_format *format, + image_sampler_data *imageSampler, + bool floatCoords, + ExplicitType outputType); -static const char *str_1d_image = "1D"; -static const char *str_2d_image = "2D"; -static const char *str_3d_image = "3D"; -static const char *str_1d_image_array = "1D array"; -static const char *str_2d_image_array = "2D array"; - -static const char *convert_image_type_to_string(cl_mem_object_type imageType) -{ - const char *p; - switch (imageType) - { - case CL_MEM_OBJECT_IMAGE1D: - p = str_1d_image; - break; - case CL_MEM_OBJECT_IMAGE2D: - p = str_2d_image; - break; - case CL_MEM_OBJECT_IMAGE3D: - p = str_3d_image; - break; - case CL_MEM_OBJECT_IMAGE1D_ARRAY: - p = str_1d_image_array; - break; - case CL_MEM_OBJECT_IMAGE2D_ARRAY: - p = str_2d_image_array; - break; - } - return p; -} - -int filter_formats( cl_image_format *formatList, bool *filterFlags, unsigned int formatCount, cl_channel_type *channelDataTypesToFilter ) -{ - int numSupported = 0; - for( unsigned int j = 0; j < formatCount; j++ ) - { - // If this format has been previously filtered, remove the filter - if( filterFlags[ j ] ) - filterFlags[ j ] = false; - - // skip mipmap tests for CL_DEPTH formats (re# Khronos Bug 13762) - if(gTestMipmaps && (formatList[ j ].image_channel_order == CL_DEPTH)) - { - log_info("Skip mipmap tests for CL_DEPTH format\n"); - filterFlags[ j ] = true; - continue; - } - - // Have we already discarded the channel type via the command line? - if( gChannelTypeToUse != (cl_channel_type)-1 && gChannelTypeToUse != formatList[ j ].image_channel_data_type ) - { - filterFlags[ j ] = true; - continue; - } - - // Have we already discarded the channel order via the command line? - if( gChannelOrderToUse != (cl_channel_order)-1 && gChannelOrderToUse != formatList[ j ].image_channel_order ) - { - filterFlags[ j ] = true; - continue; - } - - // Is given format standard channel order and type given by spec. We don't want to test it if this is vendor extension - if( !IsChannelOrderSupported( formatList[ j ].image_channel_order ) || !IsChannelTypeSupported( formatList[ j ].image_channel_data_type ) ) - { - filterFlags[ j ] = true; - continue; - } - - if ( !channelDataTypesToFilter ) - { - numSupported++; - continue; - } - - // Is the format supported? - int i; - for( i = 0; channelDataTypesToFilter[ i ] != (cl_channel_type)-1; i++ ) - { - if( formatList[ j ].image_channel_data_type == channelDataTypesToFilter[ i ] ) - { - numSupported++; - break; - } - } - if( channelDataTypesToFilter[ i ] == (cl_channel_type)-1 ) - { - // Format is NOT supported, so mark it as such - filterFlags[ j ] = true; - } - } - return numSupported; -} - -int get_format_list( cl_context context, cl_mem_object_type imageType, cl_image_format * &outFormatList, unsigned int &outFormatCount, cl_mem_flags flags ) -{ - int error; - - cl_image_format tempList[ 128 ]; - error = clGetSupportedImageFormats( context, flags, - imageType, 128, tempList, &outFormatCount ); - test_error( error, "Unable to get count of supported image formats" ); - - outFormatList = new cl_image_format[ outFormatCount ]; - error = clGetSupportedImageFormats( context, flags, - imageType, outFormatCount, outFormatList, NULL ); - test_error( error, "Unable to get list of supported image formats" ); - - return 0; -} - -int test_read_image_type( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format, bool floatCoords, - image_sampler_data *imageSampler, ExplicitType outputType, cl_mem_object_type imageType ) +int test_read_image_type(cl_device_id device, cl_context context, + cl_command_queue queue, cl_image_format *format, + bool floatCoords, image_sampler_data *imageSampler, + ExplicitType outputType, cl_mem_object_type imageType) { int ret = 0; cl_addressing_mode *addressModes = NULL; - // The sampler-less read image functions behave exactly as the corresponding read image functions - // described in section 6.13.14.2 that take integer coordinates and a sampler with filter mode set to - // CLK_FILTER_NEAREST, normalized coordinates set to CLK_NORMALIZED_COORDS_FALSE and addressing mode to CLK_ADDRESS_NONE - cl_addressing_mode addressModes_rw[] = { CL_ADDRESS_NONE, (cl_addressing_mode)-1 }; - cl_addressing_mode addressModes_ro[] = { /* CL_ADDRESS_CLAMP_NONE,*/ CL_ADDRESS_CLAMP_TO_EDGE, CL_ADDRESS_CLAMP, CL_ADDRESS_REPEAT, CL_ADDRESS_MIRRORED_REPEAT, (cl_addressing_mode)-1 }; + // The sampler-less read image functions behave exactly as the corresponding + // read image functions described in section 6.13.14.2 that take integer + // coordinates and a sampler with filter mode set to CLK_FILTER_NEAREST, + // normalized coordinates set to CLK_NORMALIZED_COORDS_FALSE and addressing + // mode to CLK_ADDRESS_NONE + cl_addressing_mode addressModes_rw[] = { CL_ADDRESS_NONE, + (cl_addressing_mode)-1 }; + cl_addressing_mode addressModes_ro[] = { + /* CL_ADDRESS_CLAMP_NONE,*/ CL_ADDRESS_CLAMP_TO_EDGE, CL_ADDRESS_CLAMP, + CL_ADDRESS_REPEAT, CL_ADDRESS_MIRRORED_REPEAT, (cl_addressing_mode)-1 + }; - if(gtestTypesToRun & kReadWriteTests) + if (gtestTypesToRun & kReadWriteTests) { addressModes = addressModes_rw; } @@ -169,39 +86,45 @@ int test_read_image_type( cl_device_id device, cl_context context, cl_command_qu addressModes = addressModes_ro; } -#if defined( __APPLE__ ) +#if defined(__APPLE__) // According to the OpenCL specification, we do not guarantee the precision // of operations for linear filtering on the GPU. We do not test linear // filtering for the CL_RGB CL_UNORM_INT_101010 image format; however, we // test it internally for a set of other image formats. - if ((gDeviceType == CL_DEVICE_TYPE_GPU) && - (imageSampler->filter_mode == CL_FILTER_LINEAR) && - (format->image_channel_order == CL_RGB) && - (format->image_channel_data_type == CL_UNORM_INT_101010)) + if ((gDeviceType == CL_DEVICE_TYPE_GPU) + && (imageSampler->filter_mode == CL_FILTER_LINEAR) + && (format->image_channel_order == CL_RGB) + && (format->image_channel_data_type == CL_UNORM_INT_101010)) { - log_info("--- Skipping CL_RGB CL_UNORM_INT_101010 format with CL_FILTER_LINEAR on GPU.\n"); + log_info("--- Skipping CL_RGB CL_UNORM_INT_101010 format with " + "CL_FILTER_LINEAR on GPU.\n"); return 0; } #endif - for( int adMode = 0; addressModes[ adMode ] != (cl_addressing_mode)-1; adMode++ ) + for (int adMode = 0; addressModes[adMode] != (cl_addressing_mode)-1; + adMode++) { - imageSampler->addressing_mode = addressModes[ adMode ]; + imageSampler->addressing_mode = addressModes[adMode]; - if( (addressModes[ adMode ] == CL_ADDRESS_REPEAT || addressModes[ adMode ] == CL_ADDRESS_MIRRORED_REPEAT) && !( imageSampler->normalized_coords ) ) + if ((addressModes[adMode] == CL_ADDRESS_REPEAT + || addressModes[adMode] == CL_ADDRESS_MIRRORED_REPEAT) + && !(imageSampler->normalized_coords)) continue; // Repeat doesn't make sense for non-normalized coords // Use this run if we were told to only run a certain filter mode - if( gAddressModeToUse != (cl_addressing_mode)-1 && imageSampler->addressing_mode != gAddressModeToUse ) + if (gAddressModeToUse != (cl_addressing_mode)-1 + && imageSampler->addressing_mode != gAddressModeToUse) continue; /* Remove redundant check to see if workaround still necessary - // Check added in because this case was leaking through causing a crash on CPU - if( ! imageSampler->normalized_coords && imageSampler->addressing_mode == CL_ADDRESS_REPEAT ) - continue; //repeat mode requires normalized coordinates + // Check added in because this case was leaking through causing a crash + on CPU if( ! imageSampler->normalized_coords && + imageSampler->addressing_mode == CL_ADDRESS_REPEAT ) continue; //repeat + mode requires normalized coordinates */ - print_read_header( format, imageSampler, false ); + print_read_header(format, imageSampler, false); gTestCount++; @@ -209,27 +132,37 @@ int test_read_image_type( cl_device_id device, cl_context context, cl_command_qu switch (imageType) { case CL_MEM_OBJECT_IMAGE1D: - retCode = test_read_image_set_1D( device, context, queue, format, imageSampler, floatCoords, outputType ); + retCode = test_read_image_set_1D(device, context, queue, format, + imageSampler, floatCoords, + outputType); break; case CL_MEM_OBJECT_IMAGE1D_ARRAY: - retCode = test_read_image_set_1D_array( device, context, queue, format, imageSampler, floatCoords, outputType ); + retCode = test_read_image_set_1D_array(device, context, queue, + format, imageSampler, + floatCoords, outputType); break; case CL_MEM_OBJECT_IMAGE2D: - retCode = test_read_image_set_2D( device, context, queue, format, imageSampler, floatCoords, outputType ); + retCode = test_read_image_set_2D(device, context, queue, format, + imageSampler, floatCoords, + outputType); break; case CL_MEM_OBJECT_IMAGE2D_ARRAY: - retCode = test_read_image_set_2D_array( device, context, queue, format, imageSampler, floatCoords, outputType ); + retCode = test_read_image_set_2D_array(device, context, queue, + format, imageSampler, + floatCoords, outputType); break; case CL_MEM_OBJECT_IMAGE3D: - retCode = test_read_image_set_3D( device, context, queue, format, imageSampler, floatCoords, outputType ); + retCode = test_read_image_set_3D(device, context, queue, format, + imageSampler, floatCoords, + outputType); break; } - if( retCode != 0 ) + if (retCode != 0) { - gTestFailure++; - log_error( "FAILED: " ); - print_read_header( format, imageSampler, true ); - log_info( "\n" ); + gFailCount++; + log_error("FAILED: "); + print_read_header(format, imageSampler, true); + log_info("\n"); } ret |= retCode; } @@ -237,8 +170,12 @@ int test_read_image_type( cl_device_id device, cl_context context, cl_command_qu return ret; } -int test_read_image_formats( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *formatList, bool *filterFlags, unsigned int numFormats, - image_sampler_data *imageSampler, ExplicitType outputType, cl_mem_object_type imageType ) +int test_read_image_formats(cl_device_id device, cl_context context, + cl_command_queue queue, cl_image_format *formatList, + bool *filterFlags, unsigned int numFormats, + image_sampler_data *imageSampler, + ExplicitType outputType, + cl_mem_object_type imageType) { int ret = 0; bool flipFlop[2] = { false, true }; @@ -246,41 +183,52 @@ int test_read_image_formats( cl_device_id device, cl_context context, cl_command // Use this run if we were told to only run a certain filter mode - if( gFilterModeToUse != (cl_filter_mode)-1 && imageSampler->filter_mode != gFilterModeToUse ) + if (gFilterModeToUse != (cl_filter_mode)-1 + && imageSampler->filter_mode != gFilterModeToUse) return 0; // Test normalized/non-normalized - for( normalizedIdx = 0; normalizedIdx < 2; normalizedIdx++ ) + for (normalizedIdx = 0; normalizedIdx < 2; normalizedIdx++) { - imageSampler->normalized_coords = flipFlop[ normalizedIdx ]; - if( gNormalizedModeToUse != 7 && gNormalizedModeToUse != (int)imageSampler->normalized_coords ) + imageSampler->normalized_coords = flipFlop[normalizedIdx]; + if (gNormalizedModeToUse != 7 + && gNormalizedModeToUse != (int)imageSampler->normalized_coords) continue; - for( floatCoordIdx = 0; floatCoordIdx < 2; floatCoordIdx++ ) + for (floatCoordIdx = 0; floatCoordIdx < 2; floatCoordIdx++) { - // Checks added in because this case was leaking through causing a crash on CPU - if( !flipFlop[ floatCoordIdx ] ) - if( imageSampler->filter_mode != CL_FILTER_NEAREST || // integer coords can only be used with nearest - flipFlop[ normalizedIdx ]) // Normalized integer coords makes no sense (they'd all be zero) + // Checks added in because this case was leaking through causing a + // crash on CPU + if (!flipFlop[floatCoordIdx]) + if (imageSampler->filter_mode != CL_FILTER_NEAREST + || // integer coords can only be used with nearest + flipFlop[normalizedIdx]) // Normalized integer coords makes + // no sense (they'd all be zero) continue; - if( flipFlop[ floatCoordIdx ] && (gtestTypesToRun & kReadWriteTests)) + if (flipFlop[floatCoordIdx] && (gtestTypesToRun & kReadWriteTests)) // sampler-less read in read_write tests run only integer coord continue; - log_info( "read_image (%s coords, %s results) *****************************\n", - flipFlop[ floatCoordIdx ] ? ( imageSampler->normalized_coords ? "normalized float" : "unnormalized float" ) : "integer", - get_explicit_type_name( outputType ) ); + log_info("read_image (%s coords, %s results) " + "*****************************\n", + flipFlop[floatCoordIdx] ? (imageSampler->normalized_coords + ? "normalized float" + : "unnormalized float") + : "integer", + get_explicit_type_name(outputType)); - for( unsigned int i = 0; i < numFormats; i++ ) + for (unsigned int i = 0; i < numFormats; i++) { - if( filterFlags[i] ) - continue; + if (filterFlags[i]) continue; - cl_image_format &imageFormat = formatList[ i ]; + cl_image_format &imageFormat = formatList[i]; - ret |= test_read_image_type( device, context, queue, &imageFormat, flipFlop[ floatCoordIdx ], imageSampler, outputType, imageType ); + ret |= + test_read_image_type(device, context, queue, &imageFormat, + flipFlop[floatCoordIdx], imageSampler, + outputType, imageType); } } } @@ -288,50 +236,65 @@ int test_read_image_formats( cl_device_id device, cl_context context, cl_command } -int test_image_set( cl_device_id device, cl_context context, cl_command_queue queue, test_format_set_fn formatTestFn, cl_mem_object_type imageType ) +int test_image_set(cl_device_id device, cl_context context, + cl_command_queue queue, test_format_set_fn formatTestFn, + cl_mem_object_type imageType) { int ret = 0; static int printedFormatList = -1; - if ( ( 0 == is_extension_available( device, "cl_khr_3d_image_writes" )) && (imageType == CL_MEM_OBJECT_IMAGE3D) && (formatTestFn == test_write_image_formats) ) + if ((imageType == CL_MEM_OBJECT_IMAGE3D) + && (formatTestFn == test_write_image_formats)) { - gTestFailure++; - log_error( "-----------------------------------------------------\n" ); - log_error( "FAILED: test writing CL_MEM_OBJECT_IMAGE3D images\n" ); - log_error( "This device does not support the mandated extension cl_khr_3d_image_writes.\n"); - log_error( "-----------------------------------------------------\n\n" ); - return -1; - } - - if ( gTestMipmaps ) - { - if ( 0 == is_extension_available( device, "cl_khr_mipmap_image" )) + if (0 == is_extension_available(device, "cl_khr_3d_image_writes")) { - log_info( "-----------------------------------------------------\n" ); - log_info( "This device does not support cl_khr_mipmap_image.\nSkipping mipmapped image test. \n" ); - log_info( "-----------------------------------------------------\n\n" ); - return 0; - } - if ( ( 0 == is_extension_available( device, "cl_khr_mipmap_image_writes" )) && (formatTestFn == test_write_image_formats)) - { - log_info( "-----------------------------------------------------\n" ); - log_info( "This device does not support cl_khr_mipmap_image_writes.\nSkipping mipmapped image write test. \n" ); - log_info( "-----------------------------------------------------\n\n" ); + log_info("-----------------------------------------------------\n"); + log_info( + "This device does not support " + "cl_khr_3d_image_writes.\nSkipping 3d image write test. \n"); + log_info( + "-----------------------------------------------------\n\n"); return 0; } } - int version_check = check_opencl_version(device,1,2); - if (version_check != 0) { - switch (imageType) { - case CL_MEM_OBJECT_IMAGE1D: - test_missing_feature(version_check, "image_1D"); - case CL_MEM_OBJECT_IMAGE1D_ARRAY: - test_missing_feature(version_check, "image_1D_array"); - case CL_MEM_OBJECT_IMAGE2D_ARRAY: - test_missing_feature(version_check, "image_2D_array"); - } + if (gTestMipmaps) + { + if (0 == is_extension_available(device, "cl_khr_mipmap_image")) + { + log_info("-----------------------------------------------------\n"); + log_info("This device does not support " + "cl_khr_mipmap_image.\nSkipping mipmapped image test. \n"); + log_info( + "-----------------------------------------------------\n\n"); + return 0; + } + if ((0 == is_extension_available(device, "cl_khr_mipmap_image_writes")) + && (formatTestFn == test_write_image_formats)) + { + log_info("-----------------------------------------------------\n"); + log_info("This device does not support " + "cl_khr_mipmap_image_writes.\nSkipping mipmapped image " + "write test. \n"); + log_info( + "-----------------------------------------------------\n\n"); + return 0; + } + } + + int version_check = (get_device_cl_version(device) < Version(1, 2)); + if (version_check != 0) + { + switch (imageType) + { + case CL_MEM_OBJECT_IMAGE1D: + test_missing_feature(version_check, "image_1D"); + case CL_MEM_OBJECT_IMAGE1D_ARRAY: + test_missing_feature(version_check, "image_1D_array"); + case CL_MEM_OBJECT_IMAGE2D_ARRAY: + test_missing_feature(version_check, "image_2D_array"); + } } // Grab the list of supported image formats for integer reads @@ -343,9 +306,9 @@ int test_image_set( cl_device_id device, cl_context context, cl_command_queue qu // The flag for creating image will be set explicitly in test functions cl_mem_flags flags; const char *flagNames; - if( formatTestFn == test_read_image_formats ) + if (formatTestFn == test_read_image_formats) { - if(gtestTypesToRun & kReadTests) + if (gtestTypesToRun & kReadTests) { flags = CL_MEM_READ_ONLY; flagNames = "read"; @@ -358,7 +321,7 @@ int test_image_set( cl_device_id device, cl_context context, cl_command_queue qu } else { - if(gtestTypesToRun & kWriteTests) + if (gtestTypesToRun & kWriteTests) { flags = CL_MEM_WRITE_ONLY; flagNames = "write"; @@ -370,95 +333,71 @@ int test_image_set( cl_device_id device, cl_context context, cl_command_queue qu } } - if( get_format_list( context, imageType, formatList, numFormats, flags ) ) + if (get_format_list(context, imageType, formatList, numFormats, flags)) return -1; BufferOwningPtr formatListBuf(formatList); - filterFlags = new bool[ numFormats ]; - if( filterFlags == NULL ) + filterFlags = new bool[numFormats]; + if (filterFlags == NULL) { - log_error( "ERROR: Out of memory allocating filter flags list!\n" ); + log_error("ERROR: Out of memory allocating filter flags list!\n"); return -1; } BufferOwningPtr filterFlagsBuf(filterFlags); - memset( filterFlags, 0, sizeof( bool ) * numFormats ); + memset(filterFlags, 0, sizeof(bool) * numFormats); - // First time through, we'll go ahead and print the formats supported, regardless of type - int test = imageType | (formatTestFn == test_read_image_formats ? (1 << 16) : (1 << 17)); - if( printedFormatList != test ) + // First time through, we'll go ahead and print the formats supported, + // regardless of type + int test = imageType + | (formatTestFn == test_read_image_formats ? (1 << 16) : (1 << 17)); + if (printedFormatList != test) { - log_info( "---- Supported %s %s formats for this device ---- \n", convert_image_type_to_string(imageType), flagNames ); - for( unsigned int f = 0; f < numFormats; f++ ) + log_info("---- Supported %s %s formats for this device ---- \n", + convert_image_type_to_string(imageType), flagNames); + for (unsigned int f = 0; f < numFormats; f++) { - if ( IsChannelOrderSupported( formatList[ f ].image_channel_order ) && IsChannelTypeSupported( formatList[ f ].image_channel_data_type ) ) - log_info( " %-7s %-24s %d\n", GetChannelOrderName( formatList[ f ].image_channel_order ), - GetChannelTypeName( formatList[ f ].image_channel_data_type ), - (int)get_format_channel_count( &formatList[ f ] ) ); + if (IsChannelOrderSupported(formatList[f].image_channel_order) + && IsChannelTypeSupported( + formatList[f].image_channel_data_type)) + log_info( + " %-7s %-24s %d\n", + GetChannelOrderName(formatList[f].image_channel_order), + GetChannelTypeName(formatList[f].image_channel_data_type), + (int)get_format_channel_count(&formatList[f])); } - log_info( "------------------------------------------- \n" ); + log_info("------------------------------------------- \n"); printedFormatList = test; } image_sampler_data imageSampler; - /////// float tests /////// - - if( gTypesToTest & kTestFloat ) + for (auto test : imageTestTypes) { - cl_channel_type floatFormats[] = { CL_UNORM_SHORT_565, CL_UNORM_SHORT_555, CL_UNORM_INT_101010, -#ifdef OBSOLETE_FORAMT - CL_UNORM_SHORT_565_REV, CL_UNORM_SHORT_555_REV, CL_UNORM_INT_8888, CL_UNORM_INT_8888_REV, CL_UNORM_INT_101010_REV, -#endif -#ifdef CL_SFIXED14_APPLE - CL_SFIXED14_APPLE, -#endif - CL_UNORM_INT8, CL_SNORM_INT8, - CL_UNORM_INT16, CL_SNORM_INT16, CL_FLOAT, CL_HALF_FLOAT, (cl_channel_type)-1 }; - if( filter_formats( formatList, filterFlags, numFormats, floatFormats ) == 0 ) + if (gTypesToTest & test.type) { - log_info( "No formats supported for float type\n" ); - } - else - { - imageSampler.filter_mode = CL_FILTER_NEAREST; - ret += formatTestFn( device, context, queue, formatList, filterFlags, numFormats, &imageSampler, kFloat, imageType ); + if (filter_formats(formatList, filterFlags, numFormats, + test.channelTypes, gTestMipmaps) + == 0) + { + log_info("No formats supported for %s type\n", test.name); + } + else + { + imageSampler.filter_mode = CL_FILTER_NEAREST; + ret += formatTestFn(device, context, queue, formatList, + filterFlags, numFormats, &imageSampler, + test.explicitType, imageType); - imageSampler.filter_mode = CL_FILTER_LINEAR; - ret += formatTestFn( device, context, queue, formatList, filterFlags, numFormats, &imageSampler, kFloat, imageType ); - } - } - - /////// int tests /////// - if( gTypesToTest & kTestInt ) - { - cl_channel_type intFormats[] = { CL_SIGNED_INT8, CL_SIGNED_INT16, CL_SIGNED_INT32, (cl_channel_type)-1 }; - if( filter_formats( formatList, filterFlags, numFormats, intFormats ) == 0 ) - { - log_info( "No formats supported for integer type\n" ); - } - else - { - // Only filter mode we support on int is nearest - imageSampler.filter_mode = CL_FILTER_NEAREST; - ret += formatTestFn( device, context, queue, formatList, filterFlags, numFormats, &imageSampler, kInt, imageType ); - } - } - - /////// uint tests /////// - - if( gTypesToTest & kTestUInt ) - { - cl_channel_type uintFormats[] = { CL_UNSIGNED_INT8, CL_UNSIGNED_INT16, CL_UNSIGNED_INT32, (cl_channel_type)-1 }; - if( filter_formats( formatList, filterFlags, numFormats, uintFormats ) == 0 ) - { - log_info( "No formats supported for unsigned int type\n" ); - } - else - { - // Only filter mode we support on uint is nearest - imageSampler.filter_mode = CL_FILTER_NEAREST; - ret += formatTestFn( device, context, queue, formatList, filterFlags, numFormats, &imageSampler, kUInt, imageType ); + // Linear filtering is only supported with floats + if (test.type == kTestFloat) + { + imageSampler.filter_mode = CL_FILTER_LINEAR; + ret += formatTestFn(device, context, queue, formatList, + filterFlags, numFormats, &imageSampler, + test.explicitType, imageType); + } + } } } return ret; diff --git a/test_conformance/images/kernel_read_write/test_read_1D.cpp b/test_conformance/images/kernel_read_write/test_read_1D.cpp index 07ad4c7d..e2e36a6f 100644 --- a/test_conformance/images/kernel_read_write/test_read_1D.cpp +++ b/test_conformance/images/kernel_read_write/test_read_1D.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -13,7 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../testBase.h" + +#include "test_common.h" #include #if defined( __APPLE__ ) @@ -25,14 +26,14 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gExtraValidateInfo, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding, gTestMipmaps; -extern cl_device_type gDeviceType; +extern bool gDebugTrace, gExtraValidateInfo, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps; extern bool gUseKernelSamplers; extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; extern uint64_t gRoundingStartValue; extern cl_mem_flags gMemFlagsToUse; extern int gtestTypesToRun; +extern bool gDeviceLt20; #define MAX_TRIES 1 #define MAX_CLAMPED 1 @@ -65,8 +66,6 @@ const char *float1DKernelSource = static const char *samplerKernelArg = " sampler_t imageSampler,"; -#define ABS_ERROR( result, expected ) ( fabsf( (float)expected - (float)result ) ) - extern void read_image_pixel_float( void *imageData, image_descriptor *imageInfo, int x, int y, int z, float *outData ); template int determine_validation_error_1D( void *imagePtr, image_descriptor *imageInfo, image_sampler_data *imageSampler, @@ -401,17 +400,8 @@ int test_read_image_1D( cl_context context, cl_command_queue queue, cl_kernel ke test_error( error, "Unable to create result buffer" ); // Create sampler to use - cl_sampler_properties properties[] = { - CL_SAMPLER_NORMALIZED_COORDS, imageSampler->normalized_coords, - CL_SAMPLER_ADDRESSING_MODE, imageSampler->addressing_mode, - CL_SAMPLER_FILTER_MODE, imageSampler->filter_mode, - 0, 0, 0 }; - if (gTestMipmaps) { - properties[6] = CL_SAMPLER_MIP_FILTER_MODE; - properties[7] = imageSampler->filter_mode; - } - actualSampler = clCreateSamplerWithProperties(context, properties, &error ); - test_error( error, "Unable to create image sampler" ); + actualSampler = create_sampler(context, imageSampler, gTestMipmaps, &error); + test_error(error, "Unable to create image sampler"); // Set arguments int idx = 0; @@ -530,10 +520,13 @@ int test_read_image_1D( cl_context context, cl_command_queue queue, cl_kernel ke xOffsetValues[ j ], 0.0f, 0.0f, norm_offset_x, 0.0f, 0.0f, imageSampler, expected, 0, &containsDenormals, lod ); - float err1 = fabsf( sRGBmap( resultPtr[0] ) - sRGBmap( expected[0] ) ); - float err2 = fabsf( sRGBmap( resultPtr[1] ) - sRGBmap( expected[1] ) ); - float err3 = fabsf( sRGBmap( resultPtr[2] ) - sRGBmap( expected[2] ) ); - float err4 = fabsf( resultPtr[3] - expected[3] ); + float err1 = ABS_ERROR(sRGBmap(resultPtr[0]), + sRGBmap(expected[0])); + float err2 = ABS_ERROR(sRGBmap(resultPtr[1]), + sRGBmap(expected[1])); + float err3 = ABS_ERROR(sRGBmap(resultPtr[2]), + sRGBmap(expected[2])); + float err4 = ABS_ERROR(resultPtr[3], expected[3]); float maxErr = 0.5; @@ -552,10 +545,13 @@ int test_read_image_1D( cl_context context, cl_command_queue queue, cl_kernel ke xOffsetValues[ j ], 0.0f, 0.0f, norm_offset_x, 0.0f, 0.0f, imageSampler, expected, 0, NULL, lod ); - err1 = fabsf( sRGBmap( resultPtr[0] ) - sRGBmap( expected[0] ) ); - err2 = fabsf( sRGBmap( resultPtr[1] ) - sRGBmap( expected[1] ) ); - err3 = fabsf( sRGBmap( resultPtr[2] ) - sRGBmap( expected[2] ) ); - err4 = fabsf( resultPtr[3] - expected[3] ); + err1 = ABS_ERROR(sRGBmap(resultPtr[0]), + sRGBmap(expected[0])); + err2 = ABS_ERROR(sRGBmap(resultPtr[1]), + sRGBmap(expected[1])); + err3 = ABS_ERROR(sRGBmap(resultPtr[2]), + sRGBmap(expected[2])); + err4 = ABS_ERROR(resultPtr[3], expected[3]); } } @@ -584,10 +580,14 @@ int test_read_image_1D( cl_context context, cl_command_queue queue, cl_kernel ke xOffsetValues[ j ], 0.0f, 0.0f, norm_offset_x, 0.0f, 0.0f, imageSampler, expected, 0, &containsDenormals, lod ); - float err1 = fabsf( sRGBmap( resultPtr[0] ) - sRGBmap( expected[0] ) ); - float err2 = fabsf( sRGBmap( resultPtr[1] ) - sRGBmap( expected[1] ) ); - float err3 = fabsf( sRGBmap( resultPtr[2] ) - sRGBmap( expected[2] ) ); - float err4 = fabsf( resultPtr[3] - expected[3] ); + float err1 = ABS_ERROR(sRGBmap(resultPtr[0]), + sRGBmap(expected[0])); + float err2 = ABS_ERROR(sRGBmap(resultPtr[1]), + sRGBmap(expected[1])); + float err3 = ABS_ERROR(sRGBmap(resultPtr[2]), + sRGBmap(expected[2])); + float err4 = + ABS_ERROR(resultPtr[3], expected[3]); float maxErr = 0.6; @@ -605,10 +605,14 @@ int test_read_image_1D( cl_context context, cl_command_queue queue, cl_kernel ke xOffsetValues[ j ], 0.0f, 0.0f, norm_offset_x, 0.0f, 0.0f, imageSampler, expected, 0, NULL, lod ); - err1 = fabsf( sRGBmap( resultPtr[0] ) - sRGBmap( expected[0] ) ); - err2 = fabsf( sRGBmap( resultPtr[1] ) - sRGBmap( expected[1] ) ); - err3 = fabsf( sRGBmap( resultPtr[2] ) - sRGBmap( expected[2] ) ); - err4 = fabsf( resultPtr[3] - expected[3] ); + err1 = ABS_ERROR(sRGBmap(resultPtr[0]), + sRGBmap(expected[0])); + err2 = ABS_ERROR(sRGBmap(resultPtr[1]), + sRGBmap(expected[1])); + err3 = ABS_ERROR(sRGBmap(resultPtr[2]), + sRGBmap(expected[2])); + err4 = ABS_ERROR(resultPtr[3], + expected[3]); } } if( ! (err1 <= maxErr) || ! (err2 <= maxErr) || @@ -675,10 +679,10 @@ int test_read_image_1D( cl_context context, cl_command_queue queue, cl_kernel ke xOffsetValues[ j ], 0.0f, 0.0f, norm_offset_x, 0.0f, 0.0f, imageSampler, expected, 0, &containsDenormals, lod ); - float err1 = fabsf( resultPtr[0] - expected[0] ); - float err2 = fabsf( resultPtr[1] - expected[1] ); - float err3 = fabsf( resultPtr[2] - expected[2] ); - float err4 = fabsf( resultPtr[3] - expected[3] ); + float err1 = ABS_ERROR(resultPtr[0], expected[0]); + float err2 = ABS_ERROR(resultPtr[1], expected[1]); + float err3 = ABS_ERROR(resultPtr[2], expected[2]); + float err4 = ABS_ERROR(resultPtr[3], expected[3]); // Clamp to the minimum absolute error for the format if (err1 > 0 && err1 < formatAbsoluteError) { err1 = 0.0f; } if (err2 > 0 && err2 < formatAbsoluteError) { err2 = 0.0f; } @@ -707,10 +711,10 @@ int test_read_image_1D( cl_context context, cl_command_queue queue, cl_kernel ke xOffsetValues[ j ], 0.0f, 0.0f, norm_offset_x, 0.0f, 0.0f, imageSampler, expected, 0, NULL, lod ); - err1 = fabsf( resultPtr[0] - expected[0] ); - err2 = fabsf( resultPtr[1] - expected[1] ); - err3 = fabsf( resultPtr[2] - expected[2] ); - err4 = fabsf( resultPtr[3] - expected[3] ); + err1 = ABS_ERROR(resultPtr[0], expected[0]); + err2 = ABS_ERROR(resultPtr[1], expected[1]); + err3 = ABS_ERROR(resultPtr[2], expected[2]); + err4 = ABS_ERROR(resultPtr[3], expected[3]); } } @@ -739,10 +743,14 @@ int test_read_image_1D( cl_context context, cl_command_queue queue, cl_kernel ke xOffsetValues[ j ], 0.0f, 0.0f, norm_offset_x, 0.0f, 0.0f, imageSampler, expected, 0, &containsDenormals, lod ); - float err1 = fabsf( resultPtr[0] - expected[0] ); - float err2 = fabsf( resultPtr[1] - expected[1] ); - float err3 = fabsf( resultPtr[2] - expected[2] ); - float err4 = fabsf( resultPtr[3] - expected[3] ); + float err1 = + ABS_ERROR(resultPtr[0], expected[0]); + float err2 = + ABS_ERROR(resultPtr[1], expected[1]); + float err3 = + ABS_ERROR(resultPtr[2], expected[2]); + float err4 = + ABS_ERROR(resultPtr[3], expected[3]); float maxErr1 = MAX( maxErr * maxPixel.p[0], FLT_MIN ); float maxErr2 = MAX( maxErr * maxPixel.p[1], FLT_MIN ); float maxErr3 = MAX( maxErr * maxPixel.p[2], FLT_MIN ); @@ -764,10 +772,14 @@ int test_read_image_1D( cl_context context, cl_command_queue queue, cl_kernel ke xOffsetValues[ j ], 0.0f, 0.0f, norm_offset_x, 0.0f, 0.0f, imageSampler, expected, 0, NULL, lod ); - err1 = fabsf( resultPtr[0] - expected[0] ); - err2 = fabsf( resultPtr[1] - expected[1] ); - err3 = fabsf( resultPtr[2] - expected[2] ); - err4 = fabsf( resultPtr[3] - expected[3] ); + err1 = ABS_ERROR(resultPtr[0], + expected[0]); + err2 = ABS_ERROR(resultPtr[1], + expected[1]); + err3 = ABS_ERROR(resultPtr[2], + expected[2]); + err4 = ABS_ERROR(resultPtr[3], + expected[3]); } } if( ! (err1 <= maxErr1) || ! (err2 <= maxErr2) || @@ -1056,7 +1068,7 @@ int test_read_image_set_1D( cl_device_id device, cl_context context, cl_command_ ptr = programSrc; - error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" ); + error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0"); if(error) { exit(1); diff --git a/test_conformance/images/kernel_read_write/test_read_1D_array.cpp b/test_conformance/images/kernel_read_write/test_read_1D_array.cpp index de01e9ed..eede817c 100644 --- a/test_conformance/images/kernel_read_write/test_read_1D_array.cpp +++ b/test_conformance/images/kernel_read_write/test_read_1D_array.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../testBase.h" +#include "test_common.h" #include #if defined( __APPLE__ ) @@ -25,14 +25,14 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gExtraValidateInfo, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding, gTestMipmaps; -extern cl_device_type gDeviceType; +extern bool gDebugTrace, gExtraValidateInfo, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps; extern bool gUseKernelSamplers; extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; extern uint64_t gRoundingStartValue; extern cl_mem_flags gMemFlagsToUse; extern int gtestTypesToRun; +extern bool gDeviceLt20; #define MAX_TRIES 1 #define MAX_CLAMPED 1 @@ -73,8 +73,6 @@ const char *floatKernelSource1DArray = static const char *samplerKernelArg = " sampler_t imageSampler,"; -#define ABS_ERROR( result, expected ) ( fabsf( (float)expected - (float)result ) ) - extern void read_image_pixel_float( void *imageData, image_descriptor *imageInfo, int x, int y, int z, float *outData ); @@ -483,17 +481,8 @@ int test_read_image_1D_array( cl_context context, cl_command_queue queue, cl_ker test_error( error, "Unable to create result buffer" ); // Create sampler to use - cl_sampler_properties properties[] = { - CL_SAMPLER_NORMALIZED_COORDS, imageSampler->normalized_coords, - CL_SAMPLER_ADDRESSING_MODE, imageSampler->addressing_mode, - CL_SAMPLER_FILTER_MODE, imageSampler->filter_mode, - 0, 0, 0 }; - if (gTestMipmaps) { - properties[6] = CL_SAMPLER_MIP_FILTER_MODE; - properties[7] = imageSampler->filter_mode; - } - actualSampler = clCreateSamplerWithProperties(context, properties, &error ); - test_error( error, "Unable to create image sampler" ); + actualSampler = create_sampler(context, imageSampler, gTestMipmaps, &error); + test_error(error, "Unable to create image sampler"); // Set arguments int idx = 0; @@ -627,10 +616,13 @@ int test_read_image_1D_array( cl_context context, cl_command_queue queue, cl_ker xOffsetValues[ j ], yOffsetValues[ j ], 0.f, norm_offset_x, norm_offset_y, 0.0f, imageSampler, expected, 0, &containsDenormals, lod ); - float err1 = fabsf( sRGBmap( resultPtr[0] ) - sRGBmap( expected[0] ) ); - float err2 = fabsf( sRGBmap( resultPtr[1] ) - sRGBmap( expected[1] ) ); - float err3 = fabsf( sRGBmap( resultPtr[2] ) - sRGBmap( expected[2] ) ); - float err4 = fabsf( resultPtr[3] - expected[3] ); + float err1 = ABS_ERROR(sRGBmap(resultPtr[0]), + sRGBmap(expected[0])); + float err2 = ABS_ERROR(sRGBmap(resultPtr[1]), + sRGBmap(expected[1])); + float err3 = ABS_ERROR(sRGBmap(resultPtr[2]), + sRGBmap(expected[2])); + float err4 = ABS_ERROR(resultPtr[3], expected[3]); float maxErr = 0.5; // Check if the result matches. @@ -648,10 +640,13 @@ int test_read_image_1D_array( cl_context context, cl_command_queue queue, cl_ker xOffsetValues[ j ], yOffsetValues[ j ], 0.f, norm_offset_x, norm_offset_y, 0.0f, imageSampler, expected, 0, NULL, lod ); - err1 = fabsf( sRGBmap( resultPtr[0] ) - sRGBmap( expected[0] ) ); - err2 = fabsf( sRGBmap( resultPtr[1] ) - sRGBmap( expected[1] ) ); - err3 = fabsf( sRGBmap( resultPtr[2] ) - sRGBmap( expected[2] ) ); - err4 = fabsf( resultPtr[3] - expected[3] ); + err1 = ABS_ERROR(sRGBmap(resultPtr[0]), + sRGBmap(expected[0])); + err2 = ABS_ERROR(sRGBmap(resultPtr[1]), + sRGBmap(expected[1])); + err3 = ABS_ERROR(sRGBmap(resultPtr[2]), + sRGBmap(expected[2])); + err4 = ABS_ERROR(resultPtr[3], expected[3]); } } @@ -683,10 +678,14 @@ int test_read_image_1D_array( cl_context context, cl_command_queue queue, cl_ker xOffsetValues[ j ], yOffsetValues[ j ], 0.f, norm_offset_x, norm_offset_y, 0.0f, imageSampler, expected, 0, &containsDenormals, lod ); - float err1 = fabsf( sRGBmap( resultPtr[0] ) - sRGBmap( expected[0] ) ); - float err2 = fabsf( sRGBmap( resultPtr[1] ) - sRGBmap( expected[1] ) ); - float err3 = fabsf( sRGBmap( resultPtr[2] ) - sRGBmap( expected[2] ) ); - float err4 = fabsf( resultPtr[3] - expected[3] ); + float err1 = ABS_ERROR(sRGBmap(resultPtr[0]), + sRGBmap(expected[0])); + float err2 = ABS_ERROR(sRGBmap(resultPtr[1]), + sRGBmap(expected[1])); + float err3 = ABS_ERROR(sRGBmap(resultPtr[2]), + sRGBmap(expected[2])); + float err4 = + ABS_ERROR(resultPtr[3], expected[3]); float maxErr = 0.6; @@ -704,10 +703,14 @@ int test_read_image_1D_array( cl_context context, cl_command_queue queue, cl_ker xOffsetValues[ j ], yOffsetValues[ j ], 0.f, norm_offset_x, norm_offset_y, 0.0f, imageSampler, expected, 0, NULL, lod ); - err1 = fabsf( sRGBmap( resultPtr[0] ) - sRGBmap( expected[0] ) ); - err2 = fabsf( sRGBmap( resultPtr[1] ) - sRGBmap( expected[1] ) ); - err3 = fabsf( sRGBmap( resultPtr[2] ) - sRGBmap( expected[2] ) ); - err4 = fabsf( resultPtr[3] - expected[3] ); + err1 = ABS_ERROR(sRGBmap(resultPtr[0]), + sRGBmap(expected[0])); + err2 = ABS_ERROR(sRGBmap(resultPtr[1]), + sRGBmap(expected[1])); + err3 = ABS_ERROR(sRGBmap(resultPtr[2]), + sRGBmap(expected[2])); + err4 = ABS_ERROR(resultPtr[3], + expected[3]); } } if( ! (err1 <= maxErr) || ! (err2 <= maxErr) || @@ -781,10 +784,10 @@ int test_read_image_1D_array( cl_context context, cl_command_queue queue, cl_ker xOffsetValues[ j ], yOffsetValues[ j ], 0.f, norm_offset_x, norm_offset_y, 0.0f, imageSampler, expected, 0, &containsDenormals, lod ); - float err1 = fabsf( resultPtr[0] - expected[0] ); - float err2 = fabsf( resultPtr[1] - expected[1] ); - float err3 = fabsf( resultPtr[2] - expected[2] ); - float err4 = fabsf( resultPtr[3] - expected[3] ); + float err1 = ABS_ERROR(resultPtr[0], expected[0]); + float err2 = ABS_ERROR(resultPtr[1], expected[1]); + float err3 = ABS_ERROR(resultPtr[2], expected[2]); + float err4 = ABS_ERROR(resultPtr[3], expected[3]); // Clamp to the minimum absolute error for the format if (err1 > 0 && err1 < formatAbsoluteError) { err1 = 0.0f; } if (err2 > 0 && err2 < formatAbsoluteError) { err2 = 0.0f; } @@ -813,10 +816,10 @@ int test_read_image_1D_array( cl_context context, cl_command_queue queue, cl_ker xOffsetValues[ j ], yOffsetValues[ j ], 0.f, norm_offset_x, norm_offset_y, 0.0f, imageSampler, expected, 0, NULL, lod ); - err1 = fabsf( resultPtr[0] - expected[0] ); - err2 = fabsf( resultPtr[1] - expected[1] ); - err3 = fabsf( resultPtr[2] - expected[2] ); - err4 = fabsf( resultPtr[3] - expected[3] ); + err1 = ABS_ERROR(resultPtr[0], expected[0]); + err2 = ABS_ERROR(resultPtr[1], expected[1]); + err3 = ABS_ERROR(resultPtr[2], expected[2]); + err4 = ABS_ERROR(resultPtr[3], expected[3]); } } @@ -848,10 +851,14 @@ int test_read_image_1D_array( cl_context context, cl_command_queue queue, cl_ker xOffsetValues[ j ], yOffsetValues[ j ], 0.f, norm_offset_x, norm_offset_y, 0.0f, imageSampler, expected, 0, &containsDenormals, lod ); - float err1 = fabsf( resultPtr[0] - expected[0] ); - float err2 = fabsf( resultPtr[1] - expected[1] ); - float err3 = fabsf( resultPtr[2] - expected[2] ); - float err4 = fabsf( resultPtr[3] - expected[3] ); + float err1 = + ABS_ERROR(resultPtr[0], expected[0]); + float err2 = + ABS_ERROR(resultPtr[1], expected[1]); + float err3 = + ABS_ERROR(resultPtr[2], expected[2]); + float err4 = + ABS_ERROR(resultPtr[3], expected[3]); float maxErr1 = MAX( maxErr * maxPixel.p[0], FLT_MIN ); float maxErr2 = MAX( maxErr * maxPixel.p[1], FLT_MIN ); float maxErr3 = MAX( maxErr * maxPixel.p[2], FLT_MIN ); @@ -873,10 +880,14 @@ int test_read_image_1D_array( cl_context context, cl_command_queue queue, cl_ker xOffsetValues[ j ], yOffsetValues[ j ], 0.f, norm_offset_x, norm_offset_y, 0.0f, imageSampler, expected, 0, NULL, lod ); - err1 = fabsf( resultPtr[0] - expected[0] ); - err2 = fabsf( resultPtr[1] - expected[1] ); - err3 = fabsf( resultPtr[2] - expected[2] ); - err4 = fabsf( resultPtr[3] - expected[3] ); + err1 = ABS_ERROR(resultPtr[0], + expected[0]); + err2 = ABS_ERROR(resultPtr[1], + expected[1]); + err3 = ABS_ERROR(resultPtr[2], + expected[2]); + err4 = ABS_ERROR(resultPtr[3], + expected[3]); } } if( ! (err1 <= maxErr1) || ! (err2 <= maxErr2) || @@ -1165,7 +1176,7 @@ int test_read_image_set_1D_array( cl_device_id device, cl_context context, cl_co gTestMipmaps ? ", lod" : "" ); ptr = programSrc; - error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" ); + error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0"); test_error( error, "Unable to create testing kernel" ); if( gTestSmallImages ) diff --git a/test_conformance/images/kernel_read_write/test_read_2D_array.cpp b/test_conformance/images/kernel_read_write/test_read_2D_array.cpp index 1e2700b0..79420b4c 100644 --- a/test_conformance/images/kernel_read_write/test_read_2D_array.cpp +++ b/test_conformance/images/kernel_read_write/test_read_2D_array.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -13,19 +13,19 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../testBase.h" +#include "test_common.h" #include #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gExtraValidateInfo, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding, gTestMipmaps; -extern cl_device_type gDeviceType; +extern bool gDebugTrace, gExtraValidateInfo, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps; extern bool gUseKernelSamplers; extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; extern cl_mem_flags gMemFlagsToUse; extern int gtestTypesToRun; +extern bool gDeviceLt20; #define MAX_TRIES 1 #define MAX_CLAMPED 1 @@ -88,8 +88,6 @@ const char *float2DArrayUnnormalizedCoordKernelSource = static const char *samplerKernelArg = " sampler_t imageSampler,"; -#define ABS_ERROR( result, expected ) ( fabsf( (float)expected - (float)result ) ) - extern void read_image_pixel_float( void *imageData, image_descriptor *imageInfo, int x, int y, int z, float *outData ); template int determine_validation_error_offset_2D_array( void *imagePtr, image_descriptor *imageInfo, image_sampler_data *imageSampler, T *resultPtr, T * expected, float error, @@ -490,17 +488,8 @@ int test_read_image_2D_array( cl_context context, cl_command_queue queue, cl_ker test_error( error, "Unable to create result buffer" ); // Create sampler to use - cl_sampler_properties properties[] = { - CL_SAMPLER_NORMALIZED_COORDS, imageSampler->normalized_coords, - CL_SAMPLER_ADDRESSING_MODE, imageSampler->addressing_mode, - CL_SAMPLER_FILTER_MODE, imageSampler->filter_mode, - 0, 0, 0 }; - if (gTestMipmaps) { - properties[6] = CL_SAMPLER_MIP_FILTER_MODE; - properties[7] = imageSampler->filter_mode; - } - actualSampler = clCreateSamplerWithProperties(context, properties, &error ); - test_error( error, "Unable to create image sampler" ); + actualSampler = create_sampler(context, imageSampler, gTestMipmaps, &error); + test_error(error, "Unable to create image sampler"); // Set arguments int idx = 0; @@ -631,7 +620,8 @@ int test_read_image_2D_array( cl_context context, cl_command_queue queue, cl_ker norm_offset_x, norm_offset_y, norm_offset_z, imageSampler, expected, 0, &hasDenormals, lod ); - float err1 = fabsf( resultPtr[0] - expected[0] ); + float err1 = + ABS_ERROR(resultPtr[0], expected[0]); // Clamp to the minimum absolute error for the format if (err1 > 0 && err1 < formatAbsoluteError) { err1 = 0.0f; } float maxErr1 = MAX( maxErr * maxPixel.p[0], FLT_MIN ); @@ -650,7 +640,8 @@ int test_read_image_2D_array( cl_context context, cl_command_queue queue, cl_ker norm_offset_x, norm_offset_y, norm_offset_z, imageSampler, expected, 0, NULL, lod ); - err1 = fabsf( resultPtr[0] - expected[0] ); + err1 = ABS_ERROR(resultPtr[0], + expected[0]); } } @@ -675,7 +666,8 @@ int test_read_image_2D_array( cl_context context, cl_command_queue queue, cl_ker norm_offset_x, norm_offset_y, norm_offset_z, imageSampler, expected, 0, &hasDenormals, lod ); - float err1 = fabsf( resultPtr[0] - expected[0] ); + float err1 = ABS_ERROR(resultPtr[0], + expected[0]); float maxErr1 = MAX( maxErr * maxPixel.p[0], FLT_MIN ); @@ -690,7 +682,8 @@ int test_read_image_2D_array( cl_context context, cl_command_queue queue, cl_ker xOffsetValues[ j ], yOffsetValues[ j ], zOffsetValues[ j ], imageSampler, expected, 0, NULL, lod ); - err1 = fabsf( resultPtr[0] - expected[0] ); + err1 = ABS_ERROR(resultPtr[0], + expected[0]); } } @@ -766,10 +759,17 @@ int test_read_image_2D_array( cl_context context, cl_command_queue queue, cl_ker norm_offset_x, norm_offset_y, norm_offset_z, imageSampler, expected, 0, &hasDenormals, lod ); - float err1 = fabsf( sRGBmap( resultPtr[0] ) - sRGBmap( expected[0] ) ); - float err2 = fabsf( sRGBmap( resultPtr[1] ) - sRGBmap( expected[1] ) ); - float err3 = fabsf( sRGBmap( resultPtr[2] ) - sRGBmap( expected[2] ) ); - float err4 = fabsf( resultPtr[3] - expected[3] ); + float err1 = + ABS_ERROR(sRGBmap(resultPtr[0]), + sRGBmap(expected[0])); + float err2 = + ABS_ERROR(sRGBmap(resultPtr[1]), + sRGBmap(expected[1])); + float err3 = + ABS_ERROR(sRGBmap(resultPtr[2]), + sRGBmap(expected[2])); + float err4 = + ABS_ERROR(resultPtr[3], expected[3]); float maxErr = 0.5; if( ! (err1 <= maxErr) || ! (err2 <= maxErr) || ! (err3 <= maxErr) || ! (err4 <= maxErr) ) @@ -786,10 +786,17 @@ int test_read_image_2D_array( cl_context context, cl_command_queue queue, cl_ker norm_offset_x, norm_offset_y, norm_offset_z, imageSampler, expected, 0, NULL, lod ); - err1 = fabsf( sRGBmap( resultPtr[0] ) - sRGBmap( expected[0] ) ); - err2 = fabsf( sRGBmap( resultPtr[1] ) - sRGBmap( expected[1] ) ); - err3 = fabsf( sRGBmap( resultPtr[2] ) - sRGBmap( expected[2] ) ); - err4 = fabsf( resultPtr[3] - expected[3] ); + err1 = + ABS_ERROR(sRGBmap(resultPtr[0]), + sRGBmap(expected[0])); + err2 = + ABS_ERROR(sRGBmap(resultPtr[1]), + sRGBmap(expected[1])); + err3 = + ABS_ERROR(sRGBmap(resultPtr[2]), + sRGBmap(expected[2])); + err4 = ABS_ERROR(resultPtr[3], + expected[3]); } } @@ -814,10 +821,17 @@ int test_read_image_2D_array( cl_context context, cl_command_queue queue, cl_ker norm_offset_x, norm_offset_y, norm_offset_z, imageSampler, expected, 0, &hasDenormals, lod ); - float err1 = fabsf( sRGBmap( resultPtr[0] ) - sRGBmap( expected[0] ) ); - float err2 = fabsf( sRGBmap( resultPtr[1] ) - sRGBmap( expected[1] ) ); - float err3 = fabsf( sRGBmap( resultPtr[2] ) - sRGBmap( expected[2] ) ); - float err4 = fabsf( resultPtr[3] - expected[3] ); + float err1 = + ABS_ERROR(sRGBmap(resultPtr[0]), + sRGBmap(expected[0])); + float err2 = + ABS_ERROR(sRGBmap(resultPtr[1]), + sRGBmap(expected[1])); + float err3 = + ABS_ERROR(sRGBmap(resultPtr[2]), + sRGBmap(expected[2])); + float err4 = ABS_ERROR(resultPtr[3], + expected[3]); float maxErr = 0.6; if( ! (err1 <= maxErr) || ! (err2 <= maxErr) || ! (err3 <= maxErr) || ! (err4 <= maxErr) ) @@ -833,10 +847,17 @@ int test_read_image_2D_array( cl_context context, cl_command_queue queue, cl_ker xOffsetValues[ j ], yOffsetValues[ j ], zOffsetValues[ j ], imageSampler, expected, 0, NULL, lod ); - err1 = fabsf( sRGBmap( resultPtr[0] ) - sRGBmap( expected[0] ) ); - err2 = fabsf( sRGBmap( resultPtr[1] ) - sRGBmap( expected[1] ) ); - err3 = fabsf( sRGBmap( resultPtr[2] ) - sRGBmap( expected[2] ) ); - err4 = fabsf( resultPtr[3] - expected[3] ); + err1 = ABS_ERROR( + sRGBmap(resultPtr[0]), + sRGBmap(expected[0])); + err2 = ABS_ERROR( + sRGBmap(resultPtr[1]), + sRGBmap(expected[1])); + err3 = ABS_ERROR( + sRGBmap(resultPtr[2]), + sRGBmap(expected[2])); + err4 = ABS_ERROR(resultPtr[3], + expected[3]); } } @@ -915,10 +936,14 @@ int test_read_image_2D_array( cl_context context, cl_command_queue queue, cl_ker norm_offset_x, norm_offset_y, norm_offset_z, imageSampler, expected, 0, &hasDenormals, lod ); - float err1 = fabsf( resultPtr[0] - expected[0] ); - float err2 = fabsf( resultPtr[1] - expected[1] ); - float err3 = fabsf( resultPtr[2] - expected[2] ); - float err4 = fabsf( resultPtr[3] - expected[3] ); + float err1 = + ABS_ERROR(resultPtr[0], expected[0]); + float err2 = + ABS_ERROR(resultPtr[1], expected[1]); + float err3 = + ABS_ERROR(resultPtr[2], expected[2]); + float err4 = + ABS_ERROR(resultPtr[3], expected[3]); // Clamp to the minimum absolute error for the format if (err1 > 0 && err1 < formatAbsoluteError) { err1 = 0.0f; } if (err2 > 0 && err2 < formatAbsoluteError) { err2 = 0.0f; } @@ -946,10 +971,14 @@ int test_read_image_2D_array( cl_context context, cl_command_queue queue, cl_ker norm_offset_x, norm_offset_y, norm_offset_z, imageSampler, expected, 0, NULL, lod ); - err1 = fabsf( resultPtr[0] - expected[0] ); - err2 = fabsf( resultPtr[1] - expected[1] ); - err3 = fabsf( resultPtr[2] - expected[2] ); - err4 = fabsf( resultPtr[3] - expected[3] ); + err1 = ABS_ERROR(resultPtr[0], + expected[0]); + err2 = ABS_ERROR(resultPtr[1], + expected[1]); + err3 = ABS_ERROR(resultPtr[2], + expected[2]); + err4 = ABS_ERROR(resultPtr[3], + expected[3]); } } @@ -974,10 +1003,14 @@ int test_read_image_2D_array( cl_context context, cl_command_queue queue, cl_ker norm_offset_x, norm_offset_y, norm_offset_z, imageSampler, expected, 0, &hasDenormals, lod ); - float err1 = fabsf( resultPtr[0] - expected[0] ); - float err2 = fabsf( resultPtr[1] - expected[1] ); - float err3 = fabsf( resultPtr[2] - expected[2] ); - float err4 = fabsf( resultPtr[3] - expected[3] ); + float err1 = ABS_ERROR(resultPtr[0], + expected[0]); + float err2 = ABS_ERROR(resultPtr[1], + expected[1]); + float err3 = ABS_ERROR(resultPtr[2], + expected[2]); + float err4 = ABS_ERROR(resultPtr[3], + expected[3]); float maxErr1 = MAX( maxErr * maxPixel.p[0], FLT_MIN ); float maxErr2 = MAX( maxErr * maxPixel.p[1], FLT_MIN ); float maxErr3 = MAX( maxErr * maxPixel.p[2], FLT_MIN ); @@ -998,10 +1031,14 @@ int test_read_image_2D_array( cl_context context, cl_command_queue queue, cl_ker xOffsetValues[ j ], yOffsetValues[ j ], zOffsetValues[ j ], imageSampler, expected, 0, NULL, lod ); - err1 = fabsf( resultPtr[0] - expected[0] ); - err2 = fabsf( resultPtr[1] - expected[1] ); - err3 = fabsf( resultPtr[2] - expected[2] ); - err4 = fabsf( resultPtr[3] - expected[3] ); + err1 = ABS_ERROR(resultPtr[0], + expected[0]); + err2 = ABS_ERROR(resultPtr[1], + expected[1]); + err3 = ABS_ERROR(resultPtr[2], + expected[2]); + err4 = ABS_ERROR(resultPtr[3], + expected[3]); } } @@ -1357,7 +1394,7 @@ int test_read_image_set_2D_array( cl_device_id device, cl_context context, cl_co gTestMipmaps ? ", lod" : " " ); ptr = programSrc; - error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" ); + error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0"); test_error( error, "Unable to create testing kernel" ); // Run tests diff --git a/test_conformance/images/kernel_read_write/test_read_3D.cpp b/test_conformance/images/kernel_read_write/test_read_3D.cpp index 8c6630ec..0b9e8dee 100644 --- a/test_conformance/images/kernel_read_write/test_read_3D.cpp +++ b/test_conformance/images/kernel_read_write/test_read_3D.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -13,20 +13,20 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../testBase.h" +#include "test_common.h" #include #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gExtraValidateInfo, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding, gTestMipmaps; -extern cl_device_type gDeviceType; +extern bool gDebugTrace, gExtraValidateInfo, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps; extern bool gUseKernelSamplers; extern cl_filter_mode gFilterModeToUse; extern cl_addressing_mode gAddressModeToUse; extern cl_mem_flags gMemFlagsToUse; extern int gtestTypesToRun; +extern bool gDeviceLt20; #define MAX_TRIES 1 #define MAX_CLAMPED 1 @@ -88,8 +88,6 @@ const char *float3DUnnormalizedCoordKernelSource = static const char *samplerKernelArg = " sampler_t imageSampler,"; -#define ABS_ERROR( result, expected ) ( fabsf( (float)expected - (float)result ) ) - extern void read_image_pixel_float( void *imageData, image_descriptor *imageInfo, int x, int y, int z, float *outData ); template int determine_validation_error_offset( void *imagePtr, image_descriptor *imageInfo, image_sampler_data *imageSampler, T *resultPtr, T * expected, float error, @@ -499,17 +497,8 @@ int test_read_image_3D( cl_context context, cl_command_queue queue, cl_kernel ke test_error( error, "Unable to create result buffer" ); // Create sampler to use - cl_sampler_properties properties[] = { - CL_SAMPLER_NORMALIZED_COORDS, imageSampler->normalized_coords, - CL_SAMPLER_ADDRESSING_MODE, imageSampler->addressing_mode, - CL_SAMPLER_FILTER_MODE, imageSampler->filter_mode, - 0, 0, 0 }; - if (gTestMipmaps) { - properties[6] = CL_SAMPLER_MIP_FILTER_MODE; - properties[7] = imageSampler->filter_mode; - } - actualSampler = clCreateSamplerWithProperties(context, properties, &error ); - test_error( error, "Unable to create image sampler" ); + actualSampler = create_sampler(context, imageSampler, gTestMipmaps, &error); + test_error(error, "Unable to create image sampler"); // Set arguments int idx = 0; @@ -647,10 +636,17 @@ int test_read_image_3D( cl_context context, cl_command_queue queue, cl_kernel ke norm_offset_x, norm_offset_y, norm_offset_z, imageSampler, expected, 0, &hasDenormals, lod ); - float err1 = fabsf( sRGBmap( resultPtr[0] ) - sRGBmap( expected[0] ) ); - float err2 = fabsf( sRGBmap( resultPtr[1] ) - sRGBmap( expected[1] ) ); - float err3 = fabsf( sRGBmap( resultPtr[2] ) - sRGBmap( expected[2] ) ); - float err4 = fabsf( resultPtr[3] - expected[3] ); + float err1 = + ABS_ERROR(sRGBmap(resultPtr[0]), + sRGBmap(expected[0])); + float err2 = + ABS_ERROR(sRGBmap(resultPtr[1]), + sRGBmap(expected[1])); + float err3 = + ABS_ERROR(sRGBmap(resultPtr[2]), + sRGBmap(expected[2])); + float err4 = + ABS_ERROR(resultPtr[3], expected[3]); // Clamp to the minimum absolute error for the format if (err1 > 0 && err1 < formatAbsoluteError) { err1 = 0.0f; } if (err2 > 0 && err2 < formatAbsoluteError) { err2 = 0.0f; } @@ -672,10 +668,17 @@ int test_read_image_3D( cl_context context, cl_command_queue queue, cl_kernel ke norm_offset_x, norm_offset_y, norm_offset_z, imageSampler, expected, 0, NULL, lod ); - err1 = fabsf( sRGBmap( resultPtr[0] ) - sRGBmap( expected[0] ) ); - err2 = fabsf( sRGBmap( resultPtr[1] ) - sRGBmap( expected[1] ) ); - err3 = fabsf( sRGBmap( resultPtr[2] ) - sRGBmap( expected[2] ) ); - err4 = fabsf( resultPtr[3] - expected[3] ); + err1 = + ABS_ERROR(sRGBmap(resultPtr[0]), + sRGBmap(expected[0])); + err2 = + ABS_ERROR(sRGBmap(resultPtr[1]), + sRGBmap(expected[1])); + err3 = + ABS_ERROR(sRGBmap(resultPtr[2]), + sRGBmap(expected[2])); + err4 = ABS_ERROR(resultPtr[3], + expected[3]); } } @@ -700,10 +703,17 @@ int test_read_image_3D( cl_context context, cl_command_queue queue, cl_kernel ke norm_offset_x, norm_offset_y, norm_offset_z, imageSampler, expected, 0, &hasDenormals, lod ); - float err1 = fabsf( sRGBmap( resultPtr[0] ) - sRGBmap( expected[0] ) ); - float err2 = fabsf( sRGBmap( resultPtr[1] ) - sRGBmap( expected[1] ) ); - float err3 = fabsf( sRGBmap( resultPtr[2] ) - sRGBmap( expected[2] ) ); - float err4 = fabsf( resultPtr[3] - expected[3] ); + float err1 = + ABS_ERROR(sRGBmap(resultPtr[0]), + sRGBmap(expected[0])); + float err2 = + ABS_ERROR(sRGBmap(resultPtr[1]), + sRGBmap(expected[1])); + float err3 = + ABS_ERROR(sRGBmap(resultPtr[2]), + sRGBmap(expected[2])); + float err4 = ABS_ERROR(resultPtr[3], + expected[3]); float maxErr = 0.6; if( ! (err1 <= maxErr) || ! (err2 <= maxErr) || ! (err3 <= maxErr) || ! (err4 <= maxErr) ) @@ -719,10 +729,17 @@ int test_read_image_3D( cl_context context, cl_command_queue queue, cl_kernel ke xOffsetValues[ j ], yOffsetValues[ j ], zOffsetValues[ j ], imageSampler, expected, 0, NULL, lod ); - err1 = fabsf( sRGBmap( resultPtr[0] ) - sRGBmap( expected[0] ) ); - err2 = fabsf( sRGBmap( resultPtr[1] ) - sRGBmap( expected[1] ) ); - err3 = fabsf( sRGBmap( resultPtr[2] ) - sRGBmap( expected[2] ) ); - err4 = fabsf( resultPtr[3] - expected[3] ); + err1 = ABS_ERROR( + sRGBmap(resultPtr[0]), + sRGBmap(expected[0])); + err2 = ABS_ERROR( + sRGBmap(resultPtr[1]), + sRGBmap(expected[1])); + err3 = ABS_ERROR( + sRGBmap(resultPtr[2]), + sRGBmap(expected[2])); + err4 = ABS_ERROR(resultPtr[3], + expected[3]); } } @@ -801,10 +818,14 @@ int test_read_image_3D( cl_context context, cl_command_queue queue, cl_kernel ke norm_offset_x, norm_offset_y, norm_offset_z, imageSampler, expected, 0, &hasDenormals, lod ); - float err1 = fabsf( resultPtr[0] - expected[0] ); - float err2 = fabsf( resultPtr[1] - expected[1] ); - float err3 = fabsf( resultPtr[2] - expected[2] ); - float err4 = fabsf( resultPtr[3] - expected[3] ); + float err1 = + ABS_ERROR(resultPtr[0], expected[0]); + float err2 = + ABS_ERROR(resultPtr[1], expected[1]); + float err3 = + ABS_ERROR(resultPtr[2], expected[2]); + float err4 = + ABS_ERROR(resultPtr[3], expected[3]); // Clamp to the minimum absolute error for the format if (err1 > 0 && err1 < formatAbsoluteError) { err1 = 0.0f; } if (err2 > 0 && err2 < formatAbsoluteError) { err2 = 0.0f; } @@ -832,10 +853,14 @@ int test_read_image_3D( cl_context context, cl_command_queue queue, cl_kernel ke norm_offset_x, norm_offset_y, norm_offset_z, imageSampler, expected, 0, NULL, lod ); - err1 = fabsf( resultPtr[0] - expected[0] ); - err2 = fabsf( resultPtr[1] - expected[1] ); - err3 = fabsf( resultPtr[2] - expected[2] ); - err4 = fabsf( resultPtr[3] - expected[3] ); + err1 = ABS_ERROR(resultPtr[0], + expected[0]); + err2 = ABS_ERROR(resultPtr[1], + expected[1]); + err3 = ABS_ERROR(resultPtr[2], + expected[2]); + err4 = ABS_ERROR(resultPtr[3], + expected[3]); } } @@ -860,10 +885,14 @@ int test_read_image_3D( cl_context context, cl_command_queue queue, cl_kernel ke norm_offset_x, norm_offset_y, norm_offset_z, imageSampler, expected, 0, &hasDenormals, lod ); - float err1 = fabsf( resultPtr[0] - expected[0] ); - float err2 = fabsf( resultPtr[1] - expected[1] ); - float err3 = fabsf( resultPtr[2] - expected[2] ); - float err4 = fabsf( resultPtr[3] - expected[3] ); + float err1 = ABS_ERROR(resultPtr[0], + expected[0]); + float err2 = ABS_ERROR(resultPtr[1], + expected[1]); + float err3 = ABS_ERROR(resultPtr[2], + expected[2]); + float err4 = ABS_ERROR(resultPtr[3], + expected[3]); float maxErr1 = MAX( maxErr * maxPixel.p[0], FLT_MIN ); float maxErr2 = MAX( maxErr * maxPixel.p[1], FLT_MIN ); float maxErr3 = MAX( maxErr * maxPixel.p[2], FLT_MIN ); @@ -884,10 +913,14 @@ int test_read_image_3D( cl_context context, cl_command_queue queue, cl_kernel ke xOffsetValues[ j ], yOffsetValues[ j ], zOffsetValues[ j ], imageSampler, expected, 0, NULL, lod ); - err1 = fabsf( resultPtr[0] - expected[0] ); - err2 = fabsf( resultPtr[1] - expected[1] ); - err3 = fabsf( resultPtr[2] - expected[2] ); - err4 = fabsf( resultPtr[3] - expected[3] ); + err1 = ABS_ERROR(resultPtr[0], + expected[0]); + err2 = ABS_ERROR(resultPtr[1], + expected[1]); + err3 = ABS_ERROR(resultPtr[2], + expected[2]); + err4 = ABS_ERROR(resultPtr[3], + expected[3]); } } @@ -1201,7 +1234,7 @@ int test_read_image_set_3D( cl_device_id device, cl_context context, cl_command_ gTestMipmaps? ",lod":" "); ptr = programSrc; - error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" ); + error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0"); test_error( error, "Unable to create testing kernel" ); // Run tests @@ -1320,7 +1353,3 @@ int test_read_image_set_3D( cl_device_id device, cl_context context, cl_command_ return 0; } - - - - diff --git a/test_conformance/images/kernel_read_write/test_write_1D.cpp b/test_conformance/images/kernel_read_write/test_write_1D.cpp index 420c4999..ca022629 100644 --- a/test_conformance/images/kernel_read_write/test_write_1D.cpp +++ b/test_conformance/images/kernel_read_write/test_write_1D.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -19,13 +19,15 @@ #include #endif -#define MAX_ERR 0.005f - -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding, gTestMipmaps; +extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps; extern cl_filter_mode gFilterModeToSkip; extern cl_mem_flags gMemFlagsToUse; extern int gtestTypesToRun; +extern bool gDeviceLt20; + +extern bool validate_float_write_results( float *expected, float *actual, image_descriptor *imageInfo ); +extern bool validate_half_write_results( cl_half *expected, cl_half *actual, image_descriptor* imageInfo ); const char *readwrite1DKernelSourcePattern = "__kernel void sample_kernel( __global %s4 *input, read_write image1d_t output %s)\n" @@ -72,7 +74,6 @@ int test_write_image_1D( cl_device_id device, cl_context context, cl_command_que int error; size_t threads[2]; bool verifyRounding = false; - int totalErrors = 0; int forceCorrectlyRoundedWrites = 0; #if defined( __APPLE__ ) @@ -307,7 +308,7 @@ int test_write_image_1D( cl_device_id device, cl_context context, cl_command_que int numTries = 5; { char *resultPtr = (char *)resultValues; - for( size_t x = 0, i = 0; x < width_lod; x++, i++ ) + for( size_t x = 0, i = 0; i < width_lod; x++, i++ ) { char resultBuffer[ 16 ]; // Largest format would be 4 channels * 4 bytes (32 bits) each @@ -357,20 +358,14 @@ int test_write_image_1D( cl_device_id device, cl_context context, cl_command_que } else if( imageInfo->format->image_channel_data_type == CL_FLOAT ) { - // Compare floats float *expected = (float *)resultBuffer; float *actual = (float *)resultPtr; - float err = 0.f; - for( unsigned int j = 0; j < get_format_channel_count( imageInfo->format ); j++ ) - err += ( expected[ j ] != 0 ) ? fabsf( ( expected[ j ] - actual[ j ] ) / expected[ j ] ) : fabsf( expected[ j ] - actual[ j ] ); - err /= (float)get_format_channel_count( imageInfo->format ); - if( err > MAX_ERR ) + if( !validate_float_write_results( expected, actual, imageInfo ) ) { - unsigned int *e = (unsigned int *)expected; - unsigned int *a = (unsigned int *)actual; - log_error( "ERROR: Sample %ld (%ld) did not validate! (%s)\n", i, x, mem_flag_names[mem_flag_index] ); - log_error( " Error: %g\n", err ); + unsigned int *e = (unsigned int *)resultBuffer; + unsigned int *a = (unsigned int *)resultPtr; + log_error( "ERROR: Sample %ld did not validate! (%s)\n", i, mem_flag_names[ mem_flag_index ] ); log_error( " Expected: %a %a %a %a\n", expected[ 0 ], expected[ 1 ], expected[ 2 ], expected[ 3 ] ); log_error( " Expected: %08x %08x %08x %08x\n", e[ 0 ], e[ 1 ], e[ 2 ], e[ 3 ] ); log_error( " Actual: %a %a %a %a\n", actual[ 0 ], actual[ 1 ], actual[ 2 ], actual[ 3 ] ); @@ -382,37 +377,22 @@ int test_write_image_1D( cl_device_id device, cl_context context, cl_command_que } else if( imageInfo->format->image_channel_data_type == CL_HALF_FLOAT ) { - // Compare half floats - if( memcmp( resultBuffer, resultPtr, 2 * get_format_channel_count( imageInfo->format ) ) != 0 ) + cl_half *e = (cl_half *)resultBuffer; + cl_half *a = (cl_half *)resultPtr; + if( !validate_half_write_results( e, a, imageInfo ) ) { - cl_ushort *e = (cl_ushort *)resultBuffer; - cl_ushort *a = (cl_ushort *)resultPtr; - int err_cnt = 0; - - //Fix up cases where we have NaNs - for( size_t j = 0; j < get_format_channel_count( imageInfo->format ); j++ ) + totalErrors++; + log_error( "ERROR: Sample %ld did not validate! (%s)\n", i, mem_flag_names[ mem_flag_index ] ); + log_error( " Expected: 0x%04x 0x%04x 0x%04x 0x%04x\n", e[ 0 ], e[ 1 ], e[ 2 ], e[ 3 ] ); + log_error( " Actual: 0x%04x 0x%04x 0x%04x 0x%04x\n", a[ 0 ], a[ 1 ], a[ 2 ], a[ 3 ] ); + if( inputType == kFloat ) { - if( is_half_nan( e[j] ) && is_half_nan(a[j]) ) - continue; - if( e[j] != a[j] ) - err_cnt++; - } - - if( err_cnt ) - { - totalErrors++; - log_error( "ERROR: Sample %ld (%ld) did not validate! (%s)\n", i, x, mem_flag_names[mem_flag_index] ); - log_error( " Expected: 0x%04x 0x%04x 0x%04x 0x%04x\n", e[0], e[1], e[2], e[3] ); - log_error( " Actual: 0x%04x 0x%04x 0x%04x 0x%04x\n", a[0], a[1], a[2], a[3] ); - if( inputType == kFloat ) - { - float *p = (float *)(char *)imagePtr; - log_error( " Source: %a %a %a %a\n", p[ 0 ], p[ 1 ], p[ 2 ], p[ 3 ] ); - log_error( " : %12.24f %12.24f %12.24f %12.24f\n", p[ 0 ], p[ 1 ], p[ 2 ], p[ 3 ] ); - } - if( ( --numTries ) == 0 ) - return 1; + float *p = (float *)imagePtr; + log_error( " Source: %a %a %a %a\n", p[ 0 ], p[ 1 ], p[ 2] , p[ 3] ); + log_error( " : %12.24f %12.24f %12.24f %12.24f\n", p[ 0 ], p[ 1 ], p[ 2 ], p[ 3 ] ); } + if( ( --numTries ) == 0 ) + return 1; } } else @@ -533,7 +513,6 @@ int test_write_image_1D( cl_device_id device, cl_context context, cl_command_que return totalErrors; } - int test_write_image_1D_set( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format, ExplicitType inputType, MTdata d ) { char programSrc[10240]; @@ -592,7 +571,7 @@ int test_write_image_1D_set( cl_device_id device, cl_context context, cl_command gTestMipmaps ? ", lod" :"" ); ptr = programSrc; - error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" ); + error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0"); test_error( error, "Unable to create testing kernel" ); // Run tests diff --git a/test_conformance/images/kernel_read_write/test_write_1D_array.cpp b/test_conformance/images/kernel_read_write/test_write_1D_array.cpp index 3e04c229..b91bf1cf 100644 --- a/test_conformance/images/kernel_read_write/test_write_1D_array.cpp +++ b/test_conformance/images/kernel_read_write/test_write_1D_array.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -19,12 +19,14 @@ #include #endif -#define MAX_ERR 0.005f - -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding, gTestMipmaps; +extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps; extern cl_filter_mode gFilterModeToSkip; extern cl_mem_flags gMemFlagsToUse; extern int gtestTypesToRun; +extern bool gDeviceLt20; + +extern bool validate_float_write_results( float *expected, float *actual, image_descriptor *imageInfo ); +extern bool validate_half_write_results( cl_half *expected, cl_half *actual, image_descriptor *imageInfo ); const char *readwrite1DArrayKernelSourcePattern = "__kernel void sample_kernel( __global %s4 *input, read_write image1d_array_t output %s)\n" @@ -81,7 +83,6 @@ int test_write_image_1D_array( cl_device_id device, cl_context context, cl_comma int error; size_t threads[2]; bool verifyRounding = false; - int totalErrors = 0; int forceCorrectlyRoundedWrites = 0; #if defined( __APPLE__ ) @@ -376,20 +377,14 @@ int test_write_image_1D_array( cl_device_id device, cl_context context, cl_comma } else if( imageInfo->format->image_channel_data_type == CL_FLOAT ) { - // Compare floats float *expected = (float *)resultBuffer; float *actual = (float *)resultPtr; - float err = 0.f; - for( unsigned int j = 0; j < get_format_channel_count( imageInfo->format ); j++ ) - err += ( expected[ j ] != 0 ) ? fabsf( ( expected[ j ] - actual[ j ] ) / expected[ j ] ) : fabsf( expected[ j ] - actual[ j ] ); - err /= (float)get_format_channel_count( imageInfo->format ); - if( err > MAX_ERR ) + if( !validate_float_write_results( expected, actual, imageInfo ) ) { - unsigned int *e = (unsigned int *)expected; - unsigned int *a = (unsigned int *)actual; - log_error( "ERROR: Sample %ld (%ld,%ld) did not validate! (%s)\n", i, x, y, mem_flag_names[mem_flag_index] ); - log_error( " Error: %g\n", err ); + unsigned int *e = (unsigned int *)resultBuffer; + unsigned int *a = (unsigned int *)resultPtr; + log_error( "ERROR: Sample %ld (%ld,%ld) did not validate! (%s)\n", i, x, y, mem_flag_names[ mem_flag_index ] ); log_error( " Expected: %a %a %a %a\n", expected[ 0 ], expected[ 1 ], expected[ 2 ], expected[ 3 ] ); log_error( " Expected: %08x %08x %08x %08x\n", e[ 0 ], e[ 1 ], e[ 2 ], e[ 3 ] ); log_error( " Actual: %a %a %a %a\n", actual[ 0 ], actual[ 1 ], actual[ 2 ], actual[ 3 ] ); @@ -401,38 +396,22 @@ int test_write_image_1D_array( cl_device_id device, cl_context context, cl_comma } else if( imageInfo->format->image_channel_data_type == CL_HALF_FLOAT ) { - - // Compare half floats - if( memcmp( resultBuffer, resultPtr, 2 * get_format_channel_count( imageInfo->format ) ) != 0 ) + cl_half *e = (cl_half *)resultBuffer; + cl_half *a = (cl_half *)resultPtr; + if( !validate_half_write_results( e, a, imageInfo ) ) { - cl_ushort *e = (cl_ushort *)resultBuffer; - cl_ushort *a = (cl_ushort *)resultPtr; - int err_cnt = 0; - - //Fix up cases where we have NaNs - for( size_t j = 0; j < get_format_channel_count( imageInfo->format ); j++ ) + totalErrors++; + log_error( "ERROR: Sample %ld (%ld,%ld) did not validate! (%s)\n", i, x, y, mem_flag_names[ mem_flag_index ] ); + log_error( " Expected: 0x%04x 0x%04x 0x%04x 0x%04x\n", e[ 0 ], e[ 1 ], e[ 2 ], e[ 3 ] ); + log_error( " Actual: 0x%04x 0x%04x 0x%04x 0x%04x\n", a[ 0 ], a[ 1 ], a[ 2 ], a[ 3 ] ); + if( inputType == kFloat ) { - if( is_half_nan( e[j] ) && is_half_nan(a[j]) ) - continue; - if( e[j] != a[j] ) - err_cnt++; - } - - if( err_cnt ) - { - totalErrors++; - log_error( "ERROR: Sample %ld (%ld,%ld) did not validate! (%s)\n", i, x, y, mem_flag_names[mem_flag_index] ); - log_error( " Expected: 0x%04x 0x%04x 0x%04x 0x%04x\n", e[0], e[1], e[2], e[3] ); - log_error( " Actual: 0x%04x 0x%04x 0x%04x 0x%04x\n", a[0], a[1], a[2], a[3] ); - if( inputType == kFloat ) - { - float *p = (float *)(char *)imagePtr; - log_error( " Source: %a %a %a %a\n", p[ 0 ], p[ 1 ], p[ 2 ], p[ 3 ] ); - log_error( " : %12.24f %12.24f %12.24f %12.24f\n", p[ 0 ], p[ 1 ], p[ 2 ], p[ 3 ] ); - } - if( ( --numTries ) == 0 ) - return 1; + float *p = (float *)imagePtr; + log_error( " Source: %a %a %a %a\n", p[ 0 ], p[ 1 ], p[ 2 ], p[ 3 ] ); + log_error( " : %12.24f %12.24f %12.24f %12.24f\n", p[ 0 ], p[ 1 ], p[ 2 ], p[ 3 ] ); } + if( ( --numTries ) == 0 ) + return 1; } } else @@ -528,7 +507,7 @@ int test_write_image_1D_array( cl_device_id device, cl_context context, cl_comma break; } - float *v = (float *)(char *)imagePtr; + float *v = (float *)imagePtr; log_error( " src: %g %g %g %g\n", v[ 0 ], v[ 1], v[ 2 ], v[ 3 ] ); log_error( " : %a %a %a %a\n", v[ 0 ], v[ 1], v[ 2 ], v[ 3 ] ); log_error( " src: %12.24f %12.24f %12.24f %12.24f\n", v[0 ], v[ 1], v[ 2 ], v[ 3 ] ); @@ -614,7 +593,7 @@ int test_write_image_1D_array_set( cl_device_id device, cl_context context, cl_c gTestMipmaps ? ", lod" :"" ); ptr = programSrc; - error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" ); + error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0"); test_error( error, "Unable to create testing kernel" ); // Run tests diff --git a/test_conformance/images/kernel_read_write/test_write_2D_array.cpp b/test_conformance/images/kernel_read_write/test_write_2D_array.cpp index c38a35e6..4524c6cd 100644 --- a/test_conformance/images/kernel_read_write/test_write_2D_array.cpp +++ b/test_conformance/images/kernel_read_write/test_write_2D_array.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -19,16 +19,15 @@ #include #endif -#define MAX_ERR 0.005f - -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding, gTestMipmaps; +extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps; extern cl_filter_mode gFilterModeToSkip; extern cl_mem_flags gMemFlagsToUse; extern int gtestTypesToRun; +extern bool gDeviceLt20; -extern int verify_write_results( size_t &i, int &numTries, int &totalErrors, char *&imagePtr, void *resultValues, size_t y, size_t z, - ExplicitType inputType, image_descriptor *imageInfo, bool verifyRounding ); +extern bool validate_float_write_results( float *expected, float *actual, image_descriptor *imageInfo ); +extern bool validate_half_write_results( cl_half *expected, cl_half *actual, image_descriptor *imageInfo ); // Utility function to clamp down image sizes for certain tests to avoid // using too much memory. @@ -108,7 +107,6 @@ int test_write_image_2D_array( cl_device_id device, cl_context context, cl_comma int error; size_t threads[3]; bool verifyRounding = false; - int totalErrors = 0; int forceCorrectlyRoundedWrites = 0; #if defined( __APPLE__ ) @@ -400,20 +398,14 @@ int test_write_image_2D_array( cl_device_id device, cl_context context, cl_comma } else if( imageInfo->format->image_channel_data_type == CL_FLOAT ) { - // Compare floats float *expected = (float *)resultBuffer; float *actual = (float *)resultPtr; - float err = 0.f; - for( unsigned int j = 0; j < get_format_channel_count( imageInfo->format ); j++ ) - err += ( expected[ j ] != 0 ) ? fabsf( ( expected[ j ] - actual[ j ] ) / expected[ j ] ) : fabsf( expected[ j ] - actual[ j ] ); - err /= (float)get_format_channel_count( imageInfo->format ); - if( err > MAX_ERR ) + if( !validate_float_write_results( expected, actual, imageInfo ) ) { - unsigned int *e = (unsigned int *)expected; - unsigned int *a = (unsigned int *)actual; - log_error( "ERROR: Sample %ld (%ld,%ld) did not validate! (%s)\n", i, x, y, mem_flag_names[mem_flag_index] ); - log_error( " Error: %g\n", err ); + unsigned int *e = (unsigned int *)resultBuffer; + unsigned int *a = (unsigned int *)resultPtr; + log_error( "ERROR: Sample %ld (%ld,%ld,%ld) did not validate! (%s)\n", i, x, y, z, mem_flag_names[ mem_flag_index ] ); log_error( " Expected: %a %a %a %a\n", expected[ 0 ], expected[ 1 ], expected[ 2 ], expected[ 3 ] ); log_error( " Expected: %08x %08x %08x %08x\n", e[ 0 ], e[ 1 ], e[ 2 ], e[ 3 ] ); log_error( " Actual: %a %a %a %a\n", actual[ 0 ], actual[ 1 ], actual[ 2 ], actual[ 3 ] ); @@ -425,40 +417,25 @@ int test_write_image_2D_array( cl_device_id device, cl_context context, cl_comma } else if( imageInfo->format->image_channel_data_type == CL_HALF_FLOAT ) { - // Compare half floats - if( memcmp( resultBuffer, resultPtr, 2 * get_format_channel_count( imageInfo->format ) ) != 0 ) + cl_half *e = (cl_half *)resultBuffer; + cl_half *a = (cl_half *)resultPtr; + if( !validate_half_write_results( e, a, imageInfo ) ) { - cl_ushort *e = (cl_ushort *)resultBuffer; - cl_ushort *a = (cl_ushort *)resultPtr; - int err_cnt = 0; - - //Fix up cases where we have NaNs - for( size_t j = 0; j < get_format_channel_count( imageInfo->format ); j++ ) - { - if( is_half_nan( e[j] ) && is_half_nan(a[j]) ) - continue; - if( e[j] != a[j] ) - err_cnt++; - } - - if( err_cnt ) - { totalErrors++; - log_error( "ERROR: Sample %ld (%ld,%ld) did not validate! (%s)\n", i, x, y, mem_flag_names[mem_flag_index] ); + log_error( "ERROR: Sample %ld (%ld,%ld,%ld) did not validate! (%s)\n", i, x, y, z, mem_flag_names[ mem_flag_index ] ); unsigned short *e = (unsigned short *)resultBuffer; unsigned short *a = (unsigned short *)resultPtr; - log_error( " Expected: 0x%04x 0x%04x 0x%04x 0x%04x\n", e[0], e[1], e[2], e[3] ); - log_error( " Actual: 0x%04x 0x%04x 0x%04x 0x%04x\n", a[0], a[1], a[2], a[3] ); + log_error( " Expected: 0x%04x 0x%04x 0x%04x 0x%04x\n", e[ 0 ], e[ 1 ], e[ 2 ], e[ 3 ] ); + log_error( " Actual: 0x%04x 0x%04x 0x%04x 0x%04x\n", a[ 0 ], a[ 1 ], a[ 2 ], a[ 3 ] ); if( inputType == kFloat ) { - float *p = (float *)(char *)imagePtr; + float *p = (float *)imagePtr; log_error( " Source: %a %a %a %a\n", p[ 0 ], p[ 1 ], p[ 2 ], p[ 3 ] ); log_error( " : %12.24f %12.24f %12.24f %12.24f\n", p[ 0 ], p[ 1 ], p[ 2 ], p[ 3 ] ); } if( ( --numTries ) == 0 ) return 1; } - } } else { @@ -641,7 +618,7 @@ int test_write_image_2D_array_set( cl_device_id device, cl_context context, cl_c gTestMipmaps ? ", lod" : "" ); ptr = programSrc; - error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" ); + error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0"); test_error( error, "Unable to create testing kernel" ); // Run tests diff --git a/test_conformance/images/kernel_read_write/test_write_3D.cpp b/test_conformance/images/kernel_read_write/test_write_3D.cpp index 357070f5..7440bd6e 100644 --- a/test_conformance/images/kernel_read_write/test_write_3D.cpp +++ b/test_conformance/images/kernel_read_write/test_write_3D.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -19,16 +19,15 @@ #include #endif -#define MAX_ERR 0.005f - -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding, gTestMipmaps; +extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestMipmaps; extern cl_filter_mode gFilterModeToSkip; extern cl_mem_flags gMemFlagsToUse; extern int gtestTypesToRun; +extern bool gDeviceLt20; -extern int verify_write_results( size_t &i, int &numTries, int &totalErrors, char *&imagePtr, void *resultValues, size_t y, size_t z, - ExplicitType inputType, image_descriptor *imageInfo, bool verifyRounding ); +extern bool validate_float_write_results( float *expected, float *actual, image_descriptor *imageInfo ); +extern bool validate_half_write_results( cl_half *expected, cl_half *actual, image_descriptor *imageInfo ); // Utility function to clamp down image sizes for certain tests to avoid // using too much memory. @@ -111,7 +110,6 @@ int test_write_image_3D( cl_device_id device, cl_context context, cl_command_que int error; size_t threads[3]; bool verifyRounding = false; - int totalErrors = 0; int forceCorrectlyRoundedWrites = 0; #if defined( __APPLE__ ) @@ -407,20 +405,14 @@ int test_write_image_3D( cl_device_id device, cl_context context, cl_command_que } else if( imageInfo->format->image_channel_data_type == CL_FLOAT ) { - // Compare floats float *expected = (float *)resultBuffer; float *actual = (float *)resultPtr; - float err = 0.f; - for( unsigned int j = 0; j < get_format_channel_count( imageInfo->format ); j++ ) - err += ( expected[ j ] != 0 ) ? fabsf( ( expected[ j ] - actual[ j ] ) / expected[ j ] ) : fabsf( expected[ j ] - actual[ j ] ); - err /= (float)get_format_channel_count( imageInfo->format ); - if( err > MAX_ERR ) + if( !validate_float_write_results( expected, actual, imageInfo ) ) { - unsigned int *e = (unsigned int *)expected; - unsigned int *a = (unsigned int *)actual; - log_error( "ERROR: Sample %ld (%ld,%ld) did not validate! (%s)\n", i, x, y, mem_flag_names[mem_flag_index] ); - log_error( " Error: %g\n", err ); + unsigned int *e = (unsigned int *)resultBuffer; + unsigned int *a = (unsigned int *)resultPtr; + log_error( "ERROR: Sample %ld (%ld,%ld,%ld) did not validate! (%s)\n", i, x, y, z, mem_flag_names[ mem_flag_index ] ); log_error( " Expected: %a %a %a %a\n", expected[ 0 ], expected[ 1 ], expected[ 2 ], expected[ 3 ] ); log_error( " Expected: %08x %08x %08x %08x\n", e[ 0 ], e[ 1 ], e[ 2 ], e[ 3 ] ); log_error( " Actual: %a %a %a %a\n", actual[ 0 ], actual[ 1 ], actual[ 2 ], actual[ 3 ] ); @@ -432,40 +424,25 @@ int test_write_image_3D( cl_device_id device, cl_context context, cl_command_que } else if( imageInfo->format->image_channel_data_type == CL_HALF_FLOAT ) { - // Compare half floats - if( memcmp( resultBuffer, resultPtr, 2 * get_format_channel_count( imageInfo->format ) ) != 0 ) + cl_half *e = (cl_half *)resultBuffer; + cl_half *a = (cl_half *)resultPtr; + if( !validate_half_write_results( e, a, imageInfo ) ) { - cl_ushort *e = (cl_ushort *)resultBuffer; - cl_ushort *a = (cl_ushort *)resultPtr; - int err_cnt = 0; - - //Fix up cases where we have NaNs - for( size_t j = 0; j < get_format_channel_count( imageInfo->format ); j++ ) - { - if( is_half_nan( e[j] ) && is_half_nan(a[j]) ) - continue; - if( e[j] != a[j] ) - err_cnt++; - } - - if( err_cnt ) - { totalErrors++; - log_error( "ERROR: Sample %ld (%ld,%ld) did not validate! (%s)\n", i, x, y, mem_flag_names[mem_flag_index] ); + log_error( "ERROR: Sample %ld (%ld,%ld,%ld) did not validate! (%s)\n", i, x, y, z, mem_flag_names[ mem_flag_index ] ); unsigned short *e = (unsigned short *)resultBuffer; unsigned short *a = (unsigned short *)resultPtr; - log_error( " Expected: 0x%04x 0x%04x 0x%04x 0x%04x\n", e[0], e[1], e[2], e[3] ); - log_error( " Actual: 0x%04x 0x%04x 0x%04x 0x%04x\n", a[0], a[1], a[2], a[3] ); + log_error( " Expected: 0x%04x 0x%04x 0x%04x 0x%04x\n", e[ 0 ], e[ 1 ], e[ 2 ], e[ 3 ] ); + log_error( " Actual: 0x%04x 0x%04x 0x%04x 0x%04x\n", a[ 0 ], a[ 1 ], a[ 2 ], a[ 3 ] ); if( inputType == kFloat ) { - float *p = (float *)(char *)imagePtr; + float *p = (float *)imagePtr; log_error( " Source: %a %a %a %a\n", p[ 0 ], p[ 1 ], p[ 2 ], p[ 3 ] ); log_error( " : %12.24f %12.24f %12.24f %12.24f\n", p[ 0 ], p[ 1 ], p[ 2 ], p[ 3 ] ); } if( ( --numTries ) == 0 ) return 1; } - } } else { @@ -647,7 +624,7 @@ int test_write_image_3D_set( cl_device_id device, cl_context context, cl_command gTestMipmaps ? ", lod" : "" ); ptr = programSrc; - error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" ); + error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0"); test_error( error, "Unable to create testing kernel" ); // Run tests diff --git a/test_conformance/images/kernel_read_write/test_write_image.cpp b/test_conformance/images/kernel_read_write/test_write_image.cpp index 99927717..f6d9235c 100644 --- a/test_conformance/images/kernel_read_write/test_write_image.cpp +++ b/test_conformance/images/kernel_read_write/test_write_image.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -19,18 +19,19 @@ #include #endif -#define MAX_ERR 0.005f - -extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding, gTestImage2DFromBuffer, gTestMipmaps; +extern bool gDebugTrace, gDisableOffsets, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestImage2DFromBuffer, gTestMipmaps; extern cl_filter_mode gFilterModeToSkip; extern cl_mem_flags gMemFlagsToUse; extern int gtestTypesToRun; +extern bool gDeviceLt20; extern int test_write_image_1D_set( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format, ExplicitType inputType, MTdata d ); extern int test_write_image_3D_set( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format, ExplicitType inputType, MTdata d ); extern int test_write_image_1D_array_set( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format, ExplicitType inputType, MTdata d ); extern int test_write_image_2D_array_set( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format, ExplicitType inputType, MTdata d ); +extern bool validate_float_write_results( float *expected, float *actual, image_descriptor *imageInfo ); +extern bool validate_half_write_results( cl_half *expected, cl_half *actual, image_descriptor *imageInfo ); const char *writeKernelSourcePattern = "__kernel void sample_kernel( __global %s%s *input, write_only %s output %s)\n" @@ -88,7 +89,6 @@ int test_write_image( cl_device_id device, cl_context context, cl_command_queue int error; size_t threads[2]; bool verifyRounding = false; - int totalErrors = 0; int forceCorrectlyRoundedWrites = 0; #if defined( __APPLE__ ) @@ -423,20 +423,14 @@ int test_write_image( cl_device_id device, cl_context context, cl_command_queue } else if( imageInfo->format->image_channel_data_type == CL_FLOAT ) { - // Compare floats float *expected = (float *)resultBuffer; float *actual = (float *)resultPtr; - float err = 0.f; - for( unsigned int j = 0; j < get_format_channel_count( imageInfo->format ); j++ ) - err += ( expected[ j ] != 0 ) ? fabsf( ( expected[ j ] - actual[ j ] ) / expected[ j ] ) : fabsf( expected[ j ] - actual[ j ] ); - err /= (float)get_format_channel_count( imageInfo->format ); - if( err > MAX_ERR ) + if( !validate_float_write_results( expected, actual, imageInfo ) ) { - unsigned int *e = (unsigned int *)expected; - unsigned int *a = (unsigned int *)actual; - log_error( "ERROR: Sample %ld (%ld,%ld) did not validate! (%s)\n", i, x, y, mem_flag_names[mem_flag_index] ); - log_error( " Error: %g\n", err ); + unsigned int *e = (unsigned int *)resultBuffer; + unsigned int *a = (unsigned int *)resultPtr; + log_error( "ERROR: Sample %ld (%ld,%ld) did not validate! (%s)\n", i, x, y, mem_flag_names[ mem_flag_index ] ); log_error( " Expected: %a %a %a %a\n", expected[ 0 ], expected[ 1 ], expected[ 2 ], expected[ 3 ] ); log_error( " Expected: %08x %08x %08x %08x\n", e[ 0 ], e[ 1 ], e[ 2 ], e[ 3 ] ); log_error( " Actual: %a %a %a %a\n", actual[ 0 ], actual[ 1 ], actual[ 2 ], actual[ 3 ] ); @@ -448,38 +442,22 @@ int test_write_image( cl_device_id device, cl_context context, cl_command_queue } else if( imageInfo->format->image_channel_data_type == CL_HALF_FLOAT ) { - - // Compare half floats - if( memcmp( resultBuffer, resultPtr, 2 * get_format_channel_count( imageInfo->format ) ) != 0 ) + cl_half *e = (cl_half *)resultBuffer; + cl_half *a = (cl_half *)resultPtr; + if( !validate_half_write_results( e, a, imageInfo ) ) { - cl_ushort *e = (cl_ushort *)resultBuffer; - cl_ushort *a = (cl_ushort *)resultPtr; - int err_cnt = 0; - - //Fix up cases where we have NaNs - for( size_t j = 0; j < get_format_channel_count( imageInfo->format ); j++ ) + totalErrors++; + log_error( "ERROR: Sample %ld (%ld,%ld) did not validate! (%s)\n", i, x, y, mem_flag_names[ mem_flag_index ] ); + log_error( " Expected: 0x%04x 0x%04x 0x%04x 0x%04x\n", e[ 0 ], e[ 1 ], e[ 2 ], e[ 3 ] ); + log_error( " Actual: 0x%04x 0x%04x 0x%04x 0x%04x\n", a[ 0 ], a[ 1 ], a[ 2 ], a[ 3 ] ); + if( inputType == kFloat ) { - if( is_half_nan( e[j] ) && is_half_nan(a[j]) ) - continue; - if( e[j] != a[j] ) - err_cnt++; - } - - if( err_cnt ) - { - totalErrors++; - log_error( "ERROR: Sample %ld (%ld,%ld) did not validate! (%s)\n", i, x, y, mem_flag_names[mem_flag_index] ); - log_error( " Expected: 0x%04x 0x%04x 0x%04x 0x%04x\n", e[0], e[1], e[2], e[3] ); - log_error( " Actual: 0x%04x 0x%04x 0x%04x 0x%04x\n", a[0], a[1], a[2], a[3] ); - if( inputType == kFloat ) - { - float *p = (float *)(char *)imagePtr; - log_error( " Source: %a %a %a %a\n", p[ 0 ], p[ 1 ], p[ 2 ], p[ 3 ] ); - log_error( " : %12.24f %12.24f %12.24f %12.24f\n", p[ 0 ], p[ 1 ], p[ 2 ], p[ 3 ] ); - } - if( ( --numTries ) == 0 ) - return 1; + float *p = (float *)(char *)imagePtr; + log_error( " Source: %a %a %a %a\n", p[ 0 ], p[ 1 ], p[ 2 ], p[ 3 ] ); + log_error( " : %12.24f %12.24f %12.24f %12.24f\n", p[ 0 ], p[ 1 ], p[ 2 ], p[ 3 ] ); } + if( ( --numTries ) == 0 ) + return 1; } } else @@ -692,7 +670,7 @@ int test_write_image_set( cl_device_id device, cl_context context, cl_command_qu gTestMipmaps ? ", lod" : "" ); ptr = programSrc; - error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" ); + error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0"); test_error( error, "Unable to create testing kernel" ); // Run tests @@ -828,19 +806,6 @@ int test_write_image_formats( cl_device_id device, cl_context context, cl_comman if( filterFlags[ i ] ) continue; - if (is_sRGBA_order(imageFormat.image_channel_order)) - { - if( !is_extension_available( device, "cl_khr_srgb_image_writes" )) - { - log_missing_feature( "-----------------------------------------------------\n" ); - log_missing_feature( "WARNING!!! sRGB formats are shown in the supported write-format list.\n"); - log_missing_feature( "However the extension cl_khr_srgb_image_writes is not available.\n"); - log_missing_feature( "Please make sure the extension is officially supported by the device .\n"); - log_missing_feature( "-----------------------------------------------------\n\n" ); - continue; - } - } - gTestCount++; print_write_header( &imageFormat, false ); @@ -866,7 +831,7 @@ int test_write_image_formats( cl_device_id device, cl_context context, cl_comman if( retCode != 0 ) { - gTestFailure++; + gFailCount++; log_error( "FAILED: " ); print_write_header( &imageFormat, true ); log_info( "\n" ); diff --git a/test_conformance/images/samplerlessReads/CMakeLists.txt b/test_conformance/images/samplerlessReads/CMakeLists.txt index 4926ef4d..991902e0 100644 --- a/test_conformance/images/samplerlessReads/CMakeLists.txt +++ b/test_conformance/images/samplerlessReads/CMakeLists.txt @@ -9,17 +9,7 @@ set(${MODULE_NAME}_SOURCES test_read_1D_buffer.cpp test_read_1D_array.cpp test_read_2D_array.cpp - ../../../test_common/harness/errorHelpers.c - ../../../test_common/harness/threadTesting.c - ../../../test_common/harness/kernelHelpers.c - ../../../test_common/harness/imageHelpers.cpp - ../../../test_common/harness/mt19937.c - ../../../test_common/harness/conversions.c - ../../../test_common/harness/testHarness.c - ../../../test_common/harness/typeWrappers.cpp - ../../../test_common/harness/msvc9.c - ../../../test_common/harness/parseParameters.cpp - ../../../test_common/harness/crc32.c + ../common.cpp ) include(../../CMakeCommon.txt) diff --git a/test_conformance/images/samplerlessReads/main.cpp b/test_conformance/images/samplerlessReads/main.cpp index 29295619..cc882f3c 100644 --- a/test_conformance/images/samplerlessReads/main.cpp +++ b/test_conformance/images/samplerlessReads/main.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../../test_common/harness/compat.h" +#include "../harness/compat.h" #include #include @@ -24,8 +24,8 @@ #endif #include "../testBase.h" -#include "../../../test_common/harness/fpcontrol.h" -#include "../../../test_common/harness/parseParameters.h" +#include "../harness/fpcontrol.h" +#include "../harness/parseParameters.h" #if defined(__PPC__) // Global varaiable used to hold the FPU control register state. The FPSCR register can not @@ -38,12 +38,11 @@ bool gTestReadWrite; bool gDebugTrace; bool gTestMaxImages; bool gTestSmallImages; -bool gTestRounding; int gTypesToTest; cl_channel_type gChannelTypeToUse = (cl_channel_type)-1; cl_channel_order gChannelOrderToUse = (cl_channel_order)-1; bool gEnablePitch = false; -cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT; +bool gDeviceLt20 = false; #define MAX_ALLOWED_STD_DEVIATION_IN_MB 8.0 @@ -94,9 +93,6 @@ int main(int argc, const char *argv[]) return -1; } - //Check CL_DEVICE_TYPE environment variable - checkDeviceTypeOverride( &gDeviceType ); - const char ** argList = (const char **)calloc( argc, sizeof( char*) ); if( NULL == argList ) @@ -111,16 +107,7 @@ int main(int argc, const char *argv[]) // Parse arguments for ( int i = 1; i < argc; i++ ) { - if ( strcmp( argv[i], "cpu" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_CPU" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_CPU; - else if ( strcmp( argv[i], "gpu" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_GPU" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_GPU; - else if ( strcmp( argv[i], "accelerator" ) == 0 || strcmp( argv[i], "CL_DEVICE_TYPE_ACCELERATOR" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_ACCELERATOR; - else if ( strcmp( argv[i], "CL_DEVICE_TYPE_DEFAULT" ) == 0 ) - gDeviceType = CL_DEVICE_TYPE_DEFAULT; - - else if ( strcmp( argv[i], "debug_trace" ) == 0 ) + if ( strcmp( argv[i], "debug_trace" ) == 0 ) gDebugTrace = true; else if ( strcmp( argv[i], "read_write" ) == 0 ) gTestReadWrite = true; @@ -178,19 +165,6 @@ int main(int argc, const char *argv[]) // Restore FP state before leaving RestoreFPState(&oldMode); - if (gTestFailure == 0) { - if (gTestCount > 1) - log_info("PASSED %d of %d sub-tests.\n", gTestCount, gTestCount); - else - log_info("PASSED sub-test.\n"); - } - else if (gTestFailure > 0) { - if (gTestCount > 1) - log_error("FAILED %d of %d sub-tests.\n", gTestFailure, gTestCount); - else - log_error("FAILED sub-test.\n"); - } - free(argList); return ret; } diff --git a/test_conformance/images/samplerlessReads/test_iterations.cpp b/test_conformance/images/samplerlessReads/test_iterations.cpp index a4d68543..857fbc67 100644 --- a/test_conformance/images/samplerlessReads/test_iterations.cpp +++ b/test_conformance/images/samplerlessReads/test_iterations.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -25,8 +25,7 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding; -extern cl_device_type gDeviceType; +extern bool gDebugTrace, gTestSmallImages, gEnablePitch, gTestMaxImages, gDeviceLt20; extern bool gTestReadWrite; #define MAX_TRIES 1 @@ -118,12 +117,7 @@ int test_read_image_2D( cl_context context, cl_command_queue queue, cl_kernel ke log_info( " - Creating kernel arguments...\n" ); // Create sampler to use - cl_sampler_properties properties[] = { - CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE, - CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_NONE, - CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST, - 0 }; - actualSampler = clCreateSamplerWithProperties( context, properties, &error ); + actualSampler = clCreateSampler( context, CL_FALSE, CL_ADDRESS_NONE, CL_FILTER_NEAREST, &error ); test_error( error, "Unable to create image sampler" ); // Create results buffer @@ -261,7 +255,7 @@ int test_read_image_set_2D( cl_device_id device, cl_context context, cl_command_ } ptr = programSrc; - error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" ); + error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0" ); test_error( error, "Unable to create testing kernel" ); if ( gTestSmallImages ) diff --git a/test_conformance/images/samplerlessReads/test_loops.cpp b/test_conformance/images/samplerlessReads/test_loops.cpp index ac4b101e..e50d5d42 100644 --- a/test_conformance/images/samplerlessReads/test_loops.cpp +++ b/test_conformance/images/samplerlessReads/test_loops.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -14,12 +14,14 @@ // limitations under the License. // #include "../testBase.h" +#include "../common.h" extern int gTypesToTest; extern cl_channel_type gChannelTypeToUse; extern cl_channel_order gChannelOrderToUse; extern bool gDebugTrace; +extern bool gDeviceLt20; extern bool gTestReadWrite; @@ -30,113 +32,6 @@ extern int test_read_image_set_3D( cl_device_id device, cl_context context, cl_c extern int test_read_image_set_1D_array( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format, image_sampler_data *imageSampler, ExplicitType outputType ); extern int test_read_image_set_2D_array( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format, image_sampler_data *imageSampler, ExplicitType outputType ); -static const char *str_1d_image = "1D"; -static const char *str_2d_image = "2D"; -static const char *str_3d_image = "3D"; -static const char *str_1d_image_array = "1D array"; -static const char *str_2d_image_array = "2D array"; -static const char *str_1d_image_buffer = "1D image buffer"; - -static const char *convert_image_type_to_string(cl_mem_object_type imageType) -{ - const char *p; - switch (imageType) - { - case CL_MEM_OBJECT_IMAGE1D: - p = str_1d_image; - break; - case CL_MEM_OBJECT_IMAGE2D: - p = str_2d_image; - break; - case CL_MEM_OBJECT_IMAGE3D: - p = str_3d_image; - break; - case CL_MEM_OBJECT_IMAGE1D_ARRAY: - p = str_1d_image_array; - break; - case CL_MEM_OBJECT_IMAGE2D_ARRAY: - p = str_2d_image_array; - break; - case CL_MEM_OBJECT_IMAGE1D_BUFFER: - p = str_1d_image_buffer; - } - return p; -} - - -int filter_formats( cl_image_format *formatList, bool *filterFlags, unsigned int formatCount, cl_channel_type *channelDataTypesToFilter ) -{ - int numSupported = 0; - for ( unsigned int j = 0; j < formatCount; j++ ) - { - // If this format has been previously filtered, remove the filter - if ( filterFlags[ j ] ) - filterFlags[ j ] = false; - - // Have we already discarded the channel type via the command line? - if ( gChannelTypeToUse != (cl_channel_type)-1 && gChannelTypeToUse != formatList[ j ].image_channel_data_type ) - { - filterFlags[ j ] = true; - continue; - } - - // Have we already discarded the channel order via the command line? - if ( gChannelOrderToUse != (cl_channel_order)-1 && gChannelOrderToUse != formatList[ j ].image_channel_order ) - { - filterFlags[ j ] = true; - continue; - } - - // Is given format standard channel order and type given by spec. We don't want to test it if this is vendor extension - if( !IsChannelOrderSupported( formatList[ j ].image_channel_order ) || !IsChannelTypeSupported( formatList[ j ].image_channel_data_type ) ) - { - filterFlags[ j ] = true; - continue; - } - - // We don't filter by channel type - if( !channelDataTypesToFilter ) - { - numSupported++; - continue; - } - - // Is the format supported? - int i; - for ( i = 0; channelDataTypesToFilter[ i ] != (cl_channel_type)-1; i++ ) - { - if ( formatList[ j ].image_channel_data_type == channelDataTypesToFilter[ i ] ) - { - numSupported++; - break; - } - } - if ( channelDataTypesToFilter[ i ] == (cl_channel_type)-1 ) - { - // Format is NOT supported, so mark it as such - filterFlags[ j ] = true; - } - } - return numSupported; -} - -int get_format_list( cl_context context, cl_mem_object_type imageType, cl_image_format * &outFormatList, unsigned int &outFormatCount, cl_mem_flags flags ) -{ - int error; - - cl_image_format tempList[ 128 ]; - error = clGetSupportedImageFormats( context, flags, - imageType, 128, tempList, &outFormatCount ); - test_error( error, "Unable to get count of supported image formats" ); - - outFormatList = new cl_image_format[ outFormatCount ]; - error = clGetSupportedImageFormats( context, flags, - imageType, outFormatCount, outFormatList, NULL ); - test_error( error, "Unable to get list of supported image formats" ); - - return 0; -} - int test_read_image_type( cl_device_id device, cl_context context, cl_command_queue queue, cl_image_format *format, image_sampler_data *imageSampler, ExplicitType outputType, cl_mem_object_type imageType ) { @@ -171,7 +66,7 @@ int test_read_image_type( cl_device_id device, cl_context context, cl_command_qu if ( ret != 0 ) { - gTestFailure++; + gFailCount++; log_error( "FAILED: " ); print_read_header( format, imageSampler, true ); log_info( "\n" ); @@ -209,6 +104,15 @@ int test_image_set( cl_device_id device, cl_context context, cl_command_queue qu cl_image_format *formatList; bool *filterFlags; unsigned int numFormats; + auto version = get_device_cl_version(device); + if (version < Version(2, 0)) { + gDeviceLt20 = true; + } + + if (gDeviceLt20 && gTestReadWrite) { + log_info("TEST skipped, Opencl 2.0 + requried for this test"); + return ret; + } // This flag is only for querying the list of supported formats // The flag for creating image will be set explicitly in test functions @@ -239,64 +143,26 @@ int test_image_set( cl_device_id device, cl_context context, cl_command_queue qu image_sampler_data imageSampler; - /////// float tests /////// - - if ( gTypesToTest & kTestFloat ) + for (auto test : imageTestTypes) { - cl_channel_type floatFormats[] = { CL_UNORM_SHORT_565, CL_UNORM_SHORT_555, CL_UNORM_INT_101010, -#ifdef OBSOLETE_FORAMT - CL_UNORM_SHORT_565_REV, CL_UNORM_SHORT_555_REV, CL_UNORM_INT_8888, CL_UNORM_INT_8888_REV, CL_UNORM_INT_101010_REV, -#endif -#ifdef CL_SFIXED14_APPLE - CL_SFIXED14_APPLE, -#endif - CL_UNORM_INT8, CL_SNORM_INT8, - CL_UNORM_INT16, CL_SNORM_INT16, CL_FLOAT, CL_HALF_FLOAT, (cl_channel_type)-1 }; - if ( filter_formats( formatList, filterFlags, numFormats, floatFormats ) == 0 ) + if (gTypesToTest & test.type) { - log_info( "No formats supported for float type\n" ); - } - else - { - imageSampler.filter_mode = CL_FILTER_NEAREST; - ret += test_read_image_formats( device, context, queue, formatList, filterFlags, numFormats, &imageSampler, kFloat, imageType ); + if (filter_formats(formatList, filterFlags, numFormats, + test.channelTypes) + == 0) + { + log_info("No formats supported for %s type\n", test.name); + } + else + { + imageSampler.filter_mode = CL_FILTER_NEAREST; + ret += test_read_image_formats( + device, context, queue, formatList, filterFlags, numFormats, + &imageSampler, test.explicitType, imageType); + } } } - /////// int tests /////// - if ( gTypesToTest & kTestInt ) - { - cl_channel_type intFormats[] = { CL_SIGNED_INT8, CL_SIGNED_INT16, CL_SIGNED_INT32, (cl_channel_type)-1 }; - if ( filter_formats( formatList, filterFlags, numFormats, intFormats ) == 0 ) - { - log_info( "No formats supported for integer type\n" ); - } - else - { - // Only filter mode we support on int is nearest - imageSampler.filter_mode = CL_FILTER_NEAREST; - ret += test_read_image_formats( device, context, queue, formatList, filterFlags, numFormats, &imageSampler, kInt, imageType ); - } - } - - /////// uint tests /////// - - if ( gTypesToTest & kTestUInt ) - { - cl_channel_type uintFormats[] = { CL_UNSIGNED_INT8, CL_UNSIGNED_INT16, CL_UNSIGNED_INT32, (cl_channel_type)-1 }; - if ( filter_formats( formatList, filterFlags, numFormats, uintFormats ) == 0 ) - { - log_info( "No formats supported for unsigned int type\n" ); - } - else - { - // Only filter mode we support on uint is nearest - imageSampler.filter_mode = CL_FILTER_NEAREST; - ret += test_read_image_formats( device, context, queue, formatList, filterFlags, numFormats, &imageSampler, kUInt, imageType ); - } - } - - delete[] filterFlags; delete[] formatList; diff --git a/test_conformance/images/samplerlessReads/test_read_1D.cpp b/test_conformance/images/samplerlessReads/test_read_1D.cpp index 7018ca66..173bc6f7 100644 --- a/test_conformance/images/samplerlessReads/test_read_1D.cpp +++ b/test_conformance/images/samplerlessReads/test_read_1D.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -25,8 +25,7 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding; -extern cl_device_type gDeviceType; +extern bool gDebugTrace, gTestSmallImages, gEnablePitch, gTestMaxImages, gDeviceLt20; extern bool gTestReadWrite; #define MAX_TRIES 1 @@ -120,12 +119,7 @@ int test_read_image_1D( cl_context context, cl_command_queue queue, cl_kernel ke log_info( " - Creating kernel arguments...\n" ); // Create sampler to use - cl_sampler_properties properties[] = { - CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE, - CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_NONE, - CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST, - 0 }; - actualSampler = clCreateSamplerWithProperties( context, properties, &error ); + actualSampler = clCreateSampler( context, CL_FALSE, CL_ADDRESS_NONE, CL_FILTER_NEAREST, &error ); test_error( error, "Unable to create image sampler" ); // Create results buffer @@ -259,7 +253,7 @@ int test_read_image_set_1D( cl_device_id device, cl_context context, cl_command_ ptr = programSrc; - error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" ); + error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0" ); test_error( error, "Unable to create testing kernel" ); if ( gTestSmallImages ) diff --git a/test_conformance/images/samplerlessReads/test_read_1D_array.cpp b/test_conformance/images/samplerlessReads/test_read_1D_array.cpp index b2f6bde2..503a161d 100644 --- a/test_conformance/images/samplerlessReads/test_read_1D_array.cpp +++ b/test_conformance/images/samplerlessReads/test_read_1D_array.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -25,8 +25,7 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding; -extern cl_device_type gDeviceType; +extern bool gDebugTrace, gTestSmallImages, gEnablePitch, gTestMaxImages, gDeviceLt20; extern bool gTestReadWrite; #define MAX_TRIES 1 @@ -115,12 +114,7 @@ int test_read_image_1D_array( cl_context context, cl_command_queue queue, cl_ker log_info( " - Creating kernel arguments...\n" ); // Create sampler to use - cl_sampler_properties properties[] = { - CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE, - CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_NONE, - CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST, - 0 }; - actualSampler = clCreateSamplerWithProperties( context, properties, &error ); + actualSampler = clCreateSampler( context, CL_FALSE, CL_ADDRESS_NONE, CL_FILTER_NEAREST, &error ); test_error( error, "Unable to create image sampler" ); // Create results buffer @@ -256,7 +250,7 @@ int test_read_image_set_1D_array( cl_device_id device, cl_context context, cl_co ptr = programSrc; - error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" ); + error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0" ); test_error( error, "Unable to create testing kernel" ); if ( gTestSmallImages ) diff --git a/test_conformance/images/samplerlessReads/test_read_1D_buffer.cpp b/test_conformance/images/samplerlessReads/test_read_1D_buffer.cpp index a014eb5c..4cd02f08 100644 --- a/test_conformance/images/samplerlessReads/test_read_1D_buffer.cpp +++ b/test_conformance/images/samplerlessReads/test_read_1D_buffer.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -25,8 +25,7 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gTestSmallImages, gTestMaxImages, gTestRounding; -extern cl_device_type gDeviceType; +extern bool gDebugTrace, gTestSmallImages, gEnablePitch, gTestMaxImages, gDeviceLt20; #define MAX_TRIES 1 #define MAX_CLAMPED 1 @@ -109,12 +108,7 @@ int test_read_image_1D_buffer( cl_context context, cl_command_queue queue, cl_ke log_info( " - Creating kernel arguments...\n" ); // Create sampler to use - cl_sampler_properties properties[] = { - CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE, - CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_NONE, - CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST, - 0 }; - actualSampler = clCreateSamplerWithProperties( context, properties, &error ); + actualSampler = clCreateSampler( context, CL_FALSE, CL_ADDRESS_NONE, CL_FILTER_NEAREST, &error ); test_error( error, "Unable to create image sampler" ); // Create results buffer @@ -256,7 +250,7 @@ int test_read_image_set_1D_buffer( cl_device_id device, cl_context context, cl_c readFormat ); ptr = programSrc; - error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" ); + error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0" ); test_error( error, "Unable to create testing kernel" ); if ( gTestSmallImages ) diff --git a/test_conformance/images/samplerlessReads/test_read_2D_array.cpp b/test_conformance/images/samplerlessReads/test_read_2D_array.cpp index 4d2b40a7..22fcffc3 100644 --- a/test_conformance/images/samplerlessReads/test_read_2D_array.cpp +++ b/test_conformance/images/samplerlessReads/test_read_2D_array.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -19,8 +19,7 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding; -extern cl_device_type gDeviceType; +extern bool gDebugTrace, gTestSmallImages, gEnablePitch, gTestMaxImages, gDeviceLt20; extern bool gTestReadWrite; const char *read2DArrayKernelSourcePattern = @@ -99,12 +98,7 @@ int test_read_image_2D_array( cl_context context, cl_command_queue queue, cl_ker } // Create sampler to use - cl_sampler_properties properties[] = { - CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE, - CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_NONE, - CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST, - 0 }; - actualSampler = clCreateSamplerWithProperties( context, properties, &error ); + actualSampler = clCreateSampler( context, CL_FALSE, CL_ADDRESS_NONE, CL_FILTER_NEAREST, &error ); test_error( error, "Unable to create image sampler" ); // Create results buffer @@ -245,7 +239,7 @@ int test_read_image_set_2D_array( cl_device_id device, cl_context context, cl_co ptr = programSrc; - error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" ); + error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0" ); test_error( error, "Unable to create testing kernel" ); diff --git a/test_conformance/images/samplerlessReads/test_read_3D.cpp b/test_conformance/images/samplerlessReads/test_read_3D.cpp index f6e274a7..142d7225 100644 --- a/test_conformance/images/samplerlessReads/test_read_3D.cpp +++ b/test_conformance/images/samplerlessReads/test_read_3D.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -19,8 +19,7 @@ #define MAX_ERR 0.005f #define MAX_HALF_LINEAR_ERR 0.3f -extern bool gDebugTrace, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding; -extern cl_device_type gDeviceType; +extern bool gDebugTrace, gTestSmallImages, gEnablePitch, gTestMaxImages, gDeviceLt20; extern bool gTestReadWrite; const char *read3DKernelSourcePattern = @@ -98,12 +97,7 @@ int test_read_image_3D( cl_context context, cl_command_queue queue, cl_kernel ke } // Create sampler to use - cl_sampler_properties properties[] = { - CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE, - CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_NONE, - CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST, - 0 }; - actualSampler = clCreateSamplerWithProperties( context, properties, &error ); + actualSampler = clCreateSampler( context, CL_FALSE, CL_ADDRESS_NONE, CL_FILTER_NEAREST, &error ); test_error( error, "Unable to create image sampler" ); // Create results buffer @@ -248,7 +242,7 @@ int test_read_image_set_3D( cl_device_id device, cl_context context, cl_command_ ptr = programSrc; - error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" ); + error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0" ); test_error( error, "Unable to create testing kernel" ); diff --git a/test_conformance/images/testBase.h b/test_conformance/images/testBase.h index 8aea7a94..f50f6b5b 100644 --- a/test_conformance/images/testBase.h +++ b/test_conformance/images/testBase.h @@ -16,11 +16,11 @@ #ifndef _testBase_h #define _testBase_h -#include "../../test_common/harness/compat.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/clImageHelper.h" -#include "../../test_common/harness/imageHelpers.h" +#include "harness/compat.h" +#include "harness/testHarness.h" +#include "harness/kernelHelpers.h" +#include "harness/clImageHelper.h" +#include "harness/imageHelpers.h" // Amount to offset pixels for checking normalized reads #define NORM_OFFSET 0.1f diff --git a/test_conformance/integer_ops/CMakeLists.txt b/test_conformance/integer_ops/CMakeLists.txt index 4f49c71f..a045ef81 100644 --- a/test_conformance/integer_ops/CMakeLists.txt +++ b/test_conformance/integer_ops/CMakeLists.txt @@ -1,26 +1,16 @@ set(MODULE_NAME INTEGER_OPS) set(${MODULE_NAME}_SOURCES - main.c - test_int_basic_ops.c + main.cpp + test_int_basic_ops.cpp test_integers.cpp test_upsample.cpp - test_intmul24.c test_intmad24.c - test_sub_sat.c test_add_sat.c - test_abs.c test_absdiff.c + test_intmul24.cpp test_intmad24.cpp + test_sub_sat.cpp test_add_sat.cpp + test_abs.cpp test_absdiff.cpp test_unary_ops.cpp - verification_and_generation_functions.c - test_popcount.c - ../../test_common/harness/ThreadPool.c - ../../test_common/harness/mt19937.c - ../../test_common/harness/conversions.c - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/threadTesting.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c + verification_and_generation_functions.cpp + test_popcount.cpp ) include(../CMakeCommon.txt) diff --git a/test_conformance/integer_ops/main.c b/test_conformance/integer_ops/main.cpp similarity index 98% rename from test_conformance/integer_ops/main.c rename to test_conformance/integer_ops/main.cpp index 207bdb09..1a8bad5f 100644 --- a/test_conformance/integer_ops/main.c +++ b/test_conformance/integer_ops/main.cpp @@ -13,12 +13,12 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include #include "procs.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" #if !defined(_WIN32) #include @@ -26,7 +26,7 @@ test_definition test_list[] = { ADD_TEST( integer_clz ), - ADD_TEST( integer_ctz ), + ADD_TEST_VERSION( integer_ctz, Version(2, 0)), ADD_TEST( integer_hadd ), ADD_TEST( integer_rhadd ), ADD_TEST( integer_mul_hi ), diff --git a/test_conformance/integer_ops/procs.h b/test_conformance/integer_ops/procs.h index eb9ec55a..d5b77e70 100644 --- a/test_conformance/integer_ops/procs.h +++ b/test_conformance/integer_ops/procs.h @@ -13,12 +13,12 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/threadTesting.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/mt19937.h" +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" +#include "harness/threadTesting.h" +#include "harness/typeWrappers.h" +#include "harness/testHarness.h" +#include "harness/mt19937.h" // The number of errors to print out for each test diff --git a/test_conformance/integer_ops/testBase.h b/test_conformance/integer_ops/testBase.h index 5073b21f..5b49bfd7 100644 --- a/test_conformance/integer_ops/testBase.h +++ b/test_conformance/integer_ops/testBase.h @@ -16,7 +16,7 @@ #ifndef _testBase_h #define _testBase_h -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/integer_ops/test_abs.c b/test_conformance/integer_ops/test_abs.cpp similarity index 99% rename from test_conformance/integer_ops/test_abs.c rename to test_conformance/integer_ops/test_abs.cpp index 1a428fb4..24d0555b 100644 --- a/test_conformance/integer_ops/test_abs.c +++ b/test_conformance/integer_ops/test_abs.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -324,7 +324,6 @@ int test_integer_abs(cl_device_id device, cl_context context, cl_command_queue q log_info("Failed on %d types\n", fail_count); return -1; } - log_info("ABS test passed\n"); free(input_ptr); free(output_ptr); diff --git a/test_conformance/integer_ops/test_absdiff.c b/test_conformance/integer_ops/test_absdiff.cpp similarity index 99% rename from test_conformance/integer_ops/test_absdiff.c rename to test_conformance/integer_ops/test_absdiff.cpp index edfeb723..7459bd2d 100644 --- a/test_conformance/integer_ops/test_absdiff.c +++ b/test_conformance/integer_ops/test_absdiff.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -362,7 +362,6 @@ int test_integer_abs_diff(cl_device_id device, cl_context context, cl_command_qu log_info("Failed on %d types\n", fail_count); return -1; } - log_info("ABS_DIFF test passed\n"); free(input_ptr[0]); free(input_ptr[1]); diff --git a/test_conformance/integer_ops/test_add_sat.c b/test_conformance/integer_ops/test_add_sat.cpp similarity index 99% rename from test_conformance/integer_ops/test_add_sat.c rename to test_conformance/integer_ops/test_add_sat.cpp index f3fddc2d..c0e45d11 100644 --- a/test_conformance/integer_ops/test_add_sat.c +++ b/test_conformance/integer_ops/test_add_sat.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -366,8 +366,6 @@ int test_integer_add_sat(cl_device_id device, cl_context context, cl_command_que return -1; } - log_info("ADD_SAT test passed\n"); - free(input_ptr[0]); free(input_ptr[1]); free(output_ptr); diff --git a/test_conformance/integer_ops/test_int_basic_ops.c b/test_conformance/integer_ops/test_int_basic_ops.cpp similarity index 99% rename from test_conformance/integer_ops/test_int_basic_ops.c rename to test_conformance/integer_ops/test_int_basic_ops.cpp index 67a39339..2d628d46 100644 --- a/test_conformance/integer_ops/test_int_basic_ops.c +++ b/test_conformance/integer_ops/test_int_basic_ops.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -21,8 +21,8 @@ #include #include "procs.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/ThreadPool.h" +#include "harness/conversions.h" +#include "harness/ThreadPool.h" #define NUM_TESTS 23 diff --git a/test_conformance/integer_ops/test_integers.cpp b/test_conformance/integer_ops/test_integers.cpp index fa7133cf..727a77cf 100644 --- a/test_conformance/integer_ops/test_integers.cpp +++ b/test_conformance/integer_ops/test_integers.cpp @@ -14,7 +14,7 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/conversions.h" +#include "harness/conversions.h" #define TEST_SIZE 512 @@ -84,11 +84,10 @@ int test_single_param_integer_kernel(cl_command_queue queue, cl_context context, useOpKernel ? fnName : "", useOpKernel ? "" : fnName, sizeName, sizeName ); - bool isOpenCL20Function = (strcmp(fnName,"ctz") == 0)? true: false; - /* Create kernels */ programPtr = kernelSource; - if( create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, (const char **)&programPtr, "sample_test", isOpenCL20Function ? "-cl-std=CL2.0": "" ) ) + if (create_single_kernel_helper(context, &program, &kernel, 1, + (const char **)&programPtr, "sample_test")) { log_error("The program we attempted to compile was: \n%s\n", kernelSource); return -1; diff --git a/test_conformance/integer_ops/test_intmad24.c b/test_conformance/integer_ops/test_intmad24.cpp similarity index 99% rename from test_conformance/integer_ops/test_intmad24.c rename to test_conformance/integer_ops/test_intmad24.cpp index 97526f05..1b1d549c 100644 --- a/test_conformance/integer_ops/test_intmad24.c +++ b/test_conformance/integer_ops/test_intmad24.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/integer_ops/test_intmul24.c b/test_conformance/integer_ops/test_intmul24.cpp similarity index 99% rename from test_conformance/integer_ops/test_intmul24.c rename to test_conformance/integer_ops/test_intmul24.cpp index 1b4192bc..0985a6ae 100644 --- a/test_conformance/integer_ops/test_intmul24.c +++ b/test_conformance/integer_ops/test_intmul24.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/integer_ops/test_popcount.c b/test_conformance/integer_ops/test_popcount.cpp similarity index 99% rename from test_conformance/integer_ops/test_popcount.c rename to test_conformance/integer_ops/test_popcount.cpp index 71c1bf63..31e40615 100644 --- a/test_conformance/integer_ops/test_popcount.c +++ b/test_conformance/integer_ops/test_popcount.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -237,7 +237,6 @@ int test_popcount(cl_device_id device, cl_context context, cl_command_queue queu log_info("Failed on %d types\n", fail_count); return -1; } - log_info("popcount test passed\n"); free(input_ptr[0]); free(output_ptr); diff --git a/test_conformance/integer_ops/test_sub_sat.c b/test_conformance/integer_ops/test_sub_sat.cpp similarity index 99% rename from test_conformance/integer_ops/test_sub_sat.c rename to test_conformance/integer_ops/test_sub_sat.cpp index d81a8f41..845d1064 100644 --- a/test_conformance/integer_ops/test_sub_sat.c +++ b/test_conformance/integer_ops/test_sub_sat.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -364,7 +364,6 @@ int test_integer_sub_sat(cl_device_id device, cl_context context, cl_command_que log_info("Failed on %d types\n", fail_count); return -1; } - log_info("SUB_SAT test passed\n"); free(input_ptr[0]); free(input_ptr[1]); diff --git a/test_conformance/integer_ops/test_unary_ops.cpp b/test_conformance/integer_ops/test_unary_ops.cpp index 06c6cf06..0b4d0b81 100644 --- a/test_conformance/integer_ops/test_unary_ops.cpp +++ b/test_conformance/integer_ops/test_unary_ops.cpp @@ -14,7 +14,7 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/conversions.h" +#include "harness/conversions.h" #define TEST_SIZE 512 diff --git a/test_conformance/integer_ops/test_upsample.cpp b/test_conformance/integer_ops/test_upsample.cpp index 6e823398..2fbbcc4b 100644 --- a/test_conformance/integer_ops/test_upsample.cpp +++ b/test_conformance/integer_ops/test_upsample.cpp @@ -14,7 +14,7 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/conversions.h" +#include "harness/conversions.h" static const int vector_sizes[] = {1, 2, 3, 4, 8, 16}; #define NUM_VECTOR_SIZES 6 diff --git a/test_conformance/integer_ops/verification_and_generation_functions.c b/test_conformance/integer_ops/verification_and_generation_functions.cpp similarity index 99% rename from test_conformance/integer_ops/verification_and_generation_functions.c rename to test_conformance/integer_ops/verification_and_generation_functions.cpp index f36a1bf4..25fbe717 100644 --- a/test_conformance/integer_ops/verification_and_generation_functions.c +++ b/test_conformance/integer_ops/verification_and_generation_functions.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -21,7 +21,7 @@ #include #include "procs.h" -#include "../../test_common/harness/conversions.h" +#include "harness/conversions.h" extern MTdata d; @@ -1481,8 +1481,8 @@ int verify_uchar(int test, size_t vector_size, cl_uchar *inptrA, cl_uchar *inptrB, cl_uchar *outptr, size_t n) { cl_uchar r; - cl_uint shift_mask = vector_size == 1 ? (cl_uint)(sizeof(cl_uint)*8)-1 - : (cl_uint)(sizeof(cl_uchar)*8)-1;; + cl_uint shift_mask = vector_size == 1 ? (cl_uint)(sizeof(cl_uint) * 8) - 1 + : (cl_uint)(sizeof(cl_uchar) * 8) - 1; size_t i, j; int count=0; diff --git a/test_conformance/math_brute_force/CMakeLists.txt b/test_conformance/math_brute_force/CMakeLists.txt index f0b39c6c..88180394 100644 --- a/test_conformance/math_brute_force/CMakeLists.txt +++ b/test_conformance/math_brute_force/CMakeLists.txt @@ -1,60 +1,26 @@ set(MODULE_NAME BRUTEFORCE) set(${MODULE_NAME}_SOURCES - FunctionList.c - Sleep.c - binary.c - binaryOperator.c - Utility.c - binary_i.c - binary_two_results_i.c - i_unary.c - macro_binary.c - macro_unary.c - mad.c - main.c - reference_math.c - ternary.c - unary.c - unary_two_results.c - unary_two_results_i.c - unary_u.c - ../../test_common/harness/rounding_mode.c - ../../test_common/harness/ThreadPool.c - ../../test_common/harness/mt19937.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/crc32.c + FunctionList.cpp + Sleep.cpp + binary.cpp + binaryOperator.cpp + Utility.cpp + binary_i.cpp + binary_two_results_i.cpp + i_unary.cpp + macro_binary.cpp + macro_unary.cpp + mad.cpp + main.cpp + reference_math.cpp + ternary.cpp + unary.cpp + unary_two_results.cpp + unary_two_results_i.cpp + unary_u.cpp ) - -if (NOT ANDROID) -set_source_files_properties( - FunctionList.c - Sleep.c - binary.c - binaryOperator.c - Utility.c - binary_i.c - binary_two_results_i.c - i_unary.c - macro_binary.c - macro_unary.c - mad.c - main.c reference_math.c - ternary.c unary.c unary_two_results.c - unary_two_results_i.c unary_u.c - COMPILE_FLAGS -msse2 ) -endif(NOT ANDROID) - -set_source_files_properties( - ${MODULE_NAME}_SOURCES - ../../test_common/harness/crc32.c - PROPERTIES LANGUAGE CXX) - if (NOT CMAKE_CL_64 AND NOT MSVC AND NOT ANDROID) set_source_files_properties( ${MODULE_NAME}_SOURCES diff --git a/test_conformance/math_brute_force/FunctionList.c b/test_conformance/math_brute_force/FunctionList.c deleted file mode 100644 index 2f54d9bc..00000000 --- a/test_conformance/math_brute_force/FunctionList.c +++ /dev/null @@ -1,211 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "FunctionList.h" -#include "reference_math.h" - -#define FTZ_ON 1 -#define FTZ_OFF 0 -#define EXACT 0.0f -#define RELAXED_ON 1 -#define RELAXED_OFF 0 - -#define STRINGIFY( _s) #_s - -// Only use ulps information in spir test -#ifdef FUNCTION_LIST_ULPS_ONLY - -#define ENTRY( _name, _ulp, _embedded_ulp, _rmode, _type ) { STRINGIFY(_name), STRINGIFY(_name), {NULL}, {NULL}, {NULL}, _ulp, _ulp, _embedded_ulp, INFINITY, _rmode, RELAXED_OFF, _type } -#define ENTRY_EXT( _name, _ulp, _embedded_ulp, _relaxed_ulp, _rmode, _type ) { STRINGIFY(_name), STRINGIFY(_name), {NULL}, {NULL}, {NULL}, _ulp, _ulp, _embedded_ulp, _relaxed_ulp, _rmode, RELAXED_ON, _type } -#define HALF_ENTRY( _name, _ulp, _embedded_ulp, _rmode, _type ) { "half_" STRINGIFY(_name), "half_" STRINGIFY(_name), {NULL}, {NULL}, {NULL}, _ulp, _ulp, _embedded_ulp, INFINITY, _rmode, RELAXED_OFF, _type } -#define OPERATOR_ENTRY(_name, _operator, _ulp, _embedded_ulp, _rmode, _type) { STRINGIFY(_name), _operator, {NULL}, {NULL}, {NULL}, _ulp, _ulp, _embedded_ulp, INFINITY, _rmode, RELAXED_OFF, _type } -#define unaryF NULL -#define i_unaryF NULL -#define unaryF_u NULL -#define macro_unaryF NULL -#define binaryF NULL -#define binaryF_nextafter NULL -#define binaryOperatorF NULL -#define binaryF_i NULL -#define macro_binaryF NULL -#define ternaryF NULL -#define unaryF_two_results NULL -#define unaryF_two_results_i NULL -#define binaryF_two_results_i NULL -#define mad_function NULL - -#define reference_sqrt NULL -#define reference_sqrtl NULL -#define reference_divide NULL -#define reference_dividel NULL -#define reference_relaxed_divide NULL - -#else // FUNCTION_LIST_ULPS_ONLY - -#define ENTRY( _name, _ulp, _embedded_ulp, _rmode, _type ) { STRINGIFY(_name), STRINGIFY(_name), {(void*)reference_##_name}, {(void*)reference_##_name##l}, {(void*)reference_##_name}, _ulp, _ulp, _embedded_ulp, INFINITY, _rmode, RELAXED_OFF, _type } -#define ENTRY_EXT( _name, _ulp, _embedded_ulp, _relaxed_ulp, _rmode, _type ) { STRINGIFY(_name), STRINGIFY(_name), {(void*)reference_##_name}, {(void*)reference_##_name##l}, {(void*)reference_##relaxed_##_name}, _ulp, _ulp, _embedded_ulp, _relaxed_ulp, _rmode, RELAXED_ON, _type } -#define HALF_ENTRY( _name, _ulp, _embedded_ulp, _rmode, _type ) { "half_" STRINGIFY(_name), "half_" STRINGIFY(_name), {(void*)reference_##_name}, {NULL}, {NULL}, _ulp, _ulp, _embedded_ulp, INFINITY, _rmode, RELAXED_OFF, _type } -#define OPERATOR_ENTRY(_name, _operator, _ulp, _embedded_ulp, _rmode, _type) { STRINGIFY(_name), _operator, {(void*)reference_##_name}, {(void*)reference_##_name##l}, {NULL}, _ulp, _ulp, _embedded_ulp, INFINITY, _rmode, RELAXED_OFF, _type } - -#if defined( __cplusplus ) - extern "C" { -#endif -extern const vtbl _unary; // float foo( float ) -extern const vtbl _unary_u; // float foo( uint ), double foo( ulong ) -extern const vtbl _i_unary; // int foo( float ) -extern const vtbl _macro_unary; // int foo( float ), returns {0,1} for scalar, { 0, -1 } for vector -extern const vtbl _binary; // float foo( float, float ) -extern const vtbl _binary_nextafter; // float foo( float, float ), special handling for nextafter -extern const vtbl _binary_operator; // float .op. float -extern const vtbl _macro_binary; // int foo( float, float ), returns {0,1} for scalar, { 0, -1 } for vector -extern const vtbl _binary_i; // float foo( float, int ) -extern const vtbl _ternary; // float foo( float, float, float ) -extern const vtbl _unary_two_results; // float foo( float, float * ) -extern const vtbl _unary_two_results_i; // float foo( float, int * ) -extern const vtbl _binary_two_results_i; // float foo( float, float, int * ) -extern const vtbl _mad_tbl; // float mad( float, float, float ) -#if defined( __cplusplus) - } -#endif - -#define unaryF &_unary -#define i_unaryF &_i_unary -#define unaryF_u &_unary_u -#define macro_unaryF &_macro_unary -#define binaryF &_binary -#define binaryF_nextafter &_binary_nextafter -#define binaryOperatorF &_binary_operator -#define binaryF_i &_binary_i -#define macro_binaryF &_macro_binary -#define ternaryF &_ternary -#define unaryF_two_results &_unary_two_results -#define unaryF_two_results_i &_unary_two_results_i -#define binaryF_two_results_i &_binary_two_results_i -#define mad_function &_mad_tbl - -#endif // FUNCTION_LIST_ULPS_ONLY - -const Func functionList[] = { - ENTRY( acos, 4.0f, 4.0f, FTZ_OFF, unaryF), - ENTRY( acosh, 4.0f, 4.0f, FTZ_OFF, unaryF), - ENTRY( acospi, 5.0f, 5.0f, FTZ_OFF, unaryF), - ENTRY( asin, 4.0f, 4.0f, FTZ_OFF, unaryF), - ENTRY( asinh, 4.0f, 4.0f, FTZ_OFF, unaryF), - ENTRY( asinpi, 5.0f, 5.0f, FTZ_OFF, unaryF), - ENTRY( atan, 5.0f, 5.0f, FTZ_OFF, unaryF), - ENTRY( atanh, 5.0f, 5.0f, FTZ_OFF, unaryF), - ENTRY( atanpi, 5.0f, 5.0f, FTZ_OFF, unaryF), - ENTRY( atan2, 6.0f, 6.0f, FTZ_OFF, binaryF), - ENTRY( atan2pi, 6.0f, 6.0f, FTZ_OFF, binaryF), - ENTRY( cbrt, 2.0f, 4.0f, FTZ_OFF, unaryF), - ENTRY( ceil, 0.0f, 0.0f, FTZ_OFF, unaryF), - ENTRY( copysign, 0.0f, 0.0f, FTZ_OFF, binaryF), - ENTRY_EXT( cos, 4.0f, 4.0f, 0.00048828125f, FTZ_OFF, unaryF), //relaxed ulp 2^-11 - ENTRY( cosh, 4.0f, 4.0f, FTZ_OFF, unaryF), - ENTRY( cospi, 4.0f, 4.0f, FTZ_OFF, unaryF), -// ENTRY( erfc, 16.0f, 16.0f, FTZ_OFF, unaryF), //disabled for 1.0 due to lack of reference implementation -// ENTRY( erf, 16.0f, 16.0f, FTZ_OFF, unaryF), //disabled for 1.0 due to lack of reference implementation - ENTRY_EXT( exp, 3.0f, 4.0f, 3.0f, FTZ_OFF, unaryF), //relaxed error is actually overwritten in unary.c as it is 3+floor(fabs(2*x)) - ENTRY_EXT( exp2, 3.0f, 4.0f, 3.0f, FTZ_OFF, unaryF), //relaxed error is actually overwritten in unary.c as it is 3+floor(fabs(2*x)) - ENTRY_EXT( exp10, 3.0f, 4.0f, 8192.0f, FTZ_OFF, unaryF), //relaxed error is actually overwritten in unary.c as it is 3+floor(fabs(2*x)) in derived mode, - // in non-derived mode it uses the ulp error for half_exp10. - ENTRY( expm1, 3.0f, 4.0f, FTZ_OFF, unaryF), - ENTRY( fabs, 0.0f, 0.0f, FTZ_OFF, unaryF), - ENTRY( fdim, 0.0f, 0.0f, FTZ_OFF, binaryF), - ENTRY( floor, 0.0f, 0.0f, FTZ_OFF, unaryF), - ENTRY( fma, 0.0f, 0.0f, FTZ_OFF, ternaryF), - ENTRY( fmax, 0.0f, 0.0f, FTZ_OFF, binaryF), - ENTRY( fmin, 0.0f, 0.0f, FTZ_OFF, binaryF), - ENTRY( fmod, 0.0f, 0.0f, FTZ_OFF, binaryF ), - ENTRY( fract, 0.0f, 0.0f, FTZ_OFF, unaryF_two_results), - ENTRY( frexp, 0.0f, 0.0f, FTZ_OFF, unaryF_two_results_i), - ENTRY( hypot, 4.0f, 4.0f, FTZ_OFF, binaryF), - ENTRY( ilogb, 0.0f, 0.0f, FTZ_OFF, i_unaryF), - ENTRY( isequal, 0.0f, 0.0f, FTZ_OFF, macro_binaryF), - ENTRY( isfinite, 0.0f, 0.0f, FTZ_OFF, macro_unaryF), - ENTRY( isgreater, 0.0f, 0.0f, FTZ_OFF, macro_binaryF), - ENTRY( isgreaterequal, 0.0f, 0.0f, FTZ_OFF, macro_binaryF), - ENTRY( isinf, 0.0f, 0.0f, FTZ_OFF, macro_unaryF), - ENTRY( isless, 0.0f, 0.0f, FTZ_OFF, macro_binaryF), - ENTRY( islessequal, 0.0f, 0.0f, FTZ_OFF, macro_binaryF), - ENTRY( islessgreater, 0.0f, 0.0f, FTZ_OFF, macro_binaryF), - ENTRY( isnan, 0.0f, 0.0f, FTZ_OFF, macro_unaryF), - ENTRY( isnormal, 0.0f, 0.0f, FTZ_OFF, macro_unaryF), - ENTRY( isnotequal, 0.0f, 0.0f, FTZ_OFF, macro_binaryF), - ENTRY( isordered, 0.0f, 0.0f, FTZ_OFF, macro_binaryF), - ENTRY( isunordered, 0.0f, 0.0f, FTZ_OFF, macro_binaryF), - ENTRY( ldexp, 0.0f, 0.0f, FTZ_OFF, binaryF_i), - ENTRY( lgamma, INFINITY, INFINITY, FTZ_OFF, unaryF), - ENTRY( lgamma_r, INFINITY, INFINITY, FTZ_OFF, unaryF_two_results_i), - ENTRY_EXT( log, 3.0f, 4.0f, 4.76837158203125e-7f, FTZ_OFF, unaryF), //relaxed ulp 2^-21 - ENTRY_EXT( log2, 3.0f, 4.0f, 4.76837158203125e-7f, FTZ_OFF, unaryF), //relaxed ulp 2^-21 - ENTRY( log10, 3.0f, 4.0f, FTZ_OFF, unaryF), - ENTRY( log1p, 2.0f, 4.0f, FTZ_OFF, unaryF), - ENTRY( logb, 0.0f, 0.0f, FTZ_OFF, unaryF), - ENTRY_EXT( mad, INFINITY, INFINITY, INFINITY, FTZ_OFF, mad_function), //in fast-relaxed-math mode it has to be either exactly rounded fma or exactly rounded a*b+c - ENTRY( maxmag, 0.0f, 0.0f, FTZ_OFF, binaryF ), - ENTRY( minmag, 0.0f, 0.0f, FTZ_OFF, binaryF ), - ENTRY( modf, 0.0f, 0.0f, FTZ_OFF, unaryF_two_results ), - ENTRY( nan, 0.0f, 0.0f, FTZ_OFF, unaryF_u), - ENTRY( nextafter, 0.0f, 0.0f, FTZ_OFF, binaryF_nextafter), - ENTRY_EXT( pow, 16.0f, 16.0f, 8192.0f, FTZ_OFF, binaryF), //in derived mode the ulp error is calculated as exp2(y*log2(x)) and in non-derived it is the same as half_pow - ENTRY( pown, 16.0f, 16.0f, FTZ_OFF, binaryF_i), - ENTRY( powr, 16.0f, 16.0f, FTZ_OFF, binaryF), -// ENTRY( reciprocal, 1.0f, 1.0f, FTZ_OFF, unaryF), - ENTRY( remainder, 0.0f, 0.0f, FTZ_OFF, binaryF), - ENTRY( remquo, 0.0f, 0.0f, FTZ_OFF, binaryF_two_results_i), - ENTRY( rint, 0.0f, 0.0f, FTZ_OFF, unaryF), - ENTRY( rootn, 16.0f, 16.0f, FTZ_OFF, binaryF_i), - ENTRY( round, 0.0f, 0.0f, FTZ_OFF, unaryF), - ENTRY( rsqrt, 2.0f, 4.0f, FTZ_OFF, unaryF), - ENTRY( signbit, 0.0f, 0.0f, FTZ_OFF, macro_unaryF), - ENTRY_EXT( sin, 4.0f, 4.0f, 0.00048828125f, FTZ_OFF, unaryF), //relaxed ulp 2^-11 - ENTRY_EXT( sincos, 4.0f, 4.0f, 0.00048828125f, FTZ_OFF, unaryF_two_results), //relaxed ulp 2^-11 - ENTRY( sinh, 4.0f, 4.0f, FTZ_OFF, unaryF), - ENTRY( sinpi, 4.0f, 4.0f, FTZ_OFF, unaryF), - { "sqrt", "sqrt", {(void*)reference_sqrt}, {(void*)reference_sqrtl}, {NULL}, 3.0f, 0.0f, 4.0f, INFINITY, FTZ_OFF, RELAXED_OFF, unaryF }, - { "sqrt_cr", "sqrt", {(void*)reference_sqrt}, {(void*)reference_sqrtl}, {NULL}, 0.0f, 0.0f, 0.0f, INFINITY, FTZ_OFF, RELAXED_OFF, unaryF }, - ENTRY_EXT( tan, 5.0f, 5.0f, 8192.0f, FTZ_OFF, unaryF), //in derived mode it the ulp error is calculated as sin/cos and in non-derived mode it is the same as half_tan. - ENTRY( tanh, 5.0f, 5.0f, FTZ_OFF, unaryF), - ENTRY( tanpi, 6.0f, 6.0f, FTZ_OFF, unaryF), -// ENTRY( tgamma, 16.0f, 16.0f, FTZ_OFF, unaryF), // Commented this out until we can be sure this requirement is realistic - ENTRY( trunc, 0.0f, 0.0f, FTZ_OFF, unaryF), - - HALF_ENTRY( cos, 8192.0f, 8192.0f, FTZ_ON, unaryF), - HALF_ENTRY( divide, 8192.0f, 8192.0f, FTZ_ON, binaryF), - HALF_ENTRY( exp, 8192.0f, 8192.0f, FTZ_ON, unaryF), - HALF_ENTRY( exp2, 8192.0f, 8192.0f, FTZ_ON, unaryF), - HALF_ENTRY( exp10, 8192.0f, 8192.0f, FTZ_ON, unaryF), - HALF_ENTRY( log, 8192.0f, 8192.0f, FTZ_ON, unaryF), - HALF_ENTRY( log2, 8192.0f, 8192.0f, FTZ_ON, unaryF), - HALF_ENTRY( log10, 8192.0f, 8192.0f, FTZ_ON, unaryF), - HALF_ENTRY( powr, 8192.0f, 8192.0f, FTZ_ON, binaryF), - HALF_ENTRY( recip, 8192.0f, 8192.0f, FTZ_ON, unaryF), - HALF_ENTRY( rsqrt, 8192.0f, 8192.0f, FTZ_ON, unaryF), - HALF_ENTRY( sin, 8192.0f, 8192.0f, FTZ_ON, unaryF), - HALF_ENTRY( sqrt, 8192.0f, 8192.0f, FTZ_ON, unaryF), - HALF_ENTRY( tan, 8192.0f, 8192.0f, FTZ_ON, unaryF), - - // basic operations - OPERATOR_ENTRY( add, "+", 0.0f, 0.0f, FTZ_OFF, binaryOperatorF), - OPERATOR_ENTRY( subtract, "-", 0.0f, 0.0f, FTZ_OFF, binaryOperatorF), - { "divide", "/", {(void*)reference_divide}, {(void*)reference_dividel}, {(void*)reference_relaxed_divide}, 2.5f, 0.0f, 3.0f, 2.5f, FTZ_OFF, RELAXED_ON, binaryOperatorF }, - { "divide_cr", "/", {(void*)reference_divide}, {(void*)reference_dividel}, {(void*)reference_relaxed_divide}, 0.0f, 0.0f, 0.0f, 0.f, FTZ_OFF, RELAXED_OFF, binaryOperatorF }, - OPERATOR_ENTRY( multiply, "*", 0.0f, 0.0f, FTZ_OFF, binaryOperatorF), - OPERATOR_ENTRY( assignment, "", 0.0f, 0.0f, FTZ_OFF, unaryF), // A simple copy operation - OPERATOR_ENTRY( not, "!", 0.0f, 0.0f, FTZ_OFF, macro_unaryF), - }; - -const size_t functionListCount = sizeof( functionList ) / sizeof( functionList[0] ); diff --git a/test_conformance/math_brute_force/FunctionList.cpp b/test_conformance/math_brute_force/FunctionList.cpp new file mode 100644 index 00000000..0aa35508 --- /dev/null +++ b/test_conformance/math_brute_force/FunctionList.cpp @@ -0,0 +1,325 @@ +// +// Copyright (c) 2017 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "FunctionList.h" +#include "reference_math.h" + +#define FTZ_ON 1 +#define FTZ_OFF 0 +#define EXACT 0.0f +#define RELAXED_ON 1 +#define RELAXED_OFF 0 + +#define STRINGIFY( _s) #_s + +// Only use ulps information in spir test +#ifdef FUNCTION_LIST_ULPS_ONLY + +#define ENTRY(_name, _ulp, _embedded_ulp, _rmode, _type) \ + { \ + STRINGIFY(_name), STRINGIFY(_name), { NULL }, { NULL }, { NULL }, \ + _ulp, _ulp, _embedded_ulp, INFINITY, INFINITY, _rmode, \ + RELAXED_OFF, _type \ + } +#define ENTRY_EXT(_name, _ulp, _embedded_ulp, _relaxed_ulp, _rmode, _type, \ + _relaxed_embedded_ulp) \ + { \ + STRINGIFY(_name), STRINGIFY(_name), { NULL }, { NULL }, { NULL }, \ + _ulp, _ulp, _embedded_ulp, _relaxed_ulp, _relaxed_embedded_ulp, \ + _rmode, RELAXED_ON, _type \ + } +#define HALF_ENTRY(_name, _ulp, _embedded_ulp, _rmode, _type) \ + { \ + "half_" STRINGIFY(_name), "half_" STRINGIFY(_name), { NULL }, \ + { NULL }, { NULL }, _ulp, _ulp, _embedded_ulp, INFINITY, INFINITY, \ + _rmode, RELAXED_OFF, _type \ + } +#define OPERATOR_ENTRY(_name, _operator, _ulp, _embedded_ulp, _rmode, _type) \ + { \ + STRINGIFY(_name), _operator, { NULL }, { NULL }, { NULL }, _ulp, _ulp, \ + _embedded_ulp, INFINITY, INFINITY, _rmode, RELAXED_OFF, _type \ + } +#define unaryF NULL +#define i_unaryF NULL +#define unaryF_u NULL +#define macro_unaryF NULL +#define binaryF NULL +#define binaryF_nextafter NULL +#define binaryOperatorF NULL +#define binaryF_i NULL +#define macro_binaryF NULL +#define ternaryF NULL +#define unaryF_two_results NULL +#define unaryF_two_results_i NULL +#define binaryF_two_results_i NULL +#define mad_function NULL + +#define reference_sqrt NULL +#define reference_sqrtl NULL +#define reference_divide NULL +#define reference_dividel NULL +#define reference_relaxed_divide NULL + +#else // FUNCTION_LIST_ULPS_ONLY + +#define ENTRY(_name, _ulp, _embedded_ulp, _rmode, _type) \ + { \ + STRINGIFY(_name), STRINGIFY(_name), { (void*)reference_##_name }, \ + { (void*)reference_##_name##l }, { (void*)reference_##_name }, \ + _ulp, _ulp, _embedded_ulp, INFINITY, INFINITY, _rmode, \ + RELAXED_OFF, _type \ + } +#define ENTRY_EXT(_name, _ulp, _embedded_ulp, _relaxed_ulp, _rmode, _type, \ + _relaxed_embedded_ulp) \ + { \ + STRINGIFY(_name), STRINGIFY(_name), { (void*)reference_##_name }, \ + { (void*)reference_##_name##l }, \ + { (void*)reference_##relaxed_##_name }, _ulp, _ulp, _embedded_ulp, \ + _relaxed_ulp, _relaxed_embedded_ulp, _rmode, RELAXED_ON, _type \ + } +#define HALF_ENTRY(_name, _ulp, _embedded_ulp, _rmode, _type) \ + { \ + "half_" STRINGIFY(_name), "half_" STRINGIFY(_name), \ + { (void*)reference_##_name }, { NULL }, { NULL }, _ulp, _ulp, \ + _embedded_ulp, INFINITY, INFINITY, _rmode, RELAXED_OFF, _type \ + } +#define OPERATOR_ENTRY(_name, _operator, _ulp, _embedded_ulp, _rmode, _type) \ + { \ + STRINGIFY(_name), _operator, { (void*)reference_##_name }, \ + { (void*)reference_##_name##l }, { NULL }, _ulp, _ulp, \ + _embedded_ulp, INFINITY, INFINITY, _rmode, RELAXED_OFF, _type \ + } + +extern const vtbl _unary; // float foo( float ) +extern const vtbl _unary_u; // float foo( uint ), double foo( ulong ) +extern const vtbl _i_unary; // int foo( float ) +extern const vtbl _macro_unary; // int foo( float ), returns {0,1} for scalar, { 0, -1 } for vector +extern const vtbl _binary; // float foo( float, float ) +extern const vtbl _binary_nextafter; // float foo( float, float ), special handling for nextafter +extern const vtbl _binary_operator; // float .op. float +extern const vtbl _macro_binary; // int foo( float, float ), returns {0,1} for scalar, { 0, -1 } for vector +extern const vtbl _binary_i; // float foo( float, int ) +extern const vtbl _ternary; // float foo( float, float, float ) +extern const vtbl _unary_two_results; // float foo( float, float * ) +extern const vtbl _unary_two_results_i; // float foo( float, int * ) +extern const vtbl _binary_two_results_i; // float foo( float, float, int * ) +extern const vtbl _mad_tbl; // float mad( float, float, float ) + +#define unaryF &_unary +#define i_unaryF &_i_unary +#define unaryF_u &_unary_u +#define macro_unaryF &_macro_unary +#define binaryF &_binary +#define binaryF_nextafter &_binary_nextafter +#define binaryOperatorF &_binary_operator +#define binaryF_i &_binary_i +#define macro_binaryF &_macro_binary +#define ternaryF &_ternary +#define unaryF_two_results &_unary_two_results +#define unaryF_two_results_i &_unary_two_results_i +#define binaryF_two_results_i &_binary_two_results_i +#define mad_function &_mad_tbl + +#endif // FUNCTION_LIST_ULPS_ONLY + +const Func functionList[] = { + ENTRY(acos, 4.0f, 4.0f, FTZ_OFF, unaryF), + ENTRY(acosh, 4.0f, 4.0f, FTZ_OFF, unaryF), + ENTRY(acospi, 5.0f, 5.0f, FTZ_OFF, unaryF), + ENTRY(asin, 4.0f, 4.0f, FTZ_OFF, unaryF), + ENTRY(asinh, 4.0f, 4.0f, FTZ_OFF, unaryF), + ENTRY(asinpi, 5.0f, 5.0f, FTZ_OFF, unaryF), + ENTRY(atan, 5.0f, 5.0f, FTZ_OFF, unaryF), + ENTRY(atanh, 5.0f, 5.0f, FTZ_OFF, unaryF), + ENTRY(atanpi, 5.0f, 5.0f, FTZ_OFF, unaryF), + ENTRY(atan2, 6.0f, 6.0f, FTZ_OFF, binaryF), + ENTRY(atan2pi, 6.0f, 6.0f, FTZ_OFF, binaryF), + ENTRY(cbrt, 2.0f, 4.0f, FTZ_OFF, unaryF), + ENTRY(ceil, 0.0f, 0.0f, FTZ_OFF, unaryF), + ENTRY(copysign, 0.0f, 0.0f, FTZ_OFF, binaryF), + ENTRY_EXT(cos, 4.0f, 4.0f, 0.00048828125f, FTZ_OFF, unaryF, + 0.00048828125f), // relaxed ulp 2^-11 + ENTRY(cosh, 4.0f, 4.0f, FTZ_OFF, unaryF), + ENTRY(cospi, 4.0f, 4.0f, FTZ_OFF, unaryF), + // ENTRY( erfc, 16.0f, + // 16.0f, FTZ_OFF, unaryF), + // //disabled for 1.0 due to lack of + // reference implementation ENTRY( erf, + // 16.0f, 16.0f, FTZ_OFF, + // unaryF), //disabled for 1.0 due to lack + // of reference implementation + ENTRY_EXT(exp, 3.0f, 4.0f, 3.0f, FTZ_OFF, unaryF, + 4.0f), // relaxed error is actually overwritten in unary.c as it + // is 3+floor(fabs(2*x)) + ENTRY_EXT(exp2, 3.0f, 4.0f, 3.0f, FTZ_OFF, unaryF, + 4.0f), // relaxed error is actually overwritten in unary.c as it + // is 3+floor(fabs(2*x)) + ENTRY_EXT(exp10, 3.0f, 4.0f, 8192.0f, FTZ_OFF, unaryF, + 8192.0f), // relaxed error is actually overwritten in unary.c as + // it is 3+floor(fabs(2*x)) in derived mode, + // in non-derived mode it uses the ulp error for half_exp10. + ENTRY(expm1, 3.0f, 4.0f, FTZ_OFF, unaryF), + ENTRY(fabs, 0.0f, 0.0f, FTZ_OFF, unaryF), + ENTRY(fdim, 0.0f, 0.0f, FTZ_OFF, binaryF), + ENTRY(floor, 0.0f, 0.0f, FTZ_OFF, unaryF), + ENTRY(fma, 0.0f, 0.0f, FTZ_OFF, ternaryF), + ENTRY(fmax, 0.0f, 0.0f, FTZ_OFF, binaryF), + ENTRY(fmin, 0.0f, 0.0f, FTZ_OFF, binaryF), + ENTRY(fmod, 0.0f, 0.0f, FTZ_OFF, binaryF), + ENTRY(fract, 0.0f, 0.0f, FTZ_OFF, unaryF_two_results), + ENTRY(frexp, 0.0f, 0.0f, FTZ_OFF, unaryF_two_results_i), + ENTRY(hypot, 4.0f, 4.0f, FTZ_OFF, binaryF), + ENTRY(ilogb, 0.0f, 0.0f, FTZ_OFF, i_unaryF), + ENTRY(isequal, 0.0f, 0.0f, FTZ_OFF, macro_binaryF), + ENTRY(isfinite, 0.0f, 0.0f, FTZ_OFF, macro_unaryF), + ENTRY(isgreater, 0.0f, 0.0f, FTZ_OFF, macro_binaryF), + ENTRY(isgreaterequal, 0.0f, 0.0f, FTZ_OFF, macro_binaryF), + ENTRY(isinf, 0.0f, 0.0f, FTZ_OFF, macro_unaryF), + ENTRY(isless, 0.0f, 0.0f, FTZ_OFF, macro_binaryF), + ENTRY(islessequal, 0.0f, 0.0f, FTZ_OFF, macro_binaryF), + ENTRY(islessgreater, 0.0f, 0.0f, FTZ_OFF, macro_binaryF), + ENTRY(isnan, 0.0f, 0.0f, FTZ_OFF, macro_unaryF), + ENTRY(isnormal, 0.0f, 0.0f, FTZ_OFF, macro_unaryF), + ENTRY(isnotequal, 0.0f, 0.0f, FTZ_OFF, macro_binaryF), + ENTRY(isordered, 0.0f, 0.0f, FTZ_OFF, macro_binaryF), + ENTRY(isunordered, 0.0f, 0.0f, FTZ_OFF, macro_binaryF), + ENTRY(ldexp, 0.0f, 0.0f, FTZ_OFF, binaryF_i), + ENTRY(lgamma, INFINITY, INFINITY, FTZ_OFF, unaryF), + ENTRY(lgamma_r, INFINITY, INFINITY, FTZ_OFF, unaryF_two_results_i), + ENTRY_EXT(log, 3.0f, 4.0f, 4.76837158203125e-7f, FTZ_OFF, unaryF, + 4.76837158203125e-7f), // relaxed ulp 2^-21 + ENTRY_EXT(log2, 3.0f, 4.0f, 4.76837158203125e-7f, FTZ_OFF, unaryF, + 4.76837158203125e-7f), // relaxed ulp 2^-21 + ENTRY(log10, 3.0f, 4.0f, FTZ_OFF, unaryF), + ENTRY(log1p, 2.0f, 4.0f, FTZ_OFF, unaryF), + ENTRY(logb, 0.0f, 0.0f, FTZ_OFF, unaryF), + ENTRY_EXT(mad, INFINITY, INFINITY, INFINITY, FTZ_OFF, mad_function, + INFINITY), // in fast-relaxed-math mode it has to be either + // exactly rounded fma or exactly rounded a*b+c + ENTRY(maxmag, 0.0f, 0.0f, FTZ_OFF, binaryF), + ENTRY(minmag, 0.0f, 0.0f, FTZ_OFF, binaryF), + ENTRY(modf, 0.0f, 0.0f, FTZ_OFF, unaryF_two_results), + ENTRY(nan, 0.0f, 0.0f, FTZ_OFF, unaryF_u), + ENTRY(nextafter, 0.0f, 0.0f, FTZ_OFF, binaryF_nextafter), + ENTRY_EXT(pow, 16.0f, 16.0f, 8192.0f, FTZ_OFF, binaryF, + 8192.0f), // in derived mode the ulp error is calculated as + // exp2(y*log2(x)) and in non-derived it is the same as + // half_pow + ENTRY(pown, 16.0f, 16.0f, FTZ_OFF, binaryF_i), + ENTRY(powr, 16.0f, 16.0f, FTZ_OFF, binaryF), + // ENTRY( reciprocal, 1.0f, + // 1.0f, FTZ_OFF, unaryF), + ENTRY(remainder, 0.0f, 0.0f, FTZ_OFF, binaryF), + ENTRY(remquo, 0.0f, 0.0f, FTZ_OFF, binaryF_two_results_i), + ENTRY(rint, 0.0f, 0.0f, FTZ_OFF, unaryF), + ENTRY(rootn, 16.0f, 16.0f, FTZ_OFF, binaryF_i), + ENTRY(round, 0.0f, 0.0f, FTZ_OFF, unaryF), + ENTRY(rsqrt, 2.0f, 4.0f, FTZ_OFF, unaryF), + ENTRY(signbit, 0.0f, 0.0f, FTZ_OFF, macro_unaryF), + ENTRY_EXT(sin, 4.0f, 4.0f, 0.00048828125f, FTZ_OFF, unaryF, + 0.00048828125f), // relaxed ulp 2^-11 + ENTRY_EXT(sincos, 4.0f, 4.0f, 0.00048828125f, FTZ_OFF, unaryF_two_results, + 0.00048828125f), // relaxed ulp 2^-11 + ENTRY(sinh, 4.0f, 4.0f, FTZ_OFF, unaryF), + ENTRY(sinpi, 4.0f, 4.0f, FTZ_OFF, unaryF), + { "sqrt", + "sqrt", + { (void*)reference_sqrt }, + { (void*)reference_sqrtl }, + { NULL }, + 3.0f, + 0.0f, + 4.0f, + INFINITY, + INFINITY, + FTZ_OFF, + RELAXED_OFF, + unaryF }, + { "sqrt_cr", + "sqrt", + { (void*)reference_sqrt }, + { (void*)reference_sqrtl }, + { NULL }, + 0.0f, + 0.0f, + 0.0f, + INFINITY, + INFINITY, + FTZ_OFF, + RELAXED_OFF, + unaryF }, + ENTRY_EXT( + tan, 5.0f, 5.0f, 8192.0f, FTZ_OFF, unaryF, + 8192.0f), // in derived mode it the ulp error is calculated as sin/cos + // and in non-derived mode it is the same as half_tan. + ENTRY(tanh, 5.0f, 5.0f, FTZ_OFF, unaryF), + ENTRY(tanpi, 6.0f, 6.0f, FTZ_OFF, unaryF), + // ENTRY( tgamma, 16.0f, + // 16.0f, FTZ_OFF, unaryF), + // // Commented this out until we can be + // sure this requirement is realistic + ENTRY(trunc, 0.0f, 0.0f, FTZ_OFF, unaryF), + + HALF_ENTRY(cos, 8192.0f, 8192.0f, FTZ_ON, unaryF), + HALF_ENTRY(divide, 8192.0f, 8192.0f, FTZ_ON, binaryF), + HALF_ENTRY(exp, 8192.0f, 8192.0f, FTZ_ON, unaryF), + HALF_ENTRY(exp2, 8192.0f, 8192.0f, FTZ_ON, unaryF), + HALF_ENTRY(exp10, 8192.0f, 8192.0f, FTZ_ON, unaryF), + HALF_ENTRY(log, 8192.0f, 8192.0f, FTZ_ON, unaryF), + HALF_ENTRY(log2, 8192.0f, 8192.0f, FTZ_ON, unaryF), + HALF_ENTRY(log10, 8192.0f, 8192.0f, FTZ_ON, unaryF), + HALF_ENTRY(powr, 8192.0f, 8192.0f, FTZ_ON, binaryF), + HALF_ENTRY(recip, 8192.0f, 8192.0f, FTZ_ON, unaryF), + HALF_ENTRY(rsqrt, 8192.0f, 8192.0f, FTZ_ON, unaryF), + HALF_ENTRY(sin, 8192.0f, 8192.0f, FTZ_ON, unaryF), + HALF_ENTRY(sqrt, 8192.0f, 8192.0f, FTZ_ON, unaryF), + HALF_ENTRY(tan, 8192.0f, 8192.0f, FTZ_ON, unaryF), + + // basic operations + OPERATOR_ENTRY(add, "+", 0.0f, 0.0f, FTZ_OFF, binaryOperatorF), + OPERATOR_ENTRY(subtract, "-", 0.0f, 0.0f, FTZ_OFF, binaryOperatorF), + { "divide", + "/", + { (void*)reference_divide }, + { (void*)reference_dividel }, + { (void*)reference_relaxed_divide }, + 2.5f, + 0.0f, + 3.0f, + 2.5f, + INFINITY, + FTZ_OFF, + RELAXED_ON, + binaryOperatorF }, + { "divide_cr", + "/", + { (void*)reference_divide }, + { (void*)reference_dividel }, + { (void*)reference_relaxed_divide }, + 0.0f, + 0.0f, + 0.0f, + 0.f, + INFINITY, + FTZ_OFF, + RELAXED_OFF, + binaryOperatorF }, + OPERATOR_ENTRY(multiply, "*", 0.0f, 0.0f, FTZ_OFF, binaryOperatorF), + OPERATOR_ENTRY(assignment, "", 0.0f, 0.0f, FTZ_OFF, + unaryF), // A simple copy operation + OPERATOR_ENTRY(not, "!", 0.0f, 0.0f, FTZ_OFF, macro_unaryF), +}; + +const size_t functionListCount = sizeof( functionList ) / sizeof( functionList[0] ); diff --git a/test_conformance/math_brute_force/FunctionList.h b/test_conformance/math_brute_force/FunctionList.h index 32facbd6..c22bceeb 100644 --- a/test_conformance/math_brute_force/FunctionList.h +++ b/test_conformance/math_brute_force/FunctionList.h @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -16,7 +16,7 @@ #ifndef FUNCTIONLIST_H #define FUNCTIONLIST_H -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #ifndef WIN32 #include @@ -28,11 +28,7 @@ #include #endif -#include "../../test_common/harness/mt19937.h" - -#ifdef __cplusplus -extern "C" { -#endif +#include "harness/mt19937.h" typedef union fptr { @@ -72,8 +68,10 @@ struct Func; typedef struct vtbl { const char *type_name; - int (*TestFunc)( const struct Func *, MTdata ); - int (*DoubleTestFunc)( const struct Func *, MTdata); // may be NULL if function is single precision only + int (*TestFunc)(const struct Func *, MTdata, bool); + int (*DoubleTestFunc)( + const struct Func *, MTdata, + bool); // may be NULL if function is single precision only }vtbl; typedef struct Func @@ -87,6 +85,7 @@ typedef struct Func float double_ulps; float float_embedded_ulps; float relaxed_error; + float relaxed_embedded_error; int ftz; int relaxed; const vtbl *vtbl_ptr; @@ -97,10 +96,6 @@ extern const Func functionList[]; extern const size_t functionListCount; -#ifdef __cplusplus -} -#endif - #endif diff --git a/test_conformance/math_brute_force/Sleep.c b/test_conformance/math_brute_force/Sleep.cpp similarity index 100% rename from test_conformance/math_brute_force/Sleep.c rename to test_conformance/math_brute_force/Sleep.cpp diff --git a/test_conformance/math_brute_force/Utility.c b/test_conformance/math_brute_force/Utility.cpp similarity index 89% rename from test_conformance/math_brute_force/Utility.c rename to test_conformance/math_brute_force/Utility.cpp index 3c706fab..9ab7c7fa 100644 --- a/test_conformance/math_brute_force/Utility.c +++ b/test_conformance/math_brute_force/Utility.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -14,6 +14,7 @@ // limitations under the License. // #include "Utility.h" +#include "FunctionList.h" #if defined(__PPC__) // Global varaiable used to hold the FPU control register state. The FPSCR register can not @@ -167,3 +168,32 @@ void logFunctionInfo(const char *fname, unsigned int float_size, unsigned int is vlog("%15s %4s %4s",fname, fpSizeStr, fpFastRelaxedStr); } +float getAllowedUlpError(const Func *f, const bool relaxed) +{ + float ulp; + + if (relaxed) + { + if (gIsEmbedded) + { + ulp = f->relaxed_embedded_error; + } + else + { + ulp = f->relaxed_error; + } + } + else + { + if (gIsEmbedded) + { + ulp = f->float_embedded_ulps; + } + else + { + ulp = f->float_ulps; + } + } + + return ulp; +} \ No newline at end of file diff --git a/test_conformance/math_brute_force/Utility.h b/test_conformance/math_brute_force/Utility.h index e7d27cb7..7a4cac6c 100644 --- a/test_conformance/math_brute_force/Utility.h +++ b/test_conformance/math_brute_force/Utility.h @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -16,7 +16,7 @@ #ifndef UTILITY_H #define UTILITY_H -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #ifdef __APPLE__ #include @@ -24,10 +24,12 @@ #include #endif #include -#include "../../test_common/harness/rounding_mode.h" -#include "../../test_common/harness/fpcontrol.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/ThreadPool.h" +#include "harness/rounding_mode.h" +#include "harness/fpcontrol.h" +#include "harness/testHarness.h" +#include "harness/ThreadPool.h" +#include "harness/conversions.h" + #define BUFFER_SIZE (1024*1024*2) #if defined( __GNUC__ ) @@ -36,6 +38,8 @@ #define UNUSED #endif +struct Func; + extern int gWimpyBufferSize; extern int gWimpyReductionFactor; @@ -64,7 +68,6 @@ extern int gSkipCorrectnessTesting; extern int gMeasureTimes; extern int gReportAverageTimes; extern int gForceFTZ; -extern volatile int gTestFastRelaxed; extern int gFastRelaxedDerived; extern int gWimpyMode; extern int gHasDouble; @@ -81,18 +84,7 @@ extern cl_device_fp_config gDoubleCapabilities; #define LOWER_IS_BETTER 0 #define HIGHER_IS_BETTER 1 -#if USE_ATF - - #include - #define test_start() ATFTestStart() - #define test_finish() ATFTestFinish() - #define vlog( ... ) ATFLogInfo(__VA_ARGS__) - #define vlog_error( ... ) ATFLogError(__VA_ARGS__) - #define vlog_perf( _number, _higherIsBetter, _units, _nameFmt, ... ) ATFLogPerformanceNumber(_number, _higherIsBetter, _units, _nameFmt, __VA_ARGS__ ) - -#else - #include "../../test_common/harness/errorHelpers.h" -#endif +#include "harness/errorHelpers.h" #if defined (_MSC_VER ) //Deal with missing scalbn on windows @@ -101,21 +93,18 @@ extern cl_device_fp_config gDoubleCapabilities; #define scalbnl( _a, _i ) ldexpl( _a, _i ) #endif -#ifdef __cplusplus -extern "C" { -#endif float Abs_Error( float test, double reference ); float Ulp_Error( float test, double reference ); //float Ulp_Error_Half( float test, double reference ); float Bruteforce_Ulp_Error_Double( double test, long double reference ); -#ifdef __cplusplus -} //extern "C" -#endif uint64_t GetTime( void ); double SubtractTime( uint64_t endTime, uint64_t startTime ); -int MakeKernel( const char **c, cl_uint count, const char *name, cl_kernel *k, cl_program *p ); -int MakeKernels( const char **c, cl_uint count, const char *name, cl_uint kernel_count, cl_kernel *k, cl_program *p ); +int MakeKernel(const char **c, cl_uint count, const char *name, cl_kernel *k, + cl_program *p, bool relaxedMode); +int MakeKernels(const char **c, cl_uint count, const char *name, + cl_uint kernel_count, cl_kernel *k, cl_program *p, + bool relaxedMode); // used to convert a bucket of bits into a search pattern through double static inline double DoubleFromUInt32( uint32_t bits ); @@ -139,34 +128,6 @@ void _LogBuildError( cl_program p, int line, const char *file ); #define PERF_LOOP_COUNT 100 -// Note: though this takes a double, this is for use with single precision tests -static inline int IsFloatSubnormal( double x ) -{ -#if 2 == FLT_RADIX - // Do this in integer to avoid problems with FTZ behavior - union{ float d; uint32_t u;}u; - u.d = fabsf((float)x); - return (u.u-1) < 0x007fffffU; -#else - // rely on floating point hardware for non-radix2 non-IEEE-754 hardware -- will fail if you flush subnormals to zero - return fabs(x) < (double) FLT_MIN && x != 0.0; -#endif -} - - -static inline int IsDoubleSubnormal( long double x ) -{ -#if 2 == FLT_RADIX - // Do this in integer to avoid problems with FTZ behavior - union{ double d; uint64_t u;}u; - u.d = fabs((double) x); - return (u.u-1) < 0x000fffffffffffffULL; -#else - // rely on floating point hardware for non-radix2 non-IEEE-754 hardware -- will fail if you flush subnormals to zero - return fabs(x) < (double) DBL_MIN && x != 0.0; -#endif -} - //The spec is fairly clear that we may enforce a hard cutoff to prevent premature flushing to zero. // However, to avoid conflict for 1.0, we are letting results at TYPE_MIN + ulp_limit to be flushed to zero. static inline int IsFloatResultSubnormal( double x, float ulps ) @@ -241,11 +202,7 @@ static inline void Force64BitFPUPrecision(void) #endif } -#ifdef __cplusplus -extern "C" -#else extern -#endif void memset_pattern4(void *dest, const void *src_pattern, size_t bytes ); typedef union @@ -270,6 +227,8 @@ int compareDoubles(double x, double y); void logFunctionInfo(const char *fname, unsigned int float_size, unsigned int isFastRelaxed); +float getAllowedUlpError(const Func *f, const bool relaxed); + #endif /* UTILITY_H */ diff --git a/test_conformance/math_brute_force/binary.c b/test_conformance/math_brute_force/binary.cpp similarity index 94% rename from test_conformance/math_brute_force/binary.c rename to test_conformance/math_brute_force/binary.cpp index 7bf136ff..eb5007c0 100644 --- a/test_conformance/math_brute_force/binary.c +++ b/test_conformance/math_brute_force/binary.cpp @@ -18,29 +18,33 @@ #include #include "FunctionList.h" -int TestFunc_Float_Float_Float(const Func *f, MTdata); -int TestFunc_Double_Double_Double(const Func *f, MTdata); -int TestFunc_Float_Float_Float_nextafter(const Func *f, MTdata); -int TestFunc_Double_Double_Double_nextafter(const Func *f, MTdata); -int TestFunc_Float_Float_Float_common(const Func *f, MTdata, int isNextafter); -int TestFunc_Double_Double_Double_common(const Func *f, MTdata, int isNextafter); +int TestFunc_Float_Float_Float(const Func *f, MTdata, bool relaxedMode); +int TestFunc_Double_Double_Double(const Func *f, MTdata, bool relaxedMode); +int TestFunc_Float_Float_Float_nextafter(const Func *f, MTdata, + bool relaxedMode); +int TestFunc_Double_Double_Double_nextafter(const Func *f, MTdata, + bool relaxedMode); +int TestFunc_Float_Float_Float_common(const Func *f, MTdata, int isNextafter, + bool relaxedMode); +int TestFunc_Double_Double_Double_common(const Func *f, MTdata, int isNextafter, + bool relaxedMode); const float twoToMinus126 = MAKE_HEX_FLOAT(0x1p-126f, 1, -126); const double twoToMinus1022 = MAKE_HEX_DOUBLE(0x1p-1022, 1, -1022); -#if defined( __cplusplus ) - extern "C" -#endif -const vtbl _binary = { "binary", TestFunc_Float_Float_Float, TestFunc_Double_Double_Double }; +extern const vtbl _binary = { "binary", TestFunc_Float_Float_Float, + TestFunc_Double_Double_Double }; -#if defined( __cplusplus ) - extern "C" -#endif -const vtbl _binary_nextafter = { "binary_nextafter", TestFunc_Float_Float_Float_nextafter, TestFunc_Double_Double_Double_nextafter }; +extern const vtbl _binary_nextafter = { + "binary_nextafter", TestFunc_Float_Float_Float_nextafter, + TestFunc_Double_Double_Double_nextafter +}; -static int BuildKernel( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p ); +static int BuildKernel(const char *name, int vectorSize, cl_uint kernel_count, + cl_kernel *k, cl_program *p, bool relaxedMode); -static int BuildKernel( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p ) +static int BuildKernel(const char *name, int vectorSize, cl_uint kernel_count, + cl_kernel *k, cl_program *p, bool relaxedMode) { const char *c[] = { "__kernel void math_kernel", sizeNames[vectorSize], "( __global float", sizeNames[vectorSize], "* out, __global float", sizeNames[vectorSize], "* in1, __global float", sizeNames[vectorSize], "* in2 )\n" "{\n" @@ -100,10 +104,13 @@ static int BuildKernel( const char *name, int vectorSize, cl_uint kernel_count, char testName[32]; snprintf( testName, sizeof( testName ) -1, "math_kernel%s", sizeNames[vectorSize] ); - return MakeKernels(kern, (cl_uint) kernSize, testName, kernel_count, k, p); + return MakeKernels(kern, (cl_uint)kernSize, testName, kernel_count, k, p, + relaxedMode); } -static int BuildKernelDouble( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p ) +static int BuildKernelDouble(const char *name, int vectorSize, + cl_uint kernel_count, cl_kernel *k, cl_program *p, + bool relaxedMode) { const char *c[] = { "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n", "__kernel void math_kernel", sizeNames[vectorSize], "( __global double", sizeNames[vectorSize], "* out, __global double", sizeNames[vectorSize], "* in1, __global double", sizeNames[vectorSize], "* in2 )\n" @@ -165,7 +172,8 @@ static int BuildKernelDouble( const char *name, int vectorSize, cl_uint kernel_c char testName[32]; snprintf( testName, sizeof( testName ) -1, "math_kernel%s", sizeNames[vectorSize] ); - return MakeKernels(kern, (cl_uint) kernSize, testName, kernel_count, k, p); + return MakeKernels(kern, (cl_uint)kernSize, testName, kernel_count, k, p, + relaxedMode); } // A table of more difficult cases to get right @@ -194,6 +202,7 @@ typedef struct BuildKernelInfo cl_kernel **kernels; cl_program *programs; const char *nameInCode; + bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. }BuildKernelInfo; static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -201,7 +210,8 @@ static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, voi { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernel( info->nameInCode, i, info->kernel_count, info->kernels[i], info->programs + i ); + return BuildKernel(info->nameInCode, i, info->kernel_count, + info->kernels[i], info->programs + i, info->relaxedMode); } static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -209,7 +219,9 @@ static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, vo { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernelDouble( info->nameInCode, i, info->kernel_count, info->kernels[i], info->programs + i ); + return BuildKernelDouble(info->nameInCode, i, info->kernel_count, + info->kernels[i], info->programs + i, + info->relaxedMode); } //Thread specific data for a worker thread @@ -242,11 +254,14 @@ typedef struct TestInfo int isFDim; int skipNanInf; int isNextafter; -}TestInfo; + bool relaxedMode; // True if test is running in relaxed mode, false + // otherwise. +} TestInfo; static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *p ); -int TestFunc_Float_Float_Float_common(const Func *f, MTdata d, int isNextafter) +int TestFunc_Float_Float_Float_common(const Func *f, MTdata d, int isNextafter, + bool relaxedMode) { TestInfo test_info; cl_int error; @@ -256,7 +271,7 @@ int TestFunc_Float_Float_Float_common(const Func *f, MTdata d, int isNextafter) double maxErrorVal2 = 0.0; int skipTestingRelaxed = 0; - logFunctionInfo(f->name,sizeof(cl_float),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_float), relaxedMode); // Init test_info memset( &test_info, 0, sizeof( test_info ) ); @@ -286,6 +301,7 @@ int TestFunc_Float_Float_Float_common(const Func *f, MTdata d, int isNextafter) test_info.isFDim = 0 == strcmp( "fdim", f->nameInCode ); test_info.skipNanInf = test_info.isFDim && ! gInfNanSupport; test_info.isNextafter = isNextafter; + test_info.relaxedMode = relaxedMode; // cl_kernels aren't thread safe, so we make one for each vector size for every thread for( i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++ ) { @@ -332,7 +348,7 @@ int TestFunc_Float_Float_Float_common(const Func *f, MTdata d, int isNextafter) goto exit; } } - test_info.tinfo[i].tQueue = clCreateCommandQueueWithProperties(gContext, gDevice, 0, &error); + test_info.tinfo[i].tQueue = clCreateCommandQueue(gContext, gDevice, 0, &error); if( NULL == test_info.tinfo[i].tQueue || error ) { vlog_error( "clCreateCommandQueue failed. (%d)\n", error ); @@ -344,7 +360,10 @@ int TestFunc_Float_Float_Float_common(const Func *f, MTdata d, int isNextafter) // Init the kernels { - BuildKernelInfo build_info = { gMinVectorSizeIndex, test_info.threadCount, test_info.k, test_info.programs, f->nameInCode }; + BuildKernelInfo build_info = { + gMinVectorSizeIndex, test_info.threadCount, test_info.k, + test_info.programs, f->nameInCode, relaxedMode + }; if( (error = ThreadPool_Do( BuildKernel_FloatFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) goto exit; } @@ -481,9 +500,10 @@ static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *data ) size_t buffer_size = buffer_elements * sizeof( cl_float ); cl_uint base = job_id * (cl_uint) job->step; ThreadInfo *tinfo = job->tinfo + thread_id; - float ulps = job->ulps; fptr func = job->f->func; int ftz = job->ftz; + bool relaxedMode = job->relaxedMode; + float ulps = getAllowedUlpError(job->f, relaxedMode); MTdata d = tinfo->d; cl_uint j, k; cl_int error; @@ -498,7 +518,7 @@ static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *data ) RoundingMode oldRoundMode; int skipVerification = 0; - if(gTestFastRelaxed) + if (relaxedMode) { if (strcmp(name,"pow")==0 && gFastRelaxedDerived) { @@ -508,7 +528,6 @@ static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *data ) }else { func = job->f->rfunc; - ulps = job->f->relaxed_error; } } @@ -712,7 +731,7 @@ static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *data ) // As per OpenCL 2.0 spec, section 5.8.4.3, enabling fast-relaxed-math mode also enables // -cl-finite-math-only optimization. This optimization allows to assume that arguments and // results are not NaNs or +/-INFs. Hence, accept any result if inputs or results are NaNs or INFs. - if ( gTestFastRelaxed || skipNanInf) + if (relaxedMode || skipNanInf) { if( skipNanInf && overflow[j]) continue; @@ -774,7 +793,7 @@ static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *data ) // As per OpenCL 2.0 spec, section 5.8.4.3, enabling fast-relaxed-math mode also enables // -cl-finite-math-only optimization. This optimization allows to assume that arguments and // results are not NaNs or +/-INFs. Hence, accept any result if inputs or results are NaNs or INFs. - if( gTestFastRelaxed || skipNanInf ) + if (relaxedMode || skipNanInf) { if( fetestexcept(FE_OVERFLOW) && skipNanInf ) continue; @@ -819,7 +838,7 @@ static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *data ) // As per OpenCL 2.0 spec, section 5.8.4.3, enabling fast-relaxed-math mode also enables // -cl-finite-math-only optimization. This optimization allows to assume that arguments and // results are not NaNs or +/-INFs. Hence, accept any result if inputs or results are NaNs or INFs. - if( gTestFastRelaxed || skipNanInf ) + if (relaxedMode || skipNanInf) { if( fetestexcept(FE_OVERFLOW) && skipNanInf ) continue; @@ -872,7 +891,7 @@ static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *data ) // As per OpenCL 2.0 spec, section 5.8.4.3, enabling fast-relaxed-math mode also enables // -cl-finite-math-only optimization. This optimization allows to assume that arguments and // results are not NaNs or +/-INFs. Hence, accept any result if inputs or results are NaNs or INFs. - if ( gTestFastRelaxed || skipNanInf ) + if (relaxedMode || skipNanInf) { // Note: no double rounding here. Reference functions calculate in single precision. if( overflow[j] && skipNanInf) @@ -979,7 +998,8 @@ static size_t specialValuesDoubleCount = sizeof( specialValuesDouble ) / sizeof( static cl_int TestDouble( cl_uint job_id, cl_uint thread_id, void *p ); -int TestFunc_Double_Double_Double_common(const Func *f, MTdata d, int isNextafter) +int TestFunc_Double_Double_Double_common(const Func *f, MTdata d, + int isNextafter, bool relaxedMode) { TestInfo test_info; cl_int error; @@ -988,7 +1008,7 @@ int TestFunc_Double_Double_Double_common(const Func *f, MTdata d, int isNextafte double maxErrorVal = 0.0; double maxErrorVal2 = 0.0; - logFunctionInfo(f->name,sizeof(cl_double),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_double), relaxedMode); // Init test_info memset( &test_info, 0, sizeof( test_info ) ); @@ -1065,7 +1085,7 @@ int TestFunc_Double_Double_Double_common(const Func *f, MTdata d, int isNextafte goto exit; } } - test_info.tinfo[i].tQueue = clCreateCommandQueueWithProperties(gContext, gDevice, 0, &error); + test_info.tinfo[i].tQueue = clCreateCommandQueue(gContext, gDevice, 0, &error); if( NULL == test_info.tinfo[i].tQueue || error ) { vlog_error( "clCreateCommandQueue failed. (%d)\n", error ); @@ -1077,7 +1097,10 @@ int TestFunc_Double_Double_Double_common(const Func *f, MTdata d, int isNextafte // Init the kernels { - BuildKernelInfo build_info = { gMinVectorSizeIndex, test_info.threadCount, test_info.k, test_info.programs, f->nameInCode }; + BuildKernelInfo build_info = { + gMinVectorSizeIndex, test_info.threadCount, test_info.k, + test_info.programs, f->nameInCode, relaxedMode + }; if( (error = ThreadPool_Do( BuildKernel_DoubleFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) goto exit; } @@ -1536,23 +1559,25 @@ exit: } -int TestFunc_Float_Float_Float(const Func *f, MTdata d) +int TestFunc_Float_Float_Float(const Func *f, MTdata d, bool relaxedMode) { - return TestFunc_Float_Float_Float_common(f, d, 0); + return TestFunc_Float_Float_Float_common(f, d, 0, relaxedMode); } -int TestFunc_Double_Double_Double(const Func *f, MTdata d) +int TestFunc_Double_Double_Double(const Func *f, MTdata d, bool relaxedMode) { - return TestFunc_Double_Double_Double_common(f, d, 0); + return TestFunc_Double_Double_Double_common(f, d, 0, relaxedMode); } -int TestFunc_Float_Float_Float_nextafter(const Func *f, MTdata d) +int TestFunc_Float_Float_Float_nextafter(const Func *f, MTdata d, + bool relaxedMode) { - return TestFunc_Float_Float_Float_common(f, d, 1); + return TestFunc_Float_Float_Float_common(f, d, 1, relaxedMode); } -int TestFunc_Double_Double_Double_nextafter(const Func *f, MTdata d) +int TestFunc_Double_Double_Double_nextafter(const Func *f, MTdata d, + bool relaxedMode) { - return TestFunc_Double_Double_Double_common(f, d, 1); + return TestFunc_Double_Double_Double_common(f, d, 1, relaxedMode); } diff --git a/test_conformance/math_brute_force/binaryOperator.c b/test_conformance/math_brute_force/binaryOperator.cpp similarity index 94% rename from test_conformance/math_brute_force/binaryOperator.c rename to test_conformance/math_brute_force/binaryOperator.cpp index 09946cbe..0742964d 100644 --- a/test_conformance/math_brute_force/binaryOperator.c +++ b/test_conformance/math_brute_force/binaryOperator.cpp @@ -18,19 +18,25 @@ #include #include "FunctionList.h" -int TestFunc_Float_Float_Float_Operator(const Func *f, MTdata); -int TestFunc_Double_Double_Double_Operator(const Func *f, MTdata); +int TestFunc_Float_Float_Float_Operator(const Func *f, MTdata, + bool relaxedMode); +int TestFunc_Double_Double_Double_Operator(const Func *f, MTdata, + bool relaxedMode); -#if defined(__cplusplus) - extern "C" -#endif +extern const vtbl _binary_operator = { "binaryOperator", + TestFunc_Float_Float_Float_Operator, + TestFunc_Double_Double_Double_Operator }; -const vtbl _binary_operator = { "binaryOperator", TestFunc_Float_Float_Float_Operator, TestFunc_Double_Double_Double_Operator }; +static int BuildKernel(const char *name, const char *operator_symbol, + int vectorSize, cl_uint kernel_count, cl_kernel *k, + cl_program *p, bool relaxedMode); +static int BuildKernelDouble(const char *name, const char *operator_symbol, + int vectorSize, cl_uint kernel_count, cl_kernel *k, + cl_program *p, bool relaxedMode); -static int BuildKernel( const char *name, const char *operator_symbol, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p ); -static int BuildKernelDouble( const char *name, const char *operator_symbol, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p ); - -static int BuildKernel( const char *name, const char *operator_symbol, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p ) +static int BuildKernel(const char *name, const char *operator_symbol, + int vectorSize, cl_uint kernel_count, cl_kernel *k, + cl_program *p, bool relaxedMode) { const char *c[] = { "__kernel void ", name, "_kernel", sizeNames[vectorSize], "( __global float", sizeNames[vectorSize], "* out, __global float", sizeNames[vectorSize], "* in1, __global float", sizeNames[vectorSize], "* in2 )\n" @@ -90,11 +96,13 @@ static int BuildKernel( const char *name, const char *operator_symbol, int vecto char testName[32]; snprintf( testName, sizeof( testName ) -1, "%s_kernel%s", name, sizeNames[vectorSize] ); - return MakeKernels(kern, (cl_uint) kernSize, testName, kernel_count, k, p); - + return MakeKernels(kern, (cl_uint)kernSize, testName, kernel_count, k, p, + relaxedMode); } -static int BuildKernelDouble( const char *name, const char *operator_symbol, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p ) +static int BuildKernelDouble(const char *name, const char *operator_symbol, + int vectorSize, cl_uint kernel_count, cl_kernel *k, + cl_program *p, bool relaxedMode) { const char *c[] = { "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n", @@ -156,8 +164,8 @@ static int BuildKernelDouble( const char *name, const char *operator_symbol, int char testName[32]; snprintf( testName, sizeof( testName ) -1, "%s_kernel%s", name, sizeNames[vectorSize] ); - return MakeKernels(kern, (cl_uint) kernSize, testName, kernel_count, k, p); - + return MakeKernels(kern, (cl_uint)kernSize, testName, kernel_count, k, p, + relaxedMode); } typedef struct BuildKernelInfo @@ -168,6 +176,7 @@ typedef struct BuildKernelInfo cl_program *programs; const char *name; const char *operator_symbol; + bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. }BuildKernelInfo; static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -175,7 +184,8 @@ static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, voi { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernel( info->name, info->operator_symbol, i, info->kernel_count, info->kernels[i], info->programs + i ); + return BuildKernel(info->name, info->operator_symbol, i, info->kernel_count, + info->kernels[i], info->programs + i, info->relaxedMode); } static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -183,7 +193,9 @@ static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, vo { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernelDouble( info->name, info->operator_symbol, i, info->kernel_count, info->kernels[i], info->programs + i ); + return BuildKernelDouble(info->name, info->operator_symbol, i, + info->kernel_count, info->kernels[i], + info->programs + i, info->relaxedMode); } //Thread specific data for a worker thread @@ -212,6 +224,8 @@ typedef struct TestInfo cl_uint scale; // stride between individual test values float ulps; // max_allowed ulps int ftz; // non-zero if running in flush to zero mode + bool relaxedMode; // True if the test is being run in relaxed mode, false + // otherwise. // no special fields }TestInfo; @@ -239,7 +253,8 @@ static size_t specialValuesFloatCount = sizeof( specialValuesFloat ) / sizeof( s static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *p ); -int TestFunc_Float_Float_Float_Operator(const Func *f, MTdata d) +int TestFunc_Float_Float_Float_Operator(const Func *f, MTdata d, + bool relaxedMode) { TestInfo test_info; cl_int error; @@ -248,7 +263,7 @@ int TestFunc_Float_Float_Float_Operator(const Func *f, MTdata d) double maxErrorVal = 0.0; double maxErrorVal2 = 0.0; - logFunctionInfo(f->name,sizeof(cl_float),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_float), relaxedMode); // Init test_info memset( &test_info, 0, sizeof( test_info ) ); @@ -274,6 +289,7 @@ int TestFunc_Float_Float_Float_Operator(const Func *f, MTdata d) test_info.f = f; test_info.ulps = gIsEmbedded ? f->float_embedded_ulps : f->float_ulps; test_info.ftz = f->ftz || gForceFTZ || 0 == (CL_FP_DENORM & gFloatCapabilities); + test_info.relaxedMode = relaxedMode; // cl_kernels aren't thread safe, so we make one for each vector size for every thread for( i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++ ) @@ -321,7 +337,7 @@ int TestFunc_Float_Float_Float_Operator(const Func *f, MTdata d) goto exit; } } - test_info.tinfo[i].tQueue = clCreateCommandQueueWithProperties(gContext, gDevice, 0, &error); + test_info.tinfo[i].tQueue = clCreateCommandQueue(gContext, gDevice, 0, &error); if( NULL == test_info.tinfo[i].tQueue || error ) { vlog_error( "clCreateCommandQueue failed. (%d)\n", error ); @@ -333,7 +349,13 @@ int TestFunc_Float_Float_Float_Operator(const Func *f, MTdata d) // Init the kernels { - BuildKernelInfo build_info = { gMinVectorSizeIndex, test_info.threadCount, test_info.k, test_info.programs, f->name, f->nameInCode }; + BuildKernelInfo build_info = { gMinVectorSizeIndex, + test_info.threadCount, + test_info.k, + test_info.programs, + f->name, + f->nameInCode, + relaxedMode }; if( (error = ThreadPool_Do( BuildKernel_FloatFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) goto exit; } @@ -462,18 +484,19 @@ exit: return error; } -static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *data ) +static cl_int TestFloat(cl_uint job_id, cl_uint thread_id, void *data) { const TestInfo *job = (const TestInfo *) data; size_t buffer_elements = job->subBufferSize; size_t buffer_size = buffer_elements * sizeof( cl_float ); cl_uint base = job_id * (cl_uint) job->step; ThreadInfo *tinfo = job->tinfo + thread_id; - float ulps = job->ulps; fptr func = job->f->func; - if ( gTestFastRelaxed ) + bool relaxedMode = job->relaxedMode; + float ulps = getAllowedUlpError(job->f, relaxedMode); + if (relaxedMode) { - func = job->f->rfunc; + func = job->f->rfunc; } @@ -530,7 +553,8 @@ static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *data ) if (y >= specialValuesFloatCount) break; } - if (gTestFastRelaxed && strcmp(name,"divide") == 0) { + if (relaxedMode && strcmp(name, "divide") == 0) + { cl_uint pj = p[j] & 0x7fffffff; cl_uint p2j = p2[j] & 0x7fffffff; // Replace values outside [2^-62, 2^62] with QNaN @@ -548,7 +572,8 @@ static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *data ) p[j] = genrand_int32(d); p2[j] = genrand_int32(d); - if (gTestFastRelaxed && strcmp(name,"divide") == 0) { + if (relaxedMode && strcmp(name, "divide") == 0) + { cl_uint pj = p[j] & 0x7fffffff; cl_uint p2j = p2[j] & 0x7fffffff; // Replace values outside [2^-62, 2^62] with QNaN @@ -706,9 +731,6 @@ static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *data ) float err = Ulp_Error( test, correct ); float errB = Ulp_Error( test, (float) correct ); - if( gTestFastRelaxed ) - ulps = job->f->relaxed_error; - int fail = ((!(fabsf(err) <= ulps)) && (!(fabsf(errB) <= ulps))); if( fabsf( errB ) < fabsf(err ) ) err = errB; @@ -900,7 +922,6 @@ exit: if( overflow ) free( overflow ); return error; - } @@ -927,7 +948,8 @@ static size_t specialValuesDoubleCount = sizeof( specialValuesDouble ) / sizeof( static cl_int TestDouble( cl_uint job_id, cl_uint thread_id, void *p ); -int TestFunc_Double_Double_Double_Operator(const Func *f, MTdata d) +int TestFunc_Double_Double_Double_Operator(const Func *f, MTdata d, + bool relaxedMode) { TestInfo test_info; cl_int error; @@ -935,7 +957,7 @@ int TestFunc_Double_Double_Double_Operator(const Func *f, MTdata d) float maxError = 0.0f; double maxErrorVal = 0.0; double maxErrorVal2 = 0.0; - logFunctionInfo(f->name,sizeof(cl_double),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_double), relaxedMode); // Init test_info memset( &test_info, 0, sizeof( test_info ) ); @@ -1009,7 +1031,7 @@ int TestFunc_Double_Double_Double_Operator(const Func *f, MTdata d) goto exit; } } - test_info.tinfo[i].tQueue = clCreateCommandQueueWithProperties(gContext, gDevice, 0, &error); + test_info.tinfo[i].tQueue = clCreateCommandQueue(gContext, gDevice, 0, &error); if( NULL == test_info.tinfo[i].tQueue || error ) { vlog_error( "clCreateCommandQueue failed. (%d)\n", error ); @@ -1022,7 +1044,13 @@ int TestFunc_Double_Double_Double_Operator(const Func *f, MTdata d) // Init the kernels { - BuildKernelInfo build_info = { gMinVectorSizeIndex, test_info.threadCount, test_info.k, test_info.programs, f->name, f->nameInCode }; + BuildKernelInfo build_info = { gMinVectorSizeIndex, + test_info.threadCount, + test_info.k, + test_info.programs, + f->name, + f->nameInCode, + relaxedMode }; if( (error = ThreadPool_Do( BuildKernel_DoubleFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) goto exit; } @@ -1164,6 +1192,7 @@ static cl_int TestDouble( cl_uint job_id, cl_uint thread_id, void *data ) float ulps = job->ulps; dptr func = job->f->dfunc; int ftz = job->ftz; + bool relaxedMode = job->relaxedMode; MTdata d = tinfo->d; cl_uint j, k; cl_int error; diff --git a/test_conformance/math_brute_force/binary_i.c b/test_conformance/math_brute_force/binary_i.cpp similarity index 95% rename from test_conformance/math_brute_force/binary_i.c rename to test_conformance/math_brute_force/binary_i.cpp index 314d65dd..6ba0eb58 100644 --- a/test_conformance/math_brute_force/binary_i.c +++ b/test_conformance/math_brute_force/binary_i.cpp @@ -19,18 +19,20 @@ #include #include "FunctionList.h" -int TestFunc_Float_Float_Int(const Func *f, MTdata); -int TestFunc_Double_Double_Int(const Func *f, MTdata); +int TestFunc_Float_Float_Int(const Func *f, MTdata, bool relaxedMode); +int TestFunc_Double_Double_Int(const Func *f, MTdata, bool relaxedMode); -#if defined( __cplusplus) - extern "C" -#endif -const vtbl _binary_i = { "binary_i", TestFunc_Float_Float_Int, TestFunc_Double_Double_Int }; +extern const vtbl _binary_i = { "binary_i", TestFunc_Float_Float_Int, + TestFunc_Double_Double_Int }; -static int BuildKernel( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p ); -static int BuildKernelDouble( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p ); +static int BuildKernel(const char *name, int vectorSize, cl_uint kernel_count, + cl_kernel *k, cl_program *p, bool relaxedMode); +static int BuildKernelDouble(const char *name, int vectorSize, + cl_uint kernel_count, cl_kernel *k, cl_program *p, + bool relaxedMode); -static int BuildKernel( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p ) +static int BuildKernel(const char *name, int vectorSize, cl_uint kernel_count, + cl_kernel *k, cl_program *p, bool relaxedMode) { const char *c[] = { "__kernel void math_kernel", sizeNames[vectorSize], "( __global float", sizeNames[vectorSize], "* out, __global float", sizeNames[vectorSize], "* in1, __global int", sizeNames[vectorSize], "* in2 )\n" "{\n" @@ -91,10 +93,13 @@ static int BuildKernel( const char *name, int vectorSize, cl_uint kernel_count, char testName[32]; snprintf( testName, sizeof( testName ) -1, "math_kernel%s", sizeNames[vectorSize] ); - return MakeKernels(kern, (cl_uint) kernSize, testName, kernel_count, k, p); + return MakeKernels(kern, (cl_uint)kernSize, testName, kernel_count, k, p, + relaxedMode); } -static int BuildKernelDouble( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p ) +static int BuildKernelDouble(const char *name, int vectorSize, + cl_uint kernel_count, cl_kernel *k, cl_program *p, + bool relaxedMode) { const char *c[] = { "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n", "__kernel void math_kernel", sizeNames[vectorSize], "( __global double", sizeNames[vectorSize], "* out, __global double", sizeNames[vectorSize], "* in1, __global int", sizeNames[vectorSize], "* in2 )\n" @@ -157,7 +162,8 @@ static int BuildKernelDouble( const char *name, int vectorSize, cl_uint kernel_c char testName[32]; snprintf( testName, sizeof( testName ) -1, "math_kernel%s", sizeNames[vectorSize] ); - return MakeKernels(kern, (cl_uint) kernSize, testName, kernel_count, k, p); + return MakeKernels(kern, (cl_uint)kernSize, testName, kernel_count, k, p, + relaxedMode); } typedef struct BuildKernelInfo @@ -167,6 +173,7 @@ typedef struct BuildKernelInfo cl_kernel **kernels; cl_program *programs; const char *nameInCode; + bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. }BuildKernelInfo; static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -174,7 +181,8 @@ static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, voi { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernel( info->nameInCode, i, info->kernel_count, info->kernels[i], info->programs + i ); + return BuildKernel(info->nameInCode, i, info->kernel_count, + info->kernels[i], info->programs + i, info->relaxedMode); } static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -182,7 +190,9 @@ static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, vo { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernelDouble( info->nameInCode, i, info->kernel_count, info->kernels[i], info->programs + i ); + return BuildKernelDouble(info->nameInCode, i, info->kernel_count, + info->kernels[i], info->programs + i, + info->relaxedMode); } @@ -241,7 +251,7 @@ typedef struct TestInfo static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *p ); -int TestFunc_Float_Float_Int(const Func *f, MTdata d) +int TestFunc_Float_Float_Int(const Func *f, MTdata d, bool relaxedMode) { TestInfo test_info; cl_int error; @@ -250,7 +260,7 @@ int TestFunc_Float_Float_Int(const Func *f, MTdata d) double maxErrorVal = 0.0; cl_int maxErrorVal2 = 0; - logFunctionInfo(f->name,sizeof(cl_float),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_float), relaxedMode); // Init test_info memset( &test_info, 0, sizeof( test_info ) ); @@ -324,7 +334,7 @@ int TestFunc_Float_Float_Int(const Func *f, MTdata d) goto exit; } } - test_info.tinfo[i].tQueue = clCreateCommandQueueWithProperties(gContext, gDevice, 0, &error); + test_info.tinfo[i].tQueue = clCreateCommandQueue(gContext, gDevice, 0, &error); if( NULL == test_info.tinfo[i].tQueue || error ) { vlog_error( "clCreateCommandQueue failed. (%d)\n", error ); @@ -335,7 +345,10 @@ int TestFunc_Float_Float_Int(const Func *f, MTdata d) // Init the kernels { - BuildKernelInfo build_info = { gMinVectorSizeIndex, test_info.threadCount, test_info.k, test_info.programs, f->nameInCode }; + BuildKernelInfo build_info = { + gMinVectorSizeIndex, test_info.threadCount, test_info.k, + test_info.programs, f->nameInCode, relaxedMode + }; if( (error = ThreadPool_Do( BuildKernel_FloatFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) goto exit; } @@ -681,7 +694,12 @@ static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *data ) } if( fail ) { - vlog_error( "\nERROR: %s%s: %f ulp error at {%a, %d}: *%a vs. %a (0x%8.8x) at index: %d\n", name, sizeNames[k], err, s[j], s2[j], r[j], test, ((cl_uint*)&test)[0], j ); + vlog_error( + "\nERROR: %s%s: %f ulp error at {%a (0x%8.8x), %d}: " + "*%a (0x%8.8x) vs. %a (0x%8.8x) at index: %d\n", + name, sizeNames[k], err, s[j], ((uint32_t *)s)[j], + s2[j], r[j], ((uint32_t *)r)[j], test, + ((cl_uint *)&test)[0], j); error = -1; goto exit; } @@ -747,7 +765,7 @@ static size_t specialValuesInt2Count = sizeof( specialValuesInt ) / sizeof( spec static cl_int TestDouble( cl_uint job_id, cl_uint thread_id, void *p ); -int TestFunc_Double_Double_Int(const Func *f, MTdata d) +int TestFunc_Double_Double_Int(const Func *f, MTdata d, bool relaxedMode) { TestInfo test_info; cl_int error; @@ -756,7 +774,7 @@ int TestFunc_Double_Double_Int(const Func *f, MTdata d) double maxErrorVal = 0.0; cl_int maxErrorVal2 = 0; - logFunctionInfo(f->name,sizeof(cl_double),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_double), relaxedMode); // Init test_info memset( &test_info, 0, sizeof( test_info ) ); @@ -832,7 +850,7 @@ int TestFunc_Double_Double_Int(const Func *f, MTdata d) goto exit; } } - test_info.tinfo[i].tQueue = clCreateCommandQueueWithProperties(gContext, gDevice, 0, &error); + test_info.tinfo[i].tQueue = clCreateCommandQueue(gContext, gDevice, 0, &error); if( NULL == test_info.tinfo[i].tQueue || error ) { vlog_error( "clCreateCommandQueue failed. (%d)\n", error ); @@ -845,7 +863,10 @@ int TestFunc_Double_Double_Int(const Func *f, MTdata d) // Init the kernels { - BuildKernelInfo build_info = { gMinVectorSizeIndex, test_info.threadCount, test_info.k, test_info.programs, f->nameInCode }; + BuildKernelInfo build_info = { + gMinVectorSizeIndex, test_info.threadCount, test_info.k, + test_info.programs, f->nameInCode, relaxedMode + }; if( (error = ThreadPool_Do( BuildKernel_DoubleFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) goto exit; } diff --git a/test_conformance/math_brute_force/binary_two_results_i.c b/test_conformance/math_brute_force/binary_two_results_i.cpp similarity index 96% rename from test_conformance/math_brute_force/binary_two_results_i.c rename to test_conformance/math_brute_force/binary_two_results_i.cpp index b1e80ede..c5577b9e 100644 --- a/test_conformance/math_brute_force/binary_two_results_i.c +++ b/test_conformance/math_brute_force/binary_two_results_i.cpp @@ -21,18 +21,20 @@ #define PARALLEL_REFERENCE -int TestFunc_FloatI_Float_Float(const Func *f, MTdata); -int TestFunc_DoubleI_Double_Double(const Func *f, MTdata); +int TestFunc_FloatI_Float_Float(const Func *f, MTdata, bool relaxedMode); +int TestFunc_DoubleI_Double_Double(const Func *f, MTdata, bool relaxedMode); -#if defined( __cplusplus ) - extern "C" -#endif -const vtbl _binary_two_results_i = { "binary_two_results_i", TestFunc_FloatI_Float_Float, TestFunc_DoubleI_Double_Double }; +extern const vtbl _binary_two_results_i = { "binary_two_results_i", + TestFunc_FloatI_Float_Float, + TestFunc_DoubleI_Double_Double }; -static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_program *p ); -static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl_program *p ); +static int BuildKernel(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode); +static int BuildKernelDouble(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode); -static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_program *p ) +static int BuildKernel(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode) { const char *c[] = { "__kernel void math_kernel", sizeNames[vectorSize], "( __global float", sizeNames[vectorSize], "* out, __global int", sizeNames[vectorSize], "* out2, __global float", sizeNames[vectorSize], "* in1, __global float", sizeNames[vectorSize], "* in2)\n" "{\n" @@ -97,10 +99,11 @@ static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_progr char testName[32]; snprintf( testName, sizeof( testName ) -1, "math_kernel%s", sizeNames[vectorSize] ); - return MakeKernel(kern, (cl_uint) kernSize, testName, k, p); + return MakeKernel(kern, (cl_uint)kernSize, testName, k, p, relaxedMode); } -static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl_program *p ) +static int BuildKernelDouble(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode) { const char *c[] = { "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n", "__kernel void math_kernel", sizeNames[vectorSize], "( __global double", sizeNames[vectorSize], "* out, __global int", sizeNames[vectorSize], "* out2, __global double", sizeNames[vectorSize], "* in1, __global double", sizeNames[vectorSize], "* in2)\n" @@ -167,7 +170,7 @@ static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl char testName[32]; snprintf( testName, sizeof( testName ) -1, "math_kernel%s", sizeNames[vectorSize] ); - return MakeKernel(kern, (cl_uint) kernSize, testName, k, p); + return MakeKernel(kern, (cl_uint)kernSize, testName, k, p, relaxedMode); } typedef struct BuildKernelInfo @@ -176,6 +179,7 @@ typedef struct BuildKernelInfo cl_kernel *kernels; cl_program *programs; const char *nameInCode; + bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. }BuildKernelInfo; static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -183,7 +187,8 @@ static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, voi { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernel( info->nameInCode, i, info->kernels + i, info->programs + i ); + return BuildKernel(info->nameInCode, i, info->kernels + i, + info->programs + i, info->relaxedMode); } static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -191,7 +196,8 @@ static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, vo { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernelDouble( info->nameInCode, i, info->kernels + i, info->programs + i ); + return BuildKernelDouble(info->nameInCode, i, info->kernels + i, + info->programs + i, info->relaxedMode); } #if defined PARALLEL_REFERENCE @@ -267,7 +273,7 @@ ReferenceD(cl_uint jid, cl_uint tid, void *userInfo) #endif -int TestFunc_FloatI_Float_Float(const Func *f, MTdata d) +int TestFunc_FloatI_Float_Float(const Func *f, MTdata d, bool relaxedMode) { uint64_t i; uint32_t j, k; @@ -286,7 +292,7 @@ int TestFunc_FloatI_Float_Float(const Func *f, MTdata d) #if defined PARALLEL_REFERENCE cl_uint threadCount = GetThreadCount(); #endif - logFunctionInfo(f->name,sizeof(cl_float),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_float), relaxedMode); if(gWimpyMode ){ step = (1ULL<<32) * gWimpyReductionFactor / (512); @@ -301,7 +307,8 @@ int TestFunc_FloatI_Float_Float(const Func *f, MTdata d) // Init the kernels { - BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, f->nameInCode }; + BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, + f->nameInCode, relaxedMode }; if( (error = ThreadPool_Do( BuildKernel_FloatFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) return error; } @@ -696,7 +703,7 @@ exit: return error; } -int TestFunc_DoubleI_Double_Double(const Func *f, MTdata d) +int TestFunc_DoubleI_Double_Double(const Func *f, MTdata d, bool relaxedMode) { uint64_t i; uint32_t j, k; @@ -711,7 +718,7 @@ int TestFunc_DoubleI_Double_Double(const Func *f, MTdata d) size_t bufferSize = (gWimpyMode)? gWimpyBufferSize: BUFFER_SIZE; uint64_t step = bufferSize / sizeof( double ); - logFunctionInfo(f->name,sizeof(cl_double),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_double), relaxedMode); if(gWimpyMode ){ step = (1ULL<<32) * gWimpyReductionFactor / (512); } @@ -726,7 +733,8 @@ int TestFunc_DoubleI_Double_Double(const Func *f, MTdata d) // Init the kernels { - BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, f->nameInCode }; + BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, + f->nameInCode, relaxedMode }; if( (error = ThreadPool_Do( BuildKernel_DoubleFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) diff --git a/test_conformance/math_brute_force/i_unary.c b/test_conformance/math_brute_force/i_unary.cpp similarity index 93% rename from test_conformance/math_brute_force/i_unary.c rename to test_conformance/math_brute_force/i_unary.cpp index e41d5d82..379d8e35 100644 --- a/test_conformance/math_brute_force/i_unary.c +++ b/test_conformance/math_brute_force/i_unary.cpp @@ -18,19 +18,20 @@ #include #include "FunctionList.h" -int TestFunc_Int_Float(const Func *f, MTdata); -int TestFunc_Int_Double(const Func *f, MTdata); +int TestFunc_Int_Float(const Func *f, MTdata, bool relaxedMode); +int TestFunc_Int_Double(const Func *f, MTdata, bool relaxedMode); -#if defined( __cplusplus) - extern "C" -#endif -const vtbl _i_unary = { "i_unary", TestFunc_Int_Float, TestFunc_Int_Double }; +extern const vtbl _i_unary = { "i_unary", TestFunc_Int_Float, + TestFunc_Int_Double }; -static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_program *p ); -static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl_program *p ); +static int BuildKernel(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode); +static int BuildKernelDouble(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode); -static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_program *p ) +static int BuildKernel(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode) { const char *c[] = { "__kernel void math_kernel", sizeNames[vectorSize], "( __global int", sizeNames[vectorSize], "* out, __global float", sizeNames[vectorSize], "* in)\n" "{\n" @@ -87,10 +88,11 @@ static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_progr char testName[32]; snprintf( testName, sizeof( testName ) -1, "math_kernel%s", sizeNames[vectorSize] ); - return MakeKernel(kern, (cl_uint) kernSize, testName, k, p); + return MakeKernel(kern, (cl_uint)kernSize, testName, k, p, relaxedMode); } -static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl_program *p ) +static int BuildKernelDouble(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode) { const char *c[] = { "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n", "__kernel void math_kernel", sizeNames[vectorSize], "( __global int", sizeNames[vectorSize], "* out, __global double", sizeNames[vectorSize], "* in)\n" @@ -150,7 +152,7 @@ static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl char testName[32]; snprintf( testName, sizeof( testName ) -1, "math_kernel%s", sizeNames[vectorSize] ); - return MakeKernel(kern, (cl_uint) kernSize, testName, k, p); + return MakeKernel(kern, (cl_uint)kernSize, testName, k, p, relaxedMode); } typedef struct BuildKernelInfo @@ -159,6 +161,7 @@ typedef struct BuildKernelInfo cl_kernel *kernels; cl_program *programs; const char *nameInCode; + bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. }BuildKernelInfo; static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -166,7 +169,8 @@ static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, voi { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernel( info->nameInCode, i, info->kernels + i, info->programs + i ); + return BuildKernel(info->nameInCode, i, info->kernels + i, + info->programs + i, info->relaxedMode); } static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -174,10 +178,11 @@ static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, vo { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernelDouble( info->nameInCode, i, info->kernels + i, info->programs + i ); + return BuildKernelDouble(info->nameInCode, i, info->kernels + i, + info->programs + i, info->relaxedMode); } -int TestFunc_Int_Float(const Func *f, MTdata d) +int TestFunc_Int_Float(const Func *f, MTdata d, bool relaxedMode) { uint64_t i; uint32_t j, k; @@ -189,7 +194,7 @@ int TestFunc_Int_Float(const Func *f, MTdata d) uint64_t step = bufferSize / sizeof( float ); int scale = (int)((1ULL<<32) / (16 * bufferSize / sizeof( float )) + 1); - logFunctionInfo(f->name,sizeof(cl_float),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_float), relaxedMode); if( gWimpyMode ) { step = (1ULL<<32) * gWimpyReductionFactor / (512); @@ -203,7 +208,8 @@ int TestFunc_Int_Float(const Func *f, MTdata d) Force64BitFPUPrecision(); // Init the kernels - BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, f->nameInCode }; + BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, + f->nameInCode, relaxedMode }; if( (error = ThreadPool_Do( BuildKernel_FloatFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) return error; /* @@ -397,7 +403,7 @@ exit: return error; } -int TestFunc_Int_Double(const Func *f, MTdata d) +int TestFunc_Int_Double(const Func *f, MTdata d, bool relaxedMode) { uint64_t i; uint32_t j, k; @@ -409,7 +415,7 @@ int TestFunc_Int_Double(const Func *f, MTdata d) uint64_t step = bufferSize / sizeof( cl_double ); int scale = (int)((1ULL<<32) / (16 * bufferSize / sizeof( cl_double )) + 1); - logFunctionInfo(f->name,sizeof(cl_double),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_double), relaxedMode); if( gWimpyMode ) { step = (1ULL<<32) * gWimpyReductionFactor / (512); @@ -422,7 +428,8 @@ int TestFunc_Int_Double(const Func *f, MTdata d) Force64BitFPUPrecision(); // Init the kernels - BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, f->nameInCode }; + BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, + f->nameInCode, relaxedMode }; if( (error = ThreadPool_Do( BuildKernel_DoubleFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) @@ -625,5 +632,3 @@ exit: return error; } - - diff --git a/test_conformance/math_brute_force/macro_binary.c b/test_conformance/math_brute_force/macro_binary.cpp similarity index 95% rename from test_conformance/math_brute_force/macro_binary.c rename to test_conformance/math_brute_force/macro_binary.cpp index b65948ee..b590f50a 100644 --- a/test_conformance/math_brute_force/macro_binary.c +++ b/test_conformance/math_brute_force/macro_binary.cpp @@ -18,18 +18,19 @@ #include #include "FunctionList.h" -int TestMacro_Int_Float_Float(const Func *f, MTdata); -int TestMacro_Int_Double_Double(const Func *f, MTdata); +int TestMacro_Int_Float_Float(const Func *f, MTdata, bool relaxedMode); +int TestMacro_Int_Double_Double(const Func *f, MTdata, bool relaxedMode); -#if defined( __cplusplus) -extern "C" -#endif -const vtbl _macro_binary = { "macro_binary", TestMacro_Int_Float_Float, TestMacro_Int_Double_Double }; +extern const vtbl _macro_binary = { "macro_binary", TestMacro_Int_Float_Float, + TestMacro_Int_Double_Double }; static int BuildKernel( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p ); -static int BuildKernelDouble( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p ); +static int BuildKernelDouble(const char *name, int vectorSize, + cl_uint kernel_count, cl_kernel *k, cl_program *p, + bool relaxedMode); -static int BuildKernel( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p ) +static int BuildKernel(const char *name, int vectorSize, cl_uint kernel_count, + cl_kernel *k, cl_program *p, bool relaxedMode) { const char *c[] = { "__kernel void math_kernel", sizeNames[vectorSize], "( __global int", sizeNames[vectorSize], "* out, __global float", sizeNames[vectorSize], "* in1, __global float", sizeNames[vectorSize], "* in2 )\n" "{\n" @@ -90,10 +91,14 @@ static int BuildKernel( const char *name, int vectorSize, cl_uint kernel_count, char testName[32]; snprintf( testName, sizeof( testName ) -1, "math_kernel%s", sizeNames[vectorSize] ); - return MakeKernels(kern, (cl_uint) kernSize, testName, kernel_count, k, p); } + return MakeKernels(kern, (cl_uint)kernSize, testName, kernel_count, k, p, + relaxedMode); +} -static int BuildKernelDouble( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p ) +static int BuildKernelDouble(const char *name, int vectorSize, + cl_uint kernel_count, cl_kernel *k, cl_program *p, + bool relaxedMode) { const char *c[] = { "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n", "__kernel void math_kernel", sizeNames[vectorSize], "( __global long", sizeNames[vectorSize], "* out, __global double", sizeNames[vectorSize], "* in1, __global double", sizeNames[vectorSize], "* in2 )\n" @@ -156,7 +161,8 @@ static int BuildKernelDouble( const char *name, int vectorSize, cl_uint kernel_c char testName[32]; snprintf( testName, sizeof( testName ) -1, "math_kernel%s", sizeNames[vectorSize] ); - return MakeKernels(kern, (cl_uint) kernSize, testName, kernel_count, k, p); + return MakeKernels(kern, (cl_uint)kernSize, testName, kernel_count, k, p, + relaxedMode); } typedef struct BuildKernelInfo @@ -166,6 +172,7 @@ typedef struct BuildKernelInfo cl_kernel **kernels; cl_program *programs; const char *nameInCode; + bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. }BuildKernelInfo; static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -173,7 +180,8 @@ static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, voi { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernel( info->nameInCode, i, info->kernel_count, info->kernels[i], info->programs + i ); + return BuildKernel(info->nameInCode, i, info->kernel_count, + info->kernels[i], info->programs + i, info->relaxedMode); } static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -181,7 +189,9 @@ static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, vo { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernelDouble( info->nameInCode, i, info->kernel_count, info->kernels[i], info->programs + i ); + return BuildKernelDouble(info->nameInCode, i, info->kernel_count, + info->kernels[i], info->programs + i, + info->relaxedMode); } @@ -231,13 +241,13 @@ typedef struct TestInfo static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *p ); -int TestMacro_Int_Float_Float(const Func *f, MTdata d) +int TestMacro_Int_Float_Float(const Func *f, MTdata d, bool relaxedMode) { TestInfo test_info; cl_int error; size_t i, j; - logFunctionInfo(f->name,sizeof(cl_float),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_float), relaxedMode); // Init test_info memset( &test_info, 0, sizeof( test_info ) ); @@ -309,7 +319,7 @@ int TestMacro_Int_Float_Float(const Func *f, MTdata d) goto exit; } } - test_info.tinfo[i].tQueue = clCreateCommandQueueWithProperties(gContext, gDevice, 0, &error); + test_info.tinfo[i].tQueue = clCreateCommandQueue(gContext, gDevice, 0, &error); if( NULL == test_info.tinfo[i].tQueue || error ) { vlog_error( "clCreateCommandQueue failed. (%d)\n", error ); @@ -321,7 +331,10 @@ int TestMacro_Int_Float_Float(const Func *f, MTdata d) // Init the kernels { - BuildKernelInfo build_info = { gMinVectorSizeIndex, test_info.threadCount, test_info.k, test_info.programs, f->nameInCode }; + BuildKernelInfo build_info = { + gMinVectorSizeIndex, test_info.threadCount, test_info.k, + test_info.programs, f->nameInCode, relaxedMode + }; if( (error = ThreadPool_Do( BuildKernel_FloatFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) goto exit; } @@ -740,13 +753,13 @@ static size_t specialValuesDoubleCount = sizeof( specialValuesDouble ) / sizeof( static cl_int TestDouble( cl_uint job_id, cl_uint thread_id, void *p ); -int TestMacro_Int_Double_Double(const Func *f, MTdata d) +int TestMacro_Int_Double_Double(const Func *f, MTdata d, bool relaxedMode) { TestInfo test_info; cl_int error; size_t i, j; - logFunctionInfo(f->name,sizeof(cl_double),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_double), relaxedMode); // Init test_info memset( &test_info, 0, sizeof( test_info ) ); @@ -821,7 +834,7 @@ int TestMacro_Int_Double_Double(const Func *f, MTdata d) goto exit; } } - test_info.tinfo[i].tQueue = clCreateCommandQueueWithProperties(gContext, gDevice, 0, &error); + test_info.tinfo[i].tQueue = clCreateCommandQueue(gContext, gDevice, 0, &error); if( NULL == test_info.tinfo[i].tQueue || error ) { vlog_error( "clCreateCommandQueue failed. (%d)\n", error ); @@ -834,7 +847,10 @@ int TestMacro_Int_Double_Double(const Func *f, MTdata d) // Init the kernels { - BuildKernelInfo build_info = { gMinVectorSizeIndex, test_info.threadCount, test_info.k, test_info.programs, f->nameInCode }; + BuildKernelInfo build_info = { + gMinVectorSizeIndex, test_info.threadCount, test_info.k, + test_info.programs, f->nameInCode, relaxedMode + }; if( (error = ThreadPool_Do( BuildKernel_DoubleFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) goto exit; } diff --git a/test_conformance/math_brute_force/macro_unary.c b/test_conformance/math_brute_force/macro_unary.cpp similarity index 93% rename from test_conformance/math_brute_force/macro_unary.c rename to test_conformance/math_brute_force/macro_unary.cpp index 95af882a..872007f1 100644 --- a/test_conformance/math_brute_force/macro_unary.c +++ b/test_conformance/math_brute_force/macro_unary.cpp @@ -18,18 +18,20 @@ #include #include "FunctionList.h" -int TestMacro_Int_Float(const Func *f, MTdata); -int TestMacro_Int_Double(const Func *f, MTdata); +int TestMacro_Int_Float(const Func *f, MTdata, bool relaxedMode); +int TestMacro_Int_Double(const Func *f, MTdata, bool relaxedMode); -#if defined( __cplusplus) - extern "C" -#endif -const vtbl _macro_unary = { "macro_unary", TestMacro_Int_Float, TestMacro_Int_Double }; +extern const vtbl _macro_unary = { "macro_unary", TestMacro_Int_Float, + TestMacro_Int_Double }; -static int BuildKernel( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p ); -static int BuildKernelDouble( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p ); +static int BuildKernel(const char *name, int vectorSize, cl_uint kernel_count, + cl_kernel *k, cl_program *p, bool relaxedMode); +static int BuildKernelDouble(const char *name, int vectorSize, + cl_uint kernel_count, cl_kernel *k, cl_program *p, + bool relaxedMode); -static int BuildKernel( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p ) +static int BuildKernel(const char *name, int vectorSize, cl_uint kernel_count, + cl_kernel *k, cl_program *p, bool relaxedMode) { const char *c[] = { "__kernel void math_kernel", sizeNames[vectorSize], "( __global int", sizeNames[vectorSize], "* out, __global float", sizeNames[vectorSize], "* in)\n" "{\n" @@ -86,10 +88,13 @@ static int BuildKernel( const char *name, int vectorSize, cl_uint kernel_count, char testName[32]; snprintf( testName, sizeof( testName ) -1, "math_kernel%s", sizeNames[vectorSize] ); - return MakeKernels(kern, (cl_uint) kernSize, testName, kernel_count, k, p); + return MakeKernels(kern, (cl_uint)kernSize, testName, kernel_count, k, p, + relaxedMode); } -static int BuildKernelDouble( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p ) +static int BuildKernelDouble(const char *name, int vectorSize, + cl_uint kernel_count, cl_kernel *k, cl_program *p, + bool relaxedMode) { const char *c[] = { "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n", "__kernel void math_kernel", sizeNames[vectorSize], "( __global long", sizeNames[vectorSize], "* out, __global double", sizeNames[vectorSize], "* in)\n" @@ -149,7 +154,8 @@ static int BuildKernelDouble( const char *name, int vectorSize, cl_uint kernel_c char testName[32]; snprintf( testName, sizeof( testName ) -1, "math_kernel%s", sizeNames[vectorSize] ); - return MakeKernels(kern, (cl_uint) kernSize, testName, kernel_count, k, p); + return MakeKernels(kern, (cl_uint)kernSize, testName, kernel_count, k, p, + relaxedMode); } typedef struct BuildKernelInfo @@ -159,6 +165,7 @@ typedef struct BuildKernelInfo cl_kernel **kernels; cl_program *programs; const char *nameInCode; + bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. }BuildKernelInfo; static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -166,7 +173,8 @@ static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, voi { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernel( info->nameInCode, i, info->kernel_count, info->kernels[i], info->programs + i ); + return BuildKernel(info->nameInCode, i, info->kernel_count, + info->kernels[i], info->programs + i, info->relaxedMode); } static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -174,7 +182,9 @@ static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, vo { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernelDouble( info->nameInCode, i, info->kernel_count, info->kernels[i], info->programs + i ); + return BuildKernelDouble(info->nameInCode, i, info->kernel_count, + info->kernels[i], info->programs + i, + info->relaxedMode); } //Thread specific data for a worker thread @@ -202,13 +212,13 @@ typedef struct TestInfo static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *p ); -int TestMacro_Int_Float(const Func *f, MTdata d) +int TestMacro_Int_Float(const Func *f, MTdata d, bool relaxedMode) { TestInfo test_info; cl_int error; size_t i, j; - logFunctionInfo(f->name,sizeof(cl_float),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_float), relaxedMode); // Init test_info memset( &test_info, 0, sizeof( test_info ) ); @@ -273,7 +283,7 @@ int TestMacro_Int_Float(const Func *f, MTdata d) goto exit; } } - test_info.tinfo[i].tQueue = clCreateCommandQueueWithProperties(gContext, gDevice, 0, &error); + test_info.tinfo[i].tQueue = clCreateCommandQueue(gContext, gDevice, 0, &error); if( NULL == test_info.tinfo[i].tQueue || error ) { vlog_error( "clCreateCommandQueue failed. (%d)\n", error ); @@ -283,7 +293,10 @@ int TestMacro_Int_Float(const Func *f, MTdata d) // Init the kernels { - BuildKernelInfo build_info = { gMinVectorSizeIndex, test_info.threadCount, test_info.k, test_info.programs, f->nameInCode }; + BuildKernelInfo build_info = { + gMinVectorSizeIndex, test_info.threadCount, test_info.k, + test_info.programs, f->nameInCode, relaxedMode + }; if( (error = ThreadPool_Do( BuildKernel_FloatFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) goto exit; } @@ -396,6 +409,7 @@ static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *data ) int ftz = job->ftz; cl_uint j, k; cl_int error = CL_SUCCESS; + cl_int ret = CL_SUCCESS; const char *name = job->f->name; int signbit_test = 0; @@ -564,6 +578,7 @@ static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *data ) } exit: + ret = error; for( j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++ ) { if( (error = clEnqueueUnmapMemObject( tinfo->tQueue, tinfo->outBuf[j], out[j], 0, NULL, NULL)) ) @@ -574,7 +589,10 @@ exit: } if( (error = clFlush(tinfo->tQueue) )) + { vlog( "clFlush 3 failed\n" ); + return error; + } if( 0 == ( base & 0x0fffffff) ) @@ -589,18 +607,18 @@ exit: fflush(stdout); } - return error; + return ret; } static cl_int TestDouble( cl_uint job_id, cl_uint thread_id, void *data ); -int TestMacro_Int_Double(const Func *f, MTdata d) +int TestMacro_Int_Double(const Func *f, MTdata d, bool relaxedMode) { TestInfo test_info; cl_int error; size_t i, j; - logFunctionInfo(f->name,sizeof(cl_double),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_double), relaxedMode); // Init test_info memset( &test_info, 0, sizeof( test_info ) ); test_info.threadCount = GetThreadCount(); @@ -668,7 +686,7 @@ int TestMacro_Int_Double(const Func *f, MTdata d) goto exit; } } - test_info.tinfo[i].tQueue = clCreateCommandQueueWithProperties(gContext, gDevice, 0, &error); + test_info.tinfo[i].tQueue = clCreateCommandQueue(gContext, gDevice, 0, &error); if( NULL == test_info.tinfo[i].tQueue || error ) { vlog_error( "clCreateCommandQueue failed. (%d)\n", error ); @@ -678,7 +696,10 @@ int TestMacro_Int_Double(const Func *f, MTdata d) // Init the kernels { - BuildKernelInfo build_info = { gMinVectorSizeIndex, test_info.threadCount, test_info.k, test_info.programs, f->nameInCode }; + BuildKernelInfo build_info = { + gMinVectorSizeIndex, test_info.threadCount, test_info.k, + test_info.programs, f->nameInCode, relaxedMode + }; if( (error = ThreadPool_Do( BuildKernel_DoubleFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) goto exit; } diff --git a/test_conformance/math_brute_force/mad.c b/test_conformance/math_brute_force/mad.cpp similarity index 97% rename from test_conformance/math_brute_force/mad.c rename to test_conformance/math_brute_force/mad.cpp index 652ab360..0737afbc 100644 --- a/test_conformance/math_brute_force/mad.c +++ b/test_conformance/math_brute_force/mad.cpp @@ -18,18 +18,18 @@ #include #include "FunctionList.h" -int TestFunc_mad(const Func *f, MTdata); -int TestFunc_mad_Double(const Func *f, MTdata); +int TestFunc_mad(const Func *f, MTdata, bool relaxedMode); +int TestFunc_mad_Double(const Func *f, MTdata, bool relaxedMode); -#if defined( __cplusplus) - extern "C" -#endif -const vtbl _mad_tbl = { "ternary", TestFunc_mad, TestFunc_mad_Double }; +extern const vtbl _mad_tbl = { "ternary", TestFunc_mad, TestFunc_mad_Double }; -static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_program *p ); -static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl_program *p ); +static int BuildKernel(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode); +static int BuildKernelDouble(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode); -static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_program *p ) +static int BuildKernel(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode) { const char *c[] = { "__kernel void math_kernel", sizeNames[vectorSize], "( __global float", sizeNames[vectorSize], "* out, __global float", sizeNames[vectorSize], "* in1, __global float", sizeNames[vectorSize], "* in2, __global float", sizeNames[vectorSize], "* in3 )\n" @@ -92,10 +92,11 @@ static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_progr char testName[32]; snprintf( testName, sizeof( testName ) -1, "math_kernel%s", sizeNames[vectorSize] ); - return MakeKernel(kern, (cl_uint) kernSize, testName, k, p); + return MakeKernel(kern, (cl_uint)kernSize, testName, k, p, relaxedMode); } -static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl_program *p ) +static int BuildKernelDouble(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode) { const char *c[] = { "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n", @@ -160,7 +161,7 @@ static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl char testName[32]; snprintf( testName, sizeof( testName ) -1, "math_kernel%s", sizeNames[vectorSize] ); - return MakeKernel(kern, (cl_uint) kernSize, testName, k, p); + return MakeKernel(kern, (cl_uint)kernSize, testName, k, p, relaxedMode); } typedef struct BuildKernelInfo @@ -169,6 +170,7 @@ typedef struct BuildKernelInfo cl_kernel *kernels; cl_program *programs; const char *nameInCode; + bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. }BuildKernelInfo; static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -176,7 +178,8 @@ static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, voi { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernel( info->nameInCode, i, info->kernels + i, info->programs + i ); + return BuildKernel(info->nameInCode, i, info->kernels + i, + info->programs + i, info->relaxedMode); } static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -184,16 +187,17 @@ static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, vo { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernelDouble( info->nameInCode, i, info->kernels + i, info->programs + i ); + return BuildKernelDouble(info->nameInCode, i, info->kernels + i, + info->programs + i, info->relaxedMode); } -int TestFunc_mad(const Func *f, MTdata d) +int TestFunc_mad(const Func *f, MTdata d, bool relaxedMode) { uint64_t i; uint32_t j, k; int error; - logFunctionInfo(f->name,sizeof(cl_float),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_float), relaxedMode); cl_program programs[ VECTOR_SIZE_COUNT ]; cl_kernel kernels[ VECTOR_SIZE_COUNT ]; @@ -210,7 +214,8 @@ int TestFunc_mad(const Func *f, MTdata d) step = (1ULL<<32) * gWimpyReductionFactor / (512); } // Init the kernels - BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, f->nameInCode }; + BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, + f->nameInCode, relaxedMode }; if( (error = ThreadPool_Do( BuildKernel_FloatFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) return error; /* @@ -655,7 +660,7 @@ exit: return error; } -int TestFunc_mad_Double(const Func *f, MTdata d) +int TestFunc_mad_Double(const Func *f, MTdata d, bool relaxedMode) { uint64_t i; uint32_t j, k; @@ -669,14 +674,15 @@ int TestFunc_mad_Double(const Func *f, MTdata d) double maxErrorVal3 = 0.0f; size_t bufferSize = (gWimpyMode)? gWimpyBufferSize: BUFFER_SIZE; - logFunctionInfo(f->name,sizeof(cl_double),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_double), relaxedMode); uint64_t step = bufferSize / sizeof( double ); if( gWimpyMode ) { step = (1ULL<<32) * gWimpyReductionFactor / (512); } // Init the kernels - BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, f->nameInCode }; + BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, + f->nameInCode, relaxedMode }; if( (error = ThreadPool_Do( BuildKernel_DoubleFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) diff --git a/test_conformance/math_brute_force/main.c b/test_conformance/math_brute_force/main.cpp similarity index 78% rename from test_conformance/math_brute_force/main.c rename to test_conformance/math_brute_force/main.cpp index 09867e37..142ac64c 100644 --- a/test_conformance/math_brute_force/main.c +++ b/test_conformance/math_brute_force/main.cpp @@ -15,14 +15,16 @@ // #include "Utility.h" -#include -#include - -#include +#include +#include +#include #include #include "FunctionList.h" #include "Sleep.h" -#include "../../test_common/harness/parseParameters.h" + +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" +#include "harness/parseParameters.h" #if defined( __APPLE__ ) #include @@ -40,7 +42,7 @@ #include #endif -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" #define kPageSize 4096 #define DOUBLE_REQUIRED_FEATURES ( CL_FP_FMA | CL_FP_ROUND_TO_NEAREST | CL_FP_ROUND_TO_ZERO | CL_FP_ROUND_TO_INF | CL_FP_INF_NAN | CL_FP_DENORM ) @@ -51,8 +53,6 @@ char appName[ MAXPATHLEN ] = ""; cl_device_id gDevice = NULL; cl_context gContext = NULL; cl_command_queue gQueue = NULL; -int gTestCount = 0; -int gFailCount = 0; static int32_t gStartTestNumber; static int32_t gEndTestNumber; int gSkipCorrectnessTesting = 0; @@ -68,8 +68,9 @@ int gForceFTZ = 0; int gWimpyMode = 0; int gHasDouble = 0; int gTestFloat = 1; -//This flag should be 'ON' by default and it can be changed through the command line arguments. -volatile int gTestFastRelaxed = 1; +// This flag should be 'ON' by default and it can be changed through the command +// line arguments. +static int gTestFastRelaxed = 1; /*This flag corresponds to defining if the implementation has Derived Fast Relaxed functions. The spec does not specify ULP for derived function. The derived functions are composed of base functions which are tested for ULP, thus when this flag is enabled, Derived functions will not be tested for ULP, as per table 7.1 of OpenCL 2.0 spec. @@ -105,27 +106,8 @@ cl_device_fp_config gDoubleCapabilities = 0; int gWimpyReductionFactor = 32; int gWimpyBufferSize = BUFFER_SIZE; int gVerboseBruteForce = 0; -#if defined( __APPLE__ ) -int gHasBasicDouble = 0; -char* gBasicDoubleFuncs[] = { - "add", - "assignment", - "divide", - "isequal", - "isgreater", - "isgreaterequal", - "isless", - "islessequal", - "isnotequal", - "multiply", - "sqrt", - "subtract" }; -size_t gNumBasicDoubleFuncs = sizeof(gBasicDoubleFuncs)/sizeof(char*); -#endif - static int ParseArgs( int argc, const char **argv ); -static void PrintArch( void ); static void PrintUsage( void ); static void PrintFunctions( void ); test_status InitCL( cl_device_id device ); @@ -133,7 +115,6 @@ static void ReleaseCL( void ); static int InitILogbConstants( void ); static int IsTininessDetectedBeforeRounding( void ); static int IsInRTZMode( void ); //expensive. Please check gIsInRTZMode global instead. -static void TestFinishAtExit(void); int doTest( const char* name ) @@ -193,107 +174,67 @@ int doTest( const char* name ) InitILogbConstants(); } - if ( gTestFastRelaxed ) + if (gTestFastRelaxed && func_data->relaxed) { - if( func_data->relaxed ) + if (get_device_cl_version(gDevice) > Version(1, 2)) { gTestCount++; - vlog( "%3d: ", gTestCount ); - if( func_data->vtbl_ptr->TestFunc( func_data, gMTdata ) ) + vlog("%3d: ", gTestCount); + // Test with relaxed requirements here. + if (func_data->vtbl_ptr->TestFunc(func_data, gMTdata, + true /* relaxed mode */)) { gFailCount++; error++; - if( gStopOnError ) + if (gStopOnError) { gSkipRestOfTests = true; return error; } } } + else + { + vlog("Skipping reduced precision testing for device with " + "version 1.2 or less\n"); + } } if( gTestFloat ) { - int testFastRelaxedTmp = gTestFastRelaxed; - gTestFastRelaxed = 0; - gTestCount++; vlog( "%3d: ", gTestCount ); - if( func_data->vtbl_ptr->TestFunc( func_data, gMTdata ) ) + // Don't test with relaxed requirements. + if (func_data->vtbl_ptr->TestFunc(func_data, gMTdata, + false /* relaxed mode */)) { gFailCount++; error++; if( gStopOnError ) { - gTestFastRelaxed = testFastRelaxedTmp; gSkipRestOfTests = true; return error; } } - gTestFastRelaxed = testFastRelaxedTmp; } if( gHasDouble && NULL != func_data->vtbl_ptr->DoubleTestFunc && NULL != func_data->dfunc.p ) { - //Disable fast-relaxed-math for double precision floating-point - int testFastRelaxedTmp = gTestFastRelaxed; - gTestFastRelaxed = 0; - gTestCount++; vlog( "%3d: ", gTestCount ); - if( func_data->vtbl_ptr->DoubleTestFunc( func_data, gMTdata ) ) + // Don't test with relaxed requirements. + if (func_data->vtbl_ptr->DoubleTestFunc(func_data, gMTdata, + false /* relaxed mode*/)) { gFailCount++; error++; if( gStopOnError ) { - gTestFastRelaxed = testFastRelaxedTmp; gSkipRestOfTests = true; return error; } } - - //Re-enable testing fast-relaxed-math mode - gTestFastRelaxed = testFastRelaxedTmp; } - -#if defined( __APPLE__ ) - { - if( gHasBasicDouble && NULL != func_data->vtbl_ptr->DoubleTestFunc && NULL != func_data->dfunc.p) - { - //Disable fast-relaxed-math for double precision floating-point - int testFastRelaxedTmp = gTestFastRelaxed; - gTestFastRelaxed = 0; - - int isBasicTest = 0; - for( size_t j = 0; j < gNumBasicDoubleFuncs; j++ ) { - if( 0 == strcmp(gBasicDoubleFuncs[j], func_data->name ) ) { - isBasicTest = 1; - break; - } - } - if (isBasicTest) { - gTestCount++; - if( gTestFloat ) - vlog( " " ); - if( func_data->vtbl_ptr->DoubleTestFunc( func_data, gMTdata ) ) - { - gFailCount++; - error++; - if( gStopOnError ) - { - gTestFastRelaxed = testFastRelaxedTmp; - gSkipRestOfTests = true; - return error; - } - } - } - - //Re-enable testing fast-relaxed-math mode - gTestFastRelaxed = testFastRelaxedTmp; - } - } -#endif } return error; @@ -816,7 +757,6 @@ int main (int argc, const char * argv[]) { return -1; } - atexit(TestFinishAtExit); #if defined( __APPLE__ ) struct timeval startTime; @@ -869,30 +809,17 @@ int main (int argc, const char * argv[]) FPU_mode_type oldMode; DisableFTZ( &oldMode ); - int ret = runTestHarnessWithCheck( gTestNameCount, gTestNames, test_num, test_list, false, true, 0, InitCL ); + int ret = runTestHarnessWithCheck( gTestNameCount, gTestNames, test_num, test_list, true, 0, InitCL ); RestoreFPState( &oldMode ); free_mtdata(gMTdata); free(gTestNames); - int error_code = clFinish(gQueue); - if (error_code) - vlog_error("clFinish failed:%d\n", error_code); - - if (gFailCount == 0) + if (gQueue) { - if (gTestCount > 1) - vlog("PASSED %d of %d sub-tests.\n", gTestCount, gTestCount); - else - vlog("PASSED sub-test.\n"); - } - else if (gFailCount > 0) - { - if (gTestCount > 1) - vlog_error("FAILED %d of %d sub-tests.\n", gFailCount, gTestCount); - else - vlog_error("FAILED sub-test.\n"); + int error_code = clFinish(gQueue); + if (error_code) vlog_error("clFinish failed:%d\n", error_code); } ReleaseCL(); @@ -1099,40 +1026,6 @@ static int ParseArgs( int argc, const char **argv ) gWimpyMode = 1; } -#if defined( __APPLE__ ) - #if defined( __i386__ ) || defined( __x86_64__ ) - #define kHasSSE3 0x00000008 - #define kHasSupplementalSSE3 0x00000100 - #define kHasSSE4_1 0x00000400 - #define kHasSSE4_2 0x00000800 - /* check our environment for a hint to disable SSE variants */ - { - const char *env = getenv( "CL_MAX_SSE" ); - if( env ) - { - extern int _cpu_capabilities; - int mask = 0; - if( 0 == strcasecmp( env, "SSE4.1" ) ) - mask = kHasSSE4_2; - else if( 0 == strcasecmp( env, "SSSE3" ) ) - mask = kHasSSE4_2 | kHasSSE4_1; - else if( 0 == strcasecmp( env, "SSE3" ) ) - mask = kHasSSE4_2 | kHasSSE4_1 | kHasSupplementalSSE3; - else if( 0 == strcasecmp( env, "SSE2" ) ) - mask = kHasSSE4_2 | kHasSSE4_1 | kHasSupplementalSSE3 | kHasSSE3; - else - { - vlog_error( "Error: Unknown CL_MAX_SSE setting: %s\n", env ); - return -2; - } - - vlog( "*** Environment: CL_MAX_SSE = %s ***\n", env ); - _cpu_capabilities &= ~mask; - } - } - #endif -#endif /* __APPLE__ */ - vlog( "\nTest binary built %s %s\n", __DATE__, __TIME__ ); PrintArch(); @@ -1151,63 +1044,6 @@ static int ParseArgs( int argc, const char **argv ) return 0; } -static void PrintArch( void ) -{ - vlog( "\nHost info:\n" ); - vlog( "\tsizeof( void*) = %zd\n", sizeof( void *) ); - #if defined( __ppc__ ) - vlog( "\tARCH:\tppc\n" ); - #elif defined( __ppc64__ ) - vlog( "\tARCH:\tppc64\n" ); - #elif defined( __PPC__ ) - vlog( "ARCH:\tppc\n" ); - #elif defined( __i386__ ) - vlog( "\tARCH:\ti386\n" ); - #elif defined( __x86_64__ ) - vlog( "\tARCH:\tx86_64\n" ); - #elif defined( __arm__ ) - vlog( "\tARCH:\tarm\n" ); - #elif defined( __aarch64__ ) - vlog( "\tARCH:\taarch64\n"); - #else - vlog( "\tARCH:\tunknown\n" ); - #endif - -#if defined( __APPLE__ ) - int type = 0; - size_t typeSize = sizeof( type ); - sysctlbyname( "hw.cputype", &type, &typeSize, NULL, 0 ); - vlog( "\tcpu type:\t%d\n", type ); - typeSize = sizeof( type ); - sysctlbyname( "hw.cpusubtype", &type, &typeSize, NULL, 0 ); - vlog( "\tcpu subtype:\t%d\n", type ); - -#elif defined( __linux__ ) && !defined(__aarch64__) - int _sysctl(struct __sysctl_args *args ); - #define OSNAMESZ 100 - - struct __sysctl_args args; - char osname[OSNAMESZ]; - size_t osnamelth; - int name[] = { CTL_KERN, KERN_OSTYPE }; - memset(&args, 0, sizeof(struct __sysctl_args)); - args.name = name; - args.nlen = sizeof(name)/sizeof(name[0]); - args.oldval = osname; - args.oldlenp = &osnamelth; - - osnamelth = sizeof(osname); - - if (syscall(SYS__sysctl, &args) == -1) { - vlog( "_sysctl error\n" ); - } - else { - vlog("this machine is running %*s\n", osnamelth, osname); - } - - -#endif -} static void PrintFunctions ( void ) { @@ -1254,42 +1090,6 @@ static void CL_CALLBACK bruteforce_notify_callback(const char *errinfo, const vo vlog( "%s (%p, %zd, %p)\n", errinfo, private_info, cb, user_data ); } -static void * align_malloc(size_t size, size_t alignment) -{ -#if defined(_WIN32) && defined(_MSC_VER) - return _aligned_malloc(size, alignment); -#elif defined(__linux__) || defined (linux) || defined(__APPLE__) - void * ptr = NULL; -#if defined(__ANDROID__) - ptr = memalign(alignment, size); - if( ptr ) - return ptr; -#else - if (0 == posix_memalign(&ptr, alignment, size)) - return ptr; -#endif - return NULL; -#elif defined(__MINGW32__) - return __mingw_aligned_malloc(size, alignment); -#else -#error "Please add support OS for aligned malloc" -#endif -} - -void align_free(void * ptr) -{ -#if defined(_WIN32) && defined(_MSC_VER) - _aligned_free(ptr); -#elif defined(__linux__) || defined (linux) || defined(__APPLE__) - return free(ptr); -#elif defined(__MINGW32__) - return __mingw_aligned_free(ptr); -#else - #error "Please add support OS for aligned free" -#endif -} - - test_status InitCL( cl_device_id device ) { int error; @@ -1305,103 +1105,43 @@ test_status InitCL( cl_device_id device ) } gDevice = device; - - if( (error = clGetDeviceInfo( gDevice, CL_DEVICE_MAX_COMPUTE_UNITS, configSize, &gComputeDevices, NULL )) ) gComputeDevices = 1; // Check extensions - size_t extSize = 0; - if((error = clGetDeviceInfo( gDevice, CL_DEVICE_EXTENSIONS, 0, NULL, &extSize))) - { vlog_error( "Unable to get device extension string to see if double present. (%d) \n", error ); } - else + if(is_extension_available(gDevice, "cl_khr_fp64")) { - char *ext = (char*) malloc( extSize ); - if( NULL == ext ) - { vlog_error( "malloc failed at %s:%d\nUnable to determine if double present.\n", __FILE__, __LINE__ ); } - else + gHasDouble ^= 1; +#if defined( CL_DEVICE_DOUBLE_FP_CONFIG ) + if( (error = clGetDeviceInfo(gDevice, CL_DEVICE_DOUBLE_FP_CONFIG, sizeof(gDoubleCapabilities), &gDoubleCapabilities, NULL))) { - if((error = clGetDeviceInfo( gDevice, CL_DEVICE_EXTENSIONS, extSize, ext, NULL))) - { vlog_error( "Unable to get device extension string to see if double present. (%d) \n", error ); } - else - { - if( strstr( ext, "cl_khr_fp64" )) - { - gHasDouble ^= 1; - -#if defined( CL_DEVICE_DOUBLE_FP_CONFIG ) - if( (error = clGetDeviceInfo(gDevice, CL_DEVICE_DOUBLE_FP_CONFIG, sizeof(gDoubleCapabilities), &gDoubleCapabilities, NULL))) - { - vlog_error( "ERROR: Unable to get device CL_DEVICE_DOUBLE_FP_CONFIG. (%d)\n", error ); - return TEST_FAIL; - } - - if( DOUBLE_REQUIRED_FEATURES != (gDoubleCapabilities & DOUBLE_REQUIRED_FEATURES) ) - { - char list[300] = ""; - if( 0 == (gDoubleCapabilities & CL_FP_FMA) ) - strncat( list, "CL_FP_FMA, ", sizeof( list )-1 ); - if( 0 == (gDoubleCapabilities & CL_FP_ROUND_TO_NEAREST) ) - strncat( list, "CL_FP_ROUND_TO_NEAREST, ", sizeof( list )-1 ); - if( 0 == (gDoubleCapabilities & CL_FP_ROUND_TO_ZERO) ) - strncat( list, "CL_FP_ROUND_TO_ZERO, ", sizeof( list )-1 ); - if( 0 == (gDoubleCapabilities & CL_FP_ROUND_TO_INF) ) - strncat( list, "CL_FP_ROUND_TO_INF, ", sizeof( list )-1 ); - if( 0 == (gDoubleCapabilities & CL_FP_INF_NAN) ) - strncat( list, "CL_FP_INF_NAN, ", sizeof( list )-1 ); - if( 0 == (gDoubleCapabilities & CL_FP_DENORM) ) - strncat( list, "CL_FP_DENORM, ", sizeof( list )-1 ); - vlog_error( "ERROR: required double features are missing: %s\n", list ); - - free(ext); - return TEST_FAIL; - } -#else - vlog_error( "FAIL: device says it supports cl_khr_fp64 but CL_DEVICE_DOUBLE_FP_CONFIG is not in the headers!\n" ); - return TEST_FAIL; -#endif - } -#if defined( __APPLE__ ) - else if( strstr( ext, "cl_APPLE_fp64_basic_ops" )) - { - gHasBasicDouble ^= 1; - -#if defined( CL_DEVICE_DOUBLE_FP_CONFIG ) - if( (error = clGetDeviceInfo(gDevice, CL_DEVICE_DOUBLE_FP_CONFIG, sizeof(gDoubleCapabilities), &gDoubleCapabilities, NULL))) - { - vlog_error( "ERROR: Unable to get device CL_DEVICE_DOUBLE_FP_CONFIG. (%d)\n", error ); - return TEST_FAIL; - } - - if( DOUBLE_REQUIRED_FEATURES != (gDoubleCapabilities & DOUBLE_REQUIRED_FEATURES) ) - { - char list[300] = ""; - if( 0 == (gDoubleCapabilities & CL_FP_FMA) ) - strncat( list, "CL_FP_FMA, ", sizeof( list ) ); - if( 0 == (gDoubleCapabilities & CL_FP_ROUND_TO_NEAREST) ) - strncat( list, "CL_FP_ROUND_TO_NEAREST, ", sizeof( list ) ); - if( 0 == (gDoubleCapabilities & CL_FP_ROUND_TO_ZERO) ) - strncat( list, "CL_FP_ROUND_TO_ZERO, ", sizeof( list ) ); - if( 0 == (gDoubleCapabilities & CL_FP_ROUND_TO_INF) ) - strncat( list, "CL_FP_ROUND_TO_INF, ", sizeof( list ) ); - if( 0 == (gDoubleCapabilities & CL_FP_INF_NAN) ) - strncat( list, "CL_FP_INF_NAN, ", sizeof( list ) ); - if( 0 == (gDoubleCapabilities & CL_FP_DENORM) ) - strncat( list, "CL_FP_DENORM, ", sizeof( list ) ); - vlog_error( "ERROR: required double features are missing: %s\n", list ); - - free(ext); - return TEST_FAIL; - } -#else - vlog_error( "FAIL: device says it supports cl_khr_fp64 but CL_DEVICE_DOUBLE_FP_CONFIG is not in the headers!\n" ); - return TEST_FAIL; -#endif - } -#endif /* __APPLE__ */ - } - free(ext); + vlog_error( "ERROR: Unable to get device CL_DEVICE_DOUBLE_FP_CONFIG. (%d)\n", error ); + return TEST_FAIL; } + + if( DOUBLE_REQUIRED_FEATURES != (gDoubleCapabilities & DOUBLE_REQUIRED_FEATURES) ) + { + std::string list; + if (0 == (gDoubleCapabilities & CL_FP_FMA)) list += "CL_FP_FMA, "; + if( 0 == (gDoubleCapabilities & CL_FP_ROUND_TO_NEAREST) ) + list += "CL_FP_ROUND_TO_NEAREST, "; + if( 0 == (gDoubleCapabilities & CL_FP_ROUND_TO_ZERO) ) + list += "CL_FP_ROUND_TO_ZERO, "; + if( 0 == (gDoubleCapabilities & CL_FP_ROUND_TO_INF) ) + list += "CL_FP_ROUND_TO_INF, "; + if( 0 == (gDoubleCapabilities & CL_FP_INF_NAN) ) + list += "CL_FP_INF_NAN, "; + if( 0 == (gDoubleCapabilities & CL_FP_DENORM) ) + list += "CL_FP_DENORM, "; + vlog_error("ERROR: required double features are missing: %s\n", + list.c_str()); + + return TEST_FAIL; + } +#else + vlog_error( "FAIL: device says it supports cl_khr_fp64 but CL_DEVICE_DOUBLE_FP_CONFIG is not in the headers!\n" ); + return TEST_FAIL; +#endif } configSize = sizeof( gDeviceFrequency ); @@ -1421,7 +1161,7 @@ test_status InitCL( cl_device_id device ) return TEST_FAIL; } - gQueue = clCreateCommandQueueWithProperties(gContext, gDevice, 0, &error); + gQueue = clCreateCommandQueue(gContext, gDevice, 0, &error); if( NULL == gQueue || error ) { vlog_error( "clCreateCommandQueue failed. (%d)\n", error ); @@ -1576,9 +1316,6 @@ test_status InitCL( cl_device_id device ) vlog( "\t\t can not accurately represent the right result to an accuracy closer\n" ); vlog( "\t\t than half an ulp. See comments in Bruteforce_Ulp_Error_Double() for more details.\n\n" ); } -#if defined( __APPLE__ ) - vlog( "\tTesting basic double precision? %s\n", no_yes[0 != gHasBasicDouble] ); -#endif vlog( "\tIs Embedded? %s\n", no_yes[0 != gIsEmbedded] ); if( gIsEmbedded ) @@ -1654,20 +1391,13 @@ int InitILogbConstants( void ) " out[1] = FP_ILOGBNAN;\n" "}\n"; - cl_program query = clCreateProgramWithSource(gContext, 1, &kernel, NULL, &error); - if( NULL == query || error) + cl_program query; + error = create_single_kernel_helper(gContext, &query, NULL, 1, &kernel, NULL); + if (NULL == query || error) { vlog_error( "Error: Unable to create program to get FP_ILOGB0 and FP_ILOGBNAN for the device. (%d)", error ); return error; } - if(( error = clBuildProgram( query, 1, &gDevice, NULL, NULL, NULL ) )) - { - vlog_error( "Error: Unable to build program to get FP_ILOGB0 and FP_ILOGBNAN for the device. Err = %d\n", error ); - char log_msg[2048] = ""; - clGetProgramBuildInfo(query, gDevice, CL_PROGRAM_BUILD_LOG, sizeof( log_msg), log_msg, NULL); - vlog_error( "Log:\n%s\n", log_msg ); - return error; - } cl_kernel k = clCreateKernel( query, "GetILogBConstants", &error ); if( NULL == k || error) @@ -1716,20 +1446,12 @@ int IsTininessDetectedBeforeRounding( void ) " out[0] = a * b;\n" "}\n"; - cl_program query = clCreateProgramWithSource(gContext, 1, &kernel, NULL, &error); - if( NULL == query || error) - { + cl_program query; + error = create_single_kernel_helper(gContext, &query, NULL, 1, &kernel, NULL); + if (error != CL_SUCCESS) { vlog_error( "Error: Unable to create program to detect how tininess is detected for the device. (%d)", error ); return error; } - if(( error = clBuildProgram( query, 1, &gDevice, NULL, NULL, NULL ) )) - { - vlog_error( "Error: Unable to build program to detect how tininess is detected for the device. Err = %d\n", error ); - char log_msg[2048] = ""; - clGetProgramBuildInfo(query, gDevice, CL_PROGRAM_BUILD_LOG, sizeof( log_msg), log_msg, NULL); - vlog_error( "Log:\n%s\n", log_msg ); - return error; - } cl_kernel k = clCreateKernel( query, "IsTininessDetectedBeforeRounding", &error ); if( NULL == k || error) @@ -1767,41 +1489,26 @@ int IsTininessDetectedBeforeRounding( void ) } -int MakeKernel( const char **c, cl_uint count, const char *name, cl_kernel *k, cl_program *p ) +int MakeKernel(const char **c, cl_uint count, const char *name, cl_kernel *k, + cl_program *p, bool relaxedMode) { int error = 0; - char options[200]; - - strcpy(options, "-cl-std=CL2.0"); + char options[200] = ""; if( gForceFTZ ) { strcat(options," -cl-denorms-are-zero"); } - if( gTestFastRelaxed ) + if (relaxedMode) { strcat(options, " -cl-fast-relaxed-math"); } - *p = clCreateProgramWithSource( gContext, count, c, NULL, &error ); - if( NULL == *p || error ) + error = create_single_kernel_helper(gContext, p, NULL, count, c, NULL, options); + if (error != CL_SUCCESS) { - vlog_error( "\t\tFAILED -- Failed to create program. (%d)\n", error ); - return -1; - } - - // build it - if( (error = clBuildProgram( *p, 1, &gDevice, options, NULL, NULL )) ) - { - char buffer[2048] = ""; - - vlog_error("\t\tFAILED -- clBuildProgram() failed: (%d)\n", error); - clGetProgramBuildInfo(*p, gDevice, CL_PROGRAM_BUILD_LOG, sizeof(buffer), buffer, NULL); - vlog_error("Log: %s\n", buffer); - - clReleaseProgram( *p ); - *p = NULL; + vlog_error("\t\tFAILED -- Failed to create program. (%d)\n", error); return error; } @@ -1820,13 +1527,13 @@ int MakeKernel( const char **c, cl_uint count, const char *name, cl_kernel *k, c return error; } -int MakeKernels( const char **c, cl_uint count, const char *name, cl_uint kernel_count, cl_kernel *k, cl_program *p ) +int MakeKernels(const char **c, cl_uint count, const char *name, + cl_uint kernel_count, cl_kernel *k, cl_program *p, + bool relaxedMode) { int error = 0; cl_uint i; - char options[200]; - - strcpy(options, "-cl-std=CL2.0"); + char options[200] = ""; if (gForceFTZ) { @@ -1838,32 +1545,19 @@ int MakeKernels( const char **c, cl_uint count, const char *name, cl_uint kernel strcat(options," -cl-fp32-correctly-rounded-divide-sqrt "); } - if( gTestFastRelaxed ) + if (relaxedMode) { strcat(options, " -cl-fast-relaxed-math"); } - *p = clCreateProgramWithSource( gContext, count, c, NULL, &error ); - if( NULL == *p || error ) + error = create_single_kernel_helper(gContext, p, NULL, count, c, NULL, options); + if ( error != CL_SUCCESS ) { vlog_error( "\t\tFAILED -- Failed to create program. (%d)\n", error ); - return -1; - } - - // build it - if( (error = clBuildProgram( *p, 1, &gDevice, options, NULL, NULL )) ) - { - char buffer[2048] = ""; - - vlog_error("\t\tFAILED -- clBuildProgram() failed: (%d)\n", error); - clGetProgramBuildInfo(*p, gDevice, CL_PROGRAM_BUILD_LOG, sizeof(buffer), buffer, NULL); - vlog_error("Log: %s\n", buffer); - - clReleaseProgram( *p ); - *p = NULL; return error; } + memset( k, 0, kernel_count * sizeof( *k) ); for( i = 0; i< kernel_count; i++ ) { @@ -1880,7 +1574,7 @@ int MakeKernels( const char **c, cl_uint count, const char *name, cl_uint kernel } } - return 0; + return error; } @@ -1895,25 +1589,17 @@ static int IsInRTZMode( void ) " out[0] = (a + 0x1.fffffep-1f == a) && (b - 0x1.fffffep-1f == b);\n" "}\n"; - cl_program query = clCreateProgramWithSource(gContext, 1, &kernel, NULL, &error); - if( NULL == query || error) - { + cl_program query; + error = create_single_kernel_helper(gContext, &query, NULL, 1, &kernel, NULL); + if (error != CL_SUCCESS) { vlog_error( "Error: Unable to create program to detect RTZ mode for the device. (%d)", error ); return error; } - if(( error = clBuildProgram( query, 1, &gDevice, NULL, NULL, NULL ) )) - { - vlog_error( "Error: Unable to build program to detect RTZ mode for the device. Err = %d\n", error ); - char log_msg[2048] = ""; - clGetProgramBuildInfo(query, gDevice, CL_PROGRAM_BUILD_LOG, sizeof( log_msg), log_msg, NULL); - vlog_error( "Log:\n%s\n", log_msg ); - return error; - } cl_kernel k = clCreateKernel( query, "GetRoundingMode", &error ); if( NULL == k || error) { - vlog_error( "Error: Unable to create kernel to gdetect RTZ mode for the device. Err = %d", error ); + vlog_error( "Error: Unable to create kernel to gdetect RTZ mode for the device. Err = %d", error ); return error; } @@ -2155,7 +1841,3 @@ cl_uint RoundUpToNextPowerOfTwo( cl_uint x ) return x+x; } -void TestFinishAtExit(void) { - test_finish(); -} - diff --git a/test_conformance/math_brute_force/reference_math.c b/test_conformance/math_brute_force/reference_math.cpp similarity index 99% rename from test_conformance/math_brute_force/reference_math.c rename to test_conformance/math_brute_force/reference_math.cpp index 6e8f79aa..a739b3a5 100644 --- a/test_conformance/math_brute_force/reference_math.c +++ b/test_conformance/math_brute_force/reference_math.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include "reference_math.h" #include @@ -37,39 +37,6 @@ #define EVALUATE( x ) x #define CONCATENATE(x, y) x ## EVALUATE(y) - -// Declare Classification macros for non-C99 platforms -#ifndef isinf - #define isinf(x) ( sizeof (x) == sizeof(float ) ? fabsf(x) == INFINITY \ - : sizeof (x) == sizeof(double) ? fabs(x) == INFINITY \ - : fabsl(x) == INFINITY) -#endif - -#ifndef isfinite - #define isfinite(x) ( sizeof (x) == sizeof(float ) ? fabsf(x) < INFINITY \ - : sizeof (x) == sizeof(double) ? fabs(x) < INFINITY \ - : fabsl(x) < INFINITY) -#endif - -#ifndef isnan - #define isnan(_a) ( (_a) != (_a) ) -#endif - -#ifdef __MINGW32__ - #undef isnormal -#endif - -#ifndef isnormal - #define isnormal(x) ( sizeof (x) == sizeof(float ) ? (fabsf(x) < INFINITY && fabsf(x) >= FLT_MIN) \ - : sizeof (x) == sizeof(double) ? (fabs(x) < INFINITY && fabs(x) >= DBL_MIN) \ - : (fabsl(x) < INFINITY && fabsl(x) >= LDBL_MIN) ) -#endif - -#ifndef islessgreater - // Note: Non-C99 conformant. This will trigger floating point exceptions. We don't care about that here. - #define islessgreater( _x, _y ) ( (_x) < (_y) || (_x) > (_y) ) -#endif - #pragma STDC FP_CONTRACT OFF static void __log2_ep(double *hi, double *lo, double x); @@ -2951,14 +2918,27 @@ int reference_isgreaterequall( long double x, long double y){ return x >= y; } int reference_isinfl( long double x){ return 0 != isinf(x); } int reference_islessl( long double x, long double y){ return x < y; } int reference_islessequall( long double x, long double y){ return x <= y; } -int reference_islessgreaterl( long double x, long double y){ return 0 != islessgreater( x, y ); } +#if defined(__INTEL_COMPILER) +int reference_islessgreaterl(long double x, long double y) +{ + return 0 != islessgreaterl(x, y); +} +#else +int reference_islessgreaterl(long double x, long double y) +{ + return 0 != islessgreater(x, y); +} +#endif int reference_isnanl( long double x){ return 0 != isnan( x ); } int reference_isnormall( long double x){ return 0 != isnormal( (double) x ); } int reference_isnotequall( long double x, long double y){ return x != y; } int reference_isorderedl( long double x, long double y){ return x == x && y == y; } int reference_isunorderedl( long double x, long double y){ return isnan(x) || isnan( y ); } +#if defined( __INTEL_COMPILER ) +int reference_signbitl( long double x){ return 0 != signbitl( x ); } +#else int reference_signbitl( long double x){ return 0 != signbit( x ); } - +#endif long double reference_copysignl( long double x, long double y); long double reference_roundl( long double x ); long double reference_cbrtl(long double x); diff --git a/test_conformance/math_brute_force/ternary.c b/test_conformance/math_brute_force/ternary.cpp similarity index 97% rename from test_conformance/math_brute_force/ternary.c rename to test_conformance/math_brute_force/ternary.cpp index 8ac48d64..2c4b503e 100644 --- a/test_conformance/math_brute_force/ternary.c +++ b/test_conformance/math_brute_force/ternary.cpp @@ -21,17 +21,19 @@ #define CORRECTLY_ROUNDED 0 #define FLUSHED 1 -int TestFunc_Float_Float_Float_Float(const Func *f, MTdata); -int TestFunc_Double_Double_Double_Double(const Func *f, MTdata); +int TestFunc_Float_Float_Float_Float(const Func *f, MTdata, bool relaxedMode); +int TestFunc_Double_Double_Double_Double(const Func *f, MTdata, + bool relaxedMode); -#if defined( __cplusplus) -extern "C" -#endif -const vtbl _ternary = { "ternary", TestFunc_Float_Float_Float_Float, TestFunc_Double_Double_Double_Double }; +extern const vtbl _ternary = { "ternary", TestFunc_Float_Float_Float_Float, + TestFunc_Double_Double_Double_Double }; -static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_program *p ); -static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl_program *p ); -static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_program *p ) +static int BuildKernel(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode); +static int BuildKernelDouble(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode); +static int BuildKernel(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode) { const char *c[] = { "__kernel void math_kernel", sizeNames[vectorSize], "( __global float", sizeNames[vectorSize], "* out, __global float", sizeNames[vectorSize], "* in1, __global float", sizeNames[vectorSize], "* in2, __global float", sizeNames[vectorSize], "* in3 )\n" @@ -95,11 +97,11 @@ static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_progr char testName[32]; snprintf( testName, sizeof( testName ) -1, "math_kernel%s", sizeNames[vectorSize] ); - return MakeKernel(kern, (cl_uint) kernSize, testName, k, p); - + return MakeKernel(kern, (cl_uint)kernSize, testName, k, p, relaxedMode); } -static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl_program *p ) +static int BuildKernelDouble(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode) { const char *c[] = { "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n", @@ -165,8 +167,7 @@ static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl char testName[32]; snprintf( testName, sizeof( testName ) -1, "math_kernel%s", sizeNames[vectorSize] ); - return MakeKernel(kern, (cl_uint) kernSize, testName, k, p); - + return MakeKernel(kern, (cl_uint)kernSize, testName, k, p, relaxedMode); } typedef struct BuildKernelInfo @@ -175,6 +176,7 @@ typedef struct BuildKernelInfo cl_kernel *kernels; cl_program *programs; const char *nameInCode; + bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. }BuildKernelInfo; static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -182,7 +184,8 @@ static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, voi { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernel( info->nameInCode, i, info->kernels + i, info->programs + i ); + return BuildKernel(info->nameInCode, i, info->kernels + i, + info->programs + i, info->relaxedMode); } static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -190,7 +193,8 @@ static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, vo { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernelDouble( info->nameInCode, i, info->kernels + i, info->programs + i ); + return BuildKernelDouble(info->nameInCode, i, info->kernels + i, + info->programs + i, info->relaxedMode); } @@ -210,7 +214,7 @@ static const float specialValuesFloat[] = { static size_t specialValuesFloatCount = sizeof( specialValuesFloat ) / sizeof( specialValuesFloat[0] ); -int TestFunc_Float_Float_Float_Float(const Func *f, MTdata d) +int TestFunc_Float_Float_Float_Float(const Func *f, MTdata d, bool relaxedMode) { uint64_t i; uint32_t j, k; @@ -229,7 +233,7 @@ int TestFunc_Float_Float_Float_Float(const Func *f, MTdata d) cl_uchar overflow[BUFFER_SIZE / sizeof( float )]; float float_ulps; - logFunctionInfo(f->name,sizeof(cl_float),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_float), relaxedMode); if( gWimpyMode ) { step = (1ULL<<32) * gWimpyReductionFactor / (512); @@ -241,7 +245,8 @@ int TestFunc_Float_Float_Float_Float(const Func *f, MTdata d) float_ulps = f->float_ulps; // Init the kernels - BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, f->nameInCode }; + BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, + f->nameInCode, relaxedMode }; if( (error = ThreadPool_Do( BuildKernel_FloatFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) return error; /* @@ -853,7 +858,8 @@ static const double specialValuesDouble[] = { static const size_t specialValuesDoubleCount = sizeof( specialValuesDouble ) / sizeof( specialValuesDouble[0] ); -int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d) +int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d, + bool relaxedMode) { uint64_t i; uint32_t j, k; @@ -865,7 +871,7 @@ int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d) double maxErrorVal = 0.0f; double maxErrorVal2 = 0.0f; double maxErrorVal3 = 0.0f; - logFunctionInfo(f->name,sizeof(cl_double),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_double), relaxedMode); size_t bufferSize = (gWimpyMode)? gWimpyBufferSize: BUFFER_SIZE; uint64_t step = bufferSize / sizeof( double ); @@ -877,7 +883,8 @@ int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d) Force64BitFPUPrecision(); // Init the kernels - BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, f->nameInCode }; + BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, + f->nameInCode, relaxedMode }; if( (error = ThreadPool_Do( BuildKernel_DoubleFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) diff --git a/test_conformance/math_brute_force/unary.c b/test_conformance/math_brute_force/unary.cpp similarity index 93% rename from test_conformance/math_brute_force/unary.c rename to test_conformance/math_brute_force/unary.cpp index fc802327..91bc92d9 100644 --- a/test_conformance/math_brute_force/unary.c +++ b/test_conformance/math_brute_force/unary.cpp @@ -22,18 +22,20 @@ #include #endif -int TestFunc_Float_Float(const Func *f, MTdata); -int TestFunc_Double_Double(const Func *f, MTdata); +int TestFunc_Float_Float(const Func *f, MTdata, bool relaxedMode); +int TestFunc_Double_Double(const Func *f, MTdata, bool relaxedMode); -#if defined( __cplusplus) - extern "C" -#endif -const vtbl _unary = { "unary", TestFunc_Float_Float, TestFunc_Double_Double }; +extern const vtbl _unary = { "unary", TestFunc_Float_Float, + TestFunc_Double_Double }; -static int BuildKernel( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p ); -static int BuildKernelDouble( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p ); +static int BuildKernel(const char *name, int vectorSize, cl_uint kernel_count, + cl_kernel *k, cl_program *p, bool relaxedMode); +static int BuildKernelDouble(const char *name, int vectorSize, + cl_uint kernel_count, cl_kernel *k, cl_program *p, + bool relaxedMode); -static int BuildKernel( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p ) +static int BuildKernel(const char *name, int vectorSize, cl_uint kernel_count, + cl_kernel *k, cl_program *p, bool relaxedMode) { const char *c[] = { "__kernel void math_kernel", sizeNames[vectorSize], "( __global float", sizeNames[vectorSize], "* out, __global float", sizeNames[vectorSize], "* in)\n" @@ -91,10 +93,13 @@ static int BuildKernel( const char *name, int vectorSize, cl_uint kernel_count, char testName[32]; snprintf( testName, sizeof( testName ) -1, "math_kernel%s", sizeNames[vectorSize] ); - return MakeKernels(kern, (cl_uint) kernSize, testName, kernel_count, k, p); + return MakeKernels(kern, (cl_uint)kernSize, testName, kernel_count, k, p, + relaxedMode); } -static int BuildKernelDouble( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p ) +static int BuildKernelDouble(const char *name, int vectorSize, + cl_uint kernel_count, cl_kernel *k, cl_program *p, + bool relaxedMode) { const char *c[] = { "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n", "__kernel void math_kernel", sizeNames[vectorSize], "( __global double", sizeNames[vectorSize], "* out, __global double", sizeNames[vectorSize], "* in)\n" @@ -154,7 +159,8 @@ static int BuildKernelDouble( const char *name, int vectorSize, cl_uint kernel_c char testName[32]; snprintf( testName, sizeof( testName ) -1, "math_kernel%s", sizeNames[vectorSize] ); - return MakeKernels(kern, (cl_uint) kernSize, testName, kernel_count, k, p); + return MakeKernels(kern, (cl_uint)kernSize, testName, kernel_count, k, p, + relaxedMode); } typedef struct BuildKernelInfo @@ -164,6 +170,7 @@ typedef struct BuildKernelInfo cl_kernel **kernels; cl_program *programs; const char *nameInCode; + bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. }BuildKernelInfo; static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -171,7 +178,8 @@ static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, voi { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernel( info->nameInCode, i, info->kernel_count, info->kernels[i], info->programs + i ); + return BuildKernel(info->nameInCode, i, info->kernel_count, + info->kernels[i], info->programs + i, info->relaxedMode); } static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -179,7 +187,9 @@ static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, vo { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernelDouble( info->nameInCode, i, info->kernel_count, info->kernels[i], info->programs + i ); + return BuildKernelDouble(info->nameInCode, i, info->kernel_count, + info->kernels[i], info->programs + i, + info->relaxedMode); } //Thread specific data for a worker thread @@ -208,20 +218,22 @@ typedef struct TestInfo int isRangeLimited; // 1 if the function is only to be evaluated over a range float half_sin_cos_tan_limit; + bool relaxedMode; // True if test is to be run in relaxed mode, false + // otherwise. }TestInfo; static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *p ); -int TestFunc_Float_Float(const Func *f, MTdata d) +int TestFunc_Float_Float(const Func *f, MTdata d, bool relaxedMode) { TestInfo test_info; cl_int error; size_t i, j; float maxError = 0.0f; double maxErrorVal = 0.0; - int skipTestingRelaxed = ( gTestFastRelaxed && strcmp(f->name,"tan") == 0 ); + int skipTestingRelaxed = (relaxedMode && strcmp(f->name, "tan") == 0); - logFunctionInfo(f->name,sizeof(cl_float),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_float), relaxedMode); // Init test_info memset( &test_info, 0, sizeof( test_info ) ); @@ -248,6 +260,7 @@ int TestFunc_Float_Float(const Func *f, MTdata d) test_info.f = f; test_info.ulps = gIsEmbedded ? f->float_embedded_ulps : f->float_ulps; test_info.ftz = f->ftz || gForceFTZ || 0 == (CL_FP_DENORM & gFloatCapabilities); + test_info.relaxedMode = relaxedMode; // cl_kernels aren't thread safe, so we make one for each vector size for every thread for( i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++ ) { @@ -288,7 +301,7 @@ int TestFunc_Float_Float(const Func *f, MTdata d) goto exit; } } - test_info.tinfo[i].tQueue = clCreateCommandQueueWithProperties(gContext, gDevice, 0, &error); + test_info.tinfo[i].tQueue = clCreateCommandQueue(gContext, gDevice, 0, &error); if( NULL == test_info.tinfo[i].tQueue || error ) { vlog_error( "clCreateCommandQueue failed. (%d)\n", error ); @@ -313,7 +326,10 @@ int TestFunc_Float_Float(const Func *f, MTdata d) // Init the kernels { - BuildKernelInfo build_info = { gMinVectorSizeIndex, test_info.threadCount, test_info.k, test_info.programs, f->nameInCode }; + BuildKernelInfo build_info = { + gMinVectorSizeIndex, test_info.threadCount, test_info.k, + test_info.programs, f->nameInCode, relaxedMode + }; if( (error = ThreadPool_Do( BuildKernel_FloatFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) goto exit; } @@ -447,12 +463,12 @@ static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *data ) cl_uint scale = job->scale; cl_uint base = job_id * (cl_uint) job->step; ThreadInfo *tinfo = job->tinfo + thread_id; - float ulps = job->ulps; fptr func = job->f->func; const char * fname = job->f->name; - if ( gTestFastRelaxed ) + bool relaxedMode = job->relaxedMode; + float ulps = getAllowedUlpError(job->f, relaxedMode); + if (relaxedMode) { - ulps = job->f->relaxed_error; func = job->f->rfunc; } @@ -485,19 +501,23 @@ static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *data ) for( j = 0; j < buffer_elements; j++ ) { p[j] = base + j * scale; - if( gTestFastRelaxed ) + if (relaxedMode) { float p_j = *(float *) &p[j]; if ( strcmp(fname,"sin")==0 || strcmp(fname,"cos")==0 ) //the domain of the function is [-pi,pi] { - if( fabs(p_j) > M_PI ) - p[j] = NAN; + if (fabs(p_j) > M_PI) ((float *)p)[j] = NAN; } if ( strcmp( fname, "reciprocal" ) == 0 ) { - if( fabs(p_j) > 0x7E800000 ) //the domain of the function is [2^-126,2^126] - p[j] = NAN; + const float l_limit = HEX_FLT(+, 1, 0, -, 126); + const float u_limit = HEX_FLT(+, 1, 0, +, 126); + + if (fabs(p_j) < l_limit + || fabs(p_j) + > u_limit) // the domain of the function is [2^-126,2^126] + ((float *)p)[j] = NAN; } } } @@ -602,7 +622,7 @@ static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *data ) { fail = 0; } - else if( gTestFastRelaxed ) + else if (relaxedMode) { if ( strcmp(fname,"sin")==0 || strcmp(fname,"cos")==0 ) { @@ -617,8 +637,13 @@ static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *data ) if ( strcmp(fname, "exp") == 0 || strcmp(fname, "exp2") == 0 ) { + float exp_error = ulps; + + if (!gIsEmbedded) + { + exp_error += floor(fabs(2 * s[j])); + } - float exp_error = 3+floor(fabs(2*s[j])); fail = ! (fabsf(err) <= exp_error); ulps = exp_error; } @@ -682,7 +707,7 @@ static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *data ) typedef int (*CheckForSubnormal) (double,float); // If we are in fast relaxed math, we have a different calculation for the subnormal threshold. CheckForSubnormal isFloatResultSubnormalPtr; - if ( gTestFastRelaxed ) + if (relaxedMode) { isFloatResultSubnormalPtr = &IsFloatResultSubnormalAbsError; } @@ -983,7 +1008,7 @@ static cl_int TestDouble( cl_uint job_id, cl_uint thread_id, void *data ) return CL_SUCCESS; } -int TestFunc_Double_Double(const Func *f, MTdata d) +int TestFunc_Double_Double(const Func *f, MTdata d, bool relaxedMode) { TestInfo test_info; cl_int error; @@ -997,7 +1022,7 @@ int TestFunc_Double_Double(const Func *f, MTdata d) double end_time; #endif - logFunctionInfo(f->name,sizeof(cl_double),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_double), relaxedMode); // Init test_info memset( &test_info, 0, sizeof( test_info ) ); test_info.threadCount = GetThreadCount(); @@ -1022,6 +1047,7 @@ int TestFunc_Double_Double(const Func *f, MTdata d) test_info.f = f; test_info.ulps = f->double_ulps; test_info.ftz = f->ftz || gForceFTZ; + test_info.relaxedMode = relaxedMode; // cl_kernels aren't thread safe, so we make one for each vector size for every thread for( i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++ ) @@ -1065,7 +1091,7 @@ int TestFunc_Double_Double(const Func *f, MTdata d) goto exit; } } - test_info.tinfo[i].tQueue = clCreateCommandQueueWithProperties(gContext, gDevice, 0, &error); + test_info.tinfo[i].tQueue = clCreateCommandQueue(gContext, gDevice, 0, &error); if( NULL == test_info.tinfo[i].tQueue || error ) { vlog_error( "clCreateCommandQueue failed. (%d)\n", error ); @@ -1075,7 +1101,10 @@ int TestFunc_Double_Double(const Func *f, MTdata d) // Init the kernels { - BuildKernelInfo build_info = { gMinVectorSizeIndex, test_info.threadCount, test_info.k, test_info.programs, f->nameInCode }; + BuildKernelInfo build_info = { + gMinVectorSizeIndex, test_info.threadCount, test_info.k, + test_info.programs, f->nameInCode, relaxedMode + }; if( (error = ThreadPool_Do( BuildKernel_DoubleFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) goto exit; } diff --git a/test_conformance/math_brute_force/unary_two_results.c b/test_conformance/math_brute_force/unary_two_results.cpp similarity index 94% rename from test_conformance/math_brute_force/unary_two_results.c rename to test_conformance/math_brute_force/unary_two_results.cpp index 26756edf..a86277f1 100644 --- a/test_conformance/math_brute_force/unary_two_results.c +++ b/test_conformance/math_brute_force/unary_two_results.cpp @@ -18,17 +18,19 @@ #include #include "FunctionList.h" -int TestFunc_Float2_Float(const Func *f, MTdata); -int TestFunc_Double2_Double(const Func *f, MTdata); +int TestFunc_Float2_Float(const Func *f, MTdata, bool relaxedMode); +int TestFunc_Double2_Double(const Func *f, MTdata, bool relaxedMode); -#if defined(__cplusplus) - extern "C" -#endif -const vtbl _unary_two_results = { "unary_two_results", TestFunc_Float2_Float, TestFunc_Double2_Double }; +extern const vtbl _unary_two_results = { "unary_two_results", + TestFunc_Float2_Float, + TestFunc_Double2_Double }; -static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_program *p ); -static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl_program *p ); -static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_program *p ) +static int BuildKernel(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode); +static int BuildKernelDouble(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode); +static int BuildKernel(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode) { const char *c[] = { "__kernel void math_kernel", sizeNames[vectorSize], "( __global float", sizeNames[vectorSize], "* out, __global float", sizeNames[vectorSize], "* out2, __global float", sizeNames[vectorSize], "* in)\n" "{\n" @@ -89,11 +91,11 @@ static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_progr char testName[32]; snprintf( testName, sizeof( testName ) -1, "math_kernel%s", sizeNames[vectorSize] ); - return MakeKernel(kern, (cl_uint) kernSize, testName, k, p); - + return MakeKernel(kern, (cl_uint)kernSize, testName, k, p, relaxedMode); } -static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl_program *p ) +static int BuildKernelDouble(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode) { const char *c[] = { "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n", "__kernel void math_kernel", sizeNames[vectorSize], "( __global double", sizeNames[vectorSize], "* out, __global double", sizeNames[vectorSize], "* out2, __global double", sizeNames[vectorSize], "* in)\n" @@ -156,8 +158,7 @@ static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl char testName[32]; snprintf( testName, sizeof( testName ) -1, "math_kernel%s", sizeNames[vectorSize] ); - return MakeKernel(kern, (cl_uint) kernSize, testName, k, p); - + return MakeKernel(kern, (cl_uint)kernSize, testName, k, p, relaxedMode); } typedef struct BuildKernelInfo @@ -166,6 +167,7 @@ typedef struct BuildKernelInfo cl_kernel *kernels; cl_program *programs; const char *nameInCode; + bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. }BuildKernelInfo; static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -173,7 +175,8 @@ static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, voi { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernel( info->nameInCode, i, info->kernels + i, info->programs + i ); + return BuildKernel(info->nameInCode, i, info->kernels + i, + info->programs + i, info->relaxedMode); } static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -181,10 +184,11 @@ static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, vo { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernelDouble( info->nameInCode, i, info->kernels + i, info->programs + i ); + return BuildKernelDouble(info->nameInCode, i, info->kernels + i, + info->programs + i, info->relaxedMode); } -int TestFunc_Float2_Float(const Func *f, MTdata d) +int TestFunc_Float2_Float(const Func *f, MTdata d, bool relaxedMode) { uint64_t i; uint32_t j, k; @@ -204,23 +208,17 @@ int TestFunc_Float2_Float(const Func *f, MTdata d) cl_uchar overflow[BUFFER_SIZE / sizeof( float )]; int isFract = 0 == strcmp( "fract", f->nameInCode ); int skipNanInf = isFract && ! gInfNanSupport; - float float_ulps; + float float_ulps = getAllowedUlpError(f, relaxedMode); - logFunctionInfo(f->name,sizeof(cl_float),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_float), relaxedMode); if( gWimpyMode ) { step = (1ULL<<32) * gWimpyReductionFactor / (512); } - if( gIsEmbedded ) - float_ulps = f->float_embedded_ulps; - else - float_ulps = f->float_ulps; - - if (gTestFastRelaxed) - float_ulps = f->relaxed_error; // Init the kernels - BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, f->nameInCode }; + BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, + f->nameInCode, relaxedMode }; if( (error = ThreadPool_Do( BuildKernel_FloatFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) return error; /* @@ -238,11 +236,10 @@ int TestFunc_Float2_Float(const Func *f, MTdata d) for( j = 0; j < bufferSize / sizeof( float ); j++ ) { p[j] = (uint32_t) i + j * scale; - if ( gTestFastRelaxed && strcmp(f->name,"sincos") == 0 ) + if (relaxedMode && strcmp(f->name, "sincos") == 0) { float pj = *(float *)&p[j]; - if(fabs(pj) > M_PI) - p[j] = NAN; + if (fabs(pj) > M_PI) ((float *)p)[j] = NAN; } } } @@ -251,11 +248,10 @@ int TestFunc_Float2_Float(const Func *f, MTdata d) for( j = 0; j < bufferSize / sizeof( float ); j++ ) { p[j] = (uint32_t) i + j; - if ( gTestFastRelaxed && strcmp(f->name,"sincos") == 0 ) + if (relaxedMode && strcmp(f->name, "sincos") == 0) { float pj = *(float *)&p[j]; - if(fabs(pj) > M_PI) - p[j] = NAN; + if (fabs(pj) > M_PI) ((float *)p)[j] = NAN; } } } @@ -330,7 +326,7 @@ int TestFunc_Float2_Float(const Func *f, MTdata d) double dd; feclearexcept(FE_OVERFLOW); - if( gTestFastRelaxed ) + if (relaxedMode) r[j] = (float) f->rfunc.f_fpf( s[j], &dd ); else r[j] = (float) f->func.f_fpf( s[j], &dd ); @@ -344,8 +340,8 @@ int TestFunc_Float2_Float(const Func *f, MTdata d) for( j = 0; j < bufferSize / sizeof( float ); j++ ) { double dd; - if( gTestFastRelaxed ) - r[j] = (float) f->rfunc.f_fpf( s[j], &dd ); + if (relaxedMode) + r[j] = (float)f->rfunc.f_fpf(s[j], &dd); else r[j] = (float) f->func.f_fpf( s[j], &dd ); @@ -396,13 +392,13 @@ int TestFunc_Float2_Float(const Func *f, MTdata d) float test = ((float*) q)[j]; float test2 = ((float*) q2)[j]; - if( gTestFastRelaxed ) - correct = f->rfunc.f_fpf( s[j], &correct2 ); + if (relaxedMode) + correct = f->rfunc.f_fpf(s[j], &correct2); else correct = f->func.f_fpf( s[j], &correct2 ); // Per section 10 paragraph 6, accept any result if an input or output is a infinity or NaN or overflow - if (gTestFastRelaxed || skipNanInf) + if (relaxedMode || skipNanInf) { if (skipNanInf && overflow[j]) continue; @@ -416,7 +412,7 @@ int TestFunc_Float2_Float(const Func *f, MTdata d) typedef int (*CheckForSubnormal) (double,float); // If we are in fast relaxed math, we have a different calculation for the subnormal threshold. CheckForSubnormal isFloatResultSubnormalPtr; - if( gTestFastRelaxed ) + if (relaxedMode) { err = Abs_Error( test, correct); err2 = Abs_Error( test2, correct2); @@ -468,7 +464,7 @@ int TestFunc_Float2_Float(const Func *f, MTdata d) if( skipNanInf ) feclearexcept(FE_OVERFLOW); - if ( gTestFastRelaxed ) + if (relaxedMode) { correctp = f->rfunc.f_fpf( 0.0, &correct2p ); correctn = f->rfunc.f_fpf( -0.0, &correct2n ); @@ -493,7 +489,7 @@ int TestFunc_Float2_Float(const Func *f, MTdata d) continue; } - if ( gTestFastRelaxed ) + if (relaxedMode) { errp = Abs_Error( test, correctp ); err2p = Abs_Error( test, correct2p ); @@ -657,7 +653,7 @@ exit: return error; } -int TestFunc_Double2_Double(const Func *f, MTdata d) +int TestFunc_Double2_Double(const Func *f, MTdata d, bool relaxedMode) { uint64_t i; uint32_t j, k; @@ -673,7 +669,7 @@ int TestFunc_Double2_Double(const Func *f, MTdata d) uint64_t step = bufferSize / sizeof( cl_double ); int scale = (int)((1ULL<<32) / (16 * bufferSize / sizeof( cl_double )) + 1); - logFunctionInfo(f->name,sizeof(cl_double),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_double), relaxedMode); if( gWimpyMode ) { step = (1ULL<<32) * gWimpyReductionFactor / (512); @@ -682,7 +678,8 @@ int TestFunc_Double2_Double(const Func *f, MTdata d) Force64BitFPUPrecision(); // Init the kernels - BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, f->nameInCode }; + BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, + f->nameInCode, relaxedMode }; if( (error = ThreadPool_Do( BuildKernel_DoubleFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) diff --git a/test_conformance/math_brute_force/unary_two_results_i.c b/test_conformance/math_brute_force/unary_two_results_i.cpp similarity index 94% rename from test_conformance/math_brute_force/unary_two_results_i.c rename to test_conformance/math_brute_force/unary_two_results_i.cpp index cdd24f8e..108be6a4 100644 --- a/test_conformance/math_brute_force/unary_two_results_i.c +++ b/test_conformance/math_brute_force/unary_two_results_i.cpp @@ -19,18 +19,20 @@ #include #include "FunctionList.h" -int TestFunc_FloatI_Float(const Func *f, MTdata); -int TestFunc_DoubleI_Double(const Func *f, MTdata); +int TestFunc_FloatI_Float(const Func *f, MTdata, bool relaxedMode); +int TestFunc_DoubleI_Double(const Func *f, MTdata, bool relaxedMode); -#if defined(__cplusplus) - extern "C" -#endif -const vtbl _unary_two_results_i = { "unary_two_results_i", TestFunc_FloatI_Float, TestFunc_DoubleI_Double }; +extern const vtbl _unary_two_results_i = { "unary_two_results_i", + TestFunc_FloatI_Float, + TestFunc_DoubleI_Double }; -static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_program *p ); -static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl_program *p ); +static int BuildKernel(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode); +static int BuildKernelDouble(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode); -static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_program *p ) +static int BuildKernel(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode) { const char *c[] = { "__kernel void math_kernel", sizeNames[vectorSize], "( __global float", sizeNames[vectorSize], "* out, __global int", sizeNames[vectorSize], "* out2, __global float", sizeNames[vectorSize], "* in)\n" "{\n" @@ -90,11 +92,11 @@ static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_progr char testName[32]; snprintf( testName, sizeof( testName ) -1, "math_kernel%s", sizeNames[vectorSize] ); - return MakeKernel(kern, (cl_uint) kernSize, testName, k, p); - + return MakeKernel(kern, (cl_uint)kernSize, testName, k, p, relaxedMode); } -static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl_program *p ) +static int BuildKernelDouble(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode) { const char *c[] = { "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n", "__kernel void math_kernel", sizeNames[vectorSize], "( __global double", sizeNames[vectorSize], "* out, __global int", sizeNames[vectorSize], "* out2, __global double", sizeNames[vectorSize], "* in)\n" @@ -156,8 +158,7 @@ static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl char testName[32]; snprintf( testName, sizeof( testName ) -1, "math_kernel%s", sizeNames[vectorSize] ); - return MakeKernel(kern, (cl_uint) kernSize, testName, k, p); - + return MakeKernel(kern, (cl_uint)kernSize, testName, k, p, relaxedMode); } typedef struct BuildKernelInfo @@ -166,6 +167,7 @@ typedef struct BuildKernelInfo cl_kernel *kernels; cl_program *programs; const char *nameInCode; + bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. }BuildKernelInfo; static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -173,7 +175,8 @@ static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, voi { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernel( info->nameInCode, i, info->kernels + i, info->programs + i ); + return BuildKernel(info->nameInCode, i, info->kernels + i, + info->programs + i, info->relaxedMode); } static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -181,7 +184,8 @@ static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, vo { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernelDouble( info->nameInCode, i, info->kernels + i, info->programs + i ); + return BuildKernelDouble(info->nameInCode, i, info->kernels + i, + info->programs + i, info->relaxedMode); } cl_ulong abs_cl_long( cl_long i ); @@ -191,7 +195,7 @@ cl_ulong abs_cl_long( cl_long i ) return (i ^ mask) - mask; } -int TestFunc_FloatI_Float(const Func *f, MTdata d) +int TestFunc_FloatI_Float(const Func *f, MTdata d, bool relaxedMode) { uint64_t i; uint32_t j, k; @@ -209,7 +213,7 @@ int TestFunc_FloatI_Float(const Func *f, MTdata d) int scale = (int)((1ULL<<32) / (16 * bufferSize / sizeof( float )) + 1); cl_ulong maxiError; - logFunctionInfo(f->name,sizeof(cl_float),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_float), relaxedMode); if( gWimpyMode ) { step = (1ULL<<32) * gWimpyReductionFactor / (512); @@ -222,7 +226,8 @@ int TestFunc_FloatI_Float(const Func *f, MTdata d) maxiError = float_ulps == INFINITY ? CL_ULONG_MAX : 0; // Init the kernels - BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, f->nameInCode }; + BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, + f->nameInCode, relaxedMode }; if( (error = ThreadPool_Do( BuildKernel_FloatFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) return error; /* @@ -493,7 +498,7 @@ exit: return error; } -int TestFunc_DoubleI_Double(const Func *f, MTdata d) +int TestFunc_DoubleI_Double(const Func *f, MTdata d, bool relaxedMode) { uint64_t i; uint32_t j, k; @@ -511,7 +516,7 @@ int TestFunc_DoubleI_Double(const Func *f, MTdata d) uint64_t step = bufferSize / sizeof( double ); int scale = (int)((1ULL<<32) / (16 * bufferSize / sizeof( double )) + 1); - logFunctionInfo(f->name,sizeof(cl_double),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_double), relaxedMode); if( gWimpyMode ) { step = (1ULL<<32) * gWimpyReductionFactor / (512); @@ -520,7 +525,8 @@ int TestFunc_DoubleI_Double(const Func *f, MTdata d) Force64BitFPUPrecision(); // Init the kernels - BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, f->nameInCode }; + BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, + f->nameInCode, relaxedMode }; if( (error = ThreadPool_Do( BuildKernel_DoubleFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) diff --git a/test_conformance/math_brute_force/unary_u.c b/test_conformance/math_brute_force/unary_u.cpp similarity index 93% rename from test_conformance/math_brute_force/unary_u.c rename to test_conformance/math_brute_force/unary_u.cpp index 336fdd24..87fcae32 100644 --- a/test_conformance/math_brute_force/unary_u.c +++ b/test_conformance/math_brute_force/unary_u.cpp @@ -18,19 +18,20 @@ #include #include "FunctionList.h" -int TestFunc_Float_UInt(const Func *f, MTdata); -int TestFunc_Double_ULong(const Func *f, MTdata); +int TestFunc_Float_UInt(const Func *f, MTdata, bool relaxedMode); +int TestFunc_Double_ULong(const Func *f, MTdata, bool relaxedMode); -#if defined( __cplusplus) - extern "C" -#endif -const vtbl _unary_u = { "unary_u", TestFunc_Float_UInt, TestFunc_Double_ULong }; +extern const vtbl _unary_u = { "unary_u", TestFunc_Float_UInt, + TestFunc_Double_ULong }; -static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_program *p ); -static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl_program *p ); +static int BuildKernel(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode); +static int BuildKernelDouble(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode); -static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_program *p ) +static int BuildKernel(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode) { const char *c[] = { "__kernel void math_kernel", sizeNames[vectorSize], "( __global float", sizeNames[vectorSize], "* out, __global uint", sizeNames[vectorSize], "* in)\n" @@ -88,10 +89,11 @@ static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_progr char testName[32]; snprintf( testName, sizeof( testName ) -1, "math_kernel%s", sizeNames[vectorSize] ); - return MakeKernel(kern, (cl_uint) kernSize, testName, k, p); + return MakeKernel(kern, (cl_uint)kernSize, testName, k, p, relaxedMode); } -static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl_program *p ) +static int BuildKernelDouble(const char *name, int vectorSize, cl_kernel *k, + cl_program *p, bool relaxedMode) { const char *c[] = { "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n", @@ -152,7 +154,7 @@ static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl char testName[32]; snprintf( testName, sizeof( testName ) -1, "math_kernel%s", sizeNames[vectorSize] ); - return MakeKernel(kern, (cl_uint) kernSize, testName, k, p); + return MakeKernel(kern, (cl_uint)kernSize, testName, k, p, relaxedMode); } typedef struct BuildKernelInfo @@ -161,6 +163,7 @@ typedef struct BuildKernelInfo cl_kernel *kernels; cl_program *programs; const char *nameInCode; + bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. }BuildKernelInfo; static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -168,7 +171,8 @@ static cl_int BuildKernel_FloatFn( cl_uint job_id, cl_uint thread_id UNUSED, voi { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernel( info->nameInCode, i, info->kernels + i, info->programs + i ); + return BuildKernel(info->nameInCode, i, info->kernels + i, + info->programs + i, info->relaxedMode); } static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, void *p ); @@ -176,10 +180,11 @@ static cl_int BuildKernel_DoubleFn( cl_uint job_id, cl_uint thread_id UNUSED, vo { BuildKernelInfo *info = (BuildKernelInfo*) p; cl_uint i = info->offset + job_id; - return BuildKernelDouble( info->nameInCode, i, info->kernels + i, info->programs + i ); + return BuildKernelDouble(info->nameInCode, i, info->kernels + i, + info->programs + i, info->relaxedMode); } -int TestFunc_Float_UInt(const Func *f, MTdata d) +int TestFunc_Float_UInt(const Func *f, MTdata d, bool relaxedMode) { uint64_t i; uint32_t j, k; @@ -197,7 +202,7 @@ int TestFunc_Float_UInt(const Func *f, MTdata d) float float_ulps; float half_sin_cos_tan_limit = 0; - logFunctionInfo(f->name,sizeof(cl_float),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_float), relaxedMode); if( gWimpyMode ) { step = (1ULL<<32) * gWimpyReductionFactor / (512); @@ -208,7 +213,8 @@ int TestFunc_Float_UInt(const Func *f, MTdata d) float_ulps = f->float_ulps; // Init the kernels - BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, f->nameInCode }; + BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, + f->nameInCode, relaxedMode }; if( (error = ThreadPool_Do( BuildKernel_FloatFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) return error; /* @@ -456,7 +462,7 @@ static cl_ulong random64( MTdata d ) return (cl_ulong) genrand_int32(d) | ((cl_ulong) genrand_int32(d) << 32); } -int TestFunc_Double_ULong(const Func *f, MTdata d) +int TestFunc_Double_ULong(const Func *f, MTdata d, bool relaxedMode) { uint64_t i; uint32_t j, k; @@ -469,7 +475,7 @@ int TestFunc_Double_ULong(const Func *f, MTdata d) size_t bufferSize = (gWimpyMode)? gWimpyBufferSize: BUFFER_SIZE; uint64_t step = bufferSize / sizeof( cl_double ); - logFunctionInfo(f->name,sizeof(cl_double),gTestFastRelaxed); + logFunctionInfo(f->name, sizeof(cl_double), relaxedMode); if( gWimpyMode ) { step = (1ULL<<32) * gWimpyReductionFactor / (512); @@ -477,7 +483,8 @@ int TestFunc_Double_ULong(const Func *f, MTdata d) Force64BitFPUPrecision(); // Init the kernels - BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, f->nameInCode }; + BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs, + f->nameInCode, relaxedMode }; if( (error = ThreadPool_Do( BuildKernel_DoubleFn, gMaxVectorSizeIndex - gMinVectorSizeIndex, &build_info ) )) @@ -691,4 +698,3 @@ exit: return error; } - diff --git a/test_conformance/mem_host_flags/CMakeLists.txt b/test_conformance/mem_host_flags/CMakeLists.txt index d1d2b794..73a36f0d 100644 --- a/test_conformance/mem_host_flags/CMakeLists.txt +++ b/test_conformance/mem_host_flags/CMakeLists.txt @@ -4,18 +4,6 @@ set(${MODULE_NAME}_SOURCES main.cpp mem_host_buffer.cpp mem_host_image.cpp - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/threadTesting.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/genericThread.cpp - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/typeWrappers.cpp - ../../test_common/harness/mt19937.c - ../../test_common/harness/conversions.c - ../../test_common/harness/ThreadPool.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c ) include(../CMakeCommon.txt) diff --git a/test_conformance/mem_host_flags/C_host_memory_block.h b/test_conformance/mem_host_flags/C_host_memory_block.h index 90e0b6b3..91b47abf 100644 --- a/test_conformance/mem_host_flags/C_host_memory_block.h +++ b/test_conformance/mem_host_flags/C_host_memory_block.h @@ -16,7 +16,7 @@ #ifndef test_conformance_cHost_MemoryBlock_h #define test_conformance_cHost_MemoryBlock_h -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/mem_host_flags/checker.h b/test_conformance/mem_host_flags/checker.h index bf2e61b6..ae879558 100644 --- a/test_conformance/mem_host_flags/checker.h +++ b/test_conformance/mem_host_flags/checker.h @@ -16,7 +16,7 @@ #ifndef test_conformance_checkers_h #define test_conformance_checkers_h -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -132,6 +132,7 @@ cBuffer_checker::~cBuffer_checker() { } + template < class T > cl_int cBuffer_checker::SetupBuffer() { @@ -183,28 +184,18 @@ cl_int cBuffer_checker::SetupASSubBuffer(cl_mem_flags parent_buffer_flag) this->m_sub_buffer_region.origin = this->buffer_origin_bytes[0]; // in bytes this->m_sub_buffer_region.size = this->region_bytes[0]; - cl_event event; cl_int err = CL_SUCCESS; - err = clEnqueueReadBufferRect(this->m_queue, m_buffer_parent, CL_TRUE, - this->buffer_origin_bytes, - this->host_origin_bytes, - this->region_bytes, - this->buffer_row_pitch_bytes, - this->buffer_slice_pitch_bytes, - this->host_row_pitch_bytes, - this->host_slice_pitch_bytes, - this->host_m_1.pData, - 0, NULL, &event); // update the mem_1 + err = clEnqueueReadBufferRect( + this->m_queue, m_buffer_parent, CL_TRUE, this->buffer_origin_bytes, + this->host_origin_bytes, this->region_bytes, this->buffer_row_pitch_bytes, + this->buffer_slice_pitch_bytes, this->host_row_pitch_bytes, + this->host_slice_pitch_bytes, this->host_m_1.pData, 0, NULL, + NULL); // update the mem_1 if (err == CL_SUCCESS && (parent_buffer_flag & (CL_MEM_HOST_WRITE_ONLY | CL_MEM_HOST_NO_ACCESS))) { log_error("Calling clEnqueueReadBufferRect on a memory object created with the CL_MEM_HOST_WRITE_ONLY flag or the CL_MEM_HOST_NO_ACCESS flag should not return CL_SUCCESS\n"); err = FAILURE; return err; - - if (this->m_blocking) { - err = clWaitForEvents(1, &event); - test_error(err, "clWaitForEvents error"); - } } else { err = CL_SUCCESS; } diff --git a/test_conformance/mem_host_flags/checker_image_mem_host_no_access.hpp b/test_conformance/mem_host_flags/checker_image_mem_host_no_access.hpp index b1960ba4..b124960d 100644 --- a/test_conformance/mem_host_flags/checker_image_mem_host_no_access.hpp +++ b/test_conformance/mem_host_flags/checker_image_mem_host_no_access.hpp @@ -51,12 +51,16 @@ cl_int cImage_check_mem_host_no_access:: verify_RW_Image() &color, img_orig, img_region, 0, NULL, &event); + test_error(err, "clEnqueueFillImage error"); if (!this->m_blocking) { err = clWaitForEvents(1, &event); test_error(err, "clWaitForEvents error"); } + err = clReleaseEvent(event); + test_error(err, "clReleaseEvent error"); + this->update_host_mem_2(); int total = (int)(this->region[0] * this->region[1] * this->region[2]); diff --git a/test_conformance/mem_host_flags/checker_image_mem_host_read_only.hpp b/test_conformance/mem_host_flags/checker_image_mem_host_read_only.hpp index 925d8546..57b535b8 100644 --- a/test_conformance/mem_host_flags/checker_image_mem_host_read_only.hpp +++ b/test_conformance/mem_host_flags/checker_image_mem_host_read_only.hpp @@ -206,6 +206,9 @@ cl_int cImage_check_mem_host_read_only< T >::verify_RW_Image() test_error(err, "clWaitForEvents error"); } + err = clReleaseEvent(event); + test_error(err, "clReleaseEvent error"); + err = this->verify_data(this->host_m_2.pData); test_error(err, "verify_data error"); @@ -245,6 +248,9 @@ cl_int cImage_check_mem_host_read_only< T >::verify_RW_Image_Mapping() test_error(err, "clWaitForEvents error"); } + err = clReleaseEvent(event); + test_error(err, "clReleaseEvent error"); + err= this->verify_mapping_ptr(dataPtr); test_error(err, "clEnqueueMapImage error"); @@ -257,6 +263,9 @@ cl_int cImage_check_mem_host_read_only< T >::verify_RW_Image_Mapping() err = clWaitForEvents(1, &event); test_error(err, "clWaitForEvents error"); + err = clReleaseEvent(event); + test_error(err, "clReleaseEvent error"); + dataPtr = (T*) clEnqueueMapImage(this->m_queue, this->m_Image, this->m_blocking, CL_MAP_WRITE, this->buffer_origin, diff --git a/test_conformance/mem_host_flags/checker_image_mem_host_write_only.hpp b/test_conformance/mem_host_flags/checker_image_mem_host_write_only.hpp index 94c446b9..35604a6f 100644 --- a/test_conformance/mem_host_flags/checker_image_mem_host_write_only.hpp +++ b/test_conformance/mem_host_flags/checker_image_mem_host_write_only.hpp @@ -87,6 +87,9 @@ cl_int cImage_check_mem_host_write_only< T >::update_host_mem_2() test_error(err, "clWaitForEvents error"); } + err = clReleaseEvent(event); + test_error(err, "clReleaseEvent error"); + this->host_m_2.Set_to_zero(); err = clEnqueueReadImage(this->m_queue, this->m_Image_2, this->m_blocking, @@ -100,6 +103,9 @@ cl_int cImage_check_mem_host_write_only< T >::update_host_mem_2() test_error(err, "clWaitForEvents error"); } + err = clReleaseEvent(event); + test_error(err, "clReleaseEvent error"); + return err; } @@ -152,6 +158,9 @@ cl_int cImage_check_mem_host_write_only::verify_RW_Image() } test_error(err, "clEnqueueFillImage error"); + err = clReleaseEvent(event); + test_error(err, "clReleaseEvent error"); + T v = TEST_VALUE; err= clEnqueueWriteImage(this->m_queue, this->m_Image, this->m_blocking, @@ -165,6 +174,9 @@ cl_int cImage_check_mem_host_write_only::verify_RW_Image() test_error(err, "clWaitForEvents error"); } + err = clReleaseEvent(event); + test_error(err, "clReleaseEvent error"); + update_host_mem_2(); // Read buffer contents into mem_2 err = this->verify_data(); // Compare the contents of mem_2 and mem_1, @@ -230,6 +242,9 @@ cl_int cImage_check_mem_host_write_only::verify_RW_Image_Mapping() test_error(err, "clWaitForEvents error"); } + err = clReleaseEvent(event); + test_error(err, "clReleaseEvent error"); + // Map image for writing T* dataPtr = (T*) clEnqueueMapImage(this->m_queue, this->m_Image, this->m_blocking, CL_MAP_WRITE, @@ -244,6 +259,9 @@ cl_int cImage_check_mem_host_write_only::verify_RW_Image_Mapping() test_error(err, "clWaitForEvents error"); } + err = clReleaseEvent(event); + test_error(err, "clReleaseEvent error"); + // Verify map pointer err = this->verify_mapping_ptr(dataPtr); test_error(err, "clEnqueueMapImage CL_MAP_WRITE pointer error"); @@ -270,6 +288,9 @@ cl_int cImage_check_mem_host_write_only::verify_RW_Image_Mapping() test_error(err, "clWaitForEvents error"); } + err = clReleaseEvent(event); + test_error(err, "clReleaseEvent error"); + dataPtr = (T*) clEnqueueMapImage(this->m_queue, this->m_Image, this->m_blocking, CL_MAP_READ, this->buffer_origin, this->region, diff --git a/test_conformance/mem_host_flags/checker_mem_host_read_only.hpp b/test_conformance/mem_host_flags/checker_mem_host_read_only.hpp index 669f3601..44910b04 100644 --- a/test_conformance/mem_host_flags/checker_mem_host_read_only.hpp +++ b/test_conformance/mem_host_flags/checker_mem_host_read_only.hpp @@ -57,7 +57,7 @@ cl_int cBuffer_check_mem_host_read_only< T >::SetupBuffer() block_size_in_byte, this->host_m_1.pData, &err); test_error(err, "clCreateBuffer error"); - if (this->buffer_mem_flag | CL_MEM_USE_HOST_PTR) + if (this->buffer_mem_flag & CL_MEM_USE_HOST_PTR) { this->pHost_ptr = (void *)this->host_m_1.pData; } @@ -139,6 +139,8 @@ cl_int cBuffer_check_mem_host_read_only< T >::verify_RW_Buffer() log_error("Buffer data difference found\n"); return FAILURE; } + err = clReleaseEvent(event); + test_error(err, "clReleaseEvent error"); // test write err = clEnqueueWriteBuffer(this->m_queue, this->m_buffer, this->m_blocking, @@ -190,6 +192,8 @@ cl_int cBuffer_check_mem_host_read_only< T >::verify_RW_Buffer_rect() log_error("Buffer data diffeence found\n"); return FAILURE; } + err = clReleaseEvent(event); + test_error(err, "clReleaseEvent error"); // test blocking write rect err = clEnqueueWriteBufferRect(this->m_queue, this->m_buffer, this->m_blocking, @@ -235,6 +239,7 @@ cl_int cBuffer_check_mem_host_read_only< T >::verify_RW_Buffer_mapping() if ((this->buffer_mem_flag & CL_MEM_USE_HOST_PTR) && dataPtr != this->pHost_ptr ) { log_error("Mapped host pointer difference found\n"); + return FAILURE; } if(!this->host_m_1.Equal((T*)dataPtr, this->m_nNumber_elements)) { @@ -242,6 +247,13 @@ cl_int cBuffer_check_mem_host_read_only< T >::verify_RW_Buffer_mapping() return FAILURE; } + err = clReleaseEvent(event); + test_error(err, "clReleaseEvent error"); + + err = clEnqueueUnmapMemObject(this->m_queue, this->m_buffer, dataPtr, 0, + nullptr, nullptr); + test_error(err, "clEnqueueUnmapMemObject error"); + // test blocking map read clEnqueueMapBuffer(this->m_queue, this->m_buffer, this->m_blocking, CL_MAP_WRITE, diff --git a/test_conformance/mem_host_flags/checker_mem_host_write_only.hpp b/test_conformance/mem_host_flags/checker_mem_host_write_only.hpp index 04c82a8e..1091bc1b 100644 --- a/test_conformance/mem_host_flags/checker_mem_host_write_only.hpp +++ b/test_conformance/mem_host_flags/checker_mem_host_write_only.hpp @@ -142,6 +142,9 @@ cl_int cBuffer_check_mem_host_write_only< T >::verify_RW_Buffer() test_error(err, "clWaitForEvents error") } + err = clReleaseEvent(event); + test_error(err, "clReleaseEvent error"); + if (tmp_host_m.Equal(this->host_m_2)){ log_error("Test data should be different\n"); return FAILURE; @@ -192,6 +195,7 @@ cl_int cBuffer_check_mem_host_write_only< T >::verify_RW_Buffer_rect() err = clEnqueueWriteBuffer(this->m_queue, this->m_buffer, CL_TRUE, 0, this->get_block_size_bytes(), tmp_host_m.pData, 0, NULL, &event_1); + test_error(err, "clEnqueueWriteBuffer error"); vv1 = TEST_VALUE; tmp_host_m.Set_to(vv1); @@ -205,7 +209,7 @@ cl_int cBuffer_check_mem_host_write_only< T >::verify_RW_Buffer_rect() this->host_slice_pitch_bytes, tmp_host_m.pData, 1, &event_1, &event); - test_error(err, "clEnqueueWriteBuffer error"); + test_error(err, "clEnqueueWriteBufferRect error"); if (!this->m_blocking) { err = clWaitForEvents(1, &event); @@ -217,6 +221,11 @@ cl_int cBuffer_check_mem_host_write_only< T >::verify_RW_Buffer_rect() return FAILURE; } + err = clReleaseEvent(event_1); + test_error(err, "clReleaseEvent error"); + err = clReleaseEvent(event); + test_error(err, "clReleaseEvent error"); + update_host_mem_2(); size_t tot_in_reg = this->region[0] * this->region[1] * this->region[2]; @@ -265,6 +274,7 @@ cl_int cBuffer_check_mem_host_write_only< T >::update_host_mem_2() cl_event event, event_2; cl_int err = clEnqueueCopyBuffer(this->m_queue, this->m_buffer, this->m_buffer2, 0, 0, this->m_nNumber_elements* sizeof (T), 0, NULL, &event); + test_error(err, "clEnqueueCopyBuffer error"); this->host_m_2.Set_to_zero(); err = clEnqueueReadBuffer(this->m_queue, this->m_buffer2, CL_TRUE, 0, @@ -275,6 +285,11 @@ cl_int cBuffer_check_mem_host_write_only< T >::update_host_mem_2() clWaitForEvents(1, &event_2); test_error(err, "clWaitForEvents error"); + err = clReleaseEvent(event_2); + test_error(err, "clReleaseEvent error"); + + err = clReleaseEvent(event); + test_error(err, "clReleaseEvent error"); return err; } @@ -300,6 +315,9 @@ cl_int cBuffer_check_mem_host_write_only< T >::verify_RW_Buffer_mapping() test_error(err, "clWaitForEvents error"); } + err = clReleaseEvent(event); + test_error(err, "clReleaseEvent error"); + update_host_mem_2(); if ((this->buffer_mem_flag & CL_MEM_USE_HOST_PTR) && dataPtr != this->pHost_ptr){ @@ -312,6 +330,10 @@ cl_int cBuffer_check_mem_host_write_only< T >::verify_RW_Buffer_mapping() return FAILURE; } + err = clEnqueueUnmapMemObject(this->m_queue, this->m_buffer, dataPtr, 0, + nullptr, nullptr); + test_error(err, "clEnqueueUnmapMemObject error"); + // test map read clEnqueueMapBuffer(this->m_queue, this->m_buffer, this->m_blocking, CL_MAP_READ, diff --git a/test_conformance/mem_host_flags/main.cpp b/test_conformance/mem_host_flags/main.cpp index 46258478..01bad676 100644 --- a/test_conformance/mem_host_flags/main.cpp +++ b/test_conformance/mem_host_flags/main.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -23,7 +23,7 @@ #endif #include "procs.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" #if !defined(_WIN32) #include @@ -43,12 +43,9 @@ test_definition test_list[] = { const int test_num = ARRAY_SIZE( test_list ); -cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT; -bool gTestRounding = true; - int main(int argc, const char *argv[]) { log_info("1st part, non gl-sharing objects...\n"); - + gTestRounding = true; return runTestHarness( argc, argv, test_num, test_list, false, false, 0 ); } diff --git a/test_conformance/mem_host_flags/mem_host_buffer.cpp b/test_conformance/mem_host_flags/mem_host_buffer.cpp index 5416ec7f..dd1f201f 100644 --- a/test_conformance/mem_host_flags/mem_host_buffer.cpp +++ b/test_conformance/mem_host_flags/mem_host_buffer.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -127,6 +127,7 @@ int test_mem_host_read_only_buffer(cl_device_id deviceID, cl_context context, for (int k=0; k<2; k++) for (int i=0; i< 2; i++) { + err = test_mem_host_read_only_buffer_RW(deviceID, context, queue, blocking[i], buffer_mem_flags[k], 0, _BUFFER); test_error(err, __FUNCTION__); diff --git a/test_conformance/mem_host_flags/mem_host_image.cpp b/test_conformance/mem_host_flags/mem_host_image.cpp index b7eeb003..f6b94c98 100644 --- a/test_conformance/mem_host_flags/mem_host_image.cpp +++ b/test_conformance/mem_host_flags/mem_host_image.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/mem_host_flags/testBase.h b/test_conformance/mem_host_flags/testBase.h index afcdf60e..30dbf749 100644 --- a/test_conformance/mem_host_flags/testBase.h +++ b/test_conformance/mem_host_flags/testBase.h @@ -16,7 +16,7 @@ #ifndef _testBase_h #define _testBase_h -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -29,12 +29,12 @@ //#include #endif -#include "../../test_common/harness/imageHelpers.h" -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/threadTesting.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/mt19937.h" +#include "harness/imageHelpers.h" +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" +#include "harness/threadTesting.h" +#include "harness/typeWrappers.h" +#include "harness/conversions.h" +#include "harness/mt19937.h" #endif // _testBase_h diff --git a/test_conformance/multiple_device_context/CMakeLists.txt b/test_conformance/multiple_device_context/CMakeLists.txt index fe1fd227..2fdda8f0 100644 --- a/test_conformance/multiple_device_context/CMakeLists.txt +++ b/test_conformance/multiple_device_context/CMakeLists.txt @@ -1,37 +1,9 @@ set(MODULE_NAME multiples) set(${MODULE_NAME}_SOURCES - main.c - test_multiple_contexts.c + main.cpp + test_multiple_contexts.cpp test_multiple_devices.cpp - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/threadTesting.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/genericThread.cpp - ../../test_common/harness/typeWrappers.cpp - ../../test_common/harness/conversions.c - ../../test_common/harness/mt19937.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c ) - -set_source_files_properties( - COMPILE_FLAGS -msse2) - -set_source_files_properties( - main.c - test_multiple_contexts.c - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/threadTesting.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/conversions.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c - PROPERTIES LANGUAGE CXX) - include(../CMakeCommon.txt) diff --git a/test_conformance/multiple_device_context/main.c b/test_conformance/multiple_device_context/main.cpp similarity index 89% rename from test_conformance/multiple_device_context/main.c rename to test_conformance/multiple_device_context/main.cpp index 53a7ce8c..10276668 100644 --- a/test_conformance/multiple_device_context/main.c +++ b/test_conformance/multiple_device_context/main.cpp @@ -13,13 +13,13 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include #include "procs.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/mt19937.h" +#include "harness/testHarness.h" +#include "harness/mt19937.h" #if !defined(_WIN32) #include diff --git a/test_conformance/multiple_device_context/procs.h b/test_conformance/multiple_device_context/procs.h index a31db666..fb1aae02 100644 --- a/test_conformance/multiple_device_context/procs.h +++ b/test_conformance/multiple_device_context/procs.h @@ -13,10 +13,10 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/mt19937.h" +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" +#include "harness/typeWrappers.h" +#include "harness/mt19937.h" extern int test_context_multiple_contexts_same_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_context_two_contexts_same_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); diff --git a/test_conformance/multiple_device_context/testBase.h b/test_conformance/multiple_device_context/testBase.h index 5073b21f..5b49bfd7 100644 --- a/test_conformance/multiple_device_context/testBase.h +++ b/test_conformance/multiple_device_context/testBase.h @@ -16,7 +16,7 @@ #ifndef _testBase_h #define _testBase_h -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/multiple_device_context/test_multiple_contexts.c b/test_conformance/multiple_device_context/test_multiple_contexts.cpp similarity index 88% rename from test_conformance/multiple_device_context/test_multiple_contexts.c rename to test_conformance/multiple_device_context/test_multiple_contexts.cpp index 6d163dd1..c432d79b 100644 --- a/test_conformance/multiple_device_context/test_multiple_contexts.c +++ b/test_conformance/multiple_device_context/test_multiple_contexts.cpp @@ -14,31 +14,31 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" const char *context_test_kernels[] = { - "__kernel void sample_test_1(__global int *src, __global int *dst)\n" + "__kernel void sample_test_1(__global uint *src, __global uint *dst)\n" "{\n" " int tid = get_global_id(0);\n" " dst[tid] = src[tid];\n" "\n" "}\n" - "__kernel void sample_test_2(__global int *src, __global int *dst)\n" + "__kernel void sample_test_2(__global uint *src, __global uint *dst)\n" "{\n" " int tid = get_global_id(0);\n" " dst[tid] = src[tid] * 2;\n" "\n" "}\n" - "__kernel void sample_test_3(__global int *src, __global int *dst)\n" + "__kernel void sample_test_3(__global uint *src, __global uint *dst)\n" "{\n" " int tid = get_global_id(0);\n" " dst[tid] = src[tid] / 2;\n" "\n" "}\n" - "__kernel void sample_test_4(__global int *src, __global int *dst)\n" + "__kernel void sample_test_4(__global uint *src, __global uint *dst)\n" "{\n" " int tid = get_global_id(0);\n" " dst[tid] = src[tid] /3;\n" @@ -46,13 +46,13 @@ const char *context_test_kernels[] = { "}\n" }; -int sampleAction1( int source ) { return source; } -int sampleAction2( int source ) { return source * 2; } -int sampleAction3( int source ) { return source / 2; } -int sampleAction4( int source ) { return source / 3; } +cl_uint sampleAction1(cl_uint source) { return source; } +cl_uint sampleAction2(cl_uint source) { return source * 2; } +cl_uint sampleAction3(cl_uint source) { return source / 2; } +cl_uint sampleAction4(cl_uint source) { return source / 3; } -typedef int (*sampleActionFn)( int source ); +typedef cl_uint (*sampleActionFn)(cl_uint source); sampleActionFn sampleActions[4] = { sampleAction1, sampleAction2, sampleAction3, sampleAction4 }; @@ -118,7 +118,7 @@ TestItem *CreateTestItem( cl_device_id deviceID, cl_int *err ) } // Create a queue - item->q = clCreateCommandQueueWithProperties( item->c, deviceID, 0, &error); + item->q = clCreateCommandQueue( item->c, deviceID, 0, &error); if( item->q == NULL || error != CL_SUCCESS) { if (err) { @@ -174,12 +174,15 @@ TestItem *CreateTestItem( cl_device_id deviceID, cl_int *err ) // create some mem objects for( i = 0; i < BUFFER_COUNT; i++ ) { - item->m[i] = clCreateBuffer( item->c, CL_MEM_READ_WRITE, TEST_SIZE * sizeof(cl_int), NULL, &error ); + item->m[i] = clCreateBuffer(item->c, CL_MEM_READ_WRITE, + TEST_SIZE * sizeof(cl_uint), NULL, &error); if( NULL == item->m[i] || CL_SUCCESS != error ) { if( err ) { - log_error( "FAILURE: clCreateBuffer( %ld bytes ) failed in CreateTestItem: %d\n", TEST_SIZE * sizeof(cl_int), error ); + log_error("FAILURE: clCreateBuffer( %ld bytes ) failed in " + "CreateTestItem: %d\n", + TEST_SIZE * sizeof(cl_uint), error); *err = error; } DestroyTestItem( item ); @@ -227,7 +230,9 @@ cl_int UseTestItem( const TestItem *item, cl_int *err ) cl_int error = CL_SUCCESS; // Fill buffer 0 with random numbers - cl_int *mapped = (cl_int*) clEnqueueMapBuffer( item->q, item->m[0], CL_TRUE, CL_MAP_WRITE, 0, TEST_SIZE * sizeof( cl_int ), 0, NULL, NULL, &error ); + cl_uint *mapped = (cl_uint *)clEnqueueMapBuffer( + item->q, item->m[0], CL_TRUE, CL_MAP_WRITE, 0, + TEST_SIZE * sizeof(cl_uint), 0, NULL, NULL, &error); if( NULL == mapped || CL_SUCCESS != error ) { if( err ) @@ -256,7 +261,9 @@ cl_int UseTestItem( const TestItem *item, cl_int *err ) for( j = 0; j < sizeof(item->k) / sizeof( item->k[0] ); j++ ) { // Fill buffer 1 with 0xdeaddead - mapped = (cl_int*) clEnqueueMapBuffer( item->q, item->m[1], CL_TRUE, CL_MAP_WRITE, 0, TEST_SIZE * sizeof( cl_int ), 0, NULL, NULL, &error ); + mapped = (cl_uint *)clEnqueueMapBuffer( + item->q, item->m[1], CL_TRUE, CL_MAP_WRITE, 0, + TEST_SIZE * sizeof(cl_uint), 0, NULL, NULL, &error); if( NULL == mapped || CL_SUCCESS != error ) { if( err ) @@ -318,7 +325,9 @@ cl_int UseTestItem( const TestItem *item, cl_int *err ) } // Get the results back - mapped = (cl_int*) clEnqueueMapBuffer( item->q, item->m[1], CL_TRUE, CL_MAP_READ, 0, TEST_SIZE * sizeof( cl_int ), 0, NULL, NULL, &error ); + mapped = (cl_uint *)clEnqueueMapBuffer( + item->q, item->m[1], CL_TRUE, CL_MAP_READ, 0, + TEST_SIZE * sizeof(cl_uint), 0, NULL, NULL, &error); if( NULL == mapped || CL_SUCCESS != error ) { if( err ) @@ -330,7 +339,9 @@ cl_int UseTestItem( const TestItem *item, cl_int *err ) } // Get our input data so we can check against it - cl_int *inputData = (cl_int*) clEnqueueMapBuffer( item->q, item->m[0], CL_TRUE, CL_MAP_READ, 0, TEST_SIZE * sizeof( cl_int ), 0, NULL, NULL, &error ); + cl_uint *inputData = (cl_uint *)clEnqueueMapBuffer( + item->q, item->m[0], CL_TRUE, CL_MAP_READ, 0, + TEST_SIZE * sizeof(cl_uint), 0, NULL, NULL, &error); if( NULL == mapped || CL_SUCCESS != error ) { if( err ) @@ -345,8 +356,8 @@ cl_int UseTestItem( const TestItem *item, cl_int *err ) //Verify the results for( i = 0; i < TEST_SIZE; i++ ) { - int expected = sampleActions[j]( inputData[i] ); - int result = mapped[i]; + cl_uint expected = sampleActions[j](inputData[i]); + cl_uint result = mapped[i]; if( expected != result ) { log_error( "FAILURE: Sample data at position %ld does not match expected result: *0x%8.8x vs. 0x%8.8x\n", i, expected, result ); @@ -509,7 +520,7 @@ exit: // that many contexts 5 times over, then you pass. int test_context_multiple_contexts_same_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) { - return test_context_multiple_contexts_same_device( deviceID, 200, 1 ); + return test_context_multiple_contexts_same_device(deviceID, 200, 1); } int test_context_two_contexts_same_device(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) diff --git a/test_conformance/multiple_device_context/test_multiple_devices.cpp b/test_conformance/multiple_device_context/test_multiple_devices.cpp index 3f4b78c4..b6f15f64 100644 --- a/test_conformance/multiple_device_context/test_multiple_devices.cpp +++ b/test_conformance/multiple_device_context/test_multiple_devices.cpp @@ -14,24 +14,22 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/conversions.h" +#include "harness/typeWrappers.h" +#include "harness/testHarness.h" +#include "harness/conversions.h" -const char *test_kernels[] = { -"__kernel void kernelA(__global int *dst)\n" -"{\n" -"\n" -" dst[get_global_id(0)]*=3;\n" -"\n" -"}\n" -"__kernel void kernelB(__global int *dst)\n" -"{\n" -"\n" -" dst[get_global_id(0)]++;\n" -"\n" -"}\n" -}; +const char *test_kernels[] = { "__kernel void kernelA(__global uint *dst)\n" + "{\n" + "\n" + " dst[get_global_id(0)]*=3;\n" + "\n" + "}\n" + "__kernel void kernelB(__global uint *dst)\n" + "{\n" + "\n" + " dst[get_global_id(0)]++;\n" + "\n" + "}\n" }; #define TEST_SIZE 512 #define MAX_DEVICES 32 @@ -46,10 +44,10 @@ int test_device_set(size_t deviceCount, size_t queueCount, cl_device_id *devices clMemWrapper stream; clCommandQueueWrapper queues[MAX_QUEUES]; size_t threads[1], localThreads[1]; - int data[TEST_SIZE]; - int outputData[TEST_SIZE]; - int expectedResults[TEST_SIZE]; - int expectedResultsOneDevice[MAX_DEVICES][TEST_SIZE]; + cl_uint data[TEST_SIZE]; + cl_uint outputData[TEST_SIZE]; + cl_uint expectedResults[TEST_SIZE]; + cl_uint expectedResultsOneDevice[MAX_DEVICES][TEST_SIZE]; size_t i; memset(queues, 0, sizeof(queues)); @@ -93,8 +91,9 @@ int test_device_set(size_t deviceCount, size_t queueCount, cl_device_id *devices for( i = 0; i < TEST_SIZE; i++ ) data[i] = genrand_int32(seed); - stream = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), sizeof(cl_int) * TEST_SIZE, data, &error); - test_error( error, "Unable to create test array" ); + stream = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_COPY_HOST_PTR), + sizeof(cl_uint) * TEST_SIZE, data, &error); + test_error(error, "Unable to create test array"); // Update the expected results for( i = 0; i < TEST_SIZE; i++ ) { @@ -119,7 +118,7 @@ int test_device_set(size_t deviceCount, size_t queueCount, cl_device_id *devices /* Create work queues */ for( i = 0; i < queueCount; i++ ) { - queues[i] = clCreateCommandQueueWithProperties( context, devices[ i % deviceCount ], 0, &error ); + queues[i] = clCreateCommandQueue( context, devices[ i % deviceCount ], 0, &error ); if (error != CL_SUCCESS || queues[i] == NULL) { log_info("Could not create queue[%d].\n", (int)i); queueCount = i; diff --git a/test_conformance/non_uniform_work_group/CMakeLists.txt b/test_conformance/non_uniform_work_group/CMakeLists.txt index ea2cc1af..30c3a846 100644 --- a/test_conformance/non_uniform_work_group/CMakeLists.txt +++ b/test_conformance/non_uniform_work_group/CMakeLists.txt @@ -8,12 +8,6 @@ set(${MODULE_NAME}_SOURCES test_basic.cpp TestNonUniformWorkGroup.cpp tools.cpp - ../../test_common/harness/testHarness.c - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c ) include(../CMakeCommon.txt) diff --git a/test_conformance/non_uniform_work_group/TestNonUniformWorkGroup.cpp b/test_conformance/non_uniform_work_group/TestNonUniformWorkGroup.cpp index 8173377b..a4a6a744 100644 --- a/test_conformance/non_uniform_work_group/TestNonUniformWorkGroup.cpp +++ b/test_conformance/non_uniform_work_group/TestNonUniformWorkGroup.cpp @@ -243,75 +243,134 @@ static const char *KERNEL_FUNCTION = NL "}" NL ; -TestNonUniformWorkGroup::TestNonUniformWorkGroup (const cl_device_id &device, const cl_context &context, - const cl_command_queue &queue, const cl_uint dims, const size_t *globalSize, const size_t *localSize, const size_t *buffersSize, - const size_t *globalWorkOffset, const size_t *reqdWorkGroupSize) - : _device(device), _context(context), _queue(queue), _dims (dims) { +TestNonUniformWorkGroup::TestNonUniformWorkGroup( + const cl_device_id &device, const cl_context &context, + const cl_command_queue &queue, const cl_uint dims, size_t *globalSize, + const size_t *localSize, const size_t *buffersSize, + const size_t *globalWorkOffset, const size_t *reqdWorkGroupSize) + : _device(device), _context(context), _queue(queue), _dims(dims) +{ - if (globalSize == NULL || dims < 1 || dims > 3) { - //throw std::invalid_argument("globalSize is NULL value."); - // This is method of informing that parameters are wrong. - // It would be checked by prepareDevice() function. - // This is used because of lack of exception support. - _globalSize[0] = 0; - return; - } - - cl_uint i; - _globalWorkOffset_IsNull = true; - _localSize_IsNull = true; - - setGlobalWorkgroupSize(globalSize); - setLocalWorkgroupSize(globalSize,localSize); - for (i = _dims; i < MAX_DIMS; i++) { - _globalSize[i] = 1; - } - - for (i = 0; i < MAX_DIMS; i++) { - _globalWorkOffset[i] = 0; - } - - if (globalWorkOffset) { - _globalWorkOffset_IsNull = false; - for (i = 0; i < _dims; i++) { - _globalWorkOffset[i] = globalWorkOffset[i]; + if (globalSize == NULL || dims < 1 || dims > 3) + { + // throw std::invalid_argument("globalSize is NULL value."); + // This is method of informing that parameters are wrong. + // It would be checked by prepareDevice() function. + // This is used because of lack of exception support. + _globalSize[0] = 0; + return; } - } - for (i = 0; i < MAX_DIMS; i++) { - _enqueuedLocalSize[i] = 1; - } + // For OpenCL-3.0 support for non-uniform workgroups is optional, it's still + // useful to run these tests since we can verify the behavior of the + // get_enqueued_local_size() builtin for uniform workgroups, so we round up + // the global size to insure uniform workgroups on those 3.0 devices. + // We only need to do this when localSize is non-null, otherwise the driver + // will select a value for localSize which will be uniform on devices that + // don't support non-uniform work-groups. + if (nullptr != localSize && get_device_cl_version(device) >= Version(3, 0)) + { + // Query for the non-uniform work-group support. + cl_bool are_non_uniform_sub_groups_supported{ CL_FALSE }; + auto error = + clGetDeviceInfo(device, CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT, + sizeof(are_non_uniform_sub_groups_supported), + &are_non_uniform_sub_groups_supported, nullptr); + if (error) + { + print_error(error, + "clGetDeviceInfo failed for " + "CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT"); + // This signals an error to the caller (see above). + _globalSize[0] = 0; + return; + } - if (localSize) { - _localSize_IsNull = false; - for (i = 0; i < _dims; i++) { - _enqueuedLocalSize[i] = _localSize[i]; + // If non-uniform work-groups are not supported round up the global + // sizes so workgroups are uniform and we have at least one. + if (CL_FALSE == are_non_uniform_sub_groups_supported) + { + log_info( + "WARNING: Non-uniform work-groups are not supported on this " + "device.\n Running test with uniform work-groups.\n"); + for (unsigned dim = 0; dim < dims; ++dim) + { + auto global_size_before = globalSize[dim]; + auto global_size_rounded = global_size_before + + (localSize[dim] - global_size_before % localSize[dim]); + globalSize[dim] = global_size_rounded; + log_info("Rounding globalSize[%d] = %d -> %d\n", dim, + global_size_before, global_size_rounded); + } + } } - } - if (reqdWorkGroupSize) { - for (i = 0; i < _dims; i++) { - _reqdWorkGroupSize[i] = reqdWorkGroupSize[i]; + cl_uint i; + _globalWorkOffset_IsNull = true; + _localSize_IsNull = true; + + setGlobalWorkgroupSize(globalSize); + setLocalWorkgroupSize(globalSize, localSize); + for (i = _dims; i < MAX_DIMS; i++) + { + _globalSize[i] = 1; } - for (i = _dims; i < MAX_DIMS; i++) { - _reqdWorkGroupSize[i] = 1; + + for (i = 0; i < MAX_DIMS; i++) + { + _globalWorkOffset[i] = 0; } - } else { - _reqdWorkGroupSize[0] = 0; - _reqdWorkGroupSize[1] = 0; - _reqdWorkGroupSize[2] = 0; - } - _testRange = Range::ALL; + if (globalWorkOffset) + { + _globalWorkOffset_IsNull = false; + for (i = 0; i < _dims; i++) + { + _globalWorkOffset[i] = globalWorkOffset[i]; + } + } - _numOfGlobalWorkItems = _globalSize[0]*_globalSize[1]*_globalSize[2]; + for (i = 0; i < MAX_DIMS; i++) + { + _enqueuedLocalSize[i] = 1; + } - DataContainerAttrib temp = {{0, 0, 0}}; + if (localSize) + { + _localSize_IsNull = false; + for (i = 0; i < _dims; i++) + { + _enqueuedLocalSize[i] = _localSize[i]; + } + } - // array with results from each region - _resultsRegionArray.resize(NUMBER_OF_REGIONS, temp); - _referenceRegionArray.resize(NUMBER_OF_REGIONS, temp); + if (reqdWorkGroupSize) + { + for (i = 0; i < _dims; i++) + { + _reqdWorkGroupSize[i] = reqdWorkGroupSize[i]; + } + for (i = _dims; i < MAX_DIMS; i++) + { + _reqdWorkGroupSize[i] = 1; + } + } + else + { + _reqdWorkGroupSize[0] = 0; + _reqdWorkGroupSize[1] = 0; + _reqdWorkGroupSize[2] = 0; + } + _testRange = Range::ALL; + + _numOfGlobalWorkItems = _globalSize[0] * _globalSize[1] * _globalSize[2]; + + DataContainerAttrib temp = { { 0, 0, 0 } }; + + // array with results from each region + _resultsRegionArray.resize(NUMBER_OF_REGIONS, temp); + _referenceRegionArray.resize(NUMBER_OF_REGIONS, temp); } TestNonUniformWorkGroup::~TestNonUniformWorkGroup () { @@ -455,6 +514,7 @@ void TestNonUniformWorkGroup::enableStrictMode(bool state) { int TestNonUniformWorkGroup::prepareDevice () { int err; cl_uint device_max_dimensions; + cl_uint i; if (_globalSize[0] == 0) { @@ -462,9 +522,6 @@ int TestNonUniformWorkGroup::prepareDevice () { return -1; } - if(_localSize_IsNull == false) - calculateExpectedValues(); - err = clGetDeviceInfo(_device, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, sizeof(device_max_dimensions), &device_max_dimensions, NULL); test_error(err, "clGetDeviceInfo failed"); @@ -474,7 +531,17 @@ int TestNonUniformWorkGroup::prepareDevice () { test_error(err, "clGetDeviceInfo failed"); - std::string buildOptions = BUILD_CL_STD_2_0; + // Trim the local size to the limitations of what the device supports in each dimension. + for (i = 0; i < _dims; i++) { + if(_enqueuedLocalSize[i] > _maxWorkItemSizes[i]) { + _enqueuedLocalSize[i] = _maxWorkItemSizes[i]; + } + } + + if(_localSize_IsNull == false) + calculateExpectedValues(); + + std::string buildOptions{}; if(_reqdWorkGroupSize[0] != 0 && _reqdWorkGroupSize[1] != 0 && _reqdWorkGroupSize[2] != 0) { std::ostringstream tmp(" "); tmp << " -D RWGSX=" << _reqdWorkGroupSize[0] @@ -713,42 +780,50 @@ int TestNonUniformWorkGroup::runKernel () { return 0; } -void SubTestExecutor::runTestNonUniformWorkGroup(const cl_uint dims, const size_t *globalSize, - const size_t *localSize, int range) { - runTestNonUniformWorkGroup (dims, globalSize, localSize, NULL, NULL, range); +void SubTestExecutor::runTestNonUniformWorkGroup(const cl_uint dims, + size_t *globalSize, + const size_t *localSize, + int range) +{ + runTestNonUniformWorkGroup(dims, globalSize, localSize, NULL, NULL, range); } -void SubTestExecutor::runTestNonUniformWorkGroup(const cl_uint dims, const size_t *globalSize, - const size_t *localSize, const size_t *globalWorkOffset, - const size_t *reqdWorkGroupSize, int range) { +void SubTestExecutor::runTestNonUniformWorkGroup( + const cl_uint dims, size_t *globalSize, const size_t *localSize, + const size_t *globalWorkOffset, const size_t *reqdWorkGroupSize, int range) +{ - int err; - ++_overallCounter; - TestNonUniformWorkGroup test (_device, _context, _queue, dims, globalSize, localSize, - NULL, globalWorkOffset, reqdWorkGroupSize); + int err; + ++_overallCounter; + TestNonUniformWorkGroup test(_device, _context, _queue, dims, globalSize, + localSize, NULL, globalWorkOffset, + reqdWorkGroupSize); - test.setTestRange(range); - err = test.prepareDevice(); - if (err) { - log_error ("Error: prepare device\n"); - ++_failCounter; - return; - } + test.setTestRange(range); + err = test.prepareDevice(); + if (err) + { + log_error("Error: prepare device\n"); + ++_failCounter; + return; + } - err = test.runKernel(); - if (err) { - log_error ("Error: run kernel\n"); - ++_failCounter; - return; - } + err = test.runKernel(); + if (err) + { + log_error("Error: run kernel\n"); + ++_failCounter; + return; + } - err = test.verifyResults(); - if (err) { - log_error ("Error: verify results\n"); - ++_failCounter; - return; - } + err = test.verifyResults(); + if (err) + { + log_error("Error: verify results\n"); + ++_failCounter; + return; + } } int SubTestExecutor::calculateWorkGroupSize(size_t &maxWgSize, int testRange) { @@ -756,7 +831,7 @@ int SubTestExecutor::calculateWorkGroupSize(size_t &maxWgSize, int testRange) { clProgramWrapper program; clKernelWrapper testKernel; - std::string buildOptions = BUILD_CL_STD_2_0; + std::string buildOptions{}; if (testRange & Range::BASIC) buildOptions += " -D TESTBASIC"; diff --git a/test_conformance/non_uniform_work_group/TestNonUniformWorkGroup.h b/test_conformance/non_uniform_work_group/TestNonUniformWorkGroup.h index e0c635a4..414d1004 100644 --- a/test_conformance/non_uniform_work_group/TestNonUniformWorkGroup.h +++ b/test_conformance/non_uniform_work_group/TestNonUniformWorkGroup.h @@ -25,8 +25,6 @@ #define NUMBER_OF_REGIONS 8 -#define BUILD_CL_STD_2_0 "-cl-std=CL2.0" - #define MAX_DIMS 3 // This structure reflects data received from kernel. @@ -62,18 +60,21 @@ std::string showArray (const size_t *arr, cl_uint dims); // Main class responsible for testing class TestNonUniformWorkGroup { public: + TestNonUniformWorkGroup(const cl_device_id &device, + const cl_context &context, + const cl_command_queue &queue, const cl_uint dims, + size_t *globalSize, const size_t *localSize, + const size_t *buffersSize, + const size_t *globalWorkOffset, + const size_t *reqdWorkGroupSize = NULL); - TestNonUniformWorkGroup (const cl_device_id &device, const cl_context &context, - const cl_command_queue &queue, const cl_uint dims, const size_t *globalSize, - const size_t *localSize, const size_t *buffersSize, const size_t *globalWorkOffset, - const size_t *reqdWorkGroupSize=NULL); + ~TestNonUniformWorkGroup(); - ~TestNonUniformWorkGroup (); - - static size_t getMaxLocalWorkgroupSize (const cl_device_id &device); - static void setMaxLocalWorkgroupSize (size_t workGroupSize) { - TestNonUniformWorkGroup::_maxLocalWorkgroupSize = workGroupSize; - } + static size_t getMaxLocalWorkgroupSize(const cl_device_id &device); + static void setMaxLocalWorkgroupSize(size_t workGroupSize) + { + TestNonUniformWorkGroup::_maxLocalWorkgroupSize = workGroupSize; + } static void enableStrictMode (bool state); void setTestRange (int range) {_testRange = range;} @@ -126,12 +127,13 @@ public: SubTestExecutor(const cl_device_id &device, const cl_context &context, const cl_command_queue &queue) : _device (device), _context (context), _queue (queue), _failCounter (0), _overallCounter (0) {} - void runTestNonUniformWorkGroup (const cl_uint dims, const size_t *globalSize, - const size_t *localSize, int range); + void runTestNonUniformWorkGroup(const cl_uint dims, size_t *globalSize, + const size_t *localSize, int range); - void runTestNonUniformWorkGroup (const cl_uint dims, const size_t *globalSize, - const size_t *localSize, const size_t *globalWorkOffset, - const size_t *reqdWorkGroupSize, int range); + void runTestNonUniformWorkGroup(const cl_uint dims, size_t *globalSize, + const size_t *localSize, + const size_t *globalWorkOffset, + const size_t *reqdWorkGroupSize, int range); int calculateWorkGroupSize(size_t &maxWgSize, int testRange); int status(); diff --git a/test_conformance/non_uniform_work_group/main.cpp b/test_conformance/non_uniform_work_group/main.cpp index 46165c11..64eff96a 100644 --- a/test_conformance/non_uniform_work_group/main.cpp +++ b/test_conformance/non_uniform_work_group/main.cpp @@ -15,7 +15,7 @@ // #include "procs.h" #include "tools.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" #include "TestNonUniformWorkGroup.h" test_definition test_list[] = { @@ -38,6 +38,19 @@ test_definition test_list[] = { const int test_num = ARRAY_SIZE( test_list ); +test_status InitCL(cl_device_id device) { + auto version = get_device_cl_version(device); + auto expected_min_version = Version(2, 0); + if (version < expected_min_version) + { + version_expected_info("Test", "OpenCL", + expected_min_version.to_string().c_str(), + version.to_string().c_str()); + return TEST_SKIP; + } + return TEST_PASS; +} + int main(int argc, const char *argv[]) { typedef std::vector ArgsVector; @@ -56,6 +69,6 @@ int main(int argc, const char *argv[]) PrimeNumbers::generatePrimeNumbers(100000); - return runTestHarness(static_cast(programArgs.size()), &programArgs.front(), test_num, test_list, false, false, 0 ); + return runTestHarnessWithCheck(static_cast(programArgs.size()), &programArgs.front(), test_num, test_list, false, false, InitCL); } diff --git a/test_conformance/non_uniform_work_group/procs.h b/test_conformance/non_uniform_work_group/procs.h index 199bb836..cb49e87f 100644 --- a/test_conformance/non_uniform_work_group/procs.h +++ b/test_conformance/non_uniform_work_group/procs.h @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/typeWrappers.h" +#include "harness/typeWrappers.h" extern int test_non_uniform_1d_basic(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); extern int test_non_uniform_1d_atomics(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); diff --git a/test_conformance/non_uniform_work_group/tools.cpp b/test_conformance/non_uniform_work_group/tools.cpp index ef732d9d..9c0f8f6d 100644 --- a/test_conformance/non_uniform_work_group/tools.cpp +++ b/test_conformance/non_uniform_work_group/tools.cpp @@ -15,7 +15,7 @@ // #include "tools.h" #include -#include "../../test_common/harness/errorHelpers.h" +#include "harness/errorHelpers.h" PrimeNumbersCollection PrimeNumbers::primeNumbers; // Method generates prime numbers using Sieve of Eratosthenes algorithm diff --git a/test_conformance/opencl_conformance_tests_12_conversions.csv b/test_conformance/opencl_conformance_tests_12_conversions.csv new file mode 100644 index 00000000..c8e283a6 --- /dev/null +++ b/test_conformance/opencl_conformance_tests_12_conversions.csv @@ -0,0 +1,4 @@ +# +# OpenCL Conformance Test Suite (conversions only) +# +Conversions,conversions/test_conversions diff --git a/test_conformance/opencl_conformance_tests_12_d3d.csv b/test_conformance/opencl_conformance_tests_12_d3d.csv new file mode 100644 index 00000000..53466ebc --- /dev/null +++ b/test_conformance/opencl_conformance_tests_12_d3d.csv @@ -0,0 +1,5 @@ +# +# OpenCL Conformance Test for DirectX interop +# + +D3D10,D3D10/test_d3d10 diff --git a/test_conformance/opencl_conformance_tests_12_full.csv b/test_conformance/opencl_conformance_tests_12_full.csv new file mode 100644 index 00000000..bb732c40 --- /dev/null +++ b/test_conformance/opencl_conformance_tests_12_full.csv @@ -0,0 +1,81 @@ +# +# OpenCL Conformance Test Suite (full version) +# + +# ######################################### +# Basic Information on the compute device +# ######################################### +Compute Info,computeinfo/test_computeinfo + +# ######################################### +# Basic operation tests +# ######################################### +Basic,basic/test_basic +API,api/test_api +Compiler,compiler/test_compiler + +# ######################################### +# Common mathematical functions +# ######################################### +Common Functions,commonfns/test_commonfns +Geometric Functions,geometrics/test_geometrics +Relationals,relationals/test_relationals + +# ######################################### +# General operation +# ######################################### +Thread Dimensions,thread_dimensions/test_thread_dimensions full* +Multiple Device/Context,multiple_device_context/test_multiples +Atomics,atomics/test_atomics +Profiling,profiling/test_profiling +Events,events/test_events +Allocations (single maximum),allocations/test_allocations single 5 all +Allocations (total maximum),allocations/test_allocations multiple 5 all +Vectors, vectors/test_vectors +Printf,printf/test_printf +Device Partitioning,device_partition/test_device_partition + +# ######################################### +# Buffers and images +# ######################################### +Buffers,buffers/test_buffers +Images (API Info),images/clGetInfo/test_cl_get_info +Images (Kernel Methods),images/kernel_image_methods/test_kernel_image_methods +Images (Kernel),images/kernel_read_write/test_image_streams CL_FILTER_NEAREST +Images (Kernel pitch),images/kernel_read_write/test_image_streams use_pitches CL_FILTER_NEAREST +Images (Kernel max size),images/kernel_read_write/test_image_streams max_images CL_FILTER_NEAREST +Images (clCopyImage),images/clCopyImage/test_cl_copy_images +Images (clCopyImage small),images/clCopyImage/test_cl_copy_images small_images +Images (clCopyImage max size),images/clCopyImage/test_cl_copy_images max_images +Images (clReadWriteImage),images/clReadWriteImage/test_cl_read_write_images +Images (clReadWriteImage pitch),images/clReadWriteImage/test_cl_read_write_images use_pitches +Images (clReadWriteImage max size),images/clReadWriteImage/test_cl_read_write_images max_images +Images (clFillImage),images/clFillImage/test_cl_fill_images +Images (clFillImage pitch),images/clFillImage/test_cl_fill_images use_pitches +Images (clFillImage max size),images/clFillImage/test_cl_fill_images max_images +Images (Samplerless),images/samplerlessReads/test_samplerless_reads +Images (Samplerless pitch),images/samplerlessReads/test_samplerless_reads use_pitches +Images (Samplerless max size),images/samplerlessReads/test_samplerless_reads max_images +Mem (Host Flags),mem_host_flags/test_mem_host_flags + +# ######################################### +# CPU is required to pass linear and normalized image filtering +# ######################################### +CL_DEVICE_TYPE_CPU, Images (Kernel CL_FILTER_LINEAR),images/kernel_read_write/test_image_streams CL_FILTER_LINEAR +CL_DEVICE_TYPE_CPU, Images (Kernel CL_FILTER_LINEAR pitch),images/kernel_read_write/test_image_streams use_pitches CL_FILTER_LINEAR +CL_DEVICE_TYPE_CPU, Images (Kernel CL_FILTER_LINEAR max size),images/kernel_read_write/test_image_streams max_images CL_FILTER_LINEAR + +# ######################################### +# OpenGL/CL interaction +# ######################################### +OpenCL-GL Sharing,gl/test_gl + +# ######################################### +# Thorough math and conversions tests +# ######################################### +Select,select/test_select +Conversions,conversions/test_conversions +Contractions,contractions/test_contractions +Math,math_brute_force/test_bruteforce +Integer Ops,integer_ops/test_integer_ops +Half Ops,half/test_half diff --git a/test_conformance/opencl_conformance_tests_12_full_no_math_or_conversions.csv b/test_conformance/opencl_conformance_tests_12_full_no_math_or_conversions.csv new file mode 100644 index 00000000..fca9af4b --- /dev/null +++ b/test_conformance/opencl_conformance_tests_12_full_no_math_or_conversions.csv @@ -0,0 +1,78 @@ +# +# OpenCL Conformance Test Suite (full version) +# + +# ######################################### +# Basic Information on the compute device +# ######################################### +Compute Info,computeinfo/test_computeinfo + +# ######################################### +# Basic operation tests +# ######################################### +Basic,basic/test_basic +API,api/test_api +Compiler,compiler/test_compiler + +# ######################################### +# Common mathematical functions +# ######################################### +Common Functions,commonfns/test_commonfns +Geometric Functions,geometrics/test_geometrics +Relationals,relationals/test_relationals + +# ######################################### +# General operation +# ######################################### +Thread Dimensions,thread_dimensions/test_thread_dimensions full* +Multiple Device/Context,multiple_device_context/test_multiples +Atomics,atomics/test_atomics +Profiling,profiling/test_profiling +Events,events/test_events +Allocations (single maximum),allocations/test_allocations single 5 all +Allocations (total maximum),allocations/test_allocations multiple 5 all +Vectors, vectors/test_vectors + +# ######################################### +# Buffers and images +# ######################################### +Buffers,buffers/test_buffers +Images (API Info),images/clGetInfo/test_cl_get_info +Images (Kernel Methods),images/kernel_image_methods/test_kernel_image_methods +Images (Kernel),images/kernel_read_write/test_image_streams CL_FILTER_NEAREST +Images (Kernel pitch),images/kernel_read_write/test_image_streams use_pitches CL_FILTER_NEAREST +Images (Kernel max size),images/kernel_read_write/test_image_streams max_images CL_FILTER_NEAREST +Images (clCopyImage),images/clCopyImage/test_cl_copy_images +Images (clCopyImage small),images/clCopyImage/test_cl_copy_images small_images +Images (clCopyImage max size),images/clCopyImage/test_cl_copy_images max_images +Images (clReadWriteImage),images/clReadWriteImage/test_cl_read_write_images +Images (clReadWriteImage pitch),images/clReadWriteImage/test_cl_read_write_images use_pitches +Images (clReadWriteImage max size),images/clReadWriteImage/test_cl_read_write_images max_images +Images (clFillImage),images/clFillImage/test_cl_fill_images +Images (clFillImage pitch),images/clFillImage/test_cl_fill_images use_pitches +Images (clFillImage max size),images/clFillImage/test_cl_fill_images max_images +Images (Samplerless),images/samplerlessReads/test_samplerless_reads +Images (Samplerless pitch),images/samplerlessReads/test_samplerless_reads use_pitches +Images (Samplerless max size),images/samplerlessReads/test_samplerless_reads max_images +Mem (Host Flags),mem_host_flags/test_mem_host_flags + +# ######################################### +# CPU is required to pass linear and normalized image filtering +# ######################################### +CL_DEVICE_TYPE_CPU, Images (Kernel CL_FILTER_LINEAR),images/kernel_read_write/test_image_streams CL_FILTER_LINEAR +CL_DEVICE_TYPE_CPU, Images (Kernel CL_FILTER_LINEAR pitch),images/kernel_read_write/test_image_streams use_pitches CL_FILTER_LINEAR +CL_DEVICE_TYPE_CPU, Images (Kernel CL_FILTER_LINEAR max size),images/kernel_read_write/test_image_streams max_images CL_FILTER_LINEAR + +# ######################################### +# OpenGL/CL interaction +# ######################################### +OpenCL-GL Sharing,gl/test_gl + +# ######################################### +# Thorough math and conversions tests +# ######################################### +Select,select/test_select +Contractions,contractions/test_contractions +Integer Ops,integer_ops/test_integer_ops +Half Ops,half/test_half + diff --git a/test_conformance/opencl_conformance_tests_12_math.csv b/test_conformance/opencl_conformance_tests_12_math.csv new file mode 100644 index 00000000..e033190f --- /dev/null +++ b/test_conformance/opencl_conformance_tests_12_math.csv @@ -0,0 +1,4 @@ +# +# OpenCL Conformance Test Suite (math only) +# +Math,math_brute_force/test_bruteforce diff --git a/test_conformance/opencl_conformance_tests_12_quick.csv b/test_conformance/opencl_conformance_tests_12_quick.csv new file mode 100644 index 00000000..af591656 --- /dev/null +++ b/test_conformance/opencl_conformance_tests_12_quick.csv @@ -0,0 +1,81 @@ +# +# OpenCL Conformance Test Suite (quick version) +# The quick version skips some long-running image tests, runs a shorter math test, +# and does not run the conversion test. +# + +# ######################################### +# Basic Information on the compute device +# ######################################### +Compute Info,computeinfo/test_computeinfo + +# ######################################### +# Basic operation tests +# ######################################### +Basic,basic/test_basic +API,api/test_api +Compiler,compiler/test_compiler + +# ######################################### +# Common mathematical functions +# ######################################### +Common Functions,commonfns/test_commonfns +Geometric Functions,geometrics/test_geometrics +Relationals,relationals/test_relationals + +# ######################################### +# General operation +# ######################################### +Thread Dimensions,thread_dimensions/test_thread_dimensions quick* +#Multiple Device/Context,multiple_device_context/test_multiples +Atomics,atomics/test_atomics +Profiling,profiling/test_profiling +Events,events/test_events +Allocations (single maximum),allocations/test_allocations single 5 all +Allocations (total maximum),allocations/test_allocations multiple 5 all +Printf,printf/test_printf +Device Partitioning,device_partition/test_device_partition + +# ######################################### +# Buffers and images +# ######################################### +Buffers,buffers/test_buffers +Images (API Info),images/clGetInfo/test_cl_get_info +Images (Kernel Methods),images/kernel_image_methods/test_kernel_image_methods +Images (Kernel),images/kernel_read_write/test_image_streams CL_FILTER_NEAREST +Images (Kernel pitch),images/kernel_read_write/test_image_streams use_pitches CL_FILTER_NEAREST +Images (Kernel max size),images/kernel_read_write/test_image_streams max_images CL_FILTER_NEAREST +Images (clCopyImage),images/clCopyImage/test_cl_copy_images +Images (clCopyImage max size),images/clCopyImage/test_cl_copy_images max_images +Images (clReadWriteImage),images/clReadWriteImage/test_cl_read_write_images +Images (clReadWriteImage pitch),images/clReadWriteImage/test_cl_read_write_images use_pitches +Images (clReadWriteImage max size),images/clReadWriteImage/test_cl_read_write_images max_images +Images (clFillImage),images/clFillImage/test_cl_fill_images +Images (clFillImage pitch),images/clFillImage/test_cl_fill_images use_pitches +Images (clFillImage max size),images/clFillImage/test_cl_fill_images max_images +Images (Samplerless),images/samplerlessReads/test_samplerless_reads +Images (Samplerless pitch),images/samplerlessReads/test_samplerless_reads use_pitches +Images (Samplerless max size),images/samplerlessReads/test_samplerless_reads max_images +Mem (Host Flags),mem_host_flags/test_mem_host_flags + +# ######################################### +# CPU is required to pass linear and normalized image filtering +# ######################################### +CL_DEVICE_TYPE_CPU, Images (Kernel CL_FILTER_LINEAR),images/kernel_read_write/test_image_streams CL_FILTER_LINEAR +CL_DEVICE_TYPE_CPU, Images (Kernel CL_FILTER_LINEAR pitch),images/kernel_read_write/test_image_streams use_pitches CL_FILTER_LINEAR +CL_DEVICE_TYPE_CPU, Images (Kernel CL_FILTER_LINEAR max size),images/kernel_read_write/test_image_streams max_images CL_FILTER_LINEAR + +# ######################################### +# OpenGL/CL interaction +# ######################################### +OpenCL-GL Sharing,gl/test_gl + +# ######################################### +# Thorough math and conversions tests +# ######################################### +Select,select/test_select +#Conversions,conversions/test_conversions +Contractions,contractions/test_contractions +Math,math_brute_force/test_bruteforce -w +Integer Ops,integer_ops/test_integer_ops integer_* quick_* +Half Ops,half/test_half -w diff --git a/test_conformance/opencl_conformance_tests_20_full.csv b/test_conformance/opencl_conformance_tests_20_full.csv new file mode 100644 index 00000000..e5320bb4 --- /dev/null +++ b/test_conformance/opencl_conformance_tests_20_full.csv @@ -0,0 +1,101 @@ +# +# OpenCL Conformance Test Suite (full version) +# + +# ######################################### +# Basic Information on the compute device +# ######################################### +Compute Info,computeinfo/test_computeinfo + +# ######################################### +# Basic operation tests +# ######################################### +Basic,basic/test_basic +API,api/test_api +Compiler,compiler/test_compiler + +# ######################################### +# Common mathematical functions +# ######################################### +Common Functions,commonfns/test_commonfns +Geometric Functions,geometrics/test_geometrics +Relationals,relationals/test_relationals + +# ######################################### +# General operation +# ######################################### +Thread Dimensions,thread_dimensions/test_thread_dimensions full* +Multiple Device/Context,multiple_device_context/test_multiples +Atomics,atomics/test_atomics +Profiling,profiling/test_profiling +Events,events/test_events +Allocations (single maximum),allocations/test_allocations single 5 all +Allocations (total maximum),allocations/test_allocations multiple 5 all +Vectors, vectors/test_vectors +Printf,printf/test_printf +Device Partitioning,device_partition/test_device_partition + +# ######################################### +# Buffers and images +# ######################################### +Buffers,buffers/test_buffers +Images (API Info),images/clGetInfo/test_cl_get_info +Images (Kernel Methods),images/kernel_image_methods/test_kernel_image_methods +Images (Kernel),images/kernel_read_write/test_image_streams CL_FILTER_NEAREST +Images (Kernel pitch),images/kernel_read_write/test_image_streams use_pitches CL_FILTER_NEAREST +Images (Kernel max size),images/kernel_read_write/test_image_streams max_images CL_FILTER_NEAREST +Images (clCopyImage),images/clCopyImage/test_cl_copy_images +Images (clCopyImage small),images/clCopyImage/test_cl_copy_images small_images +Images (clCopyImage max size),images/clCopyImage/test_cl_copy_images max_images +Images (clReadWriteImage),images/clReadWriteImage/test_cl_read_write_images +Images (clReadWriteImage pitch),images/clReadWriteImage/test_cl_read_write_images use_pitches +Images (clReadWriteImage max size),images/clReadWriteImage/test_cl_read_write_images max_images +Images (clFillImage),images/clFillImage/test_cl_fill_images +Images (clFillImage pitch),images/clFillImage/test_cl_fill_images use_pitches +Images (clFillImage max size),images/clFillImage/test_cl_fill_images max_images +Images (Samplerless),images/samplerlessReads/test_samplerless_reads +Images (Samplerless pitch),images/samplerlessReads/test_samplerless_reads use_pitches +Images (Samplerless max size),images/samplerlessReads/test_samplerless_reads max_images +Mem (Host Flags),mem_host_flags/test_mem_host_flags + +# ######################################### +# CPU is required to pass linear and normalized image filtering +# ######################################### +CL_DEVICE_TYPE_CPU, Images (Kernel CL_FILTER_LINEAR),images/kernel_read_write/test_image_streams CL_FILTER_LINEAR +CL_DEVICE_TYPE_CPU, Images (Kernel CL_FILTER_LINEAR pitch),images/kernel_read_write/test_image_streams use_pitches CL_FILTER_LINEAR +CL_DEVICE_TYPE_CPU, Images (Kernel CL_FILTER_LINEAR max size),images/kernel_read_write/test_image_streams max_images CL_FILTER_LINEAR + +# ######################################### +# OpenGL/CL interaction +# ######################################### +OpenCL-GL Sharing,gl/test_gl + +# ######################################### +# Thorough math and conversions tests +# ######################################### +Select,select/test_select +Conversions,conversions/test_conversions +Contractions,contractions/test_contractions +Math,math_brute_force/test_bruteforce +Integer Ops,integer_ops/test_integer_ops +Half Ops,half/test_half + +##################################### +# OpenCL 2.0 tests +##################################### +C11 Atomics,c11_atomics/test_c11_atomics +Execution Model,device_execution/test_device_execution +Generic Address Space,generic_address_space/test_generic_address_space +Non Uniform Work Groups,non_uniform_work_group/test_non_uniform_work_group +Pipes,pipes/test_pipes +SVM,SVM/test_svm +Workgroups,workgroups/test_workgroups + +######################################### +# Extensions +######################################### +SPIR,spir/test_spir +Mipmaps (Kernel),images/kernel_read_write/test_image_streams test_mipmaps CL_FILTER_NEAREST +Mipmaps (clCopyImage),images/clCopyImage/test_cl_copy_images test_mipmaps +Mipmaps (clReadWriteImage),images/clReadWriteImage/test_cl_read_write_images test_mipmaps +Subgroups,subgroups/test_subgroups diff --git a/test_conformance/opencl_conformance_tests_20_full_no_math_or_conversions.csv b/test_conformance/opencl_conformance_tests_20_full_no_math_or_conversions.csv new file mode 100644 index 00000000..fca9af4b --- /dev/null +++ b/test_conformance/opencl_conformance_tests_20_full_no_math_or_conversions.csv @@ -0,0 +1,78 @@ +# +# OpenCL Conformance Test Suite (full version) +# + +# ######################################### +# Basic Information on the compute device +# ######################################### +Compute Info,computeinfo/test_computeinfo + +# ######################################### +# Basic operation tests +# ######################################### +Basic,basic/test_basic +API,api/test_api +Compiler,compiler/test_compiler + +# ######################################### +# Common mathematical functions +# ######################################### +Common Functions,commonfns/test_commonfns +Geometric Functions,geometrics/test_geometrics +Relationals,relationals/test_relationals + +# ######################################### +# General operation +# ######################################### +Thread Dimensions,thread_dimensions/test_thread_dimensions full* +Multiple Device/Context,multiple_device_context/test_multiples +Atomics,atomics/test_atomics +Profiling,profiling/test_profiling +Events,events/test_events +Allocations (single maximum),allocations/test_allocations single 5 all +Allocations (total maximum),allocations/test_allocations multiple 5 all +Vectors, vectors/test_vectors + +# ######################################### +# Buffers and images +# ######################################### +Buffers,buffers/test_buffers +Images (API Info),images/clGetInfo/test_cl_get_info +Images (Kernel Methods),images/kernel_image_methods/test_kernel_image_methods +Images (Kernel),images/kernel_read_write/test_image_streams CL_FILTER_NEAREST +Images (Kernel pitch),images/kernel_read_write/test_image_streams use_pitches CL_FILTER_NEAREST +Images (Kernel max size),images/kernel_read_write/test_image_streams max_images CL_FILTER_NEAREST +Images (clCopyImage),images/clCopyImage/test_cl_copy_images +Images (clCopyImage small),images/clCopyImage/test_cl_copy_images small_images +Images (clCopyImage max size),images/clCopyImage/test_cl_copy_images max_images +Images (clReadWriteImage),images/clReadWriteImage/test_cl_read_write_images +Images (clReadWriteImage pitch),images/clReadWriteImage/test_cl_read_write_images use_pitches +Images (clReadWriteImage max size),images/clReadWriteImage/test_cl_read_write_images max_images +Images (clFillImage),images/clFillImage/test_cl_fill_images +Images (clFillImage pitch),images/clFillImage/test_cl_fill_images use_pitches +Images (clFillImage max size),images/clFillImage/test_cl_fill_images max_images +Images (Samplerless),images/samplerlessReads/test_samplerless_reads +Images (Samplerless pitch),images/samplerlessReads/test_samplerless_reads use_pitches +Images (Samplerless max size),images/samplerlessReads/test_samplerless_reads max_images +Mem (Host Flags),mem_host_flags/test_mem_host_flags + +# ######################################### +# CPU is required to pass linear and normalized image filtering +# ######################################### +CL_DEVICE_TYPE_CPU, Images (Kernel CL_FILTER_LINEAR),images/kernel_read_write/test_image_streams CL_FILTER_LINEAR +CL_DEVICE_TYPE_CPU, Images (Kernel CL_FILTER_LINEAR pitch),images/kernel_read_write/test_image_streams use_pitches CL_FILTER_LINEAR +CL_DEVICE_TYPE_CPU, Images (Kernel CL_FILTER_LINEAR max size),images/kernel_read_write/test_image_streams max_images CL_FILTER_LINEAR + +# ######################################### +# OpenGL/CL interaction +# ######################################### +OpenCL-GL Sharing,gl/test_gl + +# ######################################### +# Thorough math and conversions tests +# ######################################### +Select,select/test_select +Contractions,contractions/test_contractions +Integer Ops,integer_ops/test_integer_ops +Half Ops,half/test_half + diff --git a/test_conformance/opencl_conformance_tests_20_quick.csv b/test_conformance/opencl_conformance_tests_20_quick.csv new file mode 100644 index 00000000..af591656 --- /dev/null +++ b/test_conformance/opencl_conformance_tests_20_quick.csv @@ -0,0 +1,81 @@ +# +# OpenCL Conformance Test Suite (quick version) +# The quick version skips some long-running image tests, runs a shorter math test, +# and does not run the conversion test. +# + +# ######################################### +# Basic Information on the compute device +# ######################################### +Compute Info,computeinfo/test_computeinfo + +# ######################################### +# Basic operation tests +# ######################################### +Basic,basic/test_basic +API,api/test_api +Compiler,compiler/test_compiler + +# ######################################### +# Common mathematical functions +# ######################################### +Common Functions,commonfns/test_commonfns +Geometric Functions,geometrics/test_geometrics +Relationals,relationals/test_relationals + +# ######################################### +# General operation +# ######################################### +Thread Dimensions,thread_dimensions/test_thread_dimensions quick* +#Multiple Device/Context,multiple_device_context/test_multiples +Atomics,atomics/test_atomics +Profiling,profiling/test_profiling +Events,events/test_events +Allocations (single maximum),allocations/test_allocations single 5 all +Allocations (total maximum),allocations/test_allocations multiple 5 all +Printf,printf/test_printf +Device Partitioning,device_partition/test_device_partition + +# ######################################### +# Buffers and images +# ######################################### +Buffers,buffers/test_buffers +Images (API Info),images/clGetInfo/test_cl_get_info +Images (Kernel Methods),images/kernel_image_methods/test_kernel_image_methods +Images (Kernel),images/kernel_read_write/test_image_streams CL_FILTER_NEAREST +Images (Kernel pitch),images/kernel_read_write/test_image_streams use_pitches CL_FILTER_NEAREST +Images (Kernel max size),images/kernel_read_write/test_image_streams max_images CL_FILTER_NEAREST +Images (clCopyImage),images/clCopyImage/test_cl_copy_images +Images (clCopyImage max size),images/clCopyImage/test_cl_copy_images max_images +Images (clReadWriteImage),images/clReadWriteImage/test_cl_read_write_images +Images (clReadWriteImage pitch),images/clReadWriteImage/test_cl_read_write_images use_pitches +Images (clReadWriteImage max size),images/clReadWriteImage/test_cl_read_write_images max_images +Images (clFillImage),images/clFillImage/test_cl_fill_images +Images (clFillImage pitch),images/clFillImage/test_cl_fill_images use_pitches +Images (clFillImage max size),images/clFillImage/test_cl_fill_images max_images +Images (Samplerless),images/samplerlessReads/test_samplerless_reads +Images (Samplerless pitch),images/samplerlessReads/test_samplerless_reads use_pitches +Images (Samplerless max size),images/samplerlessReads/test_samplerless_reads max_images +Mem (Host Flags),mem_host_flags/test_mem_host_flags + +# ######################################### +# CPU is required to pass linear and normalized image filtering +# ######################################### +CL_DEVICE_TYPE_CPU, Images (Kernel CL_FILTER_LINEAR),images/kernel_read_write/test_image_streams CL_FILTER_LINEAR +CL_DEVICE_TYPE_CPU, Images (Kernel CL_FILTER_LINEAR pitch),images/kernel_read_write/test_image_streams use_pitches CL_FILTER_LINEAR +CL_DEVICE_TYPE_CPU, Images (Kernel CL_FILTER_LINEAR max size),images/kernel_read_write/test_image_streams max_images CL_FILTER_LINEAR + +# ######################################### +# OpenGL/CL interaction +# ######################################### +OpenCL-GL Sharing,gl/test_gl + +# ######################################### +# Thorough math and conversions tests +# ######################################### +Select,select/test_select +#Conversions,conversions/test_conversions +Contractions,contractions/test_contractions +Math,math_brute_force/test_bruteforce -w +Integer Ops,integer_ops/test_integer_ops integer_* quick_* +Half Ops,half/test_half -w diff --git a/test_conformance/opencl_conformance_tests_21_full_spirv.csv b/test_conformance/opencl_conformance_tests_21_full_spirv.csv index cf4921f9..1c2b7499 100644 --- a/test_conformance/opencl_conformance_tests_21_full_spirv.csv +++ b/test_conformance/opencl_conformance_tests_21_full_spirv.csv @@ -10,41 +10,40 @@ Compute Info,computeinfo/test_computeinfo # ######################################### # Basic operation tests # ######################################### -Basic,basic/test_basic -offlineCompiler spir_v cache . -API,api/test_api -offlineCompiler spir_v cache . -Compiler,compiler/test_compiler -offlineCompiler spir_v cache . +Basic,basic/test_basic --compilation-mode spir-v --compilation-cache-path . +API,api/test_api --compilation-mode spir-v --compilation-cache-path . +Compiler,compiler/test_compiler --compilation-mode spir-v --compilation-cache-path . # ######################################### # Common mathematical functions # ######################################### -Common Functions,commonfns/test_commonfns -offlineCompiler spir_v cache . -Geometric Functions,geometrics/test_geometrics -offlineCompiler spir_v cache . -Relationals,relationals/test_relationals -offlineCompiler spir_v cache . +Common Functions,commonfns/test_commonfns --compilation-mode spir-v --compilation-cache-path . +Geometric Functions,geometrics/test_geometrics --compilation-mode spir-v --compilation-cache-path . +Relationals,relationals/test_relationals --compilation-mode spir-v --compilation-cache-path . # ######################################### # General operation # ######################################### -Thread Dimensions,thread_dimensions/test_thread_dimensions full* -offlineCompiler spir_v cache . -Multiple Device/Context,multiple_device_context/test_multiples -offlineCompiler spir_v cache . -Atomics,atomics/test_atomics -offlineCompiler spir_v cache . -Profiling,profiling/test_profiling -offlineCompiler spir_v cache . -Events,events/test_events -offlineCompiler spir_v cache . -Allocations (single maximum),allocations/test_allocations single 5 all -offlineCompiler spir_v cache . -Allocations (total maximum),allocations/test_allocations multiple 5 all -offlineCompiler spir_v cache . -VecAlign, vec_align/test_vecalign -offlineCompiler spir_v cache . -VecStep, vec_step/test_vecstep -offlineCompiler spir_v cache . -Printf,printf/test_printf -offlineCompiler spir_v cache . -Device Partitioning,device_partition/test_device_partition -offlineCompiler spir_v cache . +Thread Dimensions,thread_dimensions/test_thread_dimensions full* --compilation-mode spir-v --compilation-cache-path . +Multiple Device/Context,multiple_device_context/test_multiples --compilation-mode spir-v --compilation-cache-path . +Atomics,atomics/test_atomics --compilation-mode spir-v --compilation-cache-path . +Profiling,profiling/test_profiling --compilation-mode spir-v --compilation-cache-path . +Events,events/test_events --compilation-mode spir-v --compilation-cache-path . +Allocations (single maximum),allocations/test_allocations single 5 all --compilation-mode spir-v --compilation-cache-path . +Allocations (total maximum),allocations/test_allocations multiple 5 all --compilation-mode spir-v --compilation-cache-path . +Vectors, vectors/test_vectors --compilation-mode spir-v --compilation-cache-path . +Printf,printf/test_printf --compilation-mode spir-v --compilation-cache-path . +Device Partitioning,device_partition/test_device_partition --compilation-mode spir-v --compilation-cache-path . # ######################################### # Buffers and images # ######################################### Images (API Info),images/clGetInfo/test_cl_get_info -Buffers,buffers/test_buffers -offlineCompiler spir_v cache . -Images (Kernel Methods),images/kernel_image_methods/test_kernel_image_methods -offlineCompiler spir_v cache . -Images (Kernel),images/kernel_read_write/test_image_streams CL_FILTER_NEAREST -offlineCompiler spir_v cache . -Images (Kernel pitch),images/kernel_read_write/test_image_streams use_pitches CL_FILTER_NEAREST -offlineCompiler spir_v cache . -Images (Kernel max size),images/kernel_read_write/test_image_streams max_images CL_FILTER_NEAREST -offlineCompiler spir_v cache . +Buffers,buffers/test_buffers --compilation-mode spir-v --compilation-cache-path . +Images (Kernel Methods),images/kernel_image_methods/test_kernel_image_methods --compilation-mode spir-v --compilation-cache-path . +Images (Kernel),images/kernel_read_write/test_image_streams CL_FILTER_NEAREST --compilation-mode spir-v --compilation-cache-path . +Images (Kernel pitch),images/kernel_read_write/test_image_streams use_pitches CL_FILTER_NEAREST --compilation-mode spir-v --compilation-cache-path . +Images (Kernel max size),images/kernel_read_write/test_image_streams max_images CL_FILTER_NEAREST --compilation-mode spir-v --compilation-cache-path . Images (clCopyImage),images/clCopyImage/test_cl_copy_images Images (clCopyImage small),images/clCopyImage/test_cl_copy_images small_images Images (clCopyImage max size),images/clCopyImage/test_cl_copy_images max_images @@ -54,69 +53,55 @@ Images (clReadWriteImage max size),images/clReadWriteImage/test_cl_read_write_im Images (clFillImage),images/clFillImage/test_cl_fill_images Images (clFillImage pitch),images/clFillImage/test_cl_fill_images use_pitches Images (clFillImage max size),images/clFillImage/test_cl_fill_images max_images -Images (Samplerless),images/samplerlessReads/test_samplerless_reads -offlineCompiler spir_v cache . -Images (Samplerless pitch),images/samplerlessReads/test_samplerless_reads use_pitches -offlineCompiler spir_v cache . -Images (Samplerless max size),images/samplerlessReads/test_samplerless_reads max_images -offlineCompiler spir_v cache . +Images (Samplerless),images/samplerlessReads/test_samplerless_reads --compilation-mode spir-v --compilation-cache-path . +Images (Samplerless pitch),images/samplerlessReads/test_samplerless_reads use_pitches --compilation-mode spir-v --compilation-cache-path . +Images (Samplerless max size),images/samplerlessReads/test_samplerless_reads max_images --compilation-mode spir-v --compilation-cache-path . Mem (Host Flags),mem_host_flags/test_mem_host_flags -# ######################################### -# Headers -# ######################################### -Headers (cl_typen), headers/test_headers -Headers (cl.h standalone), headers/test_cl_h -Headers (cl_platform.h standalone), headers/test_cl_platform_h -Headers (cl_gl.h standalone), headers/test_cl_gl_h -Headers (opencl.h standalone), headers/test_opencl_h - # ######################################### # CPU is required to pass linear and normalized image filtering # ######################################### -CL_DEVICE_TYPE_CPU, Images (Kernel CL_FILTER_LINEAR),images/kernel_read_write/test_image_streams CL_FILTER_LINEAR -offlineCompiler spir_v cache . -CL_DEVICE_TYPE_CPU, Images (Kernel CL_FILTER_LINEAR pitch),images/kernel_read_write/test_image_streams use_pitches CL_FILTER_LINEAR -offlineCompiler spir_v cache . -CL_DEVICE_TYPE_CPU, Images (Kernel CL_FILTER_LINEAR max size),images/kernel_read_write/test_image_streams max_images CL_FILTER_LINEAR -offlineCompiler spir_v cache . +CL_DEVICE_TYPE_CPU, Images (Kernel CL_FILTER_LINEAR),images/kernel_read_write/test_image_streams CL_FILTER_LINEAR --compilation-mode spir-v --compilation-cache-path . +CL_DEVICE_TYPE_CPU, Images (Kernel CL_FILTER_LINEAR pitch),images/kernel_read_write/test_image_streams use_pitches CL_FILTER_LINEAR --compilation-mode spir-v --compilation-cache-path . +CL_DEVICE_TYPE_CPU, Images (Kernel CL_FILTER_LINEAR max size),images/kernel_read_write/test_image_streams max_images CL_FILTER_LINEAR --compilation-mode spir-v --compilation-cache-path . # ######################################### # OpenGL/CL interaction # ######################################### -OpenCL-GL Sharing,gl/test_gl -offlineCompiler spir_v cache . +OpenCL-GL Sharing,gl/test_gl --compilation-mode spir-v --compilation-cache-path . # ######################################### # Thorough math and conversions tests # ######################################### -Select,select/test_select -offlineCompiler spir_v cache . -Conversions,conversions/test_conversions -offlineCompiler spir_v cache . -Contractions,contractions/contractions -offlineCompiler spir_v cache . -Math,math_brute_force/bruteforce -offlineCompiler spir_v cache . -Integer Ops,integer_ops/test_integer_ops -offlineCompiler spir_v cache . -Half Ops,half/Test_half -offlineCompiler spir_v cache . - -# ######################################### -# Compatibility with Previous Versions -# ######################################### -Basic 1.2,compatibility/test_conformance/basic/test_basic -API 1.2,compatibility/test_conformance/api/test_api +Select,select/test_select --compilation-mode spir-v --compilation-cache-path . +Conversions,conversions/test_conversions --compilation-mode spir-v --compilation-cache-path . +Contractions,contractions/test_contractions --compilation-mode spir-v --compilation-cache-path . +Math,math_brute_force/test_bruteforce --compilation-mode spir-v --compilation-cache-path . +Integer Ops,integer_ops/test_integer_ops --compilation-mode spir-v --compilation-cache-path . +Half Ops,half/test_half --compilation-mode spir-v --compilation-cache-path . ##################################### # OpenCL 2.0 tests ##################################### -C11 Atomics,c11_atomics/test_c11_atomics -offlineCompiler spir_v cache . -Execution Model,device_execution/test_device_execution -offlineCompiler spir_v cache . -Generic Address Space,generic_address_space/test_generic_address_space -offlineCompiler spir_v cache . -Non Uniform Work Groups,non_uniform_work_group/test_non_uniform_work_group -offlineCompiler spir_v cache . -Pipes,pipes/test_pipes -offlineCompiler spir_v cache . -SVM,SVM/test_SVM -offlineCompiler spir_v cache . -Workgroups,workgroups/test_workgroups -offlineCompiler spir_v cache . +C11 Atomics,c11_atomics/test_c11_atomics --compilation-mode spir-v --compilation-cache-path . +Execution Model,device_execution/test_device_execution --compilation-mode spir-v --compilation-cache-path . +Generic Address Space,generic_address_space/test_generic_address_space --compilation-mode spir-v --compilation-cache-path . +Non Uniform Work Groups,non_uniform_work_group/test_non_uniform_work_group --compilation-mode spir-v --compilation-cache-path . +Pipes,pipes/test_pipes --compilation-mode spir-v --compilation-cache-path . +SVM,SVM/test_svm --compilation-mode spir-v --compilation-cache-path . +Workgroups,workgroups/test_workgroups --compilation-mode spir-v --compilation-cache-path . ##################################### # OpenCL 2.1 tests ##################################### Device timer,device_timer/test_device_timer +SPIRV new,spirv_new/test_spirv_new -ILPath spirv_bin ######################################### # Extensions ######################################### SPIR,spir/test_spir -Mipmaps (Kernel),images/kernel_read_write/test_image_streams test_mipmaps CL_FILTER_NEAREST -offlineCompiler spir_v cache . -Mipmaps (clCopyImage),images/clCopyImage/test_cl_copy_images test_mipmaps -offlineCompiler spir_v cache . -Mipmaps (clReadWriteImage),images/clReadWriteImage/test_cl_read_write_images test_mipmaps -offlineCompiler spir_v cache . -Subgroups,subgroups/test_subgroups -offlineCompiler spir_v cache . +Mipmaps (Kernel),images/kernel_read_write/test_image_streams test_mipmaps CL_FILTER_NEAREST --compilation-mode spir-v --compilation-cache-path . +Mipmaps (clCopyImage),images/clCopyImage/test_cl_copy_images test_mipmaps --compilation-mode spir-v --compilation-cache-path . +Mipmaps (clReadWriteImage),images/clReadWriteImage/test_cl_read_write_images test_mipmaps --compilation-mode spir-v --compilation-cache-path . +Subgroups,subgroups/test_subgroups --compilation-mode spir-v --compilation-cache-path . diff --git a/test_conformance/opencl_conformance_tests_21_legacy_wimpy.csv b/test_conformance/opencl_conformance_tests_21_legacy_wimpy.csv index 2415d745..610a2945 100644 --- a/test_conformance/opencl_conformance_tests_21_legacy_wimpy.csv +++ b/test_conformance/opencl_conformance_tests_21_legacy_wimpy.csv @@ -33,8 +33,7 @@ Profiling,profiling/test_profiling Events,events/test_events Allocations (single maximum),allocations/test_allocations single 5 all Allocations (total maximum),allocations/test_allocations multiple 5 all -VecAlign, vec_align/test_vecalign -VecStep, vec_step/test_vecstep +Vectors, vectors/test_vectors Printf,printf/test_printf Device Partitioning,device_partition/test_device_partition @@ -51,15 +50,6 @@ Images (Samplerless pitch),images/samplerlessReads/test_samplerless_reads use_pi Images (Samplerless max size),images/samplerlessReads/test_samplerless_reads max_images Mem (Host Flags),mem_host_flags/test_mem_host_flags -# ######################################### -# Headers -# ######################################### -Headers (cl_typen), headers/test_headers -Headers (cl.h standalone), headers/test_cl_h -Headers (cl_platform.h standalone), headers/test_cl_platform_h -Headers (cl_gl.h standalone), headers/test_cl_gl_h -Headers (opencl.h standalone), headers/test_opencl_h - # ######################################### # CPU is required to pass linear and normalized image filtering # ######################################### @@ -77,10 +67,10 @@ OpenCL-GL Sharing,gl/test_gl # ######################################### Select,select/test_select Conversions,conversions/test_conversions -w -Contractions,contractions/contractions -Math,math_brute_force/bruteforce -w +Contractions,contractions/test_contractions +Math,math_brute_force/test_bruteforce -w Integer Ops,integer_ops/test_integer_ops integer_* quick_* -Half Ops,half/Test_half -w +Half Ops,half/test_half -w ##################################### # OpenCL 2.0 tests @@ -90,7 +80,7 @@ Execution Model,device_execution/test_device_execution Generic Address Space,generic_address_space/test_generic_address_space Non Uniform Work Groups,non_uniform_work_group/test_non_uniform_work_group Pipes,pipes/test_pipes -SVM,SVM/test_SVM +SVM,SVM/test_svm Workgroups,workgroups/test_workgroups ##################################### @@ -106,4 +96,4 @@ SPIR,spir/test_spir Mipmaps (Kernel),images/kernel_read_write/test_image_streams test_mipmaps CL_FILTER_NEAREST Mipmaps (clCopyImage),images/clCopyImage/test_cl_copy_images test_mipmaps Mipmaps (clReadWriteImage),images/clReadWriteImage/test_cl_read_write_images test_mipmaps -Subgroups,subgroups/test_subgroups \ No newline at end of file +Subgroups,subgroups/test_subgroups diff --git a/test_conformance/opencl_conformance_tests_full.csv b/test_conformance/opencl_conformance_tests_full.csv index 380870e0..efd004e6 100644 --- a/test_conformance/opencl_conformance_tests_full.csv +++ b/test_conformance/opencl_conformance_tests_full.csv @@ -31,8 +31,7 @@ Profiling,profiling/test_profiling Events,events/test_events Allocations (single maximum),allocations/test_allocations single 5 all Allocations (total maximum),allocations/test_allocations multiple 5 all -VecAlign, vec_align/test_vecalign -VecStep, vec_step/test_vecstep +Vectors, vectors/test_vectors Printf,printf/test_printf Device Partitioning,device_partition/test_device_partition @@ -59,15 +58,6 @@ Images (Samplerless pitch),images/samplerlessReads/test_samplerless_reads use_pi Images (Samplerless max size),images/samplerlessReads/test_samplerless_reads max_images Mem (Host Flags),mem_host_flags/test_mem_host_flags -# ######################################### -# Headers -# ######################################### -Headers (cl_typen), headers/test_headers -Headers (cl.h standalone), headers/test_cl_h -Headers (cl_platform.h standalone), headers/test_cl_platform_h -Headers (cl_gl.h standalone), headers/test_cl_gl_h -Headers (opencl.h standalone), headers/test_opencl_h - # ######################################### # CPU is required to pass linear and normalized image filtering # ######################################### @@ -85,17 +75,11 @@ OpenCL-GL Sharing,gl/test_gl # ######################################### Select,select/test_select Conversions,conversions/test_conversions -Contractions,contractions/contractions -Math,math_brute_force/bruteforce +Contractions,contractions/test_contractions +Math,math_brute_force/test_bruteforce Integer Ops,integer_ops/test_integer_ops Half Ops,half/test_half -# ######################################### -# Compatibility with Previous Versions -# ######################################### -Basic 1.2,compatibility/test_conformance/basic/test_basic -API 1.2,compatibility/test_conformance/api/test_api - ##################################### # OpenCL 2.0 tests ##################################### @@ -104,9 +88,15 @@ Execution Model,device_execution/test_device_execution Generic Address Space,generic_address_space/test_generic_address_space Non Uniform Work Groups,non_uniform_work_group/test_non_uniform_work_group Pipes,pipes/test_pipes -SVM,SVM/test_SVM +SVM,SVM/test_svm Workgroups,workgroups/test_workgroups +##################################### +# OpenCL 2.1 tests +##################################### +Device timer,device_timer/test_device_timer +SPIRV new,spirv_new/test_spirv_new -ILPath spirv_bin + ######################################### # Extensions ######################################### @@ -114,4 +104,4 @@ SPIR,spir/test_spir Mipmaps (Kernel),images/kernel_read_write/test_image_streams test_mipmaps CL_FILTER_NEAREST Mipmaps (clCopyImage),images/clCopyImage/test_cl_copy_images test_mipmaps Mipmaps (clReadWriteImage),images/clReadWriteImage/test_cl_read_write_images test_mipmaps -Subgroups,subgroups/test_subgroups \ No newline at end of file +Subgroups,subgroups/test_subgroups diff --git a/test_conformance/opencl_conformance_tests_full_no_math_or_conversions.csv b/test_conformance/opencl_conformance_tests_full_no_math_or_conversions.csv index b52f20c0..f14e0991 100644 --- a/test_conformance/opencl_conformance_tests_full_no_math_or_conversions.csv +++ b/test_conformance/opencl_conformance_tests_full_no_math_or_conversions.csv @@ -1,5 +1,5 @@ # -# OpenCL Conformance Test Suite (full version) +# OpenCL Conformance Test Suite (no math and no conversion) # # ######################################### @@ -31,8 +31,9 @@ Profiling,profiling/test_profiling Events,events/test_events Allocations (single maximum),allocations/test_allocations single 5 all Allocations (total maximum),allocations/test_allocations multiple 5 all -VecAlign, vec_align/test_vecalign -VecStep, vec_step/test_vecstep +Vectors, vectors/test_vectors +Printf,printf/test_printf +Device Partitioning,device_partition/test_device_partition # ######################################### # Buffers and images @@ -57,19 +58,6 @@ Images (Samplerless pitch),images/samplerlessReads/test_samplerless_reads use_pi Images (Samplerless max size),images/samplerlessReads/test_samplerless_reads max_images Mem (Host Flags),mem_host_flags/test_mem_host_flags -# ######################################### -# Headers -# ######################################### -Headers (cl_typen), headers/test_headers -Headers (cl.h standalone), headers/test_cl_h -Headers (cl_platform.h standalone), headers/test_cl_platform_h -Headers (cl_gl.h standalone), headers/test_cl_gl_h -Headers (opencl.h standalone), headers/test_opencl_h -Headers (cl.h standalone C99), headers/test_cl_h_c99 -Headers (cl_platform.h standalone C99), headers/test_cl_platform_h_c99 -Headers (cl_gl.h standalone C99), headers/test_cl_gl_h_c99 -Headers (opencl.h standalone C99), headers/test_opencl_h_c99 - # ######################################### # CPU is required to pass linear and normalized image filtering # ######################################### @@ -86,7 +74,32 @@ OpenCL-GL Sharing,gl/test_gl # Thorough math and conversions tests # ######################################### Select,select/test_select -Contractions,contractions/contractions +Contractions,contractions/test_contractions Integer Ops,integer_ops/test_integer_ops -Half Ops,half/Test_half +Half Ops,half/test_half +##################################### +# OpenCL 2.0 tests +##################################### +C11 Atomics,c11_atomics/test_c11_atomics +Execution Model,device_execution/test_device_execution +Generic Address Space,generic_address_space/test_generic_address_space +Non Uniform Work Groups,non_uniform_work_group/test_non_uniform_work_group +Pipes,pipes/test_pipes +SVM,SVM/test_svm +Workgroups,workgroups/test_workgroups + +##################################### +# OpenCL 2.1 tests +##################################### +Device timer,device_timer/test_device_timer +SPIRV new,spirv_new/test_spirv_new -ILPath spirv_bin + +######################################### +# Extensions +######################################### +SPIR,spir/test_spir +Mipmaps (Kernel),images/kernel_read_write/test_image_streams test_mipmaps CL_FILTER_NEAREST +Mipmaps (clCopyImage),images/clCopyImage/test_cl_copy_images test_mipmaps +Mipmaps (clReadWriteImage),images/clReadWriteImage/test_cl_read_write_images test_mipmaps +Subgroups,subgroups/test_subgroups diff --git a/test_conformance/opencl_conformance_tests_generate_spirv.csv b/test_conformance/opencl_conformance_tests_generate_spirv.csv deleted file mode 100644 index 1d5baf66..00000000 --- a/test_conformance/opencl_conformance_tests_generate_spirv.csv +++ /dev/null @@ -1,73 +0,0 @@ -# -# OpenCL Conformance Test Suite (generate spirv binaries) -# - -# ######################################### -# Basic operation tests -# ######################################### -Basic,basic/test_basic -offlineCompiler spir_v generate . -API,api/test_api -offlineCompiler spir_v generate . -Compiler,compiler/test_compiler -offlineCompiler spir_v generate . - -# ######################################### -# Common mathematical functions -# ######################################### -Common Functions,commonfns/test_commonfns -offlineCompiler spir_v generate . -Geometric Functions,geometrics/test_geometrics -offlineCompiler spir_v generate . -Relationals,relationals/test_relationals -offlineCompiler spir_v generate . - -# ######################################### -# General operation -# ######################################### -Thread Dimensions,thread_dimensions/test_thread_dimensions quick* -offlineCompiler spir_v generate . -Multiple Device/Context,multiple_device_context/test_multiples -offlineCompiler spir_v generate . -Atomics,atomics/test_atomics -offlineCompiler spir_v generate . -Profiling,profiling/test_profiling -offlineCompiler spir_v generate . -Events,events/test_events -offlineCompiler spir_v generate . -Allocations (single maximum),allocations/test_allocations single 5 all -offlineCompiler spir_v generate . -Allocations (total maximum),allocations/test_allocations multiple 5 all -offlineCompiler spir_v generate . -VecAlign, vec_align/test_vecalign -offlineCompiler spir_v generate . -VecStep, vec_step/test_vecstep -offlineCompiler spir_v generate . -Printf,printf/test_printf -offlineCompiler spir_v generate . -Device Partitioning,device_partition/test_device_partition -offlineCompiler spir_v generate . - -# ######################################### -# Buffers and images -# ######################################### -Buffers,buffers/test_buffers -Images (Kernel Methods),images/kernel_image_methods/test_kernel_image_methods -offlineCompiler spir_v generate . -Images (Kernel),images/kernel_read_write/test_image_streams CL_FILTER_NEAREST -offlineCompiler spir_v generate . -Images (Samplerless),images/samplerlessReads/test_samplerless_reads -offlineCompiler spir_v generate . - -# ######################################### -# OpenGL/CL interaction -# ######################################### -OpenCL-GL Sharing,gl/test_gl -offlineCompiler spir_v generate . - -# ######################################### -# Thorough math and conversions tests -# ######################################### -Select,select/test_select -offlineCompiler spir_v generate . -Conversions,conversions/test_conversions -w -offlineCompiler spir_v generate . -Contractions,contractions/contractions -offlineCompiler spir_v generate . -Math,math_brute_force/bruteforce -w -offlineCompiler spir_v generate . -Integer Ops,integer_ops/test_integer_ops integer_* quick_* -offlineCompiler spir_v generate . -Half Ops,half/test_half -w -offlineCompiler spir_v generate . - -##################################### -# OpenCL 2.0 tests -##################################### -C11 Atomics,c11_atomics/test_c11_atomics -offlineCompiler spir_v generate . -Execution Model,device_execution/test_device_execution -offlineCompiler spir_v generate . -Generic Address Space,generic_address_space/test_generic_address_space -offlineCompiler spir_v generate . -Non Uniform Work Groups,non_uniform_work_group/test_non_uniform_work_group -offlineCompiler spir_v generate . -Pipes,pipes/test_pipes -offlineCompiler spir_v generate . -SVM,SVM/test_SVM -offlineCompiler spir_v generate . -Workgroups,workgroups/test_workgroups -offlineCompiler spir_v generate . - -######################################### -# Extensions -######################################### -Mipmaps (Kernel),images/kernel_read_write/test_image_streams test_mipmaps CL_FILTER_NEAREST -offlineCompiler spir_v generate . -Mipmaps (clCopyImage),images/clCopyImage/test_cl_copy_images test_mipmaps -offlineCompiler spir_v generate . -Subgroups,subgroups/test_subgroups -offlineCompiler spir_v generate . diff --git a/test_conformance/opencl_conformance_tests_math.csv b/test_conformance/opencl_conformance_tests_math.csv index ebc4e4a3..e033190f 100644 --- a/test_conformance/opencl_conformance_tests_math.csv +++ b/test_conformance/opencl_conformance_tests_math.csv @@ -1,4 +1,4 @@ # # OpenCL Conformance Test Suite (math only) # -Math,math_brute_force/bruteforce +Math,math_brute_force/test_bruteforce diff --git a/test_conformance/opencl_conformance_tests_quick.csv b/test_conformance/opencl_conformance_tests_quick.csv index b80a3737..af591656 100644 --- a/test_conformance/opencl_conformance_tests_quick.csv +++ b/test_conformance/opencl_conformance_tests_quick.csv @@ -58,15 +58,6 @@ Images (Samplerless pitch),images/samplerlessReads/test_samplerless_reads use_pi Images (Samplerless max size),images/samplerlessReads/test_samplerless_reads max_images Mem (Host Flags),mem_host_flags/test_mem_host_flags -# ######################################### -# Headers -# ######################################### -Headers (cl_typen), headers/test_headers -Headers (cl.h standalone), headers/test_cl_h -Headers (cl_platform.h standalone), headers/test_cl_platform_h -Headers (cl_gl.h standalone), headers/test_cl_gl_h -Headers (opencl.h standalone), headers/test_opencl_h - # ######################################### # CPU is required to pass linear and normalized image filtering # ######################################### @@ -84,7 +75,7 @@ OpenCL-GL Sharing,gl/test_gl # ######################################### Select,select/test_select #Conversions,conversions/test_conversions -Contractions,contractions/contractions -Math,math_brute_force/bruteforce -w +Contractions,contractions/test_contractions +Math,math_brute_force/test_bruteforce -w Integer Ops,integer_ops/test_integer_ops integer_* quick_* -Half Ops,half/Test_half -w +Half Ops,half/test_half -w diff --git a/test_conformance/pipes/CMakeLists.txt b/test_conformance/pipes/CMakeLists.txt index 63bd916e..00246269 100644 --- a/test_conformance/pipes/CMakeLists.txt +++ b/test_conformance/pipes/CMakeLists.txt @@ -1,23 +1,13 @@ set(MODULE_NAME pipes) set(${MODULE_NAME}_SOURCES - main.c - test_pipe_read_write.c - test_pipe_info.c - test_pipe_limits.c - test_pipe_query_functions.c - test_pipe_readwrite_errors.c - test_pipe_subgroups.c - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/threadTesting.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/typeWrappers.cpp - ../../test_common/harness/mt19937.c - ../../test_common/harness/conversions.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c + main.cpp + test_pipe_read_write.cpp + test_pipe_info.cpp + test_pipe_limits.cpp + test_pipe_query_functions.cpp + test_pipe_readwrite_errors.cpp + test_pipe_subgroups.cpp ) include(../CMakeCommon.txt) diff --git a/test_conformance/pipes/main.c b/test_conformance/pipes/main.c deleted file mode 100644 index 019507db..00000000 --- a/test_conformance/pipes/main.c +++ /dev/null @@ -1,86 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include "procs.h" -#include "../../test_common/harness/testHarness.h" - -test_definition test_list[] = { - ADD_TEST( pipe_readwrite_int ), - ADD_TEST( pipe_readwrite_uint ), - ADD_TEST( pipe_readwrite_long ), - ADD_TEST( pipe_readwrite_ulong ), - ADD_TEST( pipe_readwrite_short ), - ADD_TEST( pipe_readwrite_ushort ), - ADD_TEST( pipe_readwrite_float ), - ADD_TEST( pipe_readwrite_half ), - ADD_TEST( pipe_readwrite_char ), - ADD_TEST( pipe_readwrite_uchar ), - ADD_TEST( pipe_readwrite_double ), - ADD_TEST( pipe_readwrite_struct ), - ADD_TEST( pipe_workgroup_readwrite_int ), - ADD_TEST( pipe_workgroup_readwrite_uint ), - ADD_TEST( pipe_workgroup_readwrite_long ), - ADD_TEST( pipe_workgroup_readwrite_ulong ), - ADD_TEST( pipe_workgroup_readwrite_short ), - ADD_TEST( pipe_workgroup_readwrite_ushort ), - ADD_TEST( pipe_workgroup_readwrite_float ), - ADD_TEST( pipe_workgroup_readwrite_half ), - ADD_TEST( pipe_workgroup_readwrite_char ), - ADD_TEST( pipe_workgroup_readwrite_uchar ), - ADD_TEST( pipe_workgroup_readwrite_double ), - ADD_TEST( pipe_workgroup_readwrite_struct ), - ADD_TEST( pipe_subgroup_readwrite_int ), - ADD_TEST( pipe_subgroup_readwrite_uint ), - ADD_TEST( pipe_subgroup_readwrite_long ), - ADD_TEST( pipe_subgroup_readwrite_ulong ), - ADD_TEST( pipe_subgroup_readwrite_short ), - ADD_TEST( pipe_subgroup_readwrite_ushort ), - ADD_TEST( pipe_subgroup_readwrite_float ), - ADD_TEST( pipe_subgroup_readwrite_half ), - ADD_TEST( pipe_subgroup_readwrite_char ), - ADD_TEST( pipe_subgroup_readwrite_uchar ), - ADD_TEST( pipe_subgroup_readwrite_double ), - ADD_TEST( pipe_subgroup_readwrite_struct ), - ADD_TEST( pipe_convenience_readwrite_int ), - ADD_TEST( pipe_convenience_readwrite_uint ), - ADD_TEST( pipe_convenience_readwrite_long ), - ADD_TEST( pipe_convenience_readwrite_ulong ), - ADD_TEST( pipe_convenience_readwrite_short ), - ADD_TEST( pipe_convenience_readwrite_ushort ), - ADD_TEST( pipe_convenience_readwrite_float ), - ADD_TEST( pipe_convenience_readwrite_half ), - ADD_TEST( pipe_convenience_readwrite_char ), - ADD_TEST( pipe_convenience_readwrite_uchar ), - ADD_TEST( pipe_convenience_readwrite_double ), - ADD_TEST( pipe_convenience_readwrite_struct ), - ADD_TEST( pipe_info ), - ADD_TEST( pipe_max_args ), - ADD_TEST( pipe_max_packet_size ), - ADD_TEST( pipe_max_active_reservations ), - ADD_TEST( pipe_query_functions ), - ADD_TEST( pipe_readwrite_errors ), - ADD_TEST( pipe_subgroups_divergence ), -}; - -const int test_num = ARRAY_SIZE( test_list ); - -int main( int argc, const char *argv[] ) -{ - return runTestHarness( argc, argv, test_num, test_list, false, false, 0 ); -} diff --git a/test_conformance/pipes/main.cpp b/test_conformance/pipes/main.cpp new file mode 100644 index 00000000..4241c4d4 --- /dev/null +++ b/test_conformance/pipes/main.cpp @@ -0,0 +1,114 @@ +// +// Copyright (c) 2017 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "harness/compat.h" + +#include "harness/testHarness.h" +#include "procs.h" +#include +#include + +test_status InitCL(cl_device_id device) { + auto version = get_device_cl_version(device); + auto expected_min_version = Version(2, 0); + if (version < expected_min_version) + { + version_expected_info("Test", "OpenCL", + expected_min_version.to_string().c_str(), + version.to_string().c_str()); + return TEST_SKIP; + } + + int error; + cl_uint max_packet_size; + error = clGetDeviceInfo(device, CL_DEVICE_PIPE_MAX_PACKET_SIZE, + sizeof(max_packet_size), &max_packet_size, NULL); + if (error != CL_SUCCESS) { + print_error(error, "Unable to get pipe max packet size"); + return TEST_FAIL; + } + + if ((max_packet_size == 0) && (version >= Version(3, 0))) + { + return TEST_SKIP; + } + + return TEST_PASS; +} + +test_definition test_list[] = { + ADD_TEST(pipe_readwrite_int), + ADD_TEST(pipe_readwrite_uint), + ADD_TEST(pipe_readwrite_long), + ADD_TEST(pipe_readwrite_ulong), + ADD_TEST(pipe_readwrite_short), + ADD_TEST(pipe_readwrite_ushort), + ADD_TEST(pipe_readwrite_float), + ADD_TEST(pipe_readwrite_half), + ADD_TEST(pipe_readwrite_char), + ADD_TEST(pipe_readwrite_uchar), + ADD_TEST(pipe_readwrite_double), + ADD_TEST(pipe_readwrite_struct), + ADD_TEST(pipe_workgroup_readwrite_int), + ADD_TEST(pipe_workgroup_readwrite_uint), + ADD_TEST(pipe_workgroup_readwrite_long), + ADD_TEST(pipe_workgroup_readwrite_ulong), + ADD_TEST(pipe_workgroup_readwrite_short), + ADD_TEST(pipe_workgroup_readwrite_ushort), + ADD_TEST(pipe_workgroup_readwrite_float), + ADD_TEST(pipe_workgroup_readwrite_half), + ADD_TEST(pipe_workgroup_readwrite_char), + ADD_TEST(pipe_workgroup_readwrite_uchar), + ADD_TEST(pipe_workgroup_readwrite_double), + ADD_TEST(pipe_workgroup_readwrite_struct), + ADD_TEST(pipe_subgroup_readwrite_int), + ADD_TEST(pipe_subgroup_readwrite_uint), + ADD_TEST(pipe_subgroup_readwrite_long), + ADD_TEST(pipe_subgroup_readwrite_ulong), + ADD_TEST(pipe_subgroup_readwrite_short), + ADD_TEST(pipe_subgroup_readwrite_ushort), + ADD_TEST(pipe_subgroup_readwrite_float), + ADD_TEST(pipe_subgroup_readwrite_half), + ADD_TEST(pipe_subgroup_readwrite_char), + ADD_TEST(pipe_subgroup_readwrite_uchar), + ADD_TEST(pipe_subgroup_readwrite_double), + ADD_TEST(pipe_subgroup_readwrite_struct), + ADD_TEST(pipe_convenience_readwrite_int), + ADD_TEST(pipe_convenience_readwrite_uint), + ADD_TEST(pipe_convenience_readwrite_long), + ADD_TEST(pipe_convenience_readwrite_ulong), + ADD_TEST(pipe_convenience_readwrite_short), + ADD_TEST(pipe_convenience_readwrite_ushort), + ADD_TEST(pipe_convenience_readwrite_float), + ADD_TEST(pipe_convenience_readwrite_half), + ADD_TEST(pipe_convenience_readwrite_char), + ADD_TEST(pipe_convenience_readwrite_uchar), + ADD_TEST(pipe_convenience_readwrite_double), + ADD_TEST(pipe_convenience_readwrite_struct), + ADD_TEST(pipe_info), + ADD_TEST(pipe_max_args), + ADD_TEST(pipe_max_packet_size), + ADD_TEST(pipe_max_active_reservations), + ADD_TEST(pipe_query_functions), + ADD_TEST(pipe_readwrite_errors), + ADD_TEST(pipe_subgroups_divergence), +}; + +const int test_num = ARRAY_SIZE(test_list); + +int main(int argc, const char *argv[]) { + return runTestHarnessWithCheck(argc, argv, test_num, test_list, false, + 0, InitCL); +} diff --git a/test_conformance/pipes/procs.h b/test_conformance/pipes/procs.h index 39c1e5c4..5cbe7952 100644 --- a/test_conformance/pipes/procs.h +++ b/test_conformance/pipes/procs.h @@ -16,12 +16,12 @@ #ifndef __PROCS_H__ #define __PROCS_H__ -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/mt19937.h" -#include "../../test_common/harness/conversions.h" +#include "harness/kernelHelpers.h" +#include "harness/testHarness.h" +#include "harness/errorHelpers.h" +#include "harness/typeWrappers.h" +#include "harness/mt19937.h" +#include "harness/conversions.h" #ifndef __APPLE__ #include diff --git a/test_conformance/pipes/test_pipe_info.c b/test_conformance/pipes/test_pipe_info.cpp similarity index 65% rename from test_conformance/pipes/test_pipe_info.c rename to test_conformance/pipes/test_pipe_info.cpp index 5d3e3a49..7543c6cd 100644 --- a/test_conformance/pipes/test_pipe_info.c +++ b/test_conformance/pipes/test_pipe_info.cpp @@ -21,29 +21,25 @@ const char* pipe_kernel_code = { int test_pipe_info( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ) { - cl_mem pipe; + clMemWrapper pipe; cl_int err; cl_uint pipe_width = 512; cl_uint pipe_depth = 1024; cl_uint returnVal; - cl_program program; - cl_kernel kernel; + clProgramWrapper program; + clKernelWrapper kernel; - pipe = clCreatePipe(context, CL_MEM_HOST_NO_ACCESS, pipe_width, pipe_depth, NULL, &err); + pipe = clCreatePipe(context, CL_MEM_HOST_NO_ACCESS, pipe_width, pipe_depth, + NULL, &err); test_error(err, "clCreatePipe failed."); - err = clGetPipeInfo(pipe, CL_PIPE_PACKET_SIZE, sizeof(pipe_width), (void *)&returnVal, NULL); - if ( err ) - { - log_error( "Error calling clGetPipeInfo(): %d\n", err ); - clReleaseMemObject(pipe); - return -1; - } + err = clGetPipeInfo(pipe, CL_PIPE_PACKET_SIZE, sizeof(pipe_width), + (void *)&returnVal, NULL); + test_error(err, "clGetPipeInfo failed."); - if(pipe_width != returnVal) + if (pipe_width != returnVal) { - log_error( "Error in clGetPipeInfo() check of pipe packet size\n" ); - clReleaseMemObject(pipe); + log_error("Error in clGetPipeInfo() check of pipe packet size\n"); return -1; } else @@ -52,17 +48,11 @@ int test_pipe_info( cl_device_id deviceID, cl_context context, cl_command_queue } err = clGetPipeInfo(pipe, CL_PIPE_MAX_PACKETS, sizeof(pipe_depth), (void *)&returnVal, NULL); - if ( err ) - { - log_error( "Error calling clGetPipeInfo(): %d\n", err ); - clReleaseMemObject(pipe); - return -1; - } + test_error(err, "clGetPipeInfo failed."); if(pipe_depth != returnVal) { log_error( "Error in clGetPipeInfo() check of pipe max packets\n" ); - clReleaseMemObject(pipe); return -1; } else @@ -71,39 +61,20 @@ int test_pipe_info( cl_device_id deviceID, cl_context context, cl_command_queue } err = create_single_kernel_helper_with_build_options(context, &program, &kernel, 1, (const char**)&pipe_kernel_code, "pipe_kernel", "-cl-std=CL2.0 -cl-kernel-arg-info"); - if(err) - { - clReleaseMemObject(pipe); - print_error(err, "Error creating program\n"); - return -1; - } + test_error_ret(err, " Error creating program", -1); cl_kernel_arg_type_qualifier arg_type_qualifier = 0; cl_kernel_arg_type_qualifier expected_type_qualifier = CL_KERNEL_ARG_TYPE_PIPE; err = clGetKernelArgInfo( kernel, 0, CL_KERNEL_ARG_TYPE_QUALIFIER, sizeof(arg_type_qualifier), &arg_type_qualifier, NULL ); - if(err) - { - clReleaseMemObject(pipe); - clReleaseKernel(kernel); - clReleaseProgram(program); - print_error(err, "clSetKernelArg failed\n"); - return -1; - } + test_error_ret(err, " clSetKernelArgInfo failed", -1); err = (arg_type_qualifier != expected_type_qualifier); + if(err) { - clReleaseMemObject(pipe); - clReleaseKernel(kernel); - clReleaseProgram(program); print_error(err, "ERROR: Bad type qualifier\n"); return -1; } - // cleanup - clReleaseMemObject(pipe); - clReleaseKernel(kernel); - clReleaseProgram(program); - return err; } diff --git a/test_conformance/pipes/test_pipe_limits.c b/test_conformance/pipes/test_pipe_limits.c deleted file mode 100644 index 2c3ad581..00000000 --- a/test_conformance/pipes/test_pipe_limits.c +++ /dev/null @@ -1,1085 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include -#include - -#include "procs.h" -#include "../../test_common/harness/errorHelpers.h" - -#define STRING_LENGTH 1024 - -void createKernelSourceCode(char *source, int num_pipes) -{ - int i; - char str[256]; - int str_length; - - strcpy(source, "__kernel void test_multiple_pipe_write(__global int *src, "); - - for(i = 0; i < num_pipes; i++) { - sprintf(str, "__write_only pipe int pipe%d, ", i); - strcat(source, str); - } - sprintf(str, "int num_pipes ) \n{\n int gid = get_global_id(0);\n reserve_id_t res_id;\n\n"); - strcat(source, str); - sprintf(str, " if(gid < (get_global_size(0))/num_pipes)\n {\n res_id = reserve_write_pipe(pipe0, 1);\n if(is_valid_reserve_id(res_id))\n {\n"); - strcat(source, str); - sprintf(str, " write_pipe(pipe0, res_id, 0, &src[gid]);\n commit_write_pipe(pipe0, res_id);\n }\n }\n"); - strcat(source, str); - for(i = 1; i < num_pipes; i++){ - sprintf(str, " else if(gid < (%d*get_global_size(0))/num_pipes)\n {\n res_id = reserve_write_pipe(pipe%d, 1);\n if(is_valid_reserve_id(res_id))\n {\n", i+1, i); - strcat(source, str); - sprintf(str, " write_pipe(pipe%d, res_id, 0, &src[gid]);\n commit_write_pipe(pipe%d, res_id);\n }\n }\n", i, i); - strcat(source, str); - } - strcat(source, "}\n\n__kernel void test_multiple_pipe_read(__global int *dst, "); - - for(i = 0; i < num_pipes; i++) { - sprintf(str, "__read_only pipe int pipe%d, ", i); - strcat(source, str); - } - sprintf(str, "int num_pipes ) \n{\n int gid = get_global_id(0);\n reserve_id_t res_id;\n\n"); - strcat(source, str); - sprintf(str, " if(gid < (get_global_size(0))/num_pipes)\n {\n res_id = reserve_read_pipe(pipe0, 1);\n if(is_valid_reserve_id(res_id))\n {\n"); - strcat(source, str); - sprintf(str, " read_pipe(pipe0, res_id, 0, &dst[gid]);\n commit_read_pipe(pipe0, res_id);\n }\n }\n"); - strcat(source, str); - for(i = 1; i < num_pipes; i++){ - sprintf(str, " else if(gid < (%d*get_global_size(0))/num_pipes)\n {\n res_id = reserve_read_pipe(pipe%d, 1);\n if(is_valid_reserve_id(res_id))\n {\n", i+1, i); - strcat(source, str); - sprintf(str, " read_pipe(pipe%d, res_id, 0, &dst[gid]);\n commit_read_pipe(pipe%d, res_id);\n }\n }\n", i, i); - strcat(source, str); - } - strcat(source, "}"); - - str_length = strlen(source); - assert(str_length <= STRING_LENGTH*num_pipes); -} - -static int verify_result(void *ptr1, void *ptr2, int n) -{ - int i; - int sum_input = 0, sum_output = 0; - cl_char *inptr = (cl_char *)ptr1; - cl_char *outptr = (cl_char *)ptr2; - - for(i = 0; i < n; i++) - { - sum_input += inptr[i]; - sum_output += outptr[i]; - } - if(sum_input != sum_output){ - return -1; - } - return 0; -} - -static int verify_result_int(void *ptr1, void *ptr2, int n) -{ - int i; - int sum_input = 0, sum_output = 0; - cl_int *inptr = (cl_int *)ptr1; - cl_int *outptr = (cl_int *)ptr2; - - for(i = 0; i < n; i++) - { - sum_input += inptr[i]; - sum_output += outptr[i]; - } - if(sum_input != sum_output){ - return -1; - } - return 0; -} - -int test_pipe_max_args(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - - cl_mem pipes[1024]; - cl_mem buffers[2]; - void *outptr; - cl_int *inptr; - cl_program program; - cl_kernel kernel[2]; - size_t global_work_size[3]; - cl_int err; - cl_int size; - int num_pipe_elements = 1024; - int i, j; - int max_pipe_args; - char *source; - cl_event producer_sync_event = NULL; - cl_event consumer_sync_event = NULL; - MTdata d = init_genrand( gRandomSeed ); - const char* kernelName[] = {"test_multiple_pipe_write", "test_multiple_pipe_read"}; - - size_t min_alignment = get_min_alignment(context); - - err = clGetDeviceInfo(deviceID, CL_DEVICE_MAX_PIPE_ARGS, sizeof(max_pipe_args), (void*)&max_pipe_args, NULL); - if(err){ - print_error(err, " clGetDeviceInfo failed\n"); - return -1; - } - if(max_pipe_args < 16){ - log_error("The device should support minimum 16 pipe objects that could be passed as arguments to the kernel"); - return -1; - } - - global_work_size[0] = (cl_uint)num_pipe_elements * max_pipe_args; - size = sizeof(int) * num_pipe_elements * max_pipe_args; - source = (char *)malloc(STRING_LENGTH * sizeof(char) * max_pipe_args); - - inptr = (cl_int *)align_malloc(size, min_alignment); - - for(i = 0; i < num_pipe_elements * max_pipe_args; i++){ - inptr[i] = (int)genrand_int32(d); - } - - buffers[0] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, size, inptr, &err); - if(err){ - clReleaseMemObject(buffers[0]); - free(source); - print_error(err, " clCreateBuffer failed\n"); - return -1; - } - outptr = align_malloc(size, min_alignment); - buffers[1] = clCreateBuffer(context, CL_MEM_USE_HOST_PTR, size, outptr, &err); - if ( err ){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - align_free( outptr ); - free(source); - print_error(err, " clCreateBuffer failed\n" ); - return -1; - } - - for(i = 0; i < max_pipe_args; i++){ - pipes[i] = clCreatePipe(context, CL_MEM_HOST_NO_ACCESS, sizeof(int), num_pipe_elements, NULL, &err); - if(err){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - align_free( outptr ); - free(source); - for(j = 0; j < i; j++) { - clReleaseMemObject(pipes[j]); - } - print_error(err, " clCreatePipe failed\n"); - return -1; - } - } - - createKernelSourceCode(source, max_pipe_args); - - // Create producer kernel - err = create_single_kernel_helper_with_build_options(context, &program, &kernel[0], 1, (const char**)&source, kernelName[0], "-cl-std=CL2.0"); - if(err){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - for(j = 0; j < max_pipe_args; j++) { - clReleaseMemObject(pipes[j]); - } - align_free(outptr); - free(source); - print_error(err, "Error creating program\n"); - return -1; - } - //Create consumer kernel - kernel[1] = clCreateKernel(program, kernelName[1], &err); - if( kernel[1] == NULL || err != CL_SUCCESS) - { - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - for(j = 0; j < max_pipe_args; j++) { - clReleaseMemObject(pipes[j]); - } - align_free(outptr); - free(source); - print_error(err, " Error creating kernel\n"); - return -1; - } - - err = clSetKernelArg(kernel[0], 0, sizeof(cl_mem), (void*)&buffers[0]); - for( i = 0; i < max_pipe_args; i++){ - err |= clSetKernelArg(kernel[0], i+1, sizeof(cl_mem), (void*)&pipes[i]); - } - err |= clSetKernelArg(kernel[0], max_pipe_args + 1, sizeof(int), (void*)&max_pipe_args); - err |= clSetKernelArg(kernel[1], 0, sizeof(cl_mem), (void*)&buffers[1]); - for( i = 0; i < max_pipe_args; i++){ - err |= clSetKernelArg(kernel[1], i+1, sizeof(cl_mem), (void*)&pipes[i]); - } - err |= clSetKernelArg(kernel[1], max_pipe_args + 1, sizeof(int), (void*)&max_pipe_args); - if ( err != CL_SUCCESS ){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - for(j = 0; j < max_pipe_args; j++) { - clReleaseMemObject(pipes[j]); - } - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseProgram(program); - align_free(outptr); - free(source); - print_error(err, " clSetKernelArg failed"); - return -1; - } - - // Launch Producer kernel - err = clEnqueueNDRangeKernel( queue, kernel[0], 1, NULL, global_work_size, NULL, 0, NULL, &producer_sync_event ); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueNDRangeKernel failed" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - for(j = 0; j < max_pipe_args; j++) { - clReleaseMemObject(pipes[j]); - } - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); - free(source); - return -1; - } - - // Launch Consumer kernel - err = clEnqueueNDRangeKernel( queue, kernel[1], 1, NULL, global_work_size, NULL, 1, &producer_sync_event, &consumer_sync_event ); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueNDRangeKernel failed" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - for(j = 0; j < max_pipe_args; j++) { - clReleaseMemObject(pipes[j]); - } - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); - free(source); - return -1; - } - - err = clEnqueueReadBuffer(queue, buffers[1], true, 0, size, outptr, 1, &consumer_sync_event, NULL); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueReadBuffer failed" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - for(j = 0; j < max_pipe_args; j++) { - clReleaseMemObject(pipes[j]); - } - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); - free(source); - return -1; - } - - err = clWaitForEvents(1, &consumer_sync_event); - if ( err != CL_SUCCESS ){ - print_error( err, " clWaitForEvents failed" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - for(j = 0; j < max_pipe_args; j++) { - clReleaseMemObject(pipes[j]); - } - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); - free(source); - return -1; - } - - if( verify_result( inptr, outptr, num_pipe_elements*sizeof(cl_int))){ - log_error("test_pipe_max_args failed\n"); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - for(j = 0; j < max_pipe_args; j++) { - clReleaseMemObject(pipes[j]); - } - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); - free(source); - return -1; - } - else { - log_info("test_pipe_max_args passed\n"); - } - //cleanup - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - for(j = 0; j < max_pipe_args; j++) { - clReleaseMemObject(pipes[j]); - } - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); - free(source); - - return 0; -} - - -int test_pipe_max_packet_size(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - cl_mem pipe; - cl_mem buffers[2]; - void *outptr; - cl_char *inptr; - cl_program program; - cl_kernel kernel[2]; - size_t global_work_size[3]; - cl_int err; - size_t size; - int num_pipe_elements = 1024; - int i; - cl_uint max_pipe_packet_size; - char *source; - char str[256]; - int str_length; - cl_event producer_sync_event = NULL; - cl_event consumer_sync_event = NULL; - MTdata d = init_genrand( gRandomSeed ); - const char* kernelName[] = {"test_pipe_max_packet_size_write", "test_pipe_max_packet_size_read"}; - - size_t min_alignment = get_min_alignment(context); - - global_work_size[0] = (cl_uint)num_pipe_elements; - - source = (char*)malloc(STRING_LENGTH*sizeof(char)); - - err = clGetDeviceInfo(deviceID, CL_DEVICE_PIPE_MAX_PACKET_SIZE, sizeof(max_pipe_packet_size), (void*)&max_pipe_packet_size, NULL); - if(err){ - print_error(err, " clGetDeviceInfo failed\n"); - return -1; - } - if(max_pipe_packet_size < 1024){ - log_error("The device should support minimum packet size of 1024 bytes"); - return -1; - } - - if(max_pipe_packet_size > (32*1024*1024/num_pipe_elements)) - { - max_pipe_packet_size = 32*1024*1024/num_pipe_elements; - } - - size = max_pipe_packet_size * num_pipe_elements; - - inptr = (cl_char *)align_malloc(size, min_alignment); - - for(i = 0; i < size; i++){ - inptr[i] = (char)genrand_int32(d); - } - - buffers[0] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, size, inptr, &err); - if(err){ - clReleaseMemObject(buffers[0]); - free(source); - print_error(err, " clCreateBuffer failed\n"); - return -1; - } - outptr = align_malloc(size, min_alignment); - buffers[1] = clCreateBuffer(context, CL_MEM_USE_HOST_PTR, size, outptr, &err); - if ( err ){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - align_free( outptr ); - free(source); - print_error(err, " clCreateBuffer failed\n" ); - return -1; - } - - pipe = clCreatePipe(context, CL_MEM_HOST_NO_ACCESS, max_pipe_packet_size, num_pipe_elements, NULL, &err); - if(err){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - align_free( outptr ); - free(source); - clReleaseMemObject(pipe); - print_error(err, " clCreatePipe failed\n"); - return -1; - } - - sprintf(str, "typedef struct{\n char a[%d];\n}TestStruct;\n\n__kernel void test_pipe_max_packet_size_write(__global TestStruct *src, __write_only pipe TestStruct out_pipe)\n{\n", max_pipe_packet_size); - strcpy(source,str); - strcat(source, " int gid = get_global_id(0);\n reserve_id_t res_id;\n\n"); - sprintf(str, " res_id = reserve_write_pipe(out_pipe, 1);\n if(is_valid_reserve_id(res_id))\n {\n"); - strcat(source, str); - sprintf(str, " write_pipe(out_pipe, res_id, 0, &src[gid]);\n commit_write_pipe(out_pipe, res_id);\n }\n}\n\n"); - strcat(source, str); - sprintf(str, "__kernel void test_pipe_max_packet_size_read(__read_only pipe TestStruct in_pipe, __global TestStruct *dst)\n{\n"); - strcat(source, str); - strcat(source, " int gid = get_global_id(0);\n reserve_id_t res_id;\n\n"); - sprintf(str, " res_id = reserve_read_pipe(in_pipe, 1);\n if(is_valid_reserve_id(res_id))\n {\n"); - strcat(source, str); - sprintf(str, " read_pipe(in_pipe, res_id, 0, &dst[gid]);\n commit_read_pipe(in_pipe, res_id);\n }\n}\n\n"); - strcat(source, str); - - str_length = strlen(source); - assert(str_length <= STRING_LENGTH); - - // Create producer kernel - err = create_single_kernel_helper_with_build_options(context, &program, &kernel[0], 1, (const char**)&source, kernelName[0], "-cl-std=CL2.0"); - if(err){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(pipe); - align_free(outptr); - free(source); - print_error(err, "Error creating program\n"); - return -1; - } - //Create consumer kernel - kernel[1] = clCreateKernel(program, kernelName[1], &err); - if( kernel[1] == NULL || err != CL_SUCCESS) - { - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(pipe); - align_free(outptr); - free(source); - print_error(err, "Error creating kernel\n"); - return -1; - } - - err = clSetKernelArg(kernel[0], 0, sizeof(cl_mem), (void*)&buffers[0]); - err |= clSetKernelArg(kernel[0], 1, sizeof(cl_mem), (void*)&pipe); - err |= clSetKernelArg(kernel[1], 0, sizeof(cl_mem), (void*)&pipe); - err |= clSetKernelArg(kernel[1], 1, sizeof(cl_mem), (void*)&buffers[1]); - if ( err != CL_SUCCESS ){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseProgram(program); - align_free(outptr); - free(source); - print_error(err, " clSetKernelArg failed"); - return -1; - } - - // Launch Producer kernel - err = clEnqueueNDRangeKernel( queue, kernel[0], 1, NULL, global_work_size, NULL, 0, NULL, &producer_sync_event ); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueNDRangeKernel failed" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); - free(source); - return -1; - } - - // Launch Consumer kernel - err = clEnqueueNDRangeKernel( queue, kernel[1], 1, NULL, global_work_size, NULL, 1, &producer_sync_event, &consumer_sync_event ); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueNDRangeKernel failed" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); - free(source); - return -1; - } - - err = clEnqueueReadBuffer(queue, buffers[1], true, 0, size, outptr, 1, &consumer_sync_event, NULL); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueReadBuffer failed" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); - free(source); - return -1; - } - - if( verify_result( inptr, outptr, size)){ - log_error("test_pipe_max_packet_size failed\n"); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); - free(source); - return -1; - } - else { - log_info("test_pipe_max_packet_size passed\n"); - } - //cleanup - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); - free(source); - - return 0; -} - -int test_pipe_max_active_reservations(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - cl_mem pipe; - cl_mem buffers[2]; - cl_mem buf_reservations; - cl_mem buf_status; - cl_mem buf_reserve_id_t_size; - cl_mem buf_reserve_id_t_size_aligned; - cl_int *inptr; - void *outptr; - int size, i; - cl_program program; - cl_kernel kernel[3]; - size_t global_work_size[3]; - cl_int err; - int status = 0; - cl_uint max_active_reservations = 0; - cl_ulong max_global_size = 0; - int reserve_id_t_size; - int temp; - char *source; - char str[256]; - int str_length; - cl_event sync_event = NULL; - cl_event read_event = NULL; - MTdata d = init_genrand( gRandomSeed ); - const char* kernelName[3] = {"test_pipe_max_active_reservations_write", "test_pipe_max_active_reservations_read", "pipe_get_reserve_id_t_size"}; - - size_t min_alignment = get_min_alignment(context); - - source = (char*)malloc(2*STRING_LENGTH*sizeof(char)); - - global_work_size[0] = 1; - - err = clGetDeviceInfo(deviceID, CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS, sizeof(max_active_reservations), (void*)&max_active_reservations, NULL); - if(err){ - print_error(err, " clGetDeviceInfo failed\n"); - return -1; - } - - err = clGetDeviceInfo(deviceID, CL_DEVICE_GLOBAL_MEM_SIZE, sizeof(max_global_size), (void*)&max_global_size, NULL); - if(err){ - print_error(err, " clGetDeviceInfo failed\n"); - return -1; - } - - max_active_reservations = (max_active_reservations > max_global_size) ? 1<<16 : max_active_reservations; - - if(max_active_reservations < 1){ - log_error("The device should support minimum active reservations of 1"); - return -1; - } - - // To get reserve_id_t size - buf_reserve_id_t_size = clCreateBuffer(context, CL_MEM_HOST_READ_ONLY, sizeof(reserve_id_t_size), NULL, &err); - if ( err ){ - clReleaseMemObject(buf_reserve_id_t_size); - print_error(err, " clCreateBuffer failed\n" ); - return -1; - } - - sprintf(str, "__kernel void test_pipe_max_active_reservations_write(__global int *src, __write_only pipe int out_pipe, __global char *reserve_id, __global int *reserve_id_t_size_aligned, __global int *status)\n{\n"); - strcpy(source,str); - sprintf(str, " __global reserve_id_t *res_id_ptr;\n int reserve_idx;\n int commit_idx;\n"); - strcat(source, str); - sprintf(str, " for(reserve_idx = 0; reserve_idx < %d; reserve_idx++)\n {\n", max_active_reservations); - strcat(source, str); - sprintf(str, " res_id_ptr = (__global reserve_id_t*)(reserve_id + reserve_idx*reserve_id_t_size_aligned[0]);\n"); - strcat(source, str); - sprintf(str, " *res_id_ptr = reserve_write_pipe(out_pipe, 1);\n"); - strcat(source, str); - sprintf(str, " if(is_valid_reserve_id(res_id_ptr[0]))\n {\n write_pipe(out_pipe, res_id_ptr[0], 0, &src[reserve_idx]);\n }\n"); - strcat(source, str); - sprintf(str, " else\n {\n *status = -1;\n return;\n }\n }\n"); - strcat(source, str); - sprintf(str, " for(commit_idx = 0; commit_idx < %d; commit_idx++)\n {\n", max_active_reservations); - strcat(source, str); - sprintf(str, " res_id_ptr = (__global reserve_id_t*)(reserve_id + commit_idx*reserve_id_t_size_aligned[0]);\n"); - strcat(source, str); - sprintf(str, " commit_write_pipe(out_pipe, res_id_ptr[0]);\n }\n}\n\n"); - strcat(source, str); - sprintf(str, "__kernel void test_pipe_max_active_reservations_read(__read_only pipe int in_pipe, __global int *dst, __global char *reserve_id, __global int *reserve_id_t_size_aligned, __global int *status)\n{\n"); - strcat(source, str); - sprintf(str, " __global reserve_id_t *res_id_ptr;\n int reserve_idx;\n int commit_idx;\n"); - strcat(source, str); - sprintf(str, " for(reserve_idx = 0; reserve_idx < %d; reserve_idx++)\n {\n", max_active_reservations); - strcat(source, str); - sprintf(str, " res_id_ptr = (__global reserve_id_t*)(reserve_id + reserve_idx*reserve_id_t_size_aligned[0]);\n"); - strcat(source, str); - sprintf(str, " *res_id_ptr = reserve_read_pipe(in_pipe, 1);\n"); - strcat(source, str); - sprintf(str, " if(is_valid_reserve_id(res_id_ptr[0]))\n {\n read_pipe(in_pipe, res_id_ptr[0], 0, &dst[reserve_idx]);\n }\n"); - strcat(source, str); - sprintf(str, " else\n {\n *status = -1;\n return;\n }\n }\n"); - strcat(source, str); - sprintf(str, " for(commit_idx = 0; commit_idx < %d; commit_idx++)\n {\n", max_active_reservations); - strcat(source, str); - sprintf(str, " res_id_ptr = (__global reserve_id_t*)(reserve_id + commit_idx*reserve_id_t_size_aligned[0]);\n"); - strcat(source, str); - sprintf(str, " commit_read_pipe(in_pipe, res_id_ptr[0]);\n }\n}\n\n"); - strcat(source, str); - sprintf(str, "__kernel void pipe_get_reserve_id_t_size(__global int *reserve_id_t_size) \n"); - strcat(source, str); - sprintf(str, "{\n *reserve_id_t_size = sizeof(reserve_id_t);\n}\n"); - strcat(source, str); - - str_length = strlen(source); - assert(str_length <= 2*STRING_LENGTH); - - // Create producer kernel - err = create_single_kernel_helper_with_build_options(context, &program, &kernel[0], 1, (const char**)&source, kernelName[0], "-cl-std=CL2.0"); - if(err){ - clReleaseMemObject(buf_reserve_id_t_size); - print_error(err, "Error creating program\n"); - return -1; - } - - // Create consumer kernel - kernel[1] = clCreateKernel(program, kernelName[1], &err); - if( kernel[1] == NULL || err != CL_SUCCESS) - { - clReleaseMemObject(buf_reserve_id_t_size); - print_error(err, "Error creating kernel\n"); - return -1; - } - - // Create size query kernel for reserve_id_t - kernel[2] = clCreateKernel(program, kernelName[2], &err); - if( kernel[2] == NULL || err != CL_SUCCESS) - { - clReleaseMemObject(buf_reserve_id_t_size); - print_error(err, "Error creating kernel\n"); - return -1; - } - err = clSetKernelArg(kernel[2], 0, sizeof(cl_mem), (void*)&buf_reserve_id_t_size); - if(err){ - clReleaseMemObject(buf_reserve_id_t_size); - print_error(err, "Error creating program\n"); - return -1; - } - //Launch size query kernel for reserve_id_t - err = clEnqueueNDRangeKernel( queue, kernel[2], 1, NULL, global_work_size, NULL, 0, NULL, &sync_event ); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueNDRangeKernel failed" ); - clReleaseMemObject(buf_reserve_id_t_size); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(sync_event); - clReleaseProgram(program); - return -1; - } - - err = clEnqueueReadBuffer(queue, buf_reserve_id_t_size, true, 0, sizeof(reserve_id_t_size), &reserve_id_t_size, 1, &sync_event, &read_event); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueReadBuffer failed" ); - clReleaseMemObject(buf_reserve_id_t_size); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(sync_event); - clReleaseProgram(program); - return -1; - } - - err = clWaitForEvents(1, &read_event); - if ( err != CL_SUCCESS ){ - print_error( err, " clWaitForEvents failed" ); - clReleaseMemObject(buf_reserve_id_t_size); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(sync_event); - clReleaseEvent(read_event); - clReleaseProgram(program); - return -1; - } - - // Round reserve_id_t_size to the nearest power of 2 - temp = 1; - while(temp < reserve_id_t_size) - temp *= 2; - reserve_id_t_size = temp; - - size = sizeof(cl_int) * max_active_reservations; - inptr = (cl_int *)align_malloc(size, min_alignment); - - for(i = 0; i < max_active_reservations; i++){ - inptr[i] = (int)genrand_int32(d); - } - - buffers[0] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, size, inptr, &err); - if ( err ){ - clReleaseMemObject(buf_reserve_id_t_size); - clReleaseMemObject(buffers[0]); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(sync_event); - clReleaseEvent(read_event); - clReleaseProgram(program); - print_error(err, " clCreateBuffer failed\n" ); - return -1; - } - - outptr = align_malloc(size, min_alignment); - buffers[1] = clCreateBuffer(context, CL_MEM_HOST_READ_ONLY, size, NULL, &err); - if ( err ){ - clReleaseMemObject(buf_reserve_id_t_size); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(sync_event); - clReleaseEvent(read_event); - clReleaseProgram(program); - align_free(outptr); - print_error(err, " clCreateBuffer failed\n" ); - return -1; - } - - buf_reserve_id_t_size_aligned = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, sizeof(reserve_id_t_size), &reserve_id_t_size, &err); - if ( err ){ - clReleaseMemObject(buf_reserve_id_t_size); - clReleaseMemObject(buf_reserve_id_t_size_aligned); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(sync_event); - clReleaseEvent(read_event); - clReleaseProgram(program); - print_error(err, " clCreateBuffer failed\n" ); - return -1; - } - - //For error status - buf_status = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, sizeof(int), &status, &err); - if ( err ){ - clReleaseMemObject(buf_status); - clReleaseMemObject(buf_reserve_id_t_size); - clReleaseMemObject(buf_reserve_id_t_size_aligned); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - align_free(outptr); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(sync_event); - clReleaseEvent(read_event); - clReleaseProgram(program); - print_error(err, " clCreateBuffer failed\n" ); - return -1; - } - - pipe = clCreatePipe(context, CL_MEM_HOST_NO_ACCESS, sizeof(int), max_active_reservations, NULL, &err); - if(err){ - clReleaseMemObject(buf_status); - clReleaseMemObject(buf_reserve_id_t_size); - clReleaseMemObject(buf_reserve_id_t_size_aligned); - clReleaseMemObject(pipe); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - align_free(outptr); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(sync_event); - clReleaseEvent(read_event); - clReleaseProgram(program); - print_error(err, " clCreatePipe failed\n"); - return -1; - } - - // Global buffer to hold all active reservation ids - buf_reservations = clCreateBuffer(context, CL_MEM_HOST_NO_ACCESS, reserve_id_t_size*max_active_reservations, NULL, &err); - if ( err != CL_SUCCESS ){ - print_error( err, " clCreateBuffer failed" ); - clReleaseMemObject(buf_status); - clReleaseMemObject(buf_reserve_id_t_size); - clReleaseMemObject(buf_reserve_id_t_size_aligned); - clReleaseMemObject(buf_reservations); - clReleaseMemObject(pipe); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - align_free(outptr); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(sync_event); - clReleaseEvent(read_event); - clReleaseProgram(program); - return -1; - } - - err = clSetKernelArg(kernel[0], 0, sizeof(cl_mem), (void*)&buffers[0]); - err |= clSetKernelArg(kernel[0], 1, sizeof(cl_mem), (void*)&pipe); - err |= clSetKernelArg(kernel[0], 2, sizeof(cl_mem), (void*)&buf_reservations); - err |= clSetKernelArg(kernel[0], 3, sizeof(cl_mem), (void*)&buf_reserve_id_t_size_aligned); - err |= clSetKernelArg(kernel[0], 4, sizeof(cl_mem), (void*)&buf_status); - if ( err != CL_SUCCESS ){ - clReleaseMemObject(buf_status); - clReleaseMemObject(buf_reserve_id_t_size); - clReleaseMemObject(buf_reserve_id_t_size_aligned); - clReleaseMemObject(buf_reservations); - clReleaseMemObject(pipe); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - align_free(outptr); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseProgram(program); - print_error(err, " clSetKernelArg failed"); - return -1; - } - - err = clSetKernelArg(kernel[1], 0, sizeof(cl_mem), (void*)&pipe); - err |= clSetKernelArg(kernel[1], 1, sizeof(cl_mem), (void*)&buffers[1]); - err |= clSetKernelArg(kernel[1], 2, sizeof(cl_mem), (void*)&buf_reservations); - err |= clSetKernelArg(kernel[1], 3, sizeof(cl_mem), (void*)&buf_reserve_id_t_size_aligned); - err |= clSetKernelArg(kernel[1], 4, sizeof(cl_mem), (void*)&buf_status); - if ( err != CL_SUCCESS ){ - clReleaseMemObject(buf_status); - clReleaseMemObject(buf_reserve_id_t_size); - clReleaseMemObject(buf_reserve_id_t_size_aligned); - clReleaseMemObject(buf_reservations); - clReleaseMemObject(pipe); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - align_free(outptr); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseProgram(program); - print_error(err, " clSetKernelArg failed"); - return -1; - } - - // Launch Producer kernel - err = clEnqueueNDRangeKernel(queue, kernel[0], 1, NULL, global_work_size, NULL, 0, NULL, &sync_event); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueNDRangeKernel failed" ); - clReleaseMemObject(buf_status); - clReleaseMemObject(buf_reserve_id_t_size); - clReleaseMemObject(buf_reserve_id_t_size_aligned); - clReleaseMemObject(buf_reservations); - clReleaseMemObject(pipe); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - align_free(outptr); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(sync_event); - clReleaseProgram(program); - return -1; - } - - err = clEnqueueReadBuffer(queue, buf_status, true, 0, sizeof(int), &status, 1, &sync_event, NULL); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueReadBuffer failed" ); - clReleaseMemObject(buf_status); - clReleaseMemObject(buf_reserve_id_t_size); - clReleaseMemObject(buf_reserve_id_t_size_aligned); - clReleaseMemObject(buf_reservations); - clReleaseMemObject(pipe); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - align_free(outptr); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(sync_event); - clReleaseProgram(program); - return -1; - } - - if(status != 0) - { - log_error("test_pipe_max_active_reservations failed\n"); - clReleaseMemObject(buf_status); - clReleaseMemObject(buf_reserve_id_t_size); - clReleaseMemObject(buf_reserve_id_t_size_aligned); - clReleaseMemObject(buf_reservations); - clReleaseMemObject(pipe); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - align_free(outptr); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(sync_event); - clReleaseProgram(program); - return -1; - } - - // Launch Consumer kernel - err = clEnqueueNDRangeKernel(queue, kernel[1], 1, NULL, global_work_size, NULL, 0, NULL, &sync_event); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueNDRangeKernel failed" ); - clReleaseMemObject(buf_status); - clReleaseMemObject(buf_reserve_id_t_size); - clReleaseMemObject(buf_reserve_id_t_size_aligned); - clReleaseMemObject(buf_reservations); - clReleaseMemObject(pipe); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - align_free(outptr); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(sync_event); - clReleaseProgram(program); - return -1; - } - - err = clEnqueueReadBuffer(queue, buf_status, true, 0, sizeof(int), &status, 1, &sync_event, NULL); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueReadBuffer failed" ); - clReleaseMemObject(buf_status); - clReleaseMemObject(buf_reserve_id_t_size); - clReleaseMemObject(buf_reserve_id_t_size_aligned); - clReleaseMemObject(buf_reservations); - clReleaseMemObject(pipe); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - align_free(outptr); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(sync_event); - clReleaseProgram(program); - return -1; - } - - if(status != 0) - { - log_error("test_pipe_max_active_reservations failed\n"); - clReleaseMemObject(buf_status); - clReleaseMemObject(buf_reserve_id_t_size); - clReleaseMemObject(buf_reserve_id_t_size_aligned); - clReleaseMemObject(buf_reservations); - clReleaseMemObject(pipe); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - align_free(outptr); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(sync_event); - clReleaseProgram(program); - return -1; - } - - err = clEnqueueReadBuffer(queue, buffers[1], true, 0, size, outptr, 1, &sync_event, NULL); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueReadBuffer failed" ); - clReleaseMemObject(buf_status); - clReleaseMemObject(buf_reserve_id_t_size); - clReleaseMemObject(buf_reserve_id_t_size_aligned); - clReleaseMemObject(buf_reservations); - clReleaseMemObject(pipe); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - align_free(outptr); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(sync_event); - clReleaseProgram(program); - return -1; - } - - if( verify_result_int( inptr, outptr, max_active_reservations)){ - log_error("test_pipe_max_active_reservations failed\n"); - clReleaseMemObject(buf_status); - clReleaseMemObject(buf_reserve_id_t_size); - clReleaseMemObject(buf_reserve_id_t_size_aligned); - clReleaseMemObject(buf_reservations); - clReleaseMemObject(pipe); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - align_free(outptr); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(sync_event); - clReleaseProgram(program); - return -1; - } - else { - log_info("test_pipe_max_active_reservations passed\n"); - } - - //cleanup - clReleaseMemObject(buf_status); - clReleaseMemObject(buf_reserve_id_t_size); - clReleaseMemObject(buf_reserve_id_t_size_aligned); - clReleaseMemObject(buf_reservations); - clReleaseMemObject(pipe); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - align_free(outptr); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(sync_event); - clReleaseProgram(program); - return 0; -} \ No newline at end of file diff --git a/test_conformance/pipes/test_pipe_limits.cpp b/test_conformance/pipes/test_pipe_limits.cpp new file mode 100644 index 00000000..85247f82 --- /dev/null +++ b/test_conformance/pipes/test_pipe_limits.cpp @@ -0,0 +1,654 @@ +// +// Copyright (c) 2017 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "harness/compat.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "procs.h" +#include "harness/errorHelpers.h" + +#define STRING_LENGTH 1024 + +void createKernelSourceCode(std::stringstream &stream, int num_pipes) +{ + int i; + + stream << "__kernel void test_multiple_pipe_write(__global int *src, "; + for (i = 0; i < num_pipes; i++) + { + stream << "__write_only pipe int pipe" << i << ", "; + } + stream << R"(int num_pipes ) + { + int gid = get_global_id(0); + reserve_id_t res_id; + + + if(gid < (get_global_size(0))/num_pipes) + { + res_id = reserve_write_pipe(pipe0, 1); + if(is_valid_reserve_id(res_id)) + { + write_pipe(pipe0, res_id, 0, &src[gid]); + commit_write_pipe(pipe0, res_id); + } + })"; + + for (i = 1; i < num_pipes; i++) + { + // clang-format off + stream << R"( + else if(gid < ()" << (i + 1) << R"(*get_global_size(0))/num_pipes) + { + res_id = reserve_write_pipe(pipe)" << i << R"(, 1); + if(is_valid_reserve_id(res_id)) + { + write_pipe(pipe)" << i << R"(, res_id, 0, &src[gid]); + commit_write_pipe(pipe)" << i << R"(, res_id); + } + } + )"; + // clang-format om + } + stream << R"( + } + + __kernel void test_multiple_pipe_read(__global int *dst, )"; + + for (i = 0; i < num_pipes; i++) + { + stream << "__read_only pipe int pipe" << i << ", "; + } + stream << R"(int num_pipes ) + { + int gid = get_global_id(0); + reserve_id_t res_id; + + + if(gid < (get_global_size(0))/num_pipes) + { + res_id = reserve_read_pipe(pipe0, 1); + if(is_valid_reserve_id(res_id)) + { + read_pipe(pipe0, res_id, 0, &dst[gid]); + commit_read_pipe(pipe0, res_id); + } + })"; + + for (i = 1; i < num_pipes; i++) + { + // clang-format off + stream << R"( + else if(gid < ()" << (i + 1) << R"(*get_global_size(0))/num_pipes) + { + res_id = reserve_read_pipe(pipe)" << i << R"(, 1); + if(is_valid_reserve_id(res_id)) + { + read_pipe(pipe)" << i << R"(, res_id, 0, &dst[gid]); + commit_read_pipe(pipe)" << i << R"(, res_id); + } + })"; + // clang-format on + } + stream << "}"; +} + +static int verify_result(void *ptr1, void *ptr2, int n) +{ + int i; + int sum_input = 0, sum_output = 0; + cl_char *inptr = (cl_char *)ptr1; + cl_char *outptr = (cl_char *)ptr2; + + for(i = 0; i < n; i++) + { + sum_input += inptr[i]; + sum_output += outptr[i]; + } + if(sum_input != sum_output){ + return -1; + } + return 0; +} + +static int verify_result_int(void *ptr1, void *ptr2, int n) +{ + int i; + int sum_input = 0, sum_output = 0; + cl_int *inptr = (cl_int *)ptr1; + cl_int *outptr = (cl_int *)ptr2; + + for(i = 0; i < n; i++) + { + sum_input += inptr[i]; + sum_output += outptr[i]; + } + if(sum_input != sum_output){ + return -1; + } + return 0; +} + +int test_pipe_max_args(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) +{ + + clMemWrapper pipes[1024]; + clMemWrapper buffers[2]; + void *outptr; + cl_int *inptr; + clProgramWrapper program; + clKernelWrapper kernel[2]; + size_t global_work_size[3]; + cl_int err; + cl_int size; + int num_pipe_elements = 1024; + int i, j; + int max_pipe_args; + std::stringstream source; + clEventWrapper producer_sync_event = NULL; + clEventWrapper consumer_sync_event = NULL; + BufferOwningPtr BufferInPtr; + BufferOwningPtr BufferOutPtr; + + MTdataHolder d(gRandomSeed); + const char *kernelName[] = { "test_multiple_pipe_write", + "test_multiple_pipe_read" }; + + size_t min_alignment = get_min_alignment(context); + + err = clGetDeviceInfo(deviceID, CL_DEVICE_MAX_PIPE_ARGS, + sizeof(max_pipe_args), (void *)&max_pipe_args, NULL); + if (err) + { + print_error(err, " clGetDeviceInfo failed\n"); + return -1; + } + if(max_pipe_args < 16){ + log_error("The device should support minimum 16 pipe objects that could be passed as arguments to the kernel"); + return -1; + } + + global_work_size[0] = (cl_uint)num_pipe_elements * max_pipe_args; + size = sizeof(int) * num_pipe_elements * max_pipe_args; + + inptr = (cl_int *)align_malloc(size, min_alignment); + + for(i = 0; i < num_pipe_elements * max_pipe_args; i++){ + inptr[i] = (int)genrand_int32(d); + } + BufferInPtr.reset(inptr, nullptr, 0, size, true); + + buffers[0] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, size, inptr, &err); + test_error_ret(err, " clCreateBuffer failed", -1); + + outptr = align_malloc(size, min_alignment); + BufferOutPtr.reset(outptr, nullptr, 0, size, true); + buffers[1] = clCreateBuffer(context, CL_MEM_USE_HOST_PTR, size, outptr, &err); + test_error_ret(err, " clCreateBuffer failed", -1); + + for(i = 0; i < max_pipe_args; i++){ + pipes[i] = clCreatePipe(context, CL_MEM_HOST_NO_ACCESS, sizeof(int), num_pipe_elements, NULL, &err); + test_error_ret(err, " clCreatePipe failed", -1); + } + + createKernelSourceCode(source, max_pipe_args); + + std::string kernel_source = source.str(); + const char *sources[] = { kernel_source.c_str() }; + + // Create producer kernel + err = create_single_kernel_helper_with_build_options( + context, &program, &kernel[0], 1, sources, kernelName[0], + "-cl-std=CL2.0"); + test_error_ret(err, " Error creating program", -1); + + //Create consumer kernel + kernel[1] = clCreateKernel(program, kernelName[1], &err); + test_error_ret(err, " Error creating kernel", -1); + + err = clSetKernelArg(kernel[0], 0, sizeof(cl_mem), (void*)&buffers[0]); + for( i = 0; i < max_pipe_args; i++){ + err |= clSetKernelArg(kernel[0], i+1, sizeof(cl_mem), (void*)&pipes[i]); + } + err |= clSetKernelArg(kernel[0], max_pipe_args + 1, sizeof(int), (void*)&max_pipe_args); + err |= clSetKernelArg(kernel[1], 0, sizeof(cl_mem), (void*)&buffers[1]); + for( i = 0; i < max_pipe_args; i++){ + err |= clSetKernelArg(kernel[1], i+1, sizeof(cl_mem), (void*)&pipes[i]); + } + err |= clSetKernelArg(kernel[1], max_pipe_args + 1, sizeof(int), (void*)&max_pipe_args); + test_error_ret(err, " clSetKernelArg failed", -1); + + // Launch Producer kernel + err = clEnqueueNDRangeKernel( queue, kernel[0], 1, NULL, global_work_size, NULL, 0, NULL, &producer_sync_event ); + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); + + // Launch Consumer kernel + err = clEnqueueNDRangeKernel( queue, kernel[1], 1, NULL, global_work_size, NULL, 1, &producer_sync_event, &consumer_sync_event ); + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); + + err = clEnqueueReadBuffer(queue, buffers[1], true, 0, size, outptr, 1, &consumer_sync_event, NULL); + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); + + err = clWaitForEvents(1, &consumer_sync_event); + test_error_ret(err, " clWaitForEvents failed", -1); + + if( verify_result( inptr, outptr, num_pipe_elements*sizeof(cl_int))){ + log_error("test_pipe_max_args failed\n"); + } + else { + log_info("test_pipe_max_args passed\n"); + } + + return 0; +} + + +int test_pipe_max_packet_size(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) +{ + clMemWrapper pipe; + clMemWrapper buffers[2]; + void *outptr; + cl_char *inptr; + clProgramWrapper program; + clKernelWrapper kernel[2]; + size_t global_work_size[3]; + cl_int err; + size_t size; + int num_pipe_elements = 1024; + int i; + cl_uint max_pipe_packet_size; + clEventWrapper producer_sync_event = NULL; + clEventWrapper consumer_sync_event = NULL; + BufferOwningPtr BufferInPtr; + BufferOwningPtr BufferOutPtr; + MTdataHolder d(gRandomSeed); + const char *kernelName[] = { "test_pipe_max_packet_size_write", + "test_pipe_max_packet_size_read" }; + + size_t min_alignment = get_min_alignment(context); + + global_work_size[0] = (cl_uint)num_pipe_elements; + + std::stringstream source; + + err = clGetDeviceInfo(deviceID, CL_DEVICE_PIPE_MAX_PACKET_SIZE, + sizeof(max_pipe_packet_size), + (void *)&max_pipe_packet_size, NULL); + test_error_ret(err, " clCreatePipe failed", -1); + + if (max_pipe_packet_size < 1024) + { + log_error( + "The device should support minimum packet size of 1024 bytes"); + return -1; + } + + if(max_pipe_packet_size > (32*1024*1024/num_pipe_elements)) + { + max_pipe_packet_size = 32*1024*1024/num_pipe_elements; + } + + size = max_pipe_packet_size * num_pipe_elements; + + inptr = (cl_char *)align_malloc(size, min_alignment); + + for(i = 0; i < size; i++){ + inptr[i] = (char)genrand_int32(d); + } + BufferInPtr.reset(inptr, nullptr, 0, size, true); + + buffers[0] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, size, inptr, &err); + test_error_ret(err, " clCreateBuffer failed", -1); + + outptr = align_malloc(size, min_alignment); + BufferOutPtr.reset(outptr, nullptr, 0, size, true); + + buffers[1] = clCreateBuffer(context, CL_MEM_USE_HOST_PTR, size, outptr, &err); + test_error_ret(err, " clCreateBuffer failed", -1); + + pipe = clCreatePipe(context, CL_MEM_HOST_NO_ACCESS, max_pipe_packet_size, num_pipe_elements, NULL, &err); + test_error_ret(err, " clCreatePipe failed", -1); + + // clang-format off + source << R"( + typedef struct{ + char a[)" << max_pipe_packet_size << R"(]; + }TestStruct; + + __kernel void test_pipe_max_packet_size_write(__global TestStruct *src, __write_only pipe TestStruct out_pipe) + { + int gid = get_global_id(0); + reserve_id_t res_id; + + res_id = reserve_write_pipe(out_pipe, 1); + if(is_valid_reserve_id(res_id)) + { + write_pipe(out_pipe, res_id, 0, &src[gid]); + commit_write_pipe(out_pipe, res_id); + } + } + + __kernel void test_pipe_max_packet_size_read(__read_only pipe TestStruct in_pipe, __global TestStruct *dst) + { + int gid = get_global_id(0); + reserve_id_t res_id; + + res_id = reserve_read_pipe(in_pipe, 1); + if(is_valid_reserve_id(res_id)) + { + read_pipe(in_pipe, res_id, 0, &dst[gid]); + commit_read_pipe(in_pipe, res_id); + } + } + )"; + // clang-format on + + std::string kernel_source = source.str(); + const char *sources[] = { kernel_source.c_str() }; + + // Create producer kernel + err = create_single_kernel_helper_with_build_options( + context, &program, &kernel[0], 1, sources, kernelName[0], + "-cl-std=CL2.0"); + test_error_ret(err, " Error creating program", -1); + + //Create consumer kernel + kernel[1] = clCreateKernel(program, kernelName[1], &err); + test_error_ret(err, " Error creating kernel", -1); + + err = clSetKernelArg(kernel[0], 0, sizeof(cl_mem), (void*)&buffers[0]); + err |= clSetKernelArg(kernel[0], 1, sizeof(cl_mem), (void*)&pipe); + err |= clSetKernelArg(kernel[1], 0, sizeof(cl_mem), (void*)&pipe); + err |= clSetKernelArg(kernel[1], 1, sizeof(cl_mem), (void*)&buffers[1]); + test_error_ret(err, " clSetKernelArg failed", -1); + + // Launch Producer kernel + err = clEnqueueNDRangeKernel( queue, kernel[0], 1, NULL, global_work_size, NULL, 0, NULL, &producer_sync_event ); + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); + + // Launch Consumer kernel + err = clEnqueueNDRangeKernel( queue, kernel[1], 1, NULL, global_work_size, NULL, 1, &producer_sync_event, &consumer_sync_event ); + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); + + err = clEnqueueReadBuffer(queue, buffers[1], true, 0, size, outptr, 1, &consumer_sync_event, NULL); + test_error_ret(err, " clEnqueueReadBuffer failed", -1); + + if( verify_result( inptr, outptr, size)){ + log_error("test_pipe_max_packet_size failed\n"); + } + else { + log_info("test_pipe_max_packet_size passed\n"); + } + + return 0; +} + +int test_pipe_max_active_reservations(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) +{ + clMemWrapper pipe; + clMemWrapper buffers[2]; + clMemWrapper buf_reservations; + clMemWrapper buf_status; + clMemWrapper buf_reserve_id_t_size; + clMemWrapper buf_reserve_id_t_size_aligned; + cl_int *inptr; + void *outptr; + int size, i; + clProgramWrapper program; + clKernelWrapper kernel[3]; + size_t global_work_size[3]; + cl_int err; + int status = 0; + cl_uint max_active_reservations = 0; + cl_ulong max_global_size = 0; + int reserve_id_t_size; + int temp; + clEventWrapper sync_event = NULL; + clEventWrapper read_event = NULL; + BufferOwningPtr BufferInPtr; + BufferOwningPtr BufferOutPtr; + MTdataHolder d(gRandomSeed); + const char *kernelName[3] = { "test_pipe_max_active_reservations_write", + "test_pipe_max_active_reservations_read", + "pipe_get_reserve_id_t_size" }; + + size_t min_alignment = get_min_alignment(context); + + std::stringstream source; + + global_work_size[0] = 1; + + err = clGetDeviceInfo(deviceID, CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS, + sizeof(max_active_reservations), + (void *)&max_active_reservations, NULL); + test_error_ret(err, " clGetDeviceInfo failed", -1); + + err = clGetDeviceInfo(deviceID, CL_DEVICE_GLOBAL_MEM_SIZE, + sizeof(max_global_size), (void *)&max_global_size, + NULL); + test_error_ret(err, " clGetDeviceInfo failed", -1); + + max_active_reservations = (max_active_reservations > max_global_size) + ? 1 << 16 + : max_active_reservations; + + if (max_active_reservations < 1) + { + log_error("The device should support minimum active reservations of 1"); + return -1; + } + + // To get reserve_id_t size + buf_reserve_id_t_size = clCreateBuffer(context, CL_MEM_HOST_READ_ONLY, sizeof(reserve_id_t_size), NULL, &err); + test_error_ret(err, " clCreateBuffer failed", -1); + + // clang-format off + source << R"( + __kernel void test_pipe_max_active_reservations_write(__global int *src, __write_only pipe int out_pipe, __global char *reserve_id, __global int *reserve_id_t_size_aligned, __global int *status) + { + __global reserve_id_t *res_id_ptr; + int reserve_idx; + int commit_idx; + + for(reserve_idx = 0; reserve_idx < )" << max_active_reservations << R"(; reserve_idx++) + { + res_id_ptr = (__global reserve_id_t*)(reserve_id + reserve_idx*reserve_id_t_size_aligned[0]); + *res_id_ptr = reserve_write_pipe(out_pipe, 1); + if(is_valid_reserve_id(res_id_ptr[0])) + { + write_pipe(out_pipe, res_id_ptr[0], 0, &src[reserve_idx]); + } + else + { + *status = -1; + return; + } + } + + for(commit_idx = 0; commit_idx < )" << max_active_reservations << R"(; commit_idx++) + { + res_id_ptr = (__global reserve_id_t*)(reserve_id + commit_idx*reserve_id_t_size_aligned[0]); + commit_write_pipe(out_pipe, res_id_ptr[0]); + } + } + + __kernel void test_pipe_max_active_reservations_read(__read_only pipe int in_pipe, __global int *dst, __global char *reserve_id, __global int *reserve_id_t_size_aligned, __global int *status) + { + __global reserve_id_t *res_id_ptr; + int reserve_idx; + int commit_idx; + + for(reserve_idx = 0; reserve_idx < )" << max_active_reservations << R"(; reserve_idx++) + { + res_id_ptr = (__global reserve_id_t*)(reserve_id + reserve_idx*reserve_id_t_size_aligned[0]); + *res_id_ptr = reserve_read_pipe(in_pipe, 1); + + if(is_valid_reserve_id(res_id_ptr[0])) + { + read_pipe(in_pipe, res_id_ptr[0], 0, &dst[reserve_idx]); + } + else + { + *status = -1; + return; + } + } + + for(commit_idx = 0; commit_idx < )" << max_active_reservations << R"(; commit_idx++) + { + res_id_ptr = (__global reserve_id_t*)(reserve_id + commit_idx*reserve_id_t_size_aligned[0]); + commit_read_pipe(in_pipe, res_id_ptr[0]); + } + } + + __kernel void pipe_get_reserve_id_t_size(__global int *reserve_id_t_size) + { + *reserve_id_t_size = sizeof(reserve_id_t); + } + )"; + // clang-format on + + std::string kernel_source = source.str(); + const char *sources[] = { kernel_source.c_str() }; + + // Create producer kernel + err = create_single_kernel_helper_with_build_options( + context, &program, &kernel[0], 1, sources, kernelName[0], + "-cl-std=CL2.0"); + test_error_ret(err, " Error creating program", -1); + + // Create consumer kernel + kernel[1] = clCreateKernel(program, kernelName[1], &err); + test_error_ret(err, " Error creating kernel", -1); + + // Create size query kernel for reserve_id_t + kernel[2] = clCreateKernel(program, kernelName[2], &err); + test_error_ret(err, " Error creating kernel", -1); + + err = clSetKernelArg(kernel[2], 0, sizeof(cl_mem), (void*)&buf_reserve_id_t_size); + test_error_ret(err, " clSetKernelArg failed", -1); + + //Launch size query kernel for reserve_id_t + err = clEnqueueNDRangeKernel( queue, kernel[2], 1, NULL, global_work_size, NULL, 0, NULL, &sync_event ); + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); + + err = clEnqueueReadBuffer(queue, buf_reserve_id_t_size, true, 0, sizeof(reserve_id_t_size), &reserve_id_t_size, 1, &sync_event, &read_event); + test_error_ret(err, " clEnqueueReadBuffer failed", -1); + + err = clWaitForEvents(1, &read_event); + test_error_ret(err, " clWaitForEvents failed", -1); + + // Round reserve_id_t_size to the nearest power of 2 + temp = 1; + while(temp < reserve_id_t_size) + temp *= 2; + reserve_id_t_size = temp; + + size = sizeof(cl_int) * max_active_reservations; + inptr = (cl_int *)align_malloc(size, min_alignment); + + for(i = 0; i < max_active_reservations; i++){ + inptr[i] = (int)genrand_int32(d); + } + BufferInPtr.reset(inptr, nullptr, 0, size, true); + + buffers[0] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, size, inptr, &err); + test_error_ret(err, " clCreateBuffer failed", -1); + + outptr = align_malloc(size, min_alignment); + BufferOutPtr.reset(outptr, nullptr, 0, size, true); + + buffers[1] = clCreateBuffer(context, CL_MEM_HOST_READ_ONLY, size, NULL, &err); + test_error_ret(err, " clCreateBuffer failed", -1); + + buf_reserve_id_t_size_aligned = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, sizeof(reserve_id_t_size), &reserve_id_t_size, &err); + test_error_ret(err, " clCreateBuffer failed", -1); + + //For error status + buf_status = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, sizeof(int), &status, &err); + test_error_ret(err, " clCreateBuffer failed", -1); + + pipe = clCreatePipe(context, CL_MEM_HOST_NO_ACCESS, sizeof(int), max_active_reservations, NULL, &err); + test_error_ret(err, " clCreatePipe failed", -1); + + // Global buffer to hold all active reservation ids + buf_reservations = clCreateBuffer(context, CL_MEM_HOST_NO_ACCESS, reserve_id_t_size*max_active_reservations, NULL, &err); + test_error_ret(err, " clCreateBuffer failed", -1); + + err = clSetKernelArg(kernel[0], 0, sizeof(cl_mem), (void*)&buffers[0]); + err |= clSetKernelArg(kernel[0], 1, sizeof(cl_mem), (void*)&pipe); + err |= clSetKernelArg(kernel[0], 2, sizeof(cl_mem), (void*)&buf_reservations); + err |= clSetKernelArg(kernel[0], 3, sizeof(cl_mem), (void*)&buf_reserve_id_t_size_aligned); + err |= clSetKernelArg(kernel[0], 4, sizeof(cl_mem), (void*)&buf_status); + test_error_ret(err, " clSetKernelArg failed", -1); + + err = clSetKernelArg(kernel[1], 0, sizeof(cl_mem), (void*)&pipe); + err |= clSetKernelArg(kernel[1], 1, sizeof(cl_mem), (void*)&buffers[1]); + err |= clSetKernelArg(kernel[1], 2, sizeof(cl_mem), (void*)&buf_reservations); + err |= clSetKernelArg(kernel[1], 3, sizeof(cl_mem), (void*)&buf_reserve_id_t_size_aligned); + err |= clSetKernelArg(kernel[1], 4, sizeof(cl_mem), (void*)&buf_status); + test_error_ret(err, " clSetKernelArg failed", -1); + + clReleaseEvent(sync_event); + + // Launch Producer kernel + err = clEnqueueNDRangeKernel(queue, kernel[0], 1, NULL, global_work_size, NULL, 0, NULL, &sync_event); + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); + + err = clEnqueueReadBuffer(queue, buf_status, true, 0, sizeof(int), &status, 1, &sync_event, NULL); + test_error_ret(err, " clEnqueueReadBuffer failed", -1); + + if(status != 0) + { + log_error("test_pipe_max_active_reservations failed\n"); + return -1; + } + + clReleaseEvent(sync_event); + // Launch Consumer kernel + err = clEnqueueNDRangeKernel(queue, kernel[1], 1, NULL, global_work_size, NULL, 0, NULL, &sync_event); + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); + + err = clEnqueueReadBuffer(queue, buf_status, true, 0, sizeof(int), &status, 1, &sync_event, NULL); + test_error_ret(err, " clEnqueueReadBuffer failed", -1); + + if(status != 0) + { + log_error("test_pipe_max_active_reservations failed\n"); + return -1; + } + + err = clEnqueueReadBuffer(queue, buffers[1], true, 0, size, outptr, 1, &sync_event, NULL); + test_error_ret(err, " clEnqueueReadBuffer failed", -1); + + if( verify_result_int( inptr, outptr, max_active_reservations)){ + log_error("test_pipe_max_active_reservations failed\n"); + return -1; + } + else { + log_info("test_pipe_max_active_reservations passed\n"); + } + + return 0; +} \ No newline at end of file diff --git a/test_conformance/pipes/test_pipe_query_functions.c b/test_conformance/pipes/test_pipe_query_functions.c deleted file mode 100644 index ce3baafd..00000000 --- a/test_conformance/pipes/test_pipe_query_functions.c +++ /dev/null @@ -1,544 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - -#include "procs.h" -#include "../../test_common/harness/errorHelpers.h" - -#define TEST_PRIME_INT ((1<<16)+1) - -const char* pipe_query_functions_kernel_code = { - "__kernel void test_pipe_write(__global int *src, __write_only pipe int out_pipe)\n" - "{\n" - " int gid = get_global_id(0);\n" - " reserve_id_t res_id;\n" - " res_id = reserve_write_pipe(out_pipe, 1);\n" - " if(is_valid_reserve_id(res_id))\n" - " {\n" - " write_pipe(out_pipe, res_id, 0, &src[gid]);\n" - " commit_write_pipe(out_pipe, res_id);\n" - " }\n" - "}\n" - "\n" - "__kernel void test_pipe_query_functions(__write_only pipe int out_pipe, __global int *num_packets, __global int *max_packets)\n" - "{\n" - " *max_packets = get_pipe_max_packets(out_pipe);\n" - " *num_packets = get_pipe_num_packets(out_pipe);\n" - "}\n" - "\n" - "__kernel void test_pipe_read(__read_only pipe int in_pipe, __global int *dst)\n" - "{\n" - " int gid = get_global_id(0);\n" - " reserve_id_t res_id;\n" - " res_id = reserve_read_pipe(in_pipe, 1);\n" - " if(is_valid_reserve_id(res_id))\n" - " {\n" - " read_pipe(in_pipe, res_id, 0, &dst[gid]);\n" - " commit_read_pipe(in_pipe, res_id);\n" - " }\n" - "}\n" }; - -static int verify_result(void *ptr1, void *ptr2, int n) -{ - int i, sum_output = 0; - cl_int *outptr1 = (int *)ptr1; - cl_int *outptr2 = (int *)ptr2; - int cmp_val = ((n*3)/2) * TEST_PRIME_INT; - - for(i = 0; i < n/2; i++) - { - sum_output += outptr1[i]; - } - for(i = 0; i < n; i++) - { - sum_output += outptr2[i]; - } - if(sum_output != cmp_val){ - return -1; - } - return 0; -} - -int test_pipe_query_functions(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - cl_mem pipe; - cl_mem buffers[4]; - void *outptr1; - void *outptr2; - cl_int *inptr; - cl_program program; - cl_kernel kernel[3]; - size_t global_work_size[3]; - size_t half_global_work_size[3]; - size_t global_work_size_pipe_query[3]; - cl_int pipe_max_packets, pipe_num_packets; - cl_int err; - cl_int size; - cl_int i; - cl_event producer_sync_event = NULL; - cl_event consumer_sync_event = NULL; - cl_event pipe_query_sync_event = NULL; - cl_event pipe_read_sync_event = NULL; - MTdata d = init_genrand( gRandomSeed ); - const char* kernelName[] = {"test_pipe_write", "test_pipe_read", "test_pipe_query_functions"}; - - size_t min_alignment = get_min_alignment(context); - - size = sizeof(int) * num_elements; - global_work_size[0] = (cl_uint)num_elements; - half_global_work_size[0] = (cl_uint)(num_elements / 2); - global_work_size_pipe_query[0] = 1; - - inptr = (int *)align_malloc(size, min_alignment); - - for(i = 0; i < num_elements; i++){ - inptr[i] = TEST_PRIME_INT; - } - - buffers[0] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, size, inptr, &err); - if(err){ - clReleaseMemObject(buffers[0]); - print_error(err, " clCreateBuffer failed\n"); - return -1; - } - outptr1 = align_malloc(size/2, min_alignment); - outptr2 = align_malloc(size, min_alignment); - buffers[1] = clCreateBuffer(context, CL_MEM_HOST_READ_ONLY, size, NULL, &err); - if ( err ){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - align_free( outptr1 ); - print_error(err, " clCreateBuffer failed\n" ); - return -1; - } - - buffers[2] = clCreateBuffer(context, CL_MEM_READ_WRITE, sizeof(int), NULL, &err); - if ( err ){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - align_free( outptr1 ); - print_error(err, " clCreateBuffer failed\n" ); - return -1; - } - - buffers[3] = clCreateBuffer(context, CL_MEM_READ_WRITE, sizeof(int), NULL, &err); - if ( err ){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(buffers[3]); - align_free( outptr1 ); - print_error(err, " clCreateBuffer failed\n" ); - return -1; - } - - pipe = clCreatePipe(context, CL_MEM_HOST_NO_ACCESS, sizeof(int), num_elements, NULL, &err); - if(err){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(buffers[3]); - align_free( outptr1 ); - clReleaseMemObject(pipe); - print_error(err, " clCreatePipe failed\n"); - return -1; - } - - // Create producer kernel - err = create_single_kernel_helper_with_build_options(context, &program, &kernel[0], 1, (const char**)&pipe_query_functions_kernel_code, kernelName[0], "-cl-std=CL2.0"); - if(err){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(buffers[3]); - clReleaseMemObject(pipe); - align_free(outptr1); - print_error(err, "Error creating program\n"); - return -1; - } - //Create consumer kernel - kernel[1] = clCreateKernel(program, kernelName[1], &err); - if( kernel[1] == NULL || err != CL_SUCCESS) - { - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(buffers[3]); - clReleaseMemObject(pipe); - align_free(outptr1); - print_error(err, "Error creating kernel\n"); - return -1; - } - //Create pipe query functions kernel - kernel[2] = clCreateKernel(program, kernelName[2], &err); - if( kernel[1] == NULL || err != CL_SUCCESS) - { - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(buffers[3]); - clReleaseMemObject(pipe); - align_free(outptr1); - print_error(err, "Error creating kernel\n"); - return -1; - } - - err = clSetKernelArg(kernel[0], 0, sizeof(cl_mem), (void*)&buffers[0]); - err |= clSetKernelArg(kernel[0], 1, sizeof(cl_mem), (void*)&pipe); - err |= clSetKernelArg(kernel[1], 0, sizeof(cl_mem), (void*)&pipe); - err |= clSetKernelArg(kernel[1], 1, sizeof(cl_mem), (void*)&buffers[1]); - err |= clSetKernelArg(kernel[2], 0, sizeof(cl_mem), (void*)&pipe); - err |= clSetKernelArg(kernel[2], 1, sizeof(cl_mem), (void*)&buffers[2]); - err |= clSetKernelArg(kernel[2], 2, sizeof(cl_mem), (void*)&buffers[3]); - - if ( err != CL_SUCCESS ){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(buffers[3]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseProgram(program); - align_free(outptr1); - print_error(err, " clSetKernelArg failed\n"); - return -1; - } - - // Launch Producer kernel - err = clEnqueueNDRangeKernel( queue, kernel[0], 1, NULL, global_work_size, NULL, 0, NULL, &producer_sync_event ); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueNDRangeKernel failed\n" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(buffers[3]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseEvent(pipe_query_sync_event); - clReleaseEvent(pipe_read_sync_event); - clReleaseProgram(program); - align_free(outptr1); - return -1; - } - - // Launch Pipe query kernel - err = clEnqueueNDRangeKernel( queue, kernel[2], 1, NULL, global_work_size_pipe_query, NULL, 1, &producer_sync_event, &pipe_query_sync_event ); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueNDRangeKernel failed\n" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(buffers[3]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseEvent(pipe_query_sync_event); - clReleaseEvent(pipe_read_sync_event); - clReleaseProgram(program); - align_free(outptr1); - return -1; - } - - err = clEnqueueReadBuffer(queue, buffers[2], true, 0, sizeof(cl_int), &pipe_num_packets, 1, &pipe_query_sync_event, NULL); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueReadBuffer failed\n" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(buffers[3]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseEvent(pipe_query_sync_event); - clReleaseEvent(pipe_read_sync_event); - clReleaseProgram(program); - align_free(outptr1); - return -1; - } - - - err = clEnqueueReadBuffer(queue, buffers[3], true, 0, sizeof(cl_int), &pipe_max_packets, 1, &pipe_query_sync_event, NULL); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueReadBuffer failed\n" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(buffers[3]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseEvent(pipe_query_sync_event); - clReleaseEvent(pipe_read_sync_event); - clReleaseProgram(program); - align_free(outptr1); - return -1; - } - - if(pipe_num_packets != num_elements || pipe_max_packets != num_elements) - { - log_error("test_pipe_query_functions failed\n"); - return -1; - } - - // Launch Consumer kernel with half the previous global size - err = clEnqueueNDRangeKernel( queue, kernel[1], 1, NULL, half_global_work_size, NULL, 1, &producer_sync_event, &consumer_sync_event ); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueNDRangeKernel failed\n" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(buffers[3]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseEvent(pipe_query_sync_event); - clReleaseEvent(pipe_read_sync_event); - clReleaseProgram(program); - align_free(outptr1); - return -1; - } - - err = clEnqueueReadBuffer(queue, buffers[1], true, 0, size / 2, outptr1, 1, &consumer_sync_event, NULL); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueReadBuffer failed\n" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(buffers[3]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseEvent(pipe_query_sync_event); - clReleaseEvent(pipe_read_sync_event); - clReleaseProgram(program); - align_free(outptr1); - return -1; - } - - // Launch Pipe query kernel - err = clEnqueueNDRangeKernel( queue, kernel[2], 1, NULL, global_work_size_pipe_query, NULL, 1, &consumer_sync_event, &pipe_query_sync_event ); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueNDRangeKernel failed\n" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(buffers[3]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseEvent(pipe_query_sync_event); - clReleaseEvent(pipe_read_sync_event); - clReleaseProgram(program); - align_free(outptr1); - return -1; - } - - err = clEnqueueReadBuffer(queue, buffers[2], true, 0, sizeof(cl_int), &pipe_num_packets, 1, &pipe_query_sync_event, &pipe_read_sync_event); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueReadBuffer failed\n" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(buffers[3]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseEvent(pipe_query_sync_event); - clReleaseEvent(pipe_read_sync_event); - clReleaseProgram(program); - align_free(outptr1); - return -1; - } - - // After consumer kernel consumes num_elements/2 from the pipe, - // there are (num_elements - num_elements/2) remaining package in the pipe. - if(pipe_num_packets != (num_elements - num_elements/2)) - { - log_error("test_pipe_query_functions failed\n"); - return -1; - } - - // Launch Producer kernel to fill the pipe again - global_work_size[0] = pipe_num_packets; - err = clEnqueueNDRangeKernel( queue, kernel[0], 1, NULL, global_work_size, NULL, 1, &pipe_read_sync_event, &producer_sync_event ); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueNDRangeKernel failed\n" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(buffers[3]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseEvent(pipe_query_sync_event); - clReleaseEvent(pipe_read_sync_event); - clReleaseProgram(program); - align_free(outptr1); - return -1; - } - - // Launch Pipe query kernel - err = clEnqueueNDRangeKernel( queue, kernel[2], 1, NULL, global_work_size_pipe_query, NULL, 1, &producer_sync_event, &pipe_query_sync_event ); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueNDRangeKernel failed\n" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(buffers[3]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseEvent(pipe_query_sync_event); - clReleaseEvent(pipe_read_sync_event); - clReleaseProgram(program); - align_free(outptr1); - return -1; - } - - err = clEnqueueReadBuffer(queue, buffers[2], true, 0, sizeof(cl_int), &pipe_num_packets, 1, &pipe_query_sync_event, &pipe_read_sync_event); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueReadBuffer failed\n" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(buffers[3]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseEvent(pipe_query_sync_event); - clReleaseEvent(pipe_read_sync_event); - clReleaseProgram(program); - align_free(outptr1); - return -1; - } - - if(pipe_num_packets != num_elements) - { - log_error("test_pipe_query_functions failed\n"); - return -1; - } - - // Launch Consumer kernel to consume all packets from pipe - global_work_size[0] = pipe_num_packets; - err = clEnqueueNDRangeKernel( queue, kernel[1], 1, NULL, global_work_size, NULL, 1, &pipe_read_sync_event, &consumer_sync_event ); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueNDRangeKernel failed\n" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(buffers[3]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseEvent(pipe_query_sync_event); - clReleaseEvent(pipe_read_sync_event); - clReleaseProgram(program); - align_free(outptr1); - return -1; - } - - err = clEnqueueReadBuffer(queue, buffers[1], true, 0, size, outptr2, 1, &consumer_sync_event, NULL); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueReadBuffer failed\n" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(buffers[3]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseEvent(pipe_query_sync_event); - clReleaseEvent(pipe_read_sync_event); - clReleaseProgram(program); - align_free(outptr1); - return -1; - } - - - if( verify_result(outptr1, outptr2, num_elements )){ - log_error("test_pipe_query_functions failed\n"); - return -1; - } - else { - log_info("test_pipe_query_functions passed\n"); - } - //cleanup - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(buffers[3]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseKernel(kernel[2]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseEvent(pipe_query_sync_event); - clReleaseEvent(pipe_read_sync_event); - clReleaseProgram(program); - align_free(outptr1); - - return 0; -} - diff --git a/test_conformance/pipes/test_pipe_query_functions.cpp b/test_conformance/pipes/test_pipe_query_functions.cpp new file mode 100644 index 00000000..f9c93aa2 --- /dev/null +++ b/test_conformance/pipes/test_pipe_query_functions.cpp @@ -0,0 +1,253 @@ +// +// Copyright (c) 2017 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "harness/compat.h" + +#include +#include +#include +#include + +#include "procs.h" +#include "harness/errorHelpers.h" + +#define TEST_PRIME_INT ((1<<16)+1) + +const char* pipe_query_functions_kernel_code = { + "__kernel void test_pipe_write(__global int *src, __write_only pipe int out_pipe)\n" + "{\n" + " int gid = get_global_id(0);\n" + " reserve_id_t res_id;\n" + " res_id = reserve_write_pipe(out_pipe, 1);\n" + " if(is_valid_reserve_id(res_id))\n" + " {\n" + " write_pipe(out_pipe, res_id, 0, &src[gid]);\n" + " commit_write_pipe(out_pipe, res_id);\n" + " }\n" + "}\n" + "\n" + "__kernel void test_pipe_query_functions(__write_only pipe int out_pipe, __global int *num_packets, __global int *max_packets)\n" + "{\n" + " *max_packets = get_pipe_max_packets(out_pipe);\n" + " *num_packets = get_pipe_num_packets(out_pipe);\n" + "}\n" + "\n" + "__kernel void test_pipe_read(__read_only pipe int in_pipe, __global int *dst)\n" + "{\n" + " int gid = get_global_id(0);\n" + " reserve_id_t res_id;\n" + " res_id = reserve_read_pipe(in_pipe, 1);\n" + " if(is_valid_reserve_id(res_id))\n" + " {\n" + " read_pipe(in_pipe, res_id, 0, &dst[gid]);\n" + " commit_read_pipe(in_pipe, res_id);\n" + " }\n" + "}\n" }; + +static int verify_result(void *ptr1, void *ptr2, int n) +{ + int i, sum_output = 0; + cl_int *outptr1 = (int *)ptr1; + cl_int *outptr2 = (int *)ptr2; + int cmp_val = ((n*3)/2) * TEST_PRIME_INT; + + for(i = 0; i < n/2; i++) + { + sum_output += outptr1[i]; + } + for(i = 0; i < n; i++) + { + sum_output += outptr2[i]; + } + if(sum_output != cmp_val){ + return -1; + } + return 0; +} + +int test_pipe_query_functions(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) +{ + clMemWrapper pipe; + clMemWrapper buffers[4]; + void *outptr1; + void *outptr2; + cl_int *inptr; + clProgramWrapper program; + clKernelWrapper kernel[3]; + size_t global_work_size[3]; + size_t half_global_work_size[3]; + size_t global_work_size_pipe_query[3]; + cl_int pipe_max_packets, pipe_num_packets; + cl_int err; + cl_int size; + cl_int i; + clEventWrapper producer_sync_event = NULL; + clEventWrapper consumer_sync_event = NULL; + clEventWrapper pipe_query_sync_event = NULL; + clEventWrapper pipe_read_sync_event = NULL; + BufferOwningPtr BufferInPtr; + BufferOwningPtr BufferOutPtr1; + BufferOwningPtr BufferOutPtr2; + MTdataHolder d(gRandomSeed); + const char *kernelName[] = { "test_pipe_write", "test_pipe_read", + "test_pipe_query_functions" }; + + size_t min_alignment = get_min_alignment(context); + + size = sizeof(int) * num_elements; + global_work_size[0] = (cl_uint)num_elements; + half_global_work_size[0] = (cl_uint)(num_elements / 2); + global_work_size_pipe_query[0] = 1; + + inptr = (int *)align_malloc(size, min_alignment); + + for (i = 0; i < num_elements; i++) + { + inptr[i] = TEST_PRIME_INT; + } + BufferInPtr.reset(inptr, nullptr, 0, size, true); + + buffers[0] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, size, inptr, &err); + test_error_ret(err, " clCreateBuffer failed", -1); + + outptr1 = align_malloc(size/2, min_alignment); + outptr2 = align_malloc(size, min_alignment); + BufferOutPtr1.reset(outptr1, nullptr, 0, size, true); + BufferOutPtr2.reset(outptr2, nullptr, 0, size, true); + + buffers[1] = clCreateBuffer(context, CL_MEM_HOST_READ_ONLY, size, NULL, &err); + test_error_ret(err, " clCreateBuffer failed", -1); + + buffers[2] = clCreateBuffer(context, CL_MEM_READ_WRITE, sizeof(int), NULL, &err); + test_error_ret(err, " clCreateBuffer failed", -1); + + buffers[3] = clCreateBuffer(context, CL_MEM_READ_WRITE, sizeof(int), NULL, &err); + test_error_ret(err, " clCreateBuffer failed", -1); + + pipe = clCreatePipe(context, CL_MEM_HOST_NO_ACCESS, sizeof(int), num_elements, NULL, &err); + test_error_ret(err, " clCreatePipe failed", -1); + + // Create producer kernel + err = create_single_kernel_helper_with_build_options(context, &program, &kernel[0], 1, (const char**)&pipe_query_functions_kernel_code, kernelName[0], "-cl-std=CL2.0"); + test_error_ret(err, " Error creating program", -1); + + //Create consumer kernel + kernel[1] = clCreateKernel(program, kernelName[1], &err); + test_error_ret(err, " Error creating kernel", -1); + + //Create pipe query functions kernel + kernel[2] = clCreateKernel(program, kernelName[2], &err); + test_error_ret(err, " Error creating kernel", -1); + + err = clSetKernelArg(kernel[0], 0, sizeof(cl_mem), (void*)&buffers[0]); + err |= clSetKernelArg(kernel[0], 1, sizeof(cl_mem), (void*)&pipe); + err |= clSetKernelArg(kernel[1], 0, sizeof(cl_mem), (void*)&pipe); + err |= clSetKernelArg(kernel[1], 1, sizeof(cl_mem), (void*)&buffers[1]); + err |= clSetKernelArg(kernel[2], 0, sizeof(cl_mem), (void*)&pipe); + err |= clSetKernelArg(kernel[2], 1, sizeof(cl_mem), (void*)&buffers[2]); + err |= clSetKernelArg(kernel[2], 2, sizeof(cl_mem), (void*)&buffers[3]); + test_error_ret(err, " clSetKernelArg failed", -1); + + // Launch Producer kernel + err = clEnqueueNDRangeKernel( queue, kernel[0], 1, NULL, global_work_size, NULL, 0, NULL, &producer_sync_event ); + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); + + // Launch Pipe query kernel + err = clEnqueueNDRangeKernel( queue, kernel[2], 1, NULL, global_work_size_pipe_query, NULL, 1, &producer_sync_event, &pipe_query_sync_event ); + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); + + err = clEnqueueReadBuffer(queue, buffers[2], true, 0, sizeof(cl_int), &pipe_num_packets, 1, &pipe_query_sync_event, NULL); + test_error_ret(err, " clEnqueueReadBuffer failed", -1); + + err = clEnqueueReadBuffer(queue, buffers[3], true, 0, sizeof(cl_int), &pipe_max_packets, 1, &pipe_query_sync_event, NULL); + test_error_ret(err, " clEnqueueReadBuffer failed", -1); + + if(pipe_num_packets != num_elements || pipe_max_packets != num_elements) + { + log_error("test_pipe_query_functions failed\n"); + return -1; + } + + // Launch Consumer kernel with half the previous global size + err = clEnqueueNDRangeKernel( queue, kernel[1], 1, NULL, half_global_work_size, NULL, 1, &producer_sync_event, &consumer_sync_event ); + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); + + err = clEnqueueReadBuffer(queue, buffers[1], true, 0, size / 2, outptr1, 1, &consumer_sync_event, NULL); + test_error_ret(err, " clEnqueueReadBuffer failed", -1); + + // We will reuse this variable so release the previous referred event. + clReleaseEvent(pipe_query_sync_event); + + // Launch Pipe query kernel + err = clEnqueueNDRangeKernel( queue, kernel[2], 1, NULL, global_work_size_pipe_query, NULL, 1, &consumer_sync_event, &pipe_query_sync_event ); + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); + + err = clEnqueueReadBuffer(queue, buffers[2], true, 0, sizeof(cl_int), &pipe_num_packets, 1, &pipe_query_sync_event, &pipe_read_sync_event); + test_error_ret(err, " clEnqueueReadBuffer failed", -1); + + // After consumer kernel consumes num_elements/2 from the pipe, + // there are (num_elements - num_elements/2) remaining package in the pipe. + if(pipe_num_packets != (num_elements - num_elements/2)) + { + log_error("test_pipe_query_functions failed\n"); + return -1; + } + + // We will reuse this variable so release the previous referred event. + clReleaseEvent(producer_sync_event); + + // Launch Producer kernel to fill the pipe again + global_work_size[0] = pipe_num_packets; + err = clEnqueueNDRangeKernel( queue, kernel[0], 1, NULL, global_work_size, NULL, 1, &pipe_read_sync_event, &producer_sync_event ); + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); + + // We will reuse this variable so release the previous referred event. + clReleaseEvent(pipe_query_sync_event); + // Launch Pipe query kernel + err = clEnqueueNDRangeKernel( queue, kernel[2], 1, NULL, global_work_size_pipe_query, NULL, 1, &producer_sync_event, &pipe_query_sync_event ); + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); + + // We will reuse this variable so release the previous referred event. + clReleaseEvent(pipe_read_sync_event); + err = clEnqueueReadBuffer(queue, buffers[2], true, 0, sizeof(cl_int), &pipe_num_packets, 1, &pipe_query_sync_event, &pipe_read_sync_event); + test_error_ret(err, " clEnqueueReadBuffer failed", -1); + + if(pipe_num_packets != num_elements) + { + log_error("test_pipe_query_functions failed\n"); + return -1; + } + + // We will reuse this variable so release the previous referred event. + clReleaseEvent(consumer_sync_event); + + // Launch Consumer kernel to consume all packets from pipe + global_work_size[0] = pipe_num_packets; + err = clEnqueueNDRangeKernel( queue, kernel[1], 1, NULL, global_work_size, NULL, 1, &pipe_read_sync_event, &consumer_sync_event ); + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); + + err = clEnqueueReadBuffer(queue, buffers[1], true, 0, size, outptr2, 1, &consumer_sync_event, NULL); + test_error_ret(err, " clEnqueueReadBuffer failed", -1); + + if( verify_result(outptr1, outptr2, num_elements )){ + log_error("test_pipe_query_functions failed\n"); + return -1; + } + else { + log_info("test_pipe_query_functions passed\n"); + } + return 0; +} + diff --git a/test_conformance/pipes/test_pipe_read_write.c b/test_conformance/pipes/test_pipe_read_write.cpp similarity index 78% rename from test_conformance/pipes/test_pipe_read_write.c rename to test_conformance/pipes/test_pipe_read_write.cpp index 9191aa0f..4bb4468e 100644 --- a/test_conformance/pipes/test_pipe_read_write.c +++ b/test_conformance/pipes/test_pipe_read_write.cpp @@ -13,17 +13,21 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" +#include +#include +#include +#include #include #include -#include +#include #include -#include +#include #include "procs.h" #include "kernels.h" -#include "../../test_common/harness/errorHelpers.h" +#include "harness/errorHelpers.h" #ifndef uchar typedef unsigned char uchar; @@ -89,113 +93,139 @@ static const char* convenience_float_kernel_name[] = { "test_pipe_convenience_wr static const char* convenience_half_kernel_name[] = { "test_pipe_convenience_write_half", "test_pipe_convenience_read_half", "test_pipe_convenience_write_half2", "test_pipe_convenience_read_half2", "test_pipe_convenience_write_half4", "test_pipe_convenience_read_half4", "test_pipe_convenience_write_half8", "test_pipe_convenience_read_half8", "test_pipe_convenience_write_half16", "test_pipe_convenience_read_half16" }; static const char* convenience_double_kernel_name[] = { "test_pipe_convenience_write_double", "test_pipe_convenience_read_double", "test_pipe_convenience_write_double2", "test_pipe_convenience_read_double2", "test_pipe_convenience_write_double4", "test_pipe_convenience_read_double4", "test_pipe_convenience_write_double8", "test_pipe_convenience_read_double8", "test_pipe_convenience_write_double16", "test_pipe_convenience_read_double16" }; -static void insertPragmaForHalfType(char *source, char *type) +static void insertPragmaForHalfType(std::stringstream &stream, char *type) { - source[0] = 0; - if(strncmp(type, "half",4) == 0) + if (strncmp(type, "half", 4) == 0) { - strcat(source, "#pragma OPENCL EXTENSION cl_khr_fp16 : enable\n"); + stream << "#pragma OPENCL EXTENSION cl_khr_fp16 : enable\n"; } } -void createKernelSource(char *source, char *type) +void createKernelSource(std::stringstream &stream, char *type) { - char str[512]; - int str_length; + insertPragmaForHalfType(stream, type); - insertPragmaForHalfType(source, type); + // clang-format off + stream << R"( + __kernel void test_pipe_write_)" << type << "(__global " << type << " *src, __write_only pipe " << type << R"( out_pipe) + { + int gid = get_global_id(0); + reserve_id_t res_id; - sprintf(str, "__kernel void test_pipe_write_%s(__global %s *src, __write_only pipe %s out_pipe)\n", type, type, type); - strcat(source, str); - sprintf(str, "{\n int gid = get_global_id(0);\n reserve_id_t res_id; \n\n"); - strcat(source, str); - sprintf(str, " res_id = reserve_write_pipe(out_pipe, 1);\n if(is_valid_reserve_id(res_id))\n {\n"); - strcat(source, str); - sprintf(str, " write_pipe(out_pipe, res_id, 0, &src[gid]);\n commit_write_pipe(out_pipe, res_id);\n }\n}\n\n"); - strcat(source, str); - sprintf(str, "__kernel void test_pipe_read_%s(__read_only pipe %s in_pipe, __global %s *dst)\n", type, type, type); - strcat(source, str); - sprintf(str, "{\n int gid = get_global_id(0);\n reserve_id_t res_id; \n\n"); - strcat(source, str); - sprintf(str, " res_id = reserve_read_pipe(in_pipe, 1);\n if(is_valid_reserve_id(res_id))\n {\n"); - strcat(source, str); - sprintf(str, " read_pipe(in_pipe, res_id, 0, &dst[gid]);\n commit_read_pipe(in_pipe, res_id);\n }\n}\n"); - strcat(source, str); - str_length = strlen(source); - assert(str_length <= STRING_LENGTH); + res_id = reserve_write_pipe(out_pipe, 1); + if(is_valid_reserve_id(res_id)) + { + write_pipe(out_pipe, res_id, 0, &src[gid]); + commit_write_pipe(out_pipe, res_id); + } + } + + __kernel void test_pipe_read_)" << type << "(__read_only pipe " << type << " in_pipe, __global " << type << R"( *dst) + { + int gid = get_global_id(0); + reserve_id_t res_id; + + res_id = reserve_read_pipe(in_pipe, 1); + if(is_valid_reserve_id(res_id)) + { + read_pipe(in_pipe, res_id, 0, &dst[gid]); + commit_read_pipe(in_pipe, res_id); + } + } + )"; + // clang-format on } -void createKernelSourceWorkGroup(char *source, char *type) +void createKernelSourceWorkGroup(std::stringstream &stream, char *type) { - char str[512]; - int str_length; + insertPragmaForHalfType(stream, type); - insertPragmaForHalfType(source, type); + // clang-format off + stream << R"( + __kernel void test_pipe_workgroup_write_)" << type << "(__global " << type << " *src, __write_only pipe " << type << R"( out_pipe) + { + int gid = get_global_id(0); + __local reserve_id_t res_id; - sprintf(str, "__kernel void test_pipe_workgroup_write_%s(__global %s *src, __write_only pipe %s out_pipe)\n", type, type, type); - strcat(source, str); - sprintf(str, "{\n int gid = get_global_id(0);\n __local reserve_id_t res_id; \n\n"); - strcat(source, str); - sprintf(str, " res_id = work_group_reserve_write_pipe(out_pipe, get_local_size(0));\n if(is_valid_reserve_id(res_id))\n {\n"); - strcat(source, str); - sprintf(str, " write_pipe(out_pipe, res_id, get_local_id(0), &src[gid]);\n work_group_commit_write_pipe(out_pipe, res_id);\n }\n}\n\n"); - strcat(source, str); - sprintf(str, "__kernel void test_pipe_workgroup_read_%s(__read_only pipe %s in_pipe, __global %s *dst)\n", type, type, type); - strcat(source, str); - sprintf(str, "{\n int gid = get_global_id(0);\n __local reserve_id_t res_id; \n\n"); - strcat(source, str); - sprintf(str, " res_id = work_group_reserve_read_pipe(in_pipe, get_local_size(0));\n if(is_valid_reserve_id(res_id))\n {\n"); - strcat(source, str); - sprintf(str, " read_pipe(in_pipe, res_id, get_local_id(0), &dst[gid]);\n work_group_commit_read_pipe(in_pipe, res_id);\n }\n}\n"); - strcat(source, str); - str_length = strlen(source); - assert(str_length <= STRING_LENGTH); + res_id = work_group_reserve_write_pipe(out_pipe, get_local_size(0)); + if(is_valid_reserve_id(res_id)) + { + write_pipe(out_pipe, res_id, get_local_id(0), &src[gid]); + work_group_commit_write_pipe(out_pipe, res_id); + } + } + + __kernel void test_pipe_workgroup_read_)" << type << "(__read_only pipe " << type << " in_pipe, __global " << type << R"( *dst) + { + int gid = get_global_id(0); + __local reserve_id_t res_id; + + res_id = work_group_reserve_read_pipe(in_pipe, get_local_size(0)); + if(is_valid_reserve_id(res_id)) + { + read_pipe(in_pipe, res_id, get_local_id(0), &dst[gid]); + work_group_commit_read_pipe(in_pipe, res_id); + } + } + )"; + // clang-format on } -void createKernelSourceSubGroup(char *source, char *type) +void createKernelSourceSubGroup(std::stringstream &stream, char *type) { - char str[512]; - int str_length; + insertPragmaForHalfType(stream, type); - insertPragmaForHalfType(source, type); + // clang-format off + stream << R"( + #pragma OPENCL EXTENSION cl_khr_subgroups : enable + __kernel void test_pipe_subgroup_write_)" << type << "(__global " << type << " *src, __write_only pipe " << type << R"( out_pipe) + { + int gid = get_global_id(0); + reserve_id_t res_id; - sprintf(str, "#pragma OPENCL EXTENSION cl_khr_subgroups : enable\n__kernel void test_pipe_subgroup_write_%s(__global %s *src, __write_only pipe %s out_pipe)\n", type, type, type); - strcat(source, str); - sprintf(str, "{\n int gid = get_global_id(0);\n reserve_id_t res_id; \n\n"); - strcat(source, str); - sprintf(str, " res_id = sub_group_reserve_write_pipe(out_pipe, get_sub_group_size());\n if(is_valid_reserve_id(res_id))\n {\n"); - strcat(source, str); - sprintf(str, " write_pipe(out_pipe, res_id, get_sub_group_local_id(), &src[gid]);\n sub_group_commit_write_pipe(out_pipe, res_id);\n }\n}\n\n"); - strcat(source, str); - sprintf(str, "__kernel void test_pipe_subgroup_read_%s(__read_only pipe %s in_pipe, __global %s *dst)\n", type, type, type); - strcat(source, str); - sprintf(str, "{\n int gid = get_global_id(0);\n reserve_id_t res_id; \n\n"); - strcat(source, str); - sprintf(str, " res_id = sub_group_reserve_read_pipe(in_pipe, get_sub_group_size());\n if(is_valid_reserve_id(res_id))\n {\n"); - strcat(source, str); - sprintf(str, " read_pipe(in_pipe, res_id, get_sub_group_local_id(), &dst[gid]);\n sub_group_commit_read_pipe(in_pipe, res_id);\n }\n}\n"); - strcat(source, str); - str_length = strlen(source); - assert(str_length <= STRING_LENGTH); + res_id = sub_group_reserve_write_pipe(out_pipe, get_sub_group_size()); + if(is_valid_reserve_id(res_id)) + { + write_pipe(out_pipe, res_id, get_sub_group_local_id(), &src[gid]); + sub_group_commit_write_pipe(out_pipe, res_id); + } + } + + __kernel void test_pipe_subgroup_read_)" << type << "(__read_only pipe " << type << " in_pipe, __global " << type << R"( *dst) + { + int gid = get_global_id(0); + reserve_id_t res_id; + + res_id = sub_group_reserve_read_pipe(in_pipe, get_sub_group_size()); + if(is_valid_reserve_id(res_id)) + { + read_pipe(in_pipe, res_id, get_sub_group_local_id(), &dst[gid]); + sub_group_commit_read_pipe(in_pipe, res_id); + } + } + )"; + // clang-format on } -void createKernelSourceConvenience(char *source, char *type) +void createKernelSourceConvenience(std::stringstream &stream, char *type) { - char str[512]; - int str_length; + insertPragmaForHalfType(stream, type); - insertPragmaForHalfType(source, type); + // clang-format off + stream << R"( + __kernel void test_pipe_convenience_write_)" << type << "(__global " << type << " *src, __write_only pipe " << type << R"( out_pipe) + { + int gid = get_global_id(0); + write_pipe(out_pipe, &src[gid]); + } - sprintf(str, "__kernel void test_pipe_convenience_write_%s(__global %s *src, __write_only pipe %s out_pipe)\n", type, type, type); - strcat(source, str); - sprintf(str, "{\n int gid = get_global_id(0);\n write_pipe(out_pipe, &src[gid]);\n}\n\n"); - strcat(source, str); - sprintf(str, "__kernel void test_pipe_convenience_read_%s(__read_only pipe %s in_pipe, __global %s *dst)\n", type, type, type); - strcat(source, str); - sprintf(str, "{\n int gid = get_global_id(0);\n read_pipe(in_pipe, &dst[gid]);\n}\n"); - strcat(source, str); - str_length = strlen(source); - assert(str_length <= STRING_LENGTH); + __kernel void test_pipe_convenience_read_)" << type << "(__read_only pipe " << type << " in_pipe, __global " << type << R"( *dst) + { + int gid = get_global_id(0); + read_pipe(in_pipe, &dst[gid]); + } + )"; + // clang-format on } // verify functions @@ -424,23 +454,24 @@ static int verify_readwrite_struct(void *ptr1, void *ptr2, int n) int test_pipe_readwrite( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements, size_t size, char *type, int loops, void *inptr[5], const char *kernelName[], int (*fn)(void *, void *, int) ) { - cl_mem pipes[5]; - cl_mem buffers[10]; - void *outptr[5]; - cl_program program[5]; - cl_kernel kernel[10]; - size_t global_work_size[3]; - size_t local_work_size[3]; - cl_int err; - int i, ii; - size_t ptrSizes[5]; - int total_errors = 0; - cl_event producer_sync_event[5]; - cl_event consumer_sync_event[5]; - char *sourceCode[5]; - char vector_type[10]; + clMemWrapper pipes[5]; + clMemWrapper buffers[10]; + void *outptr[5]; + BufferOwningPtr BufferOutPtr[5]; + clProgramWrapper program[5]; + clKernelWrapper kernel[10]; + size_t global_work_size[3]; + size_t local_work_size[3]; + cl_int err; + int i, ii; + size_t ptrSizes[5]; + int total_errors = 0; + clEventWrapper producer_sync_event[5]; + clEventWrapper consumer_sync_event[5]; + std::stringstream sourceCode[5]; + char vector_type[10]; - size_t min_alignment = get_min_alignment(context); + size_t min_alignment = get_min_alignment(context); global_work_size[0] = (cl_uint)num_elements; @@ -450,217 +481,133 @@ int test_pipe_readwrite( cl_device_id deviceID, cl_context context, cl_command_q ptrSizes[3] = ptrSizes[2] << 1; ptrSizes[4] = ptrSizes[3] << 1; - for( i = 0; i < loops; i++) + for (i = 0; i < loops; i++) { ii = i << 1; - sourceCode[i] = (char*) malloc(STRING_LENGTH * sizeof(char)); - buffers[ii] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, ptrSizes[i] * num_elements, inptr[i], &err); - if(err){ - clReleaseMemObject(buffers[ii]); - align_free( outptr[i] ); - print_error(err, " clCreateBuffer failed\n"); - return -1; - } - outptr[i] = align_malloc( ptrSizes[i] * num_elements, min_alignment); - buffers[ii+1] = clCreateBuffer(context, CL_MEM_USE_HOST_PTR, ptrSizes[i] * num_elements, outptr[i], &err); - if ( err ){ - clReleaseMemObject(buffers[ii]); - align_free( outptr[i] ); - print_error(err, " clCreateBuffer failed\n" ); - return -1; - } + buffers[ii] = + clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, + ptrSizes[i] * num_elements, inptr[i], &err); + test_error_ret(err, " clCreateBuffer failed", -1); + + outptr[i] = align_malloc(ptrSizes[i] * num_elements, min_alignment); + BufferOutPtr[i].reset(outptr[i], nullptr, 0, size, true); + buffers[ii + 1] = + clCreateBuffer(context, CL_MEM_USE_HOST_PTR, + ptrSizes[i] * num_elements, outptr[i], &err); + test_error_ret(err, " clCreateBuffer failed", -1); + // Creating pipe with non-power of 2 size - pipes[i] = clCreatePipe(context, CL_MEM_HOST_NO_ACCESS, ptrSizes[i], num_elements+3, NULL, &err); - if(err){ - clReleaseMemObject(pipes[i]); - print_error(err, " clCreatePipe failed\n"); - return -1; - } + pipes[i] = clCreatePipe(context, CL_MEM_HOST_NO_ACCESS, ptrSizes[i], + num_elements + 3, NULL, &err); + test_error_ret(err, " clCreatePipe failed", -1); - switch(i) + switch (i) { - case 0: - sprintf(vector_type, "%s", type); - break; - case 1: - sprintf(vector_type, "%s%d", type, 2); - break; - case 2: - sprintf(vector_type, "%s%d", type, 4); - break; - case 3: - sprintf(vector_type, "%s%d", type, 8); - break; - case 4: - sprintf(vector_type, "%s%d", type, 16); - break; + case 0: sprintf(vector_type, "%s", type); break; + case 1: sprintf(vector_type, "%s%d", type, 2); break; + case 2: sprintf(vector_type, "%s%d", type, 4); break; + case 3: sprintf(vector_type, "%s%d", type, 8); break; + case 4: sprintf(vector_type, "%s%d", type, 16); break; } - if(useWorkgroupReserve == 1){ + if (useWorkgroupReserve == 1) + { createKernelSourceWorkGroup(sourceCode[i], vector_type); } - else if(useSubgroupReserve == 1){ + else if (useSubgroupReserve == 1) + { createKernelSourceSubGroup(sourceCode[i], vector_type); } - else if(useConvenienceBuiltIn == 1){ + else if (useConvenienceBuiltIn == 1) + { createKernelSourceConvenience(sourceCode[i], vector_type); } - else{ + else + { createKernelSource(sourceCode[i], vector_type); } + std::string kernel_source = sourceCode[i].str(); + const char *sources[] = { kernel_source.c_str() }; // Create producer kernel - err = create_single_kernel_helper_with_build_options(context, &program[i], &kernel[ii], 1, (const char**)&sourceCode[i], kernelName[ii], "-cl-std=CL2.0"); - if(err){ - clReleaseMemObject(buffers[ii]); - clReleaseMemObject(buffers[ii+1]); - clReleaseMemObject(pipes[i]); - align_free( outptr[i] ); - print_error(err, "Error creating program\n"); - return -1; - } - //Create consumer kernel + err = create_single_kernel_helper_with_build_options( + context, &program[i], &kernel[ii], 1, sources, kernelName[ii], + "-cl-std=CL2.0"); + + test_error_ret(err, " Error creating program", -1); + + // Create consumer kernel kernel[ii + 1] = clCreateKernel(program[i], kernelName[ii + 1], &err); - if( kernel[ii + 1] == NULL || err != CL_SUCCESS) - { - clReleaseMemObject(buffers[ii]); - clReleaseMemObject(buffers[ii+1]); - clReleaseMemObject(pipes[i]); - align_free( outptr[i] ); - log_error("Creating program for %s\n", type); - print_error( err, "Unable to create kernel" ); - return -1; - } + test_error_ret(err, " Error creating kernel", -1); - err = clSetKernelArg(kernel[ii], 0, sizeof(cl_mem), (void*)&buffers[ii]); - err |= clSetKernelArg(kernel[ii], 1, sizeof(cl_mem), (void*)&pipes[i]); - err |= clSetKernelArg(kernel[ii + 1], 0, sizeof(cl_mem), (void*)&pipes[i]); - err |= clSetKernelArg(kernel[ii + 1], 1, sizeof(cl_mem), (void*)&buffers[ii + 1]); - if ( err != CL_SUCCESS ){ - clReleaseMemObject(buffers[ii]); - clReleaseMemObject(buffers[ii+1]); - clReleaseMemObject(pipes[i]); - clReleaseKernel(kernel[ii]); - clReleaseKernel(kernel[ii+1]); - clReleaseProgram(program[i]); - align_free(outptr[i]); - print_error(err, " clSetKernelArg failed"); - return -1; - } + err = + clSetKernelArg(kernel[ii], 0, sizeof(cl_mem), (void *)&buffers[ii]); + err |= clSetKernelArg(kernel[ii], 1, sizeof(cl_mem), (void *)&pipes[i]); + err |= clSetKernelArg(kernel[ii + 1], 0, sizeof(cl_mem), + (void *)&pipes[i]); + err |= clSetKernelArg(kernel[ii + 1], 1, sizeof(cl_mem), + (void *)&buffers[ii + 1]); + test_error_ret(err, " clSetKernelArg failed", -1); - if(useWorkgroupReserve == 1 || useSubgroupReserve == 1) + if (useWorkgroupReserve == 1 || useSubgroupReserve == 1) { - err = get_max_common_work_group_size( context, kernel[ii], global_work_size[0], &local_work_size[0] ); - test_error( err, "Unable to get work group size to use" ); + err = get_max_common_work_group_size( + context, kernel[ii], global_work_size[0], &local_work_size[0]); + test_error(err, "Unable to get work group size to use"); // Launch Producer kernel - err = clEnqueueNDRangeKernel( queue, kernel[ii], 1, NULL, global_work_size, local_work_size, 0, NULL, &producer_sync_event[i] ); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueNDRangeKernel failed" ); - clReleaseMemObject(buffers[ii]); - clReleaseMemObject(buffers[ii+1]); - clReleaseMemObject(pipes[i]); - clReleaseKernel(kernel[ii]); - clReleaseKernel(kernel[ii+1]); - clReleaseEvent(producer_sync_event[i]); - clReleaseEvent(consumer_sync_event[i]); - clReleaseProgram(program[i]); - align_free(outptr[i]); - return -1; - } + err = clEnqueueNDRangeKernel(queue, kernel[ii], 1, NULL, + global_work_size, local_work_size, 0, + NULL, &producer_sync_event[i]); + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); } else { // Launch Producer kernel - err = clEnqueueNDRangeKernel( queue, kernel[ii], 1, NULL, global_work_size, NULL, 0, NULL, &producer_sync_event[i] ); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueNDRangeKernel failed" ); - clReleaseMemObject(buffers[ii]); - clReleaseMemObject(buffers[ii+1]); - clReleaseMemObject(pipes[i]); - clReleaseKernel(kernel[ii]); - clReleaseKernel(kernel[ii+1]); - clReleaseEvent(producer_sync_event[i]); - clReleaseEvent(consumer_sync_event[i]); - clReleaseProgram(program[i]); - align_free(outptr[i]); - return -1; - } + err = clEnqueueNDRangeKernel(queue, kernel[ii], 1, NULL, + global_work_size, NULL, 0, NULL, + &producer_sync_event[i]); + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); } - if(useWorkgroupReserve == 1 || useSubgroupReserve == 1) + if (useWorkgroupReserve == 1 || useSubgroupReserve == 1) { - err = get_max_common_work_group_size( context, kernel[ii + 1], global_work_size[0], &local_work_size[0] ); - test_error( err, "Unable to get work group size to use" ); + err = get_max_common_work_group_size(context, kernel[ii + 1], + global_work_size[0], + &local_work_size[0]); + test_error(err, "Unable to get work group size to use"); // Launch Consumer kernel - err = clEnqueueNDRangeKernel( queue, kernel[ii + 1], 1, NULL, global_work_size, local_work_size, 1, &producer_sync_event[i], &consumer_sync_event[i] ); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueNDRangeKernel failed" ); - clReleaseMemObject(buffers[ii]); - clReleaseMemObject(buffers[ii+1]); - clReleaseMemObject(pipes[i]); - clReleaseKernel(kernel[ii]); - clReleaseKernel(kernel[ii+1]); - clReleaseEvent(producer_sync_event[i]); - clReleaseEvent(consumer_sync_event[i]); - clReleaseProgram(program[i]); - align_free(outptr[i]); - return -1; - } + err = clEnqueueNDRangeKernel(queue, kernel[ii + 1], 1, NULL, + global_work_size, local_work_size, 1, + &producer_sync_event[i], + &consumer_sync_event[i]); + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); } else { // Launch Consumer kernel - err = clEnqueueNDRangeKernel( queue, kernel[ii + 1], 1, NULL, global_work_size, NULL, 1, &producer_sync_event[i], &consumer_sync_event[i] ); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueNDRangeKernel failed" ); - clReleaseMemObject(buffers[ii]); - clReleaseMemObject(buffers[ii+1]); - clReleaseMemObject(pipes[i]); - clReleaseKernel(kernel[ii]); - clReleaseKernel(kernel[ii+1]); - clReleaseEvent(producer_sync_event[i]); - clReleaseEvent(consumer_sync_event[i]); - clReleaseProgram(program[i]); - align_free(outptr[i]); - return -1; - } + err = clEnqueueNDRangeKernel( + queue, kernel[ii + 1], 1, NULL, global_work_size, NULL, 1, + &producer_sync_event[i], &consumer_sync_event[i]); + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); } - err = clEnqueueReadBuffer(queue, buffers[ii+1], true, 0, ptrSizes[i]*num_elements, outptr[i], 1, &consumer_sync_event[i], NULL); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueReadBuffer failed" ); - clReleaseMemObject(buffers[ii]); - clReleaseMemObject(buffers[ii+1]); - clReleaseMemObject(pipes[i]); - clReleaseKernel(kernel[ii]); - clReleaseKernel(kernel[ii+1]); - clReleaseEvent(producer_sync_event[i]); - clReleaseEvent(consumer_sync_event[i]); - clReleaseProgram(program[i]); - align_free(outptr[i]); - return -1; - } + err = clEnqueueReadBuffer(queue, buffers[ii + 1], true, 0, + ptrSizes[i] * num_elements, outptr[i], 1, + &consumer_sync_event[i], NULL); + test_error_ret(err, " clEnqueueReadBuffer failed", -1); - if( fn( inptr[i], outptr[i], (int)(ptrSizes[i] * (size_t)num_elements / ptrSizes[0]))){ - log_error("%s%d test failed\n", type, 1< BufferInPtr; + BufferOwningPtr BufferOutPtr; + clProgramWrapper program; + clKernelWrapper kernel[2]; + size_t size = sizeof(TestStruct); + size_t global_work_size[3]; + cl_int err; + int total_errors = 0; + int i; + MTdataHolder d(gRandomSeed); + clEventWrapper producer_sync_event = NULL; + clEventWrapper consumer_sync_event = NULL; - size_t min_alignment = get_min_alignment(context); + size_t min_alignment = get_min_alignment(context); global_work_size[0] = (size_t)num_elements; inptr = (TestStruct *)align_malloc(size * num_elements, min_alignment); - for ( i = 0; i < num_elements; i++ ){ + for (i = 0; i < num_elements; i++) + { inptr[i].a = (char)genrand_int32(d); inptr[i].b = genrand_int32(d); } + BufferInPtr.reset(inptr, nullptr, 0, size, true); + buffers[0] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, size * num_elements, inptr, &err); - if(err){ - clReleaseMemObject(buffers[0]); - print_error(err, " clCreateBuffer failed\n"); - return -1; - } + test_error_ret(err, " clCreateBuffer failed", -1); + outptr = align_malloc( size * num_elements, min_alignment); + BufferOutPtr.reset(outptr, nullptr, 0, size, true); + buffers[1] = clCreateBuffer(context, CL_MEM_USE_HOST_PTR, size * num_elements, outptr, &err); - if (err){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - align_free( outptr ); - print_error(err, " clCreateBuffer failed\n" ); - return -1; - } + test_error_ret(err, " clCreateBuffer failed", -1); + pipe = clCreatePipe(context, CL_MEM_HOST_NO_ACCESS, size, num_elements, NULL, &err); - if(err){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - align_free( outptr ); - clReleaseMemObject(pipe); - print_error(err, " clCreatePipe failed\n"); - return -1; - } + test_error_ret(err, " clCreatePipe failed", -1); + // Create producer kernel err = create_single_kernel_helper_with_build_options(context, &program, &kernel[0], 1, &kernelCode, kernelName[0], "-cl-std=CL2.0"); - if(err){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(pipe); - align_free(outptr); - log_error(" Error creating program for struct\n"); - print_error(err, "Error creating program\n"); - return -1; - } + test_error_ret(err, " Error creating program", -1); + //Create consumer kernel kernel[1] = clCreateKernel(program, kernelName[1], &err); - if( kernel[1] == NULL || err != CL_SUCCESS) - { - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(pipe); - align_free(outptr); - print_error(err, "Error creating kernel\n"); - return -1; - } + test_error_ret(err, " Error creating kernel", -1); err = clSetKernelArg(kernel[0], 0, sizeof(cl_mem), (void*)&buffers[0]); err |= clSetKernelArg(kernel[0], 1, sizeof(cl_mem), (void*)&pipe); err |= clSetKernelArg(kernel[1], 0, sizeof(cl_mem), (void*)&pipe); err |= clSetKernelArg(kernel[1], 1, sizeof(cl_mem), (void*)&buffers[1]); - if (err != CL_SUCCESS){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseProgram(program); - align_free(outptr); - print_error(err, " clSetKernelArg failed"); - return -1; - } + test_error_ret(err, " clSetKernelArg failed", -1); // Launch Producer kernel err = clEnqueueNDRangeKernel( queue, kernel[0], 1, NULL, global_work_size, NULL, 0, NULL, &producer_sync_event ); - if (err != CL_SUCCESS){ - print_error( err, " clEnqueueNDRangeKernel failed" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseProgram(program); - align_free(outptr); - return -1; - } + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); // Launch Consumer kernel err = clEnqueueNDRangeKernel( queue, kernel[1], 1, NULL, global_work_size, NULL, 1, &producer_sync_event, &consumer_sync_event ); - if (err != CL_SUCCESS){ - print_error( err, " clEnqueueNDRangeKernel failed" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); - return -1; - } + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); err = clEnqueueReadBuffer(queue, buffers[1], true, 0, size*num_elements, outptr, 1, &consumer_sync_event, NULL); - if (err != CL_SUCCESS){ - print_error( err, " clEnqueueReadBuffer failed" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); - return -1; - } + test_error_ret(err, " clEnqueueReadBuffer failed", -1); if( verify_readwrite_struct( inptr, outptr, num_elements)){ log_error("struct_readwrite test failed\n"); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); return -1; } else { log_info("struct_readwrite test passed\n"); } - //cleanup - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); return 0; } diff --git a/test_conformance/pipes/test_pipe_readwrite_errors.c b/test_conformance/pipes/test_pipe_readwrite_errors.c deleted file mode 100644 index f4051d35..00000000 --- a/test_conformance/pipes/test_pipe_readwrite_errors.c +++ /dev/null @@ -1,312 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - -#include "procs.h" -#include "../../test_common/harness/errorHelpers.h" - -const char* pipe_readwrite_errors_kernel_code = { - "__kernel void test_pipe_write_error(__global int *src, __write_only pipe int out_pipe, __global int *status)\n" - "{\n" - " int gid = get_global_id(0);\n" - " int reserve_idx;\n" - " reserve_id_t res_id;\n" - "\n" - " res_id = reserve_write_pipe(out_pipe, 1);\n" - " if(is_valid_reserve_id(res_id))\n" - " {\n" - " write_pipe(out_pipe, res_id, 0, &src[gid]);\n" - " commit_write_pipe(out_pipe, res_id);\n" - " }\n" - " else\n" - " {\n" - " *status = -1;\n" - " }\n" - "}\n" - "\n" - "__kernel void test_pipe_read_error(__read_only pipe int in_pipe, __global int *dst, __global int *status)\n" - "{\n" - " int gid = get_global_id(0);\n" - " int reserve_idx;\n" - " reserve_id_t res_id;\n" - "\n" - " res_id = reserve_read_pipe(in_pipe, 1);\n" - " if(is_valid_reserve_id(res_id))\n" - " {\n" - " read_pipe(in_pipe, res_id, 0, &dst[gid]);\n" - " commit_read_pipe(in_pipe, res_id);\n" - " }\n" - " else\n" - " {\n" - " *status = -1;\n" - " }\n" - "}\n" -}; - - -int test_pipe_readwrite_errors(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - cl_mem pipe; - cl_mem buffers[3]; - void *outptr; - cl_int *inptr; - cl_program program; - cl_kernel kernel[2]; - size_t global_work_size[3]; - cl_int err; - cl_int size; - cl_int i; - cl_int status = 0; - cl_event producer_sync_event; - cl_event consumer_sync_event; - MTdata d = init_genrand( gRandomSeed ); - const char* kernelName[] = {"test_pipe_write_error", "test_pipe_read_error"}; - - size_t min_alignment = get_min_alignment(context); - - global_work_size[0] = num_elements; - - size = num_elements * sizeof(cl_int); - - inptr = (cl_int *)align_malloc(size, min_alignment); - - for(i = 0; i < (cl_int)(size / sizeof(int)); i++){ - inptr[i] = (int)genrand_int32(d); - } - - buffers[0] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, size, inptr, &err); - if(err){ - clReleaseMemObject(buffers[0]); - print_error(err, " clCreateBuffer failed\n"); - return -1; - } - outptr = align_malloc(size, min_alignment); - buffers[1] = clCreateBuffer(context, CL_MEM_USE_HOST_PTR, size, outptr, &err); - if ( err ){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - align_free( outptr ); - print_error(err, " clCreateBuffer failed\n" ); - return -1; - } - buffers[2] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, sizeof(int), &status, &err); - if ( err ){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - align_free( outptr ); - print_error(err, " clCreateBuffer failed\n" ); - return -1; - } - //Pipe created with max_packets less than global size - pipe = clCreatePipe(context, CL_MEM_HOST_NO_ACCESS, sizeof(int), num_elements - (num_elements/2), NULL, &err); - if(err){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - align_free( outptr ); - clReleaseMemObject(pipe); - print_error(err, " clCreatePipe failed\n"); - return -1; - } - - // Create producer kernel - err = create_single_kernel_helper_with_build_options(context, &program, &kernel[0], 1, (const char**)&pipe_readwrite_errors_kernel_code, kernelName[0], "-cl-std=CL2.0"); - if(err){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(pipe); - align_free(outptr); - print_error(err, "Error creating program\n"); - return -1; - } - //Create consumer kernel - kernel[1] = clCreateKernel(program, kernelName[1], &err); - if( kernel[1] == NULL || err != CL_SUCCESS) - { - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(pipe); - align_free(outptr); - print_error(err, "Error creating kernel\n"); - return -1; - } - - err = clSetKernelArg(kernel[0], 0, sizeof(cl_mem), (void*)&buffers[0]); - err |= clSetKernelArg(kernel[0], 1, sizeof(cl_mem), (void*)&pipe); - err |= clSetKernelArg(kernel[0], 2, sizeof(cl_mem), (void*)&buffers[2]); - err |= clSetKernelArg(kernel[1], 0, sizeof(cl_mem), (void*)&pipe); - err |= clSetKernelArg(kernel[1], 1, sizeof(cl_mem), (void*)&buffers[1]); - err |= clSetKernelArg(kernel[1], 2, sizeof(cl_mem), (void*)&buffers[2]); - if ( err != CL_SUCCESS ){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseProgram(program); - align_free(outptr); - print_error(err, " clSetKernelArg failed"); - return -1; - } - - // Launch Consumer kernel for empty pipe - err = clEnqueueNDRangeKernel( queue, kernel[1], 1, NULL, global_work_size, NULL, 0, NULL, &consumer_sync_event ); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueNDRangeKernel failed" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); - return -1; - } - - err = clEnqueueReadBuffer(queue, buffers[2], true, 0, sizeof(status), &status, 1, &consumer_sync_event, NULL); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueReadBuffer failed" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); - return -1; - } - - if(status == 0){ - log_error("test_pipe_readwrite_errors failed\n"); - return -1; - } - else{ - status = 0; - } - - // Launch Producer kernel - err = clEnqueueNDRangeKernel( queue, kernel[0], 1, NULL, global_work_size, NULL, 0, NULL, &producer_sync_event ); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueNDRangeKernel failed" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseProgram(program); - align_free(outptr); - return -1; - } - - err = clEnqueueReadBuffer(queue, buffers[2], true, 0, sizeof(status), &status, 1, &producer_sync_event, NULL); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueReadBuffer failed" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseProgram(program); - align_free(outptr); - return -1; - } - - if(status == 0){ - log_error("test_pipe_readwrite_errors failed\n"); - return -1; - } - else{ - status = 0; - } - - // Launch Consumer kernel - err = clEnqueueNDRangeKernel( queue, kernel[1], 1, NULL, global_work_size, NULL, 1, &producer_sync_event, &consumer_sync_event ); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueNDRangeKernel failed" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); - return -1; - } - - err = clEnqueueReadBuffer(queue, buffers[2], true, 0, sizeof(status), &status, 1, &consumer_sync_event, NULL); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueReadBuffer failed" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); - return -1; - } - - if(status == 0) - { - log_error("test_pipe_readwrite_errors failed\n"); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); - return -1; - } - - log_info("test_pipe_readwrite_errors passed\n"); - //cleanup - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); - return 0; -} diff --git a/test_conformance/pipes/test_pipe_readwrite_errors.cpp b/test_conformance/pipes/test_pipe_readwrite_errors.cpp new file mode 100644 index 00000000..1b9fc313 --- /dev/null +++ b/test_conformance/pipes/test_pipe_readwrite_errors.cpp @@ -0,0 +1,188 @@ +// +// Copyright (c) 2017 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "harness/compat.h" + +#include +#include +#include +#include + +#include "procs.h" +#include "harness/errorHelpers.h" + +const char* pipe_readwrite_errors_kernel_code = { + "__kernel void test_pipe_write_error(__global int *src, __write_only pipe int out_pipe, __global int *status)\n" + "{\n" + " int gid = get_global_id(0);\n" + " int reserve_idx;\n" + " reserve_id_t res_id;\n" + "\n" + " res_id = reserve_write_pipe(out_pipe, 1);\n" + " if(is_valid_reserve_id(res_id))\n" + " {\n" + " write_pipe(out_pipe, res_id, 0, &src[gid]);\n" + " commit_write_pipe(out_pipe, res_id);\n" + " }\n" + " else\n" + " {\n" + " *status = -1;\n" + " }\n" + "}\n" + "\n" + "__kernel void test_pipe_read_error(__read_only pipe int in_pipe, __global int *dst, __global int *status)\n" + "{\n" + " int gid = get_global_id(0);\n" + " int reserve_idx;\n" + " reserve_id_t res_id;\n" + "\n" + " res_id = reserve_read_pipe(in_pipe, 1);\n" + " if(is_valid_reserve_id(res_id))\n" + " {\n" + " read_pipe(in_pipe, res_id, 0, &dst[gid]);\n" + " commit_read_pipe(in_pipe, res_id);\n" + " }\n" + " else\n" + " {\n" + " *status = -1;\n" + " }\n" + "}\n" +}; + + +int test_pipe_readwrite_errors(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) +{ + clMemWrapper pipe; + clMemWrapper buffers[3]; + void *outptr; + cl_int *inptr; + clProgramWrapper program; + clKernelWrapper kernel[2]; + size_t global_work_size[3]; + cl_int err; + cl_int size; + cl_int i; + cl_int status = 0; + clEventWrapper producer_sync_event; + clEventWrapper consumer_sync_event; + BufferOwningPtr BufferInPtr; + BufferOwningPtr BufferOutPtr; + MTdataHolder d(gRandomSeed); + const char *kernelName[] = { "test_pipe_write_error", + "test_pipe_read_error" }; + + size_t min_alignment = get_min_alignment(context); + + global_work_size[0] = num_elements; + + size = num_elements * sizeof(cl_int); + + inptr = (cl_int *)align_malloc(size, min_alignment); + + for (i = 0; i < num_elements; i++) + { + inptr[i] = (int)genrand_int32(d); + } + BufferInPtr.reset(inptr, nullptr, 0, size, true); + + buffers[0] = + clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, size, inptr, &err); + test_error_ret(err, " clCreateBuffer failed", -1); + + outptr = align_malloc(size, min_alignment); + BufferOutPtr.reset(outptr, nullptr, 0, size, true); + + buffers[1] = clCreateBuffer(context, CL_MEM_USE_HOST_PTR, size, outptr, &err); + test_error_ret(err, " clCreateBuffer failed", -1); + + buffers[2] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, sizeof(int), &status, &err); + test_error_ret(err, " clCreateBuffer failed", -1); + + //Pipe created with max_packets less than global size + pipe = clCreatePipe(context, CL_MEM_HOST_NO_ACCESS, sizeof(int), num_elements - (num_elements/2), NULL, &err); + test_error_ret(err, " clCreatePipe failed", -1); + + // Create producer kernel + err = create_single_kernel_helper_with_build_options(context, &program, &kernel[0], 1, (const char**)&pipe_readwrite_errors_kernel_code, kernelName[0], "-cl-std=CL2.0"); + test_error_ret(err, " Error creating program", -1); + + //Create consumer kernel + kernel[1] = clCreateKernel(program, kernelName[1], &err); + test_error_ret(err, " Error creating kernel", -1); + + err = clSetKernelArg(kernel[0], 0, sizeof(cl_mem), (void*)&buffers[0]); + err |= clSetKernelArg(kernel[0], 1, sizeof(cl_mem), (void*)&pipe); + err |= clSetKernelArg(kernel[0], 2, sizeof(cl_mem), (void*)&buffers[2]); + err |= clSetKernelArg(kernel[1], 0, sizeof(cl_mem), (void*)&pipe); + err |= clSetKernelArg(kernel[1], 1, sizeof(cl_mem), (void*)&buffers[1]); + err |= clSetKernelArg(kernel[1], 2, sizeof(cl_mem), (void*)&buffers[2]); + + test_error_ret(err, " clSetKernelArg failed", -1); + + // Launch Consumer kernel for empty pipe + err = clEnqueueNDRangeKernel( queue, kernel[1], 1, NULL, global_work_size, NULL, 0, NULL, &consumer_sync_event ); + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); + + err = clEnqueueReadBuffer(queue, buffers[2], true, 0, sizeof(status), &status, 1, &consumer_sync_event, NULL); + test_error_ret(err, " clEnqueueReadBuffer failed", -1); + + if(status == 0){ + log_error("test_pipe_readwrite_errors failed\n"); + return -1; + } + else{ + status = 0; + } + + // Launch Producer kernel + err = clEnqueueNDRangeKernel( queue, kernel[0], 1, NULL, global_work_size, NULL, 0, NULL, &producer_sync_event ); + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); + + err = clEnqueueReadBuffer(queue, buffers[2], true, 0, sizeof(status), &status, 1, &producer_sync_event, NULL); + test_error_ret(err, " clEnqueueReadBuffer failed", -1); + + if (status == 0) + { + log_error("test_pipe_readwrite_errors failed\n"); + return -1; + } + else{ + status = 0; + } + + // We will reuse this variable so release the previous referred event. + clReleaseEvent(consumer_sync_event); + + // Launch Consumer kernel + err = clEnqueueNDRangeKernel( queue, kernel[1], 1, NULL, global_work_size, NULL, 1, &producer_sync_event, &consumer_sync_event ); + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); + + err = clEnqueueReadBuffer(queue, buffers[2], true, 0, sizeof(status), &status, 1, &consumer_sync_event, NULL); + test_error_ret(err, " clEnqueueReadBuffer failed", -1); + + if (status == 0) + { + log_error("test_pipe_readwrite_errors failed\n"); + return -1; + } + else + { + status = 0; + } + + log_info("test_pipe_readwrite_errors passed\n"); + + return 0; +} diff --git a/test_conformance/pipes/test_pipe_subgroups.c b/test_conformance/pipes/test_pipe_subgroups.c deleted file mode 100644 index 6f8615da..00000000 --- a/test_conformance/pipes/test_pipe_subgroups.c +++ /dev/null @@ -1,339 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include -#include - -#include "procs.h" -#include "../../test_common/harness/errorHelpers.h" -#define TEST_INT_VALUE 100 - -const char* pipe_subgroups_kernel_code = { - "#pragma OPENCL EXTENSION cl_khr_subgroups : enable\n" - "__kernel void test_pipe_subgroups_divergence_write(__global int *src, __write_only pipe int out_pipe, __global int *active_work_item_buffer)\n" - "{\n" - " int gid = get_global_id(0);\n" - " reserve_id_t res_id; \n" - "\n" - " if(get_sub_group_id() % 2 == 0)\n" - " {\n" - " active_work_item_buffer[gid] = 1;\n" - " res_id = sub_group_reserve_write_pipe(out_pipe, get_sub_group_size());\n" - " if(is_valid_reserve_id(res_id))\n" - " {\n" - " write_pipe(out_pipe, res_id, get_sub_group_local_id(), &src[gid]);\n" - " sub_group_commit_write_pipe(out_pipe, res_id);\n" - " }\n" - " }\n" - "}\n" - "\n" - "__kernel void test_pipe_subgroups_divergence_read(__read_only pipe int in_pipe, __global int *dst)\n" - "{\n" - " int gid = get_global_id(0);\n" - " reserve_id_t res_id; \n" - "\n" - " if(get_sub_group_id() % 2 == 0)\n" - " {\n" - " res_id = sub_group_reserve_read_pipe(in_pipe, get_sub_group_size());\n" - " if(is_valid_reserve_id(res_id))\n" - " {\n" - " read_pipe(in_pipe, res_id, get_sub_group_local_id(), &dst[gid]);\n" - " sub_group_commit_read_pipe(in_pipe, res_id);\n" - " }\n" - " }\n" - "}\n" -}; - -static int verify_result(void *ptr1, void *ptr2, int n) -{ - int i; - int sum_input = 0, sum_output = 0; - cl_int *inptr = (cl_int *)ptr1; - cl_int *outptr = (cl_int *)ptr2; - - for(i = 0; i < n; i++) - { - sum_input += inptr[i]; - } - sum_input *= TEST_INT_VALUE; - for(i = 0; i < n; i++) - { - if(outptr[i] == TEST_INT_VALUE){ - sum_output += outptr[i]; - } - } - - if(sum_input != sum_output){ - return -1; - } - return 0; -} - -int test_pipe_subgroups_divergence(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) -{ - cl_mem pipe; - cl_mem buffers[3]; - cl_int *outptr; - cl_int *inptr; - cl_int *active_work_item_buffer; - cl_program program; - cl_kernel kernel[2]; - size_t global_work_size[3]; - size_t local_work_size[3]; - cl_int err; - cl_int size; - int i; - size_t subgroup_count; - cl_event producer_sync_event = NULL; - cl_event consumer_sync_event = NULL; - const char* kernelName[] = {"test_pipe_subgroups_divergence_write", "test_pipe_subgroups_divergence_read"}; - - size_t min_alignment = get_min_alignment(context); - - global_work_size[0] = (cl_uint)num_elements; - - if(!is_extension_available(deviceID, "cl_khr_subgroups")) - { - log_info("cl_khr_subgroups is not supported on this platoform. Skipping test.\n"); - return CL_SUCCESS; - } - - size = sizeof(int) * num_elements; - inptr = (cl_int *)align_malloc(size, min_alignment); - outptr = (cl_int *)align_malloc(size, min_alignment); - active_work_item_buffer = (cl_int *)align_malloc(size, min_alignment); - - for(i = 0; i < num_elements; i++){ - inptr[i] = TEST_INT_VALUE; - outptr[i] = 0; - active_work_item_buffer[i] = 0; - } - - buffers[0] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, size, inptr, &err); - if(err){ - clReleaseMemObject(buffers[0]); - print_error(err, " clCreateBuffer failed\n"); - return -1; - } - - buffers[1] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, size, outptr, &err); - if ( err ){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - align_free( outptr ); - print_error(err, " clCreateBuffer failed\n" ); - return -1; - } - - buffers[2] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, size, active_work_item_buffer, &err); - if ( err ){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - align_free( outptr ); - print_error(err, " clCreateBuffer failed\n" ); - return -1; - } - - pipe = clCreatePipe(context, CL_MEM_HOST_NO_ACCESS, sizeof(int), num_elements, NULL, &err); - if(err){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - align_free( outptr ); - clReleaseMemObject(pipe); - print_error(err, " clCreatePipe failed\n"); - return -1; - } - - // Create producer kernel - err = create_single_kernel_helper_with_build_options(context, &program, &kernel[0], 1, (const char**)&pipe_subgroups_kernel_code, kernelName[0], "-cl-std=CL2.0"); - if(err){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(pipe); - align_free(outptr); - print_error(err, "Error creating program\n"); - return -1; - } - //Create consumer kernel - kernel[1] = clCreateKernel(program, kernelName[1], &err); - if( kernel[1] == NULL || err != CL_SUCCESS) - { - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(pipe); - align_free(outptr); - print_error(err, "Error creating kernel\n"); - return -1; - } - - err = clSetKernelArg(kernel[0], 0, sizeof(cl_mem), (void*)&buffers[0]); - err |= clSetKernelArg(kernel[0], 1, sizeof(cl_mem), (void*)&pipe); - err |= clSetKernelArg(kernel[0], 2, sizeof(cl_mem), (void*)&buffers[2]); - err |= clSetKernelArg(kernel[1], 0, sizeof(cl_mem), (void*)&pipe); - err |= clSetKernelArg(kernel[1], 1, sizeof(cl_mem), (void*)&buffers[1]); - if ( err != CL_SUCCESS ){ - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseProgram(program); - align_free(outptr); - print_error(err, " clSetKernelArg failed"); - return -1; - } - - err = get_max_common_work_group_size( context, kernel[0], global_work_size[0], &local_work_size[0] ); - if( err != CL_SUCCESS) - { - test_error( err, "Unable to get work group size to use" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseProgram(program); - align_free(outptr); - return -1; - } - - cl_platform_id platform; - err = clGetDeviceInfo(deviceID, CL_DEVICE_PLATFORM, sizeof(platform), &platform, NULL); - clGetKernelSubGroupInfoKHR_fn clGetKernelSubGroupInfoKHR = (clGetKernelSubGroupInfoKHR_fn) clGetExtensionFunctionAddressForPlatform(platform, "clGetKernelSubGroupInfoKHR"); - - err = clGetKernelSubGroupInfoKHR(kernel[0], deviceID, CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE_KHR, sizeof(local_work_size[0]), &local_work_size[0], sizeof(subgroup_count), &subgroup_count, NULL); - if(subgroup_count <= 1) - { - log_info("Only 1 subgroup per workgroup for the kernel. Hence no divergence among subgroups possible. Skipping test.\n"); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseProgram(program); - align_free(outptr); - return CL_SUCCESS; - } - - // Launch Producer kernel - err = clEnqueueNDRangeKernel( queue, kernel[0], 1, NULL, global_work_size, local_work_size, 0, NULL, &producer_sync_event ); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueNDRangeKernel failed" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); - return -1; - } - - err = clEnqueueReadBuffer(queue, buffers[2], true, 0, size, active_work_item_buffer, 1, &producer_sync_event, NULL); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueReadBuffer failed" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); - return -1; - } - - - // Launch Consumer kernel - err = clEnqueueNDRangeKernel( queue, kernel[1], 1, NULL, global_work_size, local_work_size, 1, &producer_sync_event, &consumer_sync_event ); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueNDRangeKernel failed" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); - return -1; - } - - err = clEnqueueReadBuffer(queue, buffers[1], true, 0, size, outptr, 1, &consumer_sync_event, NULL); - if ( err != CL_SUCCESS ){ - print_error( err, " clEnqueueReadBuffer failed" ); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); - return -1; - } - - if( verify_result( active_work_item_buffer, outptr, num_elements)){ - log_error("test_pipe_subgroups_divergence failed\n"); - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); - return -1; - } - else { - log_info("test_pipe_subgroups_divergence passed\n"); - } - //cleanup - clReleaseMemObject(buffers[0]); - clReleaseMemObject(buffers[1]); - clReleaseMemObject(buffers[2]); - clReleaseMemObject(pipe); - clReleaseKernel(kernel[0]); - clReleaseKernel(kernel[1]); - clReleaseEvent(producer_sync_event); - clReleaseEvent(consumer_sync_event); - clReleaseProgram(program); - align_free(outptr); - - return 0; -} diff --git a/test_conformance/pipes/test_pipe_subgroups.cpp b/test_conformance/pipes/test_pipe_subgroups.cpp new file mode 100644 index 00000000..b41170ca --- /dev/null +++ b/test_conformance/pipes/test_pipe_subgroups.cpp @@ -0,0 +1,206 @@ +// +// Copyright (c) 2017 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "harness/compat.h" + +#include +#include +#include +#include +#include + +#include "procs.h" +#include "harness/errorHelpers.h" +#define TEST_INT_VALUE 100 + +const char* pipe_subgroups_kernel_code = { + "#pragma OPENCL EXTENSION cl_khr_subgroups : enable\n" + "__kernel void test_pipe_subgroups_divergence_write(__global int *src, __write_only pipe int out_pipe, __global int *active_work_item_buffer)\n" + "{\n" + " int gid = get_global_id(0);\n" + " reserve_id_t res_id; \n" + "\n" + " if(get_sub_group_id() % 2 == 0)\n" + " {\n" + " active_work_item_buffer[gid] = 1;\n" + " res_id = sub_group_reserve_write_pipe(out_pipe, get_sub_group_size());\n" + " if(is_valid_reserve_id(res_id))\n" + " {\n" + " write_pipe(out_pipe, res_id, get_sub_group_local_id(), &src[gid]);\n" + " sub_group_commit_write_pipe(out_pipe, res_id);\n" + " }\n" + " }\n" + "}\n" + "\n" + "__kernel void test_pipe_subgroups_divergence_read(__read_only pipe int in_pipe, __global int *dst)\n" + "{\n" + " int gid = get_global_id(0);\n" + " reserve_id_t res_id; \n" + "\n" + " if(get_sub_group_id() % 2 == 0)\n" + " {\n" + " res_id = sub_group_reserve_read_pipe(in_pipe, get_sub_group_size());\n" + " if(is_valid_reserve_id(res_id))\n" + " {\n" + " read_pipe(in_pipe, res_id, get_sub_group_local_id(), &dst[gid]);\n" + " sub_group_commit_read_pipe(in_pipe, res_id);\n" + " }\n" + " }\n" + "}\n" +}; + +static int verify_result(void *ptr1, void *ptr2, int n) +{ + int i; + int sum_input = 0, sum_output = 0; + cl_int *inptr = (cl_int *)ptr1; + cl_int *outptr = (cl_int *)ptr2; + + for(i = 0; i < n; i++) + { + sum_input += inptr[i]; + } + sum_input *= TEST_INT_VALUE; + for(i = 0; i < n; i++) + { + if(outptr[i] == TEST_INT_VALUE){ + sum_output += outptr[i]; + } + } + + if(sum_input != sum_output){ + return -1; + } + return 0; +} + +int test_pipe_subgroups_divergence(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) +{ + clMemWrapper pipe; + clMemWrapper buffers[3]; + cl_int *outptr; + cl_int *inptr; + cl_int *active_work_item_buffer; + clProgramWrapper program; + clKernelWrapper kernel[2]; + size_t global_work_size[3]; + size_t local_work_size[3]; + cl_int err; + cl_int size; + int i; + size_t subgroup_count; + clEventWrapper producer_sync_event = NULL; + clEventWrapper consumer_sync_event = NULL; + BufferOwningPtr BufferInPtr; + BufferOwningPtr BufferOutPtr; + const char *kernelName[] = { "test_pipe_subgroups_divergence_write", + "test_pipe_subgroups_divergence_read" }; + + size_t min_alignment = get_min_alignment(context); + + global_work_size[0] = (cl_uint)num_elements; + + if (!is_extension_available(deviceID, "cl_khr_subgroups")) + { + log_info( + "cl_khr_subgroups is not supported on this platoform. Skipping " + "test.\n"); + return CL_SUCCESS; + } + + size = sizeof(int) * num_elements; + inptr = (cl_int *)align_malloc(size, min_alignment); + outptr = (cl_int *)align_malloc(size, min_alignment); + active_work_item_buffer = (cl_int *)align_malloc(size, min_alignment); + + for(i = 0; i < num_elements; i++){ + inptr[i] = TEST_INT_VALUE; + outptr[i] = 0; + active_work_item_buffer[i] = 0; + } + BufferInPtr.reset(inptr, nullptr, 0, size, true); + BufferOutPtr.reset(outptr, nullptr, 0, size, true); + + buffers[0] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, size, inptr, &err); + test_error_ret(err, " clCreateBuffer failed", -1); + + buffers[1] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, size, outptr, &err); + test_error_ret(err, " clCreateBuffer failed", -1); + + buffers[2] = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, size, active_work_item_buffer, &err); + test_error_ret(err, " clCreateBuffer failed", -1); + + pipe = clCreatePipe(context, CL_MEM_HOST_NO_ACCESS, sizeof(int), num_elements, NULL, &err); + test_error_ret(err, " clCreatePipe failed", -1); + + // Create producer kernel + err = create_single_kernel_helper_with_build_options(context, &program, &kernel[0], 1, (const char**)&pipe_subgroups_kernel_code, kernelName[0], "-cl-std=CL2.0"); + test_error_ret(err, " Error creating program", -1); + + //Create consumer kernel + kernel[1] = clCreateKernel(program, kernelName[1], &err); + test_error_ret(err, " Error creating kernel", -1); + + err = clSetKernelArg(kernel[0], 0, sizeof(cl_mem), (void*)&buffers[0]); + err |= clSetKernelArg(kernel[0], 1, sizeof(cl_mem), (void*)&pipe); + err |= clSetKernelArg(kernel[0], 2, sizeof(cl_mem), (void*)&buffers[2]); + err |= clSetKernelArg(kernel[1], 0, sizeof(cl_mem), (void*)&pipe); + err |= clSetKernelArg(kernel[1], 1, sizeof(cl_mem), (void*)&buffers[1]); + test_error_ret(err, " clSetKernelArg failed", -1); + + err = get_max_common_work_group_size( context, kernel[0], global_work_size[0], &local_work_size[0] ); + test_error_ret(err, " Unable to get work group size to use", -1); + + cl_platform_id platform; + err = clGetDeviceInfo(deviceID, CL_DEVICE_PLATFORM, sizeof(platform), + &platform, NULL); + test_error_ret(err, " clGetDeviceInfo failed", -1); + + clGetKernelSubGroupInfoKHR_fn clGetKernelSubGroupInfoKHR = + (clGetKernelSubGroupInfoKHR_fn)clGetExtensionFunctionAddressForPlatform( + platform, "clGetKernelSubGroupInfoKHR"); + + err = clGetKernelSubGroupInfoKHR(kernel[0], deviceID, CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE_KHR, sizeof(local_work_size[0]), &local_work_size[0], sizeof(subgroup_count), &subgroup_count, NULL); + test_error_ret(err, " clGetKernelSubGroupInfoKHR failed", -1); + if(subgroup_count <= 1) + { + log_info("Only 1 subgroup per workgroup for the kernel. Hence no divergence among subgroups possible. Skipping test.\n"); + return CL_SUCCESS; + } + + // Launch Producer kernel + err = clEnqueueNDRangeKernel( queue, kernel[0], 1, NULL, global_work_size, local_work_size, 0, NULL, &producer_sync_event ); + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); + + err = clEnqueueReadBuffer(queue, buffers[2], true, 0, size, active_work_item_buffer, 1, &producer_sync_event, NULL); + test_error_ret(err, " clEnqueueReadBuffer failed", -1); + + // Launch Consumer kernel + err = clEnqueueNDRangeKernel( queue, kernel[1], 1, NULL, global_work_size, local_work_size, 1, &producer_sync_event, &consumer_sync_event ); + test_error_ret(err, " clEnqueueNDRangeKernel failed", -1); + + err = clEnqueueReadBuffer(queue, buffers[1], true, 0, size, outptr, 1, &consumer_sync_event, NULL); + test_error_ret(err, " clEnqueueReadBuffer failed", -1); + + if( verify_result( active_work_item_buffer, outptr, num_elements)){ + log_error("test_pipe_subgroups_divergence failed\n"); + return -1; + } + else { + log_info("test_pipe_subgroups_divergence passed\n"); + } + + return 0; +} diff --git a/test_conformance/printf/CMakeLists.txt b/test_conformance/printf/CMakeLists.txt index 71d73c16..8f03dca9 100644 --- a/test_conformance/printf/CMakeLists.txt +++ b/test_conformance/printf/CMakeLists.txt @@ -3,20 +3,8 @@ set(MODULE_NAME PRINTF) set(CMAKE_CXX_STANDARD 11) set(${MODULE_NAME}_SOURCES - test_printf.c - util_printf.c - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/threadTesting.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/typeWrappers.cpp - ../../test_common/harness/conversions.c - ../../test_common/harness/mt19937.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/testHarness.c - #../../test_common/harness/imageHelpers.cpp - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/crc32.c + test_printf.cpp + util_printf.cpp ) include(../CMakeCommon.txt) diff --git a/test_conformance/printf/test_printf.c b/test_conformance/printf/test_printf.cpp similarity index 89% rename from test_conformance/printf/test_printf.c rename to test_conformance/printf/test_printf.cpp index bc01b7d7..b169e6b9 100644 --- a/test_conformance/printf/test_printf.c +++ b/test_conformance/printf/test_printf.cpp @@ -13,14 +13,14 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include #include #if ! defined( _WIN32) -#if ! defined( __ANDROID__ ) +#if defined(__APPLE__) #include #endif #include @@ -37,11 +37,13 @@ #define streamDup2(fd1,fd2) _dup2(fd1,fd2) #endif -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/mt19937.h" -#include "../../test_common/harness/parseParameters.h" +#include "harness/testHarness.h" +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" +#include "harness/mt19937.h" +#include "harness/parseParameters.h" + +#include typedef unsigned int uint32_t; @@ -57,7 +59,7 @@ static void printUsage( void ); //Stream helper functions //Associate stdout stream with the file(gFileName):i.e redirect stdout stream to the specific files (gFileName) -static int acquireOutputStream(); +static int acquireOutputStream(int* error); //Close the file(gFileName) associated with the stdout stream and disassociates it. static void releaseOutputStream(int fd); @@ -139,10 +141,15 @@ static int getTempFileName() //----------------------------------------- // acquireOutputStream //----------------------------------------- -static int acquireOutputStream() +static int acquireOutputStream(int* error) { int fd = streamDup(fileno(stdout)); - freopen(gFileName,"w",stdout); + *error = 0; + if (!freopen(gFileName, "w", stdout)) + { + releaseOutputStream(fd); + *error = -1; + } return fd; } @@ -156,6 +163,14 @@ static void releaseOutputStream(int fd) close(fd); } +//----------------------------------------- +// printfCallBack +//----------------------------------------- +static void CL_CALLBACK printfCallBack(const char *printf_data, size_t len, size_t final, void *user_data) +{ + fwrite(printf_data, 1, len, stdout); +} + //----------------------------------------- // getAnalysisBuffer //----------------------------------------- @@ -168,7 +183,7 @@ static void getAnalysisBuffer(char* analysisBuffer) if(NULL == fp) log_error("Failed to open analysis buffer ('%s')\n", strerror(errno)); else - while(fgets(analysisBuffer,ANALYSIS_BUFFER_SIZE , fp) != NULL ); + while(fgets(analysisBuffer, ANALYSIS_BUFFER_SIZE, fp) != NULL ); fclose(fp); } @@ -192,21 +207,11 @@ static int isKernelPFormat(testCase* pTestCase,size_t testId) //----------------------------------------- int waitForEvent(cl_event* event) { - cl_int status = CL_SUCCESS; - cl_int eventStatus = CL_QUEUED; - while(eventStatus != CL_COMPLETE) + cl_int status = clWaitForEvents(1, event); + if(status != CL_SUCCESS) { - status = clGetEventInfo( - *event, - CL_EVENT_COMMAND_EXECUTION_STATUS, - sizeof(cl_int), - &eventStatus, - NULL); - if(status != CL_SUCCESS) - { - log_error("clGetEventInfo failed"); - return status; - } + log_error("clWaitForEvents failed"); + return status; } status = clReleaseEvent(*event); @@ -291,7 +296,7 @@ static cl_program makePrintfProgram(cl_kernel *kernel_ptr, const cl_context cont { sprintf(addrSpaceArgument, "%s",allTestCase[testId]->_genParameters[testNum].addrSpaceArgumentTypeQualifier); - sprintf(addrSpacePAddArgument,allTestCase[testId]->_genParameters[testNum].addrSpacePAdd); + sprintf(addrSpacePAddArgument, "%s", allTestCase[testId]->_genParameters[testNum].addrSpacePAdd); } if (strlen(addrSpaceArgument) == 0) @@ -366,35 +371,7 @@ static bool isLongSupported(cl_device_id device_id) if(!strcmp("EMBEDDED_PROFILE",profileType.get())) { - // Device extention - status = clGetDeviceInfo( - device_id, - CL_DEVICE_EXTENSIONS, - 0, - NULL, - &tempSize); - - if(status != CL_SUCCESS) - { - log_error("*** clGetDeviceInfo FAILED ***\n\n"); - return false; - } - - std::unique_ptr devExt(new char[tempSize]); - if(devExt == NULL) - { - log_error("Failed to allocate memory(devExt)"); - return false; - } - - status = clGetDeviceInfo( - device_id, - CL_DEVICE_EXTENSIONS, - sizeof(char) * tempSize, - devExt.get(), - NULL); - - extSupport = (strstr(devExt.get(),"cles_khr_int64") != NULL); + extSupport = is_extension_available(device_id, "cles_khr_int64"); } return extSupport; } @@ -520,7 +497,12 @@ static int doTest(cl_command_queue queue, cl_context context, const unsigned int } } - fd = acquireOutputStream(); + fd = acquireOutputStream(&err); + if (err != 0) + { + log_error("Error while redirection stdout to file"); + goto exit; + } globalWorkSize[0] = 1; cl_event ndrEvt; err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, globalWorkSize, NULL, 0, NULL,&ndrEvt); @@ -540,7 +522,7 @@ static int doTest(cl_command_queue queue, cl_context context, const unsigned int goto exit; } //Wait until kernel finishes its execution and (thus) the output printed from the kernel - //is immidatly printed + //is immediately printed err = waitForEvent(&ndrEvt); releaseOutputStream(fd); @@ -587,49 +569,13 @@ exit: if(clReleaseProgram(program) != CL_SUCCESS) log_error("clReleaseProgram failed\n"); if(d_out) - clReleaseMemObject(d_out); + clReleaseMemObject(d_out); if(d_a) - clReleaseMemObject(d_a); + clReleaseMemObject(d_a); ++s_test_cnt; return err; } -//----------------------------------------- -// printArch -//----------------------------------------- -static void printArch( void ) -{ - log_info( "sizeof( void*) = %d\n", (int) sizeof( void *) ); - -#if defined( __APPLE__ ) - -#if defined( __ppc__ ) - log_info( "ARCH:\tppc\n" ); -#elif defined( __ppc64__ ) - log_info( "ARCH:\tppc64\n" ); -#elif defined( __i386__ ) - log_info( "ARCH:\ti386\n" ); -#elif defined( __x86_64__ ) - log_info( "ARCH:\tx86_64\n" ); -#elif defined( __arm__ ) - log_info( "ARCH:\tarm\n" ); -#elif defined( __aarch64__ ) - log_info( "ARCH:\taarch64\n" ); -#else -#error unknown arch -#endif - - int type = 0; - size_t typeSize = sizeof( type ); - sysctlbyname( "hw.cputype", &type, &typeSize, NULL, 0 ); - log_info( "cpu type:\t%d\n", type ); - typeSize = sizeof( type ); - sysctlbyname( "hw.cpusubtype", &type, &typeSize, NULL, 0 ); - log_info( "cpu subtype:\t%d\n", type ); - -#endif -} - int test_int_0(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) { @@ -741,17 +687,19 @@ int test_float_17(cl_device_id deviceID, cl_context context, cl_command_queue qu { return doTest(gQueue, gContext, TYPE_FLOAT, 17, deviceID); } -int test_float_18(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) + + +int test_float_limits_0(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) { - return doTest(gQueue, gContext, TYPE_FLOAT, 18, deviceID); + return doTest(gQueue, gContext, TYPE_FLOAT_LIMITS, 0, deviceID); } -int test_float_19(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) +int test_float_limits_1(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) { - return doTest(gQueue, gContext, TYPE_FLOAT, 19, deviceID); + return doTest(gQueue, gContext, TYPE_FLOAT_LIMITS, 1, deviceID); } -int test_float_20(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) +int test_float_limits_2(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) { - return doTest(gQueue, gContext, TYPE_FLOAT, 20, deviceID); + return doTest(gQueue, gContext, TYPE_FLOAT_LIMITS, 2, deviceID); } @@ -905,9 +853,10 @@ test_definition test_list[] = { ADD_TEST( float_15 ), ADD_TEST( float_16 ), ADD_TEST( float_17 ), - ADD_TEST( float_18 ), - ADD_TEST( float_19 ), - ADD_TEST( float_20 ), + + ADD_TEST( float_limits_0 ), + ADD_TEST( float_limits_1 ), + ADD_TEST( float_limits_2 ), ADD_TEST( octal_0 ), ADD_TEST( octal_1 ), @@ -1002,7 +951,7 @@ int main(int argc, const char* argv[]) return -1; } - int err = runTestHarnessWithCheck( argCount, argList, test_num, test_list, false, true, 0, InitCL ); + int err = runTestHarnessWithCheck( argCount, argList, test_num, test_list, true, 0, InitCL ); if(gQueue) { @@ -1043,7 +992,12 @@ test_status InitCL( cl_device_id device ) uint32_t compute_devices = 0; int err; - gFd = acquireOutputStream(); + gFd = acquireOutputStream(&err); + if (err != 0) + { + log_error("Error while redirection stdout to file"); + return TEST_FAIL; + } size_t config_size = sizeof( device_frequency ); #if MULTITHREAD @@ -1063,26 +1017,48 @@ test_status InitCL( cl_device_id device ) printDeviceHeader( device ); - printArch(); + PrintArch(); - err = check_opencl_version(device,1,2); - if( err != CL_SUCCESS ) { - print_missing_feature(err,"printf"); - test_finish(); - return TEST_FAIL; + auto version = get_device_cl_version(device); + auto expected_min_version = Version(1, 2); + if (version < expected_min_version) + { + version_expected_info("Test", "OpenCL", + expected_min_version.to_string().c_str(), + version.to_string().c_str()); + return TEST_SKIP; } log_info( "Test binary built %s %s\n", __DATE__, __TIME__ ); - gFd = acquireOutputStream(); + gFd = acquireOutputStream(&err); + if (err != 0) + { + log_error("Error while redirection stdout to file"); + return TEST_FAIL; + } + cl_context_properties printf_properties[] = { + CL_PRINTF_CALLBACK_ARM, (cl_context_properties)printfCallBack, + CL_PRINTF_BUFFERSIZE_ARM, ANALYSIS_BUFFER_SIZE, 0 + }; - gContext = clCreateContext(NULL, 1, &device, notify_callback, NULL, NULL); + cl_context_properties* props = NULL; + + if(is_extension_available(device, "cl_arm_printf")) + { + props = printf_properties; + } + + gContext = clCreateContext(props, 1, &device, notify_callback, NULL, NULL); checkNull(gContext, "clCreateContext"); - gQueue = clCreateCommandQueueWithProperties(gContext, device, 0, NULL); + gQueue = clCreateCommandQueue(gContext, device, 0, NULL); checkNull(gQueue, "clCreateCommandQueue"); releaseOutputStream(gFd); + // Generate reference results + generateRef(device); + return TEST_PASS; } diff --git a/test_conformance/printf/test_printf.h b/test_conformance/printf/test_printf.h index 5ae518f5..038a7b9c 100644 --- a/test_conformance/printf/test_printf.h +++ b/test_conformance/printf/test_printf.h @@ -16,10 +16,13 @@ #ifndef TESTPRINTF_INCLUDED_H #define TESTPRINTF_INCLUDED_H -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" +#include "harness/testHarness.h" +#include "harness/rounding_mode.h" #include #include +#include #ifdef __APPLE__ #include @@ -29,21 +32,6 @@ #include #endif -// Enable the test to be used with ATF -#if USE_ATF -// export BUILD_WITH_ATF=1 -#include -#define test_start() ATFTestStart() -#define log_info ATFLogInfo -#define log_error ATFLogError -#define test_finish() ATFTestFinish() -#else -#define test_start() -#define log_info printf -#define log_error printf -#define test_finish() -#endif // USE_ATF - #define ANALYSIS_BUFFER_SIZE 256 //----------------------------------------- @@ -53,10 +41,11 @@ //----------------------------------------- // Types //----------------------------------------- -enum Type +enum PrintfTestType { TYPE_INT, TYPE_FLOAT, + TYPE_FLOAT_LIMITS, TYPE_OCTAL, TYPE_UNSIGNED, TYPE_HEXADEC, @@ -81,22 +70,39 @@ struct printDataGenParameters const char* addrSpacePAdd; }; +// Reference results - filled out at run-time +static std::vector correctBufferInt; +static std::vector correctBufferFloat; +static std::vector correctBufferOctal; +static std::vector correctBufferUnsigned; +static std::vector correctBufferHexadecimal; +// Reference results - Compile-time known +extern std::vector correctBufferChar; +extern std::vector correctBufferString; +extern std::vector correctBufferFloatLimits; +extern std::vector correctBufferVector; +extern std::vector correctAddrSpace; + +// Helper for generating reference results +void generateRef(const cl_device_id device); + //----------------------------------------- //Test Case //----------------------------------------- struct testCase { - unsigned int _testNum; //test number - enum Type _type; //(data)type for test - //const char** _strPrint; //auxiliary data to build the code for kernel source - const char** _correctBuffer; //look-up table for correct results for printf - struct printDataGenParameters* _genParameters; //auxiliary data to build the code for kernel source + enum PrintfTestType _type; //(data)type for test + std::vector& _correctBuffer; //look-up table for correct results for printf + std::vector& _genParameters; //auxiliary data to build the code for kernel source + void (*printFN)(printDataGenParameters&, + char*, + const size_t); //function pointer for generating reference results + Type dataType; //the data type that will be printed during reference result generation (used for setting rounding mode) }; - extern const char* strType[]; -extern testCase* allTestCase[]; +extern std::vector allTestCase; size_t verifyOutputBuffer(char *analysisBuffer,testCase* pTestCase,size_t testId,cl_ulong pAddr = 0); diff --git a/test_conformance/printf/util_printf.c b/test_conformance/printf/util_printf.cpp similarity index 71% rename from test_conformance/printf/util_printf.c rename to test_conformance/printf/util_printf.cpp index f9f72e51..3546c5f5 100644 --- a/test_conformance/printf/util_printf.c +++ b/test_conformance/printf/util_printf.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -13,18 +13,19 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" +#include "harness/rounding_mode.h" +#include "harness/kernelHelpers.h" #include "test_printf.h" +#include - -#if defined (_WIN32) -#define strtoull _strtoi64 -#endif - -const char* strType[] = {"int","float","octal","unsigned","hexadecimal","char","string","vector","address space"}; - - +// Helpers for generating runtime reference results +static void intRefBuilder(printDataGenParameters&, char*, const size_t); +static void floatRefBuilder(printDataGenParameters&, char* rResult, const size_t); +static void octalRefBuilder(printDataGenParameters&, char*, const size_t); +static void unsignedRefBuilder(printDataGenParameters&, char*, const size_t); +static void hexRefBuilder(printDataGenParameters&, char*, const size_t); //================================== @@ -38,7 +39,7 @@ const char* strType[] = {"int","float","octal","unsigned","hexadecimal","char"," //------------------------------------------------------ -struct printDataGenParameters printIntGenParameters[] = { +std::vector printIntGenParameters = { //(Minimum)Five-wide,default(right)-justified @@ -78,38 +79,6 @@ struct printDataGenParameters printIntGenParameters[] = { }; -//------------------------------------------------ - -// Lookup table - [string]int-correct buffer | - -//------------------------------------------------ - -const char *correctBufferInt[] = { - - " 10", - - "10 ", - - "00010", - - " +10", - - "+10 ", - - "00100", - - " 00100", - - "100 ", - - " 00100" - -}; - - - - - //----------------------------------------------- //test case for int | @@ -118,13 +87,15 @@ const char *correctBufferInt[] = { testCase testCaseInt = { - sizeof(correctBufferInt)/sizeof(char*), - TYPE_INT, correctBufferInt, - printIntGenParameters + printIntGenParameters, + + intRefBuilder, + + kint }; @@ -146,7 +117,7 @@ testCase testCaseInt = { //-------------------------------------------------------- -struct printDataGenParameters printFloatGenParameters[] = { +std::vector printFloatGenParameters = { //Default(right)-justified @@ -219,6 +190,44 @@ struct printDataGenParameters printFloatGenParameters[] = { //(Minimum)Ten-wide,Double argument representing floating-point,in xh.hhhhpAd style,default(right)-justified {"%10.2a","9990.235"}, +}; + +//--------------------------------------------------------- + +//Test case for float | + +//--------------------------------------------------------- + +testCase testCaseFloat = { + + TYPE_FLOAT, + + correctBufferFloat, + + printFloatGenParameters, + + floatRefBuilder, + + kfloat + +}; + +//============================================== + +// float limits + +//============================================== + + + +//-------------------------------------------------------- + +// [string] format | [string] float-data representation | + +//-------------------------------------------------------- + + +std::vector printFloatLimitsGenParameters = { //Infinity (1.0/0.0) @@ -237,43 +246,7 @@ struct printDataGenParameters printFloatGenParameters[] = { //-------------------------------------------------------- -const char* correctBufferFloat[] = { - - "10.345600", - - "10.3", - - "10.35", - - " 10.346", - - "00010.35", - - "10.35 ", - - " -10.35", - - "0", - - "1", - - "0.600000", - - "12345.7", - - "1.2e+4", - - "2.3E-6", - - "0.023", - - "7.894561230000000e+8", - - "+7.894561230000000E+8", - - "0x1.99999ap-4", - - "0x1.38p+13", +std::vector correctBufferFloatLimits = { "inf", @@ -288,20 +261,18 @@ const char* correctBufferFloat[] = { //--------------------------------------------------------- -testCase testCaseFloat = { +testCase testCaseFloatLimits = { - sizeof(correctBufferFloat)/sizeof(char*), + TYPE_FLOAT_LIMITS, - TYPE_FLOAT, + correctBufferFloatLimits, - correctBufferFloat, + printFloatLimitsGenParameters, - printFloatGenParameters + NULL }; - - //========================================================= // octal @@ -316,7 +287,7 @@ testCase testCaseFloat = { //--------------------------------------------------------- -struct printDataGenParameters printOctalGenParameters[] = { +std::vector printOctalGenParameters = { //Default(right)-justified @@ -338,39 +309,21 @@ struct printDataGenParameters printOctalGenParameters[] = { //------------------------------------------------------- -// Lookup table - [string] octal-correct buffer | - -//------------------------------------------------------- - - - -const char* correctBufferOctal[] = { - - "12", - - "00012", - - "0575360400", - - "00012" - -}; - -//------------------------------------------------------- - //Test case for octal | //------------------------------------------------------- testCase testCaseOctal = { - sizeof(correctBufferOctal)/sizeof(char*), - TYPE_OCTAL, correctBufferOctal, - printOctalGenParameters + printOctalGenParameters, + + octalRefBuilder, + + kulong }; @@ -390,7 +343,7 @@ testCase testCaseOctal = { //--------------------------------------------------------- -struct printDataGenParameters printUnsignedGenParameters[] = { +std::vector printUnsignedGenParameters = { //Default(right)-justified @@ -404,35 +357,21 @@ struct printDataGenParameters printUnsignedGenParameters[] = { //------------------------------------------------------- -// Lookup table - [string] octal-correct buffer | - -//------------------------------------------------------- - - - -const char* correctBufferUnsigned[] = { - - "10", - - "" - -}; - -//------------------------------------------------------- - //Test case for octal | //------------------------------------------------------- testCase testCaseUnsigned = { - sizeof(correctBufferUnsigned)/sizeof(char*), - TYPE_UNSIGNED, correctBufferUnsigned, - printUnsignedGenParameters + printUnsignedGenParameters, + + unsignedRefBuilder, + + kulong }; @@ -452,7 +391,7 @@ testCase testCaseUnsigned = { //-------------------------------------------------------------- -struct printDataGenParameters printHexadecimalGenParameters[] = { +std::vector printHexadecimalGenParameters = { //Add 0x,low x,default(right)-justified @@ -478,41 +417,21 @@ struct printDataGenParameters printHexadecimalGenParameters[] = { //-------------------------------------------------------------- -// Lookup table - [string]hexadecimal-correct buffer | - -//-------------------------------------------------------------- - - - -const char* correctBufferHexadecimal[] = { - - "0xabcdef", - - "0XABCDEF", - - "0", - - " 18f", - - "018f" - -}; - -//-------------------------------------------------------------- - //Test case for hexadecimal | //-------------------------------------------------------------- testCase testCaseHexadecimal = { - sizeof(correctBufferHexadecimal)/sizeof(char*), - TYPE_HEXADEC, correctBufferHexadecimal, - printHexadecimalGenParameters + printHexadecimalGenParameters, + + hexRefBuilder, + + kulong }; @@ -532,7 +451,7 @@ testCase testCaseHexadecimal = { //----------------------------------------------------------- -struct printDataGenParameters printCharGenParameters[] = { +std::vector printCharGenParameters = { //Four-wide,zero-filled,default(right)-justified @@ -554,7 +473,7 @@ struct printDataGenParameters printCharGenParameters[] = { //--------------------------------------------------------- -const char * correctBufferChar[] = { +std::vector correctBufferChar = { " 1", @@ -566,6 +485,7 @@ const char * correctBufferChar[] = { + //---------------------------------------------------------- //Test case for char | @@ -574,13 +494,15 @@ const char * correctBufferChar[] = { testCase testCaseChar = { - sizeof(correctBufferChar)/sizeof(char*), - TYPE_CHAR, correctBufferChar, - printCharGenParameters + printCharGenParameters, + + NULL, + + kchar }; @@ -600,7 +522,7 @@ testCase testCaseChar = { //-------------------------------------------------------- -struct printDataGenParameters printStringGenParameters[] = { +std::vector printStringGenParameters = { //(Minimum)Four-wide,zero-filled,default(right)-justified @@ -621,7 +543,7 @@ struct printDataGenParameters printStringGenParameters[] = { //--------------------------------------------------------- -const char * correctBufferString[] = { +std::vector correctBufferString = { " foo", @@ -630,6 +552,7 @@ const char * correctBufferString[] = { "%%", }; + //--------------------------------------------------------- //Test case for string | @@ -638,13 +561,15 @@ const char * correctBufferString[] = { testCase testCaseString = { - sizeof(correctBufferString)/sizeof(char*), - TYPE_STRING, correctBufferString, - printStringGenParameters + printStringGenParameters, + + NULL, + + kchar }; @@ -664,7 +589,7 @@ testCase testCaseString = { //------------------------------------------------------------------------------------------------------------------- -struct printDataGenParameters printVectorGenParameters[]={ +std::vector printVectorGenParameters = { //(Minimum)Two-wide,two positions after decimal @@ -694,7 +619,7 @@ struct printDataGenParameters printVectorGenParameters[]={ //------------------------------------------------------------ -const char * correctBufferVector[] = { +std::vector correctBufferVector = { "1.00,2.00,3.00,4.00", @@ -716,13 +641,13 @@ const char * correctBufferVector[] = { testCase testCaseVector = { - sizeof(correctBufferVector)/(sizeof(char *)), - TYPE_VECTOR, correctBufferVector, - printVectorGenParameters + printVectorGenParameters, + + NULL }; @@ -744,7 +669,7 @@ testCase testCaseVector = { -struct printDataGenParameters printAddrSpaceGenParameters[]={ +std::vector printAddrSpaceGenParameters = { //Global memory region @@ -774,7 +699,7 @@ struct printDataGenParameters printAddrSpaceGenParameters[]={ //------------------------------------------------------------------------------- -const char * correctAddrSpace[] = { +std::vector correctAddrSpace = { "2","2","+3","-1","" @@ -788,13 +713,13 @@ const char * correctAddrSpace[] = { testCase testCaseAddrSpace = { - sizeof(correctAddrSpace)/(sizeof(char *)), - TYPE_ADDRESS_SPACE, correctAddrSpace, - printAddrSpaceGenParameters + printAddrSpaceGenParameters, + + NULL }; @@ -806,7 +731,7 @@ testCase testCaseAddrSpace = { //------------------------------------------------------------------------------- -testCase* allTestCase[] = {&testCaseInt,&testCaseFloat,&testCaseOctal,&testCaseUnsigned,&testCaseHexadecimal,&testCaseChar,&testCaseString,&testCaseVector,&testCaseAddrSpace}; +std::vector allTestCase = {&testCaseInt,&testCaseFloat,&testCaseFloatLimits,&testCaseOctal,&testCaseUnsigned,&testCaseHexadecimal,&testCaseChar,&testCaseString,&testCaseVector,&testCaseAddrSpace}; //----------------------------------------- @@ -852,8 +777,7 @@ size_t verifyOutputBuffer(char *analysisBuffer,testCase* pTestCase,size_t testId char correctExp[3]={0}; strncpy(correctExp,exp,2); - - char* eCorrectBuffer = strstr((char*)pTestCase->_correctBuffer[testId],correctExp); + char* eCorrectBuffer = strstr((char*)pTestCase->_correctBuffer[testId].c_str(),correctExp); if(eCorrectBuffer == NULL) return 1; @@ -863,16 +787,108 @@ size_t verifyOutputBuffer(char *analysisBuffer,testCase* pTestCase,size_t testId //Exponent always contains at least two digits if(strlen(exp) < 2) return 1; - //Scip leading zeros in the exponent + //Skip leading zeros in the exponent while(*exp == '0') ++exp; + while(*eCorrectBuffer == '0') + ++eCorrectBuffer; return strcmp(eCorrectBuffer,exp); } - if(!strcmp(pTestCase->_correctBuffer[testId],"inf")) + if(!strcmp(pTestCase->_correctBuffer[testId].c_str(),"inf")) return strcmp(analysisBuffer,"inf")&&strcmp(analysisBuffer,"infinity")&&strcmp(analysisBuffer,"1.#INF00")&&strcmp(analysisBuffer,"Inf"); - if(!strcmp(pTestCase->_correctBuffer[testId],"nan") || !strcmp(pTestCase->_correctBuffer[testId],"-nan")) { + if(!strcmp(pTestCase->_correctBuffer[testId].c_str(),"nan") || !strcmp(pTestCase->_correctBuffer[testId].c_str(),"-nan")) { return strcmp(analysisBuffer,"nan")&&strcmp(analysisBuffer,"-nan")&&strcmp(analysisBuffer,"1.#IND00")&&strcmp(analysisBuffer,"-1.#IND00")&&strcmp(analysisBuffer,"NaN")&&strcmp(analysisBuffer,"nan(ind)")&&strcmp(analysisBuffer,"nan(snan)")&&strcmp(analysisBuffer,"-nan(ind)"); } - return strcmp(analysisBuffer,pTestCase->_correctBuffer[testId]); + return strcmp(analysisBuffer,pTestCase->_correctBuffer[testId].c_str()); } +static void intRefBuilder(printDataGenParameters& params, char* refResult, const size_t refSize) +{ + snprintf(refResult, refSize, params.genericFormat, atoi(params.dataRepresentation)); +} + +static void floatRefBuilder(printDataGenParameters& params, char* refResult, const size_t refSize) +{ + snprintf(refResult, refSize, params.genericFormat, strtof(params.dataRepresentation, NULL)); +} + +static void octalRefBuilder(printDataGenParameters& params, char* refResult, const size_t refSize) +{ + const unsigned long int data = strtoul(params.dataRepresentation, NULL, 10); + snprintf(refResult, refSize, params.genericFormat, data); +} + +static void unsignedRefBuilder(printDataGenParameters& params, char* refResult, const size_t refSize) +{ + const unsigned long int data = strtoul(params.dataRepresentation, NULL, 10); + snprintf(refResult, refSize, params.genericFormat, data); +} + +static void hexRefBuilder(printDataGenParameters& params, char* refResult, const size_t refSize) +{ + const unsigned long int data = strtoul(params.dataRepresentation, NULL, 0); + snprintf(refResult, refSize, params.genericFormat, data); +} + +/* + Generate reference results. + + Results are only generated for test cases + that can easily be generated by using CPU + printf. + + If that is not the case, results are constants + that have been hard-coded. +*/ +void generateRef(const cl_device_id device) +{ + int fd = -1; + char _refBuffer[ANALYSIS_BUFFER_SIZE]; + const cl_device_fp_config fpConfig = get_default_rounding_mode(device); + const RoundingMode hostRound = get_round(); + RoundingMode deviceRound; + + // Map device rounding to CTS rounding type + // get_default_rounding_mode supports RNE and RTZ + if (fpConfig == CL_FP_ROUND_TO_NEAREST) + { + deviceRound = kRoundToNearestEven; + } + else if (fpConfig == CL_FP_ROUND_TO_ZERO) + { + deviceRound = kRoundTowardZero; + } + else + { + assert(false && "Unreachable"); + } + + // Loop through all test cases + for (auto &caseToTest: allTestCase) + { + /* + Cases that have a NULL function pointer + already have their reference results + as they're constant and hard-coded + */ + if (caseToTest->printFN == NULL) + continue; + + // Make sure the reference result is empty + assert(caseToTest->_correctBuffer.size() == 0); + + // Loop through each input + for (auto ¶ms: caseToTest->_genParameters) + { + char refResult[ANALYSIS_BUFFER_SIZE]; + // Set CPU rounding mode to match that of the device + set_round(deviceRound, caseToTest->dataType); + // Generate the result + caseToTest->printFN(params, refResult, ARRAY_SIZE(refResult)); + // Restore the original CPU rounding mode + set_round(hostRound, kfloat); + // Save the reference result + caseToTest->_correctBuffer.push_back(refResult); + } + } +} diff --git a/test_conformance/profiling/CMakeLists.txt b/test_conformance/profiling/CMakeLists.txt index 914d3295..036de05b 100644 --- a/test_conformance/profiling/CMakeLists.txt +++ b/test_conformance/profiling/CMakeLists.txt @@ -1,24 +1,14 @@ set(MODULE_NAME PROFILING) set(${MODULE_NAME}_SOURCES - main.c - readArray.c - writeArray.c - readImage.c - writeImage.c - copy.c - execute.c - execute_multipass.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/typeWrappers.cpp - ../../test_common/harness/imageHelpers.cpp - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/mt19937.c - ../../test_common/harness/conversions.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c + main.cpp + readArray.cpp + writeArray.cpp + readImage.cpp + writeImage.cpp + copy.cpp + execute.cpp + execute_multipass.cpp ) include(../CMakeCommon.txt) diff --git a/test_conformance/profiling/copy.c b/test_conformance/profiling/copy.cpp similarity index 97% rename from test_conformance/profiling/copy.c rename to test_conformance/profiling/copy.cpp index 31e3afb8..83c5db27 100644 --- a/test_conformance/profiling/copy.c +++ b/test_conformance/profiling/copy.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -21,9 +21,9 @@ #include #include "procs.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/conversions.h" +#include "harness/testHarness.h" +#include "harness/errorHelpers.h" +#include "harness/conversions.h" //--- the code for the kernel executables static const char *write_kernel_code = @@ -436,9 +436,6 @@ static int copy_image_size( cl_device_id device, cl_context context, void *dst = NULL; cl_kernel kernel[1]; size_t threads[2]; -#ifdef USE_LOCAL_THREADS - size_t localThreads[2]; -#endif int err = 0; cl_mem_flags flags; unsigned int num_channels = 4; @@ -456,16 +453,6 @@ static int copy_image_size( cl_device_id device, cl_context context, threads[0] = (size_t)w; threads[1] = (size_t)h; -#ifdef USE_LOCAL_THREADS - err = clGetDeviceConfigInfo( id, CL_DEVICE_MAX_THREAD_GROUP_SIZE, localThreads, sizeof( cl_uint ), NULL ); - test_error( err, "Unable to get thread group max size" ); - localThreads[1] = localThreads[0]; - if( localThreads[0] > threads[0] ) - localThreads[0] = threads[0]; - if( localThreads[1] > threads[1] ) - localThreads[1] = threads[1]; -#endif - inptr = (void *)generate_image( (int)num_bytes, d ); if( ! inptr ){ log_error("unable to allocate inptr at %d x %d\n", (int)w, (int)h ); @@ -539,11 +526,8 @@ static int copy_image_size( cl_device_id device, cl_context context, return -1; } -#ifdef USE_LOCAL_THREADS - err = clEnqueueNDRangeKernel( queue, kernel[0], 2, NULL, threads, localThreads, 0, NULL, NULL ); -#else err = clEnqueueNDRangeKernel( queue, kernel[0], 2, NULL, threads, NULL, 0, NULL, NULL ); -#endif + if (err != CL_SUCCESS){ print_error( err, "clEnqueueNDRangeKernel failed" ); clReleaseKernel( kernel[0] ); diff --git a/test_conformance/profiling/execute.c b/test_conformance/profiling/execute.cpp similarity index 94% rename from test_conformance/profiling/execute.c rename to test_conformance/profiling/execute.cpp index 8bdc5e4a..25ebfd12 100644 --- a/test_conformance/profiling/execute.c +++ b/test_conformance/profiling/execute.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -22,8 +22,8 @@ #include #include "procs.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/errorHelpers.h" +#include "harness/testHarness.h" +#include "harness/errorHelpers.h" #ifndef uchar typedef unsigned char uchar; @@ -175,9 +175,6 @@ static int kernelFilter( cl_device_id device, cl_context context, cl_command_que cl_event executeEvent; cl_ulong queueStart, submitStart, writeStart, writeEnd; size_t threads[2]; -#ifdef USE_LOCAL_THREADS - size_t localThreads[2]; -#endif float filter_weights[] = { .1f, .1f, .1f, .1f, .2f, .1f, .1f, .1f, .1f }; int filter_w = 3, filter_h = 3; int err = 0; @@ -186,16 +183,6 @@ static int kernelFilter( cl_device_id device, cl_context context, cl_command_que threads[0] = w; threads[1] = h; -#ifdef USE_LOCAL_THREADS - err = clGetDeviceConfigInfo( id, CL_DEVICE_MAX_THREAD_GROUP_SIZE, localThreads, sizeof( cl_uint ), NULL ); - test_error( err, "Unable to get thread group max size" ); - localThreads[1] = localThreads[0]; - if( localThreads[0] > threads[0] ) - localThreads[0] = threads[0]; - if( localThreads[1] > threads[1] ) - localThreads[1] = threads[1]; -#endif - // allocate the input and output image memory objects memobjs[0] = create_image_2d( context, (cl_mem_flags)(CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR), &image_format_desc, w, h, 0, inptr, &err ); @@ -249,11 +236,7 @@ static int kernelFilter( cl_device_id device, cl_context context, cl_command_que return -1; } -#ifdef USE_LOCAL_THREADS - err = clEnqueueNDRangeKernel( queue, kernel[0], 2, NULL, threads, localThreads, NULL, 0, &executeEvent ); -#else - err = clEnqueueNDRangeKernel( queue, kernel[0], 2, NULL, threads, NULL, NULL, 0, &executeEvent ); -#endif + err = clEnqueueNDRangeKernel( queue, kernel[0], 2, NULL, threads, NULL, 0, NULL, &executeEvent ); if( err != CL_SUCCESS ){ print_error( err, "clEnqueueNDRangeKernel failed\n" ); diff --git a/test_conformance/profiling/execute_multipass.c b/test_conformance/profiling/execute_multipass.cpp similarity index 94% rename from test_conformance/profiling/execute_multipass.c rename to test_conformance/profiling/execute_multipass.cpp index 9ca5df29..70512441 100644 --- a/test_conformance/profiling/execute_multipass.c +++ b/test_conformance/profiling/execute_multipass.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -22,8 +22,8 @@ #include #include "procs.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/errorHelpers.h" +#include "harness/testHarness.h" +#include "harness/errorHelpers.h" static const char *read3d_kernel_code = "\n" @@ -115,14 +115,9 @@ static int run_kernel( cl_device_id device, cl_context context, cl_command_queue if( localThreads[1] > threads[1] ) localThreads[1] = threads[1]; - cl_sampler_properties properties[] = { - CL_SAMPLER_NORMALIZED_COORDS, CL_FALSE, - CL_SAMPLER_ADDRESSING_MODE, CL_ADDRESS_CLAMP_TO_EDGE, - CL_SAMPLER_FILTER_MODE, CL_FILTER_NEAREST, - 0 }; - cl_sampler sampler = clCreateSamplerWithProperties( context, properties, &err ); + cl_sampler sampler = clCreateSampler( context, CL_FALSE, CL_ADDRESS_CLAMP_TO_EDGE, CL_FILTER_NEAREST, &err ); if( err ){ - log_error( " clCreateSamplerWithProperties failed.\n" ); + log_error( " clCreateSampler failed.\n" ); return -1; } @@ -165,7 +160,7 @@ static int run_kernel( cl_device_id device, cl_context context, cl_command_queue return -1; } - err = clEnqueueNDRangeKernel( queue, kernel[0], 3, NULL, threads, localThreads, NULL, 0, &executeEvent ); + err = clEnqueueNDRangeKernel( queue, kernel[0], 3, NULL, threads, localThreads, 0, NULL, &executeEvent ); if( err != CL_SUCCESS ){ print_error( err, "clEnqueueNDRangeKernel failed\n" ); diff --git a/test_conformance/profiling/main.c b/test_conformance/profiling/main.cpp similarity index 94% rename from test_conformance/profiling/main.c rename to test_conformance/profiling/main.cpp index 77213a20..bd367976 100644 --- a/test_conformance/profiling/main.c +++ b/test_conformance/profiling/main.cpp @@ -13,18 +13,16 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include #include "procs.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" -// FIXME: To use certain functions in ../../test_common/harness/imageHelpers.h +// FIXME: To use certain functions in harness/imageHelpers.h // (for example, generate_random_image_data()), the tests are required to declare // the following variables (): -cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT; -bool gTestRounding = false; test_definition test_list[] = { ADD_TEST( read_array_int ), diff --git a/test_conformance/profiling/procs.h b/test_conformance/profiling/procs.h index b3d4e675..cc7083d0 100644 --- a/test_conformance/profiling/procs.h +++ b/test_conformance/profiling/procs.h @@ -16,10 +16,10 @@ #ifndef __PROCS_H__ #define __PROCS_H__ -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/imageHelpers.h" -#include "../../test_common/harness/mt19937.h" +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" +#include "harness/imageHelpers.h" +#include "harness/mt19937.h" extern int check_times(cl_ulong queueStart, cl_ulong submitStart, cl_ulong commandStart, cl_ulong commandEnd, cl_device_id device); diff --git a/test_conformance/profiling/readArray.c b/test_conformance/profiling/readArray.cpp similarity index 86% rename from test_conformance/profiling/readArray.c rename to test_conformance/profiling/readArray.cpp index 4b4033f0..2260c28c 100644 --- a/test_conformance/profiling/readArray.c +++ b/test_conformance/profiling/readArray.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -22,7 +22,7 @@ #include #include "procs.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" #define TEST_PRIME_INT ((1<<16)+1) #define TEST_PRIME_UINT ((1U<<16)+1U) @@ -622,25 +622,12 @@ int test_stream_read( cl_device_id device, cl_context context, cl_command_queue cl_event readEvent; cl_ulong queueStart, submitStart, readStart, readEnd; size_t threads[1]; -#ifdef USE_LOCAL_THREADS - size_t localThreads[1]; -#endif int err, err_count = 0; int i; size_t ptrSizes[5]; threads[0] = (size_t)num_elements; -#ifdef USE_LOCAL_THREADS - err = clGetDeviceConfigInfo( id, CL_DEVICE_MAX_THREAD_GROUP_SIZE, localThreads, sizeof( cl_uint ), NULL ); - if( err != CL_SUCCESS ){ - log_error( "Unable to get thread group max size: %d", err ); - return -1; - } - if( localThreads[0] > threads[0] ) - localThreads[0] = threads[0]; -#endif - ptrSizes[0] = size; ptrSizes[1] = ptrSizes[0] << 1; ptrSizes[2] = ptrSizes[1] << 1; @@ -676,11 +663,8 @@ int test_stream_read( cl_device_id device, cl_context context, cl_command_queue return -1; } -#ifdef USE_LOCAL_THREADS - err = clEnqueueNDRangeKernel( queue, kernel[i], 1, NULL, threads, localThreads, 0, NULL, NULL ); -#else err = clEnqueueNDRangeKernel( queue, kernel[i], 1, NULL, threads, NULL, 0, NULL, NULL ); -#endif + if( err != CL_SUCCESS ){ print_error( err, "clEnqueueNDRangeKernel failed" ); clReleaseKernel( kernel[i] ); @@ -893,105 +877,3 @@ int test_read_array_struct( cl_device_id device, cl_context context, cl_command_ return test_stream_read( device, context, queue, num_elements, sizeof( TestStruct ), "struct", 1, stream_read_struct_kernel_code, struct_kernel_name, foo ); } - -/* -int read_struct_array(cl_device_group device, cl_device id, cl_context context, int num_elements) -{ - cl_mem streams[1]; - TestStruct *output_ptr; - cl_program program[1]; - cl_kernel kernel[1]; - void *values[1]; - size_t sizes[1] = { sizeof(cl_stream) }; - size_t threads[1]; -#ifdef USE_LOCAL_THREADS - size_t localThreads[1]; -#endif - int err; - size_t objSize = sizeof(TestStruct); - - threads[0] = (size_t)num_elements; - -#ifdef USE_LOCAL_THREADS - err = clGetDeviceConfigInfo( id, CL_DEVICE_MAX_THREAD_GROUP_SIZE, localThreads, sizeof( cl_uint ), NULL ); - if( err != CL_SUCCESS ){ - log_error( "Unable to get thread group max size: %d", err ); - return -1; - } - if( localThreads[0] > threads[0] ) - localThreads[0] = threads[0]; -#endif - - output_ptr = malloc(objSize * num_elements); - if( ! output_ptr ){ - log_error( " unable to allocate %d bytes for output_ptr\n", (int)(objSize * num_elements) ); - return -1; - } - streams[0] = clCreateBuffer( device, (cl_mem_flags)(CL_MEM_READ_WRITE), objSize * num_elements, NULL ); - if( !streams[0] ){ - log_error( " clCreateBuffer failed\n" ); - free( output_ptr ); - return -1; - } - - err = create_program_and_kernel( device, stream_read_struct_kernel_code, "test_stream_read_struct", &program[0], &kernel[0]); - if( err ){ - clReleaseProgram( program[0] ); - free( output_ptr ); - return -1; - } - - err = clSetKernelArg( kernel[0], 0, sizeof( cl_mem ), (void *)&streams[0] ); - if( err != CL_SUCCESS){ - print_error( err, "clSetKernelArg failed" ); - clReleaseProgram( program[0] ); - clReleaseKernel( kernel[0] ); - clReleaseMemObject( streams[0] ); - free( output_ptr ); - return -1; - } - -#ifdef USE_LOCAL_THREADS - err = clEnqueueNDRangeKernel( queue, kernel[0], 1, NULL, threads, localThreads, 0, NULL, NULL ); -#else - err = clEnqueueNDRangeKernel( queue, kernel[0], 1, NULL, threads, NULL, 0, NULL, NULL ); -#endif - if( err != CL_SUCCESS ){ - print_error( err, "clEnqueueNDRangeKernel failed" ); - clReleaseProgram( program[0] ); - clReleaseKernel( kernel[0] ); - clReleaseMemObject( streams[0] ); - free( output_ptr ); - return -1; - } - - err = clEnqueueReadBuffer( queue, streams[0], true, 0, objSize*num_elements, (void *)output_ptr, 0, NULL, NULL ); - if( err != CL_SUCCESS){ - print_error( err, "clEnqueueReadBuffer failed" ); - clReleaseProgram( program[0] ); - clReleaseKernel( kernel[0] ); - clReleaseMemObject( streams[0] ); - free( output_ptr ); - return -1; - } - - if (verify_read_struct(output_ptr, num_elements)){ - log_error(" struct test failed\n"); - err = -1; - } - else{ - log_info(" struct test passed\n"); - err = 0; - } - - // cleanup - clReleaseProgram( program[0] ); - clReleaseKernel( kernel[0] ); - clReleaseMemObject( streams[0] ); - free( output_ptr ); - - return err; -} -*/ - - diff --git a/test_conformance/profiling/readImage.c b/test_conformance/profiling/readImage.cpp similarity index 93% rename from test_conformance/profiling/readImage.c rename to test_conformance/profiling/readImage.cpp index e7fec12f..191044e1 100644 --- a/test_conformance/profiling/readImage.c +++ b/test_conformance/profiling/readImage.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -21,8 +21,8 @@ #include #include "procs.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/errorHelpers.h" +#include "harness/testHarness.h" +#include "harness/errorHelpers.h" //--- the code for the kernel executables static const char *readKernelCode[] = { @@ -130,9 +130,6 @@ int read_image( cl_device_id device, cl_context context, cl_command_queue queue, cl_event readEvent; cl_ulong queueStart, submitStart, readStart, readEnd; size_t threads[2]; -#ifdef USE_LOCAL_THREADS - size_t localThreads[2]; -#endif int err; int w = 64, h = 64; cl_mem_flags flags; @@ -150,16 +147,6 @@ int read_image( cl_device_id device, cl_context context, cl_command_queue queue, threads[0] = (size_t)w; threads[1] = (size_t)h; -#ifdef USE_LOCAL_THREADS - err = clGetDeviceConfigInfo( id, CL_DEVICE_MAX_THREAD_GROUP_SIZE, localThreads, sizeof( unsigned int ), NULL ); - test_error( err, "Unable to get thread group max size" ); - localThreads[1] = localThreads[0]; - if( localThreads[0] > threads[0] ) - localThreads[0] = threads[0]; - if( localThreads[1] > threads[1] ) - localThreads[1] = threads[1]; -#endif - d = init_genrand( gRandomSeed ); if( image_format_desc.image_channel_data_type == CL_SIGNED_INT8 ) inptr = (void *)generateSignedImage( w * h * 4, d ); @@ -231,11 +218,8 @@ int read_image( cl_device_id device, cl_context context, cl_command_queue queue, return -1; } -#ifdef USE_LOCAL_THREADS - err = clEnqueueNDRangeKernel(queue, kernel[0], 2, NULL, threads, localThreads, 0, NULL, NULL ); -#else err = clEnqueueNDRangeKernel(queue, kernel[0], 2, NULL, threads, NULL, 0, NULL, NULL ); -#endif + if( err != CL_SUCCESS ){ print_error( err, "clEnqueueNDRangeKernel failed" ); clReleaseKernel( kernel[0] ); diff --git a/test_conformance/profiling/writeArray.c b/test_conformance/profiling/writeArray.cpp similarity index 87% rename from test_conformance/profiling/writeArray.c rename to test_conformance/profiling/writeArray.cpp index a984a125..1455c1e3 100644 --- a/test_conformance/profiling/writeArray.c +++ b/test_conformance/profiling/writeArray.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -21,11 +21,9 @@ #include #include "procs.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/conversions.h" - -//#define USE_LOCAL_THREADS 1 +#include "harness/testHarness.h" +#include "harness/errorHelpers.h" +#include "harness/conversions.h" #ifndef uchar typedef unsigned char uchar; @@ -621,24 +619,11 @@ int test_stream_write( cl_device_id device, cl_context context, cl_command_queue cl_ulong queueStart, submitStart, writeStart, writeEnd; size_t ptrSizes[5], outPtrSizes[5]; size_t threads[1]; -#ifdef USE_LOCAL_THREADS - size_t localThreads[1]; -#endif int err, err_count = 0; int i, ii; threads[0] = (size_t)num_elements; -#ifdef USE_LOCAL_THREADS - err = clGetDeviceConfigInfo( id, CL_DEVICE_MAX_THREAD_GROUP_SIZE, localThreads, sizeof( cl_uint ), NULL ); - if( err != CL_SUCCESS ){ - print_error( err, " Unable to get thread group max size" ); - return -1; - } - if( localThreads[0] > threads[0] ) - localThreads[0] = threads[0]; -#endif - ptrSizes[0] = size; ptrSizes[1] = ptrSizes[0] << 1; ptrSizes[2] = ptrSizes[1] << 1; @@ -764,11 +749,8 @@ int test_stream_write( cl_device_id device, cl_context context, cl_command_queue return -1; } -#ifdef USE_LOCAL_THREADS - err = clEnqueueNDRangeKernel( queue, kernel[i], 1, NULL, threads, localThreads, 0, NULL, NULL ); -#else err = clEnqueueNDRangeKernel( queue, kernel[i], 1, NULL, threads, NULL, 0, NULL, NULL ); -#endif + if( err != CL_SUCCESS ){ print_error( err, " clEnqueueNDRangeKernel failed" ); clReleaseEvent(writeEvent); @@ -813,7 +795,7 @@ int test_stream_write( cl_device_id device, cl_context context, cl_command_queue } if( !err2 ) { - log_info( " %s%d data verified\n", type, 1< threads[0] ) - localThreads[0] = threads[0]; - #endif - - ptrSizes[0] = size; - ptrSizes[1] = ptrSizes[0] << 1; - ptrSizes[2] = ptrSizes[1] << 1; - ptrSizes[3] = ptrSizes[2] << 1; - ptrSizes[4] = ptrSizes[3] << 1; - - - loops = ( loops < 5 ? loops : 5 ); - for( i = 0; i < loops; i++ ){ - - inptr[i] = (TestStruct *)malloc(ptrSizes[i] * num_elements); - - for( j = 0; j < ptrSizes[i] * num_elements / ptrSizes[0]; j++ ){ - inptr[i][j].a = (int)random_float( -2147483648.f, 2147483647.0f ); - inptr[i][j].b = random_float( -FLT_MAX, FLT_MAX ); - } - - ii = i << 1; - streams[ii] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_READ_WRITE), ptrSizes[i] * num_elements, NULL); - if( ! streams[ii] ){ - free( outptr[i] ); - log_error( " clCreateBuffer failed\n" ); - return -1; - } - outptr[i] = malloc( ptrSizes[i] * num_elements ); - streams[ii+1] = clCreateBuffer( context, (cl_mem_flags)(CL_MEM_READ_WRITE), ptrSizes[i] * num_elements, NULL); - if( ! streams[ii+1] ){ - clReleaseMemObject(streams[ii]); - free( outptr[i] ); - log_error( " clCreateBuffer failed\n" ); - return -1; - } - - err = clWriteArray(context, streams[ii], false, 0, ptrSizes[i]*num_elements, inptr[i], NULL); - if( err != CL_SUCCESS ){ - clReleaseMemObject(streams[ii]); - clReleaseMemObject(streams[ii+1]); - free( outptr[i] ); - print_error( err, " clWriteArray failed" ); - return -1; - } - - err = create_program_and_kernel( device, struct_kernel_code, "read_write_struct", &program[i], &kernel[i] ); - if( err ){ - clReleaseMemObject(streams[ii]); - clReleaseMemObject(streams[ii+1]); - free( outptr[i] ); - log_error( " Error creating program for struct\n" ); - return -1; - } - - err = clSetKernelArg( kernel[i], 0, sizeof( cl_mem ), (void *)&streams[ii] ); - err |= clSetKernelArg( kernel[i], 1, sizeof( cl_mem ), (void *)&streams[ii+1] ); - if (err != CL_SUCCESS){ - clReleaseProgram( program[i] ); - clReleaseKernel( kernel[i] ); - clReleaseMemObject( streams[ii] ); - clReleaseMemObject( streams[ii+1] ); - free( outptr[i] ); - print_error( err, " clSetKernelArg failed" ); - return -1; - } - - #ifdef USE_LOCAL_THREADS - err = clEnqueueNDRangeKernel( queue, kernel[i], 1, NULL, threads, localThreads, 0, NULL, NULL ); - #else - err = clEnqueueNDRangeKernel( queue, kernel[i], 1, NULL, threads, NULL, 0, NULL, NULL ); - #endif - if( err != CL_SUCCESS ){ - print_error( err, " clEnqueueNDRangeKernel failed" ); - clReleaseMemObject( streams[ii] ); - clReleaseMemObject( streams[ii+1] ); - clReleaseKernel( kernel[i] ); - clReleaseProgram( program[i] ); - free( outptr[i] ); - return -1; - } - - err = clEnqueueReadBuffer( queue, streams[ii+1], true, 0, ptrSizes[i]*num_elements, outptr[i], 0, NULL, NULL ); - if( err != CL_SUCCESS ){ - clReleaseMemObject( streams[ii] ); - clReleaseMemObject( streams[ii+1] ); - clReleaseKernel( kernel[i] ); - clReleaseProgram( program[i] ); - free( outptr[i] ); - print_error( err, " clEnqueueReadBuffer failed" ); - return -1; - } - - if( verify_write_struct( inptr[i], outptr[i], ptrSizes[i] * num_elements / ptrSizes[0] ) ){ - log_error( " STREAM_WRITE struct%d test failed\n", 1< #include @@ -21,8 +21,8 @@ #include #include "procs.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/errorHelpers.h" +#include "harness/testHarness.h" +#include "harness/errorHelpers.h" //--- the code for the kernel executables static const char *readKernelCode[] = { @@ -413,9 +413,6 @@ int write_image( cl_device_id device, cl_context context, cl_command_queue queue cl_event writeEvent; cl_ulong queueStart, submitStart, writeStart, writeEnd; size_t threads[2]; -#ifdef USE_LOCAL_THREADS - size_t localThreads[2]; -#endif int err; int w = 64, h = 64; cl_mem_flags flags; @@ -436,16 +433,6 @@ int write_image( cl_device_id device, cl_context context, cl_command_queue queue threads[0] = (size_t)w; threads[1] = (size_t)h; -#ifdef USE_LOCAL_THREADS - err = clGetDeviceConfigInfo( id, CL_DEVICE_MAX_THREAD_GROUP_SIZE, localThreads, sizeof( unsigned int ), NULL ); - test_error( err, "Unable to get thread group max size" ); - localThreads[1] = localThreads[0]; - if( localThreads[0] > threads[0] ) - localThreads[0] = threads[0]; - if( localThreads[1] > threads[1] ) - localThreads[1] = threads[1]; -#endif - d = init_genrand( gRandomSeed ); if( image_format_desc.image_channel_data_type == CL_SIGNED_INT8 ) inptr = (void *)generateSignedImage( w * h * 4, d ); @@ -581,11 +568,8 @@ int write_image( cl_device_id device, cl_context context, cl_command_queue queue return -1; } -#ifdef USE_LOCAL_THREADS - err = clEnqueueNDRangeKernel(queue, kernel[0], 2, NULL, threads, localThreads, 0, NULL, NULL ); -#else err = clEnqueueNDRangeKernel(queue, kernel[0], 2, NULL, threads, NULL, 0, NULL, NULL ); -#endif + if( err != CL_SUCCESS ){ print_error( err, "clEnqueueNDRangeKernel failed" ); clReleaseEvent(writeEvent); diff --git a/test_conformance/relationals/CMakeLists.txt b/test_conformance/relationals/CMakeLists.txt index 81da7d2d..ecaa056c 100644 --- a/test_conformance/relationals/CMakeLists.txt +++ b/test_conformance/relationals/CMakeLists.txt @@ -1,20 +1,11 @@ set(MODULE_NAME RELATIONALS) set(${MODULE_NAME}_SOURCES - main.c + main.cpp test_relationals.cpp test_comparisons_float.cpp test_comparisons_double.cpp test_shuffles.cpp - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/threadTesting.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/mt19937.c - ../../test_common/harness/conversions.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c ) include(../CMakeCommon.txt) diff --git a/test_conformance/relationals/main.c b/test_conformance/relationals/main.cpp similarity index 95% rename from test_conformance/relationals/main.c rename to test_conformance/relationals/main.cpp index d91c2ae3..ec495c89 100644 --- a/test_conformance/relationals/main.c +++ b/test_conformance/relationals/main.cpp @@ -13,12 +13,12 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include #include "procs.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" #if !defined(_WIN32) #include diff --git a/test_conformance/relationals/procs.h b/test_conformance/relationals/procs.h index 5ee78b8a..80000ef4 100644 --- a/test_conformance/relationals/procs.h +++ b/test_conformance/relationals/procs.h @@ -13,12 +13,12 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/threadTesting.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/mt19937.h" +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" +#include "harness/threadTesting.h" +#include "harness/typeWrappers.h" +#include "harness/conversions.h" +#include "harness/mt19937.h" // The number of errors to print out for each test in the shuffle tests #define MAX_ERRORS_TO_PRINT 1 diff --git a/test_conformance/relationals/testBase.h b/test_conformance/relationals/testBase.h index 5073b21f..5b49bfd7 100644 --- a/test_conformance/relationals/testBase.h +++ b/test_conformance/relationals/testBase.h @@ -16,7 +16,7 @@ #ifndef _testBase_h #define _testBase_h -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/relationals/test_comparisons_double.cpp b/test_conformance/relationals/test_comparisons_double.cpp index 21d4d575..9dc737fd 100644 --- a/test_conformance/relationals/test_comparisons_double.cpp +++ b/test_conformance/relationals/test_comparisons_double.cpp @@ -14,10 +14,8 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" - -extern "C" { extern cl_uint gRandomSeed; }; +#include "harness/conversions.h" +#include "harness/typeWrappers.h" #define TEST_SIZE 512 diff --git a/test_conformance/relationals/test_comparisons_float.cpp b/test_conformance/relationals/test_comparisons_float.cpp index 76b31989..e8178d84 100644 --- a/test_conformance/relationals/test_comparisons_float.cpp +++ b/test_conformance/relationals/test_comparisons_float.cpp @@ -14,10 +14,8 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" - -extern "C" { extern cl_uint gRandomSeed;}; +#include "harness/conversions.h" +#include "harness/typeWrappers.h" #define TEST_SIZE 512 @@ -63,7 +61,7 @@ const char *equivTestKernelPatternLessGreater_float3 = "}\n"; typedef bool (*equivVerifyFn)( float inDataA, float inDataB ); -extern "C" { extern int gInfNanSupport; }; +extern int gInfNanSupport; int IsFloatInfinity(float x) { diff --git a/test_conformance/relationals/test_relationals.cpp b/test_conformance/relationals/test_relationals.cpp index 9542b851..70952409 100644 --- a/test_conformance/relationals/test_relationals.cpp +++ b/test_conformance/relationals/test_relationals.cpp @@ -14,9 +14,9 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/conversions.h" +#include "harness/typeWrappers.h" +#include "harness/testHarness.h" const char *anyAllTestKernelPattern = "%s\n" // optional pragma @@ -38,8 +38,6 @@ const char *anyAllTestKernelPatternVload = #define TEST_SIZE 512 -extern "C" {extern cl_uint gRandomSeed;}; - typedef int (*anyAllVerifyFn)( ExplicitType vecType, unsigned int vecSize, void *inData ); int test_any_all_kernel(cl_context context, cl_command_queue queue, diff --git a/test_conformance/relationals/test_shuffles.cpp b/test_conformance/relationals/test_shuffles.cpp index 81465fc1..c784b650 100644 --- a/test_conformance/relationals/test_shuffles.cpp +++ b/test_conformance/relationals/test_shuffles.cpp @@ -14,9 +14,9 @@ // limitations under the License. // #include "testBase.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/conversions.h" +#include "harness/typeWrappers.h" +#include "harness/testHarness.h" // #define USE_NEW_SYNTAX 1 // The number of shuffles to test per test @@ -36,8 +36,6 @@ enum ShuffleMode kBuiltInDualInputFnMode }; -extern "C" { extern cl_uint gRandomSeed;}; - static const char *shuffleKernelPattern[3] = { "__kernel void sample_test( __global %s%s *source, __global %s%s *dest )\n" "{\n" diff --git a/test_conformance/select/CMakeLists.txt b/test_conformance/select/CMakeLists.txt index 97bd24b2..285bd59e 100644 --- a/test_conformance/select/CMakeLists.txt +++ b/test_conformance/select/CMakeLists.txt @@ -1,15 +1,8 @@ set(MODULE_NAME SELECT) set(${MODULE_NAME}_SOURCES - test_select.c - util_select.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/mt19937.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c + test_select.cpp + util_select.cpp ) include(../CMakeCommon.txt) diff --git a/test_conformance/select/test_select.c b/test_conformance/select/test_select.cpp similarity index 97% rename from test_conformance/select/test_select.c rename to test_conformance/select/test_select.cpp index 0224394c..da136b48 100644 --- a/test_conformance/select/test_select.c +++ b/test_conformance/select/test_select.cpp @@ -13,24 +13,24 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include #include #include #if ! defined( _WIN32) -#if ! defined( __ANDROID__ ) +#if defined(__APPLE__) #include #endif #endif #include #include "test_select.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/mt19937.h" -#include "../../test_common/harness/parseParameters.h" +#include "harness/testHarness.h" +#include "harness/kernelHelpers.h" +#include "harness/mt19937.h" +#include "harness/parseParameters.h" //----------------------------------------- @@ -278,8 +278,11 @@ static cl_program makeSelectProgram(cl_kernel *kernel_ptr, const cl_context cont // create program cl_program program; + const char **psrc = vec_len == 3 ? sourceV3 : source; + size_t src_size = vec_len == 3 ? ARRAY_SIZE(sourceV3) : ARRAY_SIZE(source); - if (create_single_kernel_helper(context, &program, kernel_ptr, (cl_uint)(vec_len == 3 ? sizeof(sourceV3) / sizeof(sourceV3[0]) : sizeof(source) / sizeof(source[0])), vec_len == 3 ? sourceV3 : source, testname)) + if (create_single_kernel_helper(context, &program, kernel_ptr, src_size, + psrc, testname)) { log_error("Failed to build program (%d)\n", err); return NULL; @@ -340,6 +343,7 @@ static int doTest(cl_command_queue queue, cl_context context, Type stype, Type c programs[vecsize] = makeSelectProgram(&kernels[vecsize], context, stype, cmptype, element_count[vecsize] ); if (!programs[vecsize] || !kernels[vecsize]) { ++s_test_fail; + ++s_test_cnt; return -1; } } @@ -573,8 +577,16 @@ test_definition test_list[] = { const int test_num = ARRAY_SIZE( test_list ); -int main(int argc, char* argv[]) +int main(int argc, const char* argv[]) { + test_start(); + + argc = parseCustomParam(argc, argv); + if (argc == -1) + { + return EXIT_FAILURE; + } + const char ** argList = (const char **)calloc( argc, sizeof( char*) ); if( NULL == argList ) @@ -653,3 +665,4 @@ static void printUsage( void ) log_info( "\t%s\n", test_list[i].name ); } } + diff --git a/test_conformance/select/test_select.h b/test_conformance/select/test_select.h index a0edcf29..c51ae13c 100644 --- a/test_conformance/select/test_select.h +++ b/test_conformance/select/test_select.h @@ -16,7 +16,7 @@ #ifndef TESTSELECTS_INCLUDED_H #define TESTSELECTS_INCLUDED_H -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -27,22 +27,6 @@ #include #endif -// Enable the test to be used with ATF -#if USE_ATF -// export BUILD_WITH_ATF=1 -#include -#define test_start() ATFTestStart() -#define log_info ATFLogInfo -#define log_error ATFLogError -#define test_finish() ATFTestFinish() -#else -#define test_start() -#define log_info printf -#define log_error printf -#define test_finish() -#endif // USE_ATF - - // Defines the set of types we support (no support for double) typedef enum { kuchar = 0, diff --git a/test_conformance/select/util_select.c b/test_conformance/select/util_select.cpp similarity index 99% rename from test_conformance/select/util_select.c rename to test_conformance/select/util_select.cpp index 59a9dc82..71c58bc2 100644 --- a/test_conformance/select/util_select.c +++ b/test_conformance/select/util_select.cpp @@ -13,7 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" +#include "harness/errorHelpers.h" #include #include "test_select.h" diff --git a/test_conformance/spir/CMakeLists.txt b/test_conformance/spir/CMakeLists.txt index 819fadf9..70effa15 100644 --- a/test_conformance/spir/CMakeLists.txt +++ b/test_conformance/spir/CMakeLists.txt @@ -1,49 +1,66 @@ -function (install_spir_artifacts suite_name) - install(FILES "${suite_name}.zip" DESTINATION ${CLConf_OUT_DIR}/spir) -endfunction() - -include_directories(${CLConf_SRC_DIR}/test_common) - # Import function list from math_brute_force add_definitions(-DFUNCTION_LIST_ULPS_ONLY) -clconf_add_executable( - test_spir +set(SPIR_OUT ${CONFORMANCE_PREFIX}spir${CONFORMANCE_SUFFIX}) + +set (SPIR_SOURCES main.cpp datagen.cpp run_build_test.cpp run_services.cpp kernelargs.cpp - ../math_brute_force/FunctionList.c) - -target_link_libraries( - test_spir${CLConf_SUFFIX} - miniz${CLConf_SUFFIX} + ../math_brute_force/FunctionList.cpp ) -install_spir_artifacts(api) -install_spir_artifacts(atomics) -install_spir_artifacts(basic) -install_spir_artifacts(compile_and_link) -install_spir_artifacts(commonfns) -install_spir_artifacts(conversions) -install_spir_artifacts(geometrics) -install_spir_artifacts(enum_values) -install_spir_artifacts(half) -install_spir_artifacts(kernel_attributes) -install_spir_artifacts(kernel_image_methods) -install_spir_artifacts(images_kernel_read_write) -install_spir_artifacts(images_samplerlessRead) -install_spir_artifacts(integer_ops) -install_spir_artifacts(math_brute_force) -install_spir_artifacts(printf) -install_spir_artifacts(profiling) -install_spir_artifacts(relationals) -install_spir_artifacts(select) -install_spir_artifacts(sampler_enumeration) -install_spir_artifacts(vec_align) -install_spir_artifacts(vec_step) -install_spir_artifacts(binary_type) -install(FILES "khr.csv" DESTINATION ${CLConf_OUT_DIR}/spir) -#Add any other runtime directories you need here. -# end of file # +add_executable(${SPIR_OUT} + ${SPIR_SOURCES}) + +if(UNIX) + set_target_properties(${SPIR_OUT} PROPERTIES + COMPILE_FLAGS "-fexceptions -frtti") +elseif(MSVC) + set_target_properties(${SPIR_OUT} PROPERTIES + COMPILE_FLAGS "/GR /EHs /EHc") +endif() + +TARGET_LINK_LIBRARIES(${SPIR_OUT} harness + ${CLConform_LIBRARIES}) + + +set_source_files_properties(${SPIR_SOURCES} PROPERTIES LANGUAGE CXX) + +# Need to copy the spir zips to sit beside the executable + +set(SPIR_FILES + "khr.csv" + "api.zip" + "atomics.zip" + "basic.zip" + "compile_and_link.zip" + "commonfns.zip" + "conversions.zip" + "geometrics.zip" + "enum_values.zip" + "half.zip" + "kernel_attributes.zip" + "kernel_image_methods.zip" + "images_kernel_read_write.zip" + "images_samplerlessRead.zip" + "integer_ops.zip" + "math_brute_force.zip" + "printf.zip" + "profiling.zip" + "relationals.zip" + "select.zip" + "sampler_enumeration.zip" + "vec_align.zip" + "vec_step.zip" + "binary_type.zip") + +foreach(input_file ${SPIR_FILES}) + add_custom_command( + TARGET ${SPIR_OUT} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/${input_file}" "$/" +) +endforeach(input_file) diff --git a/test_conformance/spir/api.zip b/test_conformance/spir/api.zip index 1d3f67f8..ab804860 100644 Binary files a/test_conformance/spir/api.zip and b/test_conformance/spir/api.zip differ diff --git a/test_conformance/spir/datagen.cpp b/test_conformance/spir/datagen.cpp index 1bd21fa6..ffd05c35 100644 --- a/test_conformance/spir/datagen.cpp +++ b/test_conformance/spir/datagen.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include "exceptions.h" #include "datagen.h" @@ -93,38 +93,6 @@ void DataGenerator::setArgGenerator(const KernelArgInfo& argInfo, m_argGenerators[argInfo.getTypeName()] = pGen; } -float get_random_float(float low, float high, MTdata d) -{ - float t = (float)((double)genrand_int32(d) / (double)0xFFFFFFFF); - return (1.0f - t) * low + t * high; -} - -double get_random_double(double low, double high, MTdata d) -{ - cl_ulong u = (cl_ulong) genrand_int32(d) | ((cl_ulong) genrand_int32(d) << 32 ); - double t = (double) u * MAKE_HEX_DOUBLE( 0x1.0p-64, 0x1, -64); - return (1.0f - t) * low + t * high; -} - -size_t get_random_size_t(size_t low, size_t high, MTdata d) -{ - enum { N = sizeof(size_t)/sizeof(int) }; - - union { - int word[N]; - size_t size; - } u; - - for (unsigned i=0; i != N; ++i) { - u.word[i] = genrand_int32(d); - } - - assert(low <= high && "Invalid random number range specified"); - size_t range = high - low; - - return (range) ? low + ((u.size - low) % range) : low; -} - size_t get_random_int32(int low, int high, MTdata d) { int v = genrand_int32(d); diff --git a/test_conformance/spir/datagen.h b/test_conformance/spir/datagen.h index 3b8ba5b8..cf620466 100644 --- a/test_conformance/spir/datagen.h +++ b/test_conformance/spir/datagen.h @@ -16,7 +16,7 @@ #ifndef __DATAGEN_H #define __DATAGEN_H -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include @@ -27,7 +27,7 @@ #include #include -#include "../../test_common/harness/mt19937.h" +#include "harness/mt19937.h" #include "exceptions.h" #include "kernelargs.h" @@ -274,20 +274,16 @@ public: if (CL_SUCCESS != error) throw Exceptions::TestError("clGetSupportedImageFormats failed\n", error); - std::auto_ptr supportedFormats(new cl_image_format[actualNumFormats]); - error = clGetSupportedImageFormats( - context, - flags, - m_desc.image_type, - actualNumFormats, - supportedFormats.get(), - NULL); + std::vector supportedFormats(actualNumFormats); + error = clGetSupportedImageFormats(context, flags, m_desc.image_type, + actualNumFormats, + supportedFormats.data(), NULL); if (CL_SUCCESS != error) throw Exceptions::TestError("clGetSupportedImageFormats failed\n", error); for (size_t i=0; i -#include "../../test_common/miniz/miniz.h" +#include "miniz/miniz.h" namespace Exceptions { diff --git a/test_conformance/spir/images_samplerlessRead.zip b/test_conformance/spir/images_samplerlessRead.zip index bb3e9993..2d7420c0 100644 Binary files a/test_conformance/spir/images_samplerlessRead.zip and b/test_conformance/spir/images_samplerlessRead.zip differ diff --git a/test_conformance/spir/kernelargs.cpp b/test_conformance/spir/kernelargs.cpp index d9a216ee..228dc00f 100644 --- a/test_conformance/spir/kernelargs.cpp +++ b/test_conformance/spir/kernelargs.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include "kernelargs.h" #include "datagen.h" diff --git a/test_conformance/spir/kernelargs.h b/test_conformance/spir/kernelargs.h index 6ba6e8e7..2aa86d7a 100644 --- a/test_conformance/spir/kernelargs.h +++ b/test_conformance/spir/kernelargs.h @@ -29,7 +29,7 @@ #include #include -#include "../../test_common/harness/typeWrappers.h" +#include "harness/typeWrappers.h" #include "exceptions.h" diff --git a/test_conformance/spir/main.cpp b/test_conformance/spir/main.cpp index b44c8cbc..5634d5b6 100644 --- a/test_conformance/spir/main.cpp +++ b/test_conformance/spir/main.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -23,10 +23,10 @@ #include #include -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/os_helpers.h" +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" +#include "harness/typeWrappers.h" +#include "harness/os_helpers.h" #include "exceptions.h" #include "run_build_test.h" @@ -34,7 +34,7 @@ #include #include -#include "../../test_common/miniz/miniz.h" +#include "miniz/miniz.h" #if defined(_WIN32) #include @@ -147,8 +147,8 @@ static void get_spir_version(cl_device_id device, std::vector& versions) cl_int err; size_t size = 0; - if (err = clGetDeviceInfo(device, CL_DEVICE_SPIR_VERSIONS, sizeof(version), - (void*)version, &size)) + if ((err = clGetDeviceInfo(device, CL_DEVICE_SPIR_VERSIONS, sizeof(version), + (void *)version, &size))) { log_error( "Error: failed to obtain SPIR version at %s:%d (err = %d)\n", __FILE__, __LINE__, err ); diff --git a/test_conformance/spir/run_build_test.cpp b/test_conformance/spir/run_build_test.cpp index 71fd8dbc..cec2d275 100644 --- a/test_conformance/spir/run_build_test.cpp +++ b/test_conformance/spir/run_build_test.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #ifdef __APPLE__ #include @@ -27,11 +27,11 @@ #include #include -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/clImageHelper.h" -#include "../../test_common/harness/os_helpers.h" +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" +#include "harness/typeWrappers.h" +#include "harness/clImageHelper.h" +#include "harness/os_helpers.h" #include "exceptions.h" #include "kernelargs.h" @@ -268,7 +268,7 @@ static bool run_test(cl_context context, cl_command_queue queue, cl_program clpr { WorkSizeInfo ws; TestResult cl_result; - std::auto_ptr bc_result; + std::unique_ptr bc_result; // first, run the single CL test { // make sure that the kernel will be released before the program diff --git a/test_conformance/spir/run_services.cpp b/test_conformance/spir/run_services.cpp index cefae082..06fc418d 100644 --- a/test_conformance/spir/run_services.cpp +++ b/test_conformance/spir/run_services.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #ifdef __APPLE__ #include @@ -27,6 +27,7 @@ #include #include #include +#include #include "exceptions.h" #include "datagen.h" @@ -99,7 +100,8 @@ void get_kernel_name (const char *test_name, std::string &kernel_name) kernel_name.assign(temp_str); } -extern "C" void CL_CALLBACK notify_callback(const char *errInfo, const void *privateInfo, size_t cb, void *userData); +void CL_CALLBACK notify_callback(const char* errInfo, const void* privateInfo, + size_t cb, void* userData); void create_context_and_queue(cl_device_id device, cl_context *out_context, cl_command_queue *out_queue) { @@ -114,7 +116,7 @@ void create_context_and_queue(cl_device_id device, cl_context *out_context, cl_c throw Exceptions::TestError("clCreateContext failed\n", error); } - *out_queue = clCreateCommandQueueWithProperties( *out_context, device, 0, &error ); + *out_queue = clCreateCommandQueue( *out_context, device, 0, &error ); if( NULL == *out_queue || error ) { throw Exceptions::TestError("clCreateCommandQueue failed\n", error); @@ -300,18 +302,11 @@ const std::string& DataRow::operator[](int column)const std::string& DataRow::operator[](int column) { - assert((column > -1) && "Index out of bound"); + assert((column > -1 && (size_t)column <= m_row.size()) + && "Index out of bound"); + if ((size_t)column == m_row.size()) m_row.push_back(""); - if ((size_t)column < m_row.size()) - return m_row[column]; - - if (column == m_row.size()) - { - m_row.push_back(""); - return m_row[column]; - } - - assert(0 && "Index out of bound."); + return m_row[column]; } /* @@ -345,15 +340,19 @@ DataRow& DataTable::operator[](int index) */ OclExtensions OclExtensions::getDeviceCapabilities(cl_device_id devId) { - char extensions[1024] = {0}; size_t size; - + size_t set_size; + cl_int errcode = clGetDeviceInfo(devId, CL_DEVICE_EXTENSIONS, 0, NULL, &set_size); + if (errcode) + throw Exceptions::TestError("Device query failed"); // Querying the device for its supported extensions - cl_int errcode = clGetDeviceInfo(devId, - CL_DEVICE_EXTENSIONS, - sizeof(extensions), - extensions, - &size); + std::vector extensions(set_size); + errcode = clGetDeviceInfo(devId, + CL_DEVICE_EXTENSIONS, + extensions.size(), + extensions.data(), + &size); + if (errcode) throw Exceptions::TestError("Device query failed"); @@ -367,13 +366,13 @@ OclExtensions OclExtensions::getDeviceCapabilities(cl_device_id devId) throw Exceptions::TestError("Device query failed"); OclExtensions ret = OclExtensions::empty(); - assert(size < sizeof(extensions)); + assert(size == set_size); if (!size) return ret; // Iterate over the extensions, and convert them into the bit field. std::list extVector; - std::stringstream khrStream(extensions); + std::stringstream khrStream(extensions.data()); std::copy(std::istream_iterator(khrStream), std::istream_iterator(), std::back_inserter(extVector)); diff --git a/test_conformance/spir/sampler_enumeration.zip b/test_conformance/spir/sampler_enumeration.zip index 4fe2c775..5f8a7a06 100644 Binary files a/test_conformance/spir/sampler_enumeration.zip and b/test_conformance/spir/sampler_enumeration.zip differ diff --git a/test_conformance/spirv_new/CMakeLists.txt b/test_conformance/spirv_new/CMakeLists.txt new file mode 100644 index 00000000..614d5a79 --- /dev/null +++ b/test_conformance/spirv_new/CMakeLists.txt @@ -0,0 +1,26 @@ +###################################################################################################### +#Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. +# +#This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +#This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +#third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +#broadcast or otherwise exploited in any manner without the express prior written permission +#of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +#disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +#in whole or in part other than under the terms of the Khronos Adopters Agreement +#or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +###################################################################################################### + +set(MODULE_NAME SPIRV_NEW) +set(CMAKE_CXX_STANDARD 11) + +file(GLOB SPIRV_NEW_SOURCES "*.cpp") + +set(TEST_HARNESS_SOURCES + ../../test_conformance/math_brute_force/reference_math.cpp + ../../test_conformance/math_brute_force/Utility.cpp + ) + +set(${MODULE_NAME}_SOURCES ${SPIRV_NEW_SOURCES} ${TEST_HARNESS_SOURCES}) + +include(../CMakeCommon.txt) diff --git a/test_conformance/spirv_new/README.txt b/test_conformance/spirv_new/README.txt new file mode 100644 index 00000000..0b4f2095 --- /dev/null +++ b/test_conformance/spirv_new/README.txt @@ -0,0 +1,13 @@ +test_conformance/spirv_new README +================================== + +The text versions of the spirv files are present in `conformance-tests/test_conformance/spriv_new/spirv_asm`. +These text files have been used to generate the binaries in `spirv_bin` using the assembler from `spirv-tools`. + +The absolute path to `spirv_bin` needs to be passed after `--spirv-binaries-path` token for the test to find the SPIRV binaries. + +An example invocation looks like the following: + +``` +./test_conformance/spirv_new/test_conformance_spirv_new --spirv-binaries-path /home/user/workspace/conformance-tests/test_conformance/spirv_new/spirv_bin/ [other options] +``` diff --git a/test_conformance/spirv_new/main.cpp b/test_conformance/spirv_new/main.cpp new file mode 100644 index 00000000..68a1e02a --- /dev/null +++ b/test_conformance/spirv_new/main.cpp @@ -0,0 +1,264 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include +#include +#include "procs.h" +#if !defined(_WIN32) +#include +#endif + +#include +#include +#include +#include + +#if defined(_WIN32) +const std::string slash = "\\"; +#else +const std::string slash = "/"; +#endif + +const std::string spvExt = ".spv"; +std::string gAddrWidth = ""; +std::string spvBinariesPath = "spirv_bin"; +std::string spvBinariesPathArg = "--spirv-binaries-path"; + +std::vector readBinary(const char *file_name) +{ + using namespace std; + + ifstream file(file_name, ios::in | ios::binary | ios::ate); + + std::vector tmpBuffer(0); + + if (file.is_open()) { + size_t size = file.tellg(); + tmpBuffer.resize(size); + file.seekg(0, ios::beg); + file.read(&tmpBuffer[0], size); + file.close(); + } else { + log_error("File %s not found\n", file_name); + } + + std::vector result(tmpBuffer.begin(), tmpBuffer.end()); + + return result; +} + + +std::vector readSPIRV(const char *file_name) +{ + std::string full_name_str = spvBinariesPath + slash + file_name + spvExt + gAddrWidth; + return readBinary(full_name_str.c_str()); +} + +test_definition *spirvTestsRegistry::getTestDefinitions() +{ + return &testDefinitions[0]; +} + +size_t spirvTestsRegistry::getNumTests() +{ + return testDefinitions.size(); +} + +void spirvTestsRegistry::addTestClass(baseTestClass *test, const char *testName, + Version version) +{ + + testClasses.push_back(test); + test_definition testDef; + testDef.func = test->getFunction(); + testDef.name = testName; + testDef.min_version = Version(1, 2); + testDefinitions.push_back(testDef); +} + +spirvTestsRegistry& spirvTestsRegistry::getInstance() +{ + static spirvTestsRegistry instance; + return instance; +} + +static int offline_get_program_with_il(clProgramWrapper &prog, + const cl_device_id deviceID, + const cl_context context, + const char *prog_name) +{ + cl_int err = 0; + std::string outputTypeStr = "binary"; + std::string defaultScript = std::string("..") + slash + std::string("spv_to_binary.py"); + std::string outputFilename = spvBinariesPath + slash + std::string(prog_name); + std::string sourceFilename = outputFilename + spvExt; + + std::string scriptArgs = + sourceFilename + " " + + outputFilename + " " + + gAddrWidth + " " + + outputTypeStr + " " + + "-cl-std=CL2.0"; + + std::string scriptToRunString = defaultScript + scriptArgs; + + // execute script + log_info("Executing command: %s\n", scriptToRunString.c_str()); + fflush(stdout); + int returnCode = system(scriptToRunString.c_str()); + if (returnCode != 0) { + log_error("Command finished with error: 0x%x\n", returnCode); + return CL_COMPILE_PROGRAM_FAILURE; + } + + // read output file + std::vector buffer_vec = readBinary(outputFilename.c_str()); + size_t file_bytes = buffer_vec.size(); + if (file_bytes == 0) { + log_error("OfflinerCompiler: Failed to open binary file: %s", outputFilename.c_str()); + return -1; + } + + const unsigned char *buffer = &buffer_vec[0]; + cl_int status = 0; + prog = clCreateProgramWithBinary(context, 1, &deviceID, &file_bytes, &buffer, &status, &err); + SPIRV_CHECK_ERROR((err || status), "Failed to create program with clCreateProgramWithBinary"); + return err; +} + +int get_program_with_il(clProgramWrapper &prog, const cl_device_id deviceID, + const cl_context context, const char *prog_name, + spec_const spec_const_def) +{ + cl_int err = 0; + if (gCompilationMode == kBinary) + { + return offline_get_program_with_il(prog, deviceID, context, prog_name); + } + + std::vector buffer_vec = readSPIRV(prog_name); + + int file_bytes = buffer_vec.size(); + if (file_bytes == 0) + { + log_error("File %s not found\n", prog_name); + return -1; + } + + unsigned char *buffer = &buffer_vec[0]; + if (gCoreILProgram) + { + prog = clCreateProgramWithIL(context, buffer, file_bytes, &err); + SPIRV_CHECK_ERROR( + err, "Failed to create program with clCreateProgramWithIL"); + + if (spec_const_def.spec_value != NULL) + { + err = clSetProgramSpecializationConstant( + prog, spec_const_def.spec_id, spec_const_def.spec_size, + spec_const_def.spec_value); + SPIRV_CHECK_ERROR( + err, "Failed to run clSetProgramSpecializationConstant"); + } + } + else + { + cl_platform_id platform; + err = clGetDeviceInfo(deviceID, CL_DEVICE_PLATFORM, + sizeof(cl_platform_id), &platform, NULL); + SPIRV_CHECK_ERROR(err, + "Failed to get platform info with clGetDeviceInfo"); + clCreateProgramWithILKHR_fn clCreateProgramWithILKHR = NULL; + + clCreateProgramWithILKHR = (clCreateProgramWithILKHR_fn) + clGetExtensionFunctionAddressForPlatform( + platform, "clCreateProgramWithILKHR"); + if (clCreateProgramWithILKHR == NULL) + { + log_error( + "ERROR: clGetExtensionFunctionAddressForPlatform failed\n"); + return -1; + } + prog = clCreateProgramWithILKHR(context, buffer, file_bytes, &err); + SPIRV_CHECK_ERROR( + err, "Failed to create program with clCreateProgramWithILKHR"); + } + + err = clBuildProgram(prog, 1, &deviceID, NULL, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + return err; +} + +test_status InitCL(cl_device_id id) +{ + test_status spirv_status; + bool force = true; + spirv_status = check_spirv_compilation_readiness(id); + if (spirv_status != TEST_PASS) + { + return spirv_status; + } + + cl_uint address_bits; + cl_uint err = clGetDeviceInfo(id, CL_DEVICE_ADDRESS_BITS, sizeof(cl_uint), + &address_bits, NULL); + if (err != CL_SUCCESS) + { + log_error("clGetDeviceInfo failed to get address bits!"); + return TEST_FAIL; + } + + gAddrWidth = address_bits == 32 ? "32" : "64"; + return TEST_PASS; +} + +void printUsage() { + log_info("Reading SPIR-V files from default '%s' path.\n", spvBinariesPath.c_str()); + log_info("In case you want to set other directory use '%s' argument.\n", spvBinariesPathArg.c_str()); +} + +int main(int argc, const char *argv[]) +{ + gReSeed = 1; + bool modifiedSpvBinariesPath = false; + for (int i = 0; i < argc; ++i) { + int argsRemoveNum = 0; + if (argv[i] == spvBinariesPathArg) { + if (i + 1 == argc) { + log_error("Missing value for '%s' argument.\n", spvBinariesPathArg.c_str()); + return TEST_FAIL; + } else { + spvBinariesPath = std::string(argv[i + 1]); + argsRemoveNum += 2; + modifiedSpvBinariesPath = true; + } + } + + if (argsRemoveNum > 0) { + for (int j = i; j < (argc - argsRemoveNum); ++j) + argv[j] = argv[j + argsRemoveNum]; + + argc -= argsRemoveNum; + --i; + } + } + if (modifiedSpvBinariesPath == false) { + printUsage(); + } + + return runTestHarnessWithCheck( + argc, argv, spirvTestsRegistry::getInstance().getNumTests(), + spirvTestsRegistry::getInstance().getTestDefinitions(), false, 0, + InitCL); +} diff --git a/test_conformance/spirv_new/procs.h b/test_conformance/spirv_new/procs.h new file mode 100644 index 00000000..fd697a43 --- /dev/null +++ b/test_conformance/spirv_new/procs.h @@ -0,0 +1,100 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to +the Khronos Group, Inc. This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not +be disclosed in whole or in part to third parties, and may not be reproduced, +republished, distributed, transmitted, displayed, broadcast or otherwise +exploited in any manner without the express prior written permission of Khronos +Group. The receipt or possession of this code does not convey any rights to +reproduce, disclose, or distribute its contents, or to manufacture, use, or sell +anything that it may describe, in whole or in part other than under the terms of +the Khronos Adopters Agreement or Khronos Conformance Test Source License +Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#pragma once + +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" +#include "harness/typeWrappers.h" +#include "harness/conversions.h" +#include "harness/mt19937.h" +#include "harness/compat.h" +#include "harness/testHarness.h" +#include "harness/parseParameters.h" + +#include + +#define SPIRV_CHECK_ERROR(err, fmt, ...) \ + do \ + { \ + if (err == CL_SUCCESS) break; \ + log_error("%s(%d): Error %d\n" fmt "\n", __FILE__, __LINE__, err, \ + ##__VA_ARGS__); \ + return -1; \ + } while (0) + + +class baseTestClass { +public: + baseTestClass() {} + virtual basefn getFunction() = 0; +}; + +class spirvTestsRegistry { +private: + std::vector testClasses; + std::vector testDefinitions; + +public: + static spirvTestsRegistry &getInstance(); + + test_definition *getTestDefinitions(); + + size_t getNumTests(); + + void addTestClass(baseTestClass *test, const char *testName, + Version version); + spirvTestsRegistry() {} +}; + +template T *createAndRegister(const char *name, Version version) +{ + T *testClass = new T(); + spirvTestsRegistry::getInstance().addTestClass((baseTestClass *)testClass, + name, version); + return testClass; +} + +#define TEST_SPIRV_FUNC_VERSION(name, version) \ + extern int test_##name(cl_device_id deviceID, cl_context context, \ + cl_command_queue queue, int num_elements); \ + class test_##name##_class : public baseTestClass { \ + private: \ + basefn fn; \ + \ + public: \ + test_##name##_class(): fn(test_##name) {} \ + basefn getFunction() { return fn; } \ + }; \ + test_##name##_class *var_##name = \ + createAndRegister(#name, version); \ + int test_##name(cl_device_id deviceID, cl_context context, \ + cl_command_queue queue, int num_elements) + +#define TEST_SPIRV_FUNC(name) TEST_SPIRV_FUNC_VERSION(name, Version(2, 1)) + +struct spec_const +{ + spec_const(cl_int id = 0, size_t sizet = 0, const void *value = NULL) + : spec_id(id), spec_size(sizet), spec_value(value){}; + cl_int spec_id; + size_t spec_size; + const void *spec_value; +}; + +int get_program_with_il(clProgramWrapper &prog, const cl_device_id deviceID, + const cl_context context, const char *prog_name, + spec_const spec_const_def = spec_const()); +std::vector readSPIRV(const char *file_name); \ No newline at end of file diff --git a/test_conformance/spirv_new/spirv_asm/atomic_dec_global.spvasm32 b/test_conformance/spirv_new/spirv_asm/atomic_dec_global.spvasm32 new file mode 100644 index 00000000..4442255a --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/atomic_dec_global.spvasm32 @@ -0,0 +1,37 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 18 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "atomic_dec_global" %__spirv_GlobalInvocationId + OpName %__spirv_GlobalInvocationId "__spirv_GlobalInvocationId" + OpName %val "val" + OpName %counter "counter" + OpDecorate %__spirv_GlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_GlobalInvocationId Constant + OpDecorate %val FuncParamAttr NoCapture + OpDecorate %__spirv_GlobalInvocationId LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint + %uint_1 = OpConstant %uint 1 + %uint_512 = OpConstant %uint 512 +%__spirv_GlobalInvocationId = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %val = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %counter = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %13 = OpLabel + %14 = OpLoad %v3uint %__spirv_GlobalInvocationId Aligned 0 + %15 = OpCompositeExtract %uint %14 0 + %16 = OpAtomicIDecrement %uint %counter %uint_1 %uint_512 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %val %15 + OpStore %17 %16 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/atomic_dec_global.spvasm64 b/test_conformance/spirv_new/spirv_asm/atomic_dec_global.spvasm64 new file mode 100644 index 00000000..836a7af2 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/atomic_dec_global.spvasm64 @@ -0,0 +1,42 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 22 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "atomic_dec_global" %__spirv_GlobalInvocationId + OpName %__spirv_GlobalInvocationId "__spirv_GlobalInvocationId" + OpName %val "val" + OpName %counter "counter" + OpDecorate %__spirv_GlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_GlobalInvocationId Constant + OpDecorate %val FuncParamAttr NoCapture + OpDecorate %__spirv_GlobalInvocationId LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint + %uint_1 = OpConstant %uint 1 + %uint_512 = OpConstant %uint 512 + %ulong_32 = OpConstant %ulong 32 +%__spirv_GlobalInvocationId = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %11 + %val = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %counter = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %15 = OpLabel + %16 = OpLoad %v3ulong %__spirv_GlobalInvocationId Aligned 0 + %17 = OpCompositeExtract %ulong %16 0 + %18 = OpShiftLeftLogical %ulong %17 %ulong_32 + %19 = OpShiftRightArithmetic %ulong %18 %ulong_32 + %20 = OpAtomicIDecrement %uint %counter %uint_1 %uint_512 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %val %19 + OpStore %21 %20 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/atomic_inc_global.spvasm32 b/test_conformance/spirv_new/spirv_asm/atomic_inc_global.spvasm32 new file mode 100644 index 00000000..2aa163e0 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/atomic_inc_global.spvasm32 @@ -0,0 +1,37 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 18 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "atomic_inc_global" %__spirv_GlobalInvocationId + OpName %__spirv_GlobalInvocationId "__spirv_GlobalInvocationId" + OpName %val "val" + OpName %counter "counter" + OpDecorate %__spirv_GlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_GlobalInvocationId Constant + OpDecorate %val FuncParamAttr NoCapture + OpDecorate %__spirv_GlobalInvocationId LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint + %uint_1 = OpConstant %uint 1 + %uint_512 = OpConstant %uint 512 +%__spirv_GlobalInvocationId = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %val = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %counter = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %13 = OpLabel + %14 = OpLoad %v3uint %__spirv_GlobalInvocationId Aligned 0 + %15 = OpCompositeExtract %uint %14 0 + %16 = OpAtomicIIncrement %uint %counter %uint_1 %uint_512 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %val %15 + OpStore %17 %16 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/atomic_inc_global.spvasm64 b/test_conformance/spirv_new/spirv_asm/atomic_inc_global.spvasm64 new file mode 100644 index 00000000..2a96efdf --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/atomic_inc_global.spvasm64 @@ -0,0 +1,42 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 22 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "atomic_inc_global" %__spirv_GlobalInvocationId + OpName %__spirv_GlobalInvocationId "__spirv_GlobalInvocationId" + OpName %val "val" + OpName %counter "counter" + OpDecorate %__spirv_GlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_GlobalInvocationId Constant + OpDecorate %val FuncParamAttr NoCapture + OpDecorate %__spirv_GlobalInvocationId LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint + %uint_1 = OpConstant %uint 1 + %uint_512 = OpConstant %uint 512 + %ulong_32 = OpConstant %ulong 32 +%__spirv_GlobalInvocationId = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %11 + %val = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %counter = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %15 = OpLabel + %16 = OpLoad %v3ulong %__spirv_GlobalInvocationId Aligned 0 + %17 = OpCompositeExtract %ulong %16 0 + %18 = OpShiftLeftLogical %ulong %17 %ulong_32 + %19 = OpShiftRightArithmetic %ulong %18 %ulong_32 + %20 = OpAtomicIIncrement %uint %counter %uint_1 %uint_512 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %val %19 + OpStore %21 %20 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/branch_conditional.spvasm32 b/test_conformance/spirv_new/spirv_asm/branch_conditional.spvasm32 new file mode 100644 index 00000000..5b5991a5 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/branch_conditional.spvasm32 @@ -0,0 +1,57 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "branch_conditional" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %bool = OpTypeBool + %void = OpTypeVoid + %uint_0 = OpConstant %uint 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %16 = OpLabel + %17 = OpVariable %_ptr_Function_uint Function + %18 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %uint %18 0 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %19 + %21 = OpLoad %uint %20 Aligned 4 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %19 + %23 = OpLoad %uint %22 Aligned 4 + %24 = OpSLessThan %bool %21 %23 + OpBranchConditional %24 %25 %26 + %25 = OpLabel + %27 = OpISub %uint %23 %21 + OpStore %17 %27 + OpBranch %28 + %26 = OpLabel + %29 = OpISub %uint %21 %23 + OpStore %17 %29 + OpBranch %28 + %28 = OpLabel + %30 = OpLoad %uint %17 + %31 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %19 + OpStore %31 %30 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/branch_conditional.spvasm64 b/test_conformance/spirv_new/spirv_asm/branch_conditional.spvasm64 new file mode 100644 index 00000000..41983a1a --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/branch_conditional.spvasm64 @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 36 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "branch_conditional" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %bool = OpTypeBool + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %ulong_32 = OpConstant %ulong 32 + %uint_0 = OpConstant %uint 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %17 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %17 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %18 = OpLabel + %19 = OpVariable %_ptr_Function_uint Function + %20 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %21 = OpCompositeExtract %ulong %20 0 + %22 = OpShiftLeftLogical %ulong %21 %ulong_32 + %23 = OpShiftRightArithmetic %ulong %22 %ulong_32 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %23 + %25 = OpLoad %uint %24 Aligned 4 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %23 + %27 = OpLoad %uint %26 Aligned 4 + OpStore %19 %uint_0 + %28 = OpSLessThan %bool %25 %27 + OpBranchConditional %28 %29 %30 + %29 = OpLabel + %31 = OpISub %uint %27 %25 + OpStore %19 %31 + OpBranch %32 + %30 = OpLabel + %33 = OpISub %uint %25 %27 + OpStore %19 %33 + OpBranch %32 + %32 = OpLabel + %34 = OpLoad %uint %19 + %35 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %23 + OpStore %35 %34 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/branch_conditional_weighted.spvasm32 b/test_conformance/spirv_new/spirv_asm/branch_conditional_weighted.spvasm32 new file mode 100644 index 00000000..daeba30b --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/branch_conditional_weighted.spvasm32 @@ -0,0 +1,57 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "branch_conditional_weighted" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %bool = OpTypeBool + %void = OpTypeVoid + %uint_0 = OpConstant %uint 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %16 = OpLabel + %17 = OpVariable %_ptr_Function_uint Function + %18 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %uint %18 0 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %19 + %21 = OpLoad %uint %20 Aligned 4 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %19 + %23 = OpLoad %uint %22 Aligned 4 + %24 = OpSLessThan %bool %21 %23 + OpBranchConditional %24 %25 %26 4 6 + %25 = OpLabel + %27 = OpISub %uint %23 %21 + OpStore %17 %27 + OpBranch %28 + %26 = OpLabel + %29 = OpISub %uint %21 %23 + OpStore %17 %29 + OpBranch %28 + %28 = OpLabel + %30 = OpLoad %uint %17 + %31 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %19 + OpStore %31 %30 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/branch_conditional_weighted.spvasm64 b/test_conformance/spirv_new/spirv_asm/branch_conditional_weighted.spvasm64 new file mode 100644 index 00000000..5238726f --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/branch_conditional_weighted.spvasm64 @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 36 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "branch_conditional_weighted" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %bool = OpTypeBool + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %ulong_32 = OpConstant %ulong 32 + %uint_0 = OpConstant %uint 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %17 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %17 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %18 = OpLabel + %19 = OpVariable %_ptr_Function_uint Function + %20 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %21 = OpCompositeExtract %ulong %20 0 + %22 = OpShiftLeftLogical %ulong %21 %ulong_32 + %23 = OpShiftRightArithmetic %ulong %22 %ulong_32 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %23 + %25 = OpLoad %uint %24 Aligned 4 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %23 + %27 = OpLoad %uint %26 Aligned 4 + OpStore %19 %uint_0 + %28 = OpSLessThan %bool %25 %27 + OpBranchConditional %28 %29 %30 4 6 + %29 = OpLabel + %31 = OpISub %uint %27 %25 + OpStore %19 %31 + OpBranch %32 + %30 = OpLabel + %33 = OpISub %uint %25 %27 + OpStore %19 %33 + OpBranch %32 + %32 = OpLabel + %34 = OpLoad %uint %19 + %35 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %23 + OpStore %35 %34 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/branch_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/branch_simple.spvasm32 new file mode 100644 index 00000000..7978899d --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/branch_simple.spvasm32 @@ -0,0 +1,36 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 18 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "branch_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %9 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %10 = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %11 = OpLabel + %12 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %13 = OpCompositeExtract %uint %12 0 + %14 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %13 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %10 %13 + %16 = OpLoad %uint %14 + OpBranch %17 + %17 = OpLabel + OpStore %15 %16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/branch_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/branch_simple.spvasm64 new file mode 100644 index 00000000..bf44d36f --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/branch_simple.spvasm64 @@ -0,0 +1,42 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 22 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "branch_simple" %gl_GlobalInvocationID + OpName %in "in" + OpName %out "out" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %ulong_32 = OpConstant %ulong 32 + %void = OpTypeVoid + %uint = OpTypeInt 32 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %12 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %12 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %13 = OpLabel + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %17 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %17 + OpBranch %20 + %20 = OpLabel + %21 = OpLoad %uint %18 + OpStore %19 %21 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/composite_construct_int4.spvasm32 b/test_conformance/spirv_new/spirv_asm/composite_construct_int4.spvasm32 new file mode 100644 index 00000000..709d07cb --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/composite_construct_int4.spvasm32 @@ -0,0 +1,37 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "composite_construct_int4" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %v4uint = OpTypeVector %uint 4 +%_ptr_CrossWorkgroup_v4uint = OpTypePointer CrossWorkgroup %v4uint + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4uint + %uint_123 = OpConstant %uint 123 + %uint_122 = OpConstant %uint 122 + %uint_121 = OpConstant %uint 121 + %uint_119 = OpConstant %uint 119 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v4uint + %15 = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpCompositeConstruct %v4uint %uint_123 %uint_122 %uint_121 %uint_119 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4uint %in %17 + OpStore %19 %18 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/composite_construct_int4.spvasm64 b/test_conformance/spirv_new/spirv_asm/composite_construct_int4.spvasm64 new file mode 100644 index 00000000..ce895471 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/composite_construct_int4.spvasm64 @@ -0,0 +1,42 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "composite_construct_int4" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %v4uint = OpTypeVector %uint 4 +%_ptr_CrossWorkgroup_v4uint = OpTypePointer CrossWorkgroup %v4uint + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4uint + %ulong_32 = OpConstant %ulong 32 + %uint_123 = OpConstant %uint 123 + %uint_122 = OpConstant %uint 122 + %uint_121 = OpConstant %uint 121 + %uint_119 = OpConstant %uint 119 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v4uint + %17 = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpCompositeConstruct %v4uint %uint_123 %uint_122 %uint_121 %uint_119 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4uint %in %21 + OpStore %23 %22 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/composite_construct_struct.spvasm32 b/test_conformance/spirv_new/spirv_asm/composite_construct_struct.spvasm32 new file mode 100644 index 00000000..8ff67a2d --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/composite_construct_struct.spvasm32 @@ -0,0 +1,43 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "composite_construct_struct" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %v2uint = OpTypeVector %uint 2 + %uchar = OpTypeInt 8 0 + %_struct_10 = OpTypeStruct %uint %uchar + %_struct_11 = OpTypeStruct %v2uint %_struct_10 +%_ptr_CrossWorkgroup__struct_11 = OpTypePointer CrossWorkgroup %_struct_11 + %13 = OpTypeFunction %void %_ptr_CrossWorkgroup__struct_11 +%uint_2100483600 = OpConstant %uint 2100483600 + %uchar_128 = OpConstant %uchar 128 +%uint_2100480000 = OpConstant %uint 2100480000 +%uint_2100480000_0 = OpConstant %uint 2100480000 + %18 = OpConstantComposite %v2uint %uint_2100480000 %uint_2100480000_0 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %13 + %in = OpFunctionParameter %_ptr_CrossWorkgroup__struct_11 + %19 = OpLabel + %20 = OpCompositeConstruct %_struct_10 %uint_2100483600 %uchar_128 + %21 = OpCompositeConstruct %_struct_11 %18 %20 + %22 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %23 = OpCompositeExtract %uint %22 0 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup__struct_11 %in %23 + OpStore %24 %21 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/composite_construct_struct.spvasm64 b/test_conformance/spirv_new/spirv_asm/composite_construct_struct.spvasm64 new file mode 100644 index 00000000..6d98de61 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/composite_construct_struct.spvasm64 @@ -0,0 +1,48 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "composite_construct_struct" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %v2uint = OpTypeVector %uint 2 + %uchar = OpTypeInt 8 0 + %_struct_11 = OpTypeStruct %uint %uchar + %_struct_12 = OpTypeStruct %v2uint %_struct_11 +%_ptr_CrossWorkgroup__struct_12 = OpTypePointer CrossWorkgroup %_struct_12 + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup__struct_12 + %ulong_32 = OpConstant %ulong 32 +%uint_2100483600 = OpConstant %uint 2100483600 + %uchar_128 = OpConstant %uchar 128 +%uint_2100480000 = OpConstant %uint 2100480000 +%uint_2100480000_0 = OpConstant %uint 2100480000 + %20 = OpConstantComposite %v2uint %uint_2100480000 %uint_2100480000_0 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %14 + %in = OpFunctionParameter %_ptr_CrossWorkgroup__struct_12 + %21 = OpLabel + %22 = OpCompositeConstruct %_struct_11 %uint_2100483600 %uchar_128 + %23 = OpCompositeConstruct %_struct_12 %20 %22 + %24 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %25 = OpCompositeExtract %ulong %24 0 + %26 = OpShiftLeftLogical %ulong %25 %ulong_32 + %27 = OpShiftRightArithmetic %ulong %26 %ulong_32 + %28 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup__struct_12 %in %27 + OpStore %28 %23 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_char_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/constant_char_simple.spvasm32 new file mode 100644 index 00000000..40a6b569 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_char_simple.spvasm32 @@ -0,0 +1,34 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "constant_char_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar + %uchar_20 = OpConstant %uchar 20 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %12 = OpLabel + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %in %14 + OpStore %15 %uchar_20 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_char_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/constant_char_simple.spvasm64 new file mode 100644 index 00000000..3deb9c4b --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_char_simple.spvasm64 @@ -0,0 +1,38 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "constant_char_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar + %ulong_32 = OpConstant %ulong 32 + %uchar_20 = OpConstant %uchar 20 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %13 = OpLabel + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %in %17 + OpStore %18 %uchar_20 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_double_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/constant_double_simple.spvasm32 new file mode 100644 index 00000000..6d00bf54 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_double_simple.spvasm32 @@ -0,0 +1,34 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "constant_double_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_double +%double_3_1415926535897931 = OpConstant %double 3.1415926535897931 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_double + %12 = OpLabel + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %in %14 + OpStore %15 %double_3_1415926535897931 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_double_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/constant_double_simple.spvasm64 new file mode 100644 index 00000000..ed87e28e --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_double_simple.spvasm64 @@ -0,0 +1,38 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "constant_double_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_double + %ulong_32 = OpConstant %ulong 32 +%double_3_1415926535897931 = OpConstant %double 3.1415926535897931 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_double + %13 = OpLabel + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %in %17 + OpStore %18 %double_3_1415926535897931 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_false_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/constant_false_simple.spvasm32 new file mode 100644 index 00000000..0f7d44c5 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_false_simple.spvasm32 @@ -0,0 +1,36 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "constant_false_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %bool = OpTypeBool +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint + %false = OpConstantFalse %bool + %uint_1 = OpConstant %uint 1 + %uint_0 = OpConstant %uint 0 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %14 = OpLabel + %15 = OpSelect %uint %false %uint_1 %uint_0 + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %17 + OpStore %18 %15 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_false_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/constant_false_simple.spvasm64 new file mode 100644 index 00000000..9a4923cf --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_false_simple.spvasm64 @@ -0,0 +1,41 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "constant_false_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %bool = OpTypeBool +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint + %ulong_32 = OpConstant %ulong 32 + %false = OpConstantFalse %bool + %uint_1 = OpConstant %uint 1 + %uint_0 = OpConstant %uint 0 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %16 = OpLabel + %17 = OpSelect %uint %false %uint_1 %uint_0 + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %21 + OpStore %22 %17 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_float_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/constant_float_simple.spvasm32 new file mode 100644 index 00000000..85cbca73 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_float_simple.spvasm32 @@ -0,0 +1,33 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "constant_float_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_float +%float_3_14159274 = OpConstant %float 3.14159274 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %12 = OpLabel + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %14 + OpStore %15 %float_3_14159274 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_float_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/constant_float_simple.spvasm64 new file mode 100644 index 00000000..5b7672f5 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_float_simple.spvasm64 @@ -0,0 +1,37 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "constant_float_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 +%float_3_14159274 = OpConstant %float 3.14159274 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %13 = OpLabel + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %17 + OpStore %18 %float_3_14159274 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_half_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/constant_half_simple.spvasm32 new file mode 100644 index 00000000..47a0ac96 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_half_simple.spvasm32 @@ -0,0 +1,36 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 18 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "constant_half_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 + %half = OpTypeFloat 16 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup_float +%half_0x1_ap_1 = OpConstant %half 0x1.ap+1 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %13 = OpLabel + %14 = OpFConvert %float %half_0x1_ap_1 + %15 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %16 = OpCompositeExtract %uint %15 0 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %16 + OpStore %17 %14 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_half_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/constant_half_simple.spvasm64 new file mode 100644 index 00000000..7a9f1e8a --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_half_simple.spvasm64 @@ -0,0 +1,40 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 21 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "constant_half_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 + %half = OpTypeFloat 16 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 +%half_0x1_ap_1 = OpConstant %half 0x1.ap+1 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %14 = OpLabel + %15 = OpFConvert %float %half_0x1_ap_1 + %16 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %ulong %16 0 + %18 = OpShiftLeftLogical %ulong %17 %ulong_32 + %19 = OpShiftRightArithmetic %ulong %18 %ulong_32 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %19 + OpStore %20 %15 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_int3_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/constant_int3_simple.spvasm32 new file mode 100644 index 00000000..46934c0e --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_int3_simple.spvasm32 @@ -0,0 +1,35 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 18 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "constant_int3_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_v3uint = OpTypePointer CrossWorkgroup %v3uint + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_v3uint + %uint_123 = OpConstant %uint 123 + %uint_122 = OpConstant %uint 122 + %uint_121 = OpConstant %uint 121 + %13 = OpConstantComposite %v3uint %uint_123 %uint_122 %uint_121 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %9 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v3uint + %14 = OpLabel + %15 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %16 = OpCompositeExtract %uint %15 0 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v3uint %in %16 + OpStore %17 %13 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_int3_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/constant_int3_simple.spvasm64 new file mode 100644 index 00000000..25516d24 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_int3_simple.spvasm64 @@ -0,0 +1,41 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "constant_int3_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_CrossWorkgroup_v3uint = OpTypePointer CrossWorkgroup %v3uint + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup_v3uint + %ulong_32 = OpConstant %ulong 32 + %uint_123 = OpConstant %uint 123 + %uint_122 = OpConstant %uint 122 + %uint_121 = OpConstant %uint 121 + %16 = OpConstantComposite %v3uint %uint_123 %uint_122 %uint_121 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v3uint + %17 = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v3uint %in %21 + OpStore %22 %16 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_int4_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/constant_int4_simple.spvasm32 new file mode 100644 index 00000000..62ba1d8d --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_int4_simple.spvasm32 @@ -0,0 +1,37 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "constant_int4_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %v4uint = OpTypeVector %uint 4 +%_ptr_CrossWorkgroup_v4uint = OpTypePointer CrossWorkgroup %v4uint + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4uint + %uint_123 = OpConstant %uint 123 + %uint_122 = OpConstant %uint 122 + %uint_121 = OpConstant %uint 121 + %uint_119 = OpConstant %uint 119 + %15 = OpConstantComposite %v4uint %uint_123 %uint_122 %uint_121 %uint_119 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v4uint + %16 = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4uint %in %18 + OpStore %19 %15 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_int4_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/constant_int4_simple.spvasm64 new file mode 100644 index 00000000..3824090f --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_int4_simple.spvasm64 @@ -0,0 +1,42 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "constant_int4_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %v4uint = OpTypeVector %uint 4 +%_ptr_CrossWorkgroup_v4uint = OpTypePointer CrossWorkgroup %v4uint + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4uint + %ulong_32 = OpConstant %ulong 32 + %uint_123 = OpConstant %uint 123 + %uint_122 = OpConstant %uint 122 + %uint_121 = OpConstant %uint 121 + %uint_119 = OpConstant %uint 119 + %17 = OpConstantComposite %v4uint %uint_123 %uint_122 %uint_121 %uint_119 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v4uint + %18 = OpLabel + %19 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %20 = OpCompositeExtract %ulong %19 0 + %21 = OpShiftLeftLogical %ulong %20 %ulong_32 + %22 = OpShiftRightArithmetic %ulong %21 %ulong_32 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4uint %in %22 + OpStore %23 %17 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_int_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/constant_int_simple.spvasm32 new file mode 100644 index 00000000..a5091de9 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_int_simple.spvasm32 @@ -0,0 +1,32 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 15 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "constant_int_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint + %uint_123 = OpConstant %uint 123 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %9 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %11 = OpLabel + %12 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %13 = OpCompositeExtract %uint %12 0 + %14 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %13 + OpStore %14 %uint_123 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_int_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/constant_int_simple.spvasm64 new file mode 100644 index 00000000..75362b8e --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_int_simple.spvasm64 @@ -0,0 +1,37 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "constant_int_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint + %ulong_32 = OpConstant %ulong 32 + %uint_123 = OpConstant %uint 123 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %13 = OpLabel + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %17 + OpStore %18 %uint_123 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_long_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/constant_long_simple.spvasm32 new file mode 100644 index 00000000..adf712ac --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_long_simple.spvasm32 @@ -0,0 +1,34 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "constant_long_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %ulong = OpTypeInt 64 0 +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong +%ulong_34359738368 = OpConstant %ulong 34359738368 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %12 = OpLabel + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %in %14 + OpStore %15 %ulong_34359738368 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_long_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/constant_long_simple.spvasm64 new file mode 100644 index 00000000..28e856e3 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_long_simple.spvasm64 @@ -0,0 +1,36 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 18 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "constant_long_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong + %ulong_32 = OpConstant %ulong 32 +%ulong_34359738368 = OpConstant %ulong 34359738368 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %9 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %12 = OpLabel + %13 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %ulong %13 0 + %15 = OpShiftLeftLogical %ulong %14 %ulong_32 + %16 = OpShiftRightArithmetic %ulong %15 %ulong_32 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %in %16 + OpStore %17 %ulong_34359738368 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_short_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/constant_short_simple.spvasm32 new file mode 100644 index 00000000..2f280265 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_short_simple.spvasm32 @@ -0,0 +1,34 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "constant_short_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %ushort = OpTypeInt 16 0 +%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort +%ushort_32000 = OpConstant %ushort 32000 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ushort + %12 = OpLabel + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %in %14 + OpStore %15 %ushort_32000 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_short_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/constant_short_simple.spvasm64 new file mode 100644 index 00000000..d3fc51e3 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_short_simple.spvasm64 @@ -0,0 +1,38 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "constant_short_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %ushort = OpTypeInt 16 0 +%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort + %ulong_32 = OpConstant %ulong 32 +%ushort_32000 = OpConstant %ushort 32000 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ushort + %13 = OpLabel + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %in %17 + OpStore %18 %ushort_32000 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_struct_int_char_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/constant_struct_int_char_simple.spvasm32 new file mode 100644 index 00000000..ebe84ad5 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_struct_int_char_simple.spvasm32 @@ -0,0 +1,37 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "constant_struct_int_char_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 + %_struct_9 = OpTypeStruct %uint %uchar +%_ptr_CrossWorkgroup__struct_9 = OpTypePointer CrossWorkgroup %_struct_9 + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup__struct_9 +%uint_2100483600 = OpConstant %uint 2100483600 + %uchar_128 = OpConstant %uchar 128 + %14 = OpConstantComposite %_struct_9 %uint_2100483600 %uchar_128 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup__struct_9 + %15 = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup__struct_9 %in %17 + OpStore %18 %14 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_struct_int_char_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/constant_struct_int_char_simple.spvasm64 new file mode 100644 index 00000000..bc37627b --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_struct_int_char_simple.spvasm64 @@ -0,0 +1,42 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "constant_struct_int_char_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %uchar = OpTypeInt 8 0 + %_struct_10 = OpTypeStruct %uint %uchar +%_ptr_CrossWorkgroup__struct_10 = OpTypePointer CrossWorkgroup %_struct_10 + %12 = OpTypeFunction %void %_ptr_CrossWorkgroup__struct_10 + %ulong_32 = OpConstant %ulong 32 +%uint_2100483600 = OpConstant %uint 2100483600 + %uchar_128 = OpConstant %uchar 128 + %16 = OpConstantComposite %_struct_10 %uint_2100483600 %uchar_128 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %12 + %in = OpFunctionParameter %_ptr_CrossWorkgroup__struct_10 + %17 = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup__struct_10 %in %21 + OpStore %22 %16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_struct_int_float_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/constant_struct_int_float_simple.spvasm32 new file mode 100644 index 00000000..0c0e0e0b --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_struct_int_float_simple.spvasm32 @@ -0,0 +1,36 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Kernel + OpCapability Linkage + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "constant_struct_int_float_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 + %_struct_9 = OpTypeStruct %uint %float +%_ptr_CrossWorkgroup__struct_9 = OpTypePointer CrossWorkgroup %_struct_9 + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup__struct_9 + %uint_1024 = OpConstant %uint 1024 +%float_3_1415 = OpConstant %float 3.1415 + %14 = OpConstantComposite %_struct_9 %uint_1024 %float_3_1415 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup__struct_9 + %15 = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup__struct_9 %in %17 + OpStore %18 %14 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_struct_int_float_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/constant_struct_int_float_simple.spvasm64 new file mode 100644 index 00000000..f06f2775 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_struct_int_float_simple.spvasm64 @@ -0,0 +1,41 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "constant_struct_int_float_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %float = OpTypeFloat 32 + %_struct_10 = OpTypeStruct %uint %float +%_ptr_CrossWorkgroup__struct_10 = OpTypePointer CrossWorkgroup %_struct_10 + %12 = OpTypeFunction %void %_ptr_CrossWorkgroup__struct_10 + %ulong_32 = OpConstant %ulong 32 + %uint_1024 = OpConstant %uint 1024 +%float_3_1415 = OpConstant %float 3.1415 + %16 = OpConstantComposite %_struct_10 %uint_1024 %float_3_1415 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %12 + %in = OpFunctionParameter %_ptr_CrossWorkgroup__struct_10 + %17 = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup__struct_10 %in %21 + OpStore %22 %16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_struct_struct_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/constant_struct_struct_simple.spvasm32 new file mode 100644 index 00000000..62763d81 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_struct_struct_simple.spvasm32 @@ -0,0 +1,43 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Kernel + OpCapability Linkage + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "constant_struct_struct_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %v2uint = OpTypeVector %uint 2 + %uchar = OpTypeInt 8 0 + %_struct_10 = OpTypeStruct %uint %uchar + %_struct_11 = OpTypeStruct %v2uint %_struct_10 +%_ptr_CrossWorkgroup__struct_11 = OpTypePointer CrossWorkgroup %_struct_11 + %13 = OpTypeFunction %void %_ptr_CrossWorkgroup__struct_11 +%uint_2100483600 = OpConstant %uint 2100483600 + %uchar_128 = OpConstant %uchar 128 +%uint_2100480000 = OpConstant %uint 2100480000 +%uint_2100480000_0 = OpConstant %uint 2100480000 + %18 = OpConstantComposite %_struct_10 %uint_2100483600 %uchar_128 + %19 = OpConstantComposite %v2uint %uint_2100480000 %uint_2100480000_0 + %20 = OpConstantComposite %_struct_11 %19 %18 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %13 + %in = OpFunctionParameter %_ptr_CrossWorkgroup__struct_11 + %21 = OpLabel + %22 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %23 = OpCompositeExtract %uint %22 0 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup__struct_11 %in %23 + OpStore %24 %20 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_struct_struct_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/constant_struct_struct_simple.spvasm64 new file mode 100644 index 00000000..277b370c --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_struct_struct_simple.spvasm64 @@ -0,0 +1,48 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "constant_struct_struct_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %v2uint = OpTypeVector %uint 2 + %uchar = OpTypeInt 8 0 + %_struct_11 = OpTypeStruct %uint %uchar + %_struct_12 = OpTypeStruct %v2uint %_struct_11 +%_ptr_CrossWorkgroup__struct_12 = OpTypePointer CrossWorkgroup %_struct_12 + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup__struct_12 + %ulong_32 = OpConstant %ulong 32 +%uint_2100483600 = OpConstant %uint 2100483600 + %uchar_128 = OpConstant %uchar 128 +%uint_2100480000 = OpConstant %uint 2100480000 +%uint_2100480000_0 = OpConstant %uint 2100480000 + %20 = OpConstantComposite %_struct_11 %uint_2100483600 %uchar_128 + %21 = OpConstantComposite %v2uint %uint_2100480000 %uint_2100480000_0 + %22 = OpConstantComposite %_struct_12 %21 %20 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %14 + %in = OpFunctionParameter %_ptr_CrossWorkgroup__struct_12 + %23 = OpLabel + %24 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %25 = OpCompositeExtract %ulong %24 0 + %26 = OpShiftLeftLogical %ulong %25 %ulong_32 + %27 = OpShiftRightArithmetic %ulong %26 %ulong_32 + %28 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup__struct_12 %in %27 + OpStore %28 %22 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_true_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/constant_true_simple.spvasm32 new file mode 100644 index 00000000..b135e130 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_true_simple.spvasm32 @@ -0,0 +1,36 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "constant_true_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %bool = OpTypeBool +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint + %true = OpConstantTrue %bool + %uint_1 = OpConstant %uint 1 + %uint_0 = OpConstant %uint 0 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %14 = OpLabel + %15 = OpSelect %uint %true %uint_1 %uint_0 + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %17 + OpStore %18 %15 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_true_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/constant_true_simple.spvasm64 new file mode 100644 index 00000000..3fdd7a27 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_true_simple.spvasm64 @@ -0,0 +1,41 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "constant_true_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %bool = OpTypeBool +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint + %ulong_32 = OpConstant %ulong 32 + %true = OpConstantTrue %bool + %uint_1 = OpConstant %uint 1 + %uint_0 = OpConstant %uint 0 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %16 = OpLabel + %17 = OpSelect %uint %true %uint_1 %uint_0 + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %21 + OpStore %22 %17 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_uchar_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/constant_uchar_simple.spvasm32 new file mode 100644 index 00000000..c40a6000 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_uchar_simple.spvasm32 @@ -0,0 +1,34 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "constant_uchar_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar + %uchar_19 = OpConstant %uchar 19 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %12 = OpLabel + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %in %14 + OpStore %15 %uchar_19 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_uchar_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/constant_uchar_simple.spvasm64 new file mode 100644 index 00000000..c55fe286 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_uchar_simple.spvasm64 @@ -0,0 +1,38 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "constant_uchar_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar + %ulong_32 = OpConstant %ulong 32 + %uchar_19 = OpConstant %uchar 19 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %13 = OpLabel + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %in %17 + OpStore %18 %uchar_19 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_uint_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/constant_uint_simple.spvasm32 new file mode 100644 index 00000000..3f430dc8 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_uint_simple.spvasm32 @@ -0,0 +1,32 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 15 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "constant_uint_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint + %uint_54321 = OpConstant %uint 54321 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %9 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %11 = OpLabel + %12 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %13 = OpCompositeExtract %uint %12 0 + %14 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %13 + OpStore %14 %uint_54321 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_uint_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/constant_uint_simple.spvasm64 new file mode 100644 index 00000000..d64fed7f --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_uint_simple.spvasm64 @@ -0,0 +1,37 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "constant_uint_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint + %ulong_32 = OpConstant %ulong 32 + %uint_54321 = OpConstant %uint 54321 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %13 = OpLabel + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %17 + OpStore %18 %uint_54321 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_ulong_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/constant_ulong_simple.spvasm32 new file mode 100644 index 00000000..04b50547 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_ulong_simple.spvasm32 @@ -0,0 +1,34 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "constant_ulong_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %ulong = OpTypeInt 64 0 +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong +%ulong_9223372036854775810 = OpConstant %ulong 9223372036854775810 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %12 = OpLabel + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %in %14 + OpStore %15 %ulong_9223372036854775810 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_ulong_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/constant_ulong_simple.spvasm64 new file mode 100644 index 00000000..f6319767 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_ulong_simple.spvasm64 @@ -0,0 +1,36 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 18 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "constant_ulong_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong + %ulong_32 = OpConstant %ulong 32 +%ulong_9223372036854775810 = OpConstant %ulong 9223372036854775810 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %9 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %12 = OpLabel + %13 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %ulong %13 0 + %15 = OpShiftLeftLogical %ulong %14 %ulong_32 + %16 = OpShiftRightArithmetic %ulong %15 %ulong_32 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %in %16 + OpStore %17 %ulong_9223372036854775810 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_ushort_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/constant_ushort_simple.spvasm32 new file mode 100644 index 00000000..0cfda356 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_ushort_simple.spvasm32 @@ -0,0 +1,34 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "constant_ushort_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %ushort = OpTypeInt 16 0 +%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort +%ushort_65000 = OpConstant %ushort 65000 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ushort + %12 = OpLabel + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %in %14 + OpStore %15 %ushort_65000 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/constant_ushort_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/constant_ushort_simple.spvasm64 new file mode 100644 index 00000000..63240519 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/constant_ushort_simple.spvasm64 @@ -0,0 +1,38 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "constant_ushort_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %ushort = OpTypeInt 16 0 +%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort + %ulong_32 = OpConstant %ulong 32 +%ushort_65000 = OpConstant %ushort 65000 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ushort + %13 = OpLabel + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %in %17 + OpStore %18 %ushort_65000 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_char_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/copy_char_simple.spvasm32 new file mode 100644 index 00000000..5545194d --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_char_simple.spvasm32 @@ -0,0 +1,35 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 17 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "copy_char_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar + %uchar_20 = OpConstant %uchar 20 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %12 = OpLabel + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %in %14 + %16 = OpCopyObject %uchar %uchar_20 + OpStore %15 %16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_char_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/copy_char_simple.spvasm64 new file mode 100644 index 00000000..e933f208 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_char_simple.spvasm64 @@ -0,0 +1,39 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "copy_char_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar + %ulong_32 = OpConstant %ulong 32 + %uchar_20 = OpConstant %uchar 20 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %13 = OpLabel + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %in %17 + %19 = OpCopyObject %uchar %uchar_20 + OpStore %18 %19 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_double_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/copy_double_simple.spvasm32 new file mode 100644 index 00000000..4b8eb832 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_double_simple.spvasm32 @@ -0,0 +1,35 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 17 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "copy_double_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_double +%double_3_1415926535897931 = OpConstant %double 3.1415926535897931 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_double + %12 = OpLabel + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %in %14 + %16 = OpCopyObject %double %double_3_1415926535897931 + OpStore %15 %16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_double_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/copy_double_simple.spvasm64 new file mode 100644 index 00000000..49837d87 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_double_simple.spvasm64 @@ -0,0 +1,39 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "copy_double_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_double + %ulong_32 = OpConstant %ulong 32 +%double_3_1415926535897931 = OpConstant %double 3.1415926535897931 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_double + %13 = OpLabel + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %in %17 + %19 = OpCopyObject %double %double_3_1415926535897931 + OpStore %18 %19 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_float_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/copy_float_simple.spvasm32 new file mode 100644 index 00000000..268d70ec --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_float_simple.spvasm32 @@ -0,0 +1,34 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 17 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "copy_float_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_float +%float_3_14159274 = OpConstant %float 3.14159274 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %12 = OpLabel + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %14 + %16 = OpCopyObject %float %float_3_14159274 + OpStore %15 %16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_float_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/copy_float_simple.spvasm64 new file mode 100644 index 00000000..0fd6111d --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_float_simple.spvasm64 @@ -0,0 +1,38 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "copy_float_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 +%float_3_14159274 = OpConstant %float 3.14159274 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %13 = OpLabel + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %17 + %19 = OpCopyObject %float %float_3_14159274 + OpStore %18 %19 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_half_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/copy_half_simple.spvasm32 new file mode 100644 index 00000000..f924afc2 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_half_simple.spvasm32 @@ -0,0 +1,37 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "copy_half_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 + %half = OpTypeFloat 16 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup_float +%half_0x1_ap_1 = OpConstant %half 0x1.ap+1 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %13 = OpLabel + %14 = OpCopyObject %half %half_0x1_ap_1 + %15 = OpFConvert %float %14 + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %17 + OpStore %18 %15 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_half_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/copy_half_simple.spvasm64 new file mode 100644 index 00000000..b4babdf4 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_half_simple.spvasm64 @@ -0,0 +1,41 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 22 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "copy_half_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 + %half = OpTypeFloat 16 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 +%half_0x1_ap_1 = OpConstant %half 0x1.ap+1 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %14 = OpLabel + %15 = OpCopyObject %half %half_0x1_ap_1 + %16 = OpFConvert %float %15 + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %20 + OpStore %21 %16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_int3_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/copy_int3_simple.spvasm32 new file mode 100644 index 00000000..d8424d2d --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_int3_simple.spvasm32 @@ -0,0 +1,36 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "copy_int3_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_v3uint = OpTypePointer CrossWorkgroup %v3uint + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_v3uint + %uint_123 = OpConstant %uint 123 + %uint_122 = OpConstant %uint 122 + %uint_121 = OpConstant %uint 121 + %13 = OpConstantComposite %v3uint %uint_123 %uint_122 %uint_121 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %9 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v3uint + %14 = OpLabel + %15 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %16 = OpCompositeExtract %uint %15 0 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v3uint %in %16 + %18 = OpCopyObject %v3uint %13 + OpStore %17 %18 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_int3_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/copy_int3_simple.spvasm64 new file mode 100644 index 00000000..d96630bc --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_int3_simple.spvasm64 @@ -0,0 +1,42 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "copy_int3_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_CrossWorkgroup_v3uint = OpTypePointer CrossWorkgroup %v3uint + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup_v3uint + %ulong_32 = OpConstant %ulong 32 + %uint_123 = OpConstant %uint 123 + %uint_122 = OpConstant %uint 122 + %uint_121 = OpConstant %uint 121 + %16 = OpConstantComposite %v3uint %uint_123 %uint_122 %uint_121 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v3uint + %17 = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v3uint %in %21 + %23 = OpCopyObject %v3uint %16 + OpStore %22 %23 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_int4_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/copy_int4_simple.spvasm32 new file mode 100644 index 00000000..1710d730 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_int4_simple.spvasm32 @@ -0,0 +1,38 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 21 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "copy_int4_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %v4uint = OpTypeVector %uint 4 +%_ptr_CrossWorkgroup_v4uint = OpTypePointer CrossWorkgroup %v4uint + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4uint + %uint_123 = OpConstant %uint 123 + %uint_122 = OpConstant %uint 122 + %uint_121 = OpConstant %uint 121 + %uint_119 = OpConstant %uint 119 + %15 = OpConstantComposite %v4uint %uint_123 %uint_122 %uint_121 %uint_119 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v4uint + %16 = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4uint %in %18 + %20 = OpCopyObject %v4uint %15 + OpStore %19 %20 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_int4_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/copy_int4_simple.spvasm64 new file mode 100644 index 00000000..1f82ba65 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_int4_simple.spvasm64 @@ -0,0 +1,43 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "copy_int4_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %v4uint = OpTypeVector %uint 4 +%_ptr_CrossWorkgroup_v4uint = OpTypePointer CrossWorkgroup %v4uint + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4uint + %ulong_32 = OpConstant %ulong 32 + %uint_123 = OpConstant %uint 123 + %uint_122 = OpConstant %uint 122 + %uint_121 = OpConstant %uint 121 + %uint_119 = OpConstant %uint 119 + %17 = OpConstantComposite %v4uint %uint_123 %uint_122 %uint_121 %uint_119 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v4uint + %18 = OpLabel + %19 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %20 = OpCompositeExtract %ulong %19 0 + %21 = OpShiftLeftLogical %ulong %20 %ulong_32 + %22 = OpShiftRightArithmetic %ulong %21 %ulong_32 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4uint %in %22 + %24 = OpCopyObject %v4uint %17 + OpStore %23 %24 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_int_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/copy_int_simple.spvasm32 new file mode 100644 index 00000000..39011d58 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_int_simple.spvasm32 @@ -0,0 +1,33 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "copy_int_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint + %uint_123 = OpConstant %uint 123 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %9 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %11 = OpLabel + %12 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %13 = OpCompositeExtract %uint %12 0 + %14 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %13 + %15 = OpCopyObject %uint %uint_123 + OpStore %14 %15 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_int_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/copy_int_simple.spvasm64 new file mode 100644 index 00000000..11afdb7c --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_int_simple.spvasm64 @@ -0,0 +1,38 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "copy_int_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint + %ulong_32 = OpConstant %ulong 32 + %uint_123 = OpConstant %uint 123 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %13 = OpLabel + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %17 + %19 = OpCopyObject %uint %uint_123 + OpStore %18 %19 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_long_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/copy_long_simple.spvasm32 new file mode 100644 index 00000000..f4d521ed --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_long_simple.spvasm32 @@ -0,0 +1,35 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 17 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "copy_long_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %ulong = OpTypeInt 64 0 +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong +%ulong_34359738368 = OpConstant %ulong 34359738368 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %12 = OpLabel + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %in %14 + %16 = OpCopyObject %ulong %ulong_34359738368 + OpStore %15 %16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_long_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/copy_long_simple.spvasm64 new file mode 100644 index 00000000..36a50ede --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_long_simple.spvasm64 @@ -0,0 +1,37 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "copy_long_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong + %ulong_32 = OpConstant %ulong 32 +%ulong_34359738368 = OpConstant %ulong 34359738368 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %9 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %12 = OpLabel + %13 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %ulong %13 0 + %15 = OpShiftLeftLogical %ulong %14 %ulong_32 + %16 = OpShiftRightArithmetic %ulong %15 %ulong_32 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %in %16 + %18 = OpCopyObject %ulong %ulong_34359738368 + OpStore %17 %18 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_short_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/copy_short_simple.spvasm32 new file mode 100644 index 00000000..b735f0af --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_short_simple.spvasm32 @@ -0,0 +1,35 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 17 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "copy_short_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %ushort = OpTypeInt 16 0 +%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort +%ushort_32000 = OpConstant %ushort 32000 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ushort + %12 = OpLabel + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %in %14 + %16 = OpCopyObject %ushort %ushort_32000 + OpStore %15 %16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_short_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/copy_short_simple.spvasm64 new file mode 100644 index 00000000..760f0c6c --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_short_simple.spvasm64 @@ -0,0 +1,39 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "copy_short_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %ushort = OpTypeInt 16 0 +%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort + %ulong_32 = OpConstant %ulong 32 +%ushort_32000 = OpConstant %ushort 32000 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ushort + %13 = OpLabel + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %in %17 + %19 = OpCopyObject %ushort %ushort_32000 + OpStore %18 %19 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_struct_int_char_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/copy_struct_int_char_simple.spvasm32 new file mode 100644 index 00000000..f12b2889 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_struct_int_char_simple.spvasm32 @@ -0,0 +1,38 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Kernel + OpCapability Linkage + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "copy_struct_int_char_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 + %_struct_9 = OpTypeStruct %uint %uchar +%_ptr_CrossWorkgroup__struct_9 = OpTypePointer CrossWorkgroup %_struct_9 + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup__struct_9 +%uint_2100483600 = OpConstant %uint 2100483600 + %uchar_128 = OpConstant %uchar 128 + %14 = OpConstantComposite %_struct_9 %uint_2100483600 %uchar_128 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup__struct_9 + %15 = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup__struct_9 %in %17 + %19 = OpCopyObject %_struct_9 %14 + OpStore %18 %19 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_struct_int_char_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/copy_struct_int_char_simple.spvasm64 new file mode 100644 index 00000000..717244aa --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_struct_int_char_simple.spvasm64 @@ -0,0 +1,43 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "copy_struct_int_char_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %uchar = OpTypeInt 8 0 + %_struct_10 = OpTypeStruct %uint %uchar +%_ptr_CrossWorkgroup__struct_10 = OpTypePointer CrossWorkgroup %_struct_10 + %12 = OpTypeFunction %void %_ptr_CrossWorkgroup__struct_10 + %ulong_32 = OpConstant %ulong 32 +%uint_2100483600 = OpConstant %uint 2100483600 + %uchar_128 = OpConstant %uchar 128 + %16 = OpConstantComposite %_struct_10 %uint_2100483600 %uchar_128 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %12 + %in = OpFunctionParameter %_ptr_CrossWorkgroup__struct_10 + %17 = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup__struct_10 %in %21 + %23 = OpCopyObject %_struct_10 %16 + OpStore %22 %23 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_struct_int_float_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/copy_struct_int_float_simple.spvasm32 new file mode 100644 index 00000000..b781cd9a --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_struct_int_float_simple.spvasm32 @@ -0,0 +1,37 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Kernel + OpCapability Linkage + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "copy_struct_int_float_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 + %_struct_9 = OpTypeStruct %uint %float +%_ptr_CrossWorkgroup__struct_9 = OpTypePointer CrossWorkgroup %_struct_9 + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup__struct_9 + %uint_1024 = OpConstant %uint 1024 +%float_3_1415 = OpConstant %float 3.1415 + %14 = OpConstantComposite %_struct_9 %uint_1024 %float_3_1415 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup__struct_9 + %15 = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup__struct_9 %in %17 + %19 = OpCopyObject %_struct_9 %14 + OpStore %18 %19 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_struct_int_float_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/copy_struct_int_float_simple.spvasm64 new file mode 100644 index 00000000..6a9a898f --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_struct_int_float_simple.spvasm64 @@ -0,0 +1,42 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "copy_struct_int_float_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %float = OpTypeFloat 32 + %_struct_10 = OpTypeStruct %uint %float +%_ptr_CrossWorkgroup__struct_10 = OpTypePointer CrossWorkgroup %_struct_10 + %12 = OpTypeFunction %void %_ptr_CrossWorkgroup__struct_10 + %ulong_32 = OpConstant %ulong 32 + %uint_1024 = OpConstant %uint 1024 +%float_3_1415 = OpConstant %float 3.1415 + %16 = OpConstantComposite %_struct_10 %uint_1024 %float_3_1415 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %12 + %in = OpFunctionParameter %_ptr_CrossWorkgroup__struct_10 + %17 = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup__struct_10 %in %21 + %23 = OpCopyObject %_struct_10 %16 + OpStore %22 %23 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_struct_struct_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/copy_struct_struct_simple.spvasm32 new file mode 100644 index 00000000..7f8277fc --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_struct_struct_simple.spvasm32 @@ -0,0 +1,44 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Addresses + OpCapability Kernel + OpCapability Int8 + OpCapability Linkage + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "copy_struct_struct_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %v2uint = OpTypeVector %uint 2 + %uchar = OpTypeInt 8 0 + %_struct_10 = OpTypeStruct %uint %uchar + %_struct_11 = OpTypeStruct %v2uint %_struct_10 +%_ptr_CrossWorkgroup__struct_11 = OpTypePointer CrossWorkgroup %_struct_11 + %13 = OpTypeFunction %void %_ptr_CrossWorkgroup__struct_11 +%uint_2100483600 = OpConstant %uint 2100483600 + %uchar_128 = OpConstant %uchar 128 +%uint_2100480000 = OpConstant %uint 2100480000 +%uint_2100480000_0 = OpConstant %uint 2100480000 + %18 = OpConstantComposite %_struct_10 %uint_2100483600 %uchar_128 + %19 = OpConstantComposite %v2uint %uint_2100480000 %uint_2100480000_0 + %20 = OpConstantComposite %_struct_11 %19 %18 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %13 + %in = OpFunctionParameter %_ptr_CrossWorkgroup__struct_11 + %21 = OpLabel + %22 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %23 = OpCompositeExtract %uint %22 0 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup__struct_11 %in %23 + %25 = OpCopyObject %_struct_11 %20 + OpStore %24 %25 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_struct_struct_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/copy_struct_struct_simple.spvasm64 new file mode 100644 index 00000000..9573ada7 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_struct_struct_simple.spvasm64 @@ -0,0 +1,49 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "copy_struct_struct_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %v2uint = OpTypeVector %uint 2 + %uchar = OpTypeInt 8 0 + %_struct_11 = OpTypeStruct %uint %uchar + %_struct_12 = OpTypeStruct %v2uint %_struct_11 +%_ptr_CrossWorkgroup__struct_12 = OpTypePointer CrossWorkgroup %_struct_12 + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup__struct_12 + %ulong_32 = OpConstant %ulong 32 +%uint_2100483600 = OpConstant %uint 2100483600 + %uchar_128 = OpConstant %uchar 128 +%uint_2100480000 = OpConstant %uint 2100480000 +%uint_2100480000_0 = OpConstant %uint 2100480000 + %20 = OpConstantComposite %_struct_11 %uint_2100483600 %uchar_128 + %21 = OpConstantComposite %v2uint %uint_2100480000 %uint_2100480000_0 + %22 = OpConstantComposite %_struct_12 %21 %20 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %14 + %in = OpFunctionParameter %_ptr_CrossWorkgroup__struct_12 + %23 = OpLabel + %24 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %25 = OpCompositeExtract %ulong %24 0 + %26 = OpShiftLeftLogical %ulong %25 %ulong_32 + %27 = OpShiftRightArithmetic %ulong %26 %ulong_32 + %28 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup__struct_12 %in %27 + %29 = OpCopyObject %_struct_12 %22 + OpStore %28 %29 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_uchar_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/copy_uchar_simple.spvasm32 new file mode 100644 index 00000000..ca50b9f0 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_uchar_simple.spvasm32 @@ -0,0 +1,35 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 17 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "copy_uchar_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar + %uchar_19 = OpConstant %uchar 19 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %12 = OpLabel + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %in %14 + %16 = OpCopyObject %uchar %uchar_19 + OpStore %15 %16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_uchar_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/copy_uchar_simple.spvasm64 new file mode 100644 index 00000000..70726a92 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_uchar_simple.spvasm64 @@ -0,0 +1,39 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "copy_uchar_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar + %ulong_32 = OpConstant %ulong 32 + %uchar_19 = OpConstant %uchar 19 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %13 = OpLabel + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %in %17 + %19 = OpCopyObject %uchar %uchar_19 + OpStore %18 %19 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_uint_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/copy_uint_simple.spvasm32 new file mode 100644 index 00000000..b10ca7d7 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_uint_simple.spvasm32 @@ -0,0 +1,33 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "copy_uint_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint + %uint_54321 = OpConstant %uint 54321 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %9 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %11 = OpLabel + %12 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %13 = OpCompositeExtract %uint %12 0 + %14 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %13 + %15 = OpCopyObject %uint %uint_54321 + OpStore %14 %15 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_uint_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/copy_uint_simple.spvasm64 new file mode 100644 index 00000000..ace794d4 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_uint_simple.spvasm64 @@ -0,0 +1,38 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "copy_uint_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint + %ulong_32 = OpConstant %ulong 32 + %uint_54321 = OpConstant %uint 54321 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %13 = OpLabel + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %17 + %19 = OpCopyObject %uint %uint_54321 + OpStore %18 %19 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_ulong_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/copy_ulong_simple.spvasm32 new file mode 100644 index 00000000..91b60fcc --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_ulong_simple.spvasm32 @@ -0,0 +1,35 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 17 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "copy_ulong_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %ulong = OpTypeInt 64 0 +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong +%ulong_9223372036854775810 = OpConstant %ulong 9223372036854775810 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %12 = OpLabel + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %in %14 + %16 = OpCopyObject %ulong %ulong_9223372036854775810 + OpStore %15 %16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_ulong_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/copy_ulong_simple.spvasm64 new file mode 100644 index 00000000..5731a0a7 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_ulong_simple.spvasm64 @@ -0,0 +1,37 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "copy_ulong_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong + %ulong_32 = OpConstant %ulong 32 +%ulong_9223372036854775810 = OpConstant %ulong 9223372036854775810 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %9 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %12 = OpLabel + %13 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %ulong %13 0 + %15 = OpShiftLeftLogical %ulong %14 %ulong_32 + %16 = OpShiftRightArithmetic %ulong %15 %ulong_32 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %in %16 + %18 = OpCopyObject %ulong %ulong_9223372036854775810 + OpStore %17 %18 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_ushort_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/copy_ushort_simple.spvasm32 new file mode 100644 index 00000000..96d4f29d --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_ushort_simple.spvasm32 @@ -0,0 +1,35 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 17 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "copy_ushort_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %ushort = OpTypeInt 16 0 +%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort +%ushort_65000 = OpConstant %ushort 65000 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ushort + %12 = OpLabel + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %in %14 + %16 = OpCopyObject %ushort %ushort_65000 + OpStore %15 %16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/copy_ushort_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/copy_ushort_simple.spvasm64 new file mode 100644 index 00000000..cfce560f --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/copy_ushort_simple.spvasm64 @@ -0,0 +1,39 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "copy_ushort_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %ushort = OpTypeInt 16 0 +%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort + %ulong_32 = OpConstant %ulong 32 +%ushort_65000 = OpConstant %ushort 65000 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ushort + %13 = OpLabel + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %in %17 + %19 = OpCopyObject %ushort %ushort_65000 + OpStore %18 %19 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_aliased.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_aliased.spvasm32 new file mode 100644 index 00000000..ea571a18 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_aliased.spvasm32 @@ -0,0 +1,43 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 22 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "decorate_aliased" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %6 Aliased + %6 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %6 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %13 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %13 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %entry = OpLabel + %14 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %uint %14 0 + %16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %15 + %17 = OpLoad %uint %16 Aligned 4 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %15 + %19 = OpLoad %uint %18 Aligned 4 + %20 = OpIAdd %uint %17 %19 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %15 + OpStore %21 %20 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_aliased.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_aliased.spvasm64 new file mode 100644 index 00000000..1e686003 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_aliased.spvasm64 @@ -0,0 +1,48 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "decorate_aliased" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %6 Aliased + %6 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %6 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %14 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %entry = OpLabel + %16 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %ulong %16 0 + %18 = OpShiftLeftLogical %ulong %17 %ulong_32 + %19 = OpShiftRightArithmetic %ulong %18 %ulong_32 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %19 + %21 = OpLoad %uint %20 Aligned 4 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %19 + %23 = OpLoad %uint %22 Aligned 4 + %24 = OpIAdd %uint %21 %23 + %25 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %19 + OpStore %25 %24 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_alignment.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_alignment.spvasm32 new file mode 100644 index 00000000..51ed0e3c --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_alignment.spvasm32 @@ -0,0 +1,43 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 22 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "decorate_alignment" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %6 Alignment 4 + %6 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %6 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %13 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %13 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %entry = OpLabel + %14 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %uint %14 0 + %16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %15 + %17 = OpLoad %uint %16 Aligned 4 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %15 + %19 = OpLoad %uint %18 Aligned 4 + %20 = OpIAdd %uint %17 %19 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %15 + OpStore %21 %20 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_alignment.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_alignment.spvasm64 new file mode 100644 index 00000000..e7b4bde4 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_alignment.spvasm64 @@ -0,0 +1,48 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "decorate_alignment" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %6 Alignment 4 + %6 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %6 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %14 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %entry = OpLabel + %16 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %ulong %16 0 + %18 = OpShiftLeftLogical %ulong %17 %ulong_32 + %19 = OpShiftRightArithmetic %ulong %18 %ulong_32 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %19 + %21 = OpLoad %uint %20 Aligned 4 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %19 + %23 = OpLoad %uint %22 Aligned 4 + %24 = OpIAdd %uint %21 %23 + %25 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %19 + OpStore %25 %24 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_coherent.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_coherent.spvasm32 new file mode 100644 index 00000000..158d7e43 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_coherent.spvasm32 @@ -0,0 +1,81 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 40 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability ImageBasic + OpCapability LiteralSampler + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "decorate_coherent" %__spirv_BuiltInGlobalInvocationId %__spirv_BuiltInGlobalSize + OpName %sampler "sampler" + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %__spirv_BuiltInGlobalSize "__spirv_BuiltInGlobalSize" + OpName %dst "dst" + OpName %src "src" + OpName %entry "entry" + OpName %call "call" + OpName %call1 "call1" + OpName %call2 "call2" + OpName %mul "mul" + OpName %add "add" + OpName %vecinit "vecinit" + OpName %vecinit6 "vecinit6" + OpName %TempSampledImage "TempSampledImage" + OpName %call7_old "call7.old" + OpName %arrayidx "arrayidx" + OpDecorate %src Coherent + OpDecorate %19 Constant + %19 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalSize BuiltIn GlobalSize + OpDecorate %dst FuncParamAttr NoCapture + OpDecorate %sampler LinkageAttributes "sampler" Export + OpDecorate %__spirv_BuiltInGlobalSize LinkageAttributes "__spirv_BuiltInGlobalSize" Import + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %sampler Alignment 4 + OpGroupDecorate %19 %sampler %__spirv_BuiltInGlobalInvocationId %__spirv_BuiltInGlobalSize + %uint = OpTypeInt 32 0 + %uint_16 = OpConstant %uint 16 +%_ptr_Input_uint = OpTypePointer Input %uint +%_ptr_UniformConstant_uint = OpTypePointer UniformConstant %uint + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %v4uint = OpTypeVector %uint 4 +%_ptr_CrossWorkgroup_v4uint = OpTypePointer CrossWorkgroup %v4uint + %28 = OpTypeImage %void 2D 0 0 0 0 Unknown ReadOnly + %29 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4uint %28 + %v2uint = OpTypeVector %uint 2 + %31 = OpTypeSampler + %32 = OpTypeSampledImage %28 + %float = OpTypeFloat 32 + %34 = OpConstantSampler %31 None 0 Nearest + %float_0 = OpConstant %float 0 + %sampler = OpVariable %_ptr_UniformConstant_uint UniformConstant %uint_16 +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3uint Input +%__spirv_BuiltInGlobalSize = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %29 + %dst = OpFunctionParameter %_ptr_CrossWorkgroup_v4uint + %src = OpFunctionParameter %28 + %entry = OpLabel + %36 = OpUndef %v2uint + %37 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId Aligned 0 + %call = OpCompositeExtract %uint %37 0 + %38 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId Aligned 0 + %call1 = OpCompositeExtract %uint %38 1 + %39 = OpLoad %v3uint %__spirv_BuiltInGlobalSize Aligned 0 + %call2 = OpCompositeExtract %uint %39 0 + %mul = OpIMul %uint %call2 %call1 + %add = OpIAdd %uint %mul %call + %vecinit = OpCompositeInsert %v2uint %call1 %36 0 + %vecinit6 = OpCompositeInsert %v2uint %call %vecinit 1 +%TempSampledImage = OpSampledImage %32 %src %34 + %call7_old = OpImageSampleExplicitLod %v4uint %TempSampledImage %vecinit6 Lod %float_0 + %arrayidx = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4uint %dst %add + OpStore %arrayidx %call7_old Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_coherent.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_coherent.spvasm64 new file mode 100644 index 00000000..205a21c3 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_coherent.spvasm64 @@ -0,0 +1,94 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 47 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability ImageBasic + OpCapability LiteralSampler + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "decorate_coherent" %__spirv_BuiltInGlobalInvocationId %__spirv_BuiltInGlobalSize + OpName %sampler "sampler" + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %__spirv_BuiltInGlobalSize "__spirv_BuiltInGlobalSize" + OpName %dst "dst" + OpName %src "src" + OpName %entry "entry" + OpName %call "call" + OpName %conv "conv" + OpName %call1 "call1" + OpName %conv2 "conv2" + OpName %conv3 "conv3" + OpName %call4 "call4" + OpName %mul "mul" + OpName %add "add" + OpName %vecinit "vecinit" + OpName %vecinit10 "vecinit10" + OpName %TempSampledImage "TempSampledImage" + OpName %call11_old "call11.old" + OpName %sext "sext" + OpName %idxprom "idxprom" + OpName %arrayidx "arrayidx" + OpDecorate %src Coherent + OpDecorate %24 Constant + %24 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalSize BuiltIn GlobalSize + OpDecorate %dst FuncParamAttr NoCapture + OpDecorate %sampler LinkageAttributes "sampler" Export + OpDecorate %__spirv_BuiltInGlobalSize LinkageAttributes "__spirv_BuiltInGlobalSize" Import + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %sampler Alignment 4 + OpGroupDecorate %24 %sampler %__spirv_BuiltInGlobalInvocationId %__spirv_BuiltInGlobalSize + %uint = OpTypeInt 32 0 + %ulong = OpTypeInt 64 0 + %uint_16 = OpConstant %uint 16 + %ulong_32 = OpConstant %ulong 32 +%_ptr_Input_uint = OpTypePointer Input %uint +%_ptr_UniformConstant_uint = OpTypePointer UniformConstant %uint + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %v4uint = OpTypeVector %uint 4 +%_ptr_CrossWorkgroup_v4uint = OpTypePointer CrossWorkgroup %v4uint + %35 = OpTypeImage %void 2D 0 0 0 0 Unknown ReadOnly + %36 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4uint %35 + %v2uint = OpTypeVector %uint 2 + %38 = OpTypeSampler + %39 = OpTypeSampledImage %35 + %float = OpTypeFloat 32 + %41 = OpConstantSampler %38 None 0 Nearest + %float_0 = OpConstant %float 0 + %sampler = OpVariable %_ptr_UniformConstant_uint UniformConstant %uint_16 +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3ulong Input +%__spirv_BuiltInGlobalSize = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %36 + %dst = OpFunctionParameter %_ptr_CrossWorkgroup_v4uint + %src = OpFunctionParameter %35 + %entry = OpLabel + %43 = OpUndef %v2uint + %44 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId Aligned 0 + %call = OpCompositeExtract %ulong %44 0 + %conv = OpUConvert %uint %call + %45 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId Aligned 0 + %call1 = OpCompositeExtract %ulong %45 1 + %conv2 = OpUConvert %uint %call1 + %conv3 = OpSConvert %ulong %conv2 + %46 = OpLoad %v3ulong %__spirv_BuiltInGlobalSize Aligned 0 + %call4 = OpCompositeExtract %ulong %46 0 + %mul = OpIMul %ulong %conv3 %call4 + %add = OpIAdd %ulong %mul %call + %vecinit = OpCompositeInsert %v2uint %conv2 %43 0 + %vecinit10 = OpCompositeInsert %v2uint %conv %vecinit 1 +%TempSampledImage = OpSampledImage %39 %src %41 + %call11_old = OpImageSampleExplicitLod %v4uint %TempSampledImage %vecinit10 Lod %float_0 + %sext = OpShiftLeftLogical %ulong %add %ulong_32 + %idxprom = OpShiftRightArithmetic %ulong %sext %ulong_32 + %arrayidx = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4uint %dst %idxprom + OpStore %arrayidx %call11_old Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_constant.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_constant.spvasm32 new file mode 100644 index 00000000..2bfd5a23 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_constant.spvasm32 @@ -0,0 +1,43 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 22 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "decorate_constant" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %6 Constant + %6 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %6 %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %13 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %13 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %entry = OpLabel + %14 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %uint %14 0 + %16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %15 + %17 = OpLoad %uint %16 Aligned 4 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %15 + %19 = OpLoad %uint %18 Aligned 4 + %20 = OpIAdd %uint %17 %19 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %15 + OpStore %21 %20 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_constant.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_constant.spvasm64 new file mode 100644 index 00000000..a1408ae4 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_constant.spvasm64 @@ -0,0 +1,48 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "decorate_constant" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %6 Constant + %6 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %6 %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %14 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %entry = OpLabel + %16 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %ulong %16 0 + %18 = OpShiftLeftLogical %ulong %17 %ulong_32 + %19 = OpShiftRightArithmetic %ulong %18 %ulong_32 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %19 + %21 = OpLoad %uint %20 Aligned 4 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %19 + %23 = OpLoad %uint %22 Aligned 4 + %24 = OpIAdd %uint %21 %23 + %25 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %19 + OpStore %25 %24 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_constant_fail.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_constant_fail.spvasm32 new file mode 100644 index 00000000..a5a71f60 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_constant_fail.spvasm32 @@ -0,0 +1,43 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 22 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "decorate_constant" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %6 Constant + %6 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %6 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %13 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %13 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %entry = OpLabel + %14 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %uint %14 0 + %16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %15 + %17 = OpLoad %uint %16 Aligned 4 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %15 + %19 = OpLoad %uint %18 Aligned 4 + %20 = OpIAdd %uint %17 %19 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %15 + OpStore %21 %20 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_constant_fail.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_constant_fail.spvasm64 new file mode 100644 index 00000000..df02172b --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_constant_fail.spvasm64 @@ -0,0 +1,48 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "decorate_constant" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %6 Constant + %6 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %6 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %14 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %entry = OpLabel + %16 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %ulong %16 0 + %18 = OpShiftLeftLogical %ulong %17 %ulong_32 + %19 = OpShiftRightArithmetic %ulong %18 %ulong_32 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %19 + %21 = OpLoad %uint %20 Aligned 4 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %19 + %23 = OpLoad %uint %22 Aligned 4 + %24 = OpIAdd %uint %21 %23 + %25 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %19 + OpStore %25 %24 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_cpacked.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_cpacked.spvasm32 new file mode 100644 index 00000000..5aa89a46 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_cpacked.spvasm32 @@ -0,0 +1,38 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "decorate_cpacked" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %_struct_4 CPacked + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 + %_struct_4 = OpTypeStruct %uint %uchar +%_ptr_CrossWorkgroup__struct_4 = OpTypePointer CrossWorkgroup %_struct_4 + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup__struct_4 +%uint_2100483600 = OpConstant %uint 2100483600 + %uchar_127 = OpConstant %uchar 127 + %14 = OpConstantComposite %_struct_4 %uint_2100483600 %uchar_127 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup__struct_4 + %15 = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup__struct_4 %in %17 + OpStore %18 %14 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_cpacked.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_cpacked.spvasm64 new file mode 100644 index 00000000..41dee76d --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_cpacked.spvasm64 @@ -0,0 +1,43 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "decorate_cpacked" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %_struct_4 CPacked + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %uchar = OpTypeInt 8 0 + %_struct_4 = OpTypeStruct %uint %uchar +%_ptr_CrossWorkgroup__struct_4 = OpTypePointer CrossWorkgroup %_struct_4 + %12 = OpTypeFunction %void %_ptr_CrossWorkgroup__struct_4 + %ulong_32 = OpConstant %ulong 32 +%uint_2100483600 = OpConstant %uint 2100483600 + %uchar_127 = OpConstant %uchar 127 + %16 = OpConstantComposite %_struct_4 %uint_2100483600 %uchar_127 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %12 + %in = OpFunctionParameter %_ptr_CrossWorkgroup__struct_4 + %17 = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup__struct_4 %in %21 + OpStore %22 %16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_nonreadable.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_nonreadable.spvasm32 new file mode 100644 index 00000000..16c89ff5 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_nonreadable.spvasm32 @@ -0,0 +1,66 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability ImageBasic + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "decorate_nonreadable" %__spirv_BuiltInGlobalInvocationId %__spirv_BuiltInGlobalSize + OpSource OpenCL_C 100000 + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %__spirv_BuiltInGlobalSize "__spirv_BuiltInGlobalSize" + OpName %dst "dst" + OpName %src "src" + OpName %entry "entry" + OpName %call "call" + OpName %call1 "call1" + OpName %call2 "call2" + OpName %mul "mul" + OpName %add "add" + OpName %vecinit "vecinit" + OpName %vecinit3 "vecinit3" + OpName %arrayidx "arrayidx" + OpDecorate %dst NonReadable + OpDecorate %16 Constant + %16 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalSize BuiltIn GlobalSize + OpDecorate %src FuncParamAttr NoCapture + OpDecorate %__spirv_BuiltInGlobalSize LinkageAttributes "__spirv_BuiltInGlobalSize" Import + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpGroupDecorate %16 %__spirv_BuiltInGlobalInvocationId %__spirv_BuiltInGlobalSize + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %21 = OpTypeImage %void 2D 0 0 0 0 Unknown WriteOnly + %v4uint = OpTypeVector %uint 4 +%_ptr_CrossWorkgroup_v4uint = OpTypePointer CrossWorkgroup %v4uint + %24 = OpTypeFunction %void %21 %_ptr_CrossWorkgroup_v4uint + %v2uint = OpTypeVector %uint 2 +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3uint Input +%__spirv_BuiltInGlobalSize = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %24 + %dst = OpFunctionParameter %21 + %src = OpFunctionParameter %_ptr_CrossWorkgroup_v4uint + %entry = OpLabel + %26 = OpUndef %v2uint + %27 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId Aligned 0 + %call = OpCompositeExtract %uint %27 0 + %28 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId Aligned 0 + %call1 = OpCompositeExtract %uint %28 1 + %29 = OpLoad %v3uint %__spirv_BuiltInGlobalSize Aligned 0 + %call2 = OpCompositeExtract %uint %29 0 + %mul = OpIMul %uint %call2 %call1 + %add = OpIAdd %uint %mul %call + %vecinit = OpCompositeInsert %v2uint %call1 %26 0 + %vecinit3 = OpCompositeInsert %v2uint %call %vecinit 1 + %arrayidx = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4uint %src %add + %30 = OpLoad %v4uint %arrayidx Aligned 16 + OpImageWrite %dst %vecinit3 %30 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_nonreadable.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_nonreadable.spvasm64 new file mode 100644 index 00000000..cd5a0065 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_nonreadable.spvasm64 @@ -0,0 +1,79 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 38 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability ImageBasic + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "decorate_nonreadable" %__spirv_BuiltInGlobalInvocationId %__spirv_BuiltInGlobalSize + OpSource OpenCL_C 100000 + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %__spirv_BuiltInGlobalSize "__spirv_BuiltInGlobalSize" + OpName %dst "dst" + OpName %src "src" + OpName %entry "entry" + OpName %call "call" + OpName %conv "conv" + OpName %call1 "call1" + OpName %conv2 "conv2" + OpName %conv3 "conv3" + OpName %call4 "call4" + OpName %mul "mul" + OpName %add "add" + OpName %vecinit "vecinit" + OpName %vecinit7 "vecinit7" + OpName %sext "sext" + OpName %idxprom "idxprom" + OpName %arrayidx "arrayidx" + OpDecorate %dst NonReadable + OpDecorate %21 Constant + %21 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalSize BuiltIn GlobalSize + OpDecorate %src FuncParamAttr NoCapture + OpDecorate %__spirv_BuiltInGlobalSize LinkageAttributes "__spirv_BuiltInGlobalSize" Import + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpGroupDecorate %21 %__spirv_BuiltInGlobalInvocationId %__spirv_BuiltInGlobalSize + %ulong = OpTypeInt 64 0 + %uint = OpTypeInt 32 0 + %ulong_32 = OpConstant %ulong 32 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %28 = OpTypeImage %void 2D 0 0 0 0 Unknown WriteOnly + %v4uint = OpTypeVector %uint 4 +%_ptr_CrossWorkgroup_v4uint = OpTypePointer CrossWorkgroup %v4uint + %31 = OpTypeFunction %void %28 %_ptr_CrossWorkgroup_v4uint + %v2uint = OpTypeVector %uint 2 +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3ulong Input +%__spirv_BuiltInGlobalSize = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %31 + %dst = OpFunctionParameter %28 + %src = OpFunctionParameter %_ptr_CrossWorkgroup_v4uint + %entry = OpLabel + %33 = OpUndef %v2uint + %34 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId Aligned 0 + %call = OpCompositeExtract %ulong %34 0 + %conv = OpUConvert %uint %call + %35 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId Aligned 0 + %call1 = OpCompositeExtract %ulong %35 1 + %conv2 = OpUConvert %uint %call1 + %conv3 = OpSConvert %ulong %conv2 + %36 = OpLoad %v3ulong %__spirv_BuiltInGlobalSize Aligned 0 + %call4 = OpCompositeExtract %ulong %36 0 + %mul = OpIMul %ulong %conv3 %call4 + %add = OpIAdd %ulong %mul %call + %vecinit = OpCompositeInsert %v2uint %conv2 %33 0 + %vecinit7 = OpCompositeInsert %v2uint %conv %vecinit 1 + %sext = OpShiftLeftLogical %ulong %add %ulong_32 + %idxprom = OpShiftRightArithmetic %ulong %sext %ulong_32 + %arrayidx = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4uint %src %idxprom + %37 = OpLoad %v4uint %arrayidx Aligned 16 + OpImageWrite %dst %vecinit7 %37 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_nonwritable.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_nonwritable.spvasm32 new file mode 100644 index 00000000..64c378de --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_nonwritable.spvasm32 @@ -0,0 +1,81 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 40 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability ImageBasic + OpCapability LiteralSampler + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "decorate_nonwritable" %__spirv_BuiltInGlobalInvocationId %__spirv_BuiltInGlobalSize + OpName %sampler "sampler" + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %__spirv_BuiltInGlobalSize "__spirv_BuiltInGlobalSize" + OpName %dst "dst" + OpName %src "src" + OpName %entry "entry" + OpName %call "call" + OpName %call1 "call1" + OpName %call2 "call2" + OpName %mul "mul" + OpName %add "add" + OpName %vecinit "vecinit" + OpName %vecinit6 "vecinit6" + OpName %TempSampledImage "TempSampledImage" + OpName %call7_old "call7.old" + OpName %arrayidx "arrayidx" + OpDecorate %src NonWritable + OpDecorate %19 Constant + %19 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalSize BuiltIn GlobalSize + OpDecorate %dst FuncParamAttr NoCapture + OpDecorate %sampler LinkageAttributes "sampler" Export + OpDecorate %__spirv_BuiltInGlobalSize LinkageAttributes "__spirv_BuiltInGlobalSize" Import + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %sampler Alignment 4 + OpGroupDecorate %19 %sampler %__spirv_BuiltInGlobalInvocationId %__spirv_BuiltInGlobalSize + %uint = OpTypeInt 32 0 + %uint_16 = OpConstant %uint 16 +%_ptr_Input_uint = OpTypePointer Input %uint +%_ptr_UniformConstant_uint = OpTypePointer UniformConstant %uint + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %v4uint = OpTypeVector %uint 4 +%_ptr_CrossWorkgroup_v4uint = OpTypePointer CrossWorkgroup %v4uint + %28 = OpTypeImage %void 2D 0 0 0 0 Unknown ReadOnly + %29 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4uint %28 + %v2uint = OpTypeVector %uint 2 + %31 = OpTypeSampler + %32 = OpTypeSampledImage %28 + %float = OpTypeFloat 32 + %34 = OpConstantSampler %31 None 0 Nearest + %float_0 = OpConstant %float 0 + %sampler = OpVariable %_ptr_UniformConstant_uint UniformConstant %uint_16 +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3uint Input +%__spirv_BuiltInGlobalSize = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %29 + %dst = OpFunctionParameter %_ptr_CrossWorkgroup_v4uint + %src = OpFunctionParameter %28 + %entry = OpLabel + %36 = OpUndef %v2uint + %37 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId Aligned 0 + %call = OpCompositeExtract %uint %37 0 + %38 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId Aligned 0 + %call1 = OpCompositeExtract %uint %38 1 + %39 = OpLoad %v3uint %__spirv_BuiltInGlobalSize Aligned 0 + %call2 = OpCompositeExtract %uint %39 0 + %mul = OpIMul %uint %call2 %call1 + %add = OpIAdd %uint %mul %call + %vecinit = OpCompositeInsert %v2uint %call1 %36 0 + %vecinit6 = OpCompositeInsert %v2uint %call %vecinit 1 +%TempSampledImage = OpSampledImage %32 %src %34 + %call7_old = OpImageSampleExplicitLod %v4uint %TempSampledImage %vecinit6 Lod %float_0 + %arrayidx = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4uint %dst %add + OpStore %arrayidx %call7_old Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_nonwritable.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_nonwritable.spvasm64 new file mode 100644 index 00000000..7df1989a --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_nonwritable.spvasm64 @@ -0,0 +1,94 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 47 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability ImageBasic + OpCapability LiteralSampler + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "decorate_nonwritable" %__spirv_BuiltInGlobalInvocationId %__spirv_BuiltInGlobalSize + OpName %sampler "sampler" + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %__spirv_BuiltInGlobalSize "__spirv_BuiltInGlobalSize" + OpName %dst "dst" + OpName %src "src" + OpName %entry "entry" + OpName %call "call" + OpName %conv "conv" + OpName %call1 "call1" + OpName %conv2 "conv2" + OpName %conv3 "conv3" + OpName %call4 "call4" + OpName %mul "mul" + OpName %add "add" + OpName %vecinit "vecinit" + OpName %vecinit10 "vecinit10" + OpName %TempSampledImage "TempSampledImage" + OpName %call11_old "call11.old" + OpName %sext "sext" + OpName %idxprom "idxprom" + OpName %arrayidx "arrayidx" + OpDecorate %src NonWritable + OpDecorate %24 Constant + %24 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalSize BuiltIn GlobalSize + OpDecorate %dst FuncParamAttr NoCapture + OpDecorate %sampler LinkageAttributes "sampler" Export + OpDecorate %__spirv_BuiltInGlobalSize LinkageAttributes "__spirv_BuiltInGlobalSize" Import + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %sampler Alignment 4 + OpGroupDecorate %24 %sampler %__spirv_BuiltInGlobalInvocationId %__spirv_BuiltInGlobalSize + %uint = OpTypeInt 32 0 + %ulong = OpTypeInt 64 0 + %uint_16 = OpConstant %uint 16 + %ulong_32 = OpConstant %ulong 32 +%_ptr_Input_uint = OpTypePointer Input %uint +%_ptr_UniformConstant_uint = OpTypePointer UniformConstant %uint + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %v4uint = OpTypeVector %uint 4 +%_ptr_CrossWorkgroup_v4uint = OpTypePointer CrossWorkgroup %v4uint + %35 = OpTypeImage %void 2D 0 0 0 0 Unknown ReadOnly + %36 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4uint %35 + %v2uint = OpTypeVector %uint 2 + %38 = OpTypeSampler + %39 = OpTypeSampledImage %35 + %float = OpTypeFloat 32 + %41 = OpConstantSampler %38 None 0 Nearest + %float_0 = OpConstant %float 0 + %sampler = OpVariable %_ptr_UniformConstant_uint UniformConstant %uint_16 +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3ulong Input +%__spirv_BuiltInGlobalSize = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %36 + %dst = OpFunctionParameter %_ptr_CrossWorkgroup_v4uint + %src = OpFunctionParameter %35 + %entry = OpLabel + %43 = OpUndef %v2uint + %44 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId Aligned 0 + %call = OpCompositeExtract %ulong %44 0 + %conv = OpUConvert %uint %call + %45 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId Aligned 0 + %call1 = OpCompositeExtract %ulong %45 1 + %conv2 = OpUConvert %uint %call1 + %conv3 = OpSConvert %ulong %conv2 + %46 = OpLoad %v3ulong %__spirv_BuiltInGlobalSize Aligned 0 + %call4 = OpCompositeExtract %ulong %46 0 + %mul = OpIMul %ulong %conv3 %call4 + %add = OpIAdd %ulong %mul %call + %vecinit = OpCompositeInsert %v2uint %conv2 %43 0 + %vecinit10 = OpCompositeInsert %v2uint %conv %vecinit 1 +%TempSampledImage = OpSampledImage %39 %src %41 + %call11_old = OpImageSampleExplicitLod %v4uint %TempSampledImage %vecinit10 Lod %float_0 + %sext = OpShiftLeftLogical %ulong %add %ulong_32 + %idxprom = OpShiftRightArithmetic %ulong %sext %ulong_32 + %arrayidx = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4uint %dst %idxprom + OpStore %arrayidx %call11_old Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_restrict.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_restrict.spvasm32 new file mode 100644 index 00000000..7c06103a --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_restrict.spvasm32 @@ -0,0 +1,43 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 22 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "decorate_restrict" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %6 Restrict + %6 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %6 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %13 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %13 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %entry = OpLabel + %14 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %uint %14 0 + %16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %15 + %17 = OpLoad %uint %16 Aligned 4 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %15 + %19 = OpLoad %uint %18 Aligned 4 + %20 = OpIAdd %uint %17 %19 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %15 + OpStore %21 %20 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_restrict.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_restrict.spvasm64 new file mode 100644 index 00000000..5bdaf73e --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_restrict.spvasm64 @@ -0,0 +1,48 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "decorate_restrict" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %6 Restrict + %6 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %6 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %14 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %entry = OpLabel + %16 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %ulong %16 0 + %18 = OpShiftLeftLogical %ulong %17 %ulong_32 + %19 = OpShiftRightArithmetic %ulong %18 %ulong_32 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %19 + %21 = OpLoad %uint %20 Aligned 4 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %19 + %23 = OpLoad %uint %22 Aligned 4 + %24 = OpIAdd %uint %21 %23 + %25 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %19 + OpStore %25 %24 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_rounding_rte_double_long.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rte_double_long.spvasm32 new file mode 100644 index 00000000..32b6fe8e --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rte_double_long.spvasm32 @@ -0,0 +1,42 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 21 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "decorate_rounding_rte_double_long" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %6 FPRoundingMode RTE + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %ulong = OpTypeInt 64 0 +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong %_ptr_CrossWorkgroup_double +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %in = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %in %17 + %19 = OpLoad %double %18 + %6 = OpConvertFToS %ulong %19 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %res %17 + OpStore %20 %6 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_rounding_rte_double_long.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rte_double_long.spvasm64 new file mode 100644 index 00000000..b7b37544 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rte_double_long.spvasm64 @@ -0,0 +1,44 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "decorate_rounding_rte_double_long" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %6 FPRoundingMode RTE + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong %_ptr_CrossWorkgroup_double + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %14 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %in = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %16 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %ulong %16 0 + %18 = OpShiftLeftLogical %ulong %17 %ulong_32 + %19 = OpShiftRightArithmetic %ulong %18 %ulong_32 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %in %19 + %21 = OpLoad %double %20 + %6 = OpConvertFToS %ulong %21 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %res %19 + OpStore %22 %6 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_rounding_rte_float_int.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rte_float_int.spvasm32 new file mode 100644 index 00000000..45e840a3 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rte_float_int.spvasm32 @@ -0,0 +1,39 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "decorate_rounding_rte_float_int" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %6 FPRoundingMode RTE + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %14 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %15 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %16 = OpCompositeExtract %uint %15 0 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %16 + %18 = OpLoad %float %17 Aligned 4 + %6 = OpConvertFToS %uint %18 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %16 + OpStore %19 %6 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_rounding_rte_float_int.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rte_float_int.spvasm64 new file mode 100644 index 00000000..771975eb --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rte_float_int.spvasm64 @@ -0,0 +1,44 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "decorate_rounding_rte_float_int" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %6 FPRoundingMode RTE + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %20 + %22 = OpLoad %float %21 Aligned 4 + %6 = OpConvertFToS %uint %22 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %20 + OpStore %23 %6 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtn_double_long.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtn_double_long.spvasm32 new file mode 100644 index 00000000..6ca20231 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtn_double_long.spvasm32 @@ -0,0 +1,42 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 21 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "decorate_rounding_rtn_double_long" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %6 FPRoundingMode RTN + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %ulong = OpTypeInt 64 0 +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong %_ptr_CrossWorkgroup_double +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %in = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %in %17 + %19 = OpLoad %double %18 + %6 = OpConvertFToS %ulong %19 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %res %17 + OpStore %20 %6 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtn_double_long.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtn_double_long.spvasm64 new file mode 100644 index 00000000..13b3e2b3 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtn_double_long.spvasm64 @@ -0,0 +1,44 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "decorate_rounding_rtn_double_long" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %6 FPRoundingMode RTN + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong %_ptr_CrossWorkgroup_double + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %14 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %in = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %16 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %ulong %16 0 + %18 = OpShiftLeftLogical %ulong %17 %ulong_32 + %19 = OpShiftRightArithmetic %ulong %18 %ulong_32 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %in %19 + %21 = OpLoad %double %20 + %6 = OpConvertFToS %ulong %21 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %res %19 + OpStore %22 %6 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtn_float_int.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtn_float_int.spvasm32 new file mode 100644 index 00000000..60e16d02 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtn_float_int.spvasm32 @@ -0,0 +1,39 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "decorate_rounding_rtn_float_int" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %6 FPRoundingMode RTN + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %14 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %15 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %16 = OpCompositeExtract %uint %15 0 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %16 + %18 = OpLoad %float %17 Aligned 4 + %6 = OpConvertFToS %uint %18 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %16 + OpStore %19 %6 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtn_float_int.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtn_float_int.spvasm64 new file mode 100644 index 00000000..41fb1c77 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtn_float_int.spvasm64 @@ -0,0 +1,44 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "decorate_rounding_rtn_float_int" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %6 FPRoundingMode RTN + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %20 + %22 = OpLoad %float %21 Aligned 4 + %6 = OpConvertFToS %uint %22 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %20 + OpStore %23 %6 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtp_double_long.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtp_double_long.spvasm32 new file mode 100644 index 00000000..a2b097a6 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtp_double_long.spvasm32 @@ -0,0 +1,42 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 21 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "decorate_rounding_rtp_double_long" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %6 FPRoundingMode RTP + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %ulong = OpTypeInt 64 0 +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong %_ptr_CrossWorkgroup_double +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %in = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %in %17 + %19 = OpLoad %double %18 + %6 = OpConvertFToS %ulong %19 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %res %17 + OpStore %20 %6 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtp_double_long.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtp_double_long.spvasm64 new file mode 100644 index 00000000..4eaa81db --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtp_double_long.spvasm64 @@ -0,0 +1,44 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "decorate_rounding_rtp_double_long" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %6 FPRoundingMode RTP + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong %_ptr_CrossWorkgroup_double + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %14 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %in = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %16 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %ulong %16 0 + %18 = OpShiftLeftLogical %ulong %17 %ulong_32 + %19 = OpShiftRightArithmetic %ulong %18 %ulong_32 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %in %19 + %21 = OpLoad %double %20 + %6 = OpConvertFToS %ulong %21 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %res %19 + OpStore %22 %6 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtp_float_int.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtp_float_int.spvasm32 new file mode 100644 index 00000000..cce1cbc6 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtp_float_int.spvasm32 @@ -0,0 +1,39 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "decorate_rounding_rtp_float_int" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %6 FPRoundingMode RTP + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %14 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %15 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %16 = OpCompositeExtract %uint %15 0 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %16 + %18 = OpLoad %float %17 Aligned 4 + %6 = OpConvertFToS %uint %18 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %16 + OpStore %19 %6 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtp_float_int.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtp_float_int.spvasm64 new file mode 100644 index 00000000..6f315dba --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtp_float_int.spvasm64 @@ -0,0 +1,44 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "decorate_rounding_rtp_float_int" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %6 FPRoundingMode RTP + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %20 + %22 = OpLoad %float %21 Aligned 4 + %6 = OpConvertFToS %uint %22 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %20 + OpStore %23 %6 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtz_double_long.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtz_double_long.spvasm32 new file mode 100644 index 00000000..d9dfe729 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtz_double_long.spvasm32 @@ -0,0 +1,42 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 21 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "decorate_rounding_rtz_double_long" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %6 FPRoundingMode RTZ + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %ulong = OpTypeInt 64 0 +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong %_ptr_CrossWorkgroup_double +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %in = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %in %17 + %19 = OpLoad %double %18 + %6 = OpConvertFToS %ulong %19 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %res %17 + OpStore %20 %6 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtz_double_long.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtz_double_long.spvasm64 new file mode 100644 index 00000000..7738138f --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtz_double_long.spvasm64 @@ -0,0 +1,44 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "decorate_rounding_rtz_double_long" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %6 FPRoundingMode RTZ + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong %_ptr_CrossWorkgroup_double + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %14 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %in = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %16 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %ulong %16 0 + %18 = OpShiftLeftLogical %ulong %17 %ulong_32 + %19 = OpShiftRightArithmetic %ulong %18 %ulong_32 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %in %19 + %21 = OpLoad %double %20 + %6 = OpConvertFToS %ulong %21 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %res %19 + OpStore %22 %6 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtz_float_int.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtz_float_int.spvasm32 new file mode 100644 index 00000000..288df6db --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtz_float_int.spvasm32 @@ -0,0 +1,39 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "decorate_rounding_rtz_float_int" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %6 FPRoundingMode RTZ + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %14 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %15 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %16 = OpCompositeExtract %uint %15 0 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %16 + %18 = OpLoad %float %17 Aligned 4 + %6 = OpConvertFToS %uint %18 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %16 + OpStore %19 %6 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtz_float_int.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtz_float_int.spvasm64 new file mode 100644 index 00000000..728d8bb2 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_rounding_rtz_float_int.spvasm64 @@ -0,0 +1,44 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "decorate_rounding_rtz_float_int" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %6 FPRoundingMode RTZ + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %20 + %22 = OpLoad %float %21 Aligned 4 + %6 = OpConvertFToS %uint %22 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %20 + OpStore %23 %6 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_char.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_char.spvasm32 new file mode 100644 index 00000000..5437067f --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_char.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "decorate_saturated_conversion_char" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %7 SaturatedConversion + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %lhs %18 + %20 = OpLoad %float %19 Aligned 4 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %18 + %22 = OpLoad %float %21 Aligned 4 + %23 = OpFMul %float %20 %22 + %7 = OpConvertFToS %uchar %23 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %res %18 + OpStore %24 %7 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_char.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_char.spvasm64 new file mode 100644 index 00000000..ba4d6492 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_char.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "decorate_saturated_conversion_char" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %7 SaturatedConversion + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %lhs %21 + %23 = OpLoad %float %22 Aligned 4 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %21 + %25 = OpLoad %float %24 Aligned 4 + %26 = OpFMul %float %23 %25 + %7 = OpConvertFToS %uchar %26 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %res %21 + OpStore %27 %7 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_int.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_int.spvasm32 new file mode 100644 index 00000000..3fa47c97 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_int.spvasm32 @@ -0,0 +1,45 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "decorate_saturated_conversion_int" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %7 SaturatedConversion + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %lhs %17 + %19 = OpLoad %double %18 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %rhs %17 + %21 = OpLoad %double %20 + %22 = OpFMul %double %19 %21 + %7 = OpConvertFToS %uint %22 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %17 + OpStore %23 %7 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_int.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_int.spvasm64 new file mode 100644 index 00000000..8609e208 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_int.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "decorate_saturated_conversion_int" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %7 SaturatedConversion + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %lhs %21 + %23 = OpLoad %double %22 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %rhs %21 + %25 = OpLoad %double %24 + %26 = OpFMul %double %23 %25 + %7 = OpConvertFToS %uint %26 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %21 + OpStore %27 %7 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_short.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_short.spvasm32 new file mode 100644 index 00000000..dbb3b44d --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_short.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "decorate_saturated_conversion_short" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %7 SaturatedConversion + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %ushort = OpTypeInt 16 0 +%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_ushort + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %lhs %18 + %20 = OpLoad %float %19 Aligned 4 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %18 + %22 = OpLoad %float %21 Aligned 4 + %23 = OpFMul %float %20 %22 + %7 = OpConvertFToS %ushort %23 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %res %18 + OpStore %24 %7 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_short.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_short.spvasm64 new file mode 100644 index 00000000..2915c12c --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_short.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "decorate_saturated_conversion_short" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %7 SaturatedConversion + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %ushort = OpTypeInt 16 0 +%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_ushort + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %lhs %21 + %23 = OpLoad %float %22 Aligned 4 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %21 + %25 = OpLoad %float %24 Aligned 4 + %26 = OpFMul %float %23 %25 + %7 = OpConvertFToS %ushort %26 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %res %21 + OpStore %27 %7 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_uchar.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_uchar.spvasm32 new file mode 100644 index 00000000..9bffb686 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_uchar.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "decorate_saturated_conversion_uchar" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %7 SaturatedConversion + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %lhs %18 + %20 = OpLoad %float %19 Aligned 4 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %18 + %22 = OpLoad %float %21 Aligned 4 + %23 = OpFMul %float %20 %22 + %7 = OpConvertFToU %uchar %23 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %res %18 + OpStore %24 %7 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_uchar.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_uchar.spvasm64 new file mode 100644 index 00000000..354639fe --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_uchar.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "decorate_saturated_conversion_uchar" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %7 SaturatedConversion + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %lhs %21 + %23 = OpLoad %float %22 Aligned 4 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %21 + %25 = OpLoad %float %24 Aligned 4 + %26 = OpFMul %float %23 %25 + %7 = OpConvertFToU %uchar %26 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %res %21 + OpStore %27 %7 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_uint.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_uint.spvasm32 new file mode 100644 index 00000000..06724891 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_uint.spvasm32 @@ -0,0 +1,45 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "decorate_saturated_conversion_uint" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %7 SaturatedConversion + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %lhs %17 + %19 = OpLoad %double %18 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %rhs %17 + %21 = OpLoad %double %20 + %22 = OpFMul %double %19 %21 + %7 = OpConvertFToU %uint %22 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %17 + OpStore %23 %7 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_uint.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_uint.spvasm64 new file mode 100644 index 00000000..7d9efb08 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_uint.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "decorate_saturated_conversion_uint" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %7 SaturatedConversion + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %lhs %21 + %23 = OpLoad %double %22 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %rhs %21 + %25 = OpLoad %double %24 + %26 = OpFMul %double %23 %25 + %7 = OpConvertFToS %uint %26 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %21 + OpStore %27 %7 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_ushort.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_ushort.spvasm32 new file mode 100644 index 00000000..ffbb4177 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_ushort.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "decorate_saturated_conversion_ushort" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %7 SaturatedConversion + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %ushort = OpTypeInt 16 0 +%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_ushort + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %lhs %18 + %20 = OpLoad %float %19 Aligned 4 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %18 + %22 = OpLoad %float %21 Aligned 4 + %23 = OpFMul %float %20 %22 + %7 = OpConvertFToU %ushort %23 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %res %18 + OpStore %24 %7 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_ushort.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_ushort.spvasm64 new file mode 100644 index 00000000..317f9929 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_ushort.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "decorate_saturated_conversion_ushort" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %7 SaturatedConversion + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %ushort = OpTypeInt 16 0 +%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_ushort + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %lhs %21 + %23 = OpLoad %float %22 Aligned 4 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %21 + %25 = OpLoad %float %24 Aligned 4 + %26 = OpFMul %float %23 %25 + %7 = OpConvertFToU %ushort %26 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %res %21 + OpStore %27 %7 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_volatile.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_volatile.spvasm32 new file mode 100644 index 00000000..f6eb3577 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_volatile.spvasm32 @@ -0,0 +1,81 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 40 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability ImageBasic + OpCapability LiteralSampler + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "decorate_volatile" %__spirv_BuiltInGlobalInvocationId %__spirv_BuiltInGlobalSize + OpName %sampler "sampler" + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %__spirv_BuiltInGlobalSize "__spirv_BuiltInGlobalSize" + OpName %dst "dst" + OpName %src "src" + OpName %entry "entry" + OpName %call "call" + OpName %call1 "call1" + OpName %call2 "call2" + OpName %mul "mul" + OpName %add "add" + OpName %vecinit "vecinit" + OpName %vecinit6 "vecinit6" + OpName %TempSampledImage "TempSampledImage" + OpName %call7_old "call7.old" + OpName %arrayidx "arrayidx" + OpDecorate %src Volatile + OpDecorate %19 Constant + %19 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalSize BuiltIn GlobalSize + OpDecorate %dst FuncParamAttr NoCapture + OpDecorate %sampler LinkageAttributes "sampler" Export + OpDecorate %__spirv_BuiltInGlobalSize LinkageAttributes "__spirv_BuiltInGlobalSize" Import + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %sampler Alignment 4 + OpGroupDecorate %19 %sampler %__spirv_BuiltInGlobalInvocationId %__spirv_BuiltInGlobalSize + %uint = OpTypeInt 32 0 + %uint_16 = OpConstant %uint 16 +%_ptr_Input_uint = OpTypePointer Input %uint +%_ptr_UniformConstant_uint = OpTypePointer UniformConstant %uint + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %v4uint = OpTypeVector %uint 4 +%_ptr_CrossWorkgroup_v4uint = OpTypePointer CrossWorkgroup %v4uint + %28 = OpTypeImage %void 2D 0 0 0 0 Unknown ReadOnly + %29 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4uint %28 + %v2uint = OpTypeVector %uint 2 + %31 = OpTypeSampler + %32 = OpTypeSampledImage %28 + %float = OpTypeFloat 32 + %34 = OpConstantSampler %31 None 0 Nearest + %float_0 = OpConstant %float 0 + %sampler = OpVariable %_ptr_UniformConstant_uint UniformConstant %uint_16 +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3uint Input +%__spirv_BuiltInGlobalSize = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %29 + %dst = OpFunctionParameter %_ptr_CrossWorkgroup_v4uint + %src = OpFunctionParameter %28 + %entry = OpLabel + %36 = OpUndef %v2uint + %37 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId Aligned 0 + %call = OpCompositeExtract %uint %37 0 + %38 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId Aligned 0 + %call1 = OpCompositeExtract %uint %38 1 + %39 = OpLoad %v3uint %__spirv_BuiltInGlobalSize Aligned 0 + %call2 = OpCompositeExtract %uint %39 0 + %mul = OpIMul %uint %call2 %call1 + %add = OpIAdd %uint %mul %call + %vecinit = OpCompositeInsert %v2uint %call1 %36 0 + %vecinit6 = OpCompositeInsert %v2uint %call %vecinit 1 +%TempSampledImage = OpSampledImage %32 %src %34 + %call7_old = OpImageSampleExplicitLod %v4uint %TempSampledImage %vecinit6 Lod %float_0 + %arrayidx = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4uint %dst %add + OpStore %arrayidx %call7_old Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_volatile.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_volatile.spvasm64 new file mode 100644 index 00000000..ef2623b7 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_volatile.spvasm64 @@ -0,0 +1,94 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 47 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability ImageBasic + OpCapability LiteralSampler + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "decorate_volatile" %__spirv_BuiltInGlobalInvocationId %__spirv_BuiltInGlobalSize + OpName %sampler "sampler" + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %__spirv_BuiltInGlobalSize "__spirv_BuiltInGlobalSize" + OpName %dst "dst" + OpName %src "src" + OpName %entry "entry" + OpName %call "call" + OpName %conv "conv" + OpName %call1 "call1" + OpName %conv2 "conv2" + OpName %conv3 "conv3" + OpName %call4 "call4" + OpName %mul "mul" + OpName %add "add" + OpName %vecinit "vecinit" + OpName %vecinit10 "vecinit10" + OpName %TempSampledImage "TempSampledImage" + OpName %call11_old "call11.old" + OpName %sext "sext" + OpName %idxprom "idxprom" + OpName %arrayidx "arrayidx" + OpDecorate %src Volatile + OpDecorate %24 Constant + %24 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalSize BuiltIn GlobalSize + OpDecorate %dst FuncParamAttr NoCapture + OpDecorate %sampler LinkageAttributes "sampler" Export + OpDecorate %__spirv_BuiltInGlobalSize LinkageAttributes "__spirv_BuiltInGlobalSize" Import + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %sampler Alignment 4 + OpGroupDecorate %24 %sampler %__spirv_BuiltInGlobalInvocationId %__spirv_BuiltInGlobalSize + %uint = OpTypeInt 32 0 + %ulong = OpTypeInt 64 0 + %uint_16 = OpConstant %uint 16 + %ulong_32 = OpConstant %ulong 32 +%_ptr_Input_uint = OpTypePointer Input %uint +%_ptr_UniformConstant_uint = OpTypePointer UniformConstant %uint + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %v4uint = OpTypeVector %uint 4 +%_ptr_CrossWorkgroup_v4uint = OpTypePointer CrossWorkgroup %v4uint + %35 = OpTypeImage %void 2D 0 0 0 0 Unknown ReadOnly + %36 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4uint %35 + %v2uint = OpTypeVector %uint 2 + %38 = OpTypeSampler + %39 = OpTypeSampledImage %35 + %float = OpTypeFloat 32 + %41 = OpConstantSampler %38 None 0 Nearest + %float_0 = OpConstant %float 0 + %sampler = OpVariable %_ptr_UniformConstant_uint UniformConstant %uint_16 +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3ulong Input +%__spirv_BuiltInGlobalSize = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %36 + %dst = OpFunctionParameter %_ptr_CrossWorkgroup_v4uint + %src = OpFunctionParameter %35 + %entry = OpLabel + %43 = OpUndef %v2uint + %44 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId Aligned 0 + %call = OpCompositeExtract %ulong %44 0 + %conv = OpUConvert %uint %call + %45 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId Aligned 0 + %call1 = OpCompositeExtract %ulong %45 1 + %conv2 = OpUConvert %uint %call1 + %conv3 = OpSConvert %ulong %conv2 + %46 = OpLoad %v3ulong %__spirv_BuiltInGlobalSize Aligned 0 + %call4 = OpCompositeExtract %ulong %46 0 + %mul = OpIMul %ulong %conv3 %call4 + %add = OpIAdd %ulong %mul %call + %vecinit = OpCompositeInsert %v2uint %conv2 %43 0 + %vecinit10 = OpCompositeInsert %v2uint %conv %vecinit 1 +%TempSampledImage = OpSampledImage %39 %src %41 + %call11_old = OpImageSampleExplicitLod %v4uint %TempSampledImage %vecinit10 Lod %float_0 + %sext = OpShiftLeftLogical %ulong %add %ulong_32 + %idxprom = OpShiftRightArithmetic %ulong %sext %ulong_32 + %arrayidx = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4uint %dst %idxprom + OpStore %arrayidx %call11_old Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_int.spvasm32 b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_int.spvasm32 new file mode 100644 index 00000000..00416401 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_int.spvasm32 @@ -0,0 +1,47 @@ +; SPIR-V +; Version: 1.1 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpExtension "SPV_KHR_no_integer_wrap_decoration" + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_cl" %__spirv_BuiltInGlobalInvocationId + OpSource OpenCL_C 200000 + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %7 FuncParamAttr NoWrite + %7 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %8 NoSignedWrap + OpGroupDecorate %7 %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %14 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %15 = OpLabel + %16 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %17 + %19 = OpLoad %uint %18 Aligned 4 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %17 + %21 = OpLoad %uint %20 Aligned 4 + %8 = OpIAdd %uint %19 %21 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %17 + OpStore %22 %8 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_int.spvasm64 b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_int.spvasm64 new file mode 100644 index 00000000..ca398d6e --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_int.spvasm64 @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.1 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_cl" %__spirv_BuiltInGlobalInvocationId + OpSource OpenCL_C 200000 + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %7 FuncParamAttr NoWrite + %7 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %8 NoSignedWrap + OpGroupDecorate %7 %lhs %rhs + %ulong = OpTypeInt 64 0 + %uint = OpTypeInt 32 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %15 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %16 = OpLabel + %17 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpUConvert %uint %18 + %20 = OpSConvert %ulong %19 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %20 + %22 = OpLoad %uint %21 Aligned 4 + %23 = OpSConvert %ulong %19 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %23 + %25 = OpLoad %uint %24 Aligned 4 + %8 = OpIAdd %uint %22 %25 + %26 = OpSConvert %ulong %19 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %26 + OpStore %27 %8 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_uint.spvasm32 b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_uint.spvasm32 new file mode 100644 index 00000000..07f75e8b --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_uint.spvasm32 @@ -0,0 +1,47 @@ +; SPIR-V +; Version: 1.1 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpExtension "SPV_KHR_no_integer_wrap_decoration" + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_cl" %__spirv_BuiltInGlobalInvocationId + OpSource OpenCL_C 200000 + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %7 FuncParamAttr NoWrite + %7 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %8 NoUnsignedWrap + OpGroupDecorate %7 %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %14 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %15 = OpLabel + %16 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %17 + %19 = OpLoad %uint %18 Aligned 4 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %17 + %21 = OpLoad %uint %20 Aligned 4 + %8 = OpIAdd %uint %19 %21 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %17 + OpStore %22 %8 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_uint.spvasm64 b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_uint.spvasm64 new file mode 100644 index 00000000..1d362cbb --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_uint.spvasm64 @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.1 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_cl" %__spirv_BuiltInGlobalInvocationId + OpSource OpenCL_C 200000 + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %7 FuncParamAttr NoWrite + %7 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %8 NoUnsignedWrap + OpGroupDecorate %7 %lhs %rhs + %ulong = OpTypeInt 64 0 + %uint = OpTypeInt 32 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %15 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %16 = OpLabel + %17 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpUConvert %uint %18 + %20 = OpSConvert %ulong %19 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %20 + %22 = OpLoad %uint %21 Aligned 4 + %23 = OpSConvert %ulong %19 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %23 + %25 = OpLoad %uint %24 Aligned 4 + %8 = OpIAdd %uint %22 %25 + %26 = OpSConvert %ulong %19 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %26 + OpStore %27 %8 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_int.spvasm32 b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_int.spvasm32 new file mode 100644 index 00000000..19bf4770 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_int.spvasm32 @@ -0,0 +1,47 @@ +; SPIR-V +; Version: 1.1 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpExtension "SPV_KHR_no_integer_wrap_decoration" + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_cl" %__spirv_BuiltInGlobalInvocationId + OpSource OpenCL_C 200000 + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %7 FuncParamAttr NoWrite + %7 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %8 NoSignedWrap + OpGroupDecorate %7 %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %14 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %15 = OpLabel + %16 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %17 + %19 = OpLoad %uint %18 Aligned 4 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %17 + %21 = OpLoad %uint %20 Aligned 4 + %8 = OpIMul %uint %19 %21 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %17 + OpStore %22 %8 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_int.spvasm64 b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_int.spvasm64 new file mode 100644 index 00000000..65c5b273 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_int.spvasm64 @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.1 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_cl" %__spirv_BuiltInGlobalInvocationId + OpSource OpenCL_C 200000 + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %7 FuncParamAttr NoWrite + %7 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %8 NoSignedWrap + OpGroupDecorate %7 %lhs %rhs + %ulong = OpTypeInt 64 0 + %uint = OpTypeInt 32 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %15 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %16 = OpLabel + %17 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpUConvert %uint %18 + %20 = OpSConvert %ulong %19 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %20 + %22 = OpLoad %uint %21 Aligned 4 + %23 = OpSConvert %ulong %19 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %23 + %25 = OpLoad %uint %24 Aligned 4 + %8 = OpIMul %uint %22 %25 + %26 = OpSConvert %ulong %19 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %26 + OpStore %27 %8 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_uint.spvasm32 b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_uint.spvasm32 new file mode 100644 index 00000000..dc70be61 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_uint.spvasm32 @@ -0,0 +1,47 @@ +; SPIR-V +; Version: 1.1 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpExtension "SPV_KHR_no_integer_wrap_decoration" + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_cl" %__spirv_BuiltInGlobalInvocationId + OpSource OpenCL_C 200000 + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %7 FuncParamAttr NoWrite + %7 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %8 NoUnsignedWrap + OpGroupDecorate %7 %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %14 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %15 = OpLabel + %16 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %17 + %19 = OpLoad %uint %18 Aligned 4 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %17 + %21 = OpLoad %uint %20 Aligned 4 + %8 = OpIMul %uint %19 %21 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %17 + OpStore %22 %8 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_uint.spvasm64 b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_uint.spvasm64 new file mode 100644 index 00000000..344f9619 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_uint.spvasm64 @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.1 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_cl" %__spirv_BuiltInGlobalInvocationId + OpSource OpenCL_C 200000 + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %7 FuncParamAttr NoWrite + %7 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %8 NoUnsignedWrap + OpGroupDecorate %7 %lhs %rhs + %ulong = OpTypeInt 64 0 + %uint = OpTypeInt 32 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %15 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %16 = OpLabel + %17 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpUConvert %uint %18 + %20 = OpSConvert %ulong %19 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %20 + %22 = OpLoad %uint %21 Aligned 4 + %23 = OpSConvert %ulong %19 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %23 + %25 = OpLoad %uint %24 Aligned 4 + %8 = OpIMul %uint %22 %25 + %26 = OpSConvert %ulong %19 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %26 + OpStore %27 %8 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fnegate_int.spvasm32 b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fnegate_int.spvasm32 new file mode 100644 index 00000000..6d70518f --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fnegate_int.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.1 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 22 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpExtension "SPV_KHR_no_integer_wrap_decoration" + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_cl" %__spirv_BuiltInGlobalInvocationId + OpSource OpenCL_C 200000 + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %7 FuncParamAttr NoWrite + OpDecorate %8 NoSignedWrap + %7 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpGroupDecorate %7 %lhs %rhs + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %15 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %16 = OpLabel + %17 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %18 + %20 = OpLoad %uint %19 Aligned 4 + %8 = OpSNegate %uint %20 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %18 + OpStore %21 %8 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fnegate_int.spvasm64 b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fnegate_int.spvasm64 new file mode 100644 index 00000000..149143c5 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fnegate_int.spvasm64 @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.1 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_cl" %__spirv_BuiltInGlobalInvocationId + OpSource OpenCL_C 200000 + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %7 FuncParamAttr NoWrite + OpDecorate %8 NoSignedWrap + %7 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpGroupDecorate %7 %lhs %rhs + %ulong = OpTypeInt 64 0 + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %16 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %17 = OpLabel + %18 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpUConvert %uint %19 + %21 = OpSConvert %ulong %20 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %21 + %23 = OpLoad %uint %22 Aligned 4 + %8 = OpSNegate %uint %23 + %24 = OpSConvert %ulong %20 + %25 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %24 + OpStore %25 %8 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_int.spvasm32 b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_int.spvasm32 new file mode 100644 index 00000000..6bbfd651 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_int.spvasm32 @@ -0,0 +1,49 @@ +; SPIR-V +; Version: 1.1 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpExtension "SPV_KHR_no_integer_wrap_decoration" + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_cl" %__spirv_BuiltInGlobalInvocationId + OpSource OpenCL_C 200000 + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %7 FuncParamAttr NoWrite + %7 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %8 NoSignedWrap + OpGroupDecorate %7 %lhs %rhs + %uint = OpTypeInt 32 0 + %uint_31 = OpConstant %uint 31 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %15 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %16 = OpLabel + %17 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %18 + %20 = OpLoad %uint %19 Aligned 4 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %18 + %22 = OpLoad %uint %21 Aligned 4 + %23 = OpBitwiseAnd %uint %22 %uint_31 + %8 = OpShiftLeftLogical %uint %20 %23 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %18 + OpStore %24 %8 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_int.spvasm64 b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_int.spvasm64 new file mode 100644 index 00000000..611cb112 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_int.spvasm64 @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.1 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_cl" %__spirv_BuiltInGlobalInvocationId + OpSource OpenCL_C 200000 + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %7 FuncParamAttr NoWrite + %7 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %8 NoSignedWrap + OpGroupDecorate %7 %lhs %rhs + %ulong = OpTypeInt 64 0 + %uint = OpTypeInt 32 0 + %uint_31 = OpConstant %uint 31 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %16 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %17 = OpLabel + %18 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpUConvert %uint %19 + %21 = OpSConvert %ulong %20 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %21 + %23 = OpLoad %uint %22 Aligned 4 + %24 = OpSConvert %ulong %20 + %25 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %24 + %26 = OpLoad %uint %25 Aligned 4 + %27 = OpBitwiseAnd %uint %26 %uint_31 + %8 = OpShiftLeftLogical %uint %23 %27 + %28 = OpSConvert %ulong %20 + %29 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %28 + OpStore %29 %8 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_uint.spvasm32 b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_uint.spvasm32 new file mode 100644 index 00000000..1e7bc6c3 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_uint.spvasm32 @@ -0,0 +1,49 @@ +; SPIR-V +; Version: 1.1 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpExtension "SPV_KHR_no_integer_wrap_decoration" + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_cl" %__spirv_BuiltInGlobalInvocationId + OpSource OpenCL_C 200000 + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %7 FuncParamAttr NoWrite + %7 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %8 NoUnsignedWrap + OpGroupDecorate %7 %lhs %rhs + %uint = OpTypeInt 32 0 + %uint_31 = OpConstant %uint 31 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %15 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %16 = OpLabel + %17 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %18 + %20 = OpLoad %uint %19 Aligned 4 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %18 + %22 = OpLoad %uint %21 Aligned 4 + %23 = OpBitwiseAnd %uint %22 %uint_31 + %8 = OpShiftLeftLogical %uint %20 %23 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %18 + OpStore %24 %8 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_uint.spvasm64 b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_uint.spvasm64 new file mode 100644 index 00000000..7f7ecbbc --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_uint.spvasm64 @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.1 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_cl" %__spirv_BuiltInGlobalInvocationId + OpSource OpenCL_C 200000 + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %7 FuncParamAttr NoWrite + %7 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %8 NoUnsignedWrap + OpGroupDecorate %7 %lhs %rhs + %ulong = OpTypeInt 64 0 + %uint = OpTypeInt 32 0 + %uint_31 = OpConstant %uint 31 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %16 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %17 = OpLabel + %18 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpUConvert %uint %19 + %21 = OpSConvert %ulong %20 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %21 + %23 = OpLoad %uint %22 Aligned 4 + %24 = OpSConvert %ulong %20 + %25 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %24 + %26 = OpLoad %uint %25 Aligned 4 + %27 = OpBitwiseAnd %uint %26 %uint_31 + %8 = OpShiftLeftLogical %uint %23 %27 + %28 = OpSConvert %ulong %20 + %29 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %28 + OpStore %29 %8 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_int.spvasm32 b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_int.spvasm32 new file mode 100644 index 00000000..45cefcfd --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_int.spvasm32 @@ -0,0 +1,47 @@ +; SPIR-V +; Version: 1.1 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpExtension "SPV_KHR_no_integer_wrap_decoration" + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_cl" %__spirv_BuiltInGlobalInvocationId + OpSource OpenCL_C 200000 + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %7 FuncParamAttr NoWrite + %7 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpGroupDecorate %7 %lhs %rhs + OpDecorate %8 NoSignedWrap + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %14 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %15 = OpLabel + %16 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %17 + %19 = OpLoad %uint %18 Aligned 4 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %17 + %21 = OpLoad %uint %20 Aligned 4 + %8 = OpISub %uint %19 %21 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %17 + OpStore %22 %8 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_int.spvasm64 b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_int.spvasm64 new file mode 100644 index 00000000..0b99dc52 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_int.spvasm64 @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.1 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_cl" %__spirv_BuiltInGlobalInvocationId + OpSource OpenCL_C 200000 + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %7 FuncParamAttr NoWrite + %7 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpGroupDecorate %7 %lhs %rhs + OpDecorate %8 NoSignedWrap + %ulong = OpTypeInt 64 0 + %uint = OpTypeInt 32 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %15 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %16 = OpLabel + %17 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpUConvert %uint %18 + %20 = OpSConvert %ulong %19 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %20 + %22 = OpLoad %uint %21 Aligned 4 + %23 = OpSConvert %ulong %19 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %23 + %25 = OpLoad %uint %24 Aligned 4 + %8 = OpISub %uint %22 %25 + %26 = OpSConvert %ulong %19 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %26 + OpStore %27 %8 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_uint.spvasm32 b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_uint.spvasm32 new file mode 100644 index 00000000..feaa27f3 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_uint.spvasm32 @@ -0,0 +1,47 @@ +; SPIR-V +; Version: 1.1 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpExtension "SPV_KHR_no_integer_wrap_decoration" + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_cl" %__spirv_BuiltInGlobalInvocationId + OpSource OpenCL_C 200000 + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %7 FuncParamAttr NoWrite + %7 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpGroupDecorate %7 %lhs %rhs + OpDecorate %8 NoUnsignedWrap + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %14 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %15 = OpLabel + %16 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %17 + %19 = OpLoad %uint %18 Aligned 4 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %17 + %21 = OpLoad %uint %20 Aligned 4 + %8 = OpISub %uint %19 %21 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %17 + OpStore %22 %8 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_uint.spvasm64 b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_uint.spvasm64 new file mode 100644 index 00000000..d1069979 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_uint.spvasm64 @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.1 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_cl" %__spirv_BuiltInGlobalInvocationId + OpSource OpenCL_C 200000 + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %7 FuncParamAttr NoWrite + %7 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpGroupDecorate %7 %lhs %rhs + OpDecorate %8 NoUnsignedWrap + %ulong = OpTypeInt 64 0 + %uint = OpTypeInt 32 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %15 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %16 = OpLabel + %17 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpUConvert %uint %18 + %20 = OpSConvert %ulong %19 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %20 + %22 = OpLoad %uint %21 Aligned 4 + %23 = OpSConvert %ulong %19 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %23 + %25 = OpLoad %uint %24 Aligned 4 + %8 = OpISub %uint %22 %25 + %26 = OpSConvert %ulong %19 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %26 + OpStore %27 %8 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fadd_double.spvasm32 b/test_conformance/spirv_new/spirv_asm/fadd_double.spvasm32 new file mode 100644 index 00000000..ee4be5a7 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fadd_double.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %lhs %17 + %19 = OpLoad %double %18 Aligned 8 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %rhs %17 + %21 = OpLoad %double %20 Aligned 8 + %22 = OpFAdd %double %19 %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %res %17 + OpStore %23 %22 Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fadd_double.spvasm64 b/test_conformance/spirv_new/spirv_asm/fadd_double.spvasm64 new file mode 100644 index 00000000..7a7f3e12 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fadd_double.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %lhs %20 + %22 = OpLoad %double %21 Aligned 8 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %rhs %20 + %24 = OpLoad %double %23 Aligned 8 + %25 = OpFAdd %double %22 %24 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %res %20 + OpStore %26 %25 Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fadd_double2.spvasm32 b/test_conformance/spirv_new/spirv_asm/fadd_double2.spvasm32 new file mode 100644 index 00000000..b8cab7e9 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fadd_double2.spvasm32 @@ -0,0 +1,47 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %double = OpTypeFloat 64 + %v2double = OpTypeVector %double 2 +%_ptr_CrossWorkgroup_v2double = OpTypePointer CrossWorkgroup %v2double + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %entry = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %lhs %18 + %20 = OpLoad %v2double %19 Aligned 16 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %rhs %18 + %22 = OpLoad %v2double %21 Aligned 16 + %23 = OpFAdd %v2double %20 %22 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %res %18 + OpStore %24 %23 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fadd_double2.spvasm64 b/test_conformance/spirv_new/spirv_asm/fadd_double2.spvasm64 new file mode 100644 index 00000000..a4571dbe --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fadd_double2.spvasm64 @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %double = OpTypeFloat 64 + %v2double = OpTypeVector %double 2 +%_ptr_CrossWorkgroup_v2double = OpTypePointer CrossWorkgroup %v2double + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %entry = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %lhs %21 + %23 = OpLoad %v2double %22 Aligned 16 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %rhs %21 + %25 = OpLoad %v2double %24 Aligned 16 + %26 = OpFAdd %v2double %23 %25 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %res %21 + OpStore %27 %26 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fadd_float.spvasm32 b/test_conformance/spirv_new/spirv_asm/fadd_float.spvasm32 new file mode 100644 index 00000000..482f9a76 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fadd_float.spvasm32 @@ -0,0 +1,45 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %lhs %17 + %19 = OpLoad %float %18 Aligned 4 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %17 + %21 = OpLoad %float %20 Aligned 4 + %22 = OpFAdd %float %19 %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %res %17 + OpStore %23 %22 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fadd_float.spvasm64 b/test_conformance/spirv_new/spirv_asm/fadd_float.spvasm64 new file mode 100644 index 00000000..21d59772 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fadd_float.spvasm64 @@ -0,0 +1,49 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %lhs %20 + %22 = OpLoad %float %21 Aligned 4 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %20 + %24 = OpLoad %float %23 Aligned 4 + %25 = OpFAdd %float %22 %24 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %res %20 + OpStore %26 %25 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fadd_float4.spvasm32 b/test_conformance/spirv_new/spirv_asm/fadd_float4.spvasm32 new file mode 100644 index 00000000..d3c0e6d5 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fadd_float4.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_CrossWorkgroup_v4float = OpTypePointer CrossWorkgroup %v4float + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %entry = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %lhs %18 + %20 = OpLoad %v4float %19 Aligned 16 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %rhs %18 + %22 = OpLoad %v4float %21 Aligned 16 + %23 = OpFAdd %v4float %20 %22 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %res %18 + OpStore %24 %23 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fadd_float4.spvasm64 b/test_conformance/spirv_new/spirv_asm/fadd_float4.spvasm64 new file mode 100644 index 00000000..76519c39 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fadd_float4.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_CrossWorkgroup_v4float = OpTypePointer CrossWorkgroup %v4float + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %entry = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %lhs %21 + %23 = OpLoad %v4float %22 Aligned 16 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %rhs %21 + %25 = OpLoad %v4float %24 Aligned 16 + %26 = OpFAdd %v4float %23 %25 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %res %21 + OpStore %27 %26 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fadd_half.spvasm32 b/test_conformance/spirv_new/spirv_asm/fadd_half.spvasm32 new file mode 100644 index 00000000..f818cb40 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fadd_half.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %half = OpTypeFloat 16 +%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_half + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_half + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_half + %entry = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %lhs %17 + %19 = OpLoad %half %18 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %rhs %17 + %21 = OpLoad %half %20 + %22 = OpFAdd %half %19 %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %res %17 + OpStore %23 %22 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fadd_half.spvasm64 b/test_conformance/spirv_new/spirv_asm/fadd_half.spvasm64 new file mode 100644 index 00000000..1af41274 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fadd_half.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %half = OpTypeFloat 16 +%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_half + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_half + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_half + %entry = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %lhs %20 + %22 = OpLoad %half %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %rhs %20 + %24 = OpLoad %half %23 + %25 = OpFAdd %half %22 %24 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %res %20 + OpStore %26 %25 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fdiv_double.spvasm32 b/test_conformance/spirv_new/spirv_asm/fdiv_double.spvasm32 new file mode 100644 index 00000000..6e25c8fd --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fdiv_double.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %lhs %17 + %19 = OpLoad %double %18 Aligned 8 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %rhs %17 + %21 = OpLoad %double %20 Aligned 8 + %22 = OpFDiv %double %19 %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %res %17 + OpStore %23 %22 Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fdiv_double.spvasm64 b/test_conformance/spirv_new/spirv_asm/fdiv_double.spvasm64 new file mode 100644 index 00000000..efbd1e2a --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fdiv_double.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %lhs %20 + %22 = OpLoad %double %21 Aligned 8 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %rhs %20 + %24 = OpLoad %double %23 Aligned 8 + %25 = OpFDiv %double %22 %24 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %res %20 + OpStore %26 %25 Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fdiv_double2.spvasm32 b/test_conformance/spirv_new/spirv_asm/fdiv_double2.spvasm32 new file mode 100644 index 00000000..5169102a --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fdiv_double2.spvasm32 @@ -0,0 +1,47 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %double = OpTypeFloat 64 + %v2double = OpTypeVector %double 2 +%_ptr_CrossWorkgroup_v2double = OpTypePointer CrossWorkgroup %v2double + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %entry = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %lhs %18 + %20 = OpLoad %v2double %19 Aligned 16 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %rhs %18 + %22 = OpLoad %v2double %21 Aligned 16 + %23 = OpFDiv %v2double %20 %22 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %res %18 + OpStore %24 %23 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fdiv_double2.spvasm64 b/test_conformance/spirv_new/spirv_asm/fdiv_double2.spvasm64 new file mode 100644 index 00000000..9b73c4f1 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fdiv_double2.spvasm64 @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %double = OpTypeFloat 64 + %v2double = OpTypeVector %double 2 +%_ptr_CrossWorkgroup_v2double = OpTypePointer CrossWorkgroup %v2double + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %entry = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %lhs %21 + %23 = OpLoad %v2double %22 Aligned 16 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %rhs %21 + %25 = OpLoad %v2double %24 Aligned 16 + %26 = OpFDiv %v2double %23 %25 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %res %21 + OpStore %27 %26 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fdiv_float.spvasm32 b/test_conformance/spirv_new/spirv_asm/fdiv_float.spvasm32 new file mode 100644 index 00000000..69efe6f4 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fdiv_float.spvasm32 @@ -0,0 +1,45 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %lhs %17 + %19 = OpLoad %float %18 Aligned 4 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %17 + %21 = OpLoad %float %20 Aligned 4 + %22 = OpFDiv %float %19 %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %res %17 + OpStore %23 %22 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fdiv_float.spvasm64 b/test_conformance/spirv_new/spirv_asm/fdiv_float.spvasm64 new file mode 100644 index 00000000..06676f92 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fdiv_float.spvasm64 @@ -0,0 +1,49 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %lhs %20 + %22 = OpLoad %float %21 Aligned 4 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %20 + %24 = OpLoad %float %23 Aligned 4 + %25 = OpFDiv %float %22 %24 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %res %20 + OpStore %26 %25 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fdiv_float4.spvasm32 b/test_conformance/spirv_new/spirv_asm/fdiv_float4.spvasm32 new file mode 100644 index 00000000..3f1324a8 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fdiv_float4.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_CrossWorkgroup_v4float = OpTypePointer CrossWorkgroup %v4float + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %entry = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %lhs %18 + %20 = OpLoad %v4float %19 Aligned 16 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %rhs %18 + %22 = OpLoad %v4float %21 Aligned 16 + %23 = OpFDiv %v4float %20 %22 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %res %18 + OpStore %24 %23 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fdiv_float4.spvasm64 b/test_conformance/spirv_new/spirv_asm/fdiv_float4.spvasm64 new file mode 100644 index 00000000..aeab8e86 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fdiv_float4.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_CrossWorkgroup_v4float = OpTypePointer CrossWorkgroup %v4float + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %entry = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %lhs %21 + %23 = OpLoad %v4float %22 Aligned 16 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %rhs %21 + %25 = OpLoad %v4float %24 Aligned 16 + %26 = OpFDiv %v4float %23 %25 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %res %21 + OpStore %27 %26 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fdiv_half.spvasm32 b/test_conformance/spirv_new/spirv_asm/fdiv_half.spvasm32 new file mode 100644 index 00000000..35c8c875 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fdiv_half.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %half = OpTypeFloat 16 +%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_half + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_half + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_half + %entry = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %lhs %17 + %19 = OpLoad %half %18 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %rhs %17 + %21 = OpLoad %half %20 + %22 = OpFDiv %half %19 %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %res %17 + OpStore %23 %22 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fdiv_half.spvasm64 b/test_conformance/spirv_new/spirv_asm/fdiv_half.spvasm64 new file mode 100644 index 00000000..9630ec1c --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fdiv_half.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %half = OpTypeFloat 16 +%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_half + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_half + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_half + %entry = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %lhs %20 + %22 = OpLoad %half %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %rhs %20 + %24 = OpLoad %half %23 + %25 = OpFDiv %half %22 %24 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %res %20 + OpStore %26 %25 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fmod_double.spvasm32 b/test_conformance/spirv_new/spirv_asm/fmod_double.spvasm32 new file mode 100644 index 00000000..06d65d20 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fmod_double.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %lhs %17 + %19 = OpLoad %double %18 Aligned 8 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %rhs %17 + %21 = OpLoad %double %20 Aligned 8 + %22 = OpFMod %double %19 %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %res %17 + OpStore %23 %22 Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fmod_double.spvasm64 b/test_conformance/spirv_new/spirv_asm/fmod_double.spvasm64 new file mode 100644 index 00000000..92121ec1 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fmod_double.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %lhs %20 + %22 = OpLoad %double %21 Aligned 8 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %rhs %20 + %24 = OpLoad %double %23 Aligned 8 + %25 = OpFMod %double %22 %24 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %res %20 + OpStore %26 %25 Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fmod_double2.spvasm32 b/test_conformance/spirv_new/spirv_asm/fmod_double2.spvasm32 new file mode 100644 index 00000000..f50bb99d --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fmod_double2.spvasm32 @@ -0,0 +1,47 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %double = OpTypeFloat 64 + %v2double = OpTypeVector %double 2 +%_ptr_CrossWorkgroup_v2double = OpTypePointer CrossWorkgroup %v2double + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %entry = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %lhs %18 + %20 = OpLoad %v2double %19 Aligned 16 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %rhs %18 + %22 = OpLoad %v2double %21 Aligned 16 + %23 = OpFMod %v2double %20 %22 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %res %18 + OpStore %24 %23 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fmod_double2.spvasm64 b/test_conformance/spirv_new/spirv_asm/fmod_double2.spvasm64 new file mode 100644 index 00000000..bdaa98eb --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fmod_double2.spvasm64 @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %double = OpTypeFloat 64 + %v2double = OpTypeVector %double 2 +%_ptr_CrossWorkgroup_v2double = OpTypePointer CrossWorkgroup %v2double + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %entry = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %lhs %21 + %23 = OpLoad %v2double %22 Aligned 16 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %rhs %21 + %25 = OpLoad %v2double %24 Aligned 16 + %26 = OpFMod %v2double %23 %25 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %res %21 + OpStore %27 %26 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fmod_float.spvasm32 b/test_conformance/spirv_new/spirv_asm/fmod_float.spvasm32 new file mode 100644 index 00000000..d1e79614 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fmod_float.spvasm32 @@ -0,0 +1,45 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %lhs %17 + %19 = OpLoad %float %18 Aligned 4 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %17 + %21 = OpLoad %float %20 Aligned 4 + %22 = OpFMod %float %19 %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %res %17 + OpStore %23 %22 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fmod_float.spvasm64 b/test_conformance/spirv_new/spirv_asm/fmod_float.spvasm64 new file mode 100644 index 00000000..ce085d5d --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fmod_float.spvasm64 @@ -0,0 +1,49 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %lhs %20 + %22 = OpLoad %float %21 Aligned 4 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %20 + %24 = OpLoad %float %23 Aligned 4 + %25 = OpFMod %float %22 %24 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %res %20 + OpStore %26 %25 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fmod_float4.spvasm32 b/test_conformance/spirv_new/spirv_asm/fmod_float4.spvasm32 new file mode 100644 index 00000000..60235eaf --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fmod_float4.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_CrossWorkgroup_v4float = OpTypePointer CrossWorkgroup %v4float + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %entry = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %lhs %18 + %20 = OpLoad %v4float %19 Aligned 16 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %rhs %18 + %22 = OpLoad %v4float %21 Aligned 16 + %23 = OpFMod %v4float %20 %22 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %res %18 + OpStore %24 %23 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fmod_float4.spvasm64 b/test_conformance/spirv_new/spirv_asm/fmod_float4.spvasm64 new file mode 100644 index 00000000..58663d69 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fmod_float4.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_CrossWorkgroup_v4float = OpTypePointer CrossWorkgroup %v4float + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %entry = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %lhs %21 + %23 = OpLoad %v4float %22 Aligned 16 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %rhs %21 + %25 = OpLoad %v4float %24 Aligned 16 + %26 = OpFMod %v4float %23 %25 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %res %21 + OpStore %27 %26 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fmod_half.spvasm32 b/test_conformance/spirv_new/spirv_asm/fmod_half.spvasm32 new file mode 100644 index 00000000..1884299f --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fmod_half.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %half = OpTypeFloat 16 +%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_half + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_half + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_half + %entry = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %lhs %17 + %19 = OpLoad %half %18 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %rhs %17 + %21 = OpLoad %half %20 + %22 = OpFMod %half %19 %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %res %17 + OpStore %23 %22 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fmod_half.spvasm64 b/test_conformance/spirv_new/spirv_asm/fmod_half.spvasm64 new file mode 100644 index 00000000..62798c26 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fmod_half.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %half = OpTypeFloat 16 +%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_half + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_half + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_half + %entry = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %lhs %20 + %22 = OpLoad %half %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %rhs %20 + %24 = OpLoad %half %23 + %25 = OpFMod %half %22 %24 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %res %20 + OpStore %26 %25 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fmul_double.spvasm32 b/test_conformance/spirv_new/spirv_asm/fmul_double.spvasm32 new file mode 100644 index 00000000..a9c47798 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fmul_double.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %lhs %17 + %19 = OpLoad %double %18 Aligned 8 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %rhs %17 + %21 = OpLoad %double %20 Aligned 8 + %22 = OpFMul %double %19 %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %res %17 + OpStore %23 %22 Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fmul_double.spvasm64 b/test_conformance/spirv_new/spirv_asm/fmul_double.spvasm64 new file mode 100644 index 00000000..308f2d9c --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fmul_double.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %lhs %20 + %22 = OpLoad %double %21 Aligned 8 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %rhs %20 + %24 = OpLoad %double %23 Aligned 8 + %25 = OpFMul %double %22 %24 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %res %20 + OpStore %26 %25 Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fmul_double2.spvasm32 b/test_conformance/spirv_new/spirv_asm/fmul_double2.spvasm32 new file mode 100644 index 00000000..2101c7fa --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fmul_double2.spvasm32 @@ -0,0 +1,47 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %double = OpTypeFloat 64 + %v2double = OpTypeVector %double 2 +%_ptr_CrossWorkgroup_v2double = OpTypePointer CrossWorkgroup %v2double + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %entry = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %lhs %18 + %20 = OpLoad %v2double %19 Aligned 16 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %rhs %18 + %22 = OpLoad %v2double %21 Aligned 16 + %23 = OpFMul %v2double %20 %22 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %res %18 + OpStore %24 %23 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fmul_double2.spvasm64 b/test_conformance/spirv_new/spirv_asm/fmul_double2.spvasm64 new file mode 100644 index 00000000..05d01136 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fmul_double2.spvasm64 @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %double = OpTypeFloat 64 + %v2double = OpTypeVector %double 2 +%_ptr_CrossWorkgroup_v2double = OpTypePointer CrossWorkgroup %v2double + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %entry = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %lhs %21 + %23 = OpLoad %v2double %22 Aligned 16 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %rhs %21 + %25 = OpLoad %v2double %24 Aligned 16 + %26 = OpFMul %v2double %23 %25 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %res %21 + OpStore %27 %26 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fmul_float.spvasm32 b/test_conformance/spirv_new/spirv_asm/fmul_float.spvasm32 new file mode 100644 index 00000000..284739f7 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fmul_float.spvasm32 @@ -0,0 +1,45 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %lhs %17 + %19 = OpLoad %float %18 Aligned 4 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %17 + %21 = OpLoad %float %20 Aligned 4 + %22 = OpFMul %float %19 %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %res %17 + OpStore %23 %22 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fmul_float.spvasm64 b/test_conformance/spirv_new/spirv_asm/fmul_float.spvasm64 new file mode 100644 index 00000000..f082b9fa --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fmul_float.spvasm64 @@ -0,0 +1,49 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %lhs %20 + %22 = OpLoad %float %21 Aligned 4 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %20 + %24 = OpLoad %float %23 Aligned 4 + %25 = OpFMul %float %22 %24 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %res %20 + OpStore %26 %25 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fmul_float4.spvasm32 b/test_conformance/spirv_new/spirv_asm/fmul_float4.spvasm32 new file mode 100644 index 00000000..ca9a1f32 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fmul_float4.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_CrossWorkgroup_v4float = OpTypePointer CrossWorkgroup %v4float + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %entry = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %lhs %18 + %20 = OpLoad %v4float %19 Aligned 16 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %rhs %18 + %22 = OpLoad %v4float %21 Aligned 16 + %23 = OpFMul %v4float %20 %22 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %res %18 + OpStore %24 %23 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fmul_float4.spvasm64 b/test_conformance/spirv_new/spirv_asm/fmul_float4.spvasm64 new file mode 100644 index 00000000..f1e9b990 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fmul_float4.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_CrossWorkgroup_v4float = OpTypePointer CrossWorkgroup %v4float + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %entry = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %lhs %21 + %23 = OpLoad %v4float %22 Aligned 16 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %rhs %21 + %25 = OpLoad %v4float %24 Aligned 16 + %26 = OpFMul %v4float %23 %25 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %res %21 + OpStore %27 %26 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fmul_half.spvasm32 b/test_conformance/spirv_new/spirv_asm/fmul_half.spvasm32 new file mode 100644 index 00000000..1cdf4a49 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fmul_half.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %half = OpTypeFloat 16 +%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_half + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_half + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_half + %entry = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %lhs %17 + %19 = OpLoad %half %18 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %rhs %17 + %21 = OpLoad %half %20 + %22 = OpFMul %half %19 %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %res %17 + OpStore %23 %22 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fmul_half.spvasm64 b/test_conformance/spirv_new/spirv_asm/fmul_half.spvasm64 new file mode 100644 index 00000000..0061e32b --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fmul_half.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %half = OpTypeFloat 16 +%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_half + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_half + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_half + %entry = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %lhs %20 + %22 = OpLoad %half %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %rhs %20 + %24 = OpLoad %half %23 + %25 = OpFMul %half %22 %24 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %res %20 + OpStore %26 %25 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/frem_double.spvasm32 b/test_conformance/spirv_new/spirv_asm/frem_double.spvasm32 new file mode 100644 index 00000000..091fb086 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/frem_double.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %lhs %17 + %19 = OpLoad %double %18 Aligned 8 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %rhs %17 + %21 = OpLoad %double %20 Aligned 8 + %22 = OpFRem %double %19 %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %res %17 + OpStore %23 %22 Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/frem_double.spvasm64 b/test_conformance/spirv_new/spirv_asm/frem_double.spvasm64 new file mode 100644 index 00000000..4675c1d4 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/frem_double.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %lhs %20 + %22 = OpLoad %double %21 Aligned 8 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %rhs %20 + %24 = OpLoad %double %23 Aligned 8 + %25 = OpFRem %double %22 %24 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %res %20 + OpStore %26 %25 Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/frem_double2.spvasm32 b/test_conformance/spirv_new/spirv_asm/frem_double2.spvasm32 new file mode 100644 index 00000000..ef8050b3 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/frem_double2.spvasm32 @@ -0,0 +1,47 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %double = OpTypeFloat 64 + %v2double = OpTypeVector %double 2 +%_ptr_CrossWorkgroup_v2double = OpTypePointer CrossWorkgroup %v2double + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %entry = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %lhs %18 + %20 = OpLoad %v2double %19 Aligned 16 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %rhs %18 + %22 = OpLoad %v2double %21 Aligned 16 + %23 = OpFRem %v2double %20 %22 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %res %18 + OpStore %24 %23 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/frem_double2.spvasm64 b/test_conformance/spirv_new/spirv_asm/frem_double2.spvasm64 new file mode 100644 index 00000000..a92e95bc --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/frem_double2.spvasm64 @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %double = OpTypeFloat 64 + %v2double = OpTypeVector %double 2 +%_ptr_CrossWorkgroup_v2double = OpTypePointer CrossWorkgroup %v2double + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %entry = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %lhs %21 + %23 = OpLoad %v2double %22 Aligned 16 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %rhs %21 + %25 = OpLoad %v2double %24 Aligned 16 + %26 = OpFRem %v2double %23 %25 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %res %21 + OpStore %27 %26 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/frem_float.spvasm32 b/test_conformance/spirv_new/spirv_asm/frem_float.spvasm32 new file mode 100644 index 00000000..5cfd0cdc --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/frem_float.spvasm32 @@ -0,0 +1,45 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %lhs %17 + %19 = OpLoad %float %18 Aligned 4 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %17 + %21 = OpLoad %float %20 Aligned 4 + %22 = OpFRem %float %19 %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %res %17 + OpStore %23 %22 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/frem_float.spvasm64 b/test_conformance/spirv_new/spirv_asm/frem_float.spvasm64 new file mode 100644 index 00000000..36b631d6 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/frem_float.spvasm64 @@ -0,0 +1,49 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %lhs %20 + %22 = OpLoad %float %21 Aligned 4 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %20 + %24 = OpLoad %float %23 Aligned 4 + %25 = OpFRem %float %22 %24 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %res %20 + OpStore %26 %25 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/frem_float4.spvasm32 b/test_conformance/spirv_new/spirv_asm/frem_float4.spvasm32 new file mode 100644 index 00000000..0b0b6e8f --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/frem_float4.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_CrossWorkgroup_v4float = OpTypePointer CrossWorkgroup %v4float + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %entry = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %lhs %18 + %20 = OpLoad %v4float %19 Aligned 16 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %rhs %18 + %22 = OpLoad %v4float %21 Aligned 16 + %23 = OpFRem %v4float %20 %22 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %res %18 + OpStore %24 %23 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/frem_float4.spvasm64 b/test_conformance/spirv_new/spirv_asm/frem_float4.spvasm64 new file mode 100644 index 00000000..55cc605c --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/frem_float4.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_CrossWorkgroup_v4float = OpTypePointer CrossWorkgroup %v4float + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %entry = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %lhs %21 + %23 = OpLoad %v4float %22 Aligned 16 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %rhs %21 + %25 = OpLoad %v4float %24 Aligned 16 + %26 = OpFRem %v4float %23 %25 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %res %21 + OpStore %27 %26 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/frem_half.spvasm32 b/test_conformance/spirv_new/spirv_asm/frem_half.spvasm32 new file mode 100644 index 00000000..e4a8b8a7 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/frem_half.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %half = OpTypeFloat 16 +%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_half + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_half + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_half + %entry = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %lhs %17 + %19 = OpLoad %half %18 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %rhs %17 + %21 = OpLoad %half %20 + %22 = OpFRem %half %19 %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %res %17 + OpStore %23 %22 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/frem_half.spvasm64 b/test_conformance/spirv_new/spirv_asm/frem_half.spvasm64 new file mode 100644 index 00000000..8cfe36ad --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/frem_half.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %half = OpTypeFloat 16 +%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_half + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_half + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_half + %entry = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %lhs %20 + %22 = OpLoad %half %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %rhs %20 + %24 = OpLoad %half %23 + %25 = OpFRem %half %22 %24 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %res %20 + OpStore %26 %25 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fsub_double.spvasm32 b/test_conformance/spirv_new/spirv_asm/fsub_double.spvasm32 new file mode 100644 index 00000000..b9d3d9fa --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fsub_double.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %lhs %17 + %19 = OpLoad %double %18 Aligned 8 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %rhs %17 + %21 = OpLoad %double %20 Aligned 8 + %22 = OpFSub %double %19 %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %res %17 + OpStore %23 %22 Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fsub_double.spvasm64 b/test_conformance/spirv_new/spirv_asm/fsub_double.spvasm64 new file mode 100644 index 00000000..8cdbfe3a --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fsub_double.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_double + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %lhs %20 + %22 = OpLoad %double %21 Aligned 8 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %rhs %20 + %24 = OpLoad %double %23 Aligned 8 + %25 = OpFSub %double %22 %24 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %res %20 + OpStore %26 %25 Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fsub_double2.spvasm32 b/test_conformance/spirv_new/spirv_asm/fsub_double2.spvasm32 new file mode 100644 index 00000000..f892275d --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fsub_double2.spvasm32 @@ -0,0 +1,47 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %double = OpTypeFloat 64 + %v2double = OpTypeVector %double 2 +%_ptr_CrossWorkgroup_v2double = OpTypePointer CrossWorkgroup %v2double + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %entry = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %lhs %18 + %20 = OpLoad %v2double %19 Aligned 16 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %rhs %18 + %22 = OpLoad %v2double %21 Aligned 16 + %23 = OpFSub %v2double %20 %22 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %res %18 + OpStore %24 %23 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fsub_double2.spvasm64 b/test_conformance/spirv_new/spirv_asm/fsub_double2.spvasm64 new file mode 100644 index 00000000..3ac187df --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fsub_double2.spvasm64 @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %double = OpTypeFloat 64 + %v2double = OpTypeVector %double 2 +%_ptr_CrossWorkgroup_v2double = OpTypePointer CrossWorkgroup %v2double + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %entry = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %lhs %21 + %23 = OpLoad %v2double %22 Aligned 16 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %rhs %21 + %25 = OpLoad %v2double %24 Aligned 16 + %26 = OpFSub %v2double %23 %25 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %res %21 + OpStore %27 %26 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fsub_float.spvasm32 b/test_conformance/spirv_new/spirv_asm/fsub_float.spvasm32 new file mode 100644 index 00000000..70f93da7 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fsub_float.spvasm32 @@ -0,0 +1,45 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %lhs %17 + %19 = OpLoad %float %18 Aligned 4 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %17 + %21 = OpLoad %float %20 Aligned 4 + %22 = OpFSub %float %19 %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %res %17 + OpStore %23 %22 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fsub_float.spvasm64 b/test_conformance/spirv_new/spirv_asm/fsub_float.spvasm64 new file mode 100644 index 00000000..603974d1 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fsub_float.spvasm64 @@ -0,0 +1,49 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %lhs %20 + %22 = OpLoad %float %21 Aligned 4 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %20 + %24 = OpLoad %float %23 Aligned 4 + %25 = OpFSub %float %22 %24 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %res %20 + OpStore %26 %25 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fsub_float4.spvasm32 b/test_conformance/spirv_new/spirv_asm/fsub_float4.spvasm32 new file mode 100644 index 00000000..a992d6e3 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fsub_float4.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_CrossWorkgroup_v4float = OpTypePointer CrossWorkgroup %v4float + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %entry = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %lhs %18 + %20 = OpLoad %v4float %19 Aligned 16 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %rhs %18 + %22 = OpLoad %v4float %21 Aligned 16 + %23 = OpFSub %v4float %20 %22 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %res %18 + OpStore %24 %23 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fsub_float4.spvasm64 b/test_conformance/spirv_new/spirv_asm/fsub_float4.spvasm64 new file mode 100644 index 00000000..2f3ad1bb --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fsub_float4.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_CrossWorkgroup_v4float = OpTypePointer CrossWorkgroup %v4float + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %entry = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %lhs %21 + %23 = OpLoad %v4float %22 Aligned 16 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %rhs %21 + %25 = OpLoad %v4float %24 Aligned 16 + %26 = OpFSub %v4float %23 %25 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %res %21 + OpStore %27 %26 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fsub_half.spvasm32 b/test_conformance/spirv_new/spirv_asm/fsub_half.spvasm32 new file mode 100644 index 00000000..09112d73 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fsub_half.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %half = OpTypeFloat 16 +%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_half + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_half + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_half + %entry = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %lhs %17 + %19 = OpLoad %half %18 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %rhs %17 + %21 = OpLoad %half %20 + %22 = OpFSub %half %19 %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %res %17 + OpStore %23 %22 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/fsub_half.spvasm64 b/test_conformance/spirv_new/spirv_asm/fsub_half.spvasm64 new file mode 100644 index 00000000..4fd41e22 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/fsub_half.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %7 FuncParamAttr NoCapture + %7 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %7 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %half = OpTypeFloat 16 +%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %2 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_half + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_half + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_half + %entry = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %lhs %20 + %22 = OpLoad %half %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %rhs %20 + %24 = OpLoad %half %23 + %25 = OpFSub %half %22 %24 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %res %20 + OpStore %26 %25 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/label_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/label_simple.spvasm32 new file mode 100644 index 00000000..e5b826b2 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/label_simple.spvasm32 @@ -0,0 +1,34 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 17 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "label_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %9 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %10 = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %11 = OpLabel + %12 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %13 = OpCompositeExtract %uint %12 0 + %14 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %13 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %10 %13 + %16 = OpLoad %uint %14 + OpStore %15 %16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/label_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/label_simple.spvasm64 new file mode 100644 index 00000000..e496c25d --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/label_simple.spvasm64 @@ -0,0 +1,40 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 21 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "label_simple" %gl_GlobalInvocationID + OpName %in "in" + OpName %out "out" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %ulong_32 = OpConstant %ulong 32 + %void = OpTypeVoid + %uint = OpTypeInt 32 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %12 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %12 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %13 = OpLabel + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %17 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %17 + %20 = OpLoad %uint %18 + OpStore %19 %20 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/lifetime_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/lifetime_simple.spvasm32 new file mode 100644 index 00000000..df2cb592 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/lifetime_simple.spvasm32 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "lifetime_simple" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %bool = OpTypeBool + %void = OpTypeVoid + %uint_0 = OpConstant %uint 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %16 = OpLabel + %17 = OpVariable %_ptr_Function_uint Function + %18 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %uint %18 0 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %19 + %21 = OpLoad %uint %20 Aligned 4 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %19 + %23 = OpLoad %uint %22 Aligned 4 + %24 = OpISub %uint %21 %23 + OpLifetimeStart %17 0 + OpStore %17 %24 + %25 = OpLoad %uint %17 + OpLifetimeStop %17 0 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %19 + OpStore %26 %25 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/lifetime_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/lifetime_simple.spvasm64 new file mode 100644 index 00000000..d24242f9 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/lifetime_simple.spvasm64 @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "lifetime_simple" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %bool = OpTypeBool + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %ulong_32 = OpConstant %ulong 32 + %uint_0 = OpConstant %uint 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %17 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %17 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %18 = OpLabel + %19 = OpVariable %_ptr_Function_uint Function + %20 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %21 = OpCompositeExtract %ulong %20 0 + %22 = OpShiftLeftLogical %ulong %21 %ulong_32 + %23 = OpShiftRightArithmetic %ulong %22 %ulong_32 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %23 + %25 = OpLoad %uint %24 Aligned 4 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %23 + %27 = OpLoad %uint %26 Aligned 4 + %28 = OpISub %uint %25 %27 + OpLifetimeStart %19 0 + OpStore %19 %28 + %29 = OpLoad %uint %19 + OpLifetimeStop %19 0 + %30 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %23 + OpStore %30 %29 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/linkage_export.spvasm32 b/test_conformance/spirv_new/spirv_asm/linkage_export.spvasm32 new file mode 100644 index 00000000..9208b199 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/linkage_export.spvasm32 @@ -0,0 +1,20 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 8 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpName %simple_fnegate_linkage "simple_fnegate_linkage" + OpDecorate %simple_fnegate_linkage LinkageAttributes "simple_fnegate_linkage" Export + %void = OpTypeVoid + %float = OpTypeFloat 32 + %4 = OpTypeFunction %float %float +%simple_fnegate_linkage = OpFunction %float Const %4 + %5 = OpFunctionParameter %float + %6 = OpLabel + %7 = OpFNegate %float %5 + OpReturnValue %7 + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/linkage_export.spvasm64 b/test_conformance/spirv_new/spirv_asm/linkage_export.spvasm64 new file mode 100644 index 00000000..f13f6479 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/linkage_export.spvasm64 @@ -0,0 +1,20 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 8 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical64 OpenCL + OpName %simple_fnegate_linkage "simple_fnegate_linkage" + OpDecorate %simple_fnegate_linkage LinkageAttributes "simple_fnegate_linkage" Export + %void = OpTypeVoid + %float = OpTypeFloat 32 + %4 = OpTypeFunction %float %float +%simple_fnegate_linkage = OpFunction %float Const %4 + %5 = OpFunctionParameter %float + %6 = OpLabel + %7 = OpFNegate %float %5 + OpReturnValue %7 + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/linkage_import.spvasm32 b/test_conformance/spirv_new/spirv_asm/linkage_import.spvasm32 new file mode 100644 index 00000000..79217e7f --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/linkage_import.spvasm32 @@ -0,0 +1,39 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "test_linkage" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %4 LinkageAttributes "simple_fnegate_linkage" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup_float + %12 = OpTypeFunction %float %float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %4 = OpFunction %float Const %12 + %13 = OpFunctionParameter %float + OpFunctionEnd + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %14 = OpLabel + %15 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %16 = OpCompositeExtract %uint %15 0 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %16 + %18 = OpLoad %float %17 + %19 = OpFunctionCall %float %4 %18 + OpStore %17 %19 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/linkage_import.spvasm64 b/test_conformance/spirv_new/spirv_asm/linkage_import.spvasm64 new file mode 100644 index 00000000..707d8534 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/linkage_import.spvasm64 @@ -0,0 +1,43 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "test_linkage" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %4 LinkageAttributes "simple_fnegate_linkage" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 + %13 = OpTypeFunction %float %float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %4 = OpFunction %float Const %13 + %14 = OpFunctionParameter %float + OpFunctionEnd + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %15 = OpLabel + %16 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %ulong %16 0 + %18 = OpShiftLeftLogical %ulong %17 %ulong_32 + %19 = OpShiftRightArithmetic %ulong %18 %ulong_32 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %19 + %21 = OpLoad %float %20 + %22 = OpFunctionCall %float %4 %21 + OpStore %20 %22 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/loop_merge_branch_conditional_dont_unroll.spvasm32 b/test_conformance/spirv_new/spirv_asm/loop_merge_branch_conditional_dont_unroll.spvasm32 new file mode 100644 index 00000000..790dfa81 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/loop_merge_branch_conditional_dont_unroll.spvasm32 @@ -0,0 +1,70 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 40 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "loop_merge_branch_conditional_dont_unroll" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %rep "rep" + OpName %num "num" + OpDecorate %6 FuncParamAttr NoCapture + %6 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %6 %res %in + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %bool = OpTypeBool + %void = OpTypeVoid + %uint_0 = OpConstant %uint 0 + %uint_1 = OpConstant %uint 1 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %17 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %uint %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %17 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rep = OpFunctionParameter %uint + %num = OpFunctionParameter %uint + %18 = OpLabel + %19 = OpVariable %_ptr_Function_uint Function + %20 = OpVariable %_ptr_Function_uint Function + %21 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %22 = OpCompositeExtract %uint %21 0 + OpStore %19 %uint_0 Aligned 4 + OpStore %20 %uint_0 Aligned 4 + OpBranch %23 + %23 = OpLabel + %24 = OpLoad %uint %20 + %25 = OpSLessThan %bool %24 %rep + OpLoopMerge %26 %27 DontUnroll + OpBranchConditional %25 %28 %26 + %28 = OpLabel + %29 = OpLoad %uint %20 + %30 = OpIMul %uint %29 %num + %31 = OpIAdd %uint %22 %30 + %32 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %31 + %33 = OpLoad %uint %32 + %34 = OpLoad %uint %19 + %35 = OpIAdd %uint %34 %33 + OpStore %19 %35 Aligned 4 + OpBranch %27 + %27 = OpLabel + %36 = OpLoad %uint %20 + %37 = OpIAdd %uint %36 %uint_1 + OpStore %20 %37 + OpBranch %23 + %26 = OpLabel + %38 = OpLoad %uint %19 + %39 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %22 + OpStore %39 %38 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/loop_merge_branch_conditional_dont_unroll.spvasm64 b/test_conformance/spirv_new/spirv_asm/loop_merge_branch_conditional_dont_unroll.spvasm64 new file mode 100644 index 00000000..d7e21e4a --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/loop_merge_branch_conditional_dont_unroll.spvasm64 @@ -0,0 +1,76 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 45 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "loop_merge_branch_conditional_dont_unroll" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %rep "rep" + OpName %num "num" + OpDecorate %6 FuncParamAttr NoCapture + %6 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %6 %res %in + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %ulong_32 = OpConstant %ulong 32 + %bool = OpTypeBool + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 + %uint_1 = OpConstant %uint 1 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %19 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %uint %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %19 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rep = OpFunctionParameter %uint + %num = OpFunctionParameter %uint + %20 = OpLabel + %21 = OpVariable %_ptr_Function_uint Function + %22 = OpVariable %_ptr_Function_uint Function + %23 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %24 = OpCompositeExtract %ulong %23 0 + %25 = OpShiftLeftLogical %ulong %24 %ulong_32 + %26 = OpShiftRightArithmetic %ulong %25 %ulong_32 + %27 = OpSConvert %uint %26 + OpStore %21 %uint_0 Aligned 4 + OpStore %22 %uint_0 Aligned 4 + OpBranch %28 + %28 = OpLabel + %29 = OpLoad %uint %22 + %30 = OpSLessThan %bool %29 %rep + OpLoopMerge %31 %32 DontUnroll + OpBranchConditional %30 %33 %31 + %33 = OpLabel + %34 = OpLoad %uint %22 + %35 = OpIMul %uint %34 %num + %36 = OpIAdd %uint %27 %35 + %37 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %36 + %38 = OpLoad %uint %37 + %39 = OpLoad %uint %21 + %40 = OpIAdd %uint %39 %38 + OpStore %21 %40 Aligned 4 + OpBranch %32 + %32 = OpLabel + %41 = OpLoad %uint %22 + %42 = OpIAdd %uint %41 %uint_1 + OpStore %22 %42 + OpBranch %28 + %31 = OpLabel + %43 = OpLoad %uint %21 + %44 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %26 + OpStore %44 %43 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/loop_merge_branch_conditional_none.spvasm32 b/test_conformance/spirv_new/spirv_asm/loop_merge_branch_conditional_none.spvasm32 new file mode 100644 index 00000000..50ccc636 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/loop_merge_branch_conditional_none.spvasm32 @@ -0,0 +1,70 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 40 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "loop_merge_branch_conditional_none" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %rep "rep" + OpName %num "num" + OpDecorate %6 FuncParamAttr NoCapture + %6 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %6 %res %in + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %bool = OpTypeBool + %void = OpTypeVoid + %uint_0 = OpConstant %uint 0 + %uint_1 = OpConstant %uint 1 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %17 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %uint %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %17 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rep = OpFunctionParameter %uint + %num = OpFunctionParameter %uint + %18 = OpLabel + %19 = OpVariable %_ptr_Function_uint Function + %20 = OpVariable %_ptr_Function_uint Function + %21 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %22 = OpCompositeExtract %uint %21 0 + OpStore %19 %uint_0 Aligned 4 + OpStore %20 %uint_0 Aligned 4 + OpBranch %23 + %23 = OpLabel + %24 = OpLoad %uint %20 + %25 = OpSLessThan %bool %24 %rep + OpLoopMerge %26 %27 None + OpBranchConditional %25 %28 %26 + %28 = OpLabel + %29 = OpLoad %uint %20 + %30 = OpIMul %uint %29 %num + %31 = OpIAdd %uint %22 %30 + %32 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %31 + %33 = OpLoad %uint %32 + %34 = OpLoad %uint %19 + %35 = OpIAdd %uint %34 %33 + OpStore %19 %35 Aligned 4 + OpBranch %27 + %27 = OpLabel + %36 = OpLoad %uint %20 + %37 = OpIAdd %uint %36 %uint_1 + OpStore %20 %37 + OpBranch %23 + %26 = OpLabel + %38 = OpLoad %uint %19 + %39 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %22 + OpStore %39 %38 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/loop_merge_branch_conditional_none.spvasm64 b/test_conformance/spirv_new/spirv_asm/loop_merge_branch_conditional_none.spvasm64 new file mode 100644 index 00000000..c6e88ed0 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/loop_merge_branch_conditional_none.spvasm64 @@ -0,0 +1,76 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 45 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "loop_merge_branch_conditional_none" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %rep "rep" + OpName %num "num" + OpDecorate %6 FuncParamAttr NoCapture + %6 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %6 %res %in + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %ulong_32 = OpConstant %ulong 32 + %bool = OpTypeBool + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 + %uint_1 = OpConstant %uint 1 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %19 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %uint %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %19 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rep = OpFunctionParameter %uint + %num = OpFunctionParameter %uint + %20 = OpLabel + %21 = OpVariable %_ptr_Function_uint Function + %22 = OpVariable %_ptr_Function_uint Function + %23 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %24 = OpCompositeExtract %ulong %23 0 + %25 = OpShiftLeftLogical %ulong %24 %ulong_32 + %26 = OpShiftRightArithmetic %ulong %25 %ulong_32 + %27 = OpSConvert %uint %26 + OpStore %21 %uint_0 Aligned 4 + OpStore %22 %uint_0 Aligned 4 + OpBranch %28 + %28 = OpLabel + %29 = OpLoad %uint %22 + %30 = OpSLessThan %bool %29 %rep + OpLoopMerge %31 %32 None + OpBranchConditional %30 %33 %31 + %33 = OpLabel + %34 = OpLoad %uint %22 + %35 = OpIMul %uint %34 %num + %36 = OpIAdd %uint %27 %35 + %37 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %36 + %38 = OpLoad %uint %37 + %39 = OpLoad %uint %21 + %40 = OpIAdd %uint %39 %38 + OpStore %21 %40 Aligned 4 + OpBranch %32 + %32 = OpLabel + %41 = OpLoad %uint %22 + %42 = OpIAdd %uint %41 %uint_1 + OpStore %22 %42 + OpBranch %28 + %31 = OpLabel + %43 = OpLoad %uint %21 + %44 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %26 + OpStore %44 %43 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/loop_merge_branch_conditional_unroll.spvasm32 b/test_conformance/spirv_new/spirv_asm/loop_merge_branch_conditional_unroll.spvasm32 new file mode 100644 index 00000000..ad94ac04 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/loop_merge_branch_conditional_unroll.spvasm32 @@ -0,0 +1,70 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 40 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "loop_merge_branch_conditional_unroll" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %rep "rep" + OpName %num "num" + OpDecorate %6 FuncParamAttr NoCapture + %6 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %6 %res %in + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %bool = OpTypeBool + %void = OpTypeVoid + %uint_0 = OpConstant %uint 0 + %uint_1 = OpConstant %uint 1 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %17 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %uint %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %17 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rep = OpFunctionParameter %uint + %num = OpFunctionParameter %uint + %18 = OpLabel + %19 = OpVariable %_ptr_Function_uint Function + %20 = OpVariable %_ptr_Function_uint Function + %21 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %22 = OpCompositeExtract %uint %21 0 + OpStore %19 %uint_0 Aligned 4 + OpStore %20 %uint_0 Aligned 4 + OpBranch %23 + %23 = OpLabel + %24 = OpLoad %uint %20 + %25 = OpSLessThan %bool %24 %rep + OpLoopMerge %26 %27 Unroll + OpBranchConditional %25 %28 %26 + %28 = OpLabel + %29 = OpLoad %uint %20 + %30 = OpIMul %uint %29 %num + %31 = OpIAdd %uint %22 %30 + %32 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %31 + %33 = OpLoad %uint %32 + %34 = OpLoad %uint %19 + %35 = OpIAdd %uint %34 %33 + OpStore %19 %35 Aligned 4 + OpBranch %27 + %27 = OpLabel + %36 = OpLoad %uint %20 + %37 = OpIAdd %uint %36 %uint_1 + OpStore %20 %37 + OpBranch %23 + %26 = OpLabel + %38 = OpLoad %uint %19 + %39 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %22 + OpStore %39 %38 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/loop_merge_branch_conditional_unroll.spvasm64 b/test_conformance/spirv_new/spirv_asm/loop_merge_branch_conditional_unroll.spvasm64 new file mode 100644 index 00000000..b6b6f7a6 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/loop_merge_branch_conditional_unroll.spvasm64 @@ -0,0 +1,76 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 45 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "loop_merge_branch_conditional_unroll" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %rep "rep" + OpName %num "num" + OpDecorate %6 FuncParamAttr NoCapture + %6 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %6 %res %in + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %ulong_32 = OpConstant %ulong 32 + %bool = OpTypeBool + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 + %uint_1 = OpConstant %uint 1 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %19 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %uint %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %19 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rep = OpFunctionParameter %uint + %num = OpFunctionParameter %uint + %20 = OpLabel + %21 = OpVariable %_ptr_Function_uint Function + %22 = OpVariable %_ptr_Function_uint Function + %23 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %24 = OpCompositeExtract %ulong %23 0 + %25 = OpShiftLeftLogical %ulong %24 %ulong_32 + %26 = OpShiftRightArithmetic %ulong %25 %ulong_32 + %27 = OpSConvert %uint %26 + OpStore %21 %uint_0 Aligned 4 + OpStore %22 %uint_0 Aligned 4 + OpBranch %28 + %28 = OpLabel + %29 = OpLoad %uint %22 + %30 = OpSLessThan %bool %29 %rep + OpLoopMerge %31 %32 Unroll + OpBranchConditional %30 %33 %31 + %33 = OpLabel + %34 = OpLoad %uint %22 + %35 = OpIMul %uint %34 %num + %36 = OpIAdd %uint %27 %35 + %37 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %36 + %38 = OpLoad %uint %37 + %39 = OpLoad %uint %21 + %40 = OpIAdd %uint %39 %38 + OpStore %21 %40 Aligned 4 + OpBranch %32 + %32 = OpLabel + %41 = OpLoad %uint %22 + %42 = OpIAdd %uint %41 %uint_1 + OpStore %22 %42 + OpBranch %28 + %31 = OpLabel + %43 = OpLoad %uint %21 + %44 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %26 + OpStore %44 %43 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/loop_merge_branch_dont_unroll.spvasm32 b/test_conformance/spirv_new/spirv_asm/loop_merge_branch_dont_unroll.spvasm32 new file mode 100644 index 00000000..e6ef6b69 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/loop_merge_branch_dont_unroll.spvasm32 @@ -0,0 +1,72 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 41 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "loop_merge_branch_dont_unroll" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %rep "rep" + OpName %num "num" + OpDecorate %6 FuncParamAttr NoCapture + %6 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %6 %res %in + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %bool = OpTypeBool + %void = OpTypeVoid + %uint_0 = OpConstant %uint 0 + %uint_1 = OpConstant %uint 1 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %17 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %uint %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %17 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rep = OpFunctionParameter %uint + %num = OpFunctionParameter %uint + %18 = OpLabel + %19 = OpVariable %_ptr_Function_uint Function + %20 = OpVariable %_ptr_Function_uint Function + %21 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %22 = OpCompositeExtract %uint %21 0 + OpStore %19 %uint_0 Aligned 4 + OpStore %20 %uint_0 Aligned 4 + OpBranch %23 + %23 = OpLabel + OpLoopMerge %24 %25 DontUnroll + OpBranch %26 + %26 = OpLabel + %27 = OpLoad %uint %20 + %28 = OpSLessThan %bool %27 %rep + OpBranchConditional %28 %29 %24 + %29 = OpLabel + %30 = OpLoad %uint %20 + %31 = OpIMul %uint %30 %num + %32 = OpIAdd %uint %22 %31 + %33 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %32 + %34 = OpLoad %uint %33 + %35 = OpLoad %uint %19 + %36 = OpIAdd %uint %35 %34 + OpStore %19 %36 Aligned 4 + OpBranch %25 + %25 = OpLabel + %37 = OpLoad %uint %20 + %38 = OpIAdd %uint %37 %uint_1 + OpStore %20 %38 + OpBranch %23 + %24 = OpLabel + %39 = OpLoad %uint %19 + %40 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %22 + OpStore %40 %39 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/loop_merge_branch_dont_unroll.spvasm64 b/test_conformance/spirv_new/spirv_asm/loop_merge_branch_dont_unroll.spvasm64 new file mode 100644 index 00000000..932ca39e --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/loop_merge_branch_dont_unroll.spvasm64 @@ -0,0 +1,78 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 46 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "loop_merge_branch_dont_unroll" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %rep "rep" + OpName %num "num" + OpDecorate %6 FuncParamAttr NoCapture + %6 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %6 %res %in + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %ulong_32 = OpConstant %ulong 32 + %bool = OpTypeBool + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 + %uint_1 = OpConstant %uint 1 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %19 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %uint %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %19 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rep = OpFunctionParameter %uint + %num = OpFunctionParameter %uint + %20 = OpLabel + %21 = OpVariable %_ptr_Function_uint Function + %22 = OpVariable %_ptr_Function_uint Function + %23 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %24 = OpCompositeExtract %ulong %23 0 + %25 = OpShiftLeftLogical %ulong %24 %ulong_32 + %26 = OpShiftRightArithmetic %ulong %25 %ulong_32 + %27 = OpSConvert %uint %26 + OpStore %21 %uint_0 Aligned 4 + OpStore %22 %uint_0 Aligned 4 + OpBranch %28 + %28 = OpLabel + OpLoopMerge %29 %30 DontUnroll + OpBranch %31 + %31 = OpLabel + %32 = OpLoad %uint %22 + %33 = OpSLessThan %bool %32 %rep + OpBranchConditional %33 %34 %29 + %34 = OpLabel + %35 = OpLoad %uint %22 + %36 = OpIMul %uint %35 %num + %37 = OpIAdd %uint %27 %36 + %38 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %37 + %39 = OpLoad %uint %38 + %40 = OpLoad %uint %21 + %41 = OpIAdd %uint %40 %39 + OpStore %21 %41 Aligned 4 + OpBranch %30 + %30 = OpLabel + %42 = OpLoad %uint %22 + %43 = OpIAdd %uint %42 %uint_1 + OpStore %22 %43 + OpBranch %28 + %29 = OpLabel + %44 = OpLoad %uint %21 + %45 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %26 + OpStore %45 %44 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/loop_merge_branch_none.spvasm32 b/test_conformance/spirv_new/spirv_asm/loop_merge_branch_none.spvasm32 new file mode 100644 index 00000000..e545284c --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/loop_merge_branch_none.spvasm32 @@ -0,0 +1,72 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 41 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "loop_merge_branch_none" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %rep "rep" + OpName %num "num" + OpDecorate %6 FuncParamAttr NoCapture + %6 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %6 %res %in + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %bool = OpTypeBool + %void = OpTypeVoid + %uint_0 = OpConstant %uint 0 + %uint_1 = OpConstant %uint 1 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %17 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %uint %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %17 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rep = OpFunctionParameter %uint + %num = OpFunctionParameter %uint + %18 = OpLabel + %19 = OpVariable %_ptr_Function_uint Function + %20 = OpVariable %_ptr_Function_uint Function + %21 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %22 = OpCompositeExtract %uint %21 0 + OpStore %19 %uint_0 Aligned 4 + OpStore %20 %uint_0 Aligned 4 + OpBranch %23 + %23 = OpLabel + OpLoopMerge %24 %25 None + OpBranch %26 + %26 = OpLabel + %27 = OpLoad %uint %20 + %28 = OpSLessThan %bool %27 %rep + OpBranchConditional %28 %29 %24 + %29 = OpLabel + %30 = OpLoad %uint %20 + %31 = OpIMul %uint %30 %num + %32 = OpIAdd %uint %22 %31 + %33 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %32 + %34 = OpLoad %uint %33 + %35 = OpLoad %uint %19 + %36 = OpIAdd %uint %35 %34 + OpStore %19 %36 Aligned 4 + OpBranch %25 + %25 = OpLabel + %37 = OpLoad %uint %20 + %38 = OpIAdd %uint %37 %uint_1 + OpStore %20 %38 + OpBranch %23 + %24 = OpLabel + %39 = OpLoad %uint %19 + %40 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %22 + OpStore %40 %39 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/loop_merge_branch_none.spvasm64 b/test_conformance/spirv_new/spirv_asm/loop_merge_branch_none.spvasm64 new file mode 100644 index 00000000..e1236666 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/loop_merge_branch_none.spvasm64 @@ -0,0 +1,78 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 46 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "loop_merge_branch_none" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %rep "rep" + OpName %num "num" + OpDecorate %6 FuncParamAttr NoCapture + %6 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %6 %res %in + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %ulong_32 = OpConstant %ulong 32 + %bool = OpTypeBool + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 + %uint_1 = OpConstant %uint 1 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %19 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %uint %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %19 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rep = OpFunctionParameter %uint + %num = OpFunctionParameter %uint + %20 = OpLabel + %21 = OpVariable %_ptr_Function_uint Function + %22 = OpVariable %_ptr_Function_uint Function + %23 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %24 = OpCompositeExtract %ulong %23 0 + %25 = OpShiftLeftLogical %ulong %24 %ulong_32 + %26 = OpShiftRightArithmetic %ulong %25 %ulong_32 + %27 = OpSConvert %uint %26 + OpStore %21 %uint_0 Aligned 4 + OpStore %22 %uint_0 Aligned 4 + OpBranch %28 + %28 = OpLabel + OpLoopMerge %29 %30 None + OpBranch %31 + %31 = OpLabel + %32 = OpLoad %uint %22 + %33 = OpSLessThan %bool %32 %rep + OpBranchConditional %33 %34 %29 + %34 = OpLabel + %35 = OpLoad %uint %22 + %36 = OpIMul %uint %35 %num + %37 = OpIAdd %uint %27 %36 + %38 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %37 + %39 = OpLoad %uint %38 + %40 = OpLoad %uint %21 + %41 = OpIAdd %uint %40 %39 + OpStore %21 %41 Aligned 4 + OpBranch %30 + %30 = OpLabel + %42 = OpLoad %uint %22 + %43 = OpIAdd %uint %42 %uint_1 + OpStore %22 %43 + OpBranch %28 + %29 = OpLabel + %44 = OpLoad %uint %21 + %45 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %26 + OpStore %45 %44 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/loop_merge_branch_unroll.spvasm32 b/test_conformance/spirv_new/spirv_asm/loop_merge_branch_unroll.spvasm32 new file mode 100644 index 00000000..43582628 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/loop_merge_branch_unroll.spvasm32 @@ -0,0 +1,72 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 41 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "loop_merge_branch_unroll" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %rep "rep" + OpName %num "num" + OpDecorate %6 FuncParamAttr NoCapture + %6 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %6 %res %in + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %bool = OpTypeBool + %void = OpTypeVoid + %uint_0 = OpConstant %uint 0 + %uint_1 = OpConstant %uint 1 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %17 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %uint %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %17 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rep = OpFunctionParameter %uint + %num = OpFunctionParameter %uint + %18 = OpLabel + %19 = OpVariable %_ptr_Function_uint Function + %20 = OpVariable %_ptr_Function_uint Function + %21 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %22 = OpCompositeExtract %uint %21 0 + OpStore %19 %uint_0 Aligned 4 + OpStore %20 %uint_0 Aligned 4 + OpBranch %23 + %23 = OpLabel + OpLoopMerge %24 %25 Unroll + OpBranch %26 + %26 = OpLabel + %27 = OpLoad %uint %20 + %28 = OpSLessThan %bool %27 %rep + OpBranchConditional %28 %29 %24 + %29 = OpLabel + %30 = OpLoad %uint %20 + %31 = OpIMul %uint %30 %num + %32 = OpIAdd %uint %22 %31 + %33 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %32 + %34 = OpLoad %uint %33 + %35 = OpLoad %uint %19 + %36 = OpIAdd %uint %35 %34 + OpStore %19 %36 Aligned 4 + OpBranch %25 + %25 = OpLabel + %37 = OpLoad %uint %20 + %38 = OpIAdd %uint %37 %uint_1 + OpStore %20 %38 + OpBranch %23 + %24 = OpLabel + %39 = OpLoad %uint %19 + %40 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %22 + OpStore %40 %39 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/loop_merge_branch_unroll.spvasm64 b/test_conformance/spirv_new/spirv_asm/loop_merge_branch_unroll.spvasm64 new file mode 100644 index 00000000..7a9520a7 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/loop_merge_branch_unroll.spvasm64 @@ -0,0 +1,78 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 46 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "loop_merge_branch_unroll" %gl_GlobalInvocationID + OpName %res "res" + OpName %in "in" + OpName %rep "rep" + OpName %num "num" + OpDecorate %6 FuncParamAttr NoCapture + %6 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %6 %res %in + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %ulong_32 = OpConstant %ulong 32 + %bool = OpTypeBool + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 + %uint_1 = OpConstant %uint 1 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %19 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %uint %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %19 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rep = OpFunctionParameter %uint + %num = OpFunctionParameter %uint + %20 = OpLabel + %21 = OpVariable %_ptr_Function_uint Function + %22 = OpVariable %_ptr_Function_uint Function + %23 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %24 = OpCompositeExtract %ulong %23 0 + %25 = OpShiftLeftLogical %ulong %24 %ulong_32 + %26 = OpShiftRightArithmetic %ulong %25 %ulong_32 + %27 = OpSConvert %uint %26 + OpStore %21 %uint_0 Aligned 4 + OpStore %22 %uint_0 Aligned 4 + OpBranch %28 + %28 = OpLabel + OpLoopMerge %29 %30 Unroll + OpBranch %31 + %31 = OpLabel + %32 = OpLoad %uint %22 + %33 = OpSLessThan %bool %32 %rep + OpBranchConditional %33 %34 %29 + %34 = OpLabel + %35 = OpLoad %uint %22 + %36 = OpIMul %uint %35 %num + %37 = OpIAdd %uint %27 %36 + %38 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %37 + %39 = OpLoad %uint %38 + %40 = OpLoad %uint %21 + %41 = OpIAdd %uint %40 %39 + OpStore %21 %41 Aligned 4 + OpBranch %30 + %30 = OpLabel + %42 = OpLoad %uint %22 + %43 = OpIAdd %uint %42 %uint_1 + OpStore %22 %43 + OpBranch %28 + %29 = OpLabel + %44 = OpLoad %uint %21 + %45 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %26 + OpStore %45 %44 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_function_const.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_function_const.spvasm32 new file mode 100644 index 00000000..9dc1561a --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_function_const.spvasm32 @@ -0,0 +1,41 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 22 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "op_function_const" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_float + %11 = OpTypeFunction %float %float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %12 = OpFunction %float Const %11 + %13 = OpFunctionParameter %float + %14 = OpLabel + %15 = OpFNegate %float %13 + OpReturnValue %15 + OpFunctionEnd + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %16 = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %18 + %20 = OpLoad %float %19 + %21 = OpFunctionCall %float %12 %20 + OpStore %19 %21 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_function_const.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_function_const.spvasm64 new file mode 100644 index 00000000..58a497cb --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_function_const.spvasm64 @@ -0,0 +1,45 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "op_function_const" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 + %12 = OpTypeFunction %float %float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %13 = OpFunction %float Const %12 + %14 = OpFunctionParameter %float + %15 = OpLabel + %16 = OpFNegate %float %14 + OpReturnValue %16 + OpFunctionEnd + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %17 = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %21 + %23 = OpLoad %float %22 + %24 = OpFunctionCall %float %13 %23 + OpStore %22 %24 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_function_inline.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_function_inline.spvasm32 new file mode 100644 index 00000000..f344df3f --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_function_inline.spvasm32 @@ -0,0 +1,41 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 22 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "op_function_inline" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_float + %11 = OpTypeFunction %float %float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %12 = OpFunction %float Inline %11 + %13 = OpFunctionParameter %float + %14 = OpLabel + %15 = OpFNegate %float %13 + OpReturnValue %15 + OpFunctionEnd + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %16 = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %18 + %20 = OpLoad %float %19 + %21 = OpFunctionCall %float %12 %20 + OpStore %19 %21 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_function_inline.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_function_inline.spvasm64 new file mode 100644 index 00000000..ee4e9c92 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_function_inline.spvasm64 @@ -0,0 +1,45 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "op_function_inline" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 + %12 = OpTypeFunction %float %float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %13 = OpFunction %float Inline %12 + %14 = OpFunctionParameter %float + %15 = OpLabel + %16 = OpFNegate %float %14 + OpReturnValue %16 + OpFunctionEnd + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %17 = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %21 + %23 = OpLoad %float %22 + %24 = OpFunctionCall %float %13 %23 + OpStore %22 %24 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_function_noinline.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_function_noinline.spvasm32 new file mode 100644 index 00000000..8c93a494 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_function_noinline.spvasm32 @@ -0,0 +1,41 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 22 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "op_function_noinline" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_float + %11 = OpTypeFunction %float %float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %12 = OpFunction %float DontInline %11 + %13 = OpFunctionParameter %float + %14 = OpLabel + %15 = OpFNegate %float %13 + OpReturnValue %15 + OpFunctionEnd + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %16 = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %18 + %20 = OpLoad %float %19 + %21 = OpFunctionCall %float %12 %20 + OpStore %19 %21 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_function_noinline.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_function_noinline.spvasm64 new file mode 100644 index 00000000..cdf19901 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_function_noinline.spvasm64 @@ -0,0 +1,45 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "op_function_noinline" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 + %12 = OpTypeFunction %float %float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %13 = OpFunction %float DontInline %12 + %14 = OpFunctionParameter %float + %15 = OpLabel + %16 = OpFNegate %float %14 + OpReturnValue %16 + OpFunctionEnd + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %17 = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %21 + %23 = OpLoad %float %22 + %24 = OpFunctionCall %float %13 %23 + OpStore %22 %24 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_function_none.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_function_none.spvasm32 new file mode 100644 index 00000000..cd4345bb --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_function_none.spvasm32 @@ -0,0 +1,41 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 22 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "op_function_none" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_float + %11 = OpTypeFunction %float %float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %12 = OpFunction %float None %11 + %13 = OpFunctionParameter %float + %14 = OpLabel + %15 = OpFNegate %float %13 + OpReturnValue %15 + OpFunctionEnd + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %16 = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %18 + %20 = OpLoad %float %19 + %21 = OpFunctionCall %float %12 %20 + OpStore %19 %21 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_function_none.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_function_none.spvasm64 new file mode 100644 index 00000000..f242ae71 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_function_none.spvasm64 @@ -0,0 +1,45 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "op_function_none" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 + %12 = OpTypeFunction %float %float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %13 = OpFunction %float None %12 + %14 = OpFunctionParameter %float + %15 = OpLabel + %16 = OpFNegate %float %14 + OpReturnValue %16 + OpFunctionEnd + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %17 = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %21 + %23 = OpLoad %float %22 + %24 = OpFunctionCall %float %13 %23 + OpStore %22 %24 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_function_pure.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_function_pure.spvasm32 new file mode 100644 index 00000000..4922f679 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_function_pure.spvasm32 @@ -0,0 +1,41 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 22 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "op_function_pure" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_float + %11 = OpTypeFunction %float %float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %12 = OpFunction %float Pure %11 + %13 = OpFunctionParameter %float + %14 = OpLabel + %15 = OpFNegate %float %13 + OpReturnValue %15 + OpFunctionEnd + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %16 = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %18 + %20 = OpLoad %float %19 + %21 = OpFunctionCall %float %12 %20 + OpStore %19 %21 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_function_pure.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_function_pure.spvasm64 new file mode 100644 index 00000000..8c792cef --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_function_pure.spvasm64 @@ -0,0 +1,45 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "op_function_pure" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 + %12 = OpTypeFunction %float %float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %13 = OpFunction %float Pure %12 + %14 = OpFunctionParameter %float + %15 = OpLabel + %16 = OpFNegate %float %14 + OpReturnValue %16 + OpFunctionEnd + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %17 = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %21 + %23 = OpLoad %float %22 + %24 = OpFunctionCall %float %13 %23 + OpStore %22 %24 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_function_pure_ptr.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_function_pure_ptr.spvasm32 new file mode 100644 index 00000000..b8f958d4 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_function_pure_ptr.spvasm32 @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "op_function_pure_ptr" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_float + %uint_32 = OpConstant %uint 32 + %12 = OpTypeFunction %float %_ptr_CrossWorkgroup_float %uint + %13 = OpTypeFunction %void %_ptr_CrossWorkgroup_float %uint %float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %14 = OpFunction %float Pure %12 + %15 = OpFunctionParameter %_ptr_CrossWorkgroup_float + %16 = OpFunctionParameter %uint + %17 = OpLabel + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %15 %16 + %19 = OpLoad %float %18 + %20 = OpFNegate %float %19 + OpReturnValue %20 + OpFunctionEnd + %21 = OpFunction %void None %13 + %22 = OpFunctionParameter %_ptr_CrossWorkgroup_float + %23 = OpFunctionParameter %uint + %24 = OpFunctionParameter %float + %25 = OpLabel + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %22 %23 + OpStore %26 %24 + OpReturn + OpFunctionEnd + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %27 = OpLabel + %28 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %29 = OpCompositeExtract %uint %28 0 + %30 = OpFunctionCall %float %14 %in %29 + %31 = OpFunctionCall %void %21 %in %29 %30 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_function_pure_ptr.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_function_pure_ptr.spvasm64 new file mode 100644 index 00000000..4a5896d0 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_function_pure_ptr.spvasm64 @@ -0,0 +1,56 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 34 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "op_function_pure_ptr" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 + %12 = OpTypeFunction %float %_ptr_CrossWorkgroup_float %ulong + %13 = OpTypeFunction %void %_ptr_CrossWorkgroup_float %ulong %float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %14 = OpFunction %float Pure %12 + %15 = OpFunctionParameter %_ptr_CrossWorkgroup_float + %16 = OpFunctionParameter %ulong + %17 = OpLabel + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %15 %16 + %19 = OpLoad %float %18 + %20 = OpFNegate %float %19 + OpReturnValue %20 + OpFunctionEnd + %21 = OpFunction %void None %13 + %22 = OpFunctionParameter %_ptr_CrossWorkgroup_float + %23 = OpFunctionParameter %ulong + %24 = OpFunctionParameter %float + %25 = OpLabel + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %22 %23 + OpStore %26 %24 + OpReturn + OpFunctionEnd + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %27 = OpLabel + %28 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %29 = OpCompositeExtract %ulong %28 0 + %30 = OpShiftLeftLogical %ulong %29 %ulong_32 + %31 = OpShiftRightArithmetic %ulong %30 %ulong_32 + %32 = OpFunctionCall %float %14 %in %31 + %33 = OpFunctionCall %void %21 %in %31 %32 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_neg_double.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_neg_double.spvasm32 new file mode 100644 index 00000000..868565c6 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_neg_double.spvasm32 @@ -0,0 +1,35 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 17 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "op_neg_double" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_double +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_double + %11 = OpLabel + %12 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %13 = OpCompositeExtract %uint %12 0 + %14 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %in %13 + %15 = OpLoad %double %14 + %16 = OpFNegate %double %15 + OpStore %14 %16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_neg_double.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_neg_double.spvasm64 new file mode 100644 index 00000000..38e71c97 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_neg_double.spvasm64 @@ -0,0 +1,39 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "op_neg_double" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_double + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_double + %12 = OpLabel + %13 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %ulong %13 0 + %15 = OpShiftLeftLogical %ulong %14 %ulong_32 + %16 = OpShiftRightArithmetic %ulong %15 %ulong_32 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %in %16 + %18 = OpLoad %double %17 + %19 = OpFNegate %double %18 + OpStore %17 %19 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_neg_float.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_neg_float.spvasm32 new file mode 100644 index 00000000..e3cd3c92 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_neg_float.spvasm32 @@ -0,0 +1,34 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 17 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "op_neg_float" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %11 = OpLabel + %12 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %13 = OpCompositeExtract %uint %12 0 + %14 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %13 + %15 = OpLoad %float %14 + %16 = OpFNegate %float %15 + OpStore %14 %16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_neg_float.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_neg_float.spvasm64 new file mode 100644 index 00000000..085d114f --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_neg_float.spvasm64 @@ -0,0 +1,38 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "op_neg_float" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %12 = OpLabel + %13 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %ulong %13 0 + %15 = OpShiftLeftLogical %ulong %14 %ulong_32 + %16 = OpShiftRightArithmetic %ulong %15 %ulong_32 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %16 + %18 = OpLoad %float %17 + %19 = OpFNegate %float %18 + OpStore %17 %19 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_neg_float4.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_neg_float4.spvasm32 new file mode 100644 index 00000000..c65b7e93 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_neg_float4.spvasm32 @@ -0,0 +1,35 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 18 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "op_neg_float4" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_CrossWorkgroup_v4float = OpTypePointer CrossWorkgroup %v4float + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %12 = OpLabel + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %in %14 + %16 = OpLoad %v4float %15 + %17 = OpFNegate %v4float %16 + OpStore %15 %17 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_neg_float4.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_neg_float4.spvasm64 new file mode 100644 index 00000000..16c647b7 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_neg_float4.spvasm64 @@ -0,0 +1,39 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 21 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "op_neg_float4" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_CrossWorkgroup_v4float = OpTypePointer CrossWorkgroup %v4float + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %13 = OpLabel + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %in %17 + %19 = OpLoad %v4float %18 + %20 = OpFNegate %v4float %19 + OpStore %18 %20 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_neg_int.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_neg_int.spvasm32 new file mode 100644 index 00000000..98bf6f7c --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_neg_int.spvasm32 @@ -0,0 +1,33 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "op_neg_int" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %9 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %10 = OpLabel + %11 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %12 = OpCompositeExtract %uint %11 0 + %13 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %12 + %14 = OpLoad %uint %13 + %15 = OpSNegate %uint %14 + OpStore %13 %15 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_neg_int.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_neg_int.spvasm64 new file mode 100644 index 00000000..6dd86da0 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_neg_int.spvasm64 @@ -0,0 +1,38 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "op_neg_int" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %12 = OpLabel + %13 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %ulong %13 0 + %15 = OpShiftLeftLogical %ulong %14 %ulong_32 + %16 = OpShiftRightArithmetic %ulong %15 %ulong_32 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %16 + %18 = OpLoad %uint %17 + %19 = OpSNegate %uint %18 + OpStore %17 %19 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_neg_int4.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_neg_int4.spvasm32 new file mode 100644 index 00000000..61042e45 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_neg_int4.spvasm32 @@ -0,0 +1,34 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 17 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "op_neg_int4" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %v4uint = OpTypeVector %uint 4 +%_ptr_CrossWorkgroup_v4uint = OpTypePointer CrossWorkgroup %v4uint + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v4uint + %11 = OpLabel + %12 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %13 = OpCompositeExtract %uint %12 0 + %14 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4uint %in %13 + %15 = OpLoad %v4uint %14 + %16 = OpSNegate %v4uint %15 + OpStore %14 %16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_neg_int4.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_neg_int4.spvasm64 new file mode 100644 index 00000000..e741ef73 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_neg_int4.spvasm64 @@ -0,0 +1,39 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 21 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "op_neg_int4" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %v4uint = OpTypeVector %uint 4 +%_ptr_CrossWorkgroup_v4uint = OpTypePointer CrossWorkgroup %v4uint + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4uint + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v4uint + %13 = OpLabel + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4uint %in %17 + %19 = OpLoad %v4uint %18 + %20 = OpSNegate %v4uint %19 + OpStore %18 %20 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_neg_long.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_neg_long.spvasm32 new file mode 100644 index 00000000..ab9d29d4 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_neg_long.spvasm32 @@ -0,0 +1,35 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 17 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "op_neg_long" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %ulong = OpTypeInt 64 0 +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %11 = OpLabel + %12 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %13 = OpCompositeExtract %uint %12 0 + %14 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %in %13 + %15 = OpLoad %ulong %14 + %16 = OpSNegate %ulong %15 + OpStore %14 %16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_neg_long.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_neg_long.spvasm64 new file mode 100644 index 00000000..2eeb5654 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_neg_long.spvasm64 @@ -0,0 +1,37 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "op_neg_long" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %9 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %11 = OpLabel + %12 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %13 = OpCompositeExtract %ulong %12 0 + %14 = OpShiftLeftLogical %ulong %13 %ulong_32 + %15 = OpShiftRightArithmetic %ulong %14 %ulong_32 + %16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %in %15 + %17 = OpLoad %ulong %16 + %18 = OpSNegate %ulong %17 + OpStore %16 %18 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_neg_short.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_neg_short.spvasm32 new file mode 100644 index 00000000..18e7040a --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_neg_short.spvasm32 @@ -0,0 +1,35 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 17 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "op_neg_short" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %ushort = OpTypeInt 16 0 +%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ushort + %11 = OpLabel + %12 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %13 = OpCompositeExtract %uint %12 0 + %14 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %in %13 + %15 = OpLoad %ushort %14 + %16 = OpSNegate %ushort %15 + OpStore %14 %16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_neg_short.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_neg_short.spvasm64 new file mode 100644 index 00000000..546b1040 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_neg_short.spvasm64 @@ -0,0 +1,39 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "op_neg_short" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %ushort = OpTypeInt 16 0 +%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ushort + %12 = OpLabel + %13 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %ulong %13 0 + %15 = OpShiftLeftLogical %ulong %14 %ulong_32 + %16 = OpShiftRightArithmetic %ulong %15 %ulong_32 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %in %16 + %18 = OpLoad %ushort %17 + %19 = OpSNegate %ushort %18 + OpStore %17 %19 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_not_int.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_not_int.spvasm32 new file mode 100644 index 00000000..8608e3a4 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_not_int.spvasm32 @@ -0,0 +1,33 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "op_not_int" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %9 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %10 = OpLabel + %11 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %12 = OpCompositeExtract %uint %11 0 + %13 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %12 + %14 = OpLoad %uint %13 + %15 = OpNot %uint %14 + OpStore %13 %15 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_not_int.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_not_int.spvasm64 new file mode 100644 index 00000000..bffdfb7a --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_not_int.spvasm64 @@ -0,0 +1,38 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "op_not_int" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %12 = OpLabel + %13 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %ulong %13 0 + %15 = OpShiftLeftLogical %ulong %14 %ulong_32 + %16 = OpShiftRightArithmetic %ulong %15 %ulong_32 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %16 + %18 = OpLoad %uint %17 + %19 = OpNot %uint %18 + OpStore %17 %19 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_not_int4.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_not_int4.spvasm32 new file mode 100644 index 00000000..caf5bee7 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_not_int4.spvasm32 @@ -0,0 +1,34 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 17 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "op_not_int4" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %v4uint = OpTypeVector %uint 4 +%_ptr_CrossWorkgroup_v4uint = OpTypePointer CrossWorkgroup %v4uint + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v4uint + %11 = OpLabel + %12 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %13 = OpCompositeExtract %uint %12 0 + %14 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4uint %in %13 + %15 = OpLoad %v4uint %14 + %16 = OpNot %v4uint %15 + OpStore %14 %16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_not_int4.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_not_int4.spvasm64 new file mode 100644 index 00000000..f39c703b --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_not_int4.spvasm64 @@ -0,0 +1,39 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 21 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "op_not_int4" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %v4uint = OpTypeVector %uint 4 +%_ptr_CrossWorkgroup_v4uint = OpTypePointer CrossWorkgroup %v4uint + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4uint + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v4uint + %13 = OpLabel + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4uint %in %17 + %19 = OpLoad %v4uint %18 + %20 = OpNot %v4uint %19 + OpStore %18 %20 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_not_long.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_not_long.spvasm32 new file mode 100644 index 00000000..a94c8c56 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_not_long.spvasm32 @@ -0,0 +1,35 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 17 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "op_not_long" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %ulong = OpTypeInt 64 0 +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %11 = OpLabel + %12 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %13 = OpCompositeExtract %uint %12 0 + %14 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %in %13 + %15 = OpLoad %ulong %14 + %16 = OpNot %ulong %15 + OpStore %14 %16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_not_long.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_not_long.spvasm64 new file mode 100644 index 00000000..0cb309f1 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_not_long.spvasm64 @@ -0,0 +1,37 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "op_not_long" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %9 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %11 = OpLabel + %12 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %13 = OpCompositeExtract %ulong %12 0 + %14 = OpShiftLeftLogical %ulong %13 %ulong_32 + %15 = OpShiftRightArithmetic %ulong %14 %ulong_32 + %16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %in %15 + %17 = OpLoad %ulong %16 + %18 = OpNot %ulong %17 + OpStore %16 %18 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_not_short.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_not_short.spvasm32 new file mode 100644 index 00000000..15d52845 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_not_short.spvasm32 @@ -0,0 +1,35 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 17 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "op_not_short" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %ushort = OpTypeInt 16 0 +%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ushort + %11 = OpLabel + %12 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %13 = OpCompositeExtract %uint %12 0 + %14 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %in %13 + %15 = OpLoad %ushort %14 + %16 = OpNot %ushort %15 + OpStore %14 %16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_not_short.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_not_short.spvasm64 new file mode 100644 index 00000000..e2507114 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_not_short.spvasm64 @@ -0,0 +1,39 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "op_not_short" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %ushort = OpTypeInt 16 0 +%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ushort + %12 = OpLabel + %13 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %ulong %13 0 + %15 = OpShiftLeftLogical %ulong %14 %ulong_32 + %16 = OpShiftRightArithmetic %ulong %15 %ulong_32 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %in %16 + %18 = OpLoad %ushort %17 + %19 = OpNot %ushort %18 + OpStore %17 %19 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_spec_constant_double_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_spec_constant_double_simple.spvasm32 new file mode 100644 index 00000000..00cd989a --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_spec_constant_double_simple.spvasm32 @@ -0,0 +1,36 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Kernel + OpCapability Float64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %9 "spec_const_kernel" + %15 = OpString "kernel_arg_type.spec_const_kernel.double*," + OpSource OpenCL_C 102000 + OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value" + OpName %output_value "output_value" + OpName %entry "entry" + OpName %add "add" + OpDecorate %spec_const_kernel_spec_constant_value Constant + OpDecorate %spec_const_kernel_spec_constant_value Alignment 8 + OpDecorate %double_0 SpecId 101 + %double = OpTypeFloat 64 +%_ptr_UniformConstant_double = OpTypePointer UniformConstant %double + %void = OpTypeVoid +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %8 = OpTypeFunction %void %_ptr_CrossWorkgroup_double + %double_0 = OpSpecConstant %double 0 +%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_double UniformConstant %double_0 + %9 = OpFunction %void None %8 +%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %12 = OpLoad %double %output_value Aligned 8 + %13 = OpLoad %double %spec_const_kernel_spec_constant_value Aligned 8 + %add = OpFAdd %double %12 %13 + OpStore %output_value %add Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_spec_constant_double_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_spec_constant_double_simple.spvasm64 new file mode 100644 index 00000000..b50501b8 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_spec_constant_double_simple.spvasm64 @@ -0,0 +1,36 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Kernel + OpCapability Float64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %9 "spec_const_kernel" + %15 = OpString "kernel_arg_type.spec_const_kernel.double*," + OpSource OpenCL_C 102000 + OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value" + OpName %output_value "output_value" + OpName %entry "entry" + OpName %add "add" + OpDecorate %spec_const_kernel_spec_constant_value Constant + OpDecorate %spec_const_kernel_spec_constant_value Alignment 8 + OpDecorate %double_0 SpecId 101 + %double = OpTypeFloat 64 +%_ptr_UniformConstant_double = OpTypePointer UniformConstant %double + %void = OpTypeVoid +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %8 = OpTypeFunction %void %_ptr_CrossWorkgroup_double + %double_0 = OpSpecConstant %double 0 +%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_double UniformConstant %double_0 + %9 = OpFunction %void None %8 +%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_double + %entry = OpLabel + %12 = OpLoad %double %output_value Aligned 8 + %13 = OpLoad %double %spec_const_kernel_spec_constant_value Aligned 8 + %add = OpFAdd %double %12 %13 + OpStore %output_value %add Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_spec_constant_false_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_spec_constant_false_simple.spvasm32 new file mode 100644 index 00000000..8492474c --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_spec_constant_false_simple.spvasm32 @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %11 "spec_const_kernel" + %27 = OpString "kernel_arg_type.spec_const_kernel.uchar*," + OpSource OpenCL_C 102000 + OpName %test_value "test_value" + OpName %entry "entry" + OpName %output_value "output_value" + OpName %entry_0 "entry" + OpName %if_then "if.then" + OpName %if_end "if.end" + OpDecorate %test_value FuncParamAttr Zext + OpDecorate %test_value LinkageAttributes "test_value" Export + OpDecorate %false SpecId 101 + %uchar = OpTypeInt 8 0 + %uint = OpTypeInt 32 0 + %uchar_0 = OpConstant %uchar 0 + %uchar_1 = OpConstant %uchar 1 + %uint_1 = OpConstant %uint 1 + %bool = OpTypeBool + %3 = OpTypeFunction %bool + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar + %false = OpSpecConstantFalse %bool + %test_value = OpFunction %bool None %3 + %entry = OpLabel + OpReturnValue %false + OpFunctionEnd + %11 = OpFunction %void None %10 +%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %entry_0 = OpLabel + %call = OpFunctionCall %bool %test_value + %frombool = OpSelect %uchar %call %uchar_1 %uchar_0 + %tobool = OpINotEqual %bool %frombool %uchar_0 + OpBranchConditional %tobool %if_then %if_end + %if_then = OpLabel + %21 = OpLoad %uchar %output_value Aligned 1 + %conv = OpUConvert %uint %21 + %add = OpIAdd %uint %conv %uint_1 + %conv1 = OpUConvert %uchar %add + OpStore %output_value %conv1 Aligned 1 + OpBranch %if_end + %if_end = OpLabel + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_spec_constant_false_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_spec_constant_false_simple.spvasm64 new file mode 100644 index 00000000..c76bccc8 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_spec_constant_false_simple.spvasm64 @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %11 "spec_const_kernel" + %27 = OpString "kernel_arg_type.spec_const_kernel.uchar*," + OpSource OpenCL_C 102000 + OpName %test_value "test_value" + OpName %entry "entry" + OpName %output_value "output_value" + OpName %entry_0 "entry" + OpName %if_then "if.then" + OpName %if_end "if.end" + OpDecorate %test_value FuncParamAttr Zext + OpDecorate %test_value LinkageAttributes "test_value" Export + OpDecorate %false SpecId 101 + %uchar = OpTypeInt 8 0 + %uint = OpTypeInt 32 0 + %uchar_0 = OpConstant %uchar 0 + %uchar_1 = OpConstant %uchar 1 + %uint_1 = OpConstant %uint 1 + %bool = OpTypeBool + %3 = OpTypeFunction %bool + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar + %false = OpSpecConstantFalse %bool + %test_value = OpFunction %bool None %3 + %entry = OpLabel + OpReturnValue %false + OpFunctionEnd + %11 = OpFunction %void None %10 +%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %entry_0 = OpLabel + %call = OpFunctionCall %bool %test_value + %frombool = OpSelect %uchar %call %uchar_1 %uchar_0 + %tobool = OpINotEqual %bool %frombool %uchar_0 + OpBranchConditional %tobool %if_then %if_end + %if_then = OpLabel + %21 = OpLoad %uchar %output_value Aligned 1 + %conv = OpUConvert %uint %21 + %add = OpIAdd %uint %conv %uint_1 + %conv1 = OpUConvert %uchar %add + OpStore %output_value %conv1 Aligned 1 + OpBranch %if_end + %if_end = OpLabel + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_spec_constant_float_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_spec_constant_float_simple.spvasm32 new file mode 100644 index 00000000..b3163af1 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_spec_constant_float_simple.spvasm32 @@ -0,0 +1,35 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %9 "spec_const_kernel" + %15 = OpString "kernel_arg_type.spec_const_kernel.float*," + OpSource OpenCL_C 102000 + OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value" + OpName %output_value "output_value" + OpName %entry "entry" + OpName %add "add" + OpDecorate %spec_const_kernel_spec_constant_value Constant + OpDecorate %spec_const_kernel_spec_constant_value Alignment 4 + OpDecorate %float_0 SpecId 101 + %float = OpTypeFloat 32 +%_ptr_UniformConstant_float = OpTypePointer UniformConstant %float + %void = OpTypeVoid +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %8 = OpTypeFunction %void %_ptr_CrossWorkgroup_float + %float_0 = OpSpecConstant %float 0 +%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_float UniformConstant %float_0 + %9 = OpFunction %void None %8 +%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %12 = OpLoad %float %output_value Aligned 4 + %13 = OpLoad %float %spec_const_kernel_spec_constant_value Aligned 4 + %add = OpFAdd %float %12 %13 + OpStore %output_value %add Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_spec_constant_float_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_spec_constant_float_simple.spvasm64 new file mode 100644 index 00000000..006cdc7d --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_spec_constant_float_simple.spvasm64 @@ -0,0 +1,35 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %9 "spec_const_kernel" + %15 = OpString "kernel_arg_type.spec_const_kernel.float*," + OpSource OpenCL_C 102000 + OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value" + OpName %output_value "output_value" + OpName %entry "entry" + OpName %add "add" + OpDecorate %spec_const_kernel_spec_constant_value Constant + OpDecorate %spec_const_kernel_spec_constant_value Alignment 4 + OpDecorate %float_0 SpecId 101 + %float = OpTypeFloat 32 +%_ptr_UniformConstant_float = OpTypePointer UniformConstant %float + %void = OpTypeVoid +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %8 = OpTypeFunction %void %_ptr_CrossWorkgroup_float + %float_0 = OpSpecConstant %float 0 +%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_float UniformConstant %float_0 + %9 = OpFunction %void None %8 +%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %12 = OpLoad %float %output_value Aligned 4 + %13 = OpLoad %float %spec_const_kernel_spec_constant_value Aligned 4 + %add = OpFAdd %float %12 %13 + OpStore %output_value %add Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_spec_constant_half_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_spec_constant_half_simple.spvasm32 new file mode 100644 index 00000000..2195ebe8 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_spec_constant_half_simple.spvasm32 @@ -0,0 +1,36 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Kernel + OpCapability Float16Buffer + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %9 "spec_const_kernel" + %15 = OpString "kernel_arg_type.spec_const_kernel.half*," + OpSource OpenCL_C 102000 + OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value" + OpName %output_value "output_value" + OpName %entry "entry" + OpName %add "add" + OpDecorate %spec_const_kernel_spec_constant_value Constant + OpDecorate %spec_const_kernel_spec_constant_value Alignment 2 + OpDecorate %half_0x0p_0 SpecId 101 + %half = OpTypeFloat 16 +%_ptr_UniformConstant_half = OpTypePointer UniformConstant %half + %void = OpTypeVoid +%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half + %8 = OpTypeFunction %void %_ptr_CrossWorkgroup_half +%half_0x0p_0 = OpSpecConstant %half 0x0p+0 +%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_half UniformConstant %half_0x0p_0 + %9 = OpFunction %void None %8 +%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_half + %entry = OpLabel + %12 = OpLoad %half %output_value Aligned 2 + %13 = OpLoad %half %spec_const_kernel_spec_constant_value Aligned 2 + %add = OpFAdd %half %12 %13 + OpStore %output_value %add Aligned 2 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_spec_constant_half_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_spec_constant_half_simple.spvasm64 new file mode 100644 index 00000000..47dc418a --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_spec_constant_half_simple.spvasm64 @@ -0,0 +1,36 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Kernel + OpCapability Float16Buffer + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %9 "spec_const_kernel" + %15 = OpString "kernel_arg_type.spec_const_kernel.half*," + OpSource OpenCL_C 102000 + OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value" + OpName %output_value "output_value" + OpName %entry "entry" + OpName %add "add" + OpDecorate %spec_const_kernel_spec_constant_value Constant + OpDecorate %spec_const_kernel_spec_constant_value Alignment 2 + OpDecorate %half_0x0p_0 SpecId 101 + %half = OpTypeFloat 16 +%_ptr_UniformConstant_half = OpTypePointer UniformConstant %half + %void = OpTypeVoid +%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half + %8 = OpTypeFunction %void %_ptr_CrossWorkgroup_half +%half_0x0p_0 = OpSpecConstant %half 0x0p+0 +%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_half UniformConstant %half_0x0p_0 + %9 = OpFunction %void None %8 +%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_half + %entry = OpLabel + %12 = OpLoad %half %output_value Aligned 2 + %13 = OpLoad %half %spec_const_kernel_spec_constant_value Aligned 2 + %add = OpFAdd %half %12 %13 + OpStore %output_value %add Aligned 2 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_spec_constant_true_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_spec_constant_true_simple.spvasm32 new file mode 100644 index 00000000..834b85df --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_spec_constant_true_simple.spvasm32 @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %11 "spec_const_kernel" + %27 = OpString "kernel_arg_type.spec_const_kernel.uchar*," + OpSource OpenCL_C 102000 + OpName %test_value "test_value" + OpName %entry "entry" + OpName %output_value "output_value" + OpName %entry_0 "entry" + OpName %if_then "if.then" + OpName %if_end "if.end" + OpDecorate %test_value FuncParamAttr Zext + OpDecorate %test_value LinkageAttributes "test_value" Export + OpDecorate %true SpecId 101 + %uchar = OpTypeInt 8 0 + %uint = OpTypeInt 32 0 + %uchar_0 = OpConstant %uchar 0 + %uchar_1 = OpConstant %uchar 1 + %uint_1 = OpConstant %uint 1 + %bool = OpTypeBool + %3 = OpTypeFunction %bool + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar + %true = OpSpecConstantTrue %bool + %test_value = OpFunction %bool None %3 + %entry = OpLabel + OpReturnValue %true + OpFunctionEnd + %11 = OpFunction %void None %10 +%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %entry_0 = OpLabel + %call = OpFunctionCall %bool %test_value + %frombool = OpSelect %uchar %call %uchar_1 %uchar_0 + %tobool = OpINotEqual %bool %frombool %uchar_0 + OpBranchConditional %tobool %if_end %if_then + %if_then = OpLabel + %21 = OpLoad %uchar %output_value Aligned 1 + %conv = OpUConvert %uint %21 + %add = OpIAdd %uint %conv %uint_1 + %conv1 = OpUConvert %uchar %add + OpStore %output_value %conv1 Aligned 1 + OpBranch %if_end + %if_end = OpLabel + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_spec_constant_true_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_spec_constant_true_simple.spvasm64 new file mode 100644 index 00000000..83ce4d62 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_spec_constant_true_simple.spvasm64 @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %11 "spec_const_kernel" + %27 = OpString "kernel_arg_type.spec_const_kernel.uchar*," + OpSource OpenCL_C 102000 + OpName %test_value "test_value" + OpName %entry "entry" + OpName %output_value "output_value" + OpName %entry_0 "entry" + OpName %if_then "if.then" + OpName %if_end "if.end" + OpDecorate %test_value FuncParamAttr Zext + OpDecorate %test_value LinkageAttributes "test_value" Export + OpDecorate %true SpecId 101 + %uchar = OpTypeInt 8 0 + %uint = OpTypeInt 32 0 + %uchar_0 = OpConstant %uchar 0 + %uchar_1 = OpConstant %uchar 1 + %uint_1 = OpConstant %uint 1 + %bool = OpTypeBool + %3 = OpTypeFunction %bool + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar + %true = OpSpecConstantTrue %bool + %test_value = OpFunction %bool None %3 + %entry = OpLabel + OpReturnValue %true + OpFunctionEnd + %11 = OpFunction %void None %10 +%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %entry_0 = OpLabel + %call = OpFunctionCall %bool %test_value + %frombool = OpSelect %uchar %call %uchar_1 %uchar_0 + %tobool = OpINotEqual %bool %frombool %uchar_0 + OpBranchConditional %tobool %if_end %if_then + %if_then = OpLabel + %21 = OpLoad %uchar %output_value Aligned 1 + %conv = OpUConvert %uint %21 + %add = OpIAdd %uint %conv %uint_1 + %conv1 = OpUConvert %uchar %add + OpStore %output_value %conv1 Aligned 1 + OpBranch %if_end + %if_end = OpLabel + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_spec_constant_uchar_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_spec_constant_uchar_simple.spvasm32 new file mode 100644 index 00000000..0e832b42 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_spec_constant_uchar_simple.spvasm32 @@ -0,0 +1,37 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Kernel + OpCapability Int8 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %9 "spec_const_kernel" + %19 = OpString "kernel_arg_type.spec_const_kernel.uchar*," + OpSource OpenCL_C 102000 + OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value" + OpName %output_value "output_value" + OpName %entry "entry" + OpName %add "add" + OpDecorate %spec_const_kernel_spec_constant_value Constant + OpDecorate %spec_const_kernel_spec_constant_value Alignment 1 + OpDecorate %uchar_0 SpecId 101 + %uchar = OpTypeInt 8 0 + %uint = OpTypeInt 32 0 + %uchar_0 = OpSpecConstant %uchar 0 +%_ptr_UniformConstant_uchar = OpTypePointer UniformConstant %uchar + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar +%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_uchar UniformConstant %uchar_0 + %9 = OpFunction %void None %8 +%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %entry = OpLabel + %12 = OpLoad %uchar %output_value Aligned 1 + %15 = OpLoad %uchar %spec_const_kernel_spec_constant_value Aligned 1 + %add = OpIAdd %uchar %12 %15 + OpStore %output_value %add Aligned 1 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_spec_constant_uchar_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_spec_constant_uchar_simple.spvasm64 new file mode 100644 index 00000000..89150fc6 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_spec_constant_uchar_simple.spvasm64 @@ -0,0 +1,37 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Kernel + OpCapability Int8 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %9 "spec_const_kernel" + %19 = OpString "kernel_arg_type.spec_const_kernel.uchar*," + OpSource OpenCL_C 102000 + OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value" + OpName %output_value "output_value" + OpName %entry "entry" + OpName %add "add" + OpDecorate %spec_const_kernel_spec_constant_value Constant + OpDecorate %spec_const_kernel_spec_constant_value Alignment 1 + OpDecorate %uchar_0 SpecId 101 + %uchar = OpTypeInt 8 0 + %uint = OpTypeInt 32 0 + %uchar_0 = OpSpecConstant %uchar 0 +%_ptr_UniformConstant_uchar = OpTypePointer UniformConstant %uchar + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar +%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_uchar UniformConstant %uchar_0 + %9 = OpFunction %void None %8 +%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %entry = OpLabel + %12 = OpLoad %uchar %output_value Aligned 1 + %15 = OpLoad %uchar %spec_const_kernel_spec_constant_value Aligned 1 + %add = OpIAdd %uchar %12 %15 + OpStore %output_value %add Aligned 1 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_spec_constant_uint_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_spec_constant_uint_simple.spvasm32 new file mode 100644 index 00000000..7bf0f12c --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_spec_constant_uint_simple.spvasm32 @@ -0,0 +1,35 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %9 "spec_const_kernel" + %15 = OpString "kernel_arg_type.spec_const_kernel.uint*," + OpSource OpenCL_C 102000 + OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value" + OpName %output_value "output_value" + OpName %entry "entry" + OpName %add "add" + OpDecorate %spec_const_kernel_spec_constant_value Constant + OpDecorate %spec_const_kernel_spec_constant_value Alignment 4 + OpDecorate %uint_0 SpecId 101 + %uint = OpTypeInt 32 0 + %uint_0 = OpSpecConstant %uint 0 +%_ptr_UniformConstant_uint = OpTypePointer UniformConstant %uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint +%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_uint UniformConstant %uint_0 + %9 = OpFunction %void None %8 +%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %entry = OpLabel + %12 = OpLoad %uint %output_value Aligned 4 + %13 = OpLoad %uint %spec_const_kernel_spec_constant_value Aligned 4 + %add = OpIAdd %uint %12 %13 + OpStore %output_value %add Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_spec_constant_uint_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_spec_constant_uint_simple.spvasm64 new file mode 100644 index 00000000..a73bf240 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_spec_constant_uint_simple.spvasm64 @@ -0,0 +1,35 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %9 "spec_const_kernel" + %15 = OpString "kernel_arg_type.spec_const_kernel.uint*," + OpSource OpenCL_C 102000 + OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value" + OpName %output_value "output_value" + OpName %entry "entry" + OpName %add "add" + OpDecorate %spec_const_kernel_spec_constant_value Constant + OpDecorate %spec_const_kernel_spec_constant_value Alignment 4 + OpDecorate %uint_0 SpecId 101 + %uint = OpTypeInt 32 0 + %uint_0 = OpSpecConstant %uint 0 +%_ptr_UniformConstant_uint = OpTypePointer UniformConstant %uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint +%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_uint UniformConstant %uint_0 + %9 = OpFunction %void None %8 +%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %entry = OpLabel + %12 = OpLoad %uint %output_value Aligned 4 + %13 = OpLoad %uint %spec_const_kernel_spec_constant_value Aligned 4 + %add = OpIAdd %uint %12 %13 + OpStore %output_value %add Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_spec_constant_ulong_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_spec_constant_ulong_simple.spvasm32 new file mode 100644 index 00000000..c4e2ef79 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_spec_constant_ulong_simple.spvasm32 @@ -0,0 +1,36 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %9 "spec_const_kernel" + %15 = OpString "kernel_arg_type.spec_const_kernel.ulong*," + OpSource OpenCL_C 102000 + OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value" + OpName %output_value "output_value" + OpName %entry "entry" + OpName %add "add" + OpDecorate %spec_const_kernel_spec_constant_value Constant + OpDecorate %spec_const_kernel_spec_constant_value Alignment 8 + OpDecorate %ulong_0 SpecId 101 + %ulong = OpTypeInt 64 0 + %ulong_0 = OpSpecConstant %ulong 0 +%_ptr_UniformConstant_ulong = OpTypePointer UniformConstant %ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %8 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong +%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_ulong UniformConstant %ulong_0 + %9 = OpFunction %void None %8 +%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %entry = OpLabel + %12 = OpLoad %ulong %output_value Aligned 8 + %13 = OpLoad %ulong %spec_const_kernel_spec_constant_value Aligned 8 + %add = OpIAdd %ulong %12 %13 + OpStore %output_value %add Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_spec_constant_ulong_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_spec_constant_ulong_simple.spvasm64 new file mode 100644 index 00000000..3ec3a8ff --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_spec_constant_ulong_simple.spvasm64 @@ -0,0 +1,36 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %9 "spec_const_kernel" + %15 = OpString "kernel_arg_type.spec_const_kernel.ulong*," + OpSource OpenCL_C 102000 + OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value" + OpName %output_value "output_value" + OpName %entry "entry" + OpName %add "add" + OpDecorate %spec_const_kernel_spec_constant_value Constant + OpDecorate %spec_const_kernel_spec_constant_value Alignment 8 + OpDecorate %ulong_0 SpecId 101 + %ulong = OpTypeInt 64 0 + %ulong_0 = OpSpecConstant %ulong 0 +%_ptr_UniformConstant_ulong = OpTypePointer UniformConstant %ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %8 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong +%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_ulong UniformConstant %ulong_0 + %9 = OpFunction %void None %8 +%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %entry = OpLabel + %12 = OpLoad %ulong %output_value Aligned 8 + %13 = OpLoad %ulong %spec_const_kernel_spec_constant_value Aligned 8 + %add = OpIAdd %ulong %12 %13 + OpStore %output_value %add Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_spec_constant_ushort_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/op_spec_constant_ushort_simple.spvasm32 new file mode 100644 index 00000000..d5012070 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_spec_constant_ushort_simple.spvasm32 @@ -0,0 +1,36 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Kernel + OpCapability Int16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %9 "spec_const_kernel" + %19 = OpString "kernel_arg_type.spec_const_kernel.ushort*," + OpSource OpenCL_C 102000 + OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value" + OpName %output_value "output_value" + OpName %entry "entry" + OpDecorate %spec_const_kernel_spec_constant_value Constant + OpDecorate %spec_const_kernel_spec_constant_value Alignment 2 + OpDecorate %ushort_0 SpecId 101 + %ushort = OpTypeInt 16 0 + %uint = OpTypeInt 32 0 + %ushort_0 = OpSpecConstant %ushort 0 +%_ptr_UniformConstant_ushort = OpTypePointer UniformConstant %ushort + %void = OpTypeVoid +%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort + %8 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort +%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_ushort UniformConstant %ushort_0 + %9 = OpFunction %void None %8 +%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_ushort + %entry = OpLabel + %12 = OpLoad %ushort %output_value Aligned 2 + %15 = OpLoad %ushort %spec_const_kernel_spec_constant_value Aligned 2 + %add = OpIAdd %ushort %12 %15 + OpStore %output_value %add Aligned 2 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/op_spec_constant_ushort_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/op_spec_constant_ushort_simple.spvasm64 new file mode 100644 index 00000000..27f5fb8f --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/op_spec_constant_ushort_simple.spvasm64 @@ -0,0 +1,36 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Kernel + OpCapability Int16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %9 "spec_const_kernel" + %19 = OpString "kernel_arg_type.spec_const_kernel.ushort*," + OpSource OpenCL_C 102000 + OpName %spec_const_kernel_spec_constant_value "spec_const_kernel.spec_constant_value" + OpName %output_value "output_value" + OpName %entry "entry" + OpDecorate %spec_const_kernel_spec_constant_value Constant + OpDecorate %spec_const_kernel_spec_constant_value Alignment 2 + OpDecorate %ushort_0 SpecId 101 + %ushort = OpTypeInt 16 0 + %uint = OpTypeInt 32 0 + %ushort_0 = OpSpecConstant %ushort 0 +%_ptr_UniformConstant_ushort = OpTypePointer UniformConstant %ushort + %void = OpTypeVoid +%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort + %8 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort +%spec_const_kernel_spec_constant_value = OpVariable %_ptr_UniformConstant_ushort UniformConstant %ushort_0 + %9 = OpFunction %void None %8 +%output_value = OpFunctionParameter %_ptr_CrossWorkgroup_ushort + %entry = OpLabel + %12 = OpLoad %ushort %output_value Aligned 2 + %15 = OpLoad %ushort %spec_const_kernel_spec_constant_value Aligned 2 + %add = OpIAdd %ushort %12 %15 + OpStore %output_value %add Aligned 2 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/opaque.spvasm32 b/test_conformance/spirv_new/spirv_asm/opaque.spvasm32 new file mode 100644 index 00000000..e9a0a5af --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/opaque.spvasm32 @@ -0,0 +1,40 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 22 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "opaque" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %4 LinkageAttributes "opaque_store" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 +%Opaque_opaque_t = OpTypeOpaque "opaque_t" +%_ptr_CrossWorkgroup_Opaque_opaque_t = OpTypePointer CrossWorkgroup %Opaque_opaque_t +%float_3_14159274 = OpConstant %float 3.14159274 + %13 = OpTypeFunction %void %_ptr_CrossWorkgroup_Opaque_opaque_t +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_Opaque_opaque_t %uint %float + %4 = OpFunction %void None %14 + %15 = OpFunctionParameter %_ptr_CrossWorkgroup_Opaque_opaque_t + %16 = OpFunctionParameter %uint + %17 = OpFunctionParameter %float + OpFunctionEnd + %1 = OpFunction %void None %13 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_Opaque_opaque_t + %18 = OpLabel + %19 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %20 = OpCompositeExtract %uint %19 0 + %21 = OpFunctionCall %void %4 %in %20 %float_3_14159274 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/opaque.spvasm64 b/test_conformance/spirv_new/spirv_asm/opaque.spvasm64 new file mode 100644 index 00000000..0759c28b --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/opaque.spvasm64 @@ -0,0 +1,44 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "opaque" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %4 LinkageAttributes "opaque_store" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 + %ulong_32 = OpConstant %ulong 32 +%float_3_14159274 = OpConstant %float 3.14159274 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input +%Opaque_opaque_t = OpTypeOpaque "opaque_t" +%_ptr_CrossWorkgroup_Opaque_opaque_t = OpTypePointer CrossWorkgroup %Opaque_opaque_t + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_Opaque_opaque_t + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_Opaque_opaque_t %ulong %float + %4 = OpFunction %void None %15 + %16 = OpFunctionParameter %_ptr_CrossWorkgroup_Opaque_opaque_t + %17 = OpFunctionParameter %ulong + %18 = OpFunctionParameter %float + OpFunctionEnd + %1 = OpFunction %void None %14 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_Opaque_opaque_t + %19 = OpLabel + %20 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %21 = OpCompositeExtract %ulong %20 0 + %22 = OpShiftLeftLogical %ulong %21 %ulong_32 + %23 = OpShiftRightArithmetic %ulong %22 %ulong_32 + %24 = OpFunctionCall %void %4 %in %23 %float_3_14159274 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/phi_2.spvasm32 b/test_conformance/spirv_new/spirv_asm/phi_2.spvasm32 new file mode 100644 index 00000000..7a6311a7 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/phi_2.spvasm32 @@ -0,0 +1,52 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "phi_2" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %bool = OpTypeBool + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %13 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %13 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %14 = OpLabel + %15 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %16 = OpCompositeExtract %uint %15 0 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %16 + %18 = OpLoad %uint %17 Aligned 4 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %16 + %20 = OpLoad %uint %19 Aligned 4 + %21 = OpSLessThan %bool %18 %20 + OpBranchConditional %21 %22 %23 + %22 = OpLabel + %24 = OpISub %uint %20 %18 + OpBranch %25 + %23 = OpLabel + %26 = OpISub %uint %18 %20 + OpBranch %25 + %25 = OpLabel + %27 = OpPhi %uint %24 %22 %26 %23 + %28 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %16 + OpStore %28 %27 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/phi_2.spvasm64 b/test_conformance/spirv_new/spirv_asm/phi_2.spvasm64 new file mode 100644 index 00000000..538c5f71 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/phi_2.spvasm64 @@ -0,0 +1,57 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 33 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "phi_2" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %ulong_32 = OpConstant %ulong 32 + %bool = OpTypeBool + %void = OpTypeVoid + %uint = OpTypeInt 32 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %16 = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %20 + %22 = OpLoad %uint %21 Aligned 4 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %20 + %24 = OpLoad %uint %23 Aligned 4 + %25 = OpSLessThan %bool %22 %24 + OpBranchConditional %25 %26 %27 + %26 = OpLabel + %28 = OpISub %uint %24 %22 + OpBranch %29 + %27 = OpLabel + %30 = OpISub %uint %22 %24 + OpBranch %29 + %29 = OpLabel + %31 = OpPhi %uint %28 %26 %30 %27 + %32 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %20 + OpStore %32 %31 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/phi_3.spvasm32 b/test_conformance/spirv_new/spirv_asm/phi_3.spvasm32 new file mode 100644 index 00000000..fef5c243 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/phi_3.spvasm32 @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 34 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "phi_3" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %bool = OpTypeBool + %void = OpTypeVoid + %uint_0 = OpConstant %uint 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %14 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %15 = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %17 + %19 = OpLoad %uint %18 Aligned 4 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %17 + %21 = OpLoad %uint %20 Aligned 4 + %22 = OpSLessThan %bool %19 %21 + OpBranchConditional %22 %23 %24 + %23 = OpLabel + %25 = OpSLessThan %bool %19 %uint_0 + OpBranchConditional %25 %26 %27 + %26 = OpLabel + %28 = OpISub %uint %uint_0 %19 + OpBranch %29 + %27 = OpLabel + %30 = OpISub %uint %19 %uint_0 + OpBranch %29 + %24 = OpLabel + %31 = OpISub %uint %19 %21 + OpBranch %29 + %29 = OpLabel + %32 = OpPhi %uint %28 %26 %30 %27 %31 %24 + %33 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %17 + OpStore %33 %32 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/phi_3.spvasm64 b/test_conformance/spirv_new/spirv_asm/phi_3.spvasm64 new file mode 100644 index 00000000..9ea0fc86 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/phi_3.spvasm64 @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 38 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "phi_3" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 + %ulong_32 = OpConstant %ulong 32 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %bool = OpTypeBool + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %17 = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %21 + %23 = OpLoad %uint %22 Aligned 4 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %21 + %25 = OpLoad %uint %24 Aligned 4 + %26 = OpSLessThan %bool %23 %25 + OpBranchConditional %26 %27 %28 + %27 = OpLabel + %29 = OpSLessThan %bool %23 %uint_0 + OpBranchConditional %29 %30 %31 + %30 = OpLabel + %32 = OpISub %uint %uint_0 %23 + OpBranch %33 + %31 = OpLabel + %34 = OpISub %uint %23 %uint_0 + OpBranch %33 + %28 = OpLabel + %35 = OpISub %uint %23 %25 + OpBranch %33 + %33 = OpLabel + %36 = OpPhi %uint %32 %30 %34 %31 %35 %28 + %37 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %21 + OpStore %37 %36 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/phi_4.spvasm32 b/test_conformance/spirv_new/spirv_asm/phi_4.spvasm32 new file mode 100644 index 00000000..575ff3d3 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/phi_4.spvasm32 @@ -0,0 +1,65 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 38 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "phi_4" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %bool = OpTypeBool + %void = OpTypeVoid + %uint_0 = OpConstant %uint 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %14 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %15 = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %17 + %19 = OpLoad %uint %18 Aligned 4 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %17 + %21 = OpLoad %uint %20 Aligned 4 + %22 = OpSLessThan %bool %19 %21 + OpBranchConditional %22 %23 %24 + %23 = OpLabel + %25 = OpSLessThan %bool %19 %uint_0 + OpBranchConditional %25 %26 %27 + %26 = OpLabel + %28 = OpISub %uint %uint_0 %19 + OpBranch %29 + %27 = OpLabel + %30 = OpISub %uint %19 %uint_0 + OpBranch %29 + %24 = OpLabel + %31 = OpSLessThan %bool %21 %uint_0 + OpBranchConditional %31 %32 %33 + %32 = OpLabel + %34 = OpISub %uint %uint_0 %21 + OpBranch %29 + %33 = OpLabel + %35 = OpISub %uint %21 %uint_0 + OpBranch %29 + %29 = OpLabel + %36 = OpPhi %uint %28 %26 %30 %27 %34 %32 %35 %33 + %37 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %17 + OpStore %37 %36 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/phi_4.spvasm64 b/test_conformance/spirv_new/spirv_asm/phi_4.spvasm64 new file mode 100644 index 00000000..ffa1fc11 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/phi_4.spvasm64 @@ -0,0 +1,70 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 42 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "phi_4" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %ulong_32 = OpConstant %ulong 32 + %bool = OpTypeBool + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %17 = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %21 + %23 = OpLoad %uint %22 Aligned 4 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %21 + %25 = OpLoad %uint %24 Aligned 4 + %26 = OpSLessThan %bool %23 %25 + OpBranchConditional %26 %27 %28 + %27 = OpLabel + %29 = OpSLessThan %bool %23 %uint_0 + OpBranchConditional %29 %30 %31 + %30 = OpLabel + %32 = OpISub %uint %uint_0 %23 + OpBranch %33 + %31 = OpLabel + %34 = OpISub %uint %23 %uint_0 + OpBranch %33 + %28 = OpLabel + %35 = OpSLessThan %bool %25 %uint_0 + OpBranchConditional %35 %36 %37 + %36 = OpLabel + %38 = OpISub %uint %uint_0 %25 + OpBranch %33 + %37 = OpLabel + %39 = OpISub %uint %25 %uint_0 + OpBranch %33 + %33 = OpLabel + %40 = OpPhi %uint %32 %30 %34 %31 %38 %36 %39 %37 + %41 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %21 + OpStore %41 %40 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/select_if_dont_flatten.spvasm32 b/test_conformance/spirv_new/spirv_asm/select_if_dont_flatten.spvasm32 new file mode 100644 index 00000000..53883e34 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/select_if_dont_flatten.spvasm32 @@ -0,0 +1,58 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "select_if_dont_flatten" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %bool = OpTypeBool + %void = OpTypeVoid + %uint_0 = OpConstant %uint 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %16 = OpLabel + %17 = OpVariable %_ptr_Function_uint Function + %18 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %uint %18 0 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %19 + %21 = OpLoad %uint %20 Aligned 4 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %19 + %23 = OpLoad %uint %22 Aligned 4 + %24 = OpSLessThan %bool %21 %23 + OpSelectionMerge %25 DontFlatten + OpBranchConditional %24 %26 %27 + %26 = OpLabel + %28 = OpISub %uint %23 %21 + OpStore %17 %28 + OpBranch %25 + %27 = OpLabel + %29 = OpISub %uint %21 %23 + OpStore %17 %29 + OpBranch %25 + %25 = OpLabel + %30 = OpLoad %uint %17 + %31 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %19 + OpStore %31 %30 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/select_if_dont_flatten.spvasm64 b/test_conformance/spirv_new/spirv_asm/select_if_dont_flatten.spvasm64 new file mode 100644 index 00000000..5939b713 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/select_if_dont_flatten.spvasm64 @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 36 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "select_if_dont_flatten" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %bool = OpTypeBool + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %ulong_32 = OpConstant %ulong 32 + %uint_0 = OpConstant %uint 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %17 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %17 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %18 = OpLabel + %19 = OpVariable %_ptr_Function_uint Function + %20 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %21 = OpCompositeExtract %ulong %20 0 + %22 = OpShiftLeftLogical %ulong %21 %ulong_32 + %23 = OpShiftRightArithmetic %ulong %22 %ulong_32 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %23 + %25 = OpLoad %uint %24 Aligned 4 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %23 + %27 = OpLoad %uint %26 Aligned 4 + OpStore %19 %uint_0 + %28 = OpSLessThan %bool %25 %27 + OpSelectionMerge %29 DontFlatten + OpBranchConditional %28 %30 %31 + %30 = OpLabel + %32 = OpISub %uint %27 %25 + OpStore %19 %32 + OpBranch %29 + %31 = OpLabel + %33 = OpISub %uint %25 %27 + OpStore %19 %33 + OpBranch %29 + %29 = OpLabel + %34 = OpLoad %uint %19 + %35 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %23 + OpStore %35 %34 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/select_if_flatten.spvasm32 b/test_conformance/spirv_new/spirv_asm/select_if_flatten.spvasm32 new file mode 100644 index 00000000..0b057322 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/select_if_flatten.spvasm32 @@ -0,0 +1,58 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "select_if_flatten" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %bool = OpTypeBool + %void = OpTypeVoid + %uint_0 = OpConstant %uint 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %16 = OpLabel + %17 = OpVariable %_ptr_Function_uint Function + %18 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %uint %18 0 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %19 + %21 = OpLoad %uint %20 Aligned 4 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %19 + %23 = OpLoad %uint %22 Aligned 4 + %24 = OpSLessThan %bool %21 %23 + OpSelectionMerge %25 Flatten + OpBranchConditional %24 %26 %27 + %26 = OpLabel + %28 = OpISub %uint %23 %21 + OpStore %17 %28 + OpBranch %25 + %27 = OpLabel + %29 = OpISub %uint %21 %23 + OpStore %17 %29 + OpBranch %25 + %25 = OpLabel + %30 = OpLoad %uint %17 + %31 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %19 + OpStore %31 %30 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/select_if_flatten.spvasm64 b/test_conformance/spirv_new/spirv_asm/select_if_flatten.spvasm64 new file mode 100644 index 00000000..e3e4cf98 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/select_if_flatten.spvasm64 @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 36 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "select_if_flatten" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %bool = OpTypeBool + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %ulong_32 = OpConstant %ulong 32 + %uint_0 = OpConstant %uint 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %17 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %17 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %18 = OpLabel + %19 = OpVariable %_ptr_Function_uint Function + %20 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %21 = OpCompositeExtract %ulong %20 0 + %22 = OpShiftLeftLogical %ulong %21 %ulong_32 + %23 = OpShiftRightArithmetic %ulong %22 %ulong_32 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %23 + %25 = OpLoad %uint %24 Aligned 4 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %23 + %27 = OpLoad %uint %26 Aligned 4 + OpStore %19 %uint_0 + %28 = OpSLessThan %bool %25 %27 + OpSelectionMerge %29 Flatten + OpBranchConditional %28 %30 %31 + %30 = OpLabel + %32 = OpISub %uint %27 %25 + OpStore %19 %32 + OpBranch %29 + %31 = OpLabel + %33 = OpISub %uint %25 %27 + OpStore %19 %33 + OpBranch %29 + %29 = OpLabel + %34 = OpLoad %uint %19 + %35 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %23 + OpStore %35 %34 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/select_if_none.spvasm32 b/test_conformance/spirv_new/spirv_asm/select_if_none.spvasm32 new file mode 100644 index 00000000..b8217880 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/select_if_none.spvasm32 @@ -0,0 +1,58 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "select_if_none" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %bool = OpTypeBool + %void = OpTypeVoid + %uint_0 = OpConstant %uint 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %16 = OpLabel + %17 = OpVariable %_ptr_Function_uint Function + %18 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %uint %18 0 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %19 + %21 = OpLoad %uint %20 Aligned 4 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %19 + %23 = OpLoad %uint %22 Aligned 4 + %24 = OpSLessThan %bool %21 %23 + OpSelectionMerge %25 None + OpBranchConditional %24 %26 %27 + %26 = OpLabel + %28 = OpISub %uint %23 %21 + OpStore %17 %28 + OpBranch %25 + %27 = OpLabel + %29 = OpISub %uint %21 %23 + OpStore %17 %29 + OpBranch %25 + %25 = OpLabel + %30 = OpLoad %uint %17 + %31 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %19 + OpStore %31 %30 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/select_if_none.spvasm64 b/test_conformance/spirv_new/spirv_asm/select_if_none.spvasm64 new file mode 100644 index 00000000..6a45bce6 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/select_if_none.spvasm64 @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 36 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "select_if_none" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %bool = OpTypeBool + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %ulong_32 = OpConstant %ulong 32 + %uint_0 = OpConstant %uint 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %17 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %17 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %18 = OpLabel + %19 = OpVariable %_ptr_Function_uint Function + %20 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %21 = OpCompositeExtract %ulong %20 0 + %22 = OpShiftLeftLogical %ulong %21 %ulong_32 + %23 = OpShiftRightArithmetic %ulong %22 %ulong_32 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %23 + %25 = OpLoad %uint %24 Aligned 4 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %23 + %27 = OpLoad %uint %26 Aligned 4 + OpStore %19 %uint_0 + %28 = OpSLessThan %bool %25 %27 + OpSelectionMerge %29 None + OpBranchConditional %28 %30 %31 + %30 = OpLabel + %32 = OpISub %uint %27 %25 + OpStore %19 %32 + OpBranch %29 + %31 = OpLabel + %33 = OpISub %uint %25 %27 + OpStore %19 %33 + OpBranch %29 + %29 = OpLabel + %34 = OpLoad %uint %19 + %35 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %23 + OpStore %35 %34 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/select_switch_dont_flatten.spvasm32 b/test_conformance/spirv_new/spirv_asm/select_switch_dont_flatten.spvasm32 new file mode 100644 index 00000000..fa459f77 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/select_switch_dont_flatten.spvasm32 @@ -0,0 +1,67 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 37 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "select_switch_dont_flatten" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %bool = OpTypeBool + %void = OpTypeVoid + %uint_0 = OpConstant %uint 0 + %uint_1 = OpConstant %uint 1 + %uint_2 = OpConstant %uint 2 + %uint_3 = OpConstant %uint 3 + %uint_4 = OpConstant %uint 4 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %19 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %19 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %20 = OpLabel + %21 = OpVariable %_ptr_Function_uint Function + %22 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %23 = OpCompositeExtract %uint %22 0 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %23 + %25 = OpLoad %uint %24 Aligned 4 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %23 + %27 = OpLoad %uint %26 Aligned 4 + %28 = OpIAdd %uint %25 %27 + %29 = OpUMod %uint %28 %uint_4 + OpSelectionMerge %30 DontFlatten + OpSwitch %29 %31 1 %32 2 %33 3 %34 + %32 = OpLabel + OpStore %21 %uint_1 + OpBranch %30 + %33 = OpLabel + OpStore %21 %uint_2 + OpBranch %30 + %34 = OpLabel + OpStore %21 %uint_3 + OpBranch %30 + %31 = OpLabel + OpStore %21 %uint_0 + OpBranch %30 + %30 = OpLabel + %35 = OpLoad %uint %21 + %36 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %23 + OpStore %36 %35 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/select_switch_dont_flatten.spvasm64 b/test_conformance/spirv_new/spirv_asm/select_switch_dont_flatten.spvasm64 new file mode 100644 index 00000000..cae44bed --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/select_switch_dont_flatten.spvasm64 @@ -0,0 +1,73 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 41 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "select_switch_dont_flatten" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %bool = OpTypeBool + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %ulong_32 = OpConstant %ulong 32 + %uint_0 = OpConstant %uint 0 + %uint_1 = OpConstant %uint 1 + %uint_2 = OpConstant %uint 2 + %uint_3 = OpConstant %uint 3 + %uint_4 = OpConstant %uint 4 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %21 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %21 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %22 = OpLabel + %23 = OpVariable %_ptr_Function_uint Function + %24 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %25 = OpCompositeExtract %ulong %24 0 + %26 = OpShiftLeftLogical %ulong %25 %ulong_32 + %27 = OpShiftRightArithmetic %ulong %26 %ulong_32 + %28 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %27 + %29 = OpLoad %uint %28 Aligned 4 + %30 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %27 + %31 = OpLoad %uint %30 Aligned 4 + OpStore %23 %uint_0 + %32 = OpIAdd %uint %29 %31 + %33 = OpUMod %uint %32 %uint_4 + OpSelectionMerge %34 DontFlatten + OpSwitch %33 %35 1 %36 2 %37 3 %38 + %36 = OpLabel + OpStore %23 %uint_1 + OpBranch %34 + %37 = OpLabel + OpStore %23 %uint_2 + OpBranch %34 + %38 = OpLabel + OpStore %23 %uint_3 + OpBranch %34 + %35 = OpLabel + OpStore %23 %uint_0 + OpBranch %34 + %34 = OpLabel + %39 = OpLoad %uint %23 + %40 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %27 + OpStore %40 %39 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/select_switch_flatten.spvasm32 b/test_conformance/spirv_new/spirv_asm/select_switch_flatten.spvasm32 new file mode 100644 index 00000000..441fafb5 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/select_switch_flatten.spvasm32 @@ -0,0 +1,67 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 37 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "select_switch_flatten" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %bool = OpTypeBool + %void = OpTypeVoid + %uint_0 = OpConstant %uint 0 + %uint_1 = OpConstant %uint 1 + %uint_2 = OpConstant %uint 2 + %uint_3 = OpConstant %uint 3 + %uint_4 = OpConstant %uint 4 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %19 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %19 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %20 = OpLabel + %21 = OpVariable %_ptr_Function_uint Function + %22 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %23 = OpCompositeExtract %uint %22 0 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %23 + %25 = OpLoad %uint %24 Aligned 4 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %23 + %27 = OpLoad %uint %26 Aligned 4 + %28 = OpIAdd %uint %25 %27 + %29 = OpUMod %uint %28 %uint_4 + OpSelectionMerge %30 Flatten + OpSwitch %29 %31 1 %32 2 %33 3 %34 + %32 = OpLabel + OpStore %21 %uint_1 + OpBranch %30 + %33 = OpLabel + OpStore %21 %uint_2 + OpBranch %30 + %34 = OpLabel + OpStore %21 %uint_3 + OpBranch %30 + %31 = OpLabel + OpStore %21 %uint_0 + OpBranch %30 + %30 = OpLabel + %35 = OpLoad %uint %21 + %36 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %23 + OpStore %36 %35 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/select_switch_flatten.spvasm64 b/test_conformance/spirv_new/spirv_asm/select_switch_flatten.spvasm64 new file mode 100644 index 00000000..9e565147 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/select_switch_flatten.spvasm64 @@ -0,0 +1,73 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 41 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "select_switch_flatten" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %bool = OpTypeBool + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %ulong_32 = OpConstant %ulong 32 + %uint_0 = OpConstant %uint 0 + %uint_1 = OpConstant %uint 1 + %uint_2 = OpConstant %uint 2 + %uint_3 = OpConstant %uint 3 + %uint_4 = OpConstant %uint 4 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %21 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %21 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %22 = OpLabel + %23 = OpVariable %_ptr_Function_uint Function + %24 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %25 = OpCompositeExtract %ulong %24 0 + %26 = OpShiftLeftLogical %ulong %25 %ulong_32 + %27 = OpShiftRightArithmetic %ulong %26 %ulong_32 + %28 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %27 + %29 = OpLoad %uint %28 Aligned 4 + %30 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %27 + %31 = OpLoad %uint %30 Aligned 4 + OpStore %23 %uint_0 + %32 = OpIAdd %uint %29 %31 + %33 = OpUMod %uint %32 %uint_4 + OpSelectionMerge %34 Flatten + OpSwitch %33 %35 1 %36 2 %37 3 %38 + %36 = OpLabel + OpStore %23 %uint_1 + OpBranch %34 + %37 = OpLabel + OpStore %23 %uint_2 + OpBranch %34 + %38 = OpLabel + OpStore %23 %uint_3 + OpBranch %34 + %35 = OpLabel + OpStore %23 %uint_0 + OpBranch %34 + %34 = OpLabel + %39 = OpLoad %uint %23 + %40 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %27 + OpStore %40 %39 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/select_switch_none.spvasm32 b/test_conformance/spirv_new/spirv_asm/select_switch_none.spvasm32 new file mode 100644 index 00000000..ddaf22a4 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/select_switch_none.spvasm32 @@ -0,0 +1,67 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 37 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "select_switch_none" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %bool = OpTypeBool + %void = OpTypeVoid + %uint_0 = OpConstant %uint 0 + %uint_1 = OpConstant %uint 1 + %uint_2 = OpConstant %uint 2 + %uint_3 = OpConstant %uint 3 + %uint_4 = OpConstant %uint 4 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %19 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %19 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %20 = OpLabel + %21 = OpVariable %_ptr_Function_uint Function + %22 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %23 = OpCompositeExtract %uint %22 0 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %23 + %25 = OpLoad %uint %24 Aligned 4 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %23 + %27 = OpLoad %uint %26 Aligned 4 + %28 = OpIAdd %uint %25 %27 + %29 = OpUMod %uint %28 %uint_4 + OpSelectionMerge %30 None + OpSwitch %29 %31 1 %32 2 %33 3 %34 + %32 = OpLabel + OpStore %21 %uint_1 + OpBranch %30 + %33 = OpLabel + OpStore %21 %uint_2 + OpBranch %30 + %34 = OpLabel + OpStore %21 %uint_3 + OpBranch %30 + %31 = OpLabel + OpStore %21 %uint_0 + OpBranch %30 + %30 = OpLabel + %35 = OpLoad %uint %21 + %36 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %23 + OpStore %36 %35 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/select_switch_none.spvasm64 b/test_conformance/spirv_new/spirv_asm/select_switch_none.spvasm64 new file mode 100644 index 00000000..27a3983c --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/select_switch_none.spvasm64 @@ -0,0 +1,73 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 41 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "select_switch_none" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %bool = OpTypeBool + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %ulong_32 = OpConstant %ulong 32 + %uint_0 = OpConstant %uint 0 + %uint_1 = OpConstant %uint 1 + %uint_2 = OpConstant %uint 2 + %uint_3 = OpConstant %uint 3 + %uint_4 = OpConstant %uint 4 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_Function_uint = OpTypePointer Function %uint + %21 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %21 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %22 = OpLabel + %23 = OpVariable %_ptr_Function_uint Function + %24 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %25 = OpCompositeExtract %ulong %24 0 + %26 = OpShiftLeftLogical %ulong %25 %ulong_32 + %27 = OpShiftRightArithmetic %ulong %26 %ulong_32 + %28 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %27 + %29 = OpLoad %uint %28 Aligned 4 + %30 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %27 + %31 = OpLoad %uint %30 Aligned 4 + OpStore %23 %uint_0 + %32 = OpIAdd %uint %29 %31 + %33 = OpUMod %uint %32 %uint_4 + OpSelectionMerge %34 None + OpSwitch %33 %35 1 %36 2 %37 3 %38 + %36 = OpLabel + OpStore %23 %uint_1 + OpBranch %34 + %37 = OpLabel + OpStore %23 %uint_2 + OpBranch %34 + %38 = OpLabel + OpStore %23 %uint_3 + OpBranch %34 + %35 = OpLabel + OpStore %23 %uint_0 + OpBranch %34 + %34 = OpLabel + %39 = OpLoad %uint %23 + %40 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %27 + OpStore %40 %39 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_char_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/undef_char_simple.spvasm32 new file mode 100644 index 00000000..ad77b2a7 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_char_simple.spvasm32 @@ -0,0 +1,34 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "undef_char_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %11 = OpLabel + %12 = OpUndef %uchar + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %in %14 + OpStore %15 %12 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_char_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/undef_char_simple.spvasm64 new file mode 100644 index 00000000..4e4768d2 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_char_simple.spvasm64 @@ -0,0 +1,38 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "undef_char_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %12 = OpLabel + %13 = OpUndef %uchar + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %in %17 + OpStore %18 %13 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_double_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/undef_double_simple.spvasm32 new file mode 100644 index 00000000..631c179f --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_double_simple.spvasm32 @@ -0,0 +1,34 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "undef_double_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_double +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_double + %11 = OpLabel + %12 = OpUndef %double + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %in %14 + OpStore %15 %12 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_double_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/undef_double_simple.spvasm64 new file mode 100644 index 00000000..6e301167 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_double_simple.spvasm64 @@ -0,0 +1,38 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "undef_double_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_double + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_double + %12 = OpLabel + %13 = OpUndef %double + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %in %17 + OpStore %18 %13 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_false_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/undef_false_simple.spvasm32 new file mode 100644 index 00000000..8886283e --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_false_simple.spvasm32 @@ -0,0 +1,36 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "undef_false_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %bool = OpTypeBool +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint + %uint_1 = OpConstant %uint 1 + %uint_0 = OpConstant %uint 0 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %13 = OpLabel + %14 = OpUndef %bool + %15 = OpSelect %uint %14 %uint_1 %uint_0 + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %17 + OpStore %18 %15 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_false_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/undef_false_simple.spvasm64 new file mode 100644 index 00000000..4b781b1e --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_false_simple.spvasm64 @@ -0,0 +1,41 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "undef_false_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %bool = OpTypeBool +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint + %ulong_32 = OpConstant %ulong 32 + %uint_1 = OpConstant %uint 1 + %uint_0 = OpConstant %uint 0 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %15 = OpLabel + %16 = OpUndef %bool + %17 = OpSelect %uint %16 %uint_1 %uint_0 + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %21 + OpStore %22 %17 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_float_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/undef_float_simple.spvasm32 new file mode 100644 index 00000000..93a69a87 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_float_simple.spvasm32 @@ -0,0 +1,33 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "undef_float_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %11 = OpLabel + %12 = OpUndef %float + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %14 + OpStore %15 %12 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_float_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/undef_float_simple.spvasm64 new file mode 100644 index 00000000..f2e1d249 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_float_simple.spvasm64 @@ -0,0 +1,37 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "undef_float_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %12 = OpLabel + %13 = OpUndef %float + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %17 + OpStore %18 %13 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_half_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/undef_half_simple.spvasm32 new file mode 100644 index 00000000..6f05643a --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_half_simple.spvasm32 @@ -0,0 +1,36 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 18 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "undef_half_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 + %half = OpTypeFloat 16 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup_float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %12 = OpLabel + %13 = OpUndef %half + %14 = OpFConvert %float %13 + %15 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %16 = OpCompositeExtract %uint %15 0 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %16 + OpStore %17 %14 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_half_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/undef_half_simple.spvasm64 new file mode 100644 index 00000000..eff63f8c --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_half_simple.spvasm64 @@ -0,0 +1,40 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 21 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "undef_half_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %float = OpTypeFloat 32 + %half = OpTypeFloat 16 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %13 = OpLabel + %14 = OpUndef %half + %15 = OpFConvert %float %14 + %16 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %ulong %16 0 + %18 = OpShiftLeftLogical %ulong %17 %ulong_32 + %19 = OpShiftRightArithmetic %ulong %18 %ulong_32 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %19 + OpStore %20 %15 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_int3_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/undef_int3_simple.spvasm32 new file mode 100644 index 00000000..7839d45a --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_int3_simple.spvasm32 @@ -0,0 +1,32 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 15 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "undef_int3_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_v3uint = OpTypePointer CrossWorkgroup %v3uint + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_v3uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %9 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v3uint + %10 = OpLabel + %11 = OpUndef %v3uint + %12 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %13 = OpCompositeExtract %uint %12 0 + %14 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v3uint %in %13 + OpStore %14 %11 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_int3_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/undef_int3_simple.spvasm64 new file mode 100644 index 00000000..7369f2f6 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_int3_simple.spvasm64 @@ -0,0 +1,38 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "undef_int3_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_CrossWorkgroup_v3uint = OpTypePointer CrossWorkgroup %v3uint + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup_v3uint + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v3uint + %13 = OpLabel + %14 = OpUndef %v3uint + %15 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %16 = OpCompositeExtract %ulong %15 0 + %17 = OpShiftLeftLogical %ulong %16 %ulong_32 + %18 = OpShiftRightArithmetic %ulong %17 %ulong_32 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v3uint %in %18 + OpStore %19 %14 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_int4_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/undef_int4_simple.spvasm32 new file mode 100644 index 00000000..6f30a9b8 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_int4_simple.spvasm32 @@ -0,0 +1,33 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "undef_int4_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %v4uint = OpTypeVector %uint 4 +%_ptr_CrossWorkgroup_v4uint = OpTypePointer CrossWorkgroup %v4uint + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v4uint + %11 = OpLabel + %12 = OpUndef %v4uint + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4uint %in %14 + OpStore %15 %12 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_int4_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/undef_int4_simple.spvasm64 new file mode 100644 index 00000000..d42a1578 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_int4_simple.spvasm64 @@ -0,0 +1,38 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 20 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "undef_int4_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %v4uint = OpTypeVector %uint 4 +%_ptr_CrossWorkgroup_v4uint = OpTypePointer CrossWorkgroup %v4uint + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4uint + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v4uint + %13 = OpLabel + %14 = OpUndef %v4uint + %15 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %16 = OpCompositeExtract %ulong %15 0 + %17 = OpShiftLeftLogical %ulong %16 %ulong_32 + %18 = OpShiftRightArithmetic %ulong %17 %ulong_32 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4uint %in %18 + OpStore %19 %14 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_int_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/undef_int_simple.spvasm32 new file mode 100644 index 00000000..dfa8ab4a --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_int_simple.spvasm32 @@ -0,0 +1,32 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 15 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "undef_int_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %9 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %10 = OpLabel + %11 = OpUndef %uint + %12 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %13 = OpCompositeExtract %uint %12 0 + %14 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %13 + OpStore %14 %11 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_int_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/undef_int_simple.spvasm64 new file mode 100644 index 00000000..0aecf103 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_int_simple.spvasm64 @@ -0,0 +1,37 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "undef_int_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %12 = OpLabel + %13 = OpUndef %uint + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %17 + OpStore %18 %13 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_long_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/undef_long_simple.spvasm32 new file mode 100644 index 00000000..759017b2 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_long_simple.spvasm32 @@ -0,0 +1,34 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "undef_long_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %ulong = OpTypeInt 64 0 +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %11 = OpLabel + %12 = OpUndef %ulong + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %in %14 + OpStore %15 %12 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_long_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/undef_long_simple.spvasm64 new file mode 100644 index 00000000..94b6d21a --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_long_simple.spvasm64 @@ -0,0 +1,36 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 18 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "undef_long_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %9 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %11 = OpLabel + %12 = OpUndef %ulong + %13 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %ulong %13 0 + %15 = OpShiftLeftLogical %ulong %14 %ulong_32 + %16 = OpShiftRightArithmetic %ulong %15 %ulong_32 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %in %16 + OpStore %17 %12 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_short_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/undef_short_simple.spvasm32 new file mode 100644 index 00000000..ab7904c9 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_short_simple.spvasm32 @@ -0,0 +1,34 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "undef_short_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %ushort = OpTypeInt 16 0 +%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ushort + %11 = OpLabel + %12 = OpUndef %ushort + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %in %14 + OpStore %15 %12 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_short_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/undef_short_simple.spvasm64 new file mode 100644 index 00000000..0d31d92c --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_short_simple.spvasm64 @@ -0,0 +1,38 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "undef_short_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %ushort = OpTypeInt 16 0 +%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ushort + %12 = OpLabel + %13 = OpUndef %ushort + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %in %17 + OpStore %18 %13 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_struct_int_char_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/undef_struct_int_char_simple.spvasm32 new file mode 100644 index 00000000..ddb9bf41 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_struct_int_char_simple.spvasm32 @@ -0,0 +1,35 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 17 +; Schema: 0 + OpCapability Addresses + OpCapability Kernel + OpCapability Linkage + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "undef_struct_int_char_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 + %_struct_9 = OpTypeStruct %uint %uchar +%_ptr_CrossWorkgroup__struct_9 = OpTypePointer CrossWorkgroup %_struct_9 + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup__struct_9 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup__struct_9 + %12 = OpLabel + %13 = OpUndef %_struct_9 + %14 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %uint %14 0 + %16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup__struct_9 %in %15 + OpStore %16 %13 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_struct_int_char_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/undef_struct_int_char_simple.spvasm64 new file mode 100644 index 00000000..41f7856e --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_struct_int_char_simple.spvasm64 @@ -0,0 +1,40 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 21 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "undef_struct_int_char_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %uchar = OpTypeInt 8 0 + %_struct_10 = OpTypeStruct %uint %uchar +%_ptr_CrossWorkgroup__struct_10 = OpTypePointer CrossWorkgroup %_struct_10 + %12 = OpTypeFunction %void %_ptr_CrossWorkgroup__struct_10 + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %12 + %in = OpFunctionParameter %_ptr_CrossWorkgroup__struct_10 + %14 = OpLabel + %15 = OpUndef %_struct_10 + %16 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %ulong %16 0 + %18 = OpShiftLeftLogical %ulong %17 %ulong_32 + %19 = OpShiftRightArithmetic %ulong %18 %ulong_32 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup__struct_10 %in %19 + OpStore %20 %15 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_struct_int_float_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/undef_struct_int_float_simple.spvasm32 new file mode 100644 index 00000000..cad9452c --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_struct_int_float_simple.spvasm32 @@ -0,0 +1,34 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 17 +; Schema: 0 + OpCapability Addresses + OpCapability Kernel + OpCapability Linkage + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "undef_struct_int_float_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 + %_struct_9 = OpTypeStruct %uint %float +%_ptr_CrossWorkgroup__struct_9 = OpTypePointer CrossWorkgroup %_struct_9 + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup__struct_9 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup__struct_9 + %12 = OpLabel + %13 = OpUndef %_struct_9 + %14 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %uint %14 0 + %16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup__struct_9 %in %15 + OpStore %16 %13 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_struct_int_float_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/undef_struct_int_float_simple.spvasm64 new file mode 100644 index 00000000..cdeadaa2 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_struct_int_float_simple.spvasm64 @@ -0,0 +1,39 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 21 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "undef_struct_int_float_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %float = OpTypeFloat 32 + %_struct_10 = OpTypeStruct %uint %float +%_ptr_CrossWorkgroup__struct_10 = OpTypePointer CrossWorkgroup %_struct_10 + %12 = OpTypeFunction %void %_ptr_CrossWorkgroup__struct_10 + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %12 + %in = OpFunctionParameter %_ptr_CrossWorkgroup__struct_10 + %14 = OpLabel + %15 = OpUndef %_struct_10 + %16 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %ulong %16 0 + %18 = OpShiftLeftLogical %ulong %17 %ulong_32 + %19 = OpShiftRightArithmetic %ulong %18 %ulong_32 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup__struct_10 %in %19 + OpStore %20 %15 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_struct_struct_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/undef_struct_struct_simple.spvasm32 new file mode 100644 index 00000000..d3605a5a --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_struct_struct_simple.spvasm32 @@ -0,0 +1,37 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Kernel + OpCapability Linkage + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "undef_struct_struct_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %v2uint = OpTypeVector %uint 2 + %uchar = OpTypeInt 8 0 + %_struct_10 = OpTypeStruct %uint %uchar + %_struct_11 = OpTypeStruct %v2uint %_struct_10 +%_ptr_CrossWorkgroup__struct_11 = OpTypePointer CrossWorkgroup %_struct_11 + %13 = OpTypeFunction %void %_ptr_CrossWorkgroup__struct_11 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %13 + %in = OpFunctionParameter %_ptr_CrossWorkgroup__struct_11 + %14 = OpLabel + %15 = OpUndef %_struct_11 + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup__struct_11 %in %17 + OpStore %18 %15 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_struct_struct_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/undef_struct_struct_simple.spvasm64 new file mode 100644 index 00000000..c46f254d --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_struct_struct_simple.spvasm64 @@ -0,0 +1,42 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "undef_struct_struct_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %v2uint = OpTypeVector %uint 2 + %uchar = OpTypeInt 8 0 + %_struct_11 = OpTypeStruct %uint %uchar + %_struct_12 = OpTypeStruct %v2uint %_struct_11 +%_ptr_CrossWorkgroup__struct_12 = OpTypePointer CrossWorkgroup %_struct_12 + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup__struct_12 + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %14 + %in = OpFunctionParameter %_ptr_CrossWorkgroup__struct_12 + %16 = OpLabel + %17 = OpUndef %_struct_12 + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup__struct_12 %in %21 + OpStore %22 %17 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_true_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/undef_true_simple.spvasm32 new file mode 100644 index 00000000..fa4854b0 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_true_simple.spvasm32 @@ -0,0 +1,36 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "undef_true_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %bool = OpTypeBool +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint + %uint_1 = OpConstant %uint 1 + %uint_0 = OpConstant %uint 0 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %13 = OpLabel + %14 = OpUndef %bool + %15 = OpSelect %uint %14 %uint_1 %uint_0 + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %17 + OpStore %18 %15 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_true_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/undef_true_simple.spvasm64 new file mode 100644 index 00000000..352e69cd --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_true_simple.spvasm64 @@ -0,0 +1,41 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "undef_true_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 + %bool = OpTypeBool +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %11 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint + %ulong_32 = OpConstant %ulong 32 + %uint_1 = OpConstant %uint 1 + %uint_0 = OpConstant %uint 0 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %11 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %15 = OpLabel + %16 = OpUndef %bool + %17 = OpSelect %uint %16 %uint_1 %uint_0 + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %21 + OpStore %22 %17 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_uchar_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/undef_uchar_simple.spvasm32 new file mode 100644 index 00000000..d16cb508 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_uchar_simple.spvasm32 @@ -0,0 +1,34 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "undef_uchar_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %11 = OpLabel + %12 = OpUndef %uchar + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %in %14 + OpStore %15 %12 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_uchar_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/undef_uchar_simple.spvasm64 new file mode 100644 index 00000000..4903b9c3 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_uchar_simple.spvasm64 @@ -0,0 +1,38 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "undef_uchar_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %12 = OpLabel + %13 = OpUndef %uchar + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %in %17 + OpStore %18 %13 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_uint_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/undef_uint_simple.spvasm32 new file mode 100644 index 00000000..65f38e05 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_uint_simple.spvasm32 @@ -0,0 +1,32 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 15 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "undef_uint_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %9 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %10 = OpLabel + %11 = OpUndef %uint + %12 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %13 = OpCompositeExtract %uint %12 0 + %14 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %13 + OpStore %14 %11 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_uint_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/undef_uint_simple.spvasm64 new file mode 100644 index 00000000..bc27d854 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_uint_simple.spvasm64 @@ -0,0 +1,37 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "undef_uint_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uint = OpTypeInt 32 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %12 = OpLabel + %13 = OpUndef %uint + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %17 + OpStore %18 %13 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_ulong_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/undef_ulong_simple.spvasm32 new file mode 100644 index 00000000..fb343c30 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_ulong_simple.spvasm32 @@ -0,0 +1,34 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "undef_ulong_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %ulong = OpTypeInt 64 0 +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %11 = OpLabel + %12 = OpUndef %ulong + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %in %14 + OpStore %15 %12 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_ulong_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/undef_ulong_simple.spvasm64 new file mode 100644 index 00000000..953a0c9f --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_ulong_simple.spvasm64 @@ -0,0 +1,36 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 18 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "undef_ulong_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %9 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %11 = OpLabel + %12 = OpUndef %ulong + %13 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %ulong %13 0 + %15 = OpShiftLeftLogical %ulong %14 %ulong_32 + %16 = OpShiftRightArithmetic %ulong %15 %ulong_32 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %in %16 + OpStore %17 %12 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_ushort_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/undef_ushort_simple.spvasm32 new file mode 100644 index 00000000..ce8380b9 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_ushort_simple.spvasm32 @@ -0,0 +1,34 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 16 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "undef_ushort_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %ushort = OpTypeInt 16 0 +%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ushort + %11 = OpLabel + %12 = OpUndef %ushort + %13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %14 = OpCompositeExtract %uint %13 0 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %in %14 + OpStore %15 %12 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/undef_ushort_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/undef_ushort_simple.spvasm64 new file mode 100644 index 00000000..8fd17af7 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/undef_ushort_simple.spvasm64 @@ -0,0 +1,38 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "undef_ushort_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %ushort = OpTypeInt 16 0 +%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort + %10 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %10 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ushort + %12 = OpLabel + %13 = OpUndef %ushort + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %in %17 + OpStore %18 %13 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/unreachable_simple.spvasm32 b/test_conformance/spirv_new/spirv_asm/unreachable_simple.spvasm32 new file mode 100644 index 00000000..20e3a70d --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/unreachable_simple.spvasm32 @@ -0,0 +1,38 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "unreachable_simple" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %9 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %10 = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %11 = OpLabel + %12 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %13 = OpCompositeExtract %uint %12 0 + %14 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %13 + %15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %10 %13 + %16 = OpLoad %uint %14 + OpBranch %17 + %18 = OpLabel + OpUnreachable + %17 = OpLabel + OpStore %15 %16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/unreachable_simple.spvasm64 b/test_conformance/spirv_new/spirv_asm/unreachable_simple.spvasm64 new file mode 100644 index 00000000..0c711807 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/unreachable_simple.spvasm64 @@ -0,0 +1,44 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "unreachable_simple" %gl_GlobalInvocationID + OpName %in "in" + OpName %out "out" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %ulong_32 = OpConstant %ulong 32 + %void = OpTypeVoid + %uint = OpTypeInt 32 0 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %12 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %12 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %13 = OpLabel + %14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %15 = OpCompositeExtract %ulong %14 0 + %16 = OpShiftLeftLogical %ulong %15 %ulong_32 + %17 = OpShiftRightArithmetic %ulong %16 %ulong_32 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %17 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %17 + OpBranch %20 + %21 = OpLabel + OpUnreachable + %20 = OpLabel + %22 = OpLoad %uint %18 + OpStore %19 %22 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/vector_char16_extract.spvasm32 b/test_conformance/spirv_new/spirv_asm/vector_char16_extract.spvasm32 new file mode 100644 index 00000000..48fb4eaf --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/vector_char16_extract.spvasm32 @@ -0,0 +1,42 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 22 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Vector16 + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "vector_char16_extract" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %4 FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 + %v16uchar = OpTypeVector %uchar 16 +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar +%_ptr_CrossWorkgroup_v16uchar = OpTypePointer CrossWorkgroup %v16uchar + %13 = OpTypeFunction %void %_ptr_CrossWorkgroup_v16uchar %_ptr_CrossWorkgroup_uchar %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %13 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v16uchar + %4 = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %14 = OpFunctionParameter %uint + %15 = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v16uchar %in %17 + %19 = OpLoad %v16uchar %18 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %4 %17 + %21 = OpVectorExtractDynamic %uchar %19 %14 + OpStore %20 %21 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/vector_char16_extract.spvasm64 b/test_conformance/spirv_new/spirv_asm/vector_char16_extract.spvasm64 new file mode 100644 index 00000000..16f38a95 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/vector_char16_extract.spvasm64 @@ -0,0 +1,47 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpCapability Vector16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "vector_char16_extract" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %4 FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %ulong_32 = OpConstant %ulong 32 + %uint = OpTypeInt 32 0 + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 + %v16uchar = OpTypeVector %uchar 16 +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar +%_ptr_CrossWorkgroup_v16uchar = OpTypePointer CrossWorkgroup %v16uchar + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_v16uchar %_ptr_CrossWorkgroup_uchar %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %15 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v16uchar + %4 = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %16 = OpFunctionParameter %uint + %17 = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v16uchar %in %21 + %23 = OpLoad %v16uchar %22 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %4 %21 + %25 = OpVectorExtractDynamic %uchar %23 %16 + OpStore %24 %25 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/vector_char16_insert.spvasm32 b/test_conformance/spirv_new/spirv_asm/vector_char16_insert.spvasm32 new file mode 100644 index 00000000..709161f9 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/vector_char16_insert.spvasm32 @@ -0,0 +1,43 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Vector16 + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "vector_char16_insert" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %4 FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 + %v16uchar = OpTypeVector %uchar 16 +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar +%_ptr_CrossWorkgroup_v16uchar = OpTypePointer CrossWorkgroup %v16uchar + %13 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar %_ptr_CrossWorkgroup_v16uchar %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %13 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %4 = OpFunctionParameter %_ptr_CrossWorkgroup_v16uchar + %14 = OpFunctionParameter %uint + %15 = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %in %17 + %19 = OpLoad %uchar %18 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v16uchar %4 %17 + %21 = OpLoad %v16uchar %20 + %22 = OpVectorInsertDynamic %v16uchar %21 %19 %14 + OpStore %20 %22 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/vector_char16_insert.spvasm64 b/test_conformance/spirv_new/spirv_asm/vector_char16_insert.spvasm64 new file mode 100644 index 00000000..b5ef30b4 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/vector_char16_insert.spvasm64 @@ -0,0 +1,48 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpCapability Vector16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "vector_char16_insert" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %4 FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %ulong_32 = OpConstant %ulong 32 + %uint = OpTypeInt 32 0 + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 + %v16uchar = OpTypeVector %uchar 16 +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar +%_ptr_CrossWorkgroup_v16uchar = OpTypePointer CrossWorkgroup %v16uchar + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar %_ptr_CrossWorkgroup_v16uchar %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %15 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %4 = OpFunctionParameter %_ptr_CrossWorkgroup_v16uchar + %16 = OpFunctionParameter %uint + %17 = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %in %21 + %23 = OpLoad %uchar %22 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v16uchar %4 %21 + %25 = OpLoad %v16uchar %24 + %26 = OpVectorInsertDynamic %v16uchar %25 %23 %16 + OpStore %24 %26 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/vector_double2_extract.spvasm32 b/test_conformance/spirv_new/spirv_asm/vector_double2_extract.spvasm32 new file mode 100644 index 00000000..ec19d0cf --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/vector_double2_extract.spvasm32 @@ -0,0 +1,41 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 22 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "vector_double2_extract" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %4 FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %double = OpTypeFloat 64 + %v2double = OpTypeVector %double 2 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double +%_ptr_CrossWorkgroup_v2double = OpTypePointer CrossWorkgroup %v2double + %13 = OpTypeFunction %void %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_double %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %13 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %4 = OpFunctionParameter %_ptr_CrossWorkgroup_double + %14 = OpFunctionParameter %uint + %15 = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %in %17 + %19 = OpLoad %v2double %18 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %4 %17 + %21 = OpVectorExtractDynamic %double %19 %14 + OpStore %20 %21 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/vector_double2_extract.spvasm64 b/test_conformance/spirv_new/spirv_asm/vector_double2_extract.spvasm64 new file mode 100644 index 00000000..0a6f2458 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/vector_double2_extract.spvasm64 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "vector_double2_extract" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %4 FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %ulong_32 = OpConstant %ulong 32 + %uint = OpTypeInt 32 0 + %void = OpTypeVoid + %double = OpTypeFloat 64 + %v2double = OpTypeVector %double 2 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double +%_ptr_CrossWorkgroup_v2double = OpTypePointer CrossWorkgroup %v2double + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_double %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %15 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %4 = OpFunctionParameter %_ptr_CrossWorkgroup_double + %16 = OpFunctionParameter %uint + %17 = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %in %21 + %23 = OpLoad %v2double %22 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %4 %21 + %25 = OpVectorExtractDynamic %double %23 %16 + OpStore %24 %25 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/vector_double2_insert.spvasm32 b/test_conformance/spirv_new/spirv_asm/vector_double2_insert.spvasm32 new file mode 100644 index 00000000..b434804b --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/vector_double2_insert.spvasm32 @@ -0,0 +1,42 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "vector_double2_insert" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %4 FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %double = OpTypeFloat 64 + %v2double = OpTypeVector %double 2 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double +%_ptr_CrossWorkgroup_v2double = OpTypePointer CrossWorkgroup %v2double + %13 = OpTypeFunction %void %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_v2double %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %13 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_double + %4 = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %14 = OpFunctionParameter %uint + %15 = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %in %17 + %19 = OpLoad %double %18 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %4 %17 + %21 = OpLoad %v2double %20 + %22 = OpVectorInsertDynamic %v2double %21 %19 %14 + OpStore %20 %22 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/vector_double2_insert.spvasm64 b/test_conformance/spirv_new/spirv_asm/vector_double2_insert.spvasm64 new file mode 100644 index 00000000..126f5919 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/vector_double2_insert.spvasm64 @@ -0,0 +1,47 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "vector_double2_insert" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %4 FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %ulong_32 = OpConstant %ulong 32 + %uint = OpTypeInt 32 0 + %void = OpTypeVoid + %double = OpTypeFloat 64 + %v2double = OpTypeVector %double 2 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double +%_ptr_CrossWorkgroup_v2double = OpTypePointer CrossWorkgroup %v2double + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_double %_ptr_CrossWorkgroup_v2double %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %15 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_double + %4 = OpFunctionParameter %_ptr_CrossWorkgroup_v2double + %16 = OpFunctionParameter %uint + %17 = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %in %21 + %23 = OpLoad %double %22 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %4 %21 + %25 = OpLoad %v2double %24 + %26 = OpVectorInsertDynamic %v2double %25 %23 %16 + OpStore %24 %26 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/vector_float4_extract.spvasm32 b/test_conformance/spirv_new/spirv_asm/vector_float4_extract.spvasm32 new file mode 100644 index 00000000..62fd998f --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/vector_float4_extract.spvasm32 @@ -0,0 +1,40 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 22 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "vector_float4_extract" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %4 FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float +%_ptr_CrossWorkgroup_v4float = OpTypePointer CrossWorkgroup %v4float + %13 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_float %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %13 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %4 = OpFunctionParameter %_ptr_CrossWorkgroup_float + %14 = OpFunctionParameter %uint + %15 = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %in %17 + %19 = OpLoad %v4float %18 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %4 %17 + %21 = OpVectorExtractDynamic %float %19 %14 + OpStore %20 %21 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/vector_float4_extract.spvasm64 b/test_conformance/spirv_new/spirv_asm/vector_float4_extract.spvasm64 new file mode 100644 index 00000000..fbec1e30 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/vector_float4_extract.spvasm64 @@ -0,0 +1,45 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "vector_float4_extract" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %4 FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %ulong_32 = OpConstant %ulong 32 + %uint = OpTypeInt 32 0 + %void = OpTypeVoid + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float +%_ptr_CrossWorkgroup_v4float = OpTypePointer CrossWorkgroup %v4float + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_float %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %15 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %4 = OpFunctionParameter %_ptr_CrossWorkgroup_float + %16 = OpFunctionParameter %uint + %17 = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %in %21 + %23 = OpLoad %v4float %22 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %4 %21 + %25 = OpVectorExtractDynamic %float %23 %16 + OpStore %24 %25 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/vector_float4_insert.spvasm32 b/test_conformance/spirv_new/spirv_asm/vector_float4_insert.spvasm32 new file mode 100644 index 00000000..16993f55 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/vector_float4_insert.spvasm32 @@ -0,0 +1,41 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "vector_float4_insert" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %4 FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float +%_ptr_CrossWorkgroup_v4float = OpTypePointer CrossWorkgroup %v4float + %13 = OpTypeFunction %void %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_v4float %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %13 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %4 = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %14 = OpFunctionParameter %uint + %15 = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %17 + %19 = OpLoad %float %18 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %4 %17 + %21 = OpLoad %v4float %20 + %22 = OpVectorInsertDynamic %v4float %21 %19 %14 + OpStore %20 %22 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/vector_float4_insert.spvasm64 b/test_conformance/spirv_new/spirv_asm/vector_float4_insert.spvasm64 new file mode 100644 index 00000000..e113bb57 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/vector_float4_insert.spvasm64 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "vector_float4_insert" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %4 FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %ulong_32 = OpConstant %ulong 32 + %uint = OpTypeInt 32 0 + %void = OpTypeVoid + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float +%_ptr_CrossWorkgroup_v4float = OpTypePointer CrossWorkgroup %v4float + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_v4float %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %15 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_float + %4 = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %16 = OpFunctionParameter %uint + %17 = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %in %21 + %23 = OpLoad %float %22 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %4 %21 + %25 = OpLoad %v4float %24 + %26 = OpVectorInsertDynamic %v4float %25 %23 %16 + OpStore %24 %26 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/vector_int4_extract.spvasm32 b/test_conformance/spirv_new/spirv_asm/vector_int4_extract.spvasm32 new file mode 100644 index 00000000..f64b0bb4 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/vector_int4_extract.spvasm32 @@ -0,0 +1,39 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 21 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "vector_int4_extract" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %4 FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %v4uint = OpTypeVector %uint 4 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_CrossWorkgroup_v4uint = OpTypePointer CrossWorkgroup %v4uint + %12 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4uint %_ptr_CrossWorkgroup_uint %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %12 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v4uint + %4 = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %13 = OpFunctionParameter %uint + %14 = OpLabel + %15 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %16 = OpCompositeExtract %uint %15 0 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4uint %in %16 + %18 = OpLoad %v4uint %17 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %4 %16 + %20 = OpVectorExtractDynamic %uint %18 %13 + OpStore %19 %20 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/vector_int4_extract.spvasm64 b/test_conformance/spirv_new/spirv_asm/vector_int4_extract.spvasm64 new file mode 100644 index 00000000..f9903e1e --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/vector_int4_extract.spvasm64 @@ -0,0 +1,44 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "vector_int4_extract" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %4 FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %ulong_32 = OpConstant %ulong 32 + %uint = OpTypeInt 32 0 + %void = OpTypeVoid + %v4uint = OpTypeVector %uint 4 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_CrossWorkgroup_v4uint = OpTypePointer CrossWorkgroup %v4uint + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4uint %_ptr_CrossWorkgroup_uint %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %14 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v4uint + %4 = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %15 = OpFunctionParameter %uint + %16 = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4uint %in %20 + %22 = OpLoad %v4uint %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %4 %20 + %24 = OpVectorExtractDynamic %uint %22 %15 + OpStore %23 %24 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/vector_int4_insert.spvasm32 b/test_conformance/spirv_new/spirv_asm/vector_int4_insert.spvasm32 new file mode 100644 index 00000000..265b9cce --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/vector_int4_insert.spvasm32 @@ -0,0 +1,40 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 22 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "vector_int4_insert" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %4 FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %v4uint = OpTypeVector %uint 4 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_CrossWorkgroup_v4uint = OpTypePointer CrossWorkgroup %v4uint + %12 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_v4uint %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %12 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %4 = OpFunctionParameter %_ptr_CrossWorkgroup_v4uint + %13 = OpFunctionParameter %uint + %14 = OpLabel + %15 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %16 = OpCompositeExtract %uint %15 0 + %17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %16 + %18 = OpLoad %uint %17 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4uint %4 %16 + %20 = OpLoad %v4uint %19 + %21 = OpVectorInsertDynamic %v4uint %20 %18 %13 + OpStore %19 %21 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/vector_int4_insert.spvasm64 b/test_conformance/spirv_new/spirv_asm/vector_int4_insert.spvasm64 new file mode 100644 index 00000000..be2f94e2 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/vector_int4_insert.spvasm64 @@ -0,0 +1,45 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "vector_int4_insert" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %4 FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %ulong_32 = OpConstant %ulong 32 + %uint = OpTypeInt 32 0 + %void = OpTypeVoid + %v4uint = OpTypeVector %uint 4 +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint +%_ptr_CrossWorkgroup_v4uint = OpTypePointer CrossWorkgroup %v4uint + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_v4uint %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %14 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %4 = OpFunctionParameter %_ptr_CrossWorkgroup_v4uint + %15 = OpFunctionParameter %uint + %16 = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %20 + %22 = OpLoad %uint %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4uint %4 %20 + %24 = OpLoad %v4uint %23 + %25 = OpVectorInsertDynamic %v4uint %24 %22 %15 + OpStore %23 %25 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/vector_long2_extract.spvasm32 b/test_conformance/spirv_new/spirv_asm/vector_long2_extract.spvasm32 new file mode 100644 index 00000000..e925ec2e --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/vector_long2_extract.spvasm32 @@ -0,0 +1,41 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 22 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "vector_long2_extract" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %4 FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %ulong = OpTypeInt 64 0 + %v2ulong = OpTypeVector %ulong 2 +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong +%_ptr_CrossWorkgroup_v2ulong = OpTypePointer CrossWorkgroup %v2ulong + %13 = OpTypeFunction %void %_ptr_CrossWorkgroup_v2ulong %_ptr_CrossWorkgroup_ulong %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %13 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v2ulong + %4 = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %14 = OpFunctionParameter %uint + %15 = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2ulong %in %17 + %19 = OpLoad %v2ulong %18 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %4 %17 + %21 = OpVectorExtractDynamic %ulong %19 %14 + OpStore %20 %21 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/vector_long2_extract.spvasm64 b/test_conformance/spirv_new/spirv_asm/vector_long2_extract.spvasm64 new file mode 100644 index 00000000..b1c95620 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/vector_long2_extract.spvasm64 @@ -0,0 +1,44 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "vector_long2_extract" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %4 FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %ulong_32 = OpConstant %ulong 32 + %uint = OpTypeInt 32 0 + %void = OpTypeVoid + %v2ulong = OpTypeVector %ulong 2 +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong +%_ptr_CrossWorkgroup_v2ulong = OpTypePointer CrossWorkgroup %v2ulong + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_v2ulong %_ptr_CrossWorkgroup_ulong %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %14 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_v2ulong + %4 = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %15 = OpFunctionParameter %uint + %16 = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2ulong %in %20 + %22 = OpLoad %v2ulong %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %4 %20 + %24 = OpVectorExtractDynamic %ulong %22 %15 + OpStore %23 %24 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/vector_long2_insert.spvasm32 b/test_conformance/spirv_new/spirv_asm/vector_long2_insert.spvasm32 new file mode 100644 index 00000000..49bc9f65 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/vector_long2_insert.spvasm32 @@ -0,0 +1,42 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "vector_long2_insert" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %4 FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %ulong = OpTypeInt 64 0 + %v2ulong = OpTypeVector %ulong 2 +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong +%_ptr_CrossWorkgroup_v2ulong = OpTypePointer CrossWorkgroup %v2ulong + %13 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong %_ptr_CrossWorkgroup_v2ulong %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %13 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %4 = OpFunctionParameter %_ptr_CrossWorkgroup_v2ulong + %14 = OpFunctionParameter %uint + %15 = OpLabel + %16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %17 = OpCompositeExtract %uint %16 0 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %in %17 + %19 = OpLoad %ulong %18 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2ulong %4 %17 + %21 = OpLoad %v2ulong %20 + %22 = OpVectorInsertDynamic %v2ulong %21 %19 %14 + OpStore %20 %22 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/vector_long2_insert.spvasm64 b/test_conformance/spirv_new/spirv_asm/vector_long2_insert.spvasm64 new file mode 100644 index 00000000..74ae94cf --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/vector_long2_insert.spvasm64 @@ -0,0 +1,45 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "vector_long2_insert" %gl_GlobalInvocationID + OpName %in "in" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %in FuncParamAttr NoCapture + OpDecorate %4 FuncParamAttr NoCapture + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %ulong_32 = OpConstant %ulong 32 + %uint = OpTypeInt 32 0 + %void = OpTypeVoid + %v2ulong = OpTypeVector %ulong 2 +%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong +%_ptr_CrossWorkgroup_v2ulong = OpTypePointer CrossWorkgroup %v2ulong + %14 = OpTypeFunction %void %_ptr_CrossWorkgroup_ulong %_ptr_CrossWorkgroup_v2ulong %uint +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %14 + %in = OpFunctionParameter %_ptr_CrossWorkgroup_ulong + %4 = OpFunctionParameter %_ptr_CrossWorkgroup_v2ulong + %15 = OpFunctionParameter %uint + %16 = OpLabel + %17 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %ulong %17 0 + %19 = OpShiftLeftLogical %ulong %18 %ulong_32 + %20 = OpShiftRightArithmetic %ulong %19 %ulong_32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %in %20 + %22 = OpLoad %ulong %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2ulong %4 %20 + %24 = OpLoad %v2ulong %23 + %25 = OpVectorInsertDynamic %v2ulong %24 %22 %15 + OpStore %23 %25 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/vector_times_scalar_double.spvasm32 b/test_conformance/spirv_new/spirv_asm/vector_times_scalar_double.spvasm32 new file mode 100644 index 00000000..ec2c415a --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/vector_times_scalar_double.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "vector_times_scalar" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %v4double = OpTypeVector %double 4 +%_ptr_CrossWorkgroup_v4double = OpTypePointer CrossWorkgroup %v4double + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4double %_ptr_CrossWorkgroup_v4double %_ptr_CrossWorkgroup_double +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v4double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %16 = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4double %lhs %18 + %20 = OpLoad %v4double %19 Aligned 32 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %rhs %18 + %22 = OpLoad %double %21 Aligned 8 + %23 = OpVectorTimesScalar %v4double %20 %22 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4double %res %18 + OpStore %24 %23 Aligned 32 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/vector_times_scalar_double.spvasm64 b/test_conformance/spirv_new/spirv_asm/vector_times_scalar_double.spvasm64 new file mode 100644 index 00000000..cd3755e2 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/vector_times_scalar_double.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "vector_times_scalar" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %ulong_32 = OpConstant %ulong 32 + %void = OpTypeVoid + %double = OpTypeFloat 64 +%_ptr_CrossWorkgroup_double = OpTypePointer CrossWorkgroup %double + %v4double = OpTypeVector %double 4 +%_ptr_CrossWorkgroup_v4double = OpTypePointer CrossWorkgroup %v4double + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4double %_ptr_CrossWorkgroup_v4double %_ptr_CrossWorkgroup_double +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v4double + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4double + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_double + %17 = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4double %lhs %21 + %23 = OpLoad %v4double %22 Aligned 32 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_double %rhs %21 + %25 = OpLoad %double %24 Aligned 8 + %26 = OpVectorTimesScalar %v4double %23 %25 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4double %res %21 + OpStore %27 %26 Aligned 32 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/vector_times_scalar_float.spvasm32 b/test_conformance/spirv_new/spirv_asm/vector_times_scalar_float.spvasm32 new file mode 100644 index 00000000..5c8b3379 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/vector_times_scalar_float.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "vector_times_scalar" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %v4float = OpTypeVector %float 4 +%_ptr_CrossWorkgroup_v4float = OpTypePointer CrossWorkgroup %v4float + %15 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %15 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %16 = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %lhs %18 + %20 = OpLoad %v4float %19 Aligned 16 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %18 + %22 = OpLoad %float %21 Aligned 4 + %23 = OpVectorTimesScalar %v4float %20 %22 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %res %18 + OpStore %24 %23 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/vector_times_scalar_float.spvasm64 b/test_conformance/spirv_new/spirv_asm/vector_times_scalar_float.spvasm64 new file mode 100644 index 00000000..ecc078b3 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/vector_times_scalar_float.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int16 + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "vector_times_scalar" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %5 FuncParamAttr NoCapture + %5 = OpDecorationGroup + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %5 %res %lhs %rhs + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %ulong_32 = OpConstant %ulong 32 + %void = OpTypeVoid + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %v4float = OpTypeVector %float 4 +%_ptr_CrossWorkgroup_v4float = OpTypePointer CrossWorkgroup %v4float + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %17 = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %lhs %21 + %23 = OpLoad %v4float %22 Aligned 16 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %21 + %25 = OpLoad %float %24 Aligned 4 + %26 = OpVectorTimesScalar %v4float %23 %25 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %res %21 + OpStore %27 %26 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_bin/atomic_dec_global.spv32 b/test_conformance/spirv_new/spirv_bin/atomic_dec_global.spv32 new file mode 100644 index 00000000..853c39a3 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/atomic_dec_global.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/atomic_dec_global.spv64 b/test_conformance/spirv_new/spirv_bin/atomic_dec_global.spv64 new file mode 100644 index 00000000..87529086 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/atomic_dec_global.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/atomic_inc_global.spv32 b/test_conformance/spirv_new/spirv_bin/atomic_inc_global.spv32 new file mode 100644 index 00000000..cf04e23a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/atomic_inc_global.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/atomic_inc_global.spv64 b/test_conformance/spirv_new/spirv_bin/atomic_inc_global.spv64 new file mode 100644 index 00000000..ad0f8444 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/atomic_inc_global.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/branch_conditional.spv32 b/test_conformance/spirv_new/spirv_bin/branch_conditional.spv32 new file mode 100644 index 00000000..47abfae9 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/branch_conditional.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/branch_conditional.spv64 b/test_conformance/spirv_new/spirv_bin/branch_conditional.spv64 new file mode 100644 index 00000000..5671a394 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/branch_conditional.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/branch_conditional_weighted.spv32 b/test_conformance/spirv_new/spirv_bin/branch_conditional_weighted.spv32 new file mode 100644 index 00000000..cc6ef696 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/branch_conditional_weighted.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/branch_conditional_weighted.spv64 b/test_conformance/spirv_new/spirv_bin/branch_conditional_weighted.spv64 new file mode 100644 index 00000000..a710ac52 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/branch_conditional_weighted.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/branch_simple.spv32 b/test_conformance/spirv_new/spirv_bin/branch_simple.spv32 new file mode 100644 index 00000000..6c24c444 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/branch_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/branch_simple.spv64 b/test_conformance/spirv_new/spirv_bin/branch_simple.spv64 new file mode 100644 index 00000000..ea1dd830 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/branch_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/composite_construct_int4.spv32 b/test_conformance/spirv_new/spirv_bin/composite_construct_int4.spv32 new file mode 100644 index 00000000..4b6c9f1f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/composite_construct_int4.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/composite_construct_int4.spv64 b/test_conformance/spirv_new/spirv_bin/composite_construct_int4.spv64 new file mode 100644 index 00000000..12bc7fd1 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/composite_construct_int4.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/composite_construct_struct.spv32 b/test_conformance/spirv_new/spirv_bin/composite_construct_struct.spv32 new file mode 100644 index 00000000..cb10572e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/composite_construct_struct.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/composite_construct_struct.spv64 b/test_conformance/spirv_new/spirv_bin/composite_construct_struct.spv64 new file mode 100644 index 00000000..2f1fef9e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/composite_construct_struct.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_char_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_char_simple.spv32 new file mode 100644 index 00000000..a46fbc29 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_char_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_char_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_char_simple.spv64 new file mode 100644 index 00000000..cddc6e04 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_char_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_double_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_double_simple.spv32 new file mode 100644 index 00000000..215454bc Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_double_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_double_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_double_simple.spv64 new file mode 100644 index 00000000..856949fd Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_double_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_false_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_false_simple.spv32 new file mode 100644 index 00000000..63e63313 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_false_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_false_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_false_simple.spv64 new file mode 100644 index 00000000..6a0d855f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_false_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_float_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_float_simple.spv32 new file mode 100644 index 00000000..17e3a5cc Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_float_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_float_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_float_simple.spv64 new file mode 100644 index 00000000..bc888ee4 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_float_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_half_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_half_simple.spv32 new file mode 100644 index 00000000..552450e4 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_half_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_half_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_half_simple.spv64 new file mode 100644 index 00000000..cc2a3bcd Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_half_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_int3_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_int3_simple.spv32 new file mode 100644 index 00000000..7f1c39b5 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_int3_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_int3_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_int3_simple.spv64 new file mode 100644 index 00000000..399d14e2 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_int3_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_int4_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_int4_simple.spv32 new file mode 100644 index 00000000..65a6aba9 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_int4_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_int4_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_int4_simple.spv64 new file mode 100644 index 00000000..2f8d2310 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_int4_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_int_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_int_simple.spv32 new file mode 100644 index 00000000..61a9b4de Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_int_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_int_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_int_simple.spv64 new file mode 100644 index 00000000..2f8279a1 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_int_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_long_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_long_simple.spv32 new file mode 100644 index 00000000..25a16fe4 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_long_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_long_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_long_simple.spv64 new file mode 100644 index 00000000..2362d946 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_long_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_short_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_short_simple.spv32 new file mode 100644 index 00000000..d6f134ea Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_short_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_short_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_short_simple.spv64 new file mode 100644 index 00000000..0e0ec76a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_short_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_struct_int_char_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_struct_int_char_simple.spv32 new file mode 100644 index 00000000..09468276 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_struct_int_char_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_struct_int_char_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_struct_int_char_simple.spv64 new file mode 100644 index 00000000..63f79458 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_struct_int_char_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_struct_int_float_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_struct_int_float_simple.spv32 new file mode 100644 index 00000000..2674b9bc Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_struct_int_float_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_struct_int_float_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_struct_int_float_simple.spv64 new file mode 100644 index 00000000..268efb7d Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_struct_int_float_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_struct_struct_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_struct_struct_simple.spv32 new file mode 100644 index 00000000..f2485f35 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_struct_struct_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_struct_struct_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_struct_struct_simple.spv64 new file mode 100644 index 00000000..ab0ff235 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_struct_struct_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_true_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_true_simple.spv32 new file mode 100644 index 00000000..d98465dd Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_true_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_true_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_true_simple.spv64 new file mode 100644 index 00000000..6110276b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_true_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_uchar_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_uchar_simple.spv32 new file mode 100644 index 00000000..e8291510 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_uchar_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_uchar_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_uchar_simple.spv64 new file mode 100644 index 00000000..1969c2cf Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_uchar_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_uint_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_uint_simple.spv32 new file mode 100644 index 00000000..d4e3488b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_uint_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_uint_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_uint_simple.spv64 new file mode 100644 index 00000000..c305b5af Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_uint_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_ulong_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_ulong_simple.spv32 new file mode 100644 index 00000000..9853b064 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_ulong_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_ulong_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_ulong_simple.spv64 new file mode 100644 index 00000000..0928c6db Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_ulong_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_ushort_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_ushort_simple.spv32 new file mode 100644 index 00000000..b42ec0b6 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_ushort_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_ushort_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_ushort_simple.spv64 new file mode 100644 index 00000000..3118acb8 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_ushort_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_char_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_char_simple.spv32 new file mode 100644 index 00000000..0e95f06b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_char_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_char_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_char_simple.spv64 new file mode 100644 index 00000000..6e740df7 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_char_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_double_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_double_simple.spv32 new file mode 100644 index 00000000..a4bfba7f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_double_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_double_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_double_simple.spv64 new file mode 100644 index 00000000..a1ab0c85 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_double_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_float_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_float_simple.spv32 new file mode 100644 index 00000000..92674b1c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_float_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_float_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_float_simple.spv64 new file mode 100644 index 00000000..064df40c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_float_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_half_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_half_simple.spv32 new file mode 100644 index 00000000..7c88b2a7 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_half_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_half_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_half_simple.spv64 new file mode 100644 index 00000000..06154e63 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_half_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_int3_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_int3_simple.spv32 new file mode 100644 index 00000000..55fa1703 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_int3_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_int3_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_int3_simple.spv64 new file mode 100644 index 00000000..24d0cb79 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_int3_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_int4_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_int4_simple.spv32 new file mode 100644 index 00000000..6abeefc4 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_int4_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_int4_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_int4_simple.spv64 new file mode 100644 index 00000000..c949fd37 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_int4_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_int_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_int_simple.spv32 new file mode 100644 index 00000000..8d800849 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_int_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_int_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_int_simple.spv64 new file mode 100644 index 00000000..cb71d73e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_int_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_long_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_long_simple.spv32 new file mode 100644 index 00000000..6b33d2be Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_long_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_long_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_long_simple.spv64 new file mode 100644 index 00000000..4e3e76d1 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_long_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_short_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_short_simple.spv32 new file mode 100644 index 00000000..2c321f56 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_short_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_short_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_short_simple.spv64 new file mode 100644 index 00000000..c3e06ae9 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_short_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_struct_int_char_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_struct_int_char_simple.spv32 new file mode 100644 index 00000000..402f464b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_struct_int_char_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_struct_int_char_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_struct_int_char_simple.spv64 new file mode 100644 index 00000000..918c423d Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_struct_int_char_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_struct_int_float_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_struct_int_float_simple.spv32 new file mode 100644 index 00000000..862656ec Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_struct_int_float_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_struct_int_float_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_struct_int_float_simple.spv64 new file mode 100644 index 00000000..1d6c7537 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_struct_int_float_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_struct_struct_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_struct_struct_simple.spv32 new file mode 100644 index 00000000..7d3114c0 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_struct_struct_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_struct_struct_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_struct_struct_simple.spv64 new file mode 100644 index 00000000..beb8deaa Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_struct_struct_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_uchar_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_uchar_simple.spv32 new file mode 100644 index 00000000..b23d5ece Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_uchar_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_uchar_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_uchar_simple.spv64 new file mode 100644 index 00000000..11cdd476 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_uchar_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_uint_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_uint_simple.spv32 new file mode 100644 index 00000000..5084891a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_uint_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_uint_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_uint_simple.spv64 new file mode 100644 index 00000000..ca15b681 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_uint_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_ulong_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_ulong_simple.spv32 new file mode 100644 index 00000000..98a11a1a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_ulong_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_ulong_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_ulong_simple.spv64 new file mode 100644 index 00000000..35b8096a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_ulong_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_ushort_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_ushort_simple.spv32 new file mode 100644 index 00000000..e19d5acb Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_ushort_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_ushort_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_ushort_simple.spv64 new file mode 100644 index 00000000..85aecddf Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_ushort_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_aliased.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_aliased.spv32 new file mode 100644 index 00000000..9d40c3a5 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_aliased.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_aliased.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_aliased.spv64 new file mode 100644 index 00000000..6489935c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_aliased.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_alignment.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_alignment.spv32 new file mode 100644 index 00000000..ddbd7023 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_alignment.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_alignment.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_alignment.spv64 new file mode 100644 index 00000000..631f1b1a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_alignment.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_coherent.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_coherent.spv32 new file mode 100644 index 00000000..fb6a06c3 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_coherent.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_coherent.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_coherent.spv64 new file mode 100644 index 00000000..3c2a9517 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_coherent.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_constant.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_constant.spv32 new file mode 100644 index 00000000..636bca2c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_constant.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_constant.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_constant.spv64 new file mode 100644 index 00000000..c00fa6e3 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_constant.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_constant_fail.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_constant_fail.spv32 new file mode 100644 index 00000000..6833d404 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_constant_fail.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_constant_fail.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_constant_fail.spv64 new file mode 100644 index 00000000..3fe5b8d8 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_constant_fail.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_cpacked.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_cpacked.spv32 new file mode 100644 index 00000000..b22d08ca Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_cpacked.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_cpacked.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_cpacked.spv64 new file mode 100644 index 00000000..27a3e73f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_cpacked.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_nonreadable.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_nonreadable.spv32 new file mode 100644 index 00000000..62594fa5 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_nonreadable.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_nonreadable.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_nonreadable.spv64 new file mode 100644 index 00000000..c56fc97f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_nonreadable.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_nonwritable.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_nonwritable.spv32 new file mode 100644 index 00000000..5d1e2ac2 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_nonwritable.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_nonwritable.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_nonwritable.spv64 new file mode 100644 index 00000000..05450370 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_nonwritable.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_restrict.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_restrict.spv32 new file mode 100644 index 00000000..3045aab1 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_restrict.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_restrict.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_restrict.spv64 new file mode 100644 index 00000000..86cd1ef2 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_restrict.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rte_double_long.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rte_double_long.spv32 new file mode 100644 index 00000000..ff78f589 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rte_double_long.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rte_double_long.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rte_double_long.spv64 new file mode 100644 index 00000000..ba63f28a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rte_double_long.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rte_float_int.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rte_float_int.spv32 new file mode 100644 index 00000000..8e082b4c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rte_float_int.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rte_float_int.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rte_float_int.spv64 new file mode 100644 index 00000000..aedcc974 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rte_float_int.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtn_double_long.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtn_double_long.spv32 new file mode 100644 index 00000000..99f02700 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtn_double_long.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtn_double_long.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtn_double_long.spv64 new file mode 100644 index 00000000..531a51a0 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtn_double_long.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtn_float_int.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtn_float_int.spv32 new file mode 100644 index 00000000..d0127c01 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtn_float_int.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtn_float_int.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtn_float_int.spv64 new file mode 100644 index 00000000..05209392 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtn_float_int.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtp_double_long.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtp_double_long.spv32 new file mode 100644 index 00000000..000c77b2 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtp_double_long.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtp_double_long.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtp_double_long.spv64 new file mode 100644 index 00000000..252c1124 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtp_double_long.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtp_float_int.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtp_float_int.spv32 new file mode 100644 index 00000000..bfea8ad1 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtp_float_int.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtp_float_int.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtp_float_int.spv64 new file mode 100644 index 00000000..ef4cda4e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtp_float_int.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtz_double_long.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtz_double_long.spv32 new file mode 100644 index 00000000..8dbbb9ff Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtz_double_long.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtz_double_long.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtz_double_long.spv64 new file mode 100644 index 00000000..62a498f4 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtz_double_long.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtz_float_int.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtz_float_int.spv32 new file mode 100644 index 00000000..78035b36 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtz_float_int.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtz_float_int.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtz_float_int.spv64 new file mode 100644 index 00000000..3a0489c5 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtz_float_int.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_char.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_char.spv32 new file mode 100644 index 00000000..3fe79826 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_char.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_char.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_char.spv64 new file mode 100644 index 00000000..c84d0be1 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_char.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_int.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_int.spv32 new file mode 100644 index 00000000..0191776f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_int.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_int.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_int.spv64 new file mode 100644 index 00000000..3e2a68ff Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_int.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_short.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_short.spv32 new file mode 100644 index 00000000..29579f4e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_short.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_short.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_short.spv64 new file mode 100644 index 00000000..0a37c81f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_short.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_uchar.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_uchar.spv32 new file mode 100644 index 00000000..46ab303a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_uchar.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_uchar.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_uchar.spv64 new file mode 100644 index 00000000..aa7e3a20 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_uchar.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_uint.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_uint.spv32 new file mode 100644 index 00000000..ddd4d10a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_uint.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_uint.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_uint.spv64 new file mode 100644 index 00000000..4d18a99b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_uint.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_ushort.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_ushort.spv32 new file mode 100644 index 00000000..ad44b06f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_ushort.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_ushort.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_ushort.spv64 new file mode 100644 index 00000000..385760fe Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_ushort.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_volatile.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_volatile.spv32 new file mode 100644 index 00000000..78c6b05d Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_volatile.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_volatile.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_volatile.spv64 new file mode 100644 index 00000000..794c0faa Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_volatile.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_int.spv32 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_int.spv32 new file mode 100644 index 00000000..45e6f4f1 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_int.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_int.spv64 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_int.spv64 new file mode 100644 index 00000000..29af7130 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_int.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_uint.spv32 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_uint.spv32 new file mode 100644 index 00000000..39e6e5a9 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_uint.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_uint.spv64 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_uint.spv64 new file mode 100644 index 00000000..c632884f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_uint.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_int.spv32 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_int.spv32 new file mode 100644 index 00000000..98adfe9c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_int.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_int.spv64 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_int.spv64 new file mode 100644 index 00000000..8918eac2 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_int.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_uint.spv32 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_uint.spv32 new file mode 100644 index 00000000..595c92f7 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_uint.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_uint.spv64 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_uint.spv64 new file mode 100644 index 00000000..6d19c7da Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_uint.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fnegate_int.spv32 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fnegate_int.spv32 new file mode 100644 index 00000000..ebf4dc42 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fnegate_int.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fnegate_int.spv64 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fnegate_int.spv64 new file mode 100644 index 00000000..7c46bd30 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fnegate_int.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_int.spv32 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_int.spv32 new file mode 100644 index 00000000..aa772abc Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_int.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_int.spv64 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_int.spv64 new file mode 100644 index 00000000..6ac491d6 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_int.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_uint.spv32 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_uint.spv32 new file mode 100644 index 00000000..566ddadd Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_uint.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_uint.spv64 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_uint.spv64 new file mode 100644 index 00000000..3f83a752 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_uint.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_int.spv32 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_int.spv32 new file mode 100644 index 00000000..377f1f52 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_int.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_int.spv64 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_int.spv64 new file mode 100644 index 00000000..4b67f27f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_int.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_uint.spv32 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_uint.spv32 new file mode 100644 index 00000000..f80ba8af Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_uint.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_uint.spv64 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_uint.spv64 new file mode 100644 index 00000000..0fd6c20a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_uint.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fadd_double.spv32 b/test_conformance/spirv_new/spirv_bin/fadd_double.spv32 new file mode 100644 index 00000000..eb41392c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fadd_double.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fadd_double.spv64 b/test_conformance/spirv_new/spirv_bin/fadd_double.spv64 new file mode 100644 index 00000000..a09e778e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fadd_double.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fadd_double2.spv32 b/test_conformance/spirv_new/spirv_bin/fadd_double2.spv32 new file mode 100644 index 00000000..7983bda5 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fadd_double2.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fadd_double2.spv64 b/test_conformance/spirv_new/spirv_bin/fadd_double2.spv64 new file mode 100644 index 00000000..33cd29ac Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fadd_double2.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fadd_float.spv32 b/test_conformance/spirv_new/spirv_bin/fadd_float.spv32 new file mode 100644 index 00000000..bb2d91aa Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fadd_float.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fadd_float.spv64 b/test_conformance/spirv_new/spirv_bin/fadd_float.spv64 new file mode 100644 index 00000000..f06cef0b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fadd_float.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fadd_float4.spv32 b/test_conformance/spirv_new/spirv_bin/fadd_float4.spv32 new file mode 100644 index 00000000..bd030e10 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fadd_float4.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fadd_float4.spv64 b/test_conformance/spirv_new/spirv_bin/fadd_float4.spv64 new file mode 100644 index 00000000..f7073077 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fadd_float4.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fadd_half.spv32 b/test_conformance/spirv_new/spirv_bin/fadd_half.spv32 new file mode 100644 index 00000000..5a1528b4 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fadd_half.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fadd_half.spv64 b/test_conformance/spirv_new/spirv_bin/fadd_half.spv64 new file mode 100644 index 00000000..12a14500 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fadd_half.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fdiv_double.spv32 b/test_conformance/spirv_new/spirv_bin/fdiv_double.spv32 new file mode 100644 index 00000000..ed02f3fa Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fdiv_double.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fdiv_double.spv64 b/test_conformance/spirv_new/spirv_bin/fdiv_double.spv64 new file mode 100644 index 00000000..25847af6 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fdiv_double.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fdiv_double2.spv32 b/test_conformance/spirv_new/spirv_bin/fdiv_double2.spv32 new file mode 100644 index 00000000..baa7d55f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fdiv_double2.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fdiv_double2.spv64 b/test_conformance/spirv_new/spirv_bin/fdiv_double2.spv64 new file mode 100644 index 00000000..959dbab4 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fdiv_double2.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fdiv_float.spv32 b/test_conformance/spirv_new/spirv_bin/fdiv_float.spv32 new file mode 100644 index 00000000..5e299e69 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fdiv_float.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fdiv_float.spv64 b/test_conformance/spirv_new/spirv_bin/fdiv_float.spv64 new file mode 100644 index 00000000..33f1b29c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fdiv_float.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fdiv_float4.spv32 b/test_conformance/spirv_new/spirv_bin/fdiv_float4.spv32 new file mode 100644 index 00000000..3fa367ff Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fdiv_float4.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fdiv_float4.spv64 b/test_conformance/spirv_new/spirv_bin/fdiv_float4.spv64 new file mode 100644 index 00000000..d174c49c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fdiv_float4.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fdiv_half.spv32 b/test_conformance/spirv_new/spirv_bin/fdiv_half.spv32 new file mode 100644 index 00000000..b53b3385 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fdiv_half.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fdiv_half.spv64 b/test_conformance/spirv_new/spirv_bin/fdiv_half.spv64 new file mode 100644 index 00000000..1c52fbc1 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fdiv_half.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmod_double.spv32 b/test_conformance/spirv_new/spirv_bin/fmod_double.spv32 new file mode 100644 index 00000000..17dd5a3f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmod_double.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmod_double.spv64 b/test_conformance/spirv_new/spirv_bin/fmod_double.spv64 new file mode 100644 index 00000000..d0142746 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmod_double.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmod_double2.spv32 b/test_conformance/spirv_new/spirv_bin/fmod_double2.spv32 new file mode 100644 index 00000000..c3f34897 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmod_double2.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmod_double2.spv64 b/test_conformance/spirv_new/spirv_bin/fmod_double2.spv64 new file mode 100644 index 00000000..96a26c48 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmod_double2.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmod_float.spv32 b/test_conformance/spirv_new/spirv_bin/fmod_float.spv32 new file mode 100644 index 00000000..3bcfc99a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmod_float.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmod_float.spv64 b/test_conformance/spirv_new/spirv_bin/fmod_float.spv64 new file mode 100644 index 00000000..07576a50 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmod_float.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmod_float4.spv32 b/test_conformance/spirv_new/spirv_bin/fmod_float4.spv32 new file mode 100644 index 00000000..e0290811 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmod_float4.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmod_float4.spv64 b/test_conformance/spirv_new/spirv_bin/fmod_float4.spv64 new file mode 100644 index 00000000..ef36e2af Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmod_float4.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmod_half.spv32 b/test_conformance/spirv_new/spirv_bin/fmod_half.spv32 new file mode 100644 index 00000000..7f8aa33b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmod_half.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmod_half.spv64 b/test_conformance/spirv_new/spirv_bin/fmod_half.spv64 new file mode 100644 index 00000000..1b2ab0aa Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmod_half.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmul_double.spv32 b/test_conformance/spirv_new/spirv_bin/fmul_double.spv32 new file mode 100644 index 00000000..818341c5 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmul_double.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmul_double.spv64 b/test_conformance/spirv_new/spirv_bin/fmul_double.spv64 new file mode 100644 index 00000000..6b83060a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmul_double.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmul_double2.spv32 b/test_conformance/spirv_new/spirv_bin/fmul_double2.spv32 new file mode 100644 index 00000000..76db7832 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmul_double2.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmul_double2.spv64 b/test_conformance/spirv_new/spirv_bin/fmul_double2.spv64 new file mode 100644 index 00000000..eb1057ec Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmul_double2.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmul_float.spv32 b/test_conformance/spirv_new/spirv_bin/fmul_float.spv32 new file mode 100644 index 00000000..05da0ad1 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmul_float.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmul_float.spv64 b/test_conformance/spirv_new/spirv_bin/fmul_float.spv64 new file mode 100644 index 00000000..c5403ca8 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmul_float.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmul_float4.spv32 b/test_conformance/spirv_new/spirv_bin/fmul_float4.spv32 new file mode 100644 index 00000000..388fce95 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmul_float4.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmul_float4.spv64 b/test_conformance/spirv_new/spirv_bin/fmul_float4.spv64 new file mode 100644 index 00000000..bbff46b0 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmul_float4.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmul_half.spv32 b/test_conformance/spirv_new/spirv_bin/fmul_half.spv32 new file mode 100644 index 00000000..dbba457d Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmul_half.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmul_half.spv64 b/test_conformance/spirv_new/spirv_bin/fmul_half.spv64 new file mode 100644 index 00000000..35512019 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmul_half.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/frem_double.spv32 b/test_conformance/spirv_new/spirv_bin/frem_double.spv32 new file mode 100644 index 00000000..6ca297cb Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/frem_double.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/frem_double.spv64 b/test_conformance/spirv_new/spirv_bin/frem_double.spv64 new file mode 100644 index 00000000..3e458b23 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/frem_double.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/frem_double2.spv32 b/test_conformance/spirv_new/spirv_bin/frem_double2.spv32 new file mode 100644 index 00000000..0569ce8e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/frem_double2.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/frem_double2.spv64 b/test_conformance/spirv_new/spirv_bin/frem_double2.spv64 new file mode 100644 index 00000000..34cfcc6a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/frem_double2.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/frem_float.spv32 b/test_conformance/spirv_new/spirv_bin/frem_float.spv32 new file mode 100644 index 00000000..ec6cd362 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/frem_float.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/frem_float.spv64 b/test_conformance/spirv_new/spirv_bin/frem_float.spv64 new file mode 100644 index 00000000..18b1b824 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/frem_float.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/frem_float4.spv32 b/test_conformance/spirv_new/spirv_bin/frem_float4.spv32 new file mode 100644 index 00000000..ef444d69 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/frem_float4.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/frem_float4.spv64 b/test_conformance/spirv_new/spirv_bin/frem_float4.spv64 new file mode 100644 index 00000000..074f6cbf Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/frem_float4.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/frem_half.spv32 b/test_conformance/spirv_new/spirv_bin/frem_half.spv32 new file mode 100644 index 00000000..d9a84cc5 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/frem_half.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/frem_half.spv64 b/test_conformance/spirv_new/spirv_bin/frem_half.spv64 new file mode 100644 index 00000000..5d0fce06 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/frem_half.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fsub_double.spv32 b/test_conformance/spirv_new/spirv_bin/fsub_double.spv32 new file mode 100644 index 00000000..32fa6d80 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fsub_double.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fsub_double.spv64 b/test_conformance/spirv_new/spirv_bin/fsub_double.spv64 new file mode 100644 index 00000000..153b094c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fsub_double.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fsub_double2.spv32 b/test_conformance/spirv_new/spirv_bin/fsub_double2.spv32 new file mode 100644 index 00000000..62e5c8fc Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fsub_double2.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fsub_double2.spv64 b/test_conformance/spirv_new/spirv_bin/fsub_double2.spv64 new file mode 100644 index 00000000..bf300652 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fsub_double2.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fsub_float.spv32 b/test_conformance/spirv_new/spirv_bin/fsub_float.spv32 new file mode 100644 index 00000000..03411722 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fsub_float.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fsub_float.spv64 b/test_conformance/spirv_new/spirv_bin/fsub_float.spv64 new file mode 100644 index 00000000..028c5224 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fsub_float.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fsub_float4.spv32 b/test_conformance/spirv_new/spirv_bin/fsub_float4.spv32 new file mode 100644 index 00000000..c7705dcf Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fsub_float4.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fsub_float4.spv64 b/test_conformance/spirv_new/spirv_bin/fsub_float4.spv64 new file mode 100644 index 00000000..c2593fd5 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fsub_float4.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fsub_half.spv32 b/test_conformance/spirv_new/spirv_bin/fsub_half.spv32 new file mode 100644 index 00000000..4eaf7301 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fsub_half.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fsub_half.spv64 b/test_conformance/spirv_new/spirv_bin/fsub_half.spv64 new file mode 100644 index 00000000..7f71faa9 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fsub_half.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/label_simple.spv32 b/test_conformance/spirv_new/spirv_bin/label_simple.spv32 new file mode 100644 index 00000000..c7345cf4 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/label_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/label_simple.spv64 b/test_conformance/spirv_new/spirv_bin/label_simple.spv64 new file mode 100644 index 00000000..1fb54197 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/label_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/lifetime_simple.spv32 b/test_conformance/spirv_new/spirv_bin/lifetime_simple.spv32 new file mode 100644 index 00000000..cda8a59a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/lifetime_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/lifetime_simple.spv64 b/test_conformance/spirv_new/spirv_bin/lifetime_simple.spv64 new file mode 100644 index 00000000..861581d1 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/lifetime_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/linkage_export.spv32 b/test_conformance/spirv_new/spirv_bin/linkage_export.spv32 new file mode 100644 index 00000000..280021b6 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/linkage_export.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/linkage_export.spv64 b/test_conformance/spirv_new/spirv_bin/linkage_export.spv64 new file mode 100644 index 00000000..fefdc26c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/linkage_export.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/linkage_import.spv32 b/test_conformance/spirv_new/spirv_bin/linkage_import.spv32 new file mode 100644 index 00000000..2264844c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/linkage_import.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/linkage_import.spv64 b/test_conformance/spirv_new/spirv_bin/linkage_import.spv64 new file mode 100644 index 00000000..5b730ccc Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/linkage_import.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_dont_unroll.spv32 b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_dont_unroll.spv32 new file mode 100644 index 00000000..93762436 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_dont_unroll.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_dont_unroll.spv64 b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_dont_unroll.spv64 new file mode 100644 index 00000000..be35cde0 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_dont_unroll.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_none.spv32 b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_none.spv32 new file mode 100644 index 00000000..5223ddd5 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_none.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_none.spv64 b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_none.spv64 new file mode 100644 index 00000000..4c47e418 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_none.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_unroll.spv32 b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_unroll.spv32 new file mode 100644 index 00000000..deac6d94 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_unroll.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_unroll.spv64 b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_unroll.spv64 new file mode 100644 index 00000000..69e31a56 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_unroll.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/loop_merge_branch_dont_unroll.spv32 b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_dont_unroll.spv32 new file mode 100644 index 00000000..9ccc18c5 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_dont_unroll.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/loop_merge_branch_dont_unroll.spv64 b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_dont_unroll.spv64 new file mode 100644 index 00000000..70fa1169 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_dont_unroll.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/loop_merge_branch_none.spv32 b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_none.spv32 new file mode 100644 index 00000000..beb0d535 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_none.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/loop_merge_branch_none.spv64 b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_none.spv64 new file mode 100644 index 00000000..944e64eb Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_none.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/loop_merge_branch_unroll.spv32 b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_unroll.spv32 new file mode 100644 index 00000000..b36c1ff0 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_unroll.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/loop_merge_branch_unroll.spv64 b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_unroll.spv64 new file mode 100644 index 00000000..10232b13 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_unroll.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_function_const.spv32 b/test_conformance/spirv_new/spirv_bin/op_function_const.spv32 new file mode 100644 index 00000000..715bdfe0 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_function_const.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_function_const.spv64 b/test_conformance/spirv_new/spirv_bin/op_function_const.spv64 new file mode 100644 index 00000000..84aeb1aa Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_function_const.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_function_inline.spv32 b/test_conformance/spirv_new/spirv_bin/op_function_inline.spv32 new file mode 100644 index 00000000..9ee6de8d Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_function_inline.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_function_inline.spv64 b/test_conformance/spirv_new/spirv_bin/op_function_inline.spv64 new file mode 100644 index 00000000..8a83d991 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_function_inline.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_function_noinline.spv32 b/test_conformance/spirv_new/spirv_bin/op_function_noinline.spv32 new file mode 100644 index 00000000..07f66b5c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_function_noinline.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_function_noinline.spv64 b/test_conformance/spirv_new/spirv_bin/op_function_noinline.spv64 new file mode 100644 index 00000000..815f5f47 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_function_noinline.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_function_none.spv32 b/test_conformance/spirv_new/spirv_bin/op_function_none.spv32 new file mode 100644 index 00000000..19edd132 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_function_none.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_function_none.spv64 b/test_conformance/spirv_new/spirv_bin/op_function_none.spv64 new file mode 100644 index 00000000..9eeb813c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_function_none.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_function_pure.spv32 b/test_conformance/spirv_new/spirv_bin/op_function_pure.spv32 new file mode 100644 index 00000000..50603890 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_function_pure.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_function_pure.spv64 b/test_conformance/spirv_new/spirv_bin/op_function_pure.spv64 new file mode 100644 index 00000000..8757f7ff Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_function_pure.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_function_pure_ptr.spv32 b/test_conformance/spirv_new/spirv_bin/op_function_pure_ptr.spv32 new file mode 100644 index 00000000..cd5506bc Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_function_pure_ptr.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_function_pure_ptr.spv64 b/test_conformance/spirv_new/spirv_bin/op_function_pure_ptr.spv64 new file mode 100644 index 00000000..35a6311b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_function_pure_ptr.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_double.spv32 b/test_conformance/spirv_new/spirv_bin/op_neg_double.spv32 new file mode 100644 index 00000000..b3692905 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_double.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_double.spv64 b/test_conformance/spirv_new/spirv_bin/op_neg_double.spv64 new file mode 100644 index 00000000..509ceb43 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_double.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_float.spv32 b/test_conformance/spirv_new/spirv_bin/op_neg_float.spv32 new file mode 100644 index 00000000..5032936e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_float.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_float.spv64 b/test_conformance/spirv_new/spirv_bin/op_neg_float.spv64 new file mode 100644 index 00000000..52ef3da3 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_float.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_float4.spv32 b/test_conformance/spirv_new/spirv_bin/op_neg_float4.spv32 new file mode 100644 index 00000000..ee025843 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_float4.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_float4.spv64 b/test_conformance/spirv_new/spirv_bin/op_neg_float4.spv64 new file mode 100644 index 00000000..d157a720 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_float4.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_int.spv32 b/test_conformance/spirv_new/spirv_bin/op_neg_int.spv32 new file mode 100644 index 00000000..cf7a97e9 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_int.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_int.spv64 b/test_conformance/spirv_new/spirv_bin/op_neg_int.spv64 new file mode 100644 index 00000000..1375dea0 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_int.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_int4.spv32 b/test_conformance/spirv_new/spirv_bin/op_neg_int4.spv32 new file mode 100644 index 00000000..e2b16196 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_int4.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_int4.spv64 b/test_conformance/spirv_new/spirv_bin/op_neg_int4.spv64 new file mode 100644 index 00000000..eccef16e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_int4.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_long.spv32 b/test_conformance/spirv_new/spirv_bin/op_neg_long.spv32 new file mode 100644 index 00000000..9e99f195 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_long.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_long.spv64 b/test_conformance/spirv_new/spirv_bin/op_neg_long.spv64 new file mode 100644 index 00000000..90201ff5 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_long.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_short.spv32 b/test_conformance/spirv_new/spirv_bin/op_neg_short.spv32 new file mode 100644 index 00000000..f5675e80 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_short.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_short.spv64 b/test_conformance/spirv_new/spirv_bin/op_neg_short.spv64 new file mode 100644 index 00000000..94407a81 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_short.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_not_int.spv32 b/test_conformance/spirv_new/spirv_bin/op_not_int.spv32 new file mode 100644 index 00000000..0de6efdc Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_not_int.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_not_int.spv64 b/test_conformance/spirv_new/spirv_bin/op_not_int.spv64 new file mode 100644 index 00000000..f416a7d4 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_not_int.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_not_int4.spv32 b/test_conformance/spirv_new/spirv_bin/op_not_int4.spv32 new file mode 100644 index 00000000..5f296207 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_not_int4.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_not_int4.spv64 b/test_conformance/spirv_new/spirv_bin/op_not_int4.spv64 new file mode 100644 index 00000000..a2b8d9a7 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_not_int4.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_not_long.spv32 b/test_conformance/spirv_new/spirv_bin/op_not_long.spv32 new file mode 100644 index 00000000..041931f0 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_not_long.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_not_long.spv64 b/test_conformance/spirv_new/spirv_bin/op_not_long.spv64 new file mode 100644 index 00000000..3702b716 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_not_long.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_not_short.spv32 b/test_conformance/spirv_new/spirv_bin/op_not_short.spv32 new file mode 100644 index 00000000..42d233f0 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_not_short.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_not_short.spv64 b/test_conformance/spirv_new/spirv_bin/op_not_short.spv64 new file mode 100644 index 00000000..e07f9adf Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_not_short.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_spec_constant_double_simple.spv32 b/test_conformance/spirv_new/spirv_bin/op_spec_constant_double_simple.spv32 new file mode 100644 index 00000000..a7a47186 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_spec_constant_double_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_spec_constant_double_simple.spv64 b/test_conformance/spirv_new/spirv_bin/op_spec_constant_double_simple.spv64 new file mode 100644 index 00000000..62cdf072 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_spec_constant_double_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_spec_constant_false_simple.spv32 b/test_conformance/spirv_new/spirv_bin/op_spec_constant_false_simple.spv32 new file mode 100644 index 00000000..adc01353 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_spec_constant_false_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_spec_constant_false_simple.spv64 b/test_conformance/spirv_new/spirv_bin/op_spec_constant_false_simple.spv64 new file mode 100644 index 00000000..2046ab64 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_spec_constant_false_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_spec_constant_float_simple.spv32 b/test_conformance/spirv_new/spirv_bin/op_spec_constant_float_simple.spv32 new file mode 100644 index 00000000..5ac5fdfb Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_spec_constant_float_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_spec_constant_float_simple.spv64 b/test_conformance/spirv_new/spirv_bin/op_spec_constant_float_simple.spv64 new file mode 100644 index 00000000..ac4f4440 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_spec_constant_float_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_spec_constant_half_simple.spv32 b/test_conformance/spirv_new/spirv_bin/op_spec_constant_half_simple.spv32 new file mode 100644 index 00000000..b775b80d Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_spec_constant_half_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_spec_constant_half_simple.spv64 b/test_conformance/spirv_new/spirv_bin/op_spec_constant_half_simple.spv64 new file mode 100644 index 00000000..31079495 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_spec_constant_half_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_spec_constant_true_simple.spv32 b/test_conformance/spirv_new/spirv_bin/op_spec_constant_true_simple.spv32 new file mode 100644 index 00000000..fa0deb0d Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_spec_constant_true_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_spec_constant_true_simple.spv64 b/test_conformance/spirv_new/spirv_bin/op_spec_constant_true_simple.spv64 new file mode 100644 index 00000000..84f6149f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_spec_constant_true_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_spec_constant_uchar_simple.spv32 b/test_conformance/spirv_new/spirv_bin/op_spec_constant_uchar_simple.spv32 new file mode 100644 index 00000000..ac0536a7 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_spec_constant_uchar_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_spec_constant_uchar_simple.spv64 b/test_conformance/spirv_new/spirv_bin/op_spec_constant_uchar_simple.spv64 new file mode 100644 index 00000000..5f2e95dd Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_spec_constant_uchar_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_spec_constant_uint_simple.spv32 b/test_conformance/spirv_new/spirv_bin/op_spec_constant_uint_simple.spv32 new file mode 100644 index 00000000..a7734d98 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_spec_constant_uint_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_spec_constant_uint_simple.spv64 b/test_conformance/spirv_new/spirv_bin/op_spec_constant_uint_simple.spv64 new file mode 100644 index 00000000..6bb0eef7 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_spec_constant_uint_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_spec_constant_ulong_simple.spv32 b/test_conformance/spirv_new/spirv_bin/op_spec_constant_ulong_simple.spv32 new file mode 100644 index 00000000..eb1469f8 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_spec_constant_ulong_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_spec_constant_ulong_simple.spv64 b/test_conformance/spirv_new/spirv_bin/op_spec_constant_ulong_simple.spv64 new file mode 100644 index 00000000..e37d3226 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_spec_constant_ulong_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_spec_constant_ushort_simple.spv32 b/test_conformance/spirv_new/spirv_bin/op_spec_constant_ushort_simple.spv32 new file mode 100644 index 00000000..84926b4c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_spec_constant_ushort_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_spec_constant_ushort_simple.spv64 b/test_conformance/spirv_new/spirv_bin/op_spec_constant_ushort_simple.spv64 new file mode 100644 index 00000000..00d01a7f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_spec_constant_ushort_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/opaque.spv32 b/test_conformance/spirv_new/spirv_bin/opaque.spv32 new file mode 100644 index 00000000..0dbe21f8 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/opaque.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/opaque.spv64 b/test_conformance/spirv_new/spirv_bin/opaque.spv64 new file mode 100644 index 00000000..b3b0adab Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/opaque.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/phi_2.spv32 b/test_conformance/spirv_new/spirv_bin/phi_2.spv32 new file mode 100644 index 00000000..79470dd0 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/phi_2.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/phi_2.spv64 b/test_conformance/spirv_new/spirv_bin/phi_2.spv64 new file mode 100644 index 00000000..6d153537 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/phi_2.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/phi_3.spv32 b/test_conformance/spirv_new/spirv_bin/phi_3.spv32 new file mode 100644 index 00000000..047c695b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/phi_3.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/phi_3.spv64 b/test_conformance/spirv_new/spirv_bin/phi_3.spv64 new file mode 100644 index 00000000..a42b9d9d Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/phi_3.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/phi_4.spv32 b/test_conformance/spirv_new/spirv_bin/phi_4.spv32 new file mode 100644 index 00000000..2eacc06a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/phi_4.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/phi_4.spv64 b/test_conformance/spirv_new/spirv_bin/phi_4.spv64 new file mode 100644 index 00000000..c907b9f7 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/phi_4.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/select_if_dont_flatten.spv32 b/test_conformance/spirv_new/spirv_bin/select_if_dont_flatten.spv32 new file mode 100644 index 00000000..eebbba23 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/select_if_dont_flatten.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/select_if_dont_flatten.spv64 b/test_conformance/spirv_new/spirv_bin/select_if_dont_flatten.spv64 new file mode 100644 index 00000000..5eda1248 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/select_if_dont_flatten.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/select_if_flatten.spv32 b/test_conformance/spirv_new/spirv_bin/select_if_flatten.spv32 new file mode 100644 index 00000000..8921486f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/select_if_flatten.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/select_if_flatten.spv64 b/test_conformance/spirv_new/spirv_bin/select_if_flatten.spv64 new file mode 100644 index 00000000..3c211e1c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/select_if_flatten.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/select_if_none.spv32 b/test_conformance/spirv_new/spirv_bin/select_if_none.spv32 new file mode 100644 index 00000000..b76e234d Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/select_if_none.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/select_if_none.spv64 b/test_conformance/spirv_new/spirv_bin/select_if_none.spv64 new file mode 100644 index 00000000..de143939 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/select_if_none.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/select_switch_dont_flatten.spv32 b/test_conformance/spirv_new/spirv_bin/select_switch_dont_flatten.spv32 new file mode 100644 index 00000000..5c67309a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/select_switch_dont_flatten.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/select_switch_dont_flatten.spv64 b/test_conformance/spirv_new/spirv_bin/select_switch_dont_flatten.spv64 new file mode 100644 index 00000000..7832c2a8 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/select_switch_dont_flatten.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/select_switch_flatten.spv32 b/test_conformance/spirv_new/spirv_bin/select_switch_flatten.spv32 new file mode 100644 index 00000000..6e7802da Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/select_switch_flatten.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/select_switch_flatten.spv64 b/test_conformance/spirv_new/spirv_bin/select_switch_flatten.spv64 new file mode 100644 index 00000000..ea822e64 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/select_switch_flatten.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/select_switch_none.spv32 b/test_conformance/spirv_new/spirv_bin/select_switch_none.spv32 new file mode 100644 index 00000000..36bf67c2 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/select_switch_none.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/select_switch_none.spv64 b/test_conformance/spirv_new/spirv_bin/select_switch_none.spv64 new file mode 100644 index 00000000..2cd5e60a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/select_switch_none.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_char_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_char_simple.spv32 new file mode 100644 index 00000000..1250c055 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_char_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_char_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_char_simple.spv64 new file mode 100644 index 00000000..dedb220d Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_char_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_double_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_double_simple.spv32 new file mode 100644 index 00000000..d7ef1922 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_double_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_double_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_double_simple.spv64 new file mode 100644 index 00000000..923d2c8a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_double_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_false_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_false_simple.spv32 new file mode 100644 index 00000000..5d78c737 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_false_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_false_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_false_simple.spv64 new file mode 100644 index 00000000..f3b7372b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_false_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_float_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_float_simple.spv32 new file mode 100644 index 00000000..734d932c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_float_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_float_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_float_simple.spv64 new file mode 100644 index 00000000..cbd84cc1 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_float_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_half_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_half_simple.spv32 new file mode 100644 index 00000000..810406a8 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_half_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_half_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_half_simple.spv64 new file mode 100644 index 00000000..18467ac9 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_half_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_int3_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_int3_simple.spv32 new file mode 100644 index 00000000..70bbf452 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_int3_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_int3_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_int3_simple.spv64 new file mode 100644 index 00000000..c23bf648 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_int3_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_int4_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_int4_simple.spv32 new file mode 100644 index 00000000..a808ff1d Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_int4_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_int4_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_int4_simple.spv64 new file mode 100644 index 00000000..346ab87c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_int4_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_int_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_int_simple.spv32 new file mode 100644 index 00000000..e6e1d7e1 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_int_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_int_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_int_simple.spv64 new file mode 100644 index 00000000..818fe0d9 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_int_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_long_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_long_simple.spv32 new file mode 100644 index 00000000..0f6bea69 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_long_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_long_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_long_simple.spv64 new file mode 100644 index 00000000..01f1b3f9 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_long_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_short_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_short_simple.spv32 new file mode 100644 index 00000000..f7dde05e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_short_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_short_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_short_simple.spv64 new file mode 100644 index 00000000..49231a2a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_short_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_struct_int_char_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_struct_int_char_simple.spv32 new file mode 100644 index 00000000..2e0d462e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_struct_int_char_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_struct_int_char_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_struct_int_char_simple.spv64 new file mode 100644 index 00000000..d6e8917b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_struct_int_char_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_struct_int_float_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_struct_int_float_simple.spv32 new file mode 100644 index 00000000..0741b5d7 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_struct_int_float_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_struct_int_float_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_struct_int_float_simple.spv64 new file mode 100644 index 00000000..1dc8888e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_struct_int_float_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_struct_struct_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_struct_struct_simple.spv32 new file mode 100644 index 00000000..6a883433 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_struct_struct_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_struct_struct_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_struct_struct_simple.spv64 new file mode 100644 index 00000000..f1880c09 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_struct_struct_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_true_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_true_simple.spv32 new file mode 100644 index 00000000..6eed8bac Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_true_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_true_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_true_simple.spv64 new file mode 100644 index 00000000..cd04b035 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_true_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_uchar_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_uchar_simple.spv32 new file mode 100644 index 00000000..6814e8d1 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_uchar_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_uchar_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_uchar_simple.spv64 new file mode 100644 index 00000000..93cfb56b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_uchar_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_uint_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_uint_simple.spv32 new file mode 100644 index 00000000..3d2bf5fc Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_uint_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_uint_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_uint_simple.spv64 new file mode 100644 index 00000000..00dcf37b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_uint_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_ulong_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_ulong_simple.spv32 new file mode 100644 index 00000000..2ddf4943 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_ulong_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_ulong_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_ulong_simple.spv64 new file mode 100644 index 00000000..538945e3 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_ulong_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_ushort_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_ushort_simple.spv32 new file mode 100644 index 00000000..cc39ca72 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_ushort_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_ushort_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_ushort_simple.spv64 new file mode 100644 index 00000000..2e45d210 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_ushort_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/unreachable_simple.spv32 b/test_conformance/spirv_new/spirv_bin/unreachable_simple.spv32 new file mode 100644 index 00000000..2adb0b45 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/unreachable_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/unreachable_simple.spv64 b/test_conformance/spirv_new/spirv_bin/unreachable_simple.spv64 new file mode 100644 index 00000000..806ca280 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/unreachable_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_char16_extract.spv32 b/test_conformance/spirv_new/spirv_bin/vector_char16_extract.spv32 new file mode 100644 index 00000000..7944011b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_char16_extract.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_char16_extract.spv64 b/test_conformance/spirv_new/spirv_bin/vector_char16_extract.spv64 new file mode 100644 index 00000000..cb3ad071 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_char16_extract.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_char16_insert.spv32 b/test_conformance/spirv_new/spirv_bin/vector_char16_insert.spv32 new file mode 100644 index 00000000..421f91f9 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_char16_insert.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_char16_insert.spv64 b/test_conformance/spirv_new/spirv_bin/vector_char16_insert.spv64 new file mode 100644 index 00000000..9ff56217 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_char16_insert.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_double2_extract.spv32 b/test_conformance/spirv_new/spirv_bin/vector_double2_extract.spv32 new file mode 100644 index 00000000..e69fd372 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_double2_extract.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_double2_extract.spv64 b/test_conformance/spirv_new/spirv_bin/vector_double2_extract.spv64 new file mode 100644 index 00000000..84a4ab4b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_double2_extract.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_double2_insert.spv32 b/test_conformance/spirv_new/spirv_bin/vector_double2_insert.spv32 new file mode 100644 index 00000000..f4783fc5 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_double2_insert.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_double2_insert.spv64 b/test_conformance/spirv_new/spirv_bin/vector_double2_insert.spv64 new file mode 100644 index 00000000..1b479f74 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_double2_insert.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_float4_extract.spv32 b/test_conformance/spirv_new/spirv_bin/vector_float4_extract.spv32 new file mode 100644 index 00000000..fe887814 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_float4_extract.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_float4_extract.spv64 b/test_conformance/spirv_new/spirv_bin/vector_float4_extract.spv64 new file mode 100644 index 00000000..53696b75 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_float4_extract.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_float4_insert.spv32 b/test_conformance/spirv_new/spirv_bin/vector_float4_insert.spv32 new file mode 100644 index 00000000..5c392b26 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_float4_insert.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_float4_insert.spv64 b/test_conformance/spirv_new/spirv_bin/vector_float4_insert.spv64 new file mode 100644 index 00000000..4189b2e3 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_float4_insert.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_int4_extract.spv32 b/test_conformance/spirv_new/spirv_bin/vector_int4_extract.spv32 new file mode 100644 index 00000000..b2664745 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_int4_extract.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_int4_extract.spv64 b/test_conformance/spirv_new/spirv_bin/vector_int4_extract.spv64 new file mode 100644 index 00000000..c9376b9c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_int4_extract.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_int4_insert.spv32 b/test_conformance/spirv_new/spirv_bin/vector_int4_insert.spv32 new file mode 100644 index 00000000..31104e0a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_int4_insert.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_int4_insert.spv64 b/test_conformance/spirv_new/spirv_bin/vector_int4_insert.spv64 new file mode 100644 index 00000000..dc1a2666 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_int4_insert.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_long2_extract.spv32 b/test_conformance/spirv_new/spirv_bin/vector_long2_extract.spv32 new file mode 100644 index 00000000..7791861d Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_long2_extract.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_long2_extract.spv64 b/test_conformance/spirv_new/spirv_bin/vector_long2_extract.spv64 new file mode 100644 index 00000000..75329a17 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_long2_extract.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_long2_insert.spv32 b/test_conformance/spirv_new/spirv_bin/vector_long2_insert.spv32 new file mode 100644 index 00000000..187b5dab Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_long2_insert.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_long2_insert.spv64 b/test_conformance/spirv_new/spirv_bin/vector_long2_insert.spv64 new file mode 100644 index 00000000..050cba16 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_long2_insert.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_times_scalar_double.spv32 b/test_conformance/spirv_new/spirv_bin/vector_times_scalar_double.spv32 new file mode 100644 index 00000000..ee5dd3c7 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_times_scalar_double.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_times_scalar_double.spv64 b/test_conformance/spirv_new/spirv_bin/vector_times_scalar_double.spv64 new file mode 100644 index 00000000..5407183c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_times_scalar_double.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_times_scalar_float.spv32 b/test_conformance/spirv_new/spirv_bin/vector_times_scalar_float.spv32 new file mode 100644 index 00000000..8f0d9d6d Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_times_scalar_float.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_times_scalar_float.spv64 b/test_conformance/spirv_new/spirv_bin/vector_times_scalar_float.spv64 new file mode 100644 index 00000000..af9f8fdc Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_times_scalar_float.spv64 differ diff --git a/test_conformance/spirv_new/testBase.h b/test_conformance/spirv_new/testBase.h new file mode 100644 index 00000000..1bcd6df5 --- /dev/null +++ b/test_conformance/spirv_new/testBase.h @@ -0,0 +1,37 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ +#pragma once + +#ifndef _testBase_h +#define _testBase_h + +#include "harness/compat.h" +#include "harness/rounding_mode.h" + +#include +#include +#include +#include + +#include "procs.h" + +// Ensure max min macros are undefined - compilation issues when using min max from numeric_limits template class +#if defined( max ) + #undef max +#endif + +#if defined( min ) + #undef min +#endif + +#endif // _testBase_h diff --git a/test_conformance/spirv_new/test_cl_khr_spirv_no_integer_wrap_decoration.cpp b/test_conformance/spirv_new/test_cl_khr_spirv_no_integer_wrap_decoration.cpp new file mode 100644 index 00000000..84f8ed1f --- /dev/null +++ b/test_conformance/spirv_new/test_cl_khr_spirv_no_integer_wrap_decoration.cpp @@ -0,0 +1,223 @@ +/****************************************************************** +Copyright (c) 2018 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +#include +#include +#include + + +template +int test_ext_cl_khr_spirv_no_integer_wrap_decoration(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *spvName, + const char *funcName, + const char *Tname) +{ + + cl_int err = CL_SUCCESS; + const int num = 10; + std::vector h_lhs(num); + std::vector h_rhs(num); + std::vector expected_results(num); + std::vector h_ref(num); + if (!is_extension_available(deviceID, "cl_khr_spirv_no_integer_wrap_decoration")) { + log_info("Extension cl_khr_spirv_no_integer_wrap_decoration not supported; skipping tests.\n"); + return 0; + } + + /*Test with some values that do not cause overflow*/ + if (std::is_signed::value == true) { + h_lhs.push_back((T)-25000); + h_lhs.push_back((T)-3333); + h_lhs.push_back((T)-7); + h_lhs.push_back((T)-1); + h_lhs.push_back(0); + h_lhs.push_back(1); + h_lhs.push_back(1024); + h_lhs.push_back(2048); + h_lhs.push_back(4094); + h_lhs.push_back(10000); + } else { + h_lhs.push_back(0); + h_lhs.push_back(1); + h_lhs.push_back(3); + h_lhs.push_back(5); + h_lhs.push_back(10); + h_lhs.push_back(100); + h_lhs.push_back(1024); + h_lhs.push_back(2048); + h_lhs.push_back(4094); + h_lhs.push_back(52888); + } + + h_rhs.push_back(0); + h_rhs.push_back(1); + h_rhs.push_back(2); + h_rhs.push_back(3); + h_rhs.push_back(4); + h_rhs.push_back(5); + h_rhs.push_back(6); + h_rhs.push_back(7); + h_rhs.push_back(8); + h_rhs.push_back(9); + size_t bytes = num * sizeof(T); + + clMemWrapper lhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create lhs buffer"); + + err = clEnqueueWriteBuffer(queue, lhs, CL_TRUE, 0, bytes, &h_lhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to lhs buffer"); + + clMemWrapper rhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create rhs buffer"); + + err = clEnqueueWriteBuffer(queue, rhs, CL_TRUE, 0, bytes, &h_rhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to rhs buffer"); + + std::string kernelStr; + + { + std::stringstream kernelStream; + kernelStream << "#define spirv_fadd(a, b) (a) + (b) \n"; + kernelStream << "#define spirv_fsub(a, b) (a) - (b) \n"; + kernelStream << "#define spirv_fmul(a, b) (a) * (b) \n"; + kernelStream << "#define spirv_fshiftleft(a, b) (a) << (b) \n"; + kernelStream << "#define spirv_fnegate(a, b) (-a) \n"; + + kernelStream << "#define T " << Tname << "\n"; + kernelStream << "#define FUNC spirv_" << funcName << "\n"; + kernelStream << "__kernel void fmath_cl(__global T *out, \n"; + kernelStream << "const __global T *lhs, const __global T *rhs) \n"; + kernelStream << "{ \n"; + kernelStream << " int id = get_global_id(0); \n"; + kernelStream << " out[id] = FUNC(lhs[id], rhs[id]); \n"; + kernelStream << "} \n"; + kernelStr = kernelStream.str(); + } + + size_t kernelLen = kernelStr.size(); + const char *kernelBuf = kernelStr.c_str(); + + for (int i = 0; i < num; i++) { + if (std::string(funcName) == std::string("fadd")) { + expected_results[i] = h_lhs[i] + h_rhs[i]; + } else if (std::string(funcName) == std::string("fsub")) { + expected_results[i] = h_lhs[i] - h_rhs[i]; + } else if (std::string(funcName) == std::string("fmul")) { + expected_results[i] = h_lhs[i] * h_rhs[i]; + } else if (std::string(funcName) == std::string("fshiftleft")) { + expected_results[i] = h_lhs[i] << h_rhs[i]; + } else if (std::string(funcName) == std::string("fnegate")) { + expected_results[i] = 0 - h_lhs[i]; + } + } + + { + // Run the cl kernel for reference results + clProgramWrapper prog; + err = create_single_kernel_helper_create_program(context, &prog, 1, &kernelBuf, NULL); + SPIRV_CHECK_ERROR(err, "Failed to create cl program"); + + err = clBuildProgram(prog, 1, &deviceID, NULL, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, "fmath_cl", &err); + SPIRV_CHECK_ERROR(err, "Failed to create cl kernel"); + + clMemWrapper ref = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create ref buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &ref); + SPIRV_CHECK_ERROR(err, "Failed to set arg 0"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + err = clEnqueueReadBuffer(queue, ref, CL_TRUE, 0, bytes, &h_ref[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + } + + for (int i = 0; i < num; i++) { + if (expected_results[i] != h_ref[i]) { + log_error("Values do not match at index %d expected = %d got = %d\n", i, expected_results[i], h_ref[i]); + return -1; + } + } + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, spvName); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, "fmath_cl", &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + clMemWrapper res = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create res buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &res); + SPIRV_CHECK_ERROR(err, "Failed to set arg 0"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_res(num); + err = clEnqueueReadBuffer(queue, res, CL_TRUE, 0, bytes, &h_res[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + + for (int i = 0; i < num; i++) { + if (expected_results[i] != h_res[i]) { + log_error("Values do not match at location %d expected = %d got = %d\n", i, expected_results[i], h_res[i]); + return -1; + } + } + + return 0; +} + +#define TEST_FMATH_FUNC(TYPE, FUNC) \ + TEST_SPIRV_FUNC(ext_cl_khr_spirv_no_integer_wrap_decoration_##FUNC##_##TYPE) \ + { \ + return test_ext_cl_khr_spirv_no_integer_wrap_decoration(deviceID, context, queue, \ + "ext_cl_khr_spirv_no_integer_wrap_decoration_"#FUNC"_"#TYPE, \ + #FUNC, \ + #TYPE \ + ); \ + } + +TEST_FMATH_FUNC(int, fadd) +TEST_FMATH_FUNC(int, fsub) +TEST_FMATH_FUNC(int, fmul) +TEST_FMATH_FUNC(int, fshiftleft) +TEST_FMATH_FUNC(int, fnegate) +TEST_FMATH_FUNC(uint, fadd) +TEST_FMATH_FUNC(uint, fsub) +TEST_FMATH_FUNC(uint, fmul) +TEST_FMATH_FUNC(uint, fshiftleft) \ No newline at end of file diff --git a/test_conformance/spirv_new/test_decorate.cpp b/test_conformance/spirv_new/test_decorate.cpp new file mode 100644 index 00000000..766a6b68 --- /dev/null +++ b/test_conformance/spirv_new/test_decorate.cpp @@ -0,0 +1,604 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed h_in whole or h_in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited h_in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +h_in whole or h_in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" +#include +#include +#include +#include +#include + +#ifndef isnan +// Ensure isnan is always present as a macro +#define isnan std::isnan +#endif + +long double reference_remainderl(long double x, long double y); +int gIsInRTZMode = 0; +int gDeviceILogb0 = 1; +int gDeviceILogbNaN = 1; +int gCheckTininessBeforeRounding = 1; + + +static int verify_results(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *kname, + const clProgramWrapper &prog) +{ + const int num = 1 << 20; + std::vector h_lhs(num); + std::vector h_rhs(num); + + cl_int err = 0; + + RandomSeed seed(gRandomSeed); + for (int i = 0; i < num; i++) { + h_lhs[i] = genrand(seed); + h_rhs[i] = genrand(seed); + } + + clKernelWrapper kernel = clCreateKernel(prog, kname, &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + size_t bytes = sizeof(cl_int) * num; + + clMemWrapper lhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create in buffer"); + + err = clEnqueueWriteBuffer(queue, lhs, CL_TRUE, 0, bytes, &h_lhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to in buffer"); + + clMemWrapper rhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create in buffer"); + + err = clEnqueueWriteBuffer(queue, rhs, CL_TRUE, 0, bytes, &h_rhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to in buffer"); + + clMemWrapper res = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create in buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &res); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 3"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_res(num); + err = clEnqueueReadBuffer(queue, res, CL_TRUE, 0, bytes, &h_res[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read to output"); + + for (int i = 0; i < num; i++) { + if (h_res[i] != (h_lhs[i] + h_rhs[i])) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +int test_decorate_full(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *name) +{ + clProgramWrapper prog; + cl_int err = 0; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + return verify_results(deviceID, context, queue, name, prog); +} + +TEST_SPIRV_FUNC(decorate_restrict) +{ + return test_decorate_full(deviceID, context, queue, "decorate_restrict"); +} + +TEST_SPIRV_FUNC(decorate_aliased) +{ + return test_decorate_full(deviceID, context, queue, "decorate_aliased"); +} + +TEST_SPIRV_FUNC(decorate_alignment) +{ + //TODO: Check for results ? How to ensure buffers are aligned + clProgramWrapper prog; + return get_program_with_il(prog, deviceID, context, "decorate_alignment"); +} + +TEST_SPIRV_FUNC(decorate_constant) +{ + return test_decorate_full(deviceID, context, queue, "decorate_constant"); +} + +TEST_SPIRV_FUNC(decorate_cpacked) +{ + PACKED( + struct packed_struct_t { + cl_int ival; + cl_char cval; + } + ); + + typedef struct packed_struct_t packed_t; + + const int num = 1 << 20; + + std::vector packed(num); + clProgramWrapper prog; + cl_int err = get_program_with_il(prog, deviceID, context, "decorate_cpacked"); + + clKernelWrapper kernel = clCreateKernel(prog, "decorate_cpacked", &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + size_t bytes = sizeof(packed_t) * num; + + clMemWrapper res = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create in buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &res); + SPIRV_CHECK_ERROR(err, "Failed to set arg 3"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_res(num); + err = clEnqueueReadBuffer(queue, res, CL_TRUE, 0, bytes, &h_res[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read to output"); + + for (int i = 0; i < num; i++) { + if (h_res[i].ival != 2100483600 || + h_res[i].cval != 127) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + + return 0; +} + +template +int verify_saturated_results(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *kname, + const clProgramWrapper &prog) +{ + if(std::string(kname).find("double") != std::string::npos) { + if(!is_extension_available(deviceID, "cl_khr_fp64")) { + log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); + return 0; + } + } + + cl_int err = 0; + + const int num = 1 << 20; + + clKernelWrapper kernel = clCreateKernel(prog, kname, &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + size_t in_bytes = sizeof(Ti) * num; + size_t out_bytes = sizeof(To) * num; + + std::vector h_lhs(num); + std::vector h_rhs(num); + + To loVal = std::numeric_limits::min(); + To hiVal = std::numeric_limits::max(); + + Tl range = (Tl)(hiVal) - (Tl)(loVal); + + RandomSeed seed(gRandomSeed); + for (int i = 0; i < num; i++) { + h_lhs[i] = genrand(seed) * range; + Tl val = (genrand(seed) % hiVal); + // randomly set some values on rhs to NaN + if (val * 20 < hiVal) { + h_rhs[i] = NAN; + } else { + h_rhs[i] = (Ti)(val); + } + } + + clMemWrapper lhs = clCreateBuffer(context, CL_MEM_READ_ONLY, in_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create in buffer"); + + err = clEnqueueWriteBuffer(queue, lhs, CL_TRUE, 0, in_bytes, &h_lhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to in buffer"); + + clMemWrapper rhs = clCreateBuffer(context, CL_MEM_READ_ONLY, in_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create in buffer"); + + err = clEnqueueWriteBuffer(queue, rhs, CL_TRUE, 0, in_bytes, &h_rhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to in buffer"); + + clMemWrapper res = clCreateBuffer(context, CL_MEM_READ_WRITE, out_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create in buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &res); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 3"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_res(num); + err = clEnqueueReadBuffer(queue, res, CL_TRUE, 0, out_bytes, &h_res[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read to output"); + + for (int i = 0; i < num; i++) { + Tl ival = (Tl)(h_lhs[i] * h_rhs[i]); + To val = (To)std::min(std::max(ival, loVal), hiVal); + + if (isnan(h_rhs[i])) { + val = 0; + } + + if (val != h_res[i]) { + log_error("Value error at %d\n", i); + return -1; + } + } + + return 0; +} + + +template +int test_saturate_full(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *name, + const char *types) +{ + if(std::string(types).find("double") != std::string::npos) { + if(!is_extension_available(deviceID, "cl_khr_fp64")) { + log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); + return 0; + } + } + clProgramWrapper prog; + cl_int err = 0; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + return verify_saturated_results(deviceID, context, queue, name, prog); +} + +#define TEST_SATURATED_CONVERSION(Ti, Tl, To) \ + TEST_SPIRV_FUNC(decorate_saturated_conversion_##To) \ + { \ + typedef cl_##Ti cl_Ti; \ + typedef cl_##Tl cl_Tl; \ + typedef cl_##To cl_To; \ + return test_saturate_full \ + (deviceID, context, queue, \ + "decorate_saturated_conversion_" #To, \ + #Ti #Tl #To); \ + } \ + +TEST_SATURATED_CONVERSION(float, int, char) +TEST_SATURATED_CONVERSION(float, uint, uchar) +TEST_SATURATED_CONVERSION(float, int, short) +TEST_SATURATED_CONVERSION(float, uint, ushort) +TEST_SATURATED_CONVERSION(double, long, int) +TEST_SATURATED_CONVERSION(double, ulong, uint) + +int test_image_decorate(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *name) +{ + const int width = 4096; + const int height = 4096; + + std::vector src(width * height); + RandomSeed seed(gRandomSeed); + + for (auto &val : src) { + val = genrand(seed); + } + + cl_image_format imageFormat; + imageFormat.image_channel_data_type = CL_UNSIGNED_INT32; + imageFormat.image_channel_order = CL_RGBA; + + cl_image_desc desc; + desc.image_type = CL_MEM_OBJECT_IMAGE2D; + desc.image_width = width; + desc.image_height = height; + desc.image_depth = 0; + desc.image_array_size = 0; + desc.image_row_pitch = 0; // Automatically calculate the pitch + desc.image_slice_pitch = 0; // Not needed for 2D + desc.num_mip_levels = 0; + desc.num_samples = 0; + desc.mem_object = NULL; + + cl_int err = CL_SUCCESS; + + clMemWrapper srcImage = clCreateImage(context, CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR, + &imageFormat, &desc, + &src[0], &err); + SPIRV_CHECK_ERROR(err, "Failed to create image object"); + + size_t bytes = src.size() * sizeof(cl_uint4); + clMemWrapper dstBuffer = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create image object"); + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &dstBuffer); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2 of the kernel"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &srcImage); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1 of the kernel"); + + size_t global[] = {width, height}; + err = clEnqueueNDRangeKernel(queue, kernel, 2, NULL, global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue kernel"); + + std::vector dst(src.size()); + err = clEnqueueReadBuffer(queue, dstBuffer, CL_TRUE, 0, bytes, &dst[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy data back to host"); + + for (int j = 0; j < height; j++) { + for (int i = 0; i < width; i++) { + int srcIdx = j * width + i; + int dstIdx = i * height + j; + if (dst[dstIdx] != src[srcIdx]) { + log_error("Values do not match at location (%d, %d) of src\n", i, j); + } + } + } + + return 0; +} + +#define TEST_SPIRV_IMAGE_DECORATE(type) \ + TEST_SPIRV_FUNC(decorate_##type) \ + { \ + PASSIVE_REQUIRE_IMAGE_SUPPORT(deviceID); \ + return test_image_decorate(deviceID, context, queue, \ + "decorate_" #type); \ + } \ + +TEST_SPIRV_IMAGE_DECORATE(volatile) +TEST_SPIRV_IMAGE_DECORATE(coherent) +TEST_SPIRV_IMAGE_DECORATE(nonwritable) + +TEST_SPIRV_FUNC(decorate_nonreadable) +{ + PASSIVE_REQUIRE_IMAGE_SUPPORT(deviceID); + const char *name = "decorate_nonreadable"; + const int width = 4096; + const int height = 4096; + cl_int err = CL_SUCCESS; + + std::vector src(width * height); + RandomSeed seed(gRandomSeed); + + for (auto &val : src) { + val = genrand(seed); + } + + size_t bytes = src.size() * sizeof(cl_uint4); + clMemWrapper srcBuffer = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create image object"); + + err = clEnqueueWriteBuffer(queue, srcBuffer, CL_TRUE, 0, bytes, &src[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy data back to host"); + + cl_image_format imageFormat; + imageFormat.image_channel_data_type = CL_UNSIGNED_INT32; + imageFormat.image_channel_order = CL_RGBA; + + cl_image_desc desc; + desc.image_type = CL_MEM_OBJECT_IMAGE2D; + desc.image_width = height; + desc.image_height = width; + desc.image_depth = 0; + desc.image_array_size = 0; + desc.image_row_pitch = 0; // Automatically calculate the pitch + desc.image_slice_pitch = 0; // Not needed for 2D + desc.num_mip_levels = 0; + desc.num_samples = 0; + desc.mem_object = NULL; + + + clMemWrapper dstImage = clCreateImage(context, CL_MEM_WRITE_ONLY, + &imageFormat, &desc, + NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create image object"); + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &dstImage); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2 of the kernel"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &srcBuffer); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1 of the kernel"); + + size_t global[] = {width, height}; + err = clEnqueueNDRangeKernel(queue, kernel, 2, NULL, global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue kernel"); + + std::vector dst(src.size()); + size_t origin[] = {0, 0, 0}; + size_t region[] = {height, width, 1}; + err = clEnqueueReadImage(queue, dstImage, CL_TRUE, origin, region, 0, 0, &dst[0], 0, NULL, NULL); + + + for (int j = 0; j < height; j++) { + for (int i = 0; i < width; i++) { + int srcIdx = j * width + i; + int dstIdx = i * height + j; + if (dst[dstIdx] != src[srcIdx]) { + log_error("Values do not match at location (%d, %d) of src\n", i, j); + } + } + } + + return 0; +} + +template +int test_fp_rounding(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *name, + std::vector &h_in, + std::vector &h_out) +{ + if(std::string(name).find("double") != std::string::npos) { + if(!is_extension_available(deviceID, "cl_khr_fp64")) { + log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); + return 0; + } + } + + const int num = h_in.size(); + const size_t in_bytes = num * sizeof(Ti); + const size_t out_bytes = num * sizeof(To); + cl_int err = 0; + + clMemWrapper in = clCreateBuffer(context, CL_MEM_READ_ONLY, in_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create input buffer"); + + clMemWrapper out = clCreateBuffer(context, CL_MEM_READ_ONLY, out_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create output buffer"); + + err = clEnqueueWriteBuffer(queue, in, CL_TRUE, 0, in_bytes, &h_in[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to write to input"); + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &out); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &in); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + + std::vector h_res(num); + err = clEnqueueReadBuffer(queue, out, CL_TRUE, 0, out_bytes, &h_res[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from output"); + + for (int i = 0; i < num; i++) { + if (h_res[i] != h_out[i]) { + log_error("Values do not match at location %d. Original :%lf, Expected: %ld, Found %ld\n", + i, h_in[i], h_out[i], h_res[i]); + return -1; + } + } + + return 0; +} + +template +inline To round_to_zero(Ti in) +{ + To out = (To)(in); + return out; +} + +template +int sign(T val) +{ + if (val < 0) return -1; + if (val > 0) return 1; + return 0; +} + +template +inline To round_to_even(Ti in) +{ + // https://en.wikipedia.org/wiki/Rounding#Round_half_to_even + return std::floor(in + 0.5) - 1 + std::abs(sign(reference_remainderl((long double)in, 2) - 0.5)); +} + +template +inline To round_to_posinf(Ti in) +{ + To out = std::ceil(in); + return out; +} + +template +inline To round_to_neginf(Ti in) +{ + To out = std::floor(in); + return out; +} + +#define TEST_SPIRV_FP_ROUNDING_DECORATE(name, func, Ti, To) \ + TEST_SPIRV_FUNC(decorate_fp_rounding_mode_##name##_##Ti##_##To) \ + { \ + typedef cl_##Ti clTi; \ + typedef cl_##To clTo; \ + const int num = 1 << 16; \ + std::vector in(num); \ + std::vector out(num); \ + RandomSeed seed(gRandomSeed); \ + \ + for (int i = 0; i < num; i++) { \ + in[i] = num * genrand(seed) - num/2; \ + out[i] = func(in[i]); \ + } \ + const char *name = "decorate_rounding_" #name "_" #Ti "_" #To; \ + return test_fp_rounding(deviceID, context, queue, \ + name, in, out); \ + } \ + +TEST_SPIRV_FP_ROUNDING_DECORATE(rte, round_to_even, float, int); +TEST_SPIRV_FP_ROUNDING_DECORATE(rtz, round_to_zero, float, int); +TEST_SPIRV_FP_ROUNDING_DECORATE(rtp, round_to_posinf, float, int); +TEST_SPIRV_FP_ROUNDING_DECORATE(rtn, round_to_neginf, float, int); + +TEST_SPIRV_FP_ROUNDING_DECORATE(rte, round_to_even, double, long); +TEST_SPIRV_FP_ROUNDING_DECORATE(rtz, round_to_zero, double, long); +TEST_SPIRV_FP_ROUNDING_DECORATE(rtp, round_to_posinf, double, long); +TEST_SPIRV_FP_ROUNDING_DECORATE(rtn, round_to_neginf, double, long); diff --git a/test_conformance/spirv_new/test_get_program_il.cpp b/test_conformance/spirv_new/test_get_program_il.cpp new file mode 100644 index 00000000..cf349d17 --- /dev/null +++ b/test_conformance/spirv_new/test_get_program_il.cpp @@ -0,0 +1,105 @@ +/****************************************************************** +Copyright (c) 2020 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to +the Khronos Group, Inc. This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not +be disclosed in whole or in part to third parties, and may not be reproduced, +republished, distributed, transmitted, displayed, broadcast or otherwise +exploited in any manner without the express prior written permission of Khronos +Group. The receipt or possession of this code does not convey any rights to +reproduce, disclose, or distribute its contents, or to manufacture, use, or sell +anything that it may describe, in whole or in part other than under the terms of +the Khronos Adopters Agreement or Khronos Conformance Test Source License +Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" + +const char *sample_kernel_code_single_line[] = { + "__kernel void sample_test(__global float *src, __global int *dst)\n" + "{\n" + " int tid = get_global_id(0);\n" + "\n" + " dst[tid] = (int)src[tid];\n" + "\n" + "}\n" +}; + +TEST_SPIRV_FUNC(get_program_il) +{ + clProgramWrapper source_program; + size_t il_size = -1; + int error; + + /* If a program has been created with clCreateProgramWithIL, CL_PROGRAM_IL + * should return the program IL it was created with and it's size */ + if (gCoreILProgram || is_extension_available(deviceID, "cl_khr_il_program")) + { + clProgramWrapper il_program; + std::string spvStr = "op_function_none"; + const char *spvName = spvStr.c_str(); + + std::vector spirv_binary = readSPIRV(spvName); + + int file_bytes = spirv_binary.size(); + if (file_bytes == 0) + { + test_fail("ERROR: SPIRV file %s not found!\n", spvName); + } + + /* Create program with IL */ + unsigned char *spirv_buffer = &spirv_binary[0]; + + error = get_program_with_il(il_program, deviceID, context, spvName); + + SPIRV_CHECK_ERROR(error, "Unable to create program with IL."); + if (il_program == NULL) + { + test_fail("ERROR: Unable to create test program!\n"); + } + + /* Check program IL is the same as the source IL */ + unsigned char *buffer = new unsigned char[file_bytes]; + error = clGetProgramInfo(il_program, CL_PROGRAM_IL, file_bytes, buffer, + &il_size); + SPIRV_CHECK_ERROR(error, "Unable to get program info."); + + if (il_size != file_bytes) + { + test_fail("ERROR: Returned IL size is not the same as source IL " + "size (%lu " + "!= %lu)!\n", + il_size, file_bytes); + } + + if (memcmp(buffer, spirv_buffer, file_bytes) != 0) + { + test_fail("ERROR: Returned IL is not the same as source IL!\n"); + } + + delete[] buffer; + } + + /* CL_PROGRAM_IL shouldn't return IL value unless program is created with + * clCreateProgramWithIL */ + error = create_single_kernel_helper_create_program( + context, &source_program, 1, sample_kernel_code_single_line); + if (source_program == NULL) + { + test_fail("ERROR: Unable to create test program!\n"); + } + + if (gCompilationMode != kSpir_v) + { + error = + clGetProgramInfo(source_program, CL_PROGRAM_IL, 0, NULL, &il_size); + SPIRV_CHECK_ERROR(error, "Unable to get program il length"); + if (il_size != 0) + { + test_fail( + "ERROR: Returned length of non-IL program IL is non-zero!\n"); + } + } + + return 0; +} \ No newline at end of file diff --git a/test_conformance/spirv_new/test_linkage.cpp b/test_conformance/spirv_new/test_linkage.cpp new file mode 100644 index 00000000..cf518c3e --- /dev/null +++ b/test_conformance/spirv_new/test_linkage.cpp @@ -0,0 +1,143 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed h_in whole or h_in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited h_in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +h_in whole or h_in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +#include +#include + +static int test_linkage_compile(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *fname, + clProgramWrapper &prog) +{ + cl_int err = CL_SUCCESS; + std::vector buffer_vec = readSPIRV(fname); + + int file_bytes = buffer_vec.size(); + if (file_bytes == 0) { + log_error("File not found\n"); + return -1; + } + unsigned char *buffer = &buffer_vec[0]; + + if (gCoreILProgram) + { + prog = clCreateProgramWithIL(context, buffer, file_bytes, &err); + SPIRV_CHECK_ERROR( + err, "Failed to create program with clCreateProgramWithIL"); + } + else + { + cl_platform_id platform; + err = clGetDeviceInfo(deviceID, CL_DEVICE_PLATFORM, + sizeof(cl_platform_id), &platform, NULL); + SPIRV_CHECK_ERROR(err, + "Failed to get platform info with clGetDeviceInfo"); + clCreateProgramWithILKHR_fn clCreateProgramWithILKHR = NULL; + + clCreateProgramWithILKHR = (clCreateProgramWithILKHR_fn) + clGetExtensionFunctionAddressForPlatform( + platform, "clCreateProgramWithILKHR"); + if (clCreateProgramWithILKHR == NULL) + { + log_error( + "ERROR: clGetExtensionFunctionAddressForPlatform failed\n"); + return -1; + } + prog = clCreateProgramWithILKHR(context, buffer, file_bytes, &err); + SPIRV_CHECK_ERROR( + err, "Failed to create program with clCreateProgramWithILKHR"); + } + + err = clCompileProgram(prog, 1, &deviceID, + NULL, // options + 0, // num headers + NULL, // input headers + NULL, // header include names + NULL, // callback + NULL // User data + ); + SPIRV_CHECK_ERROR(err, "Failed to compile spv program"); + return 0; +} + +TEST_SPIRV_FUNC(linkage_export_function_compile) +{ + clProgramWrapper prog; + return test_linkage_compile(deviceID, context, queue, "linkage_export", prog); +} + +TEST_SPIRV_FUNC(linkage_import_function_compile) +{ + clProgramWrapper prog; + return test_linkage_compile(deviceID, context, queue, "linkage_import", prog); +} + +TEST_SPIRV_FUNC(linkage_import_function_link) +{ + int err = 0; + + clProgramWrapper prog_export; + err = test_linkage_compile(deviceID, context, queue, "linkage_export", prog_export); + SPIRV_CHECK_ERROR(err, "Failed to compile export program"); + + clProgramWrapper prog_import; + err = test_linkage_compile(deviceID, context, queue, "linkage_import", prog_import); + SPIRV_CHECK_ERROR(err, "Failed to compile import program"); + + cl_program progs[] = {prog_export, prog_import}; + + clProgramWrapper prog = clLinkProgram(context, 1, &deviceID, NULL, 2, progs, NULL, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to link programs"); + + clKernelWrapper kernel = clCreateKernel(prog, "test_linkage", &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + const int num = 1 << 20; + std::vector h_in(num); + RandomSeed seed(gRandomSeed); + for (int i = 0; i < num; i++) { + h_in[i] = genrand(seed); + } + + size_t bytes = sizeof(cl_float) * num; + clMemWrapper in = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create in buffer"); + + err = clEnqueueWriteBuffer(queue, in, CL_TRUE, 0, bytes, &h_in[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to in buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &in); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_out(num); + err = clEnqueueReadBuffer(queue, in, CL_TRUE, 0, bytes, &h_out[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read to output"); + + for (int i = 0; i < num; i++) { + if (h_out[i] != -h_in[i]) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + + return 0; +} diff --git a/test_conformance/spirv_new/test_op_atomic.cpp b/test_conformance/spirv_new/test_op_atomic.cpp new file mode 100644 index 00000000..e4b6feb1 --- /dev/null +++ b/test_conformance/spirv_new/test_op_atomic.cpp @@ -0,0 +1,99 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +template +int test_atomic(cl_device_id deviceID, cl_context context, + cl_command_queue queue, const char *name, + const int num, + bool is_inc) +{ + clProgramWrapper prog; + cl_int err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create kernel"); + + size_t bytes = num * sizeof(T); + clMemWrapper ctr_mem = clCreateBuffer(context, CL_MEM_READ_WRITE, sizeof(T), NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create buffer"); + + T initial, result; + + if (is_inc) { + initial = 0; + result = num; + } else { + initial = num; + result = 0; + } + + err = clEnqueueWriteBuffer(queue, ctr_mem, CL_TRUE, 0, sizeof(T), &initial, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to lhs buffer"); + + clMemWrapper val_mem = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &val_mem); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &ctr_mem); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue kernel"); + + T count = 0; + err = clEnqueueReadBuffer(queue, ctr_mem, CL_TRUE, 0, sizeof(T), &count, 0, NULL, NULL); + + if (count != result) { + log_error("Counter value does not match. Expected: %d, Found: %d\n", result, (int)count); + return -1; + } + + std::vector flags(num, 0); + std::vector locs(num, -1); + std::vector host(num); + err = clEnqueueReadBuffer(queue, val_mem, CL_TRUE, 0, bytes, &host[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy from cl_buffer"); + + for (int i = 0; i < num; i++) { + T idx = host[i] - (is_inc ? 0 : 1); + if (flags[idx] == 1) { + log_error("Atomic inc value is repeated at %d and %d\n", locs[idx], i); + return -1; + } else { + flags[idx] = 1; + locs[idx] = i; + } + } + return 0; +} + +TEST_SPIRV_FUNC(op_atomic_inc_global) +{ + int num = 1 << 16; + return test_atomic(deviceID, context, queue, + "atomic_inc_global", num, true); +} + +TEST_SPIRV_FUNC(op_atomic_dec_global) +{ + int num = 1 << 16; + return test_atomic(deviceID, context, queue, + "atomic_dec_global", num, false); +} diff --git a/test_conformance/spirv_new/test_op_branch.cpp b/test_conformance/spirv_new/test_op_branch.cpp new file mode 100644 index 00000000..ec61afd9 --- /dev/null +++ b/test_conformance/spirv_new/test_op_branch.cpp @@ -0,0 +1,82 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +template +int test_branch_simple(cl_device_id deviceID, cl_context context, + cl_command_queue queue, const char *name, + std::vector &results, + bool (*notEqual)(const T&, const T&) = isNotEqual) +{ + clProgramWrapper prog; + cl_int err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create kernel"); + + int num = (int)results.size(); + + size_t bytes = num * sizeof(T); + clMemWrapper in_mem = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create buffer"); + + err = clEnqueueWriteBuffer(queue, in_mem, CL_TRUE, 0, bytes, &results[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to lhs buffer"); + + clMemWrapper out_mem = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &in_mem); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &out_mem); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue kernel"); + + std::vector host(num); + err = clEnqueueReadBuffer(queue, out_mem, CL_TRUE, 0, bytes, &host[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy from cl_buffer"); + + for (int i = 0; i < num; i++) { + if (notEqual(host[i], results[i])) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +#define TEST_BRANCH_SIMPLE(NAME) \ + TEST_SPIRV_FUNC(op_##NAME##_simple) \ + { \ + RandomSeed seed(gRandomSeed); \ + int num = 1 << 10; \ + std::vector results(num); \ + for (int i = 0; i < num; i++) { \ + results[i] = genrand(seed); \ + } \ + return test_branch_simple(deviceID, context, queue, \ + #NAME "_simple", \ + results); \ + } \ + + +TEST_BRANCH_SIMPLE(label) +TEST_BRANCH_SIMPLE(branch) +TEST_BRANCH_SIMPLE(unreachable) diff --git a/test_conformance/spirv_new/test_op_branch_conditional.cpp b/test_conformance/spirv_new/test_op_branch_conditional.cpp new file mode 100644 index 00000000..ad94b824 --- /dev/null +++ b/test_conformance/spirv_new/test_op_branch_conditional.cpp @@ -0,0 +1,106 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +#include +#include + + +template +int test_branch_conditional(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *name, + const std::vector &h_lhs, + const std::vector &h_rhs, + const std::vector &h_ref) +{ + + cl_int err = CL_SUCCESS; + int num = (int)h_lhs.size(); + size_t bytes = num * sizeof(T); + + clMemWrapper lhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create lhs buffer"); + + err = clEnqueueWriteBuffer(queue, lhs, CL_TRUE, 0, bytes, &h_lhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to lhs buffer"); + + clMemWrapper rhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create rhs buffer"); + + err = clEnqueueWriteBuffer(queue, rhs, CL_TRUE, 0, bytes, &h_rhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to rhs buffer"); + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build spv program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + clMemWrapper res = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create res buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &res); + SPIRV_CHECK_ERROR(err, "Failed to set arg 0"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_res(num); + err = clEnqueueReadBuffer(queue, res, CL_TRUE, 0, bytes, &h_res[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + + for (int i = 0; i < num; i++) { + if (h_res[i] != h_ref[i]) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +#define TEST_BRANCH_CONDITIONAL(name) \ + TEST_SPIRV_FUNC(op_##name) \ + { \ + const int num = 1 << 10; \ + RandomSeed seed(gRandomSeed); \ + \ + std::vector lhs(num); \ + std::vector rhs(num); \ + std::vector out(num); \ + \ + for (int i = 0; i < num; i++) { \ + lhs[i] = genrand(seed); \ + rhs[i] = genrand(seed); \ + out[i] = lhs[i] < rhs[i] ? \ + (rhs[i] - lhs[i]) : (lhs[i] - rhs[i]); \ + } \ + \ + return test_branch_conditional(deviceID, context, queue, \ + #name, \ + lhs, rhs, out); \ + } \ + +TEST_BRANCH_CONDITIONAL(branch_conditional) +TEST_BRANCH_CONDITIONAL(branch_conditional_weighted) diff --git a/test_conformance/spirv_new/test_op_composite_construct.cpp b/test_conformance/spirv_new/test_op_composite_construct.cpp new file mode 100644 index 00000000..d07ebd3f --- /dev/null +++ b/test_conformance/spirv_new/test_op_composite_construct.cpp @@ -0,0 +1,74 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +template +int test_composite_construct(cl_device_id deviceID, cl_context context, + cl_command_queue queue, const char *name, + std::vector &results, + bool (*notEqual)(const T&, const T&) = isNotEqual) +{ + clProgramWrapper prog; + cl_int err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create kernel"); + + int num = (int)results.size(); + + size_t bytes = num * sizeof(T); + clMemWrapper mem = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &mem); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue kernel"); + + std::vector host(num); + err = clEnqueueReadBuffer(queue, mem, CL_TRUE, 0, bytes, &host[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy from cl_buffer"); + + for (int i = 0; i < num; i++) { + if (notEqual(host[i], results[i])) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +TEST_SPIRV_FUNC(op_composite_construct_int4) +{ + cl_int4 value = {123, 122, 121, 119}; + std::vector results(256, value); + return test_composite_construct(deviceID, context, queue, "composite_construct_int4", results); +} + +TEST_SPIRV_FUNC(op_composite_construct_struct) +{ + typedef AbstractStruct2 CustomType1; + typedef AbstractStruct2 CustomType2; + + CustomType1 value1 = {2100483600, 128}; + cl_int2 intvals = {2100480000, 2100480000}; + CustomType2 value2 = {intvals, value1}; + + std::vector results(256, value2); + return test_composite_construct(deviceID, context, queue, "composite_construct_struct", results); +} diff --git a/test_conformance/spirv_new/test_op_constant.cpp b/test_conformance/spirv_new/test_op_constant.cpp new file mode 100644 index 00000000..afffdc35 --- /dev/null +++ b/test_conformance/spirv_new/test_op_constant.cpp @@ -0,0 +1,147 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + + + +template +int test_constant(cl_device_id deviceID, cl_context context, + cl_command_queue queue, const char *name, + std::vector &results, + bool (*notEqual)(const T&, const T&) = isNotEqual) +{ + if(std::string(name).find("double") != std::string::npos) { + if(!is_extension_available(deviceID, "cl_khr_fp64")) { + log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); + return 0; + } + } + clProgramWrapper prog; + cl_int err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create kernel"); + + int num = (int)results.size(); + + size_t bytes = num * sizeof(T); + clMemWrapper mem = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &mem); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue kernel"); + + std::vector host(num); + err = clEnqueueReadBuffer(queue, mem, CL_TRUE, 0, bytes, &host[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy from cl_buffer"); + + for (int i = 0; i < num; i++) { + if (notEqual(host[i], results[i])) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +#define TEST_CONSTANT(NAME, type, value) \ + TEST_SPIRV_FUNC(op_constant_##NAME##_simple) \ + { \ + std::vector results(1024, (type)value); \ + return test_constant(deviceID, context, queue, \ + "constant_" #NAME "_simple", \ + results); \ + } \ + +// Boolean tests +TEST_CONSTANT(true , cl_int , 1 ) +TEST_CONSTANT(false , cl_int , 0 ) + +// Integer tests +TEST_CONSTANT(int , cl_int , 123 ) +TEST_CONSTANT(uint , cl_uint , 54321 ) +TEST_CONSTANT(char , cl_char , 20 ) +TEST_CONSTANT(uchar , cl_uchar , 19 ) +TEST_CONSTANT(ushort, cl_ushort, 65000 ) +TEST_CONSTANT(long , cl_long , 34359738368L ) +TEST_CONSTANT(ulong , cl_ulong , 9223372036854775810UL) + +#ifdef __GNUC__ +// std::vector is causing compilation errors on GCC 5.3 (works on gcc 4.8) +// Needs further investigation + TEST_CONSTANT(short , int16_t , 32000 ) +#else +TEST_CONSTANT(short , cl_short , 32000 ) +#endif + +// Float tests +TEST_CONSTANT(float , cl_float , 3.1415927 ) +TEST_CONSTANT(double , cl_double , 3.141592653589793) + +TEST_SPIRV_FUNC(op_constant_int4_simple) +{ + cl_int4 value = {123, 122, 121, 119}; + std::vector results(256, value); + return test_constant(deviceID, context, queue, "constant_int4_simple", results); +} + +TEST_SPIRV_FUNC(op_constant_int3_simple) +{ + cl_int3 value = {123, 122, 121, 0}; + std::vector results(256, value); + return test_constant(deviceID, context, queue, "constant_int3_simple", + results, isVectorNotEqual); +} + +TEST_SPIRV_FUNC(op_constant_struct_int_float_simple) +{ + AbstractStruct2 value = {1024, 3.1415}; + std::vector > results(256, value); + return test_constant(deviceID, context, queue, "constant_struct_int_float_simple", results); +} + +TEST_SPIRV_FUNC(op_constant_struct_int_char_simple) +{ + AbstractStruct2 value = {2100483600, 128}; + std::vector > results(256, value); + return test_constant(deviceID, context, queue, "constant_struct_int_char_simple", results); +} + +TEST_SPIRV_FUNC(op_constant_struct_struct_simple) +{ + typedef AbstractStruct2 CustomType1; + typedef AbstractStruct2 CustomType2; + + CustomType1 value1 = {2100483600, 128}; + cl_int2 intvals = {2100480000, 2100480000}; + CustomType2 value2 = {intvals, value1}; + + std::vector results(256, value2); + return test_constant(deviceID, context, queue, "constant_struct_struct_simple", results); +} + +TEST_SPIRV_FUNC(op_constant_half_simple) +{ + PASSIVE_REQUIRE_FP16_SUPPORT(deviceID); + std::vector results(1024, 3.25); + return test_constant(deviceID, context, queue, + "constant_half_simple", + results); +} diff --git a/test_conformance/spirv_new/test_op_copy_object.cpp b/test_conformance/spirv_new/test_op_copy_object.cpp new file mode 100644 index 00000000..b2b99955 --- /dev/null +++ b/test_conformance/spirv_new/test_op_copy_object.cpp @@ -0,0 +1,143 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + + + +template +int test_copy(cl_device_id deviceID, cl_context context, + cl_command_queue queue, const char *name, + std::vector &results, + bool (*notEqual)(const T&, const T&) = isNotEqual) +{ + if(std::string(name).find("double") != std::string::npos) { + if(!is_extension_available(deviceID, "cl_khr_fp64")) { + log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); + return 0; + } + } + clProgramWrapper prog; + cl_int err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create kernel"); + + int num = (int)results.size(); + + size_t bytes = num * sizeof(T); + clMemWrapper mem = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &mem); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue kernel"); + + std::vector host(num); + err = clEnqueueReadBuffer(queue, mem, CL_TRUE, 0, bytes, &host[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy from cl_buffer"); + + for (int i = 0; i < num; i++) { + if (notEqual(host[i], results[i])) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +#define TEST_COPY(NAME, type, value) \ + TEST_SPIRV_FUNC(op_copy_##NAME##_simple) \ + { \ + std::vector results(1024, (type)value); \ + return test_copy(deviceID, context, queue, \ + "copy_" #NAME "_simple", \ + results); \ + } \ + +// Integer tests +TEST_COPY(int , cl_int , 123 ) +TEST_COPY(uint , cl_uint , 54321 ) +TEST_COPY(char , cl_char , 20 ) +TEST_COPY(uchar , cl_uchar , 19 ) +TEST_COPY(ushort, cl_ushort, 65000 ) +TEST_COPY(long , cl_long , 34359738368L ) +TEST_COPY(ulong , cl_ulong , 9223372036854775810UL) + +#ifdef __GNUC__ +// std::vector is causing compilation errors on GCC 5.3 (works on gcc 4.8) +// Needs further investigation +TEST_COPY(short , int16_t , 32000 ) +#else +TEST_COPY(short , cl_short , 32000 ) +#endif + +// Float tests +TEST_COPY(float , cl_float , 3.1415927 ) +TEST_COPY(double , cl_double , 3.141592653589793) + +TEST_SPIRV_FUNC(op_copy_int4_simple) +{ + cl_int4 value = {123, 122, 121, 119}; + std::vector results(256, value); + return test_copy(deviceID, context, queue, "copy_int4_simple", results); +} + +TEST_SPIRV_FUNC(op_copy_int3_simple) +{ + cl_int3 value = {123, 122, 121, 0}; + std::vector results(256, value); + return test_copy(deviceID, context, queue, "copy_int3_simple", + results, isVectorNotEqual); +} + +TEST_SPIRV_FUNC(op_copy_struct_int_float_simple) +{ + AbstractStruct2 value = {1024, 3.1415}; + std::vector > results(256, value); + return test_copy(deviceID, context, queue, "copy_struct_int_float_simple", results); +} + +TEST_SPIRV_FUNC(op_copy_struct_int_char_simple) +{ + AbstractStruct2 value = {2100483600, 128}; + std::vector > results(256, value); + return test_copy(deviceID, context, queue, "copy_struct_int_char_simple", results); +} + +TEST_SPIRV_FUNC(op_copy_struct_struct_simple) +{ + typedef AbstractStruct2 CustomType1; + typedef AbstractStruct2 CustomType2; + + CustomType1 value1 = {2100483600, 128}; + cl_int2 intvals = {2100480000, 2100480000}; + CustomType2 value2 = {intvals, value1}; + + std::vector results(256, value2); + return test_copy(deviceID, context, queue, "copy_struct_struct_simple", results); +} + +TEST_SPIRV_FUNC(op_copy_half_simple) +{ + PASSIVE_REQUIRE_FP16_SUPPORT(deviceID); + std::vector results(1024, 3.25); + return test_copy(deviceID, context, queue, + "copy_half_simple", + results); +} diff --git a/test_conformance/spirv_new/test_op_fmath.cpp b/test_conformance/spirv_new/test_op_fmath.cpp new file mode 100644 index 00000000..7250eb15 --- /dev/null +++ b/test_conformance/spirv_new/test_op_fmath.cpp @@ -0,0 +1,201 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +#include +#include + +template +int test_fmath(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *spvName, + const char *funcName, + const char *Tname, + bool fast_math, + std::vector &h_lhs, + std::vector &h_rhs) +{ + + if(std::string(Tname).find("double") != std::string::npos) { + if(!is_extension_available(deviceID, "cl_khr_fp64")) { + log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); + return 0; + } + } + cl_int err = CL_SUCCESS; + int num = (int)h_lhs.size(); + size_t bytes = num * sizeof(T); + + clMemWrapper lhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create lhs buffer"); + + err = clEnqueueWriteBuffer(queue, lhs, CL_TRUE, 0, bytes, &h_lhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to lhs buffer"); + + clMemWrapper rhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create rhs buffer"); + + err = clEnqueueWriteBuffer(queue, rhs, CL_TRUE, 0, bytes, &h_rhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to rhs buffer"); + + std::string kernelStr; + + { + std::stringstream kernelStream; + + if (is_double::value) { + kernelStream << "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n"; + } else if (sizeof(T) == sizeof(cl_half)) { + kernelStream << "#pragma OPENCL EXTENSION cl_khr_fp16 : enable\n"; + } + + kernelStream << "#define spirv_fadd(a, b) (a) + (b) \n"; + kernelStream << "#define spirv_fsub(a, b) (a) - (b) \n"; + kernelStream << "#define spirv_fmul(a, b) (a) * (b) \n"; + kernelStream << "#define spirv_fdiv(a, b) (a) / (b) \n"; + kernelStream << "#define spirv_frem(a, b) fmod(a, b) \n"; + kernelStream << "#define spirv_fmod(a, b) copysign(fmod(a,b),b) \n"; + kernelStream << "#define T " << Tname << "\n"; + kernelStream << "#define FUNC spirv_" << funcName << "\n"; + kernelStream << "__kernel void fmath_cl(__global T *out, \n"; + kernelStream << "const __global T *lhs, const __global T *rhs) \n"; + kernelStream << "{ \n"; + kernelStream << " int id = get_global_id(0); \n"; + kernelStream << " out[id] = FUNC(lhs[id], rhs[id]); \n"; + kernelStream << "} \n"; + kernelStr = kernelStream.str(); + } + + size_t kernelLen = kernelStr.size(); + const char *kernelBuf = kernelStr.c_str(); + + const char *options = fast_math ? "-cl-fast-relaxed-math" : NULL; + + std::vector h_ref(num); + + { + // Run the cl kernel for reference results + clProgramWrapper prog; + err = create_single_kernel_helper_create_program(context, &prog, 1, &kernelBuf, NULL); + SPIRV_CHECK_ERROR(err, "Failed to create cl program"); + + err = clBuildProgram(prog, 1, &deviceID, NULL, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, "fmath_cl", &err); + SPIRV_CHECK_ERROR(err, "Failed to create cl kernel"); + + clMemWrapper ref = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create ref buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &ref); + SPIRV_CHECK_ERROR(err, "Failed to set arg 0"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + err = clEnqueueReadBuffer(queue, ref, CL_TRUE, 0, bytes, &h_ref[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + } + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, spvName); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, "fmath_spv", &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + clMemWrapper res = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create res buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &res); + SPIRV_CHECK_ERROR(err, "Failed to set arg 0"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_res(num); + err = clEnqueueReadBuffer(queue, res, CL_TRUE, 0, bytes, &h_res[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + + for (int i = 0; i < num; i++) { + if (h_res[i] != h_ref[i]) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +#define TEST_FMATH_FUNC(TYPE, FUNC, MODE) \ + TEST_SPIRV_FUNC(op_##FUNC##_##TYPE##_##MODE) \ + { \ + if (sizeof(cl_##TYPE) == 2) { \ + PASSIVE_REQUIRE_FP16_SUPPORT(deviceID); \ + } \ + const int num = 1 << 20; \ + std::vector lhs(num); \ + std::vector rhs(num); \ + \ + RandomSeed seed(gRandomSeed); \ + \ + for (int i = 0; i < num; i++) { \ + lhs[i] = genrandReal(seed); \ + rhs[i] = genrandReal(seed); \ + } \ + \ + const char *mode = #MODE; \ + return test_fmath(deviceID, context, queue, \ + #FUNC "_" #TYPE, \ + #FUNC, \ + #TYPE, \ + mode[0] == 'f', \ + lhs, rhs); \ + } + +#define TEST_FMATH_MODE(TYPE, MODE) \ + TEST_FMATH_FUNC(TYPE, fadd, MODE) \ + TEST_FMATH_FUNC(TYPE, fsub, MODE) \ + TEST_FMATH_FUNC(TYPE, fmul, MODE) \ + TEST_FMATH_FUNC(TYPE, fdiv, MODE) \ + TEST_FMATH_FUNC(TYPE, frem, MODE) \ + TEST_FMATH_FUNC(TYPE, fmod, MODE) \ + +#define TEST_FMATH_TYPE(TYPE) \ + TEST_FMATH_MODE(TYPE, regular) \ + TEST_FMATH_MODE(TYPE, fast) \ + +TEST_FMATH_TYPE(float) +TEST_FMATH_TYPE(double) + +TEST_FMATH_TYPE(float4) +TEST_FMATH_TYPE(double2) + +TEST_FMATH_TYPE(half) diff --git a/test_conformance/spirv_new/test_op_function.cpp b/test_conformance/spirv_new/test_op_function.cpp new file mode 100644 index 00000000..caa3e0d3 --- /dev/null +++ b/test_conformance/spirv_new/test_op_function.cpp @@ -0,0 +1,89 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +#include +#include + +int test_function(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *funcType, + const std::vector &h_in) +{ + cl_int err = CL_SUCCESS; + int num = (int)h_in.size(); + size_t bytes = sizeof(float) * num; + + clMemWrapper in = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create in buffer"); + + err = clEnqueueWriteBuffer(queue, in, CL_TRUE, 0, bytes, &h_in[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to in buffer"); + + cl_uint bits = sizeof(void *) * 8; + std::string spvStr = std::string("op_function") + "_" + std::string(funcType); + const char *spvName = spvStr.c_str(); + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, spvName); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, spvName, &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &in); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_out(num); + err = clEnqueueReadBuffer(queue, in, CL_TRUE, 0, bytes, &h_out[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + + for (int i = 0; i < num; i++) { + if (h_out[i] != -h_in[i]) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + + +#define TEST_FUNCTION(TYPE) \ + TEST_SPIRV_FUNC(function_##TYPE) \ + { \ + int num = 1 << 20; \ + std::vector in(num); \ + RandomSeed seed(gRandomSeed); \ + for (int i = 0; i < num; i++) { \ + in[i] = genrand(seed); \ + } \ + return test_function(deviceID, \ + context, \ + queue, \ + #TYPE, \ + in); \ + } \ + +TEST_FUNCTION(none) +TEST_FUNCTION(inline) +TEST_FUNCTION(noinline) +TEST_FUNCTION(pure) +TEST_FUNCTION(const) +TEST_FUNCTION(pure_ptr) diff --git a/test_conformance/spirv_new/test_op_lifetime.cpp b/test_conformance/spirv_new/test_op_lifetime.cpp new file mode 100644 index 00000000..b60e14d6 --- /dev/null +++ b/test_conformance/spirv_new/test_op_lifetime.cpp @@ -0,0 +1,104 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +#include +#include + + +template +int test_op_lifetime(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *name, + const std::vector &h_lhs, + const std::vector &h_rhs, + const std::vector &h_ref) +{ + + cl_int err = CL_SUCCESS; + int num = (int)h_lhs.size(); + size_t bytes = num * sizeof(T); + + clMemWrapper lhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create lhs buffer"); + + err = clEnqueueWriteBuffer(queue, lhs, CL_TRUE, 0, bytes, &h_lhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to lhs buffer"); + + clMemWrapper rhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create rhs buffer"); + + err = clEnqueueWriteBuffer(queue, rhs, CL_TRUE, 0, bytes, &h_rhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to rhs buffer"); + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + clMemWrapper res = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create res buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &res); + SPIRV_CHECK_ERROR(err, "Failed to set arg 0"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_res(num); + err = clEnqueueReadBuffer(queue, res, CL_TRUE, 0, bytes, &h_res[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + + for (int i = 0; i < num; i++) { + if (h_res[i] != h_ref[i]) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +#define TEST_LIFETIME(name) \ + TEST_SPIRV_FUNC(op_##name) \ + { \ + const int num = 1 << 10; \ + RandomSeed seed(gRandomSeed); \ + \ + std::vector lhs(num); \ + std::vector rhs(num); \ + std::vector out(num); \ + \ + for (int i = 0; i < num; i++) { \ + lhs[i] = genrand(seed); \ + rhs[i] = genrand(seed); \ + out[i] = lhs[i] - rhs[i]; \ + } \ + \ + return test_op_lifetime(deviceID, context, queue, \ + #name, \ + lhs, rhs, out); \ + } \ + +TEST_LIFETIME(lifetime_simple) diff --git a/test_conformance/spirv_new/test_op_loop_merge.cpp b/test_conformance/spirv_new/test_op_loop_merge.cpp new file mode 100644 index 00000000..23d257d9 --- /dev/null +++ b/test_conformance/spirv_new/test_op_loop_merge.cpp @@ -0,0 +1,113 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +#include +#include + + +template +int test_selection_merge(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *name, + const std::vector &h_in, + const std::vector &h_ref, + const int rep) +{ + + cl_int err = CL_SUCCESS; + int num = (int)h_ref.size(); + size_t bytes = num * sizeof(T); + size_t in_bytes = rep * bytes; + + clMemWrapper in = clCreateBuffer(context, CL_MEM_READ_ONLY, in_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create in buffer"); + + err = clEnqueueWriteBuffer(queue, in, CL_TRUE, 0, in_bytes, &h_in[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to in buffer"); + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + clMemWrapper out = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create out buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &out); + SPIRV_CHECK_ERROR(err, "Failed to set arg 0"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &in); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 2, sizeof(int), &rep); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + err = clSetKernelArg(kernel, 3, sizeof(int), &num); + SPIRV_CHECK_ERROR(err, "Failed to set arg 3"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_out(num); + err = clEnqueueReadBuffer(queue, out, CL_TRUE, 0, bytes, &h_out[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + + for (int i = 0; i < num; i++) { + if (h_out[i] != h_ref[i]) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +#define TEST_LOOP_BRANCH(control) \ + TEST_SPIRV_FUNC(op_loop_merge_branch_##control) \ + { \ + const int num = 1 << 10; \ + RandomSeed seed(gRandomSeed); \ + \ + int rep = 4; \ + std::vector in(rep * num); \ + std::vector out(num); \ + \ + for (int i = 0; i < num; i++) { \ + int res = 0; \ + for (int j = 0; j < rep; j++) { \ + cl_int val = genrand(seed) % 1024; \ + res += val; \ + in[j * num + i] = val; \ + } \ + out[i] = res; \ + } \ + \ + return test_selection_merge(deviceID, context, queue, \ + "loop_merge_branch_" #control, \ + in, out, rep); \ + } \ + +TEST_LOOP_BRANCH(none) +TEST_LOOP_BRANCH(unroll) +TEST_LOOP_BRANCH(dont_unroll) + + +TEST_LOOP_BRANCH(conditional_none) +TEST_LOOP_BRANCH(conditional_unroll) +TEST_LOOP_BRANCH(conditional_dont_unroll) diff --git a/test_conformance/spirv_new/test_op_negate.cpp b/test_conformance/spirv_new/test_op_negate.cpp new file mode 100644 index 00000000..1891c9bb --- /dev/null +++ b/test_conformance/spirv_new/test_op_negate.cpp @@ -0,0 +1,119 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +#include +#include + +template +int test_negation(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *Tname, + const char *funcName, + const std::vector &h_in, + Tv (*negate)(Tv) = negOp) +{ + if(std::string(Tname).find("double") != std::string::npos) { + if(!is_extension_available(deviceID, "cl_khr_fp64")) { + log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); + return 0; + } + } + + cl_int err = CL_SUCCESS; + int num = (int)h_in.size(); + size_t bytes = sizeof(Tv) * num; + + clMemWrapper in = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create in buffer"); + + err = clEnqueueWriteBuffer(queue, in, CL_TRUE, 0, bytes, &h_in[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to in buffer"); + + cl_uint bits = sizeof(void *) * 8; + std::string spvStr = std::string(funcName) + "_" + std::string(Tname); + const char *spvName = spvStr.c_str(); + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, spvName); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, spvName, &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &in); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_out(num); + err = clEnqueueReadBuffer(queue, in, CL_TRUE, 0, bytes, &h_out[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + + for (int i = 0; i < num; i++) { + if (h_out[i] != negate(h_in[i])) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +#define TEST_NEGATION(TYPE, Tv, OP, FUNC) \ + TEST_SPIRV_FUNC(OP##_##TYPE) \ + { \ + int num = 1 << 20; \ + std::vector in(num); \ + RandomSeed seed(gRandomSeed); \ + for (int i = 0; i < num; i++) { \ + in[i] = genrand(seed); \ + } \ + return test_negation(deviceID, \ + context, \ + queue, \ + #TYPE, \ + #OP, \ + in, FUNC); \ + } \ + + +#define TEST_NEG(TYPE) TEST_NEGATION(TYPE, cl_##TYPE, op_neg, negOp) +#define TEST_NOT(TYPE) TEST_NEGATION(TYPE, cl_##TYPE, op_not, notOp) +#define TEST_NEG_VEC(TYPE, N) TEST_NEGATION(TYPE##N, cl_##TYPE##N, op_neg, (negOpVec)) +#define TEST_NOT_VEC(TYPE, N) TEST_NEGATION(TYPE##N, cl_##TYPE##N, op_not, (notOpVec)) + +TEST_NEG(float) +TEST_NEG(double) +TEST_NEG(int) +TEST_NEG(long) +TEST_NOT(int) +TEST_NOT(long) + +#ifdef __GNUC__ +// std::vector is causing compilation errors on GCC 5.3 (works on gcc 4.8) +// Needs further investigation +TEST_NEGATION(short, short, op_neg, negOp) +TEST_NEGATION(short, short, op_not, notOp) +#else +TEST_NEG(short) +TEST_NOT(short) +#endif + +TEST_NEG_VEC(float , 4) +TEST_NEG_VEC(int , 4) +TEST_NOT_VEC(int , 4) diff --git a/test_conformance/spirv_new/test_op_opaque.cpp b/test_conformance/spirv_new/test_op_opaque.cpp new file mode 100644 index 00000000..067d9e4e --- /dev/null +++ b/test_conformance/spirv_new/test_op_opaque.cpp @@ -0,0 +1,72 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +TEST_SPIRV_FUNC(op_type_opaque_simple) +{ + const char *name = "opaque"; + int num = (int)(1 << 10); + cl_int err = CL_SUCCESS; + std::vector buffer_vec = readSPIRV(name); + + int file_bytes = buffer_vec.size(); + if (file_bytes == 0) { + log_error("File not found\n"); + return -1; + } + unsigned char *buffer = &buffer_vec[0]; + + clProgramWrapper prog; + + if (gCoreILProgram) + { + prog = clCreateProgramWithIL(context, buffer, file_bytes, &err); + SPIRV_CHECK_ERROR( + err, "Failed to create program with clCreateProgramWithIL"); + } + else + { + cl_platform_id platform; + err = clGetDeviceInfo(deviceID, CL_DEVICE_PLATFORM, + sizeof(cl_platform_id), &platform, NULL); + SPIRV_CHECK_ERROR(err, + "Failed to get platform info with clGetDeviceInfo"); + clCreateProgramWithILKHR_fn clCreateProgramWithILKHR = NULL; + + clCreateProgramWithILKHR = (clCreateProgramWithILKHR_fn) + clGetExtensionFunctionAddressForPlatform( + platform, "clCreateProgramWithILKHR"); + if (clCreateProgramWithILKHR == NULL) + { + log_error( + "ERROR: clGetExtensionFunctionAddressForPlatform failed\n"); + return -1; + } + prog = clCreateProgramWithILKHR(context, buffer, file_bytes, &err); + SPIRV_CHECK_ERROR( + err, "Failed to create program with clCreateProgramWithILKHR"); + } + + err = clCompileProgram(prog, 1, &deviceID, + NULL, // options + 0, // num headers + NULL, // input headers + NULL, // header include names + NULL, // callback + NULL // User data + ); + SPIRV_CHECK_ERROR(err, "Failed to compile spv program"); + return 0; +} diff --git a/test_conformance/spirv_new/test_op_phi.cpp b/test_conformance/spirv_new/test_op_phi.cpp new file mode 100644 index 00000000..f9c69d79 --- /dev/null +++ b/test_conformance/spirv_new/test_op_phi.cpp @@ -0,0 +1,143 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +#include +#include + + +template +int test_phi(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *name, + const std::vector &h_lhs, + const std::vector &h_rhs, + const std::vector &h_ref) +{ + + cl_int err = CL_SUCCESS; + int num = (int)h_lhs.size(); + size_t bytes = num * sizeof(T); + + clMemWrapper lhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create lhs buffer"); + + err = clEnqueueWriteBuffer(queue, lhs, CL_TRUE, 0, bytes, &h_lhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to lhs buffer"); + + clMemWrapper rhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create rhs buffer"); + + err = clEnqueueWriteBuffer(queue, rhs, CL_TRUE, 0, bytes, &h_rhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to rhs buffer"); + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + clMemWrapper res = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create res buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &res); + SPIRV_CHECK_ERROR(err, "Failed to set arg 0"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_res(num); + err = clEnqueueReadBuffer(queue, res, CL_TRUE, 0, bytes, &h_res[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + + for (int i = 0; i < num; i++) { + if (h_res[i] != h_ref[i]) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +TEST_SPIRV_FUNC(op_phi_2_blocks) +{ + const int num = 1 << 10; + RandomSeed seed(gRandomSeed); + + std::vector lhs(num); + std::vector rhs(num); + std::vector out(num); + + for (int i = 0; i < num; i++) { + lhs[i] = genrand(seed); + rhs[i] = genrand(seed); + out[i] = lhs[i] < rhs[i] ? (rhs[i] - lhs[i]) : (lhs[i] - rhs[i]); + } + + return test_phi(deviceID, context, queue, "phi_2", lhs, rhs, out); +} + +TEST_SPIRV_FUNC(op_phi_3_blocks) +{ + const int num = 1 << 10; + RandomSeed seed(gRandomSeed); + + std::vector lhs(num); + std::vector rhs(num); + std::vector out(num); + + for (int i = 0; i < num; i++) { + lhs[i] = genrand(seed); + rhs[i] = genrand(seed); + if (lhs[i] < rhs[i]) { + out[i] = lhs[i] < 0 ? -lhs[i] : lhs[i]; + } else { + out[i] = lhs[i] - rhs[i]; + } + } + + return test_phi(deviceID, context, queue, "phi_3", lhs, rhs, out); +} + +TEST_SPIRV_FUNC(op_phi_4_blocks) +{ + const int num = 1 << 10; + RandomSeed seed(gRandomSeed); + + std::vector lhs(num); + std::vector rhs(num); + std::vector out(num); + + for (int i = 0; i < num; i++) { + lhs[i] = genrand(seed); + rhs[i] = genrand(seed); + if (lhs[i] < rhs[i]) { + out[i] = lhs[i] < 0 ? -lhs[i] : lhs[i]; + } else { + out[i] = rhs[i] < 0 ? -rhs[i] : rhs[i]; + } + } + + return test_phi(deviceID, context, queue, "phi_4", lhs, rhs, out); +} diff --git a/test_conformance/spirv_new/test_op_selection_merge.cpp b/test_conformance/spirv_new/test_op_selection_merge.cpp new file mode 100644 index 00000000..6ea47f35 --- /dev/null +++ b/test_conformance/spirv_new/test_op_selection_merge.cpp @@ -0,0 +1,132 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +#include +#include + + +template +int test_selection_merge(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *name, + const std::vector &h_lhs, + const std::vector &h_rhs, + const std::vector &h_ref) +{ + + cl_int err = CL_SUCCESS; + int num = (int)h_lhs.size(); + size_t bytes = num * sizeof(T); + + clMemWrapper lhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create lhs buffer"); + + err = clEnqueueWriteBuffer(queue, lhs, CL_TRUE, 0, bytes, &h_lhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to lhs buffer"); + + clMemWrapper rhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create rhs buffer"); + + err = clEnqueueWriteBuffer(queue, rhs, CL_TRUE, 0, bytes, &h_rhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to rhs buffer"); + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + clMemWrapper res = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create res buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &res); + SPIRV_CHECK_ERROR(err, "Failed to set arg 0"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_res(num); + err = clEnqueueReadBuffer(queue, res, CL_TRUE, 0, bytes, &h_res[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + + for (int i = 0; i < num; i++) { + if (h_res[i] != h_ref[i]) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +#define TEST_SELECT_IF(control) \ + TEST_SPIRV_FUNC(op_selection_merge_if_##control) \ + { \ + const int num = 1 << 10; \ + RandomSeed seed(gRandomSeed); \ + \ + std::vector lhs(num); \ + std::vector rhs(num); \ + std::vector out(num); \ + \ + for (int i = 0; i < num; i++) { \ + lhs[i] = genrand(seed); \ + rhs[i] = genrand(seed); \ + out[i] = lhs[i] < rhs[i] ? \ + (rhs[i] - lhs[i]) : (lhs[i] - rhs[i]); \ + } \ + \ + return test_selection_merge(deviceID, context, queue, \ + "select_if_" #control, \ + lhs, rhs, out); \ + } \ + +TEST_SELECT_IF(none) +TEST_SELECT_IF(flatten) +TEST_SELECT_IF(dont_flatten) + +#define TEST_SELECT_SWITCH(control) \ + TEST_SPIRV_FUNC(op_selection_merge_swith_##control) \ + { \ + const int num = 1 << 10; \ + RandomSeed seed(gRandomSeed); \ + \ + std::vector lhs(num); \ + std::vector rhs(num); \ + std::vector out(num); \ + \ + for (int i = 0; i < num; i++) { \ + lhs[i] = genrand(seed); \ + rhs[i] = genrand(seed); \ + out[i] = (lhs[i] + rhs[i]) % 4; \ + } \ + \ + return test_selection_merge(deviceID, context, queue, \ + "select_switch_" #control, \ + lhs, rhs, out); \ + } \ + +TEST_SELECT_SWITCH(none) +TEST_SELECT_SWITCH(flatten) +TEST_SELECT_SWITCH(dont_flatten) diff --git a/test_conformance/spirv_new/test_op_spec_constant.cpp b/test_conformance/spirv_new/test_op_spec_constant.cpp new file mode 100644 index 00000000..a280a4f7 --- /dev/null +++ b/test_conformance/spirv_new/test_op_spec_constant.cpp @@ -0,0 +1,157 @@ +/****************************************************************** +Copyright (c) 2020 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to +the Khronos Group, Inc. This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not +be disclosed in whole or in part to third parties, and may not be reproduced, +republished, distributed, transmitted, displayed, broadcast or otherwise +exploited in any manner without the express prior written permission of Khronos +Group. The receipt or possession of this code does not convey any rights to +reproduce, disclose, or distribute its contents, or to manufacture, use, or sell +anything that it may describe, in whole or in part other than under the terms of +the Khronos Adopters Agreement or Khronos Conformance Test Source License +Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + + +template +int run_case(cl_device_id deviceID, cl_context context, cl_command_queue queue, + const char *name, T init_buffer, T spec_constant_value, + T final_value, bool use_spec_constant) +{ + clProgramWrapper prog; + cl_int err = CL_SUCCESS; + if (use_spec_constant) + { + spec_const new_spec_const = + spec_const(101, sizeof(T), &spec_constant_value); + + err = + get_program_with_il(prog, deviceID, context, name, new_spec_const); + } + else + { + err = get_program_with_il(prog, deviceID, context, name); + } + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, "spec_const_kernel", &err); + SPIRV_CHECK_ERROR(err, "Failed to create kernel"); + size_t bytes = sizeof(T); + clMemWrapper output_buffer = + clCreateBuffer(context, CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR, bytes, + &init_buffer, &err); + SPIRV_CHECK_ERROR(err, "Failed to create output_buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(clMemWrapper), &output_buffer); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument output_buffer"); + + size_t work_size = 1; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &work_size, NULL, 0, + NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue kernel"); + + T device_results = 0; + err = clEnqueueReadBuffer(queue, output_buffer, CL_TRUE, 0, bytes, + &device_results, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy from output_buffer"); + T reference = 0; + use_spec_constant ? reference = final_value : reference = init_buffer; + if (device_results != reference) + { + log_error("Values do not match. Expected %d obtained %d\n", reference, + device_results); + err = -1; + } + return err; +} + +template +int test_spec_constant(cl_device_id deviceID, cl_context context, + cl_command_queue queue, const char *name, T init_buffer, + T spec_constant_value, T final_value) +{ + if (std::string(name).find("double") != std::string::npos) + { + if (!is_extension_available(deviceID, "cl_khr_fp64")) + { + log_info("Extension cl_khr_fp64 not supported; skipping double " + "tests.\n"); + return TEST_SKIPPED_ITSELF; + } + } + if (std::string(name).find("half") != std::string::npos) + { + if (!is_extension_available(deviceID, "cl_khr_fp16")) + { + log_info("Extension cl_khr_fp16 not supported; skipping half " + "tests.\n"); + return TEST_SKIPPED_ITSELF; + } + } + cl_int err = CL_SUCCESS; + err = run_case(deviceID, context, queue, name, init_buffer, + spec_constant_value, final_value, false); + err |= run_case(deviceID, context, queue, name, init_buffer, + spec_constant_value, final_value, true); + + if (err == CL_SUCCESS) + { + return TEST_PASS; + } + else + { + return TEST_FAIL; + } +} + + +#define TEST_SPEC_CONSTANT(NAME, type, init_buffer, spec_constant_value) \ + TEST_SPIRV_FUNC_VERSION(op_spec_constant_##NAME##_simple, Version(2, 2)) \ + { \ + type init_value = init_buffer; \ + type final_value = init_value + spec_constant_value; \ + return test_spec_constant( \ + deviceID, context, queue, "op_spec_constant_" #NAME "_simple", \ + init_value, (type)spec_constant_value, final_value); \ + } + +// type name, type, value init, spec constant value +TEST_SPEC_CONSTANT(uint, cl_uint, 25, 43) +TEST_SPEC_CONSTANT(uchar, cl_uchar, 19, 4) +TEST_SPEC_CONSTANT(ushort, cl_ushort, 6000, 3000) +TEST_SPEC_CONSTANT(ulong, cl_ulong, 9223372036854775000UL, 200) +TEST_SPEC_CONSTANT(float, cl_float, 1.5, -3.7) +TEST_SPEC_CONSTANT(half, cl_half, 1, 2) +TEST_SPEC_CONSTANT(double, cl_double, 14534.53453, 1.53453) + +// Boolean tests +// documenation: 'If a specialization constant is a boolean +// constant, spec_value should be a pointer to a cl_uchar value' + +TEST_SPIRV_FUNC_VERSION(op_spec_constant_true_simple, Version(2, 2)) +{ + // 1-st ndrange init_value is expected value (no change) + // 2-nd ndrange sets spec const to 'false' so value = value + 1 + cl_uchar value = (cl_uchar)7; + cl_uchar init_value = value; + cl_uchar final_value = value + 1; + return test_spec_constant(deviceID, context, queue, + "op_spec_constant_true_simple", + init_value, 0, final_value); +} + +TEST_SPIRV_FUNC_VERSION(op_spec_constant_false_simple, Version(2, 2)) +{ + // 1-st ndrange init_value is expected value (no change) + // 2-nd ndrange sets spec const to 'true' so value = value + 1 + cl_uchar value = (cl_uchar)7; + cl_uchar init_value = value; + cl_uchar final_value = value + 1; + return test_spec_constant(deviceID, context, queue, + "op_spec_constant_false_simple", + init_value, 1, final_value); +} diff --git a/test_conformance/spirv_new/test_op_undef.cpp b/test_conformance/spirv_new/test_op_undef.cpp new file mode 100644 index 00000000..659ab1a9 --- /dev/null +++ b/test_conformance/spirv_new/test_op_undef.cpp @@ -0,0 +1,116 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + + + +template +int test_undef(cl_device_id deviceID, cl_context context, + cl_command_queue queue, const char *name) +{ + if(std::string(name).find("double") != std::string::npos) { + if(!is_extension_available(deviceID, "cl_khr_fp64")) { + log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); + return 0; + } + } + int num = (int)(1 << 10); + cl_int err = CL_SUCCESS; + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create kernel"); + + size_t bytes = num * sizeof(T); + clMemWrapper mem = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &mem); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue kernel"); + + std::vector host(num); + err = clEnqueueReadBuffer(queue, mem, CL_TRUE, 0, bytes, &host[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy from cl_buffer"); + + return 0; +} + +#define TEST_UNDEF(NAME, TYPE) \ + TEST_SPIRV_FUNC(op_undef_##NAME##_simple) \ + { \ + return test_undef(deviceID, context, queue, \ + "undef_" #NAME "_simple"); \ + } \ + +// Boolean tests +TEST_UNDEF(true , cl_int ) +TEST_UNDEF(false , cl_int ) + +// Integer tests +TEST_UNDEF(int , cl_int ) +TEST_UNDEF(uint , cl_uint ) +TEST_UNDEF(char , cl_char ) +TEST_UNDEF(uchar , cl_uchar) +TEST_UNDEF(ushort, cl_ushort) +TEST_UNDEF(long , cl_long ) +TEST_UNDEF(ulong , cl_ulong) + +#ifdef __GNUC__ +// std::vector is causing compilation errors on GCC 5.3 (works on gcc 4.8) +// Needs further investigation +TEST_UNDEF(short , int16_t ) +#else +TEST_UNDEF(short , cl_short) +#endif + +// Float tests +TEST_UNDEF(float , cl_float) +TEST_UNDEF(double, cl_double) +TEST_UNDEF(int4 , cl_int4) +TEST_UNDEF(int3 , cl_int3) + + +TEST_SPIRV_FUNC(op_undef_struct_int_float_simple) +{ + typedef AbstractStruct2 CustomType; + return test_undef(deviceID, context, queue, "undef_struct_int_float_simple"); +} + +TEST_SPIRV_FUNC(op_undef_struct_int_char_simple) +{ + typedef AbstractStruct2 CustomType; + return test_undef(deviceID, context, queue, "undef_struct_int_char_simple"); +} + +TEST_SPIRV_FUNC(op_undef_struct_struct_simple) +{ + typedef AbstractStruct2 CustomType1; + typedef AbstractStruct2 CustomType2; + return test_undef(deviceID, context, queue, "undef_struct_struct_simple"); +} + +TEST_SPIRV_FUNC(op_undef_half_simple) +{ + PASSIVE_REQUIRE_FP16_SUPPORT(deviceID); + return test_undef(deviceID, context, queue, + "undef_half_simple"); +} diff --git a/test_conformance/spirv_new/test_op_vector_extract.cpp b/test_conformance/spirv_new/test_op_vector_extract.cpp new file mode 100644 index 00000000..fe1f8253 --- /dev/null +++ b/test_conformance/spirv_new/test_op_vector_extract.cpp @@ -0,0 +1,104 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +template +int test_extract(cl_device_id deviceID, cl_context context, + cl_command_queue queue, const char *name, + const std::vector &h_in, const int n) +{ + if(std::string(name).find("double") != std::string::npos) { + if(!is_extension_available(deviceID, "cl_khr_fp64")) { + log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); + return 0; + } + } + cl_int err = CL_SUCCESS; + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create kernel"); + + int num = (int)h_in.size(); + std::vector h_out(num); + + size_t in_bytes = num * sizeof(Tv); + clMemWrapper in = clCreateBuffer(context, CL_MEM_READ_WRITE, in_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create buffer"); + + err = clEnqueueWriteBuffer(queue, in, CL_TRUE, 0, in_bytes, &h_in[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to rhs buffer"); + + size_t out_bytes = num * sizeof(Ts); + clMemWrapper out = clCreateBuffer(context, CL_MEM_READ_WRITE, out_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &in); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &out); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + for (int k = 0; k < n; k++) { + + err = clSetKernelArg(kernel, 2, sizeof(int), &k); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue kernel"); + + err = clEnqueueReadBuffer(queue, out, CL_TRUE, 0, out_bytes, &h_out[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy from cl_buffer"); + + for (int i = 0; i < num; i++) { + if (h_out[i] != h_in[i].s[k]) { + log_error("Values do not match at location %d for vector position %d\n", i, k); + return -1; + } + } + } + return 0; +} + +#define TEST_VECTOR_EXTRACT(TYPE, N) \ + TEST_SPIRV_FUNC(op_vector_##TYPE##N##_extract) \ + { \ + typedef cl_##TYPE##N Tv; \ + typedef cl_##TYPE Ts; \ + const int num = 1 << 20; \ + std::vector in(num); \ + const char *name = "vector_" #TYPE #N "_extract"; \ + \ + RandomSeed seed(gRandomSeed); \ + \ + for (int i = 0; i < num; i++) { \ + in[i] = genrand(seed); \ + } \ + \ + return test_extract(deviceID, \ + context, queue, \ + name, \ + in, N); \ + } + +TEST_VECTOR_EXTRACT(int, 4) +TEST_VECTOR_EXTRACT(float, 4) +TEST_VECTOR_EXTRACT(long, 2) +TEST_VECTOR_EXTRACT(double, 2) +TEST_VECTOR_EXTRACT(char, 16) diff --git a/test_conformance/spirv_new/test_op_vector_insert.cpp b/test_conformance/spirv_new/test_op_vector_insert.cpp new file mode 100644 index 00000000..0749c14a --- /dev/null +++ b/test_conformance/spirv_new/test_op_vector_insert.cpp @@ -0,0 +1,122 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +template +int test_insert(cl_device_id deviceID, cl_context context, + cl_command_queue queue, const char *name, + const std::vector &h_in, const int n) +{ + if(std::string(name).find("double") != std::string::npos) { + if(!is_extension_available(deviceID, "cl_khr_fp64")) { + log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); + return 0; + } + } + cl_int err = CL_SUCCESS; + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create kernel"); + + int num = (int)h_in.size(); + std::vector h_ref(num); + std::vector h_out(num); + + RandomSeed seed(gRandomSeed); + for (int i = 0; i < num; i++) { + for (int j = 0; j < n; j++) { + h_ref[i].s[j] = h_in[i] + genrand(seed); + } + } + + size_t in_bytes = num * sizeof(Ts); + clMemWrapper in = clCreateBuffer(context, CL_MEM_READ_WRITE, in_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create buffer"); + + err = clEnqueueWriteBuffer(queue, in, CL_TRUE, 0, in_bytes, &h_in[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to rhs buffer"); + + size_t out_bytes = num * sizeof(Tv); + clMemWrapper out = clCreateBuffer(context, CL_MEM_READ_WRITE, out_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &in); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &out); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + for (int k = 0; k < n; k++) { + + // Reset the values in h_out + err = clEnqueueWriteBuffer(queue, out, CL_TRUE, 0, out_bytes, &h_ref[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to cl_buffer"); + + err = clSetKernelArg(kernel, 2, sizeof(int), &k); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + size_t global = num; + // Kernel should the k'th value of the vector in h_out with h_in + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue kernel"); + + err = clEnqueueReadBuffer(queue, out, CL_TRUE, 0, out_bytes, &h_out[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy from cl_buffer"); + + for (int i = 0; i < num; i++) { + // Kernel should have replaced k'th value of the vector in h_out with h_in + // The remaining values should be unchanged. + Tv refVec = h_ref[i]; + refVec.s[k] = h_in[i]; + for (int j = 0; j < n; j++) { + if (h_out[i].s[j] != refVec.s[j]) { + log_error("Values do not match at location %d for vector position %d\n", i, k); + return -1; + } + } + } + } + return 0; +} + +#define TEST_VECTOR_INSERT(TYPE, N) \ + TEST_SPIRV_FUNC(op_vector_##TYPE##N##_insert) \ + { \ + typedef cl_##TYPE##N Tv; \ + typedef cl_##TYPE Ts; \ + const int num = 1 << 20; \ + std::vector in(num); \ + const char *name = "vector_" #TYPE #N "_insert"; \ + \ + RandomSeed seed(gRandomSeed); \ + \ + for (int i = 0; i < num; i++) { \ + in[i] = genrand(seed); \ + } \ + \ + return test_insert(deviceID, \ + context, queue, \ + name, \ + in, N); \ + } + +TEST_VECTOR_INSERT(int, 4) +TEST_VECTOR_INSERT(float, 4) +TEST_VECTOR_INSERT(long, 2) +TEST_VECTOR_INSERT(double, 2) +TEST_VECTOR_INSERT(char, 16) diff --git a/test_conformance/spirv_new/test_op_vector_times_scalar.cpp b/test_conformance/spirv_new/test_op_vector_times_scalar.cpp new file mode 100644 index 00000000..99d71f72 --- /dev/null +++ b/test_conformance/spirv_new/test_op_vector_times_scalar.cpp @@ -0,0 +1,181 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +#include +#include + +template +int test_vector_times_scalar(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *Tname, + std::vector &h_lhs, + std::vector &h_rhs) +{ + if(std::string(Tname).find("double") != std::string::npos) { + if(!is_extension_available(deviceID, "cl_khr_fp64")) { + log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); + return 0; + } + } + + cl_int err = CL_SUCCESS; + int num = (int)h_lhs.size(); + size_t lhs_bytes = num * sizeof(Tv); + size_t rhs_bytes = num * sizeof(Ts); + size_t res_bytes = lhs_bytes; + int vec_size = sizeof(Tv) / sizeof(Ts); + + clMemWrapper lhs = clCreateBuffer(context, CL_MEM_READ_ONLY, lhs_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create lhs buffer"); + + err = clEnqueueWriteBuffer(queue, lhs, CL_TRUE, 0, lhs_bytes, &h_lhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to lhs buffer"); + + clMemWrapper rhs = clCreateBuffer(context, CL_MEM_READ_ONLY, rhs_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create rhs buffer"); + + err = clEnqueueWriteBuffer(queue, rhs, CL_TRUE, 0, rhs_bytes, &h_rhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to rhs buffer"); + + std::string kernelStr; + + { + std::stringstream kernelStream; + + if (is_double::value) { + kernelStream << "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n"; + } else if (sizeof(Ts) == sizeof(cl_half)) { + kernelStream << "#pragma OPENCL EXTENSION cl_khr_fp16 : enable\n"; + } + + kernelStream << "#define Ts " << Tname << "\n"; + kernelStream << "#define Tv " << Tname << vec_size << "\n"; + kernelStream << "__kernel void vector_times_scalar( \n"; + kernelStream << " __global Tv *out, \n"; + kernelStream << " const __global Tv *lhs,\n"; + kernelStream << " const __global Ts *rhs)\n"; + kernelStream << "{ \n"; + kernelStream << " int id = get_global_id(0); \n"; + kernelStream << " out[id] = lhs[id] * rhs[id]; \n"; + kernelStream << "} \n"; + kernelStr = kernelStream.str(); + } + + size_t kernelLen = kernelStr.size(); + const char *kernelBuf = kernelStr.c_str(); + + std::vector h_ref(num); + { + // Run the cl kernel for reference results + clProgramWrapper prog; + err = create_single_kernel_helper_create_program(context, &prog, 1, &kernelBuf, NULL); + SPIRV_CHECK_ERROR(err, "Failed to create cl program"); + + err = clBuildProgram(prog, 1, &deviceID, NULL, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, "vector_times_scalar", &err); + SPIRV_CHECK_ERROR(err, "Failed to create cl kernel"); + + clMemWrapper ref = clCreateBuffer(context, CL_MEM_READ_WRITE, res_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create ref buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &ref); + SPIRV_CHECK_ERROR(err, "Failed to set arg 0"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + err = clEnqueueReadBuffer(queue, ref, CL_TRUE, 0, res_bytes, &h_ref[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + } + + cl_uint bits = sizeof(void *) * 8; + std::string ref = "vector_times_scalar_"; + ref += Tname; + const char *spvName = ref.c_str(); + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, spvName); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, "vector_times_scalar", &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + clMemWrapper res = clCreateBuffer(context, CL_MEM_READ_WRITE, res_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create res buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &res); + SPIRV_CHECK_ERROR(err, "Failed to set arg 0"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_res(num); + err = clEnqueueReadBuffer(queue, res, CL_TRUE, 0, res_bytes, &h_res[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + + for (int i = 0; i < num; i++) { + if (h_res[i] != h_ref[i]) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +#define TEST_VECTOR_TIMES_SCALAR(TYPE, N) \ + TEST_SPIRV_FUNC(op_vector_times_scalar_##TYPE) \ + { \ + if (sizeof(cl_##TYPE) == 2) { \ + PASSIVE_REQUIRE_FP16_SUPPORT(deviceID); \ + } \ + typedef cl_##TYPE##N Tv; \ + typedef cl_##TYPE Ts; \ + const int num = 1 << 20; \ + std::vector lhs(num); \ + std::vector rhs(num); \ + \ + RandomSeed seed(gRandomSeed); \ + \ + for (int i = 0; i < num; i++) { \ + lhs[i] = genrandReal(seed); \ + rhs[i] = genrandReal(seed); \ + } \ + \ + return test_vector_times_scalar(deviceID, \ + context, queue, \ + #TYPE, \ + lhs, rhs); \ + } + +TEST_VECTOR_TIMES_SCALAR(float, 4) +TEST_VECTOR_TIMES_SCALAR(double, 4) diff --git a/test_conformance/spirv_new/types.hpp b/test_conformance/spirv_new/types.hpp new file mode 100644 index 00000000..e7fceba0 --- /dev/null +++ b/test_conformance/spirv_new/types.hpp @@ -0,0 +1,184 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#pragma once +#include + +#if defined(_MSC_VER) || defined(_WIN32) +#define PACKED(__STRUCT__) __pragma(pack(push, 1)) __STRUCT__ __pragma(pack(pop)) +#elif defined(__GNUC__) || defined(__clang__) +#define PACKED(__STRUCT__) __STRUCT__ __attribute__((packed)) +#endif + +template +inline bool isVectorNotEqual(const T &lhs, const T &rhs) +{ + bool result = false; + for (int i = 0; !result && i < n; i++) { + result |= lhs.s[i] != rhs.s[i]; + } + return result; +} + +#define VEC_NOT_EQ_FUNC(TYPE, N) \ + inline bool operator!=(const TYPE##N &lhs, const TYPE##N &rhs) \ + { \ + return isVectorNotEqual(lhs, rhs); \ + } \ + +VEC_NOT_EQ_FUNC(cl_int, 2) +VEC_NOT_EQ_FUNC(cl_int, 4) +VEC_NOT_EQ_FUNC(cl_uint, 4) +VEC_NOT_EQ_FUNC(cl_float, 2) +VEC_NOT_EQ_FUNC(cl_float, 4) +VEC_NOT_EQ_FUNC(cl_double, 2) +VEC_NOT_EQ_FUNC(cl_double, 4) + +template +bool isNotEqual(const T &lhs, const T &rhs) +{ + return lhs != rhs; +} + +// Can replace the following with tuples if c++11 can be used +template +struct AbstractStruct1 +{ + T val; +}; + +template +inline bool operator != (const AbstractStruct1 &lhs, const AbstractStruct1 &rhs) +{ + return lhs.val != rhs.val; +} + +template +struct AbstractStruct2 +{ + T0 val0; + T1 val1; +}; + + +template +inline bool operator != (const AbstractStruct2 &lhs, + const AbstractStruct2 &rhs) +{ + return lhs.val0 != rhs.val0 || lhs.val1 != rhs.val1; +} + + +template struct is_double { static const bool value = false; }; +template<> struct is_double { static const bool value = true; }; +template<> struct is_double { static const bool value = true; }; + +template +T genrandReal(RandomSeed &seed) +{ + return genrand_real1(seed); +} + +template +T genrandRealVec(RandomSeed &seed) +{ + T res; + for (int i = 0; i < N; i++) { + res.s[i] = genrand_real1(seed); + } + return res; +} + +#define GENRAND_REAL_FUNC(TYPE, N) \ + template<> inline TYPE##N genrandReal(RandomSeed &seed) \ + { \ + return genrandRealVec(seed); \ + } \ + +GENRAND_REAL_FUNC(cl_float, 2) +GENRAND_REAL_FUNC(cl_float, 4) +GENRAND_REAL_FUNC(cl_double, 2) +GENRAND_REAL_FUNC(cl_double, 4) + +template<> inline cl_half genrandReal(RandomSeed &seed) +{ + return (cl_half)(genrand_int32(seed) % 2048); +} + +template +T genrand(RandomSeed &seed) +{ + return genrandReal(seed); +} + +template<> inline cl_int genrand(RandomSeed &seed) +{ + return genrand_int32(seed); +} + +template<> inline cl_long genrand(RandomSeed &seed) +{ + return genrand_int32(seed); +} + +template<> inline cl_short genrand(RandomSeed &seed) +{ + return genrand_int32(seed); +} + +#define GENRAND_INT_VEC(T, N) \ + template<> inline T##N genrand(RandomSeed &seed) \ + { \ + T##N res; \ + for (int i = 0; i < N; i++) { \ + res.s[i] = (T)genrand_int32(seed); \ + } \ + return res; \ + } \ + +GENRAND_INT_VEC(cl_int, 4) +GENRAND_INT_VEC(cl_uint, 4) +GENRAND_INT_VEC(cl_long, 2) +GENRAND_INT_VEC(cl_char, 16) + +template +Tv negOp(Tv in) +{ + return -in; +} + +template +Tv notOp(Tv in) +{ + return ~in; +} + +template +Tv negOpVec(Tv in) +{ + Tv out; + for (int i = 0; i < N; i++) { + out.s[i] = -in.s[i]; + } + return out; +} + +template +Tv notOpVec(Tv in) +{ + Tv out; + for (int i = 0; i < N; i++) { + out.s[i] = ~in.s[i]; + } + return out; +} diff --git a/test_conformance/subgroups/CMakeLists.txt b/test_conformance/subgroups/CMakeLists.txt index 7e7c11ce..eb6a6079 100644 --- a/test_conformance/subgroups/CMakeLists.txt +++ b/test_conformance/subgroups/CMakeLists.txt @@ -6,16 +6,7 @@ set(${MODULE_NAME}_SOURCES test_queries.cpp test_workitem.cpp test_workgroup.cpp - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/typeWrappers.cpp - ../../test_common/harness/mt19937.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/ThreadPool.c - ../../test_common/harness/conversions.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c + test_ifp.cpp ) include(../CMakeCommon.txt) diff --git a/test_conformance/subgroups/main.cpp b/test_conformance/subgroups/main.cpp index c216f418..f9a9a9d5 100644 --- a/test_conformance/subgroups/main.cpp +++ b/test_conformance/subgroups/main.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -13,37 +13,58 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include #include "procs.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" MTdata gMTdata; test_definition test_list[] = { - ADD_TEST( sub_group_info ), - ADD_TEST( work_item_functions ), - ADD_TEST( work_group_functions ), - ADD_TEST( barrier_functions ), + ADD_TEST_VERSION(sub_group_info_ext, Version(2, 0)), + ADD_TEST_VERSION(sub_group_info_core, Version(2, 1)), + ADD_TEST_VERSION(work_item_functions_ext, Version(2, 0)), + ADD_TEST_VERSION(work_item_functions_core, Version(2, 1)), + ADD_TEST_VERSION(work_group_functions_ext, Version(2, 0)), + ADD_TEST_VERSION(work_group_functions_core, Version(2, 1)), + ADD_TEST_VERSION(barrier_functions_ext, Version(2, 0)), + ADD_TEST_VERSION(barrier_functions_core, Version(2, 1)), + ADD_TEST_VERSION(ifp_ext, Version(2, 0)), + ADD_TEST_VERSION(ifp_core, Version(2, 1)) }; -const int test_num = ARRAY_SIZE( test_list ); +const int test_num = ARRAY_SIZE(test_list); -static test_status checkSubGroupsExtension(cl_device_id device) +static test_status InitCL(cl_device_id device) { - if (!is_extension_available(device, "cl_khr_subgroups")) { - log_error("'cl_khr_subgroups' is a required extension, failing.\n"); - return TEST_FAIL; - } + auto version = get_device_cl_version(device); + test_status ret = TEST_PASS; + if (version >= Version(3, 0)) + { + cl_uint max_sub_groups; + int error; - return TEST_PASS; + error = clGetDeviceInfo(device, CL_DEVICE_MAX_NUM_SUB_GROUPS, + sizeof(max_sub_groups), &max_sub_groups, NULL); + if (error != CL_SUCCESS) + { + print_error(error, "Unable to get max number of subgroups"); + return TEST_FAIL; + } + + if (max_sub_groups == 0) + { + ret = TEST_SKIP; + } + } + return ret; } int main(int argc, const char *argv[]) { gMTdata = init_genrand(0); - return runTestHarnessWithCheck(argc, argv, test_num, test_list, false, false, NULL, checkSubGroupsExtension); + return runTestHarnessWithCheck(argc, argv, test_num, test_list, false, 0, + InitCL); } - diff --git a/test_conformance/subgroups/procs.h b/test_conformance/subgroups/procs.h index 731ad3b6..3ebb13b5 100644 --- a/test_conformance/subgroups/procs.h +++ b/test_conformance/subgroups/procs.h @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -16,28 +16,45 @@ #ifndef _procs_h #define _procs_h -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/threadTesting.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/mt19937.h" +#include "harness/testHarness.h" +#include "harness/kernelHelpers.h" +#include "harness/errorHelpers.h" +#include "harness/conversions.h" +#include "harness/threadTesting.h" +#include "harness/typeWrappers.h" +#include "harness/mt19937.h" extern MTdata gMTdata; -#ifdef __cplusplus -extern "C" { -#endif - -extern int test_sub_group_info(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements); -extern int test_work_item_functions(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements); -extern int test_work_group_functions(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements); -extern int test_barrier_functions(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements); -extern int test_pipe_functions(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements); - -#ifdef __cplusplus -} -#endif +extern int test_sub_group_info_ext(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_sub_group_info_core(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_work_item_functions_ext(cl_device_id device, cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_work_item_functions_core(cl_device_id device, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_work_group_functions_ext(cl_device_id device, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_work_group_functions_core(cl_device_id device, + cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_barrier_functions_ext(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_barrier_functions_core(cl_device_id device, cl_context context, + cl_command_queue queue, + int num_elements); +extern int test_pipe_functions(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_ifp_ext(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_ifp_core(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements); #endif /*_procs_h*/ diff --git a/test_conformance/subgroups/subhelpers.h b/test_conformance/subgroups/subhelpers.h index 60e392d5..6e84ccb3 100644 --- a/test_conformance/subgroups/subhelpers.h +++ b/test_conformance/subgroups/subhelpers.h @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -23,91 +23,247 @@ #include #include +class subgroupsAPI { +public: + subgroupsAPI(cl_platform_id platform, bool useCoreSubgroups) + { + static_assert(CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE + == CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE_KHR, + "Enums have to be the same"); + static_assert(CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE + == CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE_KHR, + "Enums have to be the same"); + if (useCoreSubgroups) + { + _clGetKernelSubGroupInfo_ptr = &clGetKernelSubGroupInfo; + clGetKernelSubGroupInfo_name = "clGetKernelSubGroupInfo"; + } + else + { + _clGetKernelSubGroupInfo_ptr = (clGetKernelSubGroupInfoKHR_fn) + clGetExtensionFunctionAddressForPlatform( + platform, "clGetKernelSubGroupInfoKHR"); + clGetKernelSubGroupInfo_name = "clGetKernelSubGroupInfoKHR"; + } + } + clGetKernelSubGroupInfoKHR_fn clGetKernelSubGroupInfo_ptr() + { + return _clGetKernelSubGroupInfo_ptr; + } + const char *clGetKernelSubGroupInfo_name; + +private: + clGetKernelSubGroupInfoKHR_fn _clGetKernelSubGroupInfo_ptr; +}; + // Some template helpers template struct TypeName; -template <> struct TypeName { static const char * val() { return "half"; } }; -template <> struct TypeName { static const char * val() { return "uint"; } }; -template <> struct TypeName { static const char * val() { return "int"; } }; -template <> struct TypeName { static const char * val() { return "ulong"; } }; -template <> struct TypeName { static const char * val() { return "long"; } }; -template <> struct TypeName { static const char * val() { return "float"; } }; -template <> struct TypeName { static const char * val() { return "double"; } }; +template <> struct TypeName +{ + static const char *val() { return "half"; } +}; +template <> struct TypeName +{ + static const char *val() { return "uint"; } +}; +template <> struct TypeName +{ + static const char *val() { return "int"; } +}; +template <> struct TypeName +{ + static const char *val() { return "ulong"; } +}; +template <> struct TypeName +{ + static const char *val() { return "long"; } +}; +template <> struct TypeName +{ + static const char *val() { return "float"; } +}; +template <> struct TypeName +{ + static const char *val() { return "double"; } +}; template struct TypeDef; -template <> struct TypeDef { static const char * val() { return "typedef half Type;\n"; } }; -template <> struct TypeDef { static const char * val() { return "typedef uint Type;\n"; } }; -template <> struct TypeDef { static const char * val() { return "typedef int Type;\n"; } }; -template <> struct TypeDef { static const char * val() { return "typedef ulong Type;\n"; } }; -template <> struct TypeDef { static const char * val() { return "typedef long Type;\n"; } }; -template <> struct TypeDef { static const char * val() { return "typedef float Type;\n"; } }; -template <> struct TypeDef { static const char * val() { return "typedef double Type;\n"; } }; +template <> struct TypeDef +{ + static const char *val() { return "typedef half Type;\n"; } +}; +template <> struct TypeDef +{ + static const char *val() { return "typedef uint Type;\n"; } +}; +template <> struct TypeDef +{ + static const char *val() { return "typedef int Type;\n"; } +}; +template <> struct TypeDef +{ + static const char *val() { return "typedef ulong Type;\n"; } +}; +template <> struct TypeDef +{ + static const char *val() { return "typedef long Type;\n"; } +}; +template <> struct TypeDef +{ + static const char *val() { return "typedef float Type;\n"; } +}; +template <> struct TypeDef +{ + static const char *val() { return "typedef double Type;\n"; } +}; template struct TypeIdentity; -// template <> struct TypeIdentity { static cl_half val() { return (cl_half)0.0; } }; -// template <> struct TypeIdentity { static cl_half val() { return -(cl_half)65536.0; } }; -// template <> struct TypeIdentity { static cl_half val() { return (cl_half)65536.0; } }; +// template <> struct TypeIdentity { static cl_half val() { return +// (cl_half)0.0; } }; template <> struct TypeIdentity { static +// cl_half val() { return -(cl_half)65536.0; } }; template <> struct +// TypeIdentity { static cl_half val() { return (cl_half)65536.0; } +// }; -template <> struct TypeIdentity { static cl_uint val() { return (cl_uint)0; } }; -template <> struct TypeIdentity { static cl_uint val() { return (cl_uint)0; } }; -template <> struct TypeIdentity { static cl_uint val() { return (cl_uint)0xffffffff; } }; +template <> struct TypeIdentity +{ + static cl_uint val() { return (cl_uint)0; } +}; +template <> struct TypeIdentity +{ + static cl_uint val() { return (cl_uint)0; } +}; +template <> struct TypeIdentity +{ + static cl_uint val() { return (cl_uint)0xffffffff; } +}; -template <> struct TypeIdentity { static cl_int val() { return (cl_int)0 ; } }; -template <> struct TypeIdentity { static cl_int val() { return (cl_int)0x80000000; } }; -template <> struct TypeIdentity { static cl_int val() { return (cl_int)0x7fffffff; } }; +template <> struct TypeIdentity +{ + static cl_int val() { return (cl_int)0; } +}; +template <> struct TypeIdentity +{ + static cl_int val() { return (cl_int)0x80000000; } +}; +template <> struct TypeIdentity +{ + static cl_int val() { return (cl_int)0x7fffffff; } +}; -template <> struct TypeIdentity { static cl_ulong val() { return (cl_ulong)0 ; } }; -template <> struct TypeIdentity { static cl_ulong val() { return (cl_ulong)0 ; } }; -template <> struct TypeIdentity { static cl_ulong val() { return (cl_ulong)0xffffffffffffffffULL ; } }; +template <> struct TypeIdentity +{ + static cl_ulong val() { return (cl_ulong)0; } +}; +template <> struct TypeIdentity +{ + static cl_ulong val() { return (cl_ulong)0; } +}; +template <> struct TypeIdentity +{ + static cl_ulong val() { return (cl_ulong)0xffffffffffffffffULL; } +}; -template <> struct TypeIdentity { static cl_long val() { return (cl_long)0; } }; -template <> struct TypeIdentity { static cl_long val() { return (cl_long)0x8000000000000000ULL; } }; -template <> struct TypeIdentity { static cl_long val() { return (cl_long)0x7fffffffffffffffULL; } }; +template <> struct TypeIdentity +{ + static cl_long val() { return (cl_long)0; } +}; +template <> struct TypeIdentity +{ + static cl_long val() { return (cl_long)0x8000000000000000ULL; } +}; +template <> struct TypeIdentity +{ + static cl_long val() { return (cl_long)0x7fffffffffffffffULL; } +}; -template <> struct TypeIdentity { static float val() { return 0.F; } }; -template <> struct TypeIdentity { static float val() { return -std::numeric_limits::infinity(); } }; -template <> struct TypeIdentity { static float val() { return std::numeric_limits::infinity(); } }; +template <> struct TypeIdentity +{ + static float val() { return 0.F; } +}; +template <> struct TypeIdentity +{ + static float val() { return -std::numeric_limits::infinity(); } +}; +template <> struct TypeIdentity +{ + static float val() { return std::numeric_limits::infinity(); } +}; -template <> struct TypeIdentity { static double val() { return 0.L; } }; +template <> struct TypeIdentity +{ + static double val() { return 0.L; } +}; -template <> struct TypeIdentity { static double val() { return -std::numeric_limits::infinity(); } }; -template <> struct TypeIdentity { static double val() { return std::numeric_limits::infinity(); } }; +template <> struct TypeIdentity +{ + static double val() { return -std::numeric_limits::infinity(); } +}; +template <> struct TypeIdentity +{ + static double val() { return std::numeric_limits::infinity(); } +}; template struct TypeCheck; -template <> struct TypeCheck { static bool val(cl_device_id) { return true; } }; -template <> struct TypeCheck { static bool val(cl_device_id) { return true; } }; +template <> struct TypeCheck +{ + static bool val(cl_device_id) { return true; } +}; +template <> struct TypeCheck +{ + static bool val(cl_device_id) { return true; } +}; -static bool -int64_ok(cl_device_id device) +static bool int64_ok(cl_device_id device) { char profile[128]; int error; - error = clGetDeviceInfo(device, CL_DEVICE_PROFILE, sizeof(profile), (void *)&profile, NULL); - if (error) { + error = clGetDeviceInfo(device, CL_DEVICE_PROFILE, sizeof(profile), + (void *)&profile, NULL); + if (error) + { log_info("clGetDeviceInfo failed with CL_DEVICE_PROFILE\n"); - return false; + return false; } if (strcmp(profile, "EMBEDDED_PROFILE") == 0) - return is_extension_available(device, "cles_khr_int64"); + return is_extension_available(device, "cles_khr_int64"); return true; } -template <> struct TypeCheck { static bool val(cl_device_id device) { return int64_ok(device); } }; -template <> struct TypeCheck { static bool val(cl_device_id device) { return int64_ok(device); } }; -template <> struct TypeCheck { static bool val(cl_device_id) { return true; } }; -template <> struct TypeCheck { - static bool val(cl_device_id device) { return is_extension_available(device, "cl_khr_fp16"); } +template <> struct TypeCheck +{ + static bool val(cl_device_id device) { return int64_ok(device); } }; -template <> struct TypeCheck { - static bool val(cl_device_id device) { +template <> struct TypeCheck +{ + static bool val(cl_device_id device) { return int64_ok(device); } +}; +template <> struct TypeCheck +{ + static bool val(cl_device_id) { return true; } +}; +template <> struct TypeCheck +{ + static bool val(cl_device_id device) + { + return is_extension_available(device, "cl_khr_fp16"); + } +}; +template <> struct TypeCheck +{ + static bool val(cl_device_id device) + { int error; cl_device_fp_config c; - error = clGetDeviceInfo(device, CL_DEVICE_DOUBLE_FP_CONFIG, sizeof(c), (void *)&c, NULL); - if (error) { - log_info("clGetDeviceInfo failed with CL_DEVICE_DOUBLE_FP_CONFIG\n"); + error = clGetDeviceInfo(device, CL_DEVICE_DOUBLE_FP_CONFIG, sizeof(c), + (void *)&c, NULL); + if (error) + { + log_info( + "clGetDeviceInfo failed with CL_DEVICE_DOUBLE_FP_CONFIG\n"); return false; } return c != 0; @@ -116,10 +272,10 @@ template <> struct TypeCheck { // Run a test kernel to compute the result of a built-in on an input -static int -run_kernel(cl_context context, cl_command_queue queue, cl_kernel kernel, size_t global, size_t local, - void *idata, size_t isize, void *mdata, size_t msize, - void *odata, size_t osize, size_t tsize=0) +static int run_kernel(cl_context context, cl_command_queue queue, + cl_kernel kernel, size_t global, size_t local, + void *idata, size_t isize, void *mdata, size_t msize, + void *odata, size_t osize, size_t tsize = 0) { clMemWrapper in; clMemWrapper xy; @@ -136,8 +292,10 @@ run_kernel(cl_context context, cl_command_queue queue, cl_kernel kernel, size_t out = clCreateBuffer(context, CL_MEM_WRITE_ONLY, osize, NULL, &error); test_error(error, "clCreateBuffer failed"); - if (tsize) { - tmp = clCreateBuffer(context, CL_MEM_READ_WRITE | CL_MEM_HOST_NO_ACCESS, tsize, NULL, &error); + if (tsize) + { + tmp = clCreateBuffer(context, CL_MEM_READ_WRITE | CL_MEM_HOST_NO_ACCESS, + tsize, NULL, &error); test_error(error, "clCreateBuffer failed"); } @@ -150,21 +308,26 @@ run_kernel(cl_context context, cl_command_queue queue, cl_kernel kernel, size_t error = clSetKernelArg(kernel, 2, sizeof(out), (void *)&out); test_error(error, "clSetKernelArg failed"); - if (tsize) { + if (tsize) + { error = clSetKernelArg(kernel, 3, sizeof(tmp), (void *)&tmp); test_error(error, "clSetKernelArg failed"); } - error = clEnqueueWriteBuffer(queue, in, CL_FALSE, 0, isize, idata, 0, NULL, NULL); + error = clEnqueueWriteBuffer(queue, in, CL_FALSE, 0, isize, idata, 0, NULL, + NULL); test_error(error, "clEnqueueWriteBuffer failed"); - error = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, &local, 0, NULL, NULL); + error = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, &local, 0, + NULL, NULL); test_error(error, "clEnqueueNDRangeKernel failed"); - error = clEnqueueReadBuffer(queue, xy, CL_FALSE, 0, msize, mdata, 0, NULL, NULL); + error = clEnqueueReadBuffer(queue, xy, CL_FALSE, 0, msize, mdata, 0, NULL, + NULL); test_error(error, "clEnqueueReadBuffer failed"); - error = clEnqueueReadBuffer(queue, out, CL_FALSE, 0, osize, odata, 0, NULL, NULL); + error = clEnqueueReadBuffer(queue, out, CL_FALSE, 0, osize, odata, 0, NULL, + NULL); test_error(error, "clEnqueueReadBuffer failed"); error = clFinish(queue); @@ -174,10 +337,13 @@ run_kernel(cl_context context, cl_command_queue queue, cl_kernel kernel, size_t } // Driver for testing a single built in function -template -struct test { - static int - run(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements, const char *kname, const char *src, int dynscl=0) +template +struct test +{ + static int run(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements, const char *kname, + const char *src, int dynscl, bool useCoreSubgroups) { size_t tmp; int error; @@ -185,28 +351,35 @@ struct test { size_t realSize; size_t global; size_t local; - const char *kstrings[3]; clProgramWrapper program; clKernelWrapper kernel; cl_platform_id platform; - cl_int sgmap[2*GSIZE]; + cl_int sgmap[2 * GSIZE]; Ty mapin[LSIZE]; Ty mapout[LSIZE]; - // Make sure a test of type Ty is supported by the device - if (!TypeCheck::val(device)) - return 0; + // Make sure a test of type Ty is supported by the device + if (!TypeCheck::val(device)) return 0; - error = clGetDeviceInfo(device, CL_DEVICE_PLATFORM, sizeof(platform), (void *)&platform, NULL); + error = clGetDeviceInfo(device, CL_DEVICE_PLATFORM, sizeof(platform), + (void *)&platform, NULL); test_error(error, "clGetDeviceInfo failed for CL_DEVICE_PLATFORM"); + std::stringstream kernel_sstr; + if (useCoreSubgroups) + { + kernel_sstr + << "#pragma OPENCL EXTENSION cl_khr_subgroups : enable\n"; + } + kernel_sstr << "#define XY(M,I) M[I].x = get_sub_group_local_id(); " + "M[I].y = get_sub_group_id();\n"; + kernel_sstr << TypeDef::val(); + kernel_sstr << src; + const std::string &kernel_str = kernel_sstr.str(); + const char *kernel_src = kernel_str.c_str(); - kstrings[0] = "#pragma OPENCL EXTENSION cl_khr_subgroups : enable\n" - "#define XY(M,I) M[I].x = get_sub_group_local_id(); M[I].y = get_sub_group_id();\n"; - kstrings[1] = TypeDef::val(); - kstrings[2] = src; - error = create_single_kernel_helper_with_build_options(context, &program, &kernel, 3, kstrings, kname, "-cl-std=CL2.0"); - if (error != 0) - return error; + error = create_single_kernel_helper_with_build_options( + context, &program, &kernel, 1, &kernel_src, kname, "-cl-std=CL2.0"); + if (error != 0) return error; // Determine some local dimensions to use for the test. global = GSIZE; @@ -215,32 +388,49 @@ struct test { // Limit it a bit so we have muliple work groups // Ideally this will still be large enough to give us multiple subgroups - if (local > LSIZE) - local = LSIZE; + if (local > LSIZE) local = LSIZE; - // Get the sub group info - clGetKernelSubGroupInfoKHR_fn clGetKernelSubGroupInfoKHR_ptr; - clGetKernelSubGroupInfoKHR_ptr = (clGetKernelSubGroupInfoKHR_fn)clGetExtensionFunctionAddressForPlatform(platform, - "clGetKernelSubGroupInfoKHR"); - if (clGetKernelSubGroupInfoKHR_ptr == NULL) { - log_error("ERROR: clGetKernelSubGroupInfoKHR function not available"); - return -1; + // Get the sub group info + subgroupsAPI subgroupsApiSet(platform, useCoreSubgroups); + clGetKernelSubGroupInfoKHR_fn clGetKernelSubGroupInfo_ptr = + subgroupsApiSet.clGetKernelSubGroupInfo_ptr(); + if (clGetKernelSubGroupInfo_ptr == NULL) + { + log_error("ERROR: %s function not available", + subgroupsApiSet.clGetKernelSubGroupInfo_name); + return TEST_FAIL; + } + error = clGetKernelSubGroupInfo_ptr( + kernel, device, CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE, + sizeof(local), (void *)&local, sizeof(tmp), (void *)&tmp, NULL); + if (error != CL_SUCCESS) + { + log_error("ERROR: %s function error for " + "CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE", + subgroupsApiSet.clGetKernelSubGroupInfo_name); + return TEST_FAIL; } - error = clGetKernelSubGroupInfoKHR_ptr(kernel, device, CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE_KHR, - sizeof(local), (void *)&local, sizeof(tmp), (void *)&tmp, NULL); - test_error(error, "clGetKernelSubGroupInfoKHR failed for CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE_KHR"); subgroup_size = (int)tmp; - error = clGetKernelSubGroupInfoKHR_ptr(kernel, device, CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE_KHR, - sizeof(local), (void *)&local, sizeof(tmp), (void *)&tmp, NULL); - test_error(error, "clGetKernelSubGroupInfoKHR failed for CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE_KHR"); - num_subgroups = (int)tmp; + error = clGetKernelSubGroupInfo_ptr( + kernel, device, CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE, + sizeof(local), (void *)&local, sizeof(tmp), (void *)&tmp, NULL); + if (error != CL_SUCCESS) + { + log_error("ERROR: %s function error for " + "CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE", + subgroupsApiSet.clGetKernelSubGroupInfo_name); + return TEST_FAIL; + } - // Make sure the number of sub groups is what we expect - if (num_subgroups != (local + subgroup_size - 1)/ subgroup_size) { - log_error("ERROR: unexpected number of subgroups (%d) returned by clGetKernelSubGroupInfoKHR\n", num_subgroups); - return -1; + num_subgroups = (int)tmp; + // Make sure the number of sub groups is what we expect + if (num_subgroups != (local + subgroup_size - 1) / subgroup_size) + { + log_error("ERROR: unexpected number of subgroups (%d) returned\n", + num_subgroups); + return TEST_FAIL; } std::vector idata; @@ -248,38 +438,38 @@ struct test { size_t input_array_size = GSIZE; size_t output_array_size = GSIZE; - if (dynscl != 0) { - input_array_size = (int)global / (int)local * num_subgroups * dynscl; - output_array_size = (int)global / (int)local * dynscl; + if (dynscl != 0) + { + input_array_size = + (int)global / (int)local * num_subgroups * dynscl; + output_array_size = (int)global / (int)local * dynscl; } idata.resize(input_array_size); odata.resize(output_array_size); - // Run the kernel once on zeroes to get the map - memset(&idata[0], 0, input_array_size * sizeof(Ty)); - error = run_kernel(context, queue, kernel, global, local, - &idata[0], input_array_size * sizeof(Ty), - sgmap, global*sizeof(cl_int)*2, - &odata[0], output_array_size * sizeof(Ty), - TSIZE*sizeof(Ty)); - if (error) - return error; + // Run the kernel once on zeroes to get the map + memset(&idata[0], 0, input_array_size * sizeof(Ty)); + error = run_kernel(context, queue, kernel, global, local, &idata[0], + input_array_size * sizeof(Ty), sgmap, + global * sizeof(cl_int) * 2, &odata[0], + output_array_size * sizeof(Ty), TSIZE * sizeof(Ty)); + if (error) return error; - // Generate the desired input for the kernel - Fns::gen(&idata[0], mapin, sgmap, subgroup_size, (int)local, (int)global / (int)local); + // Generate the desired input for the kernel + Fns::gen(&idata[0], mapin, sgmap, subgroup_size, (int)local, + (int)global / (int)local); - error = run_kernel(context, queue, kernel, global, local, - &idata[0], input_array_size * sizeof(Ty), - sgmap, global*sizeof(cl_int)*2, - &odata[0], output_array_size * sizeof(Ty), - TSIZE*sizeof(Ty)); - if (error) - return error; + error = run_kernel(context, queue, kernel, global, local, &idata[0], + input_array_size * sizeof(Ty), sgmap, + global * sizeof(cl_int) * 2, &odata[0], + output_array_size * sizeof(Ty), TSIZE * sizeof(Ty)); + if (error) return error; - // Check the result - return Fns::chk(&idata[0], &odata[0], mapin, mapout, sgmap, subgroup_size, (int)local, (int)global / (int)local); + // Check the result + return Fns::chk(&idata[0], &odata[0], mapin, mapout, sgmap, + subgroup_size, (int)local, (int)global / (int)local); } }; diff --git a/test_conformance/subgroups/test_barrier.cpp b/test_conformance/subgroups/test_barrier.cpp index 3b4a0f99..e6ce1d2e 100644 --- a/test_conformance/subgroups/test_barrier.cpp +++ b/test_conformance/subgroups/test_barrier.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -15,105 +15,116 @@ // #include "procs.h" #include "subhelpers.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/conversions.h" +#include "harness/typeWrappers.h" -static const char * lbar_source = -"__kernel void test_lbar(const __global Type *in, __global int2 *xy, __global Type *out)\n" -"{\n" -" __local int tmp[200];\n" -" int gid = get_global_id(0);\n" -" int nid = get_sub_group_size();\n" -" int lid = get_sub_group_local_id();\n" -" xy[gid].x = lid;\n" -" xy[gid].y = get_sub_group_id();\n" -" if (get_sub_group_id() == 0) {\n" -" tmp[lid] = in[gid];\n" -" sub_group_barrier(CLK_LOCAL_MEM_FENCE);\n" -" out[gid] = tmp[nid-1-lid];\n" -" } else {\n" -" out[gid] = -in[gid];\n" -" }\n" -"}\n"; +static const char *lbar_source = + "__kernel void test_lbar(const __global Type *in, __global int2 *xy, " + "__global Type *out)\n" + "{\n" + " __local int tmp[200];\n" + " int gid = get_global_id(0);\n" + " int nid = get_sub_group_size();\n" + " int lid = get_sub_group_local_id();\n" + " xy[gid].x = lid;\n" + " xy[gid].y = get_sub_group_id();\n" + " if (get_sub_group_id() == 0) {\n" + " tmp[lid] = in[gid];\n" + " sub_group_barrier(CLK_LOCAL_MEM_FENCE);\n" + " out[gid] = tmp[nid-1-lid];\n" + " } else {\n" + " out[gid] = -in[gid];\n" + " }\n" + "}\n"; -static const char * gbar_source = -"__kernel void test_gbar(const __global Type *in, __global int2 *xy, __global Type *out, __global Type *tmp)\n" -"{\n" -" int gid = get_global_id(0);\n" -" int nid = get_sub_group_size();\n" -" int lid = get_sub_group_local_id();\n" -" int tof = get_group_id(0)*get_max_sub_group_size();\n" -" xy[gid].x = lid;\n" -" xy[gid].y = get_sub_group_id();\n" -" if (get_sub_group_id() == 0) {\n" -" tmp[tof+lid] = in[gid];\n" -" sub_group_barrier(CLK_GLOBAL_MEM_FENCE);\n" -" out[gid] = tmp[tof+nid-1-lid];\n" -" } else {\n" -" out[gid] = -in[gid];\n" -" }\n" -"}\n"; +static const char *gbar_source = + "__kernel void test_gbar(const __global Type *in, __global int2 *xy, " + "__global Type *out, __global Type *tmp)\n" + "{\n" + " int gid = get_global_id(0);\n" + " int nid = get_sub_group_size();\n" + " int lid = get_sub_group_local_id();\n" + " int tof = get_group_id(0)*get_max_sub_group_size();\n" + " xy[gid].x = lid;\n" + " xy[gid].y = get_sub_group_id();\n" + " if (get_sub_group_id() == 0) {\n" + " tmp[tof+lid] = in[gid];\n" + " sub_group_barrier(CLK_GLOBAL_MEM_FENCE);\n" + " out[gid] = tmp[tof+nid-1-lid];\n" + " } else {\n" + " out[gid] = -in[gid];\n" + " }\n" + "}\n"; // barrier test functions -template -struct BAR { +template struct BAR +{ static void gen(cl_int *x, cl_int *t, cl_int *m, int ns, int nw, int ng) { int i, ii, j, k, n; - int nj = (nw + ns - 1)/ns; + int nj = (nw + ns - 1) / ns; int e; ii = 0; - for (k=0; k nw ? nw - ii : ns; - for (i=0;i nw ? nw - ii : ns; - for (i=0; i, G, L>::run(device, context, queue, num_elements, "test_lbar", lbar_source); - error = test, G, L, G>::run(device, context, queue, num_elements, "test_gbar", gbar_source); + error = test, G, L>::run(device, context, queue, + num_elements, "test_lbar", + lbar_source, 0, useCoreSubgroups); + error = test, G, L, G>::run( + device, context, queue, num_elements, "test_gbar", gbar_source, 0, + useCoreSubgroups); return error; } +int test_barrier_functions_core(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements) +{ + return test_barrier_functions(device, context, queue, num_elements, true); +} + +int test_barrier_functions_ext(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements) +{ + bool hasExtension = is_extension_available(device, "cl_khr_subgroups"); + + if (!hasExtension) + { + log_info( + "Device does not support 'cl_khr_subgroups'. Skipping the test.\n"); + return TEST_SKIPPED_ITSELF; + } + + return test_barrier_functions(device, context, queue, num_elements, false); +} \ No newline at end of file diff --git a/test_conformance/subgroups/test_ifp.cpp b/test_conformance/subgroups/test_ifp.cpp new file mode 100644 index 00000000..02850e5f --- /dev/null +++ b/test_conformance/subgroups/test_ifp.cpp @@ -0,0 +1,364 @@ +// +// Copyright (c) 2020 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "procs.h" +#include "subhelpers.h" +#include "harness/conversions.h" +#include "harness/typeWrappers.h" + + +// These need to stay in sync with the kernel source below +#define NUM_LOC 49 +#define INST_LOC_MASK 0x7f +#define INST_OP_SHIFT 0 +#define INST_OP_MASK 0xf +#define INST_LOC_SHIFT 4 +#define INST_VAL_SHIFT 12 +#define INST_VAL_MASK 0x7ffff +#define INST_END 0x0 +#define INST_STORE 0x1 +#define INST_WAIT 0x2 +#define INST_COUNT 0x3 + +static const char *ifp_source = + "#define NUM_LOC 49\n" + "#define INST_LOC_MASK 0x7f\n" + "#define INST_OP_SHIFT 0\n" + "#define INST_OP_MASK 0xf\n" + "#define INST_LOC_SHIFT 4\n" + "#define INST_VAL_SHIFT 12\n" + "#define INST_VAL_MASK 0x7ffff\n" + "#define INST_END 0x0\n" + "#define INST_STORE 0x1\n" + "#define INST_WAIT 0x2\n" + "#define INST_COUNT 0x3\n" + "\n" + "__kernel void\n" + "test_ifp(const __global int *in, __global int2 *xy, __global int *out)\n" + "{\n" + " __local atomic_int loc[NUM_LOC];\n" + "\n" + " // Don't run if there is only one sub group\n" + " if (get_num_sub_groups() == 1)\n" + " return;\n" + "\n" + " // First initialize loc[]\n" + " int lid = (int)get_local_id(0);\n" + "\n" + " if (lid < NUM_LOC)\n" + " atomic_init(loc+lid, 0);\n" + "\n" + " work_group_barrier(CLK_LOCAL_MEM_FENCE);\n" + "\n" + " // Compute pointer to this sub group's \"instructions\"\n" + " const __global int *pc = in +\n" + " ((int)get_group_id(0)*(int)get_enqueued_num_sub_groups() +\n" + " (int)get_sub_group_id()) *\n" + " (NUM_LOC+1);\n" + "\n" + " // Set up to \"run\"\n" + " bool ok = (int)get_sub_group_local_id() == 0;\n" + " bool run = true;\n" + "\n" + " while (run) {\n" + " int inst = *pc++;\n" + " int iop = (inst >> INST_OP_SHIFT) & INST_OP_MASK;\n" + " int iloc = (inst >> INST_LOC_SHIFT) & INST_LOC_MASK;\n" + " int ival = (inst >> INST_VAL_SHIFT) & INST_VAL_MASK;\n" + "\n" + " switch (iop) {\n" + " case INST_STORE:\n" + " if (ok)\n" + " atomic_store(loc+iloc, ival);\n" + " break;\n" + " case INST_WAIT:\n" + " if (ok) {\n" + " while (atomic_load(loc+iloc) != ival)\n" + " ;\n" + " }\n" + " break;\n" + " case INST_COUNT:\n" + " if (ok) {\n" + " int i;\n" + " for (i=0;i NUM_LOC +// Input needs num_groups * num_sub_groups * (NUM_LOC+1) elements + +static inline int inst(int op, int loc, int val) +{ + return (val << INST_VAL_SHIFT) | (loc << INST_LOC_SHIFT) + | (op << INST_OP_SHIFT); +} + +void gen_insts(cl_int *x, cl_int *p, int n) +{ + int i, j0, j1; + int val; + int ii[NUM_LOC]; + + // Create a random permutation of 0...NUM_LOC-1 + ii[0] = 0; + for (i = 1; i < NUM_LOC; ++i) + { + j0 = random_in_range(0, i, gMTdata); + if (j0 != i) ii[i] = ii[j0]; + ii[j0] = i; + } + + // Initialize "instruction pointers" + memset(p, 0, n * 4); + + for (i = 0; i < NUM_LOC; ++i) + { + // Randomly choose 2 different sub groups + // One does a random amount of work, and the other waits for it + j0 = random_in_range(0, n - 1, gMTdata); + + do + { + j1 = random_in_range(0, n - 1, gMTdata); + } while (j1 == j0); + + // Randomly choose a wait value and assign "instructions" + val = random_in_range(100, 200 + 10 * NUM_LOC, gMTdata); + x[j0 * (NUM_LOC + 1) + p[j0]] = inst(INST_COUNT, ii[i], val); + x[j1 * (NUM_LOC + 1) + p[j1]] = inst(INST_WAIT, ii[i], val); + ++p[j0]; + ++p[j1]; + } + + // Last "inst" for each sub group is END + for (i = 0; i < n; ++i) x[i * (NUM_LOC + 1) + p[i]] = inst(INST_END, 0, 0); +} + +// Execute one group's "instructions" +void run_insts(cl_int *x, cl_int *p, int n) +{ + int i, nend; + bool scont; + cl_int loc[NUM_LOC]; + + // Initialize result and "instruction pointers" + memset(loc, 0, sizeof(loc)); + memset(p, 0, 4 * n); + + // Repetitively loop over subgroups with each executing "instructions" until + // blocked The loop terminates when all subgroups have hit the "END + // instruction" + do + { + nend = 0; + for (i = 0; i < n; ++i) + { + do + { + cl_int inst = x[i * (NUM_LOC + 1) + p[i]]; + cl_int iop = (inst >> INST_OP_SHIFT) & INST_OP_MASK; + cl_int iloc = (inst >> INST_LOC_SHIFT) & INST_LOC_MASK; + cl_int ival = (inst >> INST_VAL_SHIFT) & INST_VAL_MASK; + scont = false; + + switch (iop) + { + case INST_STORE: + loc[iloc] = ival; + ++p[i]; + scont = true; + break; + case INST_WAIT: + if (loc[iloc] == ival) + { + ++p[i]; + scont = true; + } + break; + case INST_COUNT: + loc[iloc] += ival; + ++p[i]; + scont = true; + break; + case INST_END: ++nend; break; + } + } while (scont); + } + } while (nend < n); + + // Return result, reusing "p" + memcpy(p, loc, sizeof(loc)); +} + + +struct IFP +{ + static void gen(cl_int *x, cl_int *t, cl_int *, int ns, int nw, int ng) + { + int k; + int nj = (nw + ns - 1) / ns; + + // We need at least 2 sub groups per group for this test + if (nj == 1) return; + + for (k = 0; k < ng; ++k) + { + gen_insts(x, t, nj); + x += nj * (NUM_LOC + 1); + } + } + + static int chk(cl_int *x, cl_int *y, cl_int *t, cl_int *, cl_int *, int ns, + int nw, int ng) + { + int i, k; + int nj = (nw + ns - 1) / ns; + + // We need at least 2 sub groups per group for this tes + if (nj == 1) return 0; + + log_info(" independent forward progress...\n"); + + for (k = 0; k < ng; ++k) + { + run_insts(x, t, nj); + for (i = 0; i < NUM_LOC; ++i) + { + if (t[i] != y[i]) + { + log_error( + "ERROR: mismatch at element %d in work group %d\n", i, + k); + return -1; + } + } + x += nj * (NUM_LOC + 1); + y += NUM_LOC; + } + + return 0; + } +}; + +int test_ifp(cl_device_id device, cl_context context, cl_command_queue queue, + int num_elements, bool useCoreSubgroups) +{ + int error; + + // Adjust these individually below if desired/needed +#define G 2000 +#define L 200 + error = test::run(device, context, queue, num_elements, + "test_ifp", ifp_source, NUM_LOC + 1, + useCoreSubgroups); + return error; +} + +static test_status checkIFPSupport(cl_device_id device, bool &ifpSupport) +{ + cl_uint ifp_supported; + cl_uint error; + error = clGetDeviceInfo(device, + CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS, + sizeof(ifp_supported), &ifp_supported, NULL); + if (error != CL_SUCCESS) + { + print_error( + error, + "Unable to get CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS " + "capability"); + return TEST_FAIL; + } + // skip testing ifp + if (ifp_supported != 1) + { + log_info("INDEPENDENT FORWARD PROGRESS not supported...\n"); + ifpSupport = false; + } + else + { + log_info("INDEPENDENT FORWARD PROGRESS supported...\n"); + ifpSupport = true; + } + return TEST_PASS; +} + +int test_ifp_core(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements) +{ + bool ifpSupport = true; + test_status error; + error = checkIFPSupport(device, ifpSupport); + if (error != TEST_PASS) + { + return error; + } + if (ifpSupport == false) + { + log_info("Independed forward progress skipped.\n"); + return TEST_SKIPPED_ITSELF; + } + + return test_ifp(device, context, queue, num_elements, true); +} + +int test_ifp_ext(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements) +{ + bool hasExtension = is_extension_available(device, "cl_khr_subgroups"); + bool ifpSupport = true; + + if (!hasExtension) + { + log_info( + "Device does not support 'cl_khr_subgroups'. Skipping the test.\n"); + return TEST_SKIPPED_ITSELF; + } + // ifp only in subgroup functions tests: + test_status error; + error = checkIFPSupport(device, ifpSupport); + if (error != TEST_PASS) + { + return error; + } + if (ifpSupport == false) + { + log_info( + "Error reason: the extension cl_khr_subgroups requires that " + "Independed forward progress has to be supported by device.\n"); + return TEST_FAIL; + } + return test_ifp(device, context, queue, num_elements, false); +} \ No newline at end of file diff --git a/test_conformance/subgroups/test_queries.cpp b/test_conformance/subgroups/test_queries.cpp index 6055f658..2ad3d7fa 100644 --- a/test_conformance/subgroups/test_queries.cpp +++ b/test_conformance/subgroups/test_queries.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -14,118 +14,175 @@ // limitations under the License. // #include "procs.h" +#include "subhelpers.h" -typedef struct { +typedef struct +{ cl_uint maxSubGroupSize; cl_uint numSubGroups; } result_data; -static const char * query_kernel_source = -"#pragma OPENCL EXTENSION cl_khr_subgroups : enable\n" -"\n" -"typedef struct {\n" -" uint maxSubGroupSize;\n" -" uint numSubGroups;\n" -"} result_data;\n" -"\n" -"__kernel void query_kernel( __global result_data *outData )\n" -"{\n" -" int gid = get_global_id( 0 );\n" -" outData[gid].maxSubGroupSize = get_max_sub_group_size();\n" -" outData[gid].numSubGroups = get_num_sub_groups();\n" -"}"; -int -test_sub_group_info(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) +int test_sub_group_info(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements, + bool useCoreSubgroups) { static const size_t gsize0 = 80; int i, error; size_t realSize; size_t kernel_max_subgroup_size, kernel_subgroup_count; - size_t global[] = {gsize0,14,10}; - size_t local[] = {0,0,0}; + size_t global[] = { gsize0, 14, 10 }; + size_t local[] = { 0, 0, 0 }; result_data result[gsize0]; cl_uint max_dimensions; - error = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, sizeof(max_dimensions), &max_dimensions, NULL); - test_error(error, "clGetDeviceInfo failed for CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS"); + error = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, + sizeof(max_dimensions), &max_dimensions, NULL); + test_error(error, + "clGetDeviceInfo failed for CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS"); cl_platform_id platform; clProgramWrapper program; clKernelWrapper kernel; clMemWrapper out; + std::stringstream kernel_sstr; + if (useCoreSubgroups) + { + kernel_sstr << "#pragma OPENCL EXTENSION cl_khr_subgroups : enable\n"; + } + kernel_sstr + << "\n" + "typedef struct {\n" + " uint maxSubGroupSize;\n" + " uint numSubGroups;\n" + "} result_data;\n" + "\n" + "__kernel void query_kernel( __global result_data *outData )\n" + "{\n" + " int gid = get_global_id( 0 );\n" + " outData[gid].maxSubGroupSize = get_max_sub_group_size();\n" + " outData[gid].numSubGroups = get_num_sub_groups();\n" + "}"; - error = create_single_kernel_helper_with_build_options(context, &program, &kernel, 1, &query_kernel_source, "query_kernel", "-cl-std=CL2.0"); - if (error != 0) - return error; + const std::string &kernel_str = kernel_sstr.str(); + const char *kernel_src = kernel_str.c_str(); + error = create_single_kernel_helper_with_build_options( + context, &program, &kernel, 1, &kernel_src, "query_kernel", + "-cl-std=CL2.0"); + if (error != 0) return error; // Determine some local dimensions to use for the test. - if (max_dimensions == 1) { - error = get_max_common_work_group_size(context, kernel, global[0], &local[0]); + if (max_dimensions == 1) + { + error = get_max_common_work_group_size(context, kernel, global[0], + &local[0]); test_error(error, "get_max_common_work_group_size failed"); - } else if (max_dimensions == 2) { - error = get_max_common_2D_work_group_size(context, kernel, global, local); + } + else if (max_dimensions == 2) + { + error = + get_max_common_2D_work_group_size(context, kernel, global, local); test_error(error, "get_max_common_2D_work_group_size failed"); - } else { - error = get_max_common_3D_work_group_size(context, kernel, global, local); + } + else + { + error = + get_max_common_3D_work_group_size(context, kernel, global, local); test_error(error, "get_max_common_3D_work_group_size failed"); } - error = clGetDeviceInfo(device, CL_DEVICE_PLATFORM, sizeof(platform), (void *)&platform, NULL); + error = clGetDeviceInfo(device, CL_DEVICE_PLATFORM, sizeof(platform), + (void *)&platform, NULL); test_error(error, "clDeviceInfo failed for CL_DEVICE_PLATFORM"); - clGetKernelSubGroupInfoKHR_fn clGetKernelSubGroupInfoKHR_ptr; - clGetKernelSubGroupInfoKHR_ptr = (clGetKernelSubGroupInfoKHR_fn)clGetExtensionFunctionAddressForPlatform(platform, "clGetKernelSubGroupInfoKHR"); - if (clGetKernelSubGroupInfoKHR_ptr == NULL) { - log_error("ERROR: clGetKernelSubGroupInfoKHR function not available"); - return -1; + subgroupsAPI subgroupsApiSet(platform, useCoreSubgroups); + clGetKernelSubGroupInfoKHR_fn clGetKernelSubGroupInfo_ptr = + subgroupsApiSet.clGetKernelSubGroupInfo_ptr(); + if (clGetKernelSubGroupInfo_ptr == NULL) + { + log_error("ERROR: %s function not available", + subgroupsApiSet.clGetKernelSubGroupInfo_name); + return TEST_FAIL; } - error = clGetKernelSubGroupInfoKHR_ptr(kernel, device, CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE_KHR, - sizeof(local), (void *)&local, sizeof(kernel_max_subgroup_size), (void *)&kernel_max_subgroup_size, &realSize); - test_error(error, "clGetKernelSubGroupInfoKHR failed for CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE_KHR"); - log_info("The CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE_KHR for the kernel is %d.\n", (int)kernel_max_subgroup_size); - - if (realSize != sizeof(kernel_max_subgroup_size)) { - log_error( "ERROR: Returned size of max sub group size not valid! (Expected %d, got %d)\n", (int)sizeof(kernel_max_subgroup_size), (int)realSize ); - return -1; + error = clGetKernelSubGroupInfo_ptr( + kernel, device, CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE, sizeof(local), + (void *)&local, sizeof(kernel_max_subgroup_size), + (void *)&kernel_max_subgroup_size, &realSize); + if (error != CL_SUCCESS) + { + log_error("ERROR: %s function error for " + "CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE", + subgroupsApiSet.clGetKernelSubGroupInfo_name); + return TEST_FAIL; } + log_info( + "The CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE for the kernel is %d.\n", + (int)kernel_max_subgroup_size); + if (realSize != sizeof(kernel_max_subgroup_size)) + { + log_error("ERROR: Returned size of max sub group size not valid! " + "(Expected %d, got %d)\n", + (int)sizeof(kernel_max_subgroup_size), (int)realSize); + return TEST_FAIL; + } + error = clGetKernelSubGroupInfo_ptr( + kernel, device, CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE, sizeof(local), + (void *)&local, sizeof(kernel_subgroup_count), + (void *)&kernel_subgroup_count, &realSize); + if (error != CL_SUCCESS) + { + log_error("ERROR: %s function error " + "for CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE", + subgroupsApiSet.clGetKernelSubGroupInfo_name); + return TEST_FAIL; + } + log_info( + "The CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE for the kernel is %d.\n", + (int)kernel_subgroup_count); - error = clGetKernelSubGroupInfoKHR_ptr(kernel, device, CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE_KHR, - sizeof(local), (void *)&local, sizeof(kernel_subgroup_count), (void *)&kernel_subgroup_count, &realSize); - test_error(error, "clGetKernelSubGroupInfoKHR failed for CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE_KHR"); - log_info("The CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE_KHR for the kernel is %d.\n", (int)kernel_subgroup_count); - - if (realSize != sizeof(kernel_subgroup_count)) { - log_error( "ERROR: Returned size of sub group count not valid! (Expected %d, got %d)\n", (int)sizeof(kernel_subgroup_count), (int)realSize ); - return -1; + if (realSize != sizeof(kernel_subgroup_count)) + { + log_error("ERROR: Returned size of sub group count not valid! " + "(Expected %d, got %d)\n", + (int)sizeof(kernel_subgroup_count), (int)realSize); + return TEST_FAIL; } // Verify that the kernel gets the same max_subgroup_size and subgroup_count - out = clCreateBuffer(context, CL_MEM_WRITE_ONLY, sizeof(result), NULL, &error); + out = clCreateBuffer(context, CL_MEM_WRITE_ONLY, sizeof(result), NULL, + &error); test_error(error, "clCreateBuffer failed"); error = clSetKernelArg(kernel, 0, sizeof(out), &out); test_error(error, "clSetKernelArg failed"); - error = clEnqueueNDRangeKernel(queue, kernel, max_dimensions, NULL, global, local, 0, NULL, NULL); + error = clEnqueueNDRangeKernel(queue, kernel, max_dimensions, NULL, global, + local, 0, NULL, NULL); test_error(error, "clEnqueueNDRangeKernel failed"); - error = clEnqueueReadBuffer(queue, out, CL_FALSE, 0, sizeof(result), &result, 0, NULL, NULL); + error = clEnqueueReadBuffer(queue, out, CL_FALSE, 0, sizeof(result), + &result, 0, NULL, NULL); test_error(error, "clEnqueueReadBuffer failed"); error = clFinish(queue); test_error(error, "clFinish failed"); - for (i=0; i<(int)gsize0; ++i) { - if (result[i].maxSubGroupSize != (cl_uint)kernel_max_subgroup_size) { - log_error("ERROR: get_max_subgroup_size() doesn't match result from clGetKernelSubGroupInfoKHR, %u vs %u\n", - result[i].maxSubGroupSize, (cl_uint)kernel_max_subgroup_size); + for (i = 0; i < (int)gsize0; ++i) + { + if (result[i].maxSubGroupSize != (cl_uint)kernel_max_subgroup_size) + { + log_error("ERROR: get_max_subgroup_size() doesn't match result " + "from clGetKernelSubGroupInfoKHR, %u vs %u\n", + result[i].maxSubGroupSize, + (cl_uint)kernel_max_subgroup_size); return -1; } - if (result[i].numSubGroups != (cl_uint)kernel_subgroup_count) { - log_error("ERROR: get_num_sub_groups() doesn't match result from clGetKernelSubGroupInfoKHR, %u vs %u\n", + if (result[i].numSubGroups != (cl_uint)kernel_subgroup_count) + { + log_error("ERROR: get_num_sub_groups() doesn't match result from " + "clGetKernelSubGroupInfoKHR, %u vs %u\n", result[i].numSubGroups, (cl_uint)kernel_subgroup_count); return -1; } @@ -134,3 +191,23 @@ test_sub_group_info(cl_device_id device, cl_context context, cl_command_queue qu return 0; } +int test_sub_group_info_core(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements) +{ + return test_sub_group_info(device, context, queue, num_elements, true); +} + +int test_sub_group_info_ext(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements) +{ + bool hasExtension = is_extension_available(device, "cl_khr_subgroups"); + + if (!hasExtension) + { + log_info( + "Device does not support 'cl_khr_subgroups'. Skipping the test.\n"); + return TEST_SKIPPED_ITSELF; + } + + return test_sub_group_info(device, context, queue, num_elements, false); +} \ No newline at end of file diff --git a/test_conformance/subgroups/test_workgroup.cpp b/test_conformance/subgroups/test_workgroup.cpp index ee7693d3..779d30f6 100644 --- a/test_conformance/subgroups/test_workgroup.cpp +++ b/test_conformance/subgroups/test_workgroup.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -15,280 +15,206 @@ // #include "procs.h" #include "subhelpers.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/conversions.h" +#include "harness/typeWrappers.h" -static const char * any_source = -"__kernel void test_any(const __global Type *in, __global int2 *xy, __global Type *out)\n" -"{\n" -" int gid = get_global_id(0);\n" -" XY(xy,gid);\n" -" out[gid] = sub_group_any(in[gid]);\n" -"}\n"; +static const char *any_source = "__kernel void test_any(const __global Type " + "*in, __global int2 *xy, __global Type *out)\n" + "{\n" + " int gid = get_global_id(0);\n" + " XY(xy,gid);\n" + " out[gid] = sub_group_any(in[gid]);\n" + "}\n"; -static const char * all_source = -"__kernel void test_all(const __global Type *in, __global int2 *xy, __global Type *out)\n" -"{\n" -" int gid = get_global_id(0);\n" -" XY(xy,gid);\n" -" out[gid] = sub_group_all(in[gid]);\n" -"}\n"; +static const char *all_source = "__kernel void test_all(const __global Type " + "*in, __global int2 *xy, __global Type *out)\n" + "{\n" + " int gid = get_global_id(0);\n" + " XY(xy,gid);\n" + " out[gid] = sub_group_all(in[gid]);\n" + "}\n"; -static const char * bcast_source = -"__kernel void test_bcast(const __global Type *in, __global int2 *xy, __global Type *out)\n" -"{\n" -" int gid = get_global_id(0);\n" -" XY(xy,gid);\n" -" Type x = in[gid];\n" -" size_t loid = (size_t)((int)x % 100);\n" -" out[gid] = sub_group_broadcast(x, loid);\n" -"}\n"; +static const char *bcast_source = + "__kernel void test_bcast(const __global Type *in, __global int2 *xy, " + "__global Type *out)\n" + "{\n" + " int gid = get_global_id(0);\n" + " XY(xy,gid);\n" + " Type x = in[gid];\n" + " size_t loid = (size_t)((int)x % 100);\n" + " out[gid] = sub_group_broadcast(x, loid);\n" + "}\n"; -static const char * redadd_source = -"__kernel void test_redadd(const __global Type *in, __global int2 *xy, __global Type *out)\n" -"{\n" -" int gid = get_global_id(0);\n" -" XY(xy,gid);\n" -" out[gid] = sub_group_reduce_add(in[gid]);\n" -"}\n"; +static const char *redadd_source = + "__kernel void test_redadd(const __global Type *in, __global int2 *xy, " + "__global Type *out)\n" + "{\n" + " int gid = get_global_id(0);\n" + " XY(xy,gid);\n" + " out[gid] = sub_group_reduce_add(in[gid]);\n" + "}\n"; -static const char * redmax_source = -"__kernel void test_redmax(const __global Type *in, __global int2 *xy, __global Type *out)\n" -"{\n" -" int gid = get_global_id(0);\n" -" XY(xy,gid);\n" -" out[gid] = sub_group_reduce_max(in[gid]);\n" -"}\n"; +static const char *redmax_source = + "__kernel void test_redmax(const __global Type *in, __global int2 *xy, " + "__global Type *out)\n" + "{\n" + " int gid = get_global_id(0);\n" + " XY(xy,gid);\n" + " out[gid] = sub_group_reduce_max(in[gid]);\n" + "}\n"; -static const char * redmin_source = -"__kernel void test_redmin(const __global Type *in, __global int2 *xy, __global Type *out)\n" -"{\n" -" int gid = get_global_id(0);\n" -" XY(xy,gid);\n" -" out[gid] = sub_group_reduce_min(in[gid]);\n" -"}\n"; +static const char *redmin_source = + "__kernel void test_redmin(const __global Type *in, __global int2 *xy, " + "__global Type *out)\n" + "{\n" + " int gid = get_global_id(0);\n" + " XY(xy,gid);\n" + " out[gid] = sub_group_reduce_min(in[gid]);\n" + "}\n"; -static const char * scinadd_source = -"__kernel void test_scinadd(const __global Type *in, __global int2 *xy, __global Type *out)\n" -"{\n" -" int gid = get_global_id(0);\n" -" XY(xy,gid);\n" -" out[gid] = sub_group_scan_inclusive_add(in[gid]);\n" -"}\n"; +static const char *scinadd_source = + "__kernel void test_scinadd(const __global Type *in, __global int2 *xy, " + "__global Type *out)\n" + "{\n" + " int gid = get_global_id(0);\n" + " XY(xy,gid);\n" + " out[gid] = sub_group_scan_inclusive_add(in[gid]);\n" + "}\n"; -static const char * scinmax_source = -"__kernel void test_scinmax(const __global Type *in, __global int2 *xy, __global Type *out)\n" -"{\n" -" int gid = get_global_id(0);\n" -" XY(xy,gid);\n" -" out[gid] = sub_group_scan_inclusive_max(in[gid]);\n" -"}\n"; +static const char *scinmax_source = + "__kernel void test_scinmax(const __global Type *in, __global int2 *xy, " + "__global Type *out)\n" + "{\n" + " int gid = get_global_id(0);\n" + " XY(xy,gid);\n" + " out[gid] = sub_group_scan_inclusive_max(in[gid]);\n" + "}\n"; -static const char * scinmin_source = -"__kernel void test_scinmin(const __global Type *in, __global int2 *xy, __global Type *out)\n" -"{\n" -" int gid = get_global_id(0);\n" -" XY(xy,gid);\n" -" out[gid] = sub_group_scan_inclusive_min(in[gid]);\n" -"}\n"; +static const char *scinmin_source = + "__kernel void test_scinmin(const __global Type *in, __global int2 *xy, " + "__global Type *out)\n" + "{\n" + " int gid = get_global_id(0);\n" + " XY(xy,gid);\n" + " out[gid] = sub_group_scan_inclusive_min(in[gid]);\n" + "}\n"; -static const char * scexadd_source = -"__kernel void test_scexadd(const __global Type *in, __global int2 *xy, __global Type *out)\n" -"{\n" -" int gid = get_global_id(0);\n" -" XY(xy,gid);\n" -" out[gid] = sub_group_scan_exclusive_add(in[gid]);\n" -"}\n"; +static const char *scexadd_source = + "__kernel void test_scexadd(const __global Type *in, __global int2 *xy, " + "__global Type *out)\n" + "{\n" + " int gid = get_global_id(0);\n" + " XY(xy,gid);\n" + " out[gid] = sub_group_scan_exclusive_add(in[gid]);\n" + "}\n"; -static const char * scexmax_source = -"__kernel void test_scexmax(const __global Type *in, __global int2 *xy, __global Type *out)\n" -"{\n" -" int gid = get_global_id(0);\n" -" XY(xy,gid);\n" -" out[gid] = sub_group_scan_exclusive_max(in[gid]);\n" -"}\n"; +static const char *scexmax_source = + "__kernel void test_scexmax(const __global Type *in, __global int2 *xy, " + "__global Type *out)\n" + "{\n" + " int gid = get_global_id(0);\n" + " XY(xy,gid);\n" + " out[gid] = sub_group_scan_exclusive_max(in[gid]);\n" + "}\n"; -static const char * scexmin_source = -"__kernel void test_scexmin(const __global Type *in, __global int2 *xy, __global Type *out)\n" -"{\n" -" int gid = get_global_id(0);\n" -" XY(xy,gid);\n" -" out[gid] = sub_group_scan_exclusive_min(in[gid]);\n" -"}\n"; +static const char *scexmin_source = + "__kernel void test_scexmin(const __global Type *in, __global int2 *xy, " + "__global Type *out)\n" + "{\n" + " int gid = get_global_id(0);\n" + " XY(xy,gid);\n" + " out[gid] = sub_group_scan_exclusive_min(in[gid]);\n" + "}\n"; -// These need to stay in sync with the kernel source below -#define NUM_LOC 49 -#define INST_LOC_MASK 0x7f -#define INST_OP_SHIFT 0 -#define INST_OP_MASK 0xf -#define INST_LOC_SHIFT 4 -#define INST_VAL_SHIFT 12 -#define INST_VAL_MASK 0x7ffff -#define INST_END 0x0 -#define INST_STORE 0x1 -#define INST_WAIT 0x2 -#define INST_COUNT 0x3 - -static const char * ifp_source = -"#define NUM_LOC 49\n" -"#define INST_LOC_MASK 0x7f\n" -"#define INST_OP_SHIFT 0\n" -"#define INST_OP_MASK 0xf\n" -"#define INST_LOC_SHIFT 4\n" -"#define INST_VAL_SHIFT 12\n" -"#define INST_VAL_MASK 0x7ffff\n" -"#define INST_END 0x0\n" -"#define INST_STORE 0x1\n" -"#define INST_WAIT 0x2\n" -"#define INST_COUNT 0x3\n" -"\n" -"__kernel void\n" -"test_ifp(const __global int *in, __global int2 *xy, __global int *out)\n" -"{\n" -" __local atomic_int loc[NUM_LOC];\n" -"\n" -" // Don't run if there is only one sub group\n" -" if (get_num_sub_groups() == 1)\n" -" return;\n" -"\n" -" // First initialize loc[]\n" -" int lid = (int)get_local_id(0);\n" -"\n" -" if (lid < NUM_LOC)\n" -" atomic_init(loc+lid, 0);\n" -"\n" -" work_group_barrier(CLK_LOCAL_MEM_FENCE);\n" -"\n" -" // Compute pointer to this sub group's \"instructions\"\n" -" const __global int *pc = in +\n" -" ((int)get_group_id(0)*(int)get_enqueued_num_sub_groups() +\n" -" (int)get_sub_group_id()) *\n" -" (NUM_LOC+1);\n" -"\n" -" // Set up to \"run\"\n" -" bool ok = (int)get_sub_group_local_id() == 0;\n" -" bool run = true;\n" -"\n" -" while (run) {\n" -" int inst = *pc++;\n" -" int iop = (inst >> INST_OP_SHIFT) & INST_OP_MASK;\n" -" int iloc = (inst >> INST_LOC_SHIFT) & INST_LOC_MASK;\n" -" int ival = (inst >> INST_VAL_SHIFT) & INST_VAL_MASK;\n" -"\n" -" switch (iop) {\n" -" case INST_STORE:\n" -" if (ok)\n" -" atomic_store(loc+iloc, ival);\n" -" break;\n" -" case INST_WAIT:\n" -" if (ok) {\n" -" while (atomic_load(loc+iloc) != ival)\n" -" ;\n" -" }\n" -" break;\n" -" case INST_COUNT:\n" -" if (ok) {\n" -" int i;\n" -" for (i=0;i -struct AA { +template struct AA +{ static void gen(cl_int *x, cl_int *t, cl_int *m, int ns, int nw, int ng) { int i, ii, j, k, n; - int nj = (nw + ns - 1)/ns; + int nj = (nw + ns - 1) / ns; int e; ii = 0; - for (k=0; k nw ? nw - ii : ns; e = (int)(genrand_int32(gMTdata) % 3); // Initialize data matrix indexed by local id and sub group id - switch (e) { - case 0: - memset(&t[ii], 0, n*sizeof(cl_int)); - break; - case 1: - memset(&t[ii], 0, n*sizeof(cl_int)); - i = (int)(genrand_int32(gMTdata) % (cl_uint)n); - t[ii + i] = 41; - break; - case 2: - memset(&t[ii], 0xff, n*sizeof(cl_int)); - break; + switch (e) + { + case 0: memset(&t[ii], 0, n * sizeof(cl_int)); break; + case 1: + memset(&t[ii], 0, n * sizeof(cl_int)); + i = (int)(genrand_int32(gMTdata) % (cl_uint)n); + t[ii + i] = 41; + break; + case 2: memset(&t[ii], 0xff, n * sizeof(cl_int)); break; } } // Now map into work group using map from device - for (j=0;j nw ? nw - ii : ns; // Compute target - if (Which == 0) { + if (Which == 0) + { taa = 0; - for (i=0; i -struct RED { +template struct RED +{ static void gen(Ty *x, Ty *t, cl_int *m, int ns, int nw, int ng) { int i, ii, j, k, n; - int nj = (nw + ns - 1)/ns; + int nj = (nw + ns - 1) / ns; ii = 0; - for (k=0; k nw ? nw - ii : ns; - for (i=0; i::val()); + log_info(" sub_group_reduce_%s(%s)...\n", + Which == 0 ? "add" : (Which == 1 ? "max" : "min"), + TypeName::val()); - for (k=0; k nw ? nw - ii : ns; // Compute target - if (Which == 0) { + if (Which == 0) + { // add tr = mx[ii]; - for (i=1; i mx[ii + i] ? tr : mx[ii + i]; - } else if (Which == 2) { + } + else if (Which == 2) + { // min tr = mx[ii]; - for (i=1; i mx[ii + i] ? mx[ii + i] : tr; } // Check result - for (i=0; i::val(), i, j, k); + for (i = 0; i < n; ++i) + { + rr = my[ii + i]; + if (rr != tr) + { + log_error("ERROR: sub_group_reduce_%s(%s) mismatch for " + "local id %d in sub group %d in group %d\n", + Which == 0 ? "add" + : (Which == 1 ? "max" : "min"), + TypeName::val(), i, j, k); return -1; } } @@ -383,7 +328,7 @@ struct RED { x += nw; y += nw; - m += 2*nw; + m += 2 * nw; } return 0; @@ -391,69 +336,91 @@ struct RED { }; // Scan Inclusive functions -template -struct SCIN { +template struct SCIN +{ static void gen(Ty *x, Ty *t, cl_int *m, int ns, int nw, int ng) { int i, ii, j, k, n; - int nj = (nw + ns - 1)/ns; + int nj = (nw + ns - 1) / ns; ii = 0; - for (k=0; k nw ? nw - ii : ns; - for (i=0; i::val()); + log_info(" sub_group_scan_inclusive_%s(%s)...\n", + Which == 0 ? "add" : (Which == 1 ? "max" : "min"), + TypeName::val()); - for (k=0; k nw ? nw - ii : ns; // Check result - for (i=0; i mx[ii + i] ? tr : mx[ii + i]); - } else { - tr = i == 0 ? mx[ii] : (tr > mx[ii + i] ? mx[ii + i] : tr); + } + else if (Which == 1) + { + tr = i == 0 ? mx[ii] + : (tr > mx[ii + i] ? tr : mx[ii + i]); + } + else + { + tr = i == 0 ? mx[ii] + : (tr > mx[ii + i] ? mx[ii + i] : tr); } - rr = my[ii+i]; - if (rr != tr) { - log_error("ERROR: sub_group_scan_inclusive_%s(%s) mismatch for local id %d in sub group %d in group %d\n", - Which == 0 ? "add" : (Which == 1 ? "max" : "min"), TypeName::val(), i, j, k); + rr = my[ii + i]; + if (rr != tr) + { + log_error( + "ERROR: sub_group_scan_inclusive_%s(%s) mismatch " + "for local id %d in sub group %d in group %d\n", + Which == 0 ? "add" : (Which == 1 ? "max" : "min"), + TypeName::val(), i, j, k); return -1; } } @@ -461,7 +428,7 @@ struct SCIN { x += nw; y += nw; - m += 2*nw; + m += 2 * nw; } return 0; @@ -469,69 +436,91 @@ struct SCIN { }; // Scan Exclusive functions -template -struct SCEX { +template struct SCEX +{ static void gen(Ty *x, Ty *t, cl_int *m, int ns, int nw, int ng) { int i, ii, j, k, n; - int nj = (nw + ns - 1)/ns; + int nj = (nw + ns - 1) / ns; ii = 0; - for (k=0; k nw ? nw - ii : ns; - for (i=0; i::val()); + log_info(" sub_group_scan_exclusive_%s(%s)...\n", + Which == 0 ? "add" : (Which == 1 ? "max" : "min"), + TypeName::val()); - for (k=0; k nw ? nw - ii : ns; // Check result - for (i=0; i::val() : tr + trt; - } else if (Which == 1) { - tr = i == 0 ? TypeIdentity::val() : (trt > tr ? trt : tr); - } else { - tr = i == 0 ? TypeIdentity::val() : (trt > tr ? tr : trt); + for (i = 0; i < n; ++i) + { + if (Which == 0) + { + tr = i == 0 ? TypeIdentity::val() : tr + trt; } - trt = mx[ii+i]; - rr = my[ii+i]; + else if (Which == 1) + { + tr = i == 0 ? TypeIdentity::val() + : (trt > tr ? trt : tr); + } + else + { + tr = i == 0 ? TypeIdentity::val() + : (trt > tr ? tr : trt); + } + trt = mx[ii + i]; + rr = my[ii + i]; - if (rr != tr) { - log_error("ERROR: sub_group_scan_exclusive_%s(%s) mismatch for local id %d in sub group %d in group %d\n", - Which == 0 ? "add" : (Which == 1 ? "max" : "min"), TypeName::val(), i, j, k); + if (rr != tr) + { + log_error( + "ERROR: sub_group_scan_exclusive_%s(%s) mismatch " + "for local id %d in sub group %d in group %d\n", + Which == 0 ? "add" : (Which == 1 ? "max" : "min"), + TypeName::val(), i, j, k); return -1; } } @@ -539,7 +528,7 @@ struct SCEX { x += nw; y += nw; - m += 2*nw; + m += 2 * nw; } return 0; @@ -547,64 +536,77 @@ struct SCEX { }; // Broadcast functios -template -struct BC { +template struct BC +{ static void gen(Ty *x, Ty *t, cl_int *m, int ns, int nw, int ng) { int i, ii, j, k, l, n; - int nj = (nw + ns - 1)/ns; + int nj = (nw + ns - 1) / ns; int d = ns > 100 ? 100 : ns; ii = 0; - for (k=0; k nw ? nw - ii : ns; - l = (int)(genrand_int32(gMTdata) & 0x7fffffff) % (d > n ? n : d); + l = (int)(genrand_int32(gMTdata) & 0x7fffffff) + % (d > n ? n : d); - for (i=0; i::val()); - for (k=0; k nw ? nw - ii : ns; l = (int)mx[ii] % 100; - tr = mx[ii+l]; + tr = mx[ii + l]; // Check result - for (i=0; i::val(), i, j, k); + for (i = 0; i < n; ++i) + { + rr = my[ii + i]; + if (rr != tr) + { + log_error("ERROR: sub_group_broadcast(%s) mismatch for " + "local id %d in sub group %d in group %d\n", + TypeName::val(), i, j, k); return -1; } } @@ -612,256 +614,114 @@ struct BC { x += nw; y += nw; - m += 2*nw; + m += 2 * nw; } return 0; } }; -// Independent forward progress stuff -// Note: -// Output needs num_groups * NUM_LOC elements -// local_size must be > NUM_LOC -// Input needs num_groups * num_sub_groups * (NUM_LOC+1) elements - -static inline int -inst(int op, int loc, int val) -{ - return (val << INST_VAL_SHIFT) | (loc << INST_LOC_SHIFT) | (op << INST_OP_SHIFT); -} - -void gen_insts(cl_int *x, cl_int *p, int n) -{ - int i, j0, j1; - int val; - int ii[NUM_LOC]; - - // Create a random permutation of 0...NUM_LOC-1 - ii[0] = 0; - for (i=1; i> INST_OP_SHIFT) & INST_OP_MASK; - cl_int iloc = (inst >> INST_LOC_SHIFT) & INST_LOC_MASK; - cl_int ival = (inst >> INST_VAL_SHIFT) & INST_VAL_MASK; - scont = false; - - switch (iop) { - case INST_STORE: - loc[iloc] = ival; - ++p[i]; - scont = true; - break; - case INST_WAIT: - if (loc[iloc] == ival) { - ++p[i]; - scont = true; - } - break; - case INST_COUNT: - loc[iloc] += ival; - ++p[i]; - scont = true; - break; - case INST_END: - ++nend; - break; - } - } while (scont); - } - } while (nend < n); - - // Return result, reusing "p" - memcpy(p, loc, sizeof(loc)); -} - - -struct IFP { - static void gen(cl_int *x, cl_int *t, cl_int *, int ns, int nw, int ng) - { - int k; - int nj = (nw + ns - 1) / ns; - - // We need at least 2 sub groups per group for this test - if (nj == 1) - return; - - for (k=0; k, G, L>::run(device, context, queue, num_elements, "test_any", any_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_all", all_source); + template cl_int run() + { + cl_int error; + error = test, G, L>::run(device_, context_, queue_, + num_elements_, "test_bcast", + bcast_source, 0, useCoreSubgroups_); + error |= test, G, L>::run( + device_, context_, queue_, num_elements_, "test_redadd", + redadd_source, 0, useCoreSubgroups_); + error |= test, G, L>::run( + device_, context_, queue_, num_elements_, "test_redmax", + redmax_source, 0, useCoreSubgroups_); + error |= test, G, L>::run( + device_, context_, queue_, num_elements_, "test_redmin", + redmin_source, 0, useCoreSubgroups_); + error |= test, G, L>::run( + device_, context_, queue_, num_elements_, "test_scinadd", + scinadd_source, 0, useCoreSubgroups_); + error |= test, G, L>::run( + device_, context_, queue_, num_elements_, "test_scinmax", + scinmax_source, 0, useCoreSubgroups_); + error |= test, G, L>::run( + device_, context_, queue_, num_elements_, "test_scinmin", + scinmin_source, 0, useCoreSubgroups_); + error |= test, G, L>::run( + device_, context_, queue_, num_elements_, "test_scexadd", + scexadd_source, 0, useCoreSubgroups_); + error |= test, G, L>::run( + device_, context_, queue_, num_elements_, "test_scexmax", + scexmax_source, 0, useCoreSubgroups_); + error |= test, G, L>::run( + device_, context_, queue_, num_elements_, "test_scexmin", + scexmin_source, 0, useCoreSubgroups_); + return error; + } - // error |= test, G, L>::run(device, context, queue, num_elements, "test_bcast", bcast_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_bcast", bcast_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_bcast", bcast_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_bcast", bcast_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_bcast", bcast_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_bcast", bcast_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_bcast", bcast_source); +private: + cl_device_id device_; + cl_context context_; + cl_command_queue queue_; + int num_elements_; + bool useCoreSubgroups_; +}; - // error |= test, G, L>::run(device, context, queue, num_elements, "test_redadd", redadd_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_redadd", redadd_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_redadd", redadd_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_redadd", redadd_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_redadd", redadd_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_redadd", redadd_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_redadd", redadd_source); +// Entry point from main +int test_work_group_functions(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements, + bool useCoreSubgroups) +{ + int error; + error = test, G, L>::run(device, context, queue, num_elements, + "test_any", any_source, 0, + useCoreSubgroups); + error |= test, G, L>::run(device, context, queue, num_elements, + "test_all", all_source, 0, + useCoreSubgroups); + run_for_type rft(device, context, queue, num_elements, useCoreSubgroups); + error |= rft.run(); + error |= rft.run(); + error |= rft.run(); + error |= rft.run(); + error |= rft.run(); + error |= rft.run(); + // error |= rft.run(); - // error |= test, G, L>::run(device, context, queue, num_elements, "test_redmax", redmax_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_redmax", redmax_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_redmax", redmax_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_redmax", redmax_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_redmax", redmax_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_redmax", redmax_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_redmax", redmax_source); - - // error |= test, G, L>::run(device, context, queue, num_elements, "test_redmin", redmin_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_redmin", redmin_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_redmin", redmin_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_redmin", redmin_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_redmin", redmin_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_redmin", redmin_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_redmin", redmin_source); - - // error |= test, G, L>::run(device, context, queue, num_elements, "test_scinadd", scinadd_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scinadd", scinadd_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scinadd", scinadd_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scinadd", scinadd_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scinadd", scinadd_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scinadd", scinadd_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scinadd", scinadd_source); - - // error |= test, G, L>::run(device, context, queue, num_elements, "test_scinmax", scinmax_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scinmax", scinmax_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scinmax", scinmax_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scinmax", scinmax_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scinmax", scinmax_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scinmax", scinmax_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scinmax", scinmax_source); - - // error |= test, G, L>::run(device, context, queue, num_elements, "test_scinmin", scinmin_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scinmin", scinmin_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scinmin", scinmin_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scinmin", scinmin_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scinmin", scinmin_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scinmin", scinmin_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scinmin", scinmin_source); - - // error |= test, G, L>::run(device, context, queue, num_elements, "test_scexadd", scexadd_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scexadd", scexadd_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scexadd", scexadd_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scexadd", scexadd_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scexadd", scexadd_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scexadd", scexadd_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scexadd", scexadd_source); - - // error |= test, G, L>::run(device, context, queue, num_elements, "test_scexmax", scexmax_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scexmax", scexmax_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scexmax", scexmax_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scexmax", scexmax_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scexmax", scexmax_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scexmax", scexmax_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scexmax", scexmax_source); - - // error |= test, G, L>::run(device, context, queue, num_elements, "test_scexmin", scexmin_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scexmin", scexmin_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scexmin", scexmin_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scexmin", scexmin_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scexmin", scexmin_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scexmin", scexmin_source); - error |= test, G, L>::run(device, context, queue, num_elements, "test_scexmin", scexmin_source); - - error |= test::run(device, context, queue, num_elements, "test_ifp", ifp_source, NUM_LOC + 1); return error; } +int test_work_group_functions_core(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements) +{ + return test_work_group_functions(device, context, queue, num_elements, + true); +} + +int test_work_group_functions_ext(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements) +{ + bool hasExtension = is_extension_available(device, "cl_khr_subgroups"); + + if (!hasExtension) + { + log_info( + "Device does not support 'cl_khr_subgroups'. Skipping the test.\n"); + return TEST_SKIPPED_ITSELF; + } + return test_work_group_functions(device, context, queue, num_elements, + false); +} diff --git a/test_conformance/subgroups/test_workitem.cpp b/test_conformance/subgroups/test_workitem.cpp index e18d4ab9..b77bfe1a 100644 --- a/test_conformance/subgroups/test_workitem.cpp +++ b/test_conformance/subgroups/test_workitem.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -14,143 +14,166 @@ // limitations under the License. // #include "procs.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/conversions.h" +#include "harness/typeWrappers.h" -struct get_test_data { +struct get_test_data +{ cl_uint subGroupSize; cl_uint maxSubGroupSize; cl_uint numSubGroups; cl_uint enqNumSubGroups; cl_uint subGroupId; cl_uint subGroupLocalId; - bool operator==(get_test_data x) { - return subGroupSize == x.subGroupSize && - maxSubGroupSize == x.maxSubGroupSize && - numSubGroups == x.numSubGroups && - subGroupId == x.subGroupId && - subGroupLocalId == x.subGroupLocalId; + bool operator==(get_test_data x) + { + return subGroupSize == x.subGroupSize + && maxSubGroupSize == x.maxSubGroupSize + && numSubGroups == x.numSubGroups && subGroupId == x.subGroupId + && subGroupLocalId == x.subGroupLocalId; } }; -static const char * get_test_source = -"#pragma OPENCL EXTENSION cl_khr_subgroups : enable\n" -"\n" -"typedef struct {\n" -" uint subGroupSize;\n" -" uint maxSubGroupSize;\n" -" uint numSubGroups;\n" -" uint enqNumSubGroups;\n" -" uint subGroupId;\n" -" uint subGroupLocalId;\n" -"} get_test_data;\n" -"\n" -"__kernel void get_test( __global get_test_data *outData )\n" -"{\n" -" int gid = get_global_id( 0 );\n" -" outData[gid].subGroupSize = get_sub_group_size();\n" -" outData[gid].maxSubGroupSize = get_max_sub_group_size();\n" -" outData[gid].numSubGroups = get_num_sub_groups();\n" -" outData[gid].enqNumSubGroups = get_enqueued_num_sub_groups();\n" -" outData[gid].subGroupId = get_sub_group_id();\n" -" outData[gid].subGroupLocalId = get_sub_group_local_id();\n" -"}"; - -static int -check_group(const get_test_data *result, int nw, cl_uint ensg, int maxwgs) +static int check_group(const get_test_data *result, int nw, cl_uint ensg, + int maxwgs) { int first = -1; int last = -1; int i, j; cl_uint hit[32]; - for (i=0; i maxwgs) { - log_error("ERROR: get_max_subgroup_size() returned incorrect result: %u\n", result[first].maxSubGroupSize); + if (result[first].maxSubGroupSize == 0 + || result[first].maxSubGroupSize > maxwgs) + { + log_error( + "ERROR: get_max_subgroup_size() returned incorrect result: %u\n", + result[first].maxSubGroupSize); return -1; } - if (result[first].subGroupSize > result[first].maxSubGroupSize) { + if (result[first].subGroupSize > result[first].maxSubGroupSize) + { log_error("ERROR: get_sub_group_size() > get_max_sub_group_size()\n"); return -1; } - if (result[last].subGroupSize > result[first].subGroupSize) { + if (result[last].subGroupSize > result[first].subGroupSize) + { log_error("ERROR: last sub group larger than first sub group\n"); return -1; } - if (result[first].numSubGroups == 0 || result[first].numSubGroups > ensg) { - log_error("ERROR: get_num_sub_groups() returned incorrect result: %u \n", result[first].numSubGroups); + if (result[first].numSubGroups == 0 || result[first].numSubGroups > ensg) + { + log_error( + "ERROR: get_num_sub_groups() returned incorrect result: %u \n", + result[first].numSubGroups); return -1; } memset(hit, 0, sizeof(hit)); - for (i=0; i= result[first].numSubGroups) { - log_error("ERROR: get_sub_group_id() returned out of range value: %u\n", result[i].subGroupId); + if (result[i].subGroupId >= result[first].numSubGroups) + { + log_error( + "ERROR: get_sub_group_id() returned out of range value: %u\n", + result[i].subGroupId); return -1; } - if (result[i].enqNumSubGroups != ensg) { - log_error("ERROR: get_enqueued_num_sub_groups() returned incorrect value: %u\n", result[i].enqNumSubGroups); + if (result[i].enqNumSubGroups != ensg) + { + log_error("ERROR: get_enqueued_num_sub_groups() returned incorrect " + "value: %u\n", + result[i].enqNumSubGroups); return -1; } - if (result[first].numSubGroups > 1) { - if (result[i].subGroupId < result[first].numSubGroups-1) { - if (result[i].subGroupSize != result[first].subGroupSize) { - log_error("ERROR: unexpected variation in get_*_sub_group_*()\n"); + if (result[first].numSubGroups > 1) + { + if (result[i].subGroupId < result[first].numSubGroups - 1) + { + if (result[i].subGroupSize != result[first].subGroupSize) + { + log_error( + "ERROR: unexpected variation in get_*_sub_group_*()\n"); return -1; } - if (result[i].subGroupLocalId >= result[first].subGroupSize) { - log_error("ERROR: get_sub_group_local_id() returned out of bounds value: %u \n", result[i].subGroupLocalId); - return -1; - } - } else { - if (result[i].subGroupSize != result[last].subGroupSize) { - log_error("ERROR: unexpected variation in get_*_sub_group_*()\n"); - return -1; - } - if (result[i].subGroupLocalId >= result[last].subGroupSize) { - log_error("ERROR: get_sub_group_local_id() returned out of bounds value: %u \n", result[i].subGroupLocalId); + if (result[i].subGroupLocalId >= result[first].subGroupSize) + { + log_error("ERROR: get_sub_group_local_id() returned out of " + "bounds value: %u \n", + result[i].subGroupLocalId); return -1; } } - } else { - if (result[i].subGroupSize != result[first].subGroupSize) { - log_error("ERROR: unexpected variation in get_*_sub_group_*()\n"); + else + { + if (result[i].subGroupSize != result[last].subGroupSize) + { + log_error( + "ERROR: unexpected variation in get_*_sub_group_*()\n"); + return -1; + } + if (result[i].subGroupLocalId >= result[last].subGroupSize) + { + log_error("ERROR: get_sub_group_local_id() returned out of " + "bounds value: %u \n", + result[i].subGroupLocalId); + return -1; + } + } + } + else + { + if (result[i].subGroupSize != result[first].subGroupSize) + { + log_error( + "ERROR: unexpected variation in get_*_sub_group_*()\n"); return -1; } - if (result[i].subGroupLocalId >= result[first].subGroupSize) { - log_error("ERROR: get_sub_group_local_id() returned out of bounds value: %u \n", result[i].subGroupLocalId); + if (result[i].subGroupLocalId >= result[first].subGroupSize) + { + log_error("ERROR: get_sub_group_local_id() returned out of " + "bounds value: %u \n", + result[i].subGroupLocalId); return -1; } } - j = (result[first].subGroupSize + 31)/32 * result[i].subGroupId + (result[i].subGroupLocalId >> 5); - if (j < sizeof(hit)/4) { + j = (result[first].subGroupSize + 31) / 32 * result[i].subGroupId + + (result[i].subGroupLocalId >> 5); + if (j < sizeof(hit) / 4) + { cl_uint b = 1U << (result[i].subGroupLocalId & 0x1fU); - if ((hit[j] & b) != 0) { - log_error("ERROR: get_sub_group_local_id() repeated a result in the same sub group\n"); + if ((hit[j] & b) != 0) + { + log_error("ERROR: get_sub_group_local_id() repeated a result " + "in the same sub group\n"); return -1; } hit[j] |= b; @@ -160,8 +183,9 @@ check_group(const get_test_data *result, int nw, cl_uint ensg, int maxwgs) return 0; } -int -test_work_item_functions(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) +int test_work_item_functions(cl_device_id device, cl_context context, + cl_command_queue queue, int num_elements, + bool useCoreSubgroups) { static const size_t lsize = 200; int error; @@ -170,28 +194,56 @@ test_work_item_functions(cl_device_id device, cl_context context, cl_command_que cl_uint ensg; size_t global; size_t local; - get_test_data result[lsize*6]; + get_test_data result[lsize * 6]; clProgramWrapper program; clKernelWrapper kernel; clMemWrapper out; - - error = create_single_kernel_helper_with_build_options(context, &program, &kernel, 1, &get_test_source, "get_test", "-cl-std=CL2.0"); - if (error != 0) - return error; + std::stringstream kernel_sstr; + if (useCoreSubgroups) + { + kernel_sstr << "#pragma OPENCL EXTENSION cl_khr_subgroups : enable\n"; + } + kernel_sstr + << "\n" + "\n" + "typedef struct {\n" + " uint subGroupSize;\n" + " uint maxSubGroupSize;\n" + " uint numSubGroups;\n" + " uint enqNumSubGroups;\n" + " uint subGroupId;\n" + " uint subGroupLocalId;\n" + "} get_test_data;\n" + "\n" + "__kernel void get_test( __global get_test_data *outData )\n" + "{\n" + " int gid = get_global_id( 0 );\n" + " outData[gid].subGroupSize = get_sub_group_size();\n" + " outData[gid].maxSubGroupSize = get_max_sub_group_size();\n" + " outData[gid].numSubGroups = get_num_sub_groups();\n" + " outData[gid].enqNumSubGroups = get_enqueued_num_sub_groups();\n" + " outData[gid].subGroupId = get_sub_group_id();\n" + " outData[gid].subGroupLocalId = get_sub_group_local_id();\n" + "}"; + const std::string &kernel_str = kernel_sstr.str(); + const char *kernel_src = kernel_str.c_str(); + error = create_single_kernel_helper_with_build_options( + context, &program, &kernel, 1, &kernel_src, "get_test", + "-cl-std=CL2.0"); + if (error != 0) return error; error = get_max_allowed_work_group_size(context, kernel, &local, NULL); - if (error != 0) - return error; + if (error != 0) return error; maxwgs = (int)local; // Limit it a bit so we have muliple work groups // Ideally this will still be large enough to give us multiple subgroups - if (local > lsize) - local = lsize; + if (local > lsize) local = lsize; // Create our buffer - out = clCreateBuffer(context, CL_MEM_READ_WRITE, sizeof(result), NULL, &error); + out = clCreateBuffer(context, CL_MEM_READ_WRITE, sizeof(result), NULL, + &error); test_error(error, "clCreateBuffer failed"); // Set argument @@ -206,13 +258,16 @@ test_work_item_functions(cl_device_id device, cl_context context, cl_command_que // Collect the data memset((void *)&result, 0xf0, sizeof(result)); - error = clEnqueueWriteBuffer(queue, out, CL_FALSE, 0, sizeof(result), (void *)&result, 0, NULL, NULL); + error = clEnqueueWriteBuffer(queue, out, CL_FALSE, 0, sizeof(result), + (void *)&result, 0, NULL, NULL); test_error(error, "clEnqueueWriteBuffer failed"); - error = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, &local, 0, NULL, NULL); + error = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, &local, 0, + NULL, NULL); test_error(error, "clEnqueueNDRangeKernel failed"); - error = clEnqueueReadBuffer(queue, out, CL_FALSE, 0, sizeof(result), (void *)&result, 0, NULL, NULL); + error = clEnqueueReadBuffer(queue, out, CL_FALSE, 0, sizeof(result), + (void *)&result, 0, NULL, NULL); test_error(error, "clEnqueueReadBuffer failed"); error = clFinish(queue); @@ -223,30 +278,54 @@ test_work_item_functions(cl_device_id device, cl_context context, cl_command_que // Check the first group error = check_group(result, nw, ensg, maxwgs); - if (error) - return error; + if (error) return error; q = (int)global / nw; r = (int)global % nw; // Check the remaining work groups including the last if it is the same size - for (k=1; k #include diff --git a/test_conformance/thread_dimensions/procs.h b/test_conformance/thread_dimensions/procs.h index ea2c6949..d01d3c50 100644 --- a/test_conformance/thread_dimensions/procs.h +++ b/test_conformance/thread_dimensions/procs.h @@ -13,11 +13,11 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/mt19937.h" +#include "harness/kernelHelpers.h" +#include "harness/testHarness.h" +#include "harness/errorHelpers.h" +#include "harness/conversions.h" +#include "harness/mt19937.h" extern const int kVectorSizeCount; diff --git a/test_conformance/thread_dimensions/test_thread_dimensions.c b/test_conformance/thread_dimensions/test_thread_dimensions.cpp similarity index 90% rename from test_conformance/thread_dimensions/test_thread_dimensions.c rename to test_conformance/thread_dimensions/test_thread_dimensions.cpp index c7ec5e59..84f5708f 100644 --- a/test_conformance/thread_dimensions/test_thread_dimensions.c +++ b/test_conformance/thread_dimensions/test_thread_dimensions.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -33,8 +33,6 @@ int limit_size = 0; static int get_maximums(cl_kernel kernel, cl_context context, size_t *max_workgroup_size_result, - size_t *max_width_result, - size_t *max_height_result, cl_ulong *max_allcoation_result, cl_ulong *max_physical_result) { int err = 0; @@ -63,13 +61,9 @@ get_maximums(cl_kernel kernel, cl_context context, return -1; } - // Iterate over them and find the maximum local workgroup size and image size + // Iterate over them and find the maximum local workgroup size size_t max_workgroup_size = 0; size_t current_workgroup_size = 0; - size_t max_width = 0; - size_t current_width = 0; - size_t max_height = 0; - size_t current_height = 0; cl_ulong max_allocation = 0; cl_ulong current_allocation = 0; cl_ulong max_physical = 0; @@ -88,30 +82,6 @@ get_maximums(cl_kernel kernel, cl_context context, else if (current_workgroup_size < max_workgroup_size) max_workgroup_size = current_workgroup_size; - // Max image width for this device - err = clGetDeviceInfo(devices[i], CL_DEVICE_IMAGE2D_MAX_WIDTH, sizeof(current_width), ¤t_width, NULL); - if(err != CL_SUCCESS) - { - log_error("clGetDeviceConfigInfo(CL_DEVICE_IMAGE2D_MAX_WIDTH) failed (%d) for device %d.\n", err, i); - return -10; - } - if (max_width == 0) - max_width = current_width; - else if (current_width < max_width) - max_width = current_width; - - // Max image height for this device - err = clGetDeviceInfo(devices[i], CL_DEVICE_IMAGE2D_MAX_HEIGHT, sizeof(current_height), ¤t_height, NULL); - if(err != CL_SUCCESS) - { - log_error("clGetDeviceConfigInfo(CL_DEVICE_IMAGE2D_MAX_HEIGHT) failed (%d) for device %d.\n", err, i); - return -10; - } - if (max_height == 0) - max_height = current_height; - else if (current_height < max_height) - max_height = current_height; - // Get the maximum allocation size err = clGetDeviceInfo(devices[i], CL_DEVICE_MAX_MEM_ALLOC_SIZE, sizeof(current_allocation), ¤t_allocation, NULL); if(err != CL_SUCCESS) @@ -138,11 +108,9 @@ get_maximums(cl_kernel kernel, cl_context context, } free(devices); - log_info("Device maximums: max local workgroup size:%d, max width: %d, max height: %d, max allocation size: %g MB, max physical memory %gMB\n", - (int)max_workgroup_size, (int)max_width, (int)max_height, (double)(max_allocation/1024.0/1024.0), (double)(max_physical/1024.0/1024.0)); + log_info("Device maximums: max local workgroup size:%d, max allocation size: %g MB, max physical memory %gMB\n", + (int)max_workgroup_size, (double)(max_allocation/1024.0/1024.0), (double)(max_physical/1024.0/1024.0)); *max_workgroup_size_result = max_workgroup_size; - *max_width_result = max_width; - *max_height_result = max_height; *max_allcoation_result = max_allocation; *max_physical_result = max_physical; return 0; @@ -171,12 +139,6 @@ static const char *thread_dimension_kernel_code_atomic_long = " if (error)\n" " atom_or(&dst[t_address-start_address], error);\n" "\n" -"}\n" -"\n" -"__kernel void clear_memory(__global uint *dst)\n\n" -"{\n" -" dst[get_global_id(0)] = 0;\n" -"\n" "}\n"; static const char *thread_dimension_kernel_code_not_atomic_long = @@ -200,12 +162,6 @@ static const char *thread_dimension_kernel_code_not_atomic_long = " if (error)\n" " dst[t_address-start_address]|=error;\n" "\n" -"}\n" -"\n" -"__kernel void clear_memory(__global uint *dst)\n\n" -"{\n" -" dst[get_global_id(0)] = 0;\n" -"\n" "}\n"; static const char *thread_dimension_kernel_code_atomic_not_long = @@ -231,12 +187,6 @@ static const char *thread_dimension_kernel_code_atomic_not_long = " if (error)\n" " atom_or(&dst[t_address-start_address], error);\n" "\n" -"}\n" -"\n" -"__kernel void clear_memory(__global uint *dst)\n\n" -"{\n" -" dst[get_global_id(0)] = 0;\n" -"\n" "}\n"; static const char *thread_dimension_kernel_code_not_atomic_not_long = @@ -260,20 +210,8 @@ static const char *thread_dimension_kernel_code_not_atomic_not_long = " if (error)\n" " dst[t_address-start_address]|=error;\n" "\n" -"}\n" -"\n" -"__kernel void clear_memory(__global uint *dst)\n\n" -"{\n" -" dst[get_global_id(0)] = 0;\n" -"\n" "}\n"; - - -static size_t max_workgroup_size_for_clear_kernel; -cl_kernel clear_memory_kernel = 0; - - char dim_str[128]; char * print_dimensions(size_t x, size_t y, size_t z, cl_uint dim) { @@ -339,31 +277,19 @@ int run_test(cl_context context, cl_command_queue queue, cl_kernel kernel, cl_me while (end_valid_memory_address <= last_memory_address) { int err; - // Clear the memory - // // Manually -- much slower on the GPU - // memset((void*)data, 0, memory_size); - // err = clWriteArray(context, array, 0, 0, memory_size, data, NULL); - // if (err != CL_SUCCESS) { - // log_error("Failed to write to data array: %d\n", err); - // free(data); - // return -4; - // } - // In a kernel - err = clSetKernelArg(clear_memory_kernel, 0, sizeof(array), &array); + const int fill_pattern = 0x0; + err = clEnqueueFillBuffer(queue, + array, + (void*)&fill_pattern, + sizeof(fill_pattern), + 0, + memory_size, + 0, + NULL, + NULL); if (err != CL_SUCCESS) { - print_error( err, "Failed to set args for clear_memory_kernel to clear the memory between runs"); - return -4; - } - size_t global[3] = {1,0,0}; - global[0] = (cl_uint)(memory_size/sizeof(cl_uint)); - size_t local[3] = {1,0,0}; - local[0] = max_workgroup_size_for_clear_kernel; - while( global[0] % local[0] ) //make sure that global[0] is evenly divided by local[0]. Will stop at 1 in worst case. - local[0]--; - err = clEnqueueNDRangeKernel(queue, clear_memory_kernel, 1, NULL, global, local, 0, NULL, NULL); - if (err != CL_SUCCESS) { - print_error( err, "Failed to execute clear_memory_kernel to clear the memory between runs"); - return -4; + print_error( err, "Failed to set fill buffer."); + return -3; } cl_ulong start_valid_index = start_valid_memory_address/sizeof(cl_uint); @@ -545,26 +471,14 @@ test_thread_dimensions(cl_device_id device, cl_context context, cl_command_queue err = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(max_local_workgroup_size), max_local_workgroup_size, NULL); test_error(err, "clGetDeviceInfo failed for CL_DEVICE_MAX_WORK_ITEM_SIZES"); - clear_memory_kernel = clCreateKernel(program, "clear_memory", &err); - if (err) - { - log_error("clCreateKernel failed: %d\n", err); - return -1; - } - // Get the maximum sizes supported by this device size_t max_workgroup_size = 0; - size_t max_width = 0; - size_t max_height = 0; cl_ulong max_allocation = 0; cl_ulong max_physical = 0; int found_size = 0; err = get_maximums(kernel, context, - &max_workgroup_size, &max_width, &max_height, &max_allocation, &max_physical); - - err = get_maximums(clear_memory_kernel, context, - &max_workgroup_size_for_clear_kernel, &max_width, &max_height, &max_allocation, &max_physical); + &max_workgroup_size, &max_allocation, &max_physical); // Make sure we don't try to allocate more than half the physical memory present. if (max_allocation > (max_physical/2)) { @@ -854,7 +768,6 @@ test_thread_dimensions(cl_device_id device, cl_context context, cl_command_queue errors++; clReleaseMemObject(array); clReleaseKernel(kernel); - clReleaseKernel(clear_memory_kernel); clReleaseProgram(program); free_mtdata(d); return -1; @@ -896,7 +809,6 @@ test_thread_dimensions(cl_device_id device, cl_context context, cl_command_queue free_mtdata(d); clReleaseMemObject(array); clReleaseKernel(kernel); - clReleaseKernel(clear_memory_kernel); clReleaseProgram(program); if (errors) log_error("%d total errors.\n", errors); diff --git a/test_conformance/vec_align/CMakeLists.txt b/test_conformance/vec_align/CMakeLists.txt deleted file mode 100644 index c66f559a..00000000 --- a/test_conformance/vec_align/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -set(MODULE_NAME VECALIGN) - -set(${MODULE_NAME}_SOURCES - globals.c - main.c - structs.c - test_vec_align.c - type_replacer.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/mt19937.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/conversions.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c -) - -set_source_files_properties( - COMPILE_FLAGS -msse2) - -include(../CMakeCommon.txt) - diff --git a/test_conformance/vec_align/globals.c b/test_conformance/vec_align/globals.c deleted file mode 100644 index 3deecadf..00000000 --- a/test_conformance/vec_align/globals.c +++ /dev/null @@ -1,59 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "defines.h" - - -// 1,2,3,4,8,16 or -// 1,2,4,8,16,3 -int g_arrVecSizes[NUM_VECTOR_SIZES] = {1,2,3,4,8,16}; -int g_arrVecSteps[NUM_VECTOR_SIZES] = {1,2,4,4,8,16}; -const char * g_arrVecSizeNames[NUM_VECTOR_SIZES] = {"", "2","3","4","8","16"}; -size_t g_arrVecAlignMasks[NUM_VECTOR_SIZES] = {(size_t)0, - (size_t)0x1, // 2 - (size_t)0x3, // 3 - (size_t)0x3, // 4 - (size_t)0x7, // 8 - (size_t)0xf // 16 -}; - -bool g_wimpyMode = false; - -ExplicitType types[] = { kChar, kUChar, - kShort, kUShort, - kInt, kUInt, - kLong, kULong, - kFloat, kDouble, - kNumExplicitTypes }; - - -const char *g_arrTypeNames[] = - { - "char", "uchar", - "short", "ushort", - "int", "uint", - "long", "ulong", - "float", "double" - }; - -extern const size_t g_arrTypeSizes[] = - { - 1, 1, - 2, 2, - 4, 4, - 8, 8, - 4, 8 - }; - diff --git a/test_conformance/vec_align/main.c b/test_conformance/vec_align/main.c deleted file mode 100644 index 46c872d9..00000000 --- a/test_conformance/vec_align/main.c +++ /dev/null @@ -1,41 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include "procs.h" -#include "../../test_common/harness/testHarness.h" - -#if !defined(_WIN32) -#include -#endif - -test_definition test_list[] = { - ADD_TEST( vec_align_array ), - ADD_TEST( vec_align_struct ), - ADD_TEST( vec_align_packed_struct ), - ADD_TEST( vec_align_struct_arr ), - ADD_TEST( vec_align_packed_struct_arr ), -}; - -const int test_num = ARRAY_SIZE( test_list ); - -int main(int argc, const char *argv[]) -{ - return runTestHarness( argc, argv, test_num, test_list, false, false, 0 ); -} - diff --git a/test_conformance/vec_align/procs.h b/test_conformance/vec_align/procs.h deleted file mode 100644 index 595938b3..00000000 --- a/test_conformance/vec_align/procs.h +++ /dev/null @@ -1,39 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/threadTesting.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/mt19937.h" - -// The number of errors to print out for each test in the shuffle tests -#define MAX_ERRORS_TO_PRINT 1 - - -extern int create_program_and_kernel(const char *source, const char *kernel_name, cl_program *program_ret, cl_kernel *kernel_ret); - - -int test_vec_align_array(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -int test_vec_align_struct(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -int test_vec_align_packed_struct(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - - -int test_vec_align_struct_arr(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -int test_vec_align_packed_struct_arr(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); diff --git a/test_conformance/vec_align/structs.h b/test_conformance/vec_align/structs.h deleted file mode 100644 index 09c6d367..00000000 --- a/test_conformance/vec_align/structs.h +++ /dev/null @@ -1,73 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "testBase.h" - - -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" - -typedef struct _clState -{ - cl_device_id m_device; - cl_context m_context; - cl_command_queue m_queue; - - cl_program m_program; - cl_kernel m_kernel; - size_t m_numThreads; -} clState; - -clState * newClState(cl_device_id device, cl_context context, cl_command_queue queue); -clState * destroyClState(clState * pState); - -int clStateMakeProgram(clState * pState, const char * prog, - const char * kernelName); -void clStateDestroyProgramAndKernel(clState * pState); - -int runKernel(clState * pState, size_t numThreads); - -typedef struct _bufferStruct -{ - void * m_pIn; - void * m_pOut; - - cl_mem m_outBuffer; - cl_mem m_inBuffer; - - size_t m_bufSizeIn, m_bufSizeOut; - - int m_bufferUploaded; -} bufferStruct; - - -bufferStruct * newBufferStruct(size_t inSize, size_t outSize, clState * pClState); - -bufferStruct * destroyBufferStruct(bufferStruct * destroyMe, clState * pClState); - -void initContents(bufferStruct * pBufferStruct, clState * pClState, - size_t typeSize, - size_t vecWidth); - -int pushArgs(bufferStruct * pBufferStruct, clState * pClState); -int retrieveResults(bufferStruct * pBufferStruct, clState * pClState); - -// vecSizeIdx indexes into g_arrVecAlignMasks, g_arrVecSizeNames -// and g_arrVecSizes -int checkCorrectness(bufferStruct * pBufferStruct, clState * pClState, - size_t minAlign); - -int checkPackedCorrectness(bufferStruct * pBufferStruct, clState * pClState, - size_t totSize, size_t beforeSize); diff --git a/test_conformance/vec_align/type_replacer.h b/test_conformance/vec_align/type_replacer.h deleted file mode 100644 index f50b08d7..00000000 --- a/test_conformance/vec_align/type_replacer.h +++ /dev/null @@ -1,23 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include - -size_t doReplace(char * dest, size_t destLength, const char * source, - const char * stringToReplace1, const char * replaceWith1, - const char * stringToReplace2, const char * replaceWith2); - -size_t doSingleReplace(char * dest, size_t destLength, const char * source, - const char * stringToReplace, const char * replaceWith); diff --git a/test_conformance/vec_step/CMakeLists.txt b/test_conformance/vec_step/CMakeLists.txt deleted file mode 100644 index f9cf1a69..00000000 --- a/test_conformance/vec_step/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -set(MODULE_NAME VECSTEP) - -set(${MODULE_NAME}_SOURCES - globals.c - test_step.c - main.c - structs.c - type_replacer.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/mt19937.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c -) - -set_source_files_properties( - COMPILE_FLAGS -msse2) - -include(../CMakeCommon.txt) diff --git a/test_conformance/vec_step/defines.h b/test_conformance/vec_step/defines.h deleted file mode 100644 index 47af57ed..00000000 --- a/test_conformance/vec_step/defines.h +++ /dev/null @@ -1,41 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/threadTesting.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/mt19937.h" - - -// 1,2,3,4,8,16 or -// 1,2,4,8,16,3 -#define NUM_VECTOR_SIZES 6 - -extern int g_arrVecSizes[NUM_VECTOR_SIZES]; -extern int g_arrVecSteps[NUM_VECTOR_SIZES]; -extern bool g_wimpyMode; - -extern const char * g_arrVecSizeNames[NUM_VECTOR_SIZES]; - -// Define the buffer size that we want to block our test with -#define BUFFER_SIZE (1024*1024) -#define KPAGESIZE 4096 - -extern ExplicitType types[]; - -extern const char *g_arrTypeNames[]; -extern const size_t g_arrTypeSizes[]; diff --git a/test_conformance/vec_step/globals.c b/test_conformance/vec_step/globals.c deleted file mode 100644 index 029ae1c6..00000000 --- a/test_conformance/vec_step/globals.c +++ /dev/null @@ -1,52 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "defines.h" - - -// 1,2,3,4,8,16 or -// 1,2,4,8,16,3 -int g_arrVecSizes[NUM_VECTOR_SIZES] = {1,2,3,4,8,16}; -int g_arrVecSteps[NUM_VECTOR_SIZES] = {1,2,4,4,8,16}; -const char * g_arrVecSizeNames[NUM_VECTOR_SIZES] = {"", "2","3","4","8","16"}; - -bool g_wimpyMode = false; - -ExplicitType types[] = { kChar, kUChar, - kShort, kUShort, - kInt, kUInt, - kLong, kULong, - kFloat, kDouble, - kNumExplicitTypes }; - - -const char *g_arrTypeNames[] = - { - "char", "uchar", - "short", "ushort", - "int", "uint", - "long", "ulong", - "float", "double" - }; - -extern const size_t g_arrTypeSizes[] = - { - 1, 1, - 2, 2, - 4, 4, - 8, 8, - 4, 8 - }; - diff --git a/test_conformance/vec_step/procs.h b/test_conformance/vec_step/procs.h deleted file mode 100644 index c7461e17..00000000 --- a/test_conformance/vec_step/procs.h +++ /dev/null @@ -1,43 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/threadTesting.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/mt19937.h" - -// The number of errors to print out for each test in the shuffle tests -#define MAX_ERRORS_TO_PRINT 1 - - -extern int create_program_and_kernel(const char *source, const char *kernel_name, cl_program *program_ret, cl_kernel *kernel_ret); - - -/* - test_step_type, - test_step_var, - test_step_typedef_type, - test_step_typedef_var, -*/ - -extern int test_step_type(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_step_var(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_step_typedef_type(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_step_typedef_var(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); diff --git a/test_conformance/vec_step/structs.c b/test_conformance/vec_step/structs.c deleted file mode 100644 index b36e892f..00000000 --- a/test_conformance/vec_step/structs.c +++ /dev/null @@ -1,285 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "structs.h" - - -#include "defines.h" - -/** typedef struct _bufferStruct - { - void * m_pIn; - void * m_pOut; - - cl_mem m_outBuffer; - cl_mem m_inBuffer; - - size_t m_bufSize; - } bufferStruct; - */ - - -clState * newClState(cl_device_id device, cl_context context, cl_command_queue queue) -{ - clState * pResult = (clState *)malloc(sizeof(clState)); - - pResult->m_device = device; - pResult->m_context = context; - pResult->m_queue = queue; - - pResult->m_kernel = NULL; pResult->m_program = NULL; - return pResult; -} - -clState * destroyClState(clState * pState) -{ - clStateDestroyProgramAndKernel(pState); - free(pState); - return NULL; -} - - -int clStateMakeProgram(clState * pState, const char * prog, - const char * kernelName) -{ - const char * srcArr[1] = {NULL}; - srcArr[0] = prog; - int err = create_single_kernel_helper(pState->m_context, - &(pState->m_program), - &(pState->m_kernel), - 1, srcArr, kernelName ); - return err; -} - -int runKernel(clState * pState, size_t numThreads) { - int err; - pState->m_numThreads = numThreads; - err = clEnqueueNDRangeKernel(pState->m_queue, pState->m_kernel, - 1, NULL, &(pState->m_numThreads), - NULL, 0, NULL, NULL); - if(err != CL_SUCCESS) - { - log_error("clEnqueueNDRangeKernel returned %d (%x)\n", - err, err); - return -1; - } - return 0; -} - - -void clStateDestroyProgramAndKernel(clState * pState) -{ - if(pState->m_kernel != NULL) { - clReleaseKernel( pState->m_kernel ); - pState->m_kernel = NULL; - } - if(pState->m_program != NULL) { - clReleaseProgram( pState->m_program ); - pState->m_program = NULL; - } -} - -bufferStruct * newBufferStruct(size_t inSize, size_t outSize, clState * pClState) { - int error; - bufferStruct * pResult = (bufferStruct *)malloc(sizeof(bufferStruct)); - - pResult->m_bufSizeIn = inSize; - pResult->m_bufSizeOut = outSize; - - pResult->m_pIn = malloc(inSize); - pResult->m_pOut = malloc(outSize); - - pResult->m_inBuffer = clCreateBuffer(pClState->m_context, CL_MEM_READ_ONLY, - inSize, NULL, &error); - if( pResult->m_inBuffer == NULL ) - { - vlog_error( "clCreateArray failed for input (%d)\n", error ); - return destroyBufferStruct(pResult, pClState); - } - - pResult->m_outBuffer = clCreateBuffer( pClState->m_context, - CL_MEM_WRITE_ONLY, - outSize, - NULL, - &error ); - if( pResult->m_outBuffer == NULL ) - { - vlog_error( "clCreateArray failed for output (%d)\n", error ); - return destroyBufferStruct(pResult, pClState); - } - - return pResult; -} - -bufferStruct * destroyBufferStruct(bufferStruct * destroyMe, clState * pClState) { - if(destroyMe) - { - if(destroyMe->m_outBuffer != NULL) { - clReleaseMemObject(destroyMe->m_outBuffer); - destroyMe->m_outBuffer = NULL; - } - if(destroyMe->m_inBuffer != NULL) { - clReleaseMemObject(destroyMe->m_inBuffer); - destroyMe->m_inBuffer = NULL; - } - if(destroyMe->m_pIn != NULL) { - free(destroyMe->m_pIn); - destroyMe->m_pIn = NULL; - } - if(destroyMe->m_pOut != NULL) { - free(destroyMe->m_pOut); - destroyMe->m_pOut = NULL; - } - - free((void *)destroyMe); - destroyMe = NULL; - } - return destroyMe; -} - -void initContents(bufferStruct * pBufferStruct, clState * pClState, - size_t typeSize, - size_t countIn, size_t countOut ) -{ - size_t i; - - uint64_t start = 0; - - switch(typeSize) - { - case 1: { - uint8_t* ub = (uint8_t *)(pBufferStruct->m_pIn); - for (i=0; i < countIn; ++i) - { - ub[i] = (uint8_t)start++; - } - break; - } - case 2: { - uint16_t* us = (uint16_t *)(pBufferStruct->m_pIn); - for (i=0; i < countIn; ++i) - { - us[i] = (uint16_t)start++; - } - break; - } - case 4: { - if (!g_wimpyMode) { - uint32_t* ui = (uint32_t *)(pBufferStruct->m_pIn); - for (i=0; i < countIn; ++i) { - ui[i] = (uint32_t)start++; - } - } - else { - // The short test doesn't iterate over the entire 32 bit space so - // we alternate between positive and negative values - int32_t* ui = (int32_t *)(pBufferStruct->m_pIn); - int32_t sign = 1; - for (i=0; i < countIn; ++i, ++start) { - ui[i] = (int32_t)start*sign; - sign = sign * -1; - } - } - break; - } - case 8: { - // We don't iterate over the entire space of 64 bit so for the - // selects, we want to test positive and negative values - int64_t* ll = (int64_t *)(pBufferStruct->m_pIn); - int64_t sign = 1; - for (i=0; i < countIn; ++i, ++start) { - ll[i] = start*sign; - sign = sign * -1; - } - break; - } - default: { - log_error("invalid type size %x\n", (int)typeSize); - } - } - // pBufferStruct->m_bufSizeIn - // pBufferStruct->m_bufSizeOut -} - -int pushArgs(bufferStruct * pBufferStruct, clState * pClState) -{ - int err; - err = clEnqueueWriteBuffer(pClState->m_queue, pBufferStruct->m_inBuffer, - CL_TRUE, 0, pBufferStruct->m_bufSizeIn, - pBufferStruct->m_pIn, 0, NULL, NULL); - if(err != CL_SUCCESS) - { - log_error("clEnqueueWriteBuffer failed\n"); - return -1; - } - - err = clSetKernelArg(pClState->m_kernel, 0, - sizeof(pBufferStruct->m_inBuffer), // pBufferStruct->m_bufSizeIn, - &(pBufferStruct->m_inBuffer)); - if(err != CL_SUCCESS) - { - log_error("clSetKernelArgs failed, first arg (0)\n"); - return -1; - } - - err = clSetKernelArg(pClState->m_kernel, 1, - sizeof(pBufferStruct->m_outBuffer), // pBufferStruct->m_bufSizeOut, - &(pBufferStruct->m_outBuffer)); - if(err != CL_SUCCESS) - { - log_error("clSetKernelArgs failed, second arg (1)\n"); - return -1; - } - - return 0; -} - -int retrieveResults(bufferStruct * pBufferStruct, clState * pClState) -{ - int err; - err = clEnqueueReadBuffer(pClState->m_queue, pBufferStruct->m_outBuffer, - CL_TRUE, 0, pBufferStruct->m_bufSizeOut, - pBufferStruct->m_pOut, 0, NULL, NULL); - if(err != CL_SUCCESS) - { - log_error("clEnqueueReadBuffer failed\n"); - return -1; - } - return 0; -} - -int checkCorrectness(bufferStruct * pBufferStruct, clState * pClState, - size_t typeSize, - size_t vecWidth) -{ - size_t i; - cl_int targetSize = (cl_int) vecWidth; - cl_int * targetArr = (cl_int *)(pBufferStruct->m_pOut); - if(targetSize == 3) - { - targetSize = 4; // hack for 4-aligned vec3 types - } - for(i = 0; i < pClState->m_numThreads; ++i) - { - if(targetArr[i] != targetSize) - { - vlog_error("Error %ld (of %ld). Expected %d, got %d\n", - i, pClState->m_numThreads, - targetSize, targetArr[i]); - return -1; - } - } - return 0; -} diff --git a/test_conformance/vec_step/structs.h b/test_conformance/vec_step/structs.h deleted file mode 100644 index e9a4cdc3..00000000 --- a/test_conformance/vec_step/structs.h +++ /dev/null @@ -1,67 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "testBase.h" - - -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" - -typedef struct _clState -{ - cl_device_id m_device; - cl_context m_context; - cl_command_queue m_queue; - - cl_program m_program; - cl_kernel m_kernel; - size_t m_numThreads; -} clState; - -clState * newClState(cl_device_id device, cl_context context, cl_command_queue queue); -clState * destroyClState(clState * pState); - -int clStateMakeProgram(clState * pState, const char * prog, - const char * kernelName); -void clStateDestroyProgramAndKernel(clState * pState); - -int runKernel(clState * pState, size_t numThreads); - -typedef struct _bufferStruct -{ - void * m_pIn; - void * m_pOut; - - cl_mem m_outBuffer; - cl_mem m_inBuffer; - - size_t m_bufSizeIn, m_bufSizeOut; -} bufferStruct; - - -bufferStruct * newBufferStruct(size_t inSize, size_t outSize, clState * pClState); - -bufferStruct * destroyBufferStruct(bufferStruct * destroyMe, clState * pClState); - -void initContents(bufferStruct * pBufferStruct, clState * pClState, - size_t typeSize, - size_t vecWidth); - -int pushArgs(bufferStruct * pBufferStruct, clState * pClState); -int retrieveResults(bufferStruct * pBufferStruct, clState * pClState); - -int checkCorrectness(bufferStruct * pBufferStruct, clState * pClState, - size_t typeSize, - size_t vecWidth); diff --git a/test_conformance/vec_step/testBase.h b/test_conformance/vec_step/testBase.h deleted file mode 100644 index 00dcc07b..00000000 --- a/test_conformance/vec_step/testBase.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef _testBase_h -#define _testBase_h - -#include "../../test_common/harness/compat.h" - -#include -#include -#include -#include - -#include "procs.h" - -#endif // _testBase_h diff --git a/test_conformance/vec_step/type_replacer.c b/test_conformance/vec_step/type_replacer.c deleted file mode 100644 index 74967b2c..00000000 --- a/test_conformance/vec_step/type_replacer.c +++ /dev/null @@ -1,115 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include -#if !defined(_MSC_VER) -#include -#endif // !_MSC_VER - -size_t doReplace(char * dest, size_t destLength, const char * source, - const char * stringToReplace1, const char * replaceWith1, - const char * stringToReplace2, const char * replaceWith2) -{ - size_t copyCount = 0; - const char * sourcePtr = source; - char * destPtr = dest; - const char * ptr1; - const char * ptr2; - size_t nJump; - size_t len1, len2; - size_t lenReplace1, lenReplace2; - len1 = strlen(stringToReplace1); - len2 = strlen(stringToReplace2); - lenReplace1 = strlen(replaceWith1); - lenReplace2 = strlen(replaceWith2); - for(;copyCount < destLength && *sourcePtr; ) - { - ptr1 = strstr(sourcePtr, stringToReplace1); - ptr2 = strstr(sourcePtr, stringToReplace2); - if(ptr1 != NULL && (ptr2 == NULL || ptr2 > ptr1)) - { - nJump = ptr1-sourcePtr; - if(((uintptr_t)ptr1-(uintptr_t)sourcePtr) > destLength-copyCount) { return -1; } - copyCount += nJump; - strncpy(destPtr, sourcePtr, nJump); - destPtr += nJump; - sourcePtr += nJump + len1; - strcpy(destPtr, replaceWith1); - destPtr += lenReplace1; - } - else if(ptr2 != NULL && (ptr1 == NULL || ptr1 >= ptr2)) - { - nJump = ptr2-sourcePtr; - if(nJump > destLength-copyCount) { return -2; } - copyCount += nJump; - strncpy(destPtr, sourcePtr, nJump); - destPtr += nJump; - sourcePtr += nJump + len2; - strcpy(destPtr, replaceWith2); - destPtr += lenReplace2; - } - else - { - nJump = strlen(sourcePtr); - if(nJump > destLength-copyCount) { return -3; } - copyCount += nJump; - strcpy(destPtr, sourcePtr); - destPtr += nJump; - sourcePtr += nJump; - } - } - *destPtr = '\0'; - return copyCount; -} - -size_t doSingleReplace(char * dest, size_t destLength, const char * source, - const char * stringToReplace, const char * replaceWith) -{ - size_t copyCount = 0; - const char * sourcePtr = source; - char * destPtr = dest; - const char * ptr; - size_t nJump; - size_t len; - size_t lenReplace; - len = strlen(stringToReplace); - lenReplace = strlen(replaceWith); - for(;copyCount < destLength && *sourcePtr; ) - { - ptr = strstr(sourcePtr, stringToReplace); - if(ptr != NULL) - { - nJump = ptr-sourcePtr; - if(((uintptr_t)ptr-(uintptr_t)sourcePtr) > destLength-copyCount) { return -1; } - copyCount += nJump; - strncpy(destPtr, sourcePtr, nJump); - destPtr += nJump; - sourcePtr += nJump + len; - strcpy(destPtr, replaceWith); - destPtr += lenReplace; - } - else - { - nJump = strlen(sourcePtr); - if(nJump > destLength-copyCount) { return -3; } - copyCount += nJump; - strcpy(destPtr, sourcePtr); - destPtr += nJump; - sourcePtr += nJump; - } - } - *destPtr = '\0'; - return copyCount; -} diff --git a/test_conformance/vectors/CMakeLists.txt b/test_conformance/vectors/CMakeLists.txt new file mode 100644 index 00000000..278de203 --- /dev/null +++ b/test_conformance/vectors/CMakeLists.txt @@ -0,0 +1,12 @@ +set(MODULE_NAME VECTORS) + +set(${MODULE_NAME}_SOURCES + globals.cpp + main.cpp + structs.cpp + test_step.cpp + test_vec_align.cpp + type_replacer.cpp +) + +include(../CMakeCommon.txt) diff --git a/test_conformance/vec_align/defines.h b/test_conformance/vectors/defines.h similarity index 71% rename from test_conformance/vec_align/defines.h rename to test_conformance/vectors/defines.h index 69d9f5fb..c96c3dad 100644 --- a/test_conformance/vec_align/defines.h +++ b/test_conformance/vectors/defines.h @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -13,12 +13,12 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/threadTesting.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/mt19937.h" +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" +#include "harness/threadTesting.h" +#include "harness/typeWrappers.h" +#include "harness/conversions.h" +#include "harness/mt19937.h" // 1,2,3,4,8,16 or @@ -29,11 +29,11 @@ extern int g_arrVecSizes[NUM_VECTOR_SIZES]; extern int g_arrVecSteps[NUM_VECTOR_SIZES]; extern bool g_wimpyMode; -extern const char * g_arrVecSizeNames[NUM_VECTOR_SIZES]; +extern const char *g_arrVecSizeNames[NUM_VECTOR_SIZES]; extern size_t g_arrVecAlignMasks[NUM_VECTOR_SIZES]; // Define the buffer size that we want to block our test with -#define BUFFER_SIZE (1024*1024) +#define BUFFER_SIZE (1024 * 1024) #define KPAGESIZE 4096 extern ExplicitType types[]; diff --git a/test_conformance/vectors/globals.cpp b/test_conformance/vectors/globals.cpp new file mode 100644 index 00000000..6dee6d96 --- /dev/null +++ b/test_conformance/vectors/globals.cpp @@ -0,0 +1,46 @@ +// +// Copyright (c) 2017 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "defines.h" + + +// 1,2,3,4,8,16 or +// 1,2,4,8,16,3 +int g_arrVecSizes[NUM_VECTOR_SIZES] = { 1, 2, 3, 4, 8, 16 }; +int g_arrVecSteps[NUM_VECTOR_SIZES] = { 1, 2, 4, 4, 8, 16 }; +const char *g_arrVecSizeNames[NUM_VECTOR_SIZES] = { + "", "2", "3", "4", "8", "16" +}; +size_t g_arrVecAlignMasks[NUM_VECTOR_SIZES] = { + (size_t)0, + (size_t)0x1, // 2 + (size_t)0x3, // 3 + (size_t)0x3, // 4 + (size_t)0x7, // 8 + (size_t)0xf // 16 +}; + +bool g_wimpyMode = false; + +ExplicitType types[] = { + kChar, kUChar, kShort, kUShort, kInt, kUInt, kLong, + kULong, kFloat, kDouble, kNumExplicitTypes +}; + + +const char *g_arrTypeNames[] = { "char", "uchar", "short", "ushort", "int", + "uint", "long", "ulong", "float", "double" }; + +extern const size_t g_arrTypeSizes[] = { 1, 1, 2, 2, 4, 4, 8, 8, 4, 8 }; diff --git a/test_conformance/vec_step/main.c b/test_conformance/vectors/main.cpp similarity index 62% rename from test_conformance/vec_step/main.c rename to test_conformance/vectors/main.cpp index 21bffda8..98f278c3 100644 --- a/test_conformance/vec_step/main.c +++ b/test_conformance/vectors/main.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -13,28 +13,32 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include #include "procs.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" #if !defined(_WIN32) #include #endif test_definition test_list[] = { - ADD_TEST( step_type ), - ADD_TEST( step_var ), - ADD_TEST( step_typedef_type ), - ADD_TEST( step_typedef_var ), + ADD_TEST(step_type), + ADD_TEST(step_var), + ADD_TEST(step_typedef_type), + ADD_TEST(step_typedef_var), + ADD_TEST(vec_align_array), + ADD_TEST(vec_align_struct), + ADD_TEST(vec_align_packed_struct), + ADD_TEST(vec_align_struct_arr), + ADD_TEST(vec_align_packed_struct_arr), }; -const int test_num = ARRAY_SIZE( test_list ); +const int test_num = ARRAY_SIZE(test_list); int main(int argc, const char *argv[]) { - return runTestHarness( argc, argv, test_num, test_list, false, false, 0 ); + return runTestHarness(argc, argv, test_num, test_list, false, false, 0); } - diff --git a/test_conformance/vectors/procs.h b/test_conformance/vectors/procs.h new file mode 100644 index 00000000..db423a6a --- /dev/null +++ b/test_conformance/vectors/procs.h @@ -0,0 +1,55 @@ +// +// Copyright (c) 2017 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" +#include "harness/threadTesting.h" +#include "harness/typeWrappers.h" +#include "harness/conversions.h" +#include "harness/mt19937.h" + +// The number of errors to print out for each test in the shuffle tests +#define MAX_ERRORS_TO_PRINT 1 + + +extern int create_program_and_kernel(const char *source, + const char *kernel_name, + cl_program *program_ret, + cl_kernel *kernel_ret); + +extern int test_step_type(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_step_var(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_step_typedef_type(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); +extern int test_step_typedef_var(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); + +int test_vec_align_array(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); + +int test_vec_align_struct(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); + +int test_vec_align_packed_struct(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); + + +int test_vec_align_struct_arr(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); + +int test_vec_align_packed_struct_arr(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements); diff --git a/test_conformance/vec_align/structs.c b/test_conformance/vectors/structs.cpp similarity index 57% rename from test_conformance/vec_align/structs.c rename to test_conformance/vectors/structs.cpp index 2e15e36f..9bfa389b 100644 --- a/test_conformance/vec_align/structs.c +++ b/test_conformance/vectors/structs.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -33,9 +33,10 @@ */ -clState * newClState(cl_device_id device, cl_context context, cl_command_queue queue) +clState *newClState(cl_device_id device, cl_context context, + cl_command_queue queue) { - clState * pResult = (clState *)malloc(sizeof(clState)); + clState *pResult = (clState *)malloc(sizeof(clState)); #if DEBUG_MEM_ALLOC log_info("malloc clState * %x\n", pResult); #endif @@ -44,11 +45,12 @@ clState * newClState(cl_device_id device, cl_context context, cl_command_queue q pResult->m_context = context; pResult->m_queue = queue; - pResult->m_kernel = NULL; pResult->m_program = NULL; + pResult->m_kernel = NULL; + pResult->m_program = NULL; return pResult; } -clState * destroyClState(clState * pState) +clState *destroyClState(clState *pState) { clStateDestroyProgramAndKernel(pState); #if DEBUG_MEM_ALLOC @@ -59,55 +61,56 @@ clState * destroyClState(clState * pState) } -int clStateMakeProgram(clState * pState, const char * prog, - const char * kernelName) +int clStateMakeProgram(clState *pState, const char *prog, + const char *kernelName) { - const char * srcArr[1] = {NULL}; + const char *srcArr[1] = { NULL }; srcArr[0] = prog; - int err = create_single_kernel_helper(pState->m_context, - &(pState->m_program), - &(pState->m_kernel), - 1, srcArr, kernelName ); + int err = + create_single_kernel_helper(pState->m_context, &(pState->m_program), + &(pState->m_kernel), 1, srcArr, kernelName); #if DEBUG_MEM_ALLOC log_info("create program and kernel\n"); #endif return err; } -int runKernel(clState * pState, size_t numThreads) { +int runKernel(clState *pState, size_t numThreads) +{ int err; pState->m_numThreads = numThreads; - err = clEnqueueNDRangeKernel(pState->m_queue, pState->m_kernel, - 1, NULL, &(pState->m_numThreads), - NULL, 0, NULL, NULL); - if(err != CL_SUCCESS) + err = clEnqueueNDRangeKernel(pState->m_queue, pState->m_kernel, 1, NULL, + &(pState->m_numThreads), NULL, 0, NULL, NULL); + if (err != CL_SUCCESS) { - log_error("clEnqueueNDRangeKernel returned %d (%x)\n", - err, err); + log_error("clEnqueueNDRangeKernel returned %d (%x)\n", err, err); return -1; } return 0; } -void clStateDestroyProgramAndKernel(clState * pState) +void clStateDestroyProgramAndKernel(clState *pState) { #if DEBUG_MEM_ALLOC log_info("destroy program and kernel\n"); #endif - if(pState->m_kernel != NULL) { - clReleaseKernel( pState->m_kernel ); + if (pState->m_kernel != NULL) + { + clReleaseKernel(pState->m_kernel); pState->m_kernel = NULL; } - if(pState->m_program != NULL) { - clReleaseProgram( pState->m_program ); + if (pState->m_program != NULL) + { + clReleaseProgram(pState->m_program); pState->m_program = NULL; } } -bufferStruct * newBufferStruct(size_t inSize, size_t outSize, clState * pClState) { +bufferStruct *newBufferStruct(size_t inSize, size_t outSize, clState *pClState) +{ int error; - bufferStruct * pResult = (bufferStruct *)malloc(sizeof(bufferStruct)); + bufferStruct *pResult = (bufferStruct *)malloc(sizeof(bufferStruct)); #if DEBUG_MEM_ALLOC log_info("malloc bufferStruct * %x\n", pResult); #endif @@ -124,23 +127,20 @@ bufferStruct * newBufferStruct(size_t inSize, size_t outSize, clState * pClState pResult->m_inBuffer = clCreateBuffer(pClState->m_context, CL_MEM_READ_ONLY, inSize, NULL, &error); - if( pResult->m_inBuffer == NULL ) + if (pResult->m_inBuffer == NULL) { - vlog_error( "clCreateArray failed for input (%d)\n", error ); + vlog_error("clCreateArray failed for input (%d)\n", error); return destroyBufferStruct(pResult, pClState); } #if DEBUG_MEM_ALLOC log_info("clCreateBuffer %x\n", pResult->m_inBuffer); #endif - pResult->m_outBuffer = clCreateBuffer( pClState->m_context, - CL_MEM_WRITE_ONLY, - outSize, - NULL, - &error ); - if( pResult->m_outBuffer == NULL ) + pResult->m_outBuffer = clCreateBuffer( + pClState->m_context, CL_MEM_WRITE_ONLY, outSize, NULL, &error); + if (pResult->m_outBuffer == NULL) { - vlog_error( "clCreateArray failed for output (%d)\n", error ); + vlog_error("clCreateArray failed for output (%d)\n", error); return destroyBufferStruct(pResult, pClState); } #if DEBUG_MEM_ALLOC @@ -152,31 +152,36 @@ bufferStruct * newBufferStruct(size_t inSize, size_t outSize, clState * pClState return pResult; } -bufferStruct * destroyBufferStruct(bufferStruct * destroyMe, clState * pClState) { - if(destroyMe) +bufferStruct *destroyBufferStruct(bufferStruct *destroyMe, clState *pClState) +{ + if (destroyMe) { - if(destroyMe->m_outBuffer != NULL) { + if (destroyMe->m_outBuffer != NULL) + { #if DEBUG_MEM_ALLOC log_info("clReleaseMemObject %x\n", destroyMe->m_outBuffer); #endif clReleaseMemObject(destroyMe->m_outBuffer); destroyMe->m_outBuffer = NULL; } - if(destroyMe->m_inBuffer != NULL) { + if (destroyMe->m_inBuffer != NULL) + { #if DEBUG_MEM_ALLOC log_info("clReleaseMemObject %x\n", destroyMe->m_outBuffer); #endif clReleaseMemObject(destroyMe->m_inBuffer); destroyMe->m_inBuffer = NULL; } - if(destroyMe->m_pIn != NULL) { + if (destroyMe->m_pIn != NULL) + { #if DEBUG_MEM_ALLOC log_info("delete (free) m_pIn %x\n", destroyMe->m_pIn); #endif free(destroyMe->m_pIn); destroyMe->m_pIn = NULL; } - if(destroyMe->m_pOut != NULL) { + if (destroyMe->m_pOut != NULL) + { #if DEBUG_MEM_ALLOC log_info("delete (free) m_pOut %x\n", destroyMe->m_pOut); #endif @@ -192,46 +197,49 @@ bufferStruct * destroyBufferStruct(bufferStruct * destroyMe, clState * pClState) return destroyMe; } -void initContents(bufferStruct * pBufferStruct, clState * pClState, - size_t typeSize, - size_t countIn, size_t countOut ) +void initContents(bufferStruct *pBufferStruct, clState *pClState, + size_t typeSize, size_t countIn, size_t countOut) { size_t i; uint64_t start = 0; - switch(typeSize) + switch (typeSize) { case 1: { - uint8_t* ub = (uint8_t *)(pBufferStruct->m_pIn); - for (i=0; i < countIn; ++i) + uint8_t *ub = (uint8_t *)(pBufferStruct->m_pIn); + for (i = 0; i < countIn; ++i) { ub[i] = (uint8_t)start++; } break; } case 2: { - uint16_t* us = (uint16_t *)(pBufferStruct->m_pIn); - for (i=0; i < countIn; ++i) + uint16_t *us = (uint16_t *)(pBufferStruct->m_pIn); + for (i = 0; i < countIn; ++i) { us[i] = (uint16_t)start++; } break; } case 4: { - if (!g_wimpyMode) { - uint32_t* ui = (uint32_t *)(pBufferStruct->m_pIn); - for (i=0; i < countIn; ++i) { + if (!g_wimpyMode) + { + uint32_t *ui = (uint32_t *)(pBufferStruct->m_pIn); + for (i = 0; i < countIn; ++i) + { ui[i] = (uint32_t)start++; } } - else { - // The short test doesn't iterate over the entire 32 bit space so - // we alternate between positive and negative values - int32_t* ui = (int32_t *)(pBufferStruct->m_pIn); + else + { + // The short test doesn't iterate over the entire 32 bit space + // so we alternate between positive and negative values + int32_t *ui = (int32_t *)(pBufferStruct->m_pIn); int32_t sign = 1; - for (i=0; i < countIn; ++i, ++start) { - ui[i] = (int32_t)start*sign; + for (i = 0; i < countIn; ++i, ++start) + { + ui[i] = (int32_t)start * sign; sign = sign * -1; } } @@ -240,10 +248,11 @@ void initContents(bufferStruct * pBufferStruct, clState * pClState, case 8: { // We don't iterate over the entire space of 64 bit so for the // selects, we want to test positive and negative values - int64_t* ll = (int64_t *)(pBufferStruct->m_pIn); + int64_t *ll = (int64_t *)(pBufferStruct->m_pIn); int64_t sign = 1; - for (i=0; i < countIn; ++i, ++start) { - ll[i] = start*sign; + for (i = 0; i < countIn; ++i, ++start) + { + ll[i] = start * sign; sign = sign * -1; } break; @@ -256,10 +265,10 @@ void initContents(bufferStruct * pBufferStruct, clState * pClState, // pBufferStruct->m_bufSizeOut } -int pushArgs(bufferStruct * pBufferStruct, clState * pClState) +int pushArgs(bufferStruct *pBufferStruct, clState *pClState) { int err; - if( !pBufferStruct->m_bufferUploaded ) + if (!pBufferStruct->m_bufferUploaded) { err = clEnqueueWriteBuffer(pClState->m_queue, pBufferStruct->m_inBuffer, CL_TRUE, 0, pBufferStruct->m_bufSizeIn, @@ -267,7 +276,7 @@ int pushArgs(bufferStruct * pBufferStruct, clState * pClState) #if DEBUG_MEM_ALLOC log_info("clEnqueueWriteBuffer %x\n", pBufferStruct->m_inBuffer); #endif - if(err != CL_SUCCESS) + if (err != CL_SUCCESS) { log_error("clEnqueueWriteBuffer failed\n"); return -1; @@ -275,22 +284,24 @@ int pushArgs(bufferStruct * pBufferStruct, clState * pClState) pBufferStruct->m_bufferUploaded = true; } - err = clSetKernelArg(pClState->m_kernel, 0, - sizeof(pBufferStruct->m_inBuffer), // pBufferStruct->m_bufSizeIn, - &(pBufferStruct->m_inBuffer)); + err = clSetKernelArg( + pClState->m_kernel, 0, + sizeof(pBufferStruct->m_inBuffer), // pBufferStruct->m_bufSizeIn, + &(pBufferStruct->m_inBuffer)); #if DEBUG_MEM_ALLOC // log_info("clSetKernelArg 0, %x\n", pBufferStruct->m_inBuffer); #endif - if(err != CL_SUCCESS) + if (err != CL_SUCCESS) { log_error("clSetKernelArgs failed, first arg (0)\n"); return -1; } - err = clSetKernelArg(pClState->m_kernel, 1, - sizeof(pBufferStruct->m_outBuffer), // pBufferStruct->m_bufSizeOut, - &(pBufferStruct->m_outBuffer)); - if(err != CL_SUCCESS) + err = clSetKernelArg( + pClState->m_kernel, 1, + sizeof(pBufferStruct->m_outBuffer), // pBufferStruct->m_bufSizeOut, + &(pBufferStruct->m_outBuffer)); + if (err != CL_SUCCESS) { log_error("clSetKernelArgs failed, second arg (1)\n"); return -1; @@ -303,13 +314,13 @@ int pushArgs(bufferStruct * pBufferStruct, clState * pClState) return 0; } -int retrieveResults(bufferStruct * pBufferStruct, clState * pClState) +int retrieveResults(bufferStruct *pBufferStruct, clState *pClState) { int err; err = clEnqueueReadBuffer(pClState->m_queue, pBufferStruct->m_outBuffer, CL_TRUE, 0, pBufferStruct->m_bufSizeOut, pBufferStruct->m_pOut, 0, NULL, NULL); - if(err != CL_SUCCESS) + if (err != CL_SUCCESS) { log_error("clEnqueueReadBuffer failed\n"); return -1; @@ -319,19 +330,17 @@ int retrieveResults(bufferStruct * pBufferStruct, clState * pClState) // vecSizeIdx indexes into g_arrVecAlignMasks, g_arrVecSizeNames // and g_arrVecSizes -int checkCorrectness(bufferStruct * pBufferStruct, clState * pClState, - size_t minAlign) +int checkCorrectnessAlign(bufferStruct *pBufferStruct, clState *pClState, + size_t minAlign) { size_t i; - cl_uint * targetArr = (cl_uint *)(pBufferStruct->m_pOut); - for(i = 0; i < pClState->m_numThreads; ++i) + cl_uint *targetArr = (cl_uint *)(pBufferStruct->m_pOut); + for (i = 0; i < pClState->m_numThreads; ++i) { - if((targetArr[i])%minAlign != (cl_uint)0) + if ((targetArr[i]) % minAlign != (cl_uint)0) { vlog_error("Error %d (of %d). Expected a multple of %x, got %x\n", - i, pClState->m_numThreads, - minAlign, - targetArr[i]); + i, pClState->m_numThreads, minAlign, targetArr[i]); return -1; } } @@ -345,21 +354,42 @@ int checkCorrectness(bufferStruct * pBufferStruct, clState * pClState, return 0; } +int checkCorrectnessStep(bufferStruct *pBufferStruct, clState *pClState, + size_t typeSize, size_t vecWidth) +{ + size_t i; + cl_int targetSize = (cl_int)vecWidth; + cl_int *targetArr = (cl_int *)(pBufferStruct->m_pOut); + if (targetSize == 3) + { + targetSize = 4; // hack for 4-aligned vec3 types + } + for (i = 0; i < pClState->m_numThreads; ++i) + { + if (targetArr[i] != targetSize) + { + vlog_error("Error %ld (of %ld). Expected %d, got %d\n", i, + pClState->m_numThreads, targetSize, targetArr[i]); + return -1; + } + } + return 0; +} // vecSizeIdx indexes into g_arrVecAlignMasks, g_arrVecSizeNames // and g_arrVecSizes -int checkPackedCorrectness(bufferStruct * pBufferStruct, clState * pClState, +int checkPackedCorrectness(bufferStruct *pBufferStruct, clState *pClState, size_t totSize, size_t beforeSize) { size_t i; - cl_uint * targetArr = (cl_uint *)(pBufferStruct->m_pOut); - for(i = 0; i < pClState->m_numThreads; ++i) + cl_uint *targetArr = (cl_uint *)(pBufferStruct->m_pOut); + for (i = 0; i < pClState->m_numThreads; ++i) { - if((targetArr[i]-beforeSize)%totSize != (cl_uint)0) + if ((targetArr[i] - beforeSize) % totSize != (cl_uint)0) { - vlog_error("Error %d (of %d). Expected %d more than a multple of %d, got %d \n", - i, pClState->m_numThreads, beforeSize, - totSize, + vlog_error("Error %d (of %d). Expected %d more than a multple of " + "%d, got %d \n", + i, pClState->m_numThreads, beforeSize, totSize, targetArr[i]); return -1; } diff --git a/test_conformance/vectors/structs.h b/test_conformance/vectors/structs.h new file mode 100644 index 00000000..c6a1725e --- /dev/null +++ b/test_conformance/vectors/structs.h @@ -0,0 +1,75 @@ +// +// Copyright (c) 2017 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "testBase.h" + + +#include "harness/conversions.h" +#include "harness/typeWrappers.h" + +typedef struct _clState +{ + cl_device_id m_device; + cl_context m_context; + cl_command_queue m_queue; + + cl_program m_program; + cl_kernel m_kernel; + size_t m_numThreads; +} clState; + +clState* newClState(cl_device_id device, cl_context context, + cl_command_queue queue); +clState* destroyClState(clState* pState); + +int clStateMakeProgram(clState* pState, const char* prog, + const char* kernelName); +void clStateDestroyProgramAndKernel(clState* pState); + +int runKernel(clState* pState, size_t numThreads); + +typedef struct _bufferStruct +{ + void* m_pIn; + void* m_pOut; + + cl_mem m_outBuffer; + cl_mem m_inBuffer; + + size_t m_bufSizeIn, m_bufSizeOut; + + int m_bufferUploaded; +} bufferStruct; + + +bufferStruct* newBufferStruct(size_t inSize, size_t outSize, clState* pClState); + +bufferStruct* destroyBufferStruct(bufferStruct* destroyMe, clState* pClState); + +void initContents(bufferStruct* pBufferStruct, clState* pClState, + size_t typeSize, size_t vecWidth); + +int pushArgs(bufferStruct* pBufferStruct, clState* pClState); +int retrieveResults(bufferStruct* pBufferStruct, clState* pClState); + +int checkCorrectnessStep(bufferStruct* pBufferStruct, clState* pClState, + size_t typeSize, size_t vecWidth); +// vecSizeIdx indexes into g_arrVecAlignMasks, g_arrVecSizeNames +// and g_arrVecSizes +int checkCorrectnessAlign(bufferStruct* pBufferStruct, clState* pClState, + size_t minAlign); + +int checkPackedCorrectness(bufferStruct* pBufferStruct, clState* pClState, + size_t totSize, size_t beforeSize); diff --git a/test_conformance/vec_align/testBase.h b/test_conformance/vectors/testBase.h similarity index 93% rename from test_conformance/vec_align/testBase.h rename to test_conformance/vectors/testBase.h index 00dcc07b..63086d7e 100644 --- a/test_conformance/vec_align/testBase.h +++ b/test_conformance/vectors/testBase.h @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -16,7 +16,7 @@ #ifndef _testBase_h #define _testBase_h -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/vec_step/test_step.c b/test_conformance/vectors/test_step.cpp similarity index 64% rename from test_conformance/vec_step/test_step.c rename to test_conformance/vectors/test_step.cpp index 89291abe..2f6ad187 100644 --- a/test_conformance/vec_step/test_step.c +++ b/test_conformance/vectors/test_step.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -16,9 +16,9 @@ #include "testBase.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/conversions.h" +#include "harness/typeWrappers.h" +#include "harness/testHarness.h" #include "structs.h" @@ -35,95 +35,99 @@ */ - -int test_step_internal(cl_device_id deviceID, cl_context context, cl_command_queue queue, const char * pattern, const char * testName) +int test_step_internal(cl_device_id deviceID, cl_context context, + cl_command_queue queue, const char* pattern, + const char* testName) { int err; int typeIdx, vecSizeIdx; char tempBuffer[2048]; - clState * pClState = newClState(deviceID, context, queue); - bufferStruct * pBuffers = - newBufferStruct(BUFFER_SIZE, BUFFER_SIZE, pClState); + clState* pClState = newClState(deviceID, context, queue); + bufferStruct* pBuffers = + newBufferStruct(BUFFER_SIZE, BUFFER_SIZE, pClState); - if(pBuffers == NULL) { + if (pBuffers == NULL) + { destroyClState(pClState); vlog_error("%s : Could not create buffer\n", testName); return -1; } - //detect whether profile of the device is embedded + // detect whether profile of the device is embedded char profile[1024] = ""; - err = clGetDeviceInfo(deviceID, CL_DEVICE_PROFILE, sizeof(profile), profile, NULL); + err = clGetDeviceInfo(deviceID, CL_DEVICE_PROFILE, sizeof(profile), profile, + NULL); if (err) { - print_error(err, "clGetDeviceInfo for CL_DEVICE_PROFILE failed\n" ); - test_finish(); + print_error(err, "clGetDeviceInfo for CL_DEVICE_PROFILE failed\n"); return -1; } gIsEmbedded = NULL != strstr(profile, "EMBEDDED_PROFILE"); - for(typeIdx = 0; types[typeIdx] != kNumExplicitTypes; ++typeIdx) + for (typeIdx = 0; types[typeIdx] != kNumExplicitTypes; ++typeIdx) { - if( types[ typeIdx ] == kDouble ) + if (types[typeIdx] == kDouble) { // If we're testing doubles, we need to check for support first - if( !is_extension_available( deviceID, "cl_khr_fp64" ) ) + if (!is_extension_available(deviceID, "cl_khr_fp64")) { - log_info( "Not testing doubles (unsupported on this device)\n" ); + log_info("Not testing doubles (unsupported on this device)\n"); continue; } } - if( types[ typeIdx ] == kLong || types[ typeIdx ] == kULong ) - { - // If we're testing long/ulong, we need to check for embedded support - if( gIsEmbedded && !is_extension_available( deviceID, "cles_khr_int64") ) + if (types[typeIdx] == kLong || types[typeIdx] == kULong) { - log_info( "Not testing longs (unsupported on this embedded device)\n" ); - continue; + // If we're testing long/ulong, we need to check for embedded + // support + if (gIsEmbedded + && !is_extension_available(deviceID, "cles_khr_int64")) + { + log_info("Not testing longs (unsupported on this embedded " + "device)\n"); + continue; + } } - } char srcBuffer[2048]; - doSingleReplace(tempBuffer, 2048, pattern, - ".EXTENSIONS.", types[typeIdx] == kDouble + doSingleReplace(tempBuffer, 2048, pattern, ".EXTENSIONS.", + types[typeIdx] == kDouble ? "#pragma OPENCL EXTENSION cl_khr_fp64 : enable" : ""); - for(vecSizeIdx = 0; vecSizeIdx < NUM_VECTOR_SIZES; ++vecSizeIdx) + for (vecSizeIdx = 0; vecSizeIdx < NUM_VECTOR_SIZES; ++vecSizeIdx) { - doReplace(srcBuffer, 2048, tempBuffer, - ".TYPE.", g_arrTypeNames[typeIdx], - ".NUM.", g_arrVecSizeNames[vecSizeIdx]); + doReplace(srcBuffer, 2048, tempBuffer, ".TYPE.", + g_arrTypeNames[typeIdx], ".NUM.", + g_arrVecSizeNames[vecSizeIdx]); - if(srcBuffer[0] == '\0') { + if (srcBuffer[0] == '\0') + { vlog_error("%s: failed to fill source buf for type %s%s\n", - testName, - g_arrTypeNames[typeIdx], + testName, g_arrTypeNames[typeIdx], g_arrVecSizeNames[vecSizeIdx]); destroyBufferStruct(pBuffers, pClState); destroyClState(pClState); return -1; } - err = clStateMakeProgram(pClState, srcBuffer, testName ); + err = clStateMakeProgram(pClState, srcBuffer, testName); if (err) { - vlog_error("%s: Error compiling \"\n%s\n\"", - testName, srcBuffer); + vlog_error("%s: Error compiling \"\n%s\n\"", testName, + srcBuffer); destroyBufferStruct(pBuffers, pClState); destroyClState(pClState); return -1; } err = pushArgs(pBuffers, pClState); - if(err != 0) + if (err != 0) { - vlog_error("%s: failed to push args %s%s\n", - testName, + vlog_error("%s: failed to push args %s%s\n", testName, g_arrTypeNames[typeIdx], g_arrVecSizeNames[vecSizeIdx]); destroyBufferStruct(pBuffers, pClState); @@ -133,11 +137,10 @@ int test_step_internal(cl_device_id deviceID, cl_context context, cl_command_que // now we run the kernel err = runKernel(pClState, 1024); - if(err != 0) + if (err != 0) { - vlog_error("%s: runKernel fail (%ld threads) %s%s\n", - testName, pClState->m_numThreads, - g_arrTypeNames[typeIdx], + vlog_error("%s: runKernel fail (%ld threads) %s%s\n", testName, + pClState->m_numThreads, g_arrTypeNames[typeIdx], g_arrVecSizeNames[vecSizeIdx]); destroyBufferStruct(pBuffers, pClState); destroyClState(pClState); @@ -145,10 +148,9 @@ int test_step_internal(cl_device_id deviceID, cl_context context, cl_command_que } err = retrieveResults(pBuffers, pClState); - if(err != 0) + if (err != 0) { - vlog_error("%s: failed to retrieve results %s%s\n", - testName, + vlog_error("%s: failed to retrieve results %s%s\n", testName, g_arrTypeNames[typeIdx], g_arrVecSizeNames[vecSizeIdx]); destroyBufferStruct(pBuffers, pClState); @@ -156,24 +158,21 @@ int test_step_internal(cl_device_id deviceID, cl_context context, cl_command_que return -1; } - err = checkCorrectness(pBuffers, pClState, - g_arrTypeSizes[typeIdx], - g_arrVecSizes[vecSizeIdx]); + err = checkCorrectnessStep(pBuffers, pClState, + g_arrTypeSizes[typeIdx], + g_arrVecSizes[vecSizeIdx]); - if(err != 0) + if (err != 0) { - vlog_error("%s: incorrect results %s%s\n", - testName, + vlog_error("%s: incorrect results %s%s\n", testName, g_arrTypeNames[typeIdx], g_arrVecSizeNames[vecSizeIdx]); - vlog_error("%s: Source was \"\n%s\n\"", - testName, srcBuffer); + vlog_error("%s: Source was \"\n%s\n\"", testName, srcBuffer); destroyBufferStruct(pBuffers, pClState); destroyClState(pClState); return -1; } } - } destroyBufferStruct(pBuffers, pClState); @@ -185,9 +184,10 @@ int test_step_internal(cl_device_id deviceID, cl_context context, cl_command_que return 0; // -1; // fails on account of not being written. } -const char * patterns[] = { +static const char* patterns[] = { ".EXTENSIONS.\n" - "__kernel void test_step_type(__global .TYPE..NUM. *source, __global int *dest)\n" + "__kernel void test_step_type(__global .TYPE..NUM. *source, __global int " + "*dest)\n" "{\n" " int tid = get_global_id(0);\n" " dest[tid] = vec_step(.TYPE..NUM.);\n" @@ -195,7 +195,8 @@ const char * patterns[] = { "}\n", ".EXTENSIONS.\n" - "__kernel void test_step_var(__global .TYPE..NUM. *source, __global int *dest)\n" + "__kernel void test_step_var(__global .TYPE..NUM. *source, __global int " + "*dest)\n" "{\n" " int tid = get_global_id(0);\n" " dest[tid] = vec_step(source[tid]);\n" @@ -204,7 +205,8 @@ const char * patterns[] = { ".EXTENSIONS.\n" " typedef .TYPE..NUM. TypeToTest;\n" - "__kernel void test_step_typedef_type(__global TypeToTest *source, __global int *dest)\n" + "__kernel void test_step_typedef_type(__global TypeToTest *source, " + "__global int *dest)\n" "{\n" " int tid = get_global_id(0);\n" " dest[tid] = vec_step(TypeToTest);\n" @@ -213,7 +215,8 @@ const char * patterns[] = { ".EXTENSIONS.\n" " typedef .TYPE..NUM. TypeToTest;\n" - "__kernel void test_step_typedef_var(__global TypeToTest *source, __global int *dest)\n" + "__kernel void test_step_typedef_var(__global TypeToTest *source, __global " + "int *dest)\n" "{\n" " int tid = get_global_id(0);\n" " dest[tid] = vec_step(source[tid]);\n" @@ -228,25 +231,29 @@ const char * patterns[] = { test_step_typedef_var, */ -int test_step_type(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) +int test_step_type(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements) { return test_step_internal(deviceID, context, queue, patterns[0], "test_step_type"); } -int test_step_var(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) +int test_step_var(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements) { return test_step_internal(deviceID, context, queue, patterns[1], "test_step_var"); } -int test_step_typedef_type(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) +int test_step_typedef_type(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements) { return test_step_internal(deviceID, context, queue, patterns[2], "test_step_typedef_type"); } -int test_step_typedef_var(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) +int test_step_typedef_var(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements) { return test_step_internal(deviceID, context, queue, patterns[3], "test_step_typedef_var"); diff --git a/test_conformance/vec_align/test_vec_align.c b/test_conformance/vectors/test_vec_align.cpp similarity index 50% rename from test_conformance/vec_align/test_vec_align.c rename to test_conformance/vectors/test_vec_align.cpp index 775dc3ed..2f392f54 100644 --- a/test_conformance/vec_align/test_vec_align.c +++ b/test_conformance/vectors/test_vec_align.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -16,9 +16,9 @@ #include "testBase.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/typeWrappers.h" -#include "../../test_common/harness/testHarness.h" +#include "harness/conversions.h" +#include "harness/typeWrappers.h" +#include "harness/testHarness.h" #include "structs.h" @@ -29,14 +29,15 @@ size_t get_align(size_t vecSize) { - if(vecSize == 3) + if (vecSize == 3) { return 4; } return vecSize; } -/* // Lots of conditionals means this is not gonna be an optimal min on intel. */ +/* // Lots of conditionals means this is not gonna be an optimal min on intel. + */ /* // That's okay, make sure we only call a few times per test, not for every */ /* // element */ /* size_t min_of_nonzero(size_t a, size_t b) */ @@ -53,7 +54,8 @@ size_t get_align(size_t vecSize) /* } */ -/* size_t get_min_packed_alignment(size_t preSize, size_t typeMultiplePreSize, */ +/* size_t get_min_packed_alignment(size_t preSize, size_t typeMultiplePreSize, + */ /* size_t postSize, size_t typeMultiplePostSize, */ /* ExplicitType kType, size_t vecSize) */ /* { */ @@ -71,12 +73,11 @@ size_t get_align(size_t vecSize) /* } */ - int test_vec_internal(cl_device_id deviceID, cl_context context, - cl_command_queue queue, const char * pattern, - const char * testName, size_t bufSize, - size_t preSize, size_t typeMultiplePreSize, - size_t postSize, size_t typeMultiplePostSize) + cl_command_queue queue, const char* pattern, + const char* testName, size_t bufSize, size_t preSize, + size_t typeMultiplePreSize, size_t postSize, + size_t typeMultiplePostSize) { int err; int typeIdx, vecSizeIdx; @@ -86,58 +87,64 @@ int test_vec_internal(cl_device_id deviceID, cl_context context, size_t preSizeBytes, postSizeBytes, typeSize, totSize; - clState * pClState = newClState(deviceID, context, queue); - bufferStruct * pBuffers = - newBufferStruct(bufSize, bufSize*sizeof(cl_uint)/sizeof(cl_char), pClState); + clState* pClState = newClState(deviceID, context, queue); + bufferStruct* pBuffers = newBufferStruct( + bufSize, bufSize * sizeof(cl_uint) / sizeof(cl_char), pClState); - if(pBuffers == NULL) { + if (pBuffers == NULL) + { destroyClState(pClState); vlog_error("%s : Could not create buffer\n", testName); return -1; } - for(typeIdx = 0; types[typeIdx] != kNumExplicitTypes; ++typeIdx) + for (typeIdx = 0; types[typeIdx] != kNumExplicitTypes; ++typeIdx) { // Skip doubles if it is not supported otherwise enable pragma - if (types[typeIdx] == kDouble) { - if (!is_extension_available(deviceID, "cl_khr_fp64")) { + if (types[typeIdx] == kDouble) + { + if (!is_extension_available(deviceID, "cl_khr_fp64")) + { continue; - } else { - doReplace(tmpBuffer, 2048, pattern, - ".PRAGMA.", "#pragma OPENCL EXTENSION cl_khr_fp64: ", - ".STATE.", "enable"); } - } else { - if (types[typeIdx] == kLong || types[typeIdx] == kULong) { - if (gIsEmbedded) - continue; + else + { + doReplace(tmpBuffer, 2048, pattern, ".PRAGMA.", + "#pragma OPENCL EXTENSION cl_khr_fp64: ", ".STATE.", + "enable"); + } + } + else + { + if (types[typeIdx] == kLong || types[typeIdx] == kULong) + { + if (gIsEmbedded) continue; } - doReplace(tmpBuffer, 2048, pattern, - ".PRAGMA.", " ", - ".STATE.", " "); + doReplace(tmpBuffer, 2048, pattern, ".PRAGMA.", " ", ".STATE.", + " "); } typeSize = get_explicit_type_size(types[typeIdx]); - preSizeBytes = preSize + typeSize*typeMultiplePreSize; - postSizeBytes = postSize + typeSize*typeMultiplePostSize; + preSizeBytes = preSize + typeSize * typeMultiplePreSize; + postSizeBytes = postSize + typeSize * typeMultiplePostSize; + for (vecSizeIdx = 1; vecSizeIdx < NUM_VECTOR_SIZES; ++vecSizeIdx) + { - for(vecSizeIdx = 1; vecSizeIdx < NUM_VECTOR_SIZES; ++vecSizeIdx) { + totSize = preSizeBytes + postSizeBytes + + typeSize * get_align(g_arrVecSizes[vecSizeIdx]); - totSize = preSizeBytes + postSizeBytes + - typeSize*get_align(g_arrVecSizes[vecSizeIdx]); + doReplace(srcBuffer, 2048, tmpBuffer, ".TYPE.", + g_arrTypeNames[typeIdx], ".NUM.", + g_arrVecSizeNames[vecSizeIdx]); - doReplace(srcBuffer, 2048, tmpBuffer, - ".TYPE.", g_arrTypeNames[typeIdx], - ".NUM.", g_arrVecSizeNames[vecSizeIdx]); - - if(srcBuffer[0] == '\0') { + if (srcBuffer[0] == '\0') + { vlog_error("%s: failed to fill source buf for type %s%s\n", - testName, - g_arrTypeNames[typeIdx], + testName, g_arrTypeNames[typeIdx], g_arrVecSizeNames[vecSizeIdx]); destroyBufferStruct(pBuffers, pClState); destroyClState(pClState); @@ -147,19 +154,20 @@ int test_vec_internal(cl_device_id deviceID, cl_context context, // log_info("Buffer is \"\n%s\n\"\n", srcBuffer); // fflush(stdout); - err = clStateMakeProgram(pClState, srcBuffer, testName ); - if (err) { - vlog_error("%s: Error compiling \"\n%s\n\"", - testName, srcBuffer); + err = clStateMakeProgram(pClState, srcBuffer, testName); + if (err) + { + vlog_error("%s: Error compiling \"\n%s\n\"", testName, + srcBuffer); destroyBufferStruct(pBuffers, pClState); destroyClState(pClState); return -1; } err = pushArgs(pBuffers, pClState); - if(err != 0) { - vlog_error("%s: failed to push args %s%s\n", - testName, + if (err != 0) + { + vlog_error("%s: failed to push args %s%s\n", testName, g_arrTypeNames[typeIdx], g_arrVecSizeNames[vecSizeIdx]); destroyBufferStruct(pBuffers, pClState); @@ -169,12 +177,14 @@ int test_vec_internal(cl_device_id deviceID, cl_context context, // log_info("About to Run kernel\n"); fflush(stdout); // now we run the kernel - err = runKernel(pClState, - bufSize/(g_arrVecSizes[vecSizeIdx]* g_arrTypeSizes[typeIdx])); - if(err != 0) { - vlog_error("%s: runKernel fail (%ld threads) %s%s\n", - testName, pClState->m_numThreads, - g_arrTypeNames[typeIdx], + err = runKernel( + pClState, + bufSize + / (g_arrVecSizes[vecSizeIdx] * g_arrTypeSizes[typeIdx])); + if (err != 0) + { + vlog_error("%s: runKernel fail (%ld threads) %s%s\n", testName, + pClState->m_numThreads, g_arrTypeNames[typeIdx], g_arrVecSizeNames[vecSizeIdx]); destroyBufferStruct(pBuffers, pClState); destroyClState(pClState); @@ -183,9 +193,9 @@ int test_vec_internal(cl_device_id deviceID, cl_context context, // log_info("About to retrieve results\n"); fflush(stdout); err = retrieveResults(pBuffers, pClState); - if(err != 0) { - vlog_error("%s: failed to retrieve results %s%s\n", - testName, + if (err != 0) + { + vlog_error("%s: failed to retrieve results %s%s\n", testName, g_arrTypeNames[typeIdx], g_arrVecSizeNames[vecSizeIdx]); destroyBufferStruct(pBuffers, pClState); @@ -194,13 +204,12 @@ int test_vec_internal(cl_device_id deviceID, cl_context context, } - - if(preSizeBytes+postSizeBytes == 0) + if (preSizeBytes + postSizeBytes == 0) { // log_info("About to Check Correctness\n"); fflush(stdout); - err = checkCorrectness(pBuffers, pClState, - get_align(g_arrVecSizes[vecSizeIdx])* - typeSize); + err = checkCorrectnessAlign(pBuffers, pClState, + get_align(g_arrVecSizes[vecSizeIdx]) + * typeSize); } else { @@ -209,20 +218,18 @@ int test_vec_internal(cl_device_id deviceID, cl_context context, preSizeBytes); } - if(err != 0) { - vlog_error("%s: incorrect results %s%s\n", - testName, + if (err != 0) + { + vlog_error("%s: incorrect results %s%s\n", testName, g_arrTypeNames[typeIdx], g_arrVecSizeNames[vecSizeIdx]); - vlog_error("%s: Source was \"\n%s\n\"", - testName, srcBuffer); + vlog_error("%s: Source was \"\n%s\n\"", testName, srcBuffer); destroyBufferStruct(pBuffers, pClState); destroyClState(pClState); return -1; } clStateDestroyProgramAndKernel(pClState); - } } @@ -236,10 +243,10 @@ int test_vec_internal(cl_device_id deviceID, cl_context context, } - -const char * patterns[] = { +static const char* patterns[] = { ".PRAGMA..STATE.\n" - "__kernel void test_vec_align_array(.SRC_SCOPE. .TYPE..NUM. *source, .DST_SCOPE. uint *dest)\n" + "__kernel void test_vec_align_array(.SRC_SCOPE. .TYPE..NUM. *source, " + ".DST_SCOPE. uint *dest)\n" "{\n" " int tid = get_global_id(0);\n" " dest[tid] = (uint)((.SRC_SCOPE. uchar *)(source+tid));\n" @@ -250,7 +257,8 @@ const char * patterns[] = { " .TYPE..NUM. vec;\n" ".POST." "} testStruct;\n" - "__kernel void test_vec_align_struct(__constant .TYPE..NUM. *source, .DST_SCOPE. uint *dest)\n" + "__kernel void test_vec_align_struct(__constant .TYPE..NUM. *source, " + ".DST_SCOPE. uint *dest)\n" "{\n" " .SRC_SCOPE. testStruct test;\n" " int tid = get_global_id(0);\n" @@ -262,11 +270,13 @@ const char * patterns[] = { " .TYPE..NUM. vec;\n" ".POST." "} testStruct;\n" - "__kernel void test_vec_align_packed_struct(__constant .TYPE..NUM. *source, .DST_SCOPE. uint *dest)\n" + "__kernel void test_vec_align_packed_struct(__constant .TYPE..NUM. " + "*source, .DST_SCOPE. uint *dest)\n" "{\n" " .SRC_SCOPE. testStruct test;\n" " int tid = get_global_id(0);\n" - " dest[tid] = (uint)((.SRC_SCOPE. uchar *)&(test.vec) - (.SRC_SCOPE. uchar *)&test);\n" + " dest[tid] = (uint)((.SRC_SCOPE. uchar *)&(test.vec) - (.SRC_SCOPE. " + "uchar *)&test);\n" "}\n", ".PRAGMA..STATE.\n" "typedef struct myStruct { \n" @@ -274,7 +284,8 @@ const char * patterns[] = { " .TYPE..NUM. vec;\n" ".POST." "} testStruct;\n" - "__kernel void test_vec_align_struct_arr(.SRC_SCOPE. testStruct *source, .DST_SCOPE. uint *dest)\n" + "__kernel void test_vec_align_struct_arr(.SRC_SCOPE. testStruct *source, " + ".DST_SCOPE. uint *dest)\n" "{\n" " int tid = get_global_id(0);\n" " dest[tid] = (uint)((.SRC_SCOPE. uchar *)&(source[tid].vec));\n" @@ -285,142 +296,123 @@ const char * patterns[] = { " .TYPE..NUM. vec;\n" ".POST." "} testStruct;\n" - "__kernel void test_vec_align_packed_struct_arr(.SRC_SCOPE. testStruct *source, .DST_SCOPE. uint *dest)\n" + "__kernel void test_vec_align_packed_struct_arr(.SRC_SCOPE. testStruct " + "*source, .DST_SCOPE. uint *dest)\n" "{\n" " int tid = get_global_id(0);\n" - " dest[tid] = (uint)((.SRC_SCOPE. uchar *)&(source[tid].vec) - (.SRC_SCOPE. uchar *)&(source[0]));\n" + " dest[tid] = (uint)((.SRC_SCOPE. uchar *)&(source[tid].vec) - " + "(.SRC_SCOPE. uchar *)&(source[0]));\n" "}\n", // __attribute__ ((packed)) }; - -const char * pre_substitution_arr[] = { - "", - "char c;\n", - "short3 s;", - ".TYPE.3 tPre;\n", - ".TYPE. arrPre[5];\n", - ".TYPE. arrPre[12];\n", - NULL -}; +const char* pre_substitution_arr[] = { "", + "char c;\n", + "short3 s;", + ".TYPE.3 tPre;\n", + ".TYPE. arrPre[5];\n", + ".TYPE. arrPre[12];\n", + NULL }; // alignments of everything in pre_substitution_arr as raw alignments // 0 if such a thing is meaningless -size_t pre_align_arr[] = { - 0, - sizeof(cl_char), - 4*sizeof(cl_short), - 0, // taken care of in type_multiple_pre_align_arr - 0, - 0 -}; +size_t pre_align_arr[] = { 0, + sizeof(cl_char), + 4 * sizeof(cl_short), + 0, // taken care of in type_multiple_pre_align_arr + 0, + 0 }; // alignments of everything in pre_substitution_arr as multiples of // sizeof(.TYPE.) // 0 if such a thing is meaningless -size_t type_multiple_pre_align_arr[] = { - 0, - 0, - 0, - 4, - 5, - 12 -}; +size_t type_multiple_pre_align_arr[] = { 0, 0, 0, 4, 5, 12 }; -const char * post_substitution_arr[] = { - "", - "char cPost;\n", - ".TYPE. arrPost[3];\n", - ".TYPE. arrPost[5];\n", - ".TYPE.3 arrPost;\n", - ".TYPE. arrPost[12];\n", - NULL -}; +const char* post_substitution_arr[] = { "", + "char cPost;\n", + ".TYPE. arrPost[3];\n", + ".TYPE. arrPost[5];\n", + ".TYPE.3 arrPost;\n", + ".TYPE. arrPost[12];\n", + NULL }; // alignments of everything in post_substitution_arr as raw alignments // 0 if such a thing is meaningless -size_t post_align_arr[] = { - 0, - sizeof(cl_char), - 0, // taken care of in type_multiple_post_align_arr - 0, - 0, - 0 -}; +size_t post_align_arr[] = { 0, sizeof(cl_char), + 0, // taken care of in type_multiple_post_align_arr + 0, 0, + 0 }; // alignments of everything in post_substitution_arr as multiples of // sizeof(.TYPE.) // 0 if such a thing is meaningless -size_t type_multiple_post_align_arr[] = { - 0, - 0, - 3, - 5, - 4, - 12 -}; +size_t type_multiple_post_align_arr[] = { 0, 0, 3, 5, 4, 12 }; // there hsould be a packed version of this? -int test_vec_align_array(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) +int test_vec_align_array(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements) { char tmp[2048]; int result; log_info("Testing global\n"); - doReplace(tmp, (size_t)2048, patterns[0], - ".SRC_SCOPE.", "__global", + doReplace(tmp, (size_t)2048, patterns[0], ".SRC_SCOPE.", "__global", ".DST_SCOPE.", "__global"); // result = test_vec_internal(deviceID, context, queue, tmp, - "test_vec_align_array", - BUFFER_SIZE, 0, 0, 0, 0); + "test_vec_align_array", BUFFER_SIZE, 0, 0, 0, 0); return result; } -int test_vec_align_struct(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) +int test_vec_align_struct(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements) { char tmp1[2048], tmp2[2048]; int result = 0; int preIdx, postIdx; log_info("testing __private\n"); - doReplace(tmp2, (size_t)2048, patterns[1], - ".SRC_SCOPE.", "__private", + doReplace(tmp2, (size_t)2048, patterns[1], ".SRC_SCOPE.", "__private", ".DST_SCOPE.", "__global"); // - for(preIdx = 0; pre_substitution_arr[preIdx] != NULL; ++preIdx) { - for(postIdx = 0; post_substitution_arr[postIdx] != NULL; ++postIdx) { - doReplace(tmp1, (size_t)2048, tmp2, - ".PRE.", pre_substitution_arr[preIdx], - ".POST.", post_substitution_arr[postIdx]); + for (preIdx = 0; pre_substitution_arr[preIdx] != NULL; ++preIdx) + { + for (postIdx = 0; post_substitution_arr[postIdx] != NULL; ++postIdx) + { + doReplace(tmp1, (size_t)2048, tmp2, ".PRE.", + pre_substitution_arr[preIdx], ".POST.", + post_substitution_arr[postIdx]); - result = test_vec_internal(deviceID, context, queue, tmp1, - "test_vec_align_struct", - 512, 0, 0, 0, 0); - if (result != 0) { + result = + test_vec_internal(deviceID, context, queue, tmp1, + "test_vec_align_struct", 512, 0, 0, 0, 0); + if (result != 0) + { return result; } } } log_info("testing __local\n"); - doReplace(tmp2, (size_t)2048, patterns[1], - ".SRC_SCOPE.", "__local", + doReplace(tmp2, (size_t)2048, patterns[1], ".SRC_SCOPE.", "__local", ".DST_SCOPE.", "__global"); // - for(preIdx = 0; pre_substitution_arr[preIdx] != NULL; ++preIdx) { - for(postIdx = 0; post_substitution_arr[postIdx] != NULL; ++postIdx) { - doReplace(tmp1, (size_t)2048, tmp2, - ".PRE.", pre_substitution_arr[preIdx], - ".POST.", post_substitution_arr[postIdx]); + for (preIdx = 0; pre_substitution_arr[preIdx] != NULL; ++preIdx) + { + for (postIdx = 0; post_substitution_arr[postIdx] != NULL; ++postIdx) + { + doReplace(tmp1, (size_t)2048, tmp2, ".PRE.", + pre_substitution_arr[preIdx], ".POST.", + post_substitution_arr[postIdx]); - result = test_vec_internal(deviceID, context, queue, tmp1, - "test_vec_align_struct", - 512, 0, 0, 0, 0); - if(result != 0) { + result = + test_vec_internal(deviceID, context, queue, tmp1, + "test_vec_align_struct", 512, 0, 0, 0, 0); + if (result != 0) + { return result; } } @@ -428,7 +420,8 @@ int test_vec_align_struct(cl_device_id deviceID, cl_context context, cl_command_ return 0; } -int test_vec_align_packed_struct(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) +int test_vec_align_packed_struct(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements) { char tmp1[2048], tmp2[2048]; int result = 0; @@ -436,46 +429,46 @@ int test_vec_align_packed_struct(cl_device_id deviceID, cl_context context, cl_c log_info("Testing __private\n"); - doReplace(tmp2, (size_t)2048, patterns[2], - ".SRC_SCOPE.", "__private", + doReplace(tmp2, (size_t)2048, patterns[2], ".SRC_SCOPE.", "__private", ".DST_SCOPE.", "__global"); // - for(preIdx = 0; pre_substitution_arr[preIdx] != NULL; ++preIdx) { - for(postIdx = 0; post_substitution_arr[postIdx] != NULL; ++postIdx) { - doReplace(tmp1, (size_t)2048, tmp2, - ".PRE.", pre_substitution_arr[preIdx], - ".POST.", post_substitution_arr[postIdx]); + for (preIdx = 0; pre_substitution_arr[preIdx] != NULL; ++preIdx) + { + for (postIdx = 0; post_substitution_arr[postIdx] != NULL; ++postIdx) + { + doReplace(tmp1, (size_t)2048, tmp2, ".PRE.", + pre_substitution_arr[preIdx], ".POST.", + post_substitution_arr[postIdx]); - result = test_vec_internal(deviceID, context, queue, tmp1, - "test_vec_align_packed_struct", - 512, pre_align_arr[preIdx], - type_multiple_pre_align_arr[preIdx], - post_align_arr[postIdx], - type_multiple_post_align_arr[postIdx]); - if(result != 0) { + result = test_vec_internal( + deviceID, context, queue, tmp1, "test_vec_align_packed_struct", + 512, pre_align_arr[preIdx], type_multiple_pre_align_arr[preIdx], + post_align_arr[postIdx], type_multiple_post_align_arr[postIdx]); + if (result != 0) + { return result; } } } log_info("testing __local\n"); - doReplace(tmp2, (size_t)2048, patterns[2], - ".SRC_SCOPE.", "__local", + doReplace(tmp2, (size_t)2048, patterns[2], ".SRC_SCOPE.", "__local", ".DST_SCOPE.", "__global"); // - for(preIdx = 0; pre_substitution_arr[preIdx] != NULL; ++preIdx) { - for(postIdx = 0; post_substitution_arr[postIdx] != NULL; ++postIdx) { - doReplace(tmp1, (size_t)2048, tmp2, - ".PRE.", pre_substitution_arr[preIdx], - ".POST.", post_substitution_arr[postIdx]); + for (preIdx = 0; pre_substitution_arr[preIdx] != NULL; ++preIdx) + { + for (postIdx = 0; post_substitution_arr[postIdx] != NULL; ++postIdx) + { + doReplace(tmp1, (size_t)2048, tmp2, ".PRE.", + pre_substitution_arr[preIdx], ".POST.", + post_substitution_arr[postIdx]); - result = test_vec_internal(deviceID, context, queue, tmp1, - "test_vec_align_packed_struct", - 512, pre_align_arr[preIdx], - type_multiple_pre_align_arr[preIdx], - post_align_arr[postIdx], - type_multiple_post_align_arr[postIdx]); - if (result != 0) { + result = test_vec_internal( + deviceID, context, queue, tmp1, "test_vec_align_packed_struct", + 512, pre_align_arr[preIdx], type_multiple_pre_align_arr[preIdx], + post_align_arr[postIdx], type_multiple_post_align_arr[postIdx]); + if (result != 0) + { return result; } } @@ -483,7 +476,8 @@ int test_vec_align_packed_struct(cl_device_id deviceID, cl_context context, cl_c return 0; } -int test_vec_align_struct_arr(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) +int test_vec_align_struct_arr(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements) { char tmp1[2048], tmp2[2048]; int result = 0; @@ -491,20 +485,22 @@ int test_vec_align_struct_arr(cl_device_id deviceID, cl_context context, cl_comm log_info("testing __global\n"); - doReplace(tmp2, (size_t)2048, patterns[3], - ".SRC_SCOPE.", "__global", + doReplace(tmp2, (size_t)2048, patterns[3], ".SRC_SCOPE.", "__global", ".DST_SCOPE.", "__global"); // - for(preIdx = 0; pre_substitution_arr[preIdx] != NULL; ++preIdx) { - for(postIdx = 0; post_substitution_arr[postIdx] != NULL; ++postIdx) { - doReplace(tmp1, (size_t)2048, tmp2, - ".PRE.", pre_substitution_arr[preIdx], - ".POST.", post_substitution_arr[postIdx]); + for (preIdx = 0; pre_substitution_arr[preIdx] != NULL; ++preIdx) + { + for (postIdx = 0; post_substitution_arr[postIdx] != NULL; ++postIdx) + { + doReplace(tmp1, (size_t)2048, tmp2, ".PRE.", + pre_substitution_arr[preIdx], ".POST.", + post_substitution_arr[postIdx]); result = test_vec_internal(deviceID, context, queue, tmp1, - "test_vec_align_struct_arr", - BUFFER_SIZE, 0, 0, 0, 0); - if(result != 0) { + "test_vec_align_struct_arr", BUFFER_SIZE, + 0, 0, 0, 0); + if (result != 0) + { return result; } } @@ -512,7 +508,8 @@ int test_vec_align_struct_arr(cl_device_id deviceID, cl_context context, cl_comm return 0; } -int test_vec_align_packed_struct_arr(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) +int test_vec_align_packed_struct_arr(cl_device_id deviceID, cl_context context, + cl_command_queue queue, int num_elements) { char tmp1[2048], tmp2[2048]; int result = 0; @@ -520,26 +517,24 @@ int test_vec_align_packed_struct_arr(cl_device_id deviceID, cl_context context, log_info("Testing __global\n"); - doReplace(tmp2, (size_t)2048, patterns[4], - ".SRC_SCOPE.", "__global", + doReplace(tmp2, (size_t)2048, patterns[4], ".SRC_SCOPE.", "__global", ".DST_SCOPE.", "__global"); // - for(preIdx = 0; pre_substitution_arr[preIdx] != NULL; ++preIdx) { - for(postIdx = 0; post_substitution_arr[postIdx] != NULL; ++postIdx) { - doReplace(tmp1, (size_t)2048, tmp2, - ".PRE.", pre_substitution_arr[preIdx], - ".POST.", post_substitution_arr[postIdx]); + for (preIdx = 0; pre_substitution_arr[preIdx] != NULL; ++preIdx) + { + for (postIdx = 0; post_substitution_arr[postIdx] != NULL; ++postIdx) + { + doReplace(tmp1, (size_t)2048, tmp2, ".PRE.", + pre_substitution_arr[preIdx], ".POST.", + post_substitution_arr[postIdx]); - result = test_vec_internal(deviceID, context, queue, tmp1, - "test_vec_align_packed_struct_arr", - BUFFER_SIZE, pre_align_arr[preIdx], - type_multiple_pre_align_arr[preIdx], - post_align_arr[postIdx], - type_multiple_post_align_arr[postIdx]); - if(result != 0) - return result; + result = test_vec_internal( + deviceID, context, queue, tmp1, + "test_vec_align_packed_struct_arr", BUFFER_SIZE, + pre_align_arr[preIdx], type_multiple_pre_align_arr[preIdx], + post_align_arr[postIdx], type_multiple_post_align_arr[postIdx]); + if (result != 0) return result; } } return 0; } - diff --git a/test_conformance/vec_align/type_replacer.c b/test_conformance/vectors/type_replacer.cpp similarity index 62% rename from test_conformance/vec_align/type_replacer.c rename to test_conformance/vectors/type_replacer.cpp index 74967b2c..39c6194e 100644 --- a/test_conformance/vec_align/type_replacer.c +++ b/test_conformance/vectors/type_replacer.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -18,15 +18,15 @@ #include #endif // !_MSC_VER -size_t doReplace(char * dest, size_t destLength, const char * source, - const char * stringToReplace1, const char * replaceWith1, - const char * stringToReplace2, const char * replaceWith2) +size_t doReplace(char* dest, size_t destLength, const char* source, + const char* stringToReplace1, const char* replaceWith1, + const char* stringToReplace2, const char* replaceWith2) { size_t copyCount = 0; - const char * sourcePtr = source; - char * destPtr = dest; - const char * ptr1; - const char * ptr2; + const char* sourcePtr = source; + char* destPtr = dest; + const char* ptr1; + const char* ptr2; size_t nJump; size_t len1, len2; size_t lenReplace1, lenReplace2; @@ -34,14 +34,18 @@ size_t doReplace(char * dest, size_t destLength, const char * source, len2 = strlen(stringToReplace2); lenReplace1 = strlen(replaceWith1); lenReplace2 = strlen(replaceWith2); - for(;copyCount < destLength && *sourcePtr; ) + for (; copyCount < destLength && *sourcePtr;) { ptr1 = strstr(sourcePtr, stringToReplace1); ptr2 = strstr(sourcePtr, stringToReplace2); - if(ptr1 != NULL && (ptr2 == NULL || ptr2 > ptr1)) + if (ptr1 != NULL && (ptr2 == NULL || ptr2 > ptr1)) { - nJump = ptr1-sourcePtr; - if(((uintptr_t)ptr1-(uintptr_t)sourcePtr) > destLength-copyCount) { return -1; } + nJump = ptr1 - sourcePtr; + if (((uintptr_t)ptr1 - (uintptr_t)sourcePtr) + > destLength - copyCount) + { + return -1; + } copyCount += nJump; strncpy(destPtr, sourcePtr, nJump); destPtr += nJump; @@ -49,10 +53,13 @@ size_t doReplace(char * dest, size_t destLength, const char * source, strcpy(destPtr, replaceWith1); destPtr += lenReplace1; } - else if(ptr2 != NULL && (ptr1 == NULL || ptr1 >= ptr2)) + else if (ptr2 != NULL && (ptr1 == NULL || ptr1 >= ptr2)) { - nJump = ptr2-sourcePtr; - if(nJump > destLength-copyCount) { return -2; } + nJump = ptr2 - sourcePtr; + if (nJump > destLength - copyCount) + { + return -2; + } copyCount += nJump; strncpy(destPtr, sourcePtr, nJump); destPtr += nJump; @@ -63,7 +70,10 @@ size_t doReplace(char * dest, size_t destLength, const char * source, else { nJump = strlen(sourcePtr); - if(nJump > destLength-copyCount) { return -3; } + if (nJump > destLength - copyCount) + { + return -3; + } copyCount += nJump; strcpy(destPtr, sourcePtr); destPtr += nJump; @@ -74,25 +84,29 @@ size_t doReplace(char * dest, size_t destLength, const char * source, return copyCount; } -size_t doSingleReplace(char * dest, size_t destLength, const char * source, - const char * stringToReplace, const char * replaceWith) +size_t doSingleReplace(char* dest, size_t destLength, const char* source, + const char* stringToReplace, const char* replaceWith) { size_t copyCount = 0; - const char * sourcePtr = source; - char * destPtr = dest; - const char * ptr; + const char* sourcePtr = source; + char* destPtr = dest; + const char* ptr; size_t nJump; size_t len; size_t lenReplace; len = strlen(stringToReplace); lenReplace = strlen(replaceWith); - for(;copyCount < destLength && *sourcePtr; ) + for (; copyCount < destLength && *sourcePtr;) { ptr = strstr(sourcePtr, stringToReplace); - if(ptr != NULL) + if (ptr != NULL) { - nJump = ptr-sourcePtr; - if(((uintptr_t)ptr-(uintptr_t)sourcePtr) > destLength-copyCount) { return -1; } + nJump = ptr - sourcePtr; + if (((uintptr_t)ptr - (uintptr_t)sourcePtr) + > destLength - copyCount) + { + return -1; + } copyCount += nJump; strncpy(destPtr, sourcePtr, nJump); destPtr += nJump; @@ -103,7 +117,10 @@ size_t doSingleReplace(char * dest, size_t destLength, const char * source, else { nJump = strlen(sourcePtr); - if(nJump > destLength-copyCount) { return -3; } + if (nJump > destLength - copyCount) + { + return -3; + } copyCount += nJump; strcpy(destPtr, sourcePtr); destPtr += nJump; diff --git a/test_conformance/vec_step/type_replacer.h b/test_conformance/vectors/type_replacer.h similarity index 62% rename from test_conformance/vec_step/type_replacer.h rename to test_conformance/vectors/type_replacer.h index f50b08d7..d7eb7efc 100644 --- a/test_conformance/vec_step/type_replacer.h +++ b/test_conformance/vectors/type_replacer.h @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -15,9 +15,9 @@ // #include -size_t doReplace(char * dest, size_t destLength, const char * source, - const char * stringToReplace1, const char * replaceWith1, - const char * stringToReplace2, const char * replaceWith2); +size_t doReplace(char* dest, size_t destLength, const char* source, + const char* stringToReplace1, const char* replaceWith1, + const char* stringToReplace2, const char* replaceWith2); -size_t doSingleReplace(char * dest, size_t destLength, const char * source, - const char * stringToReplace, const char * replaceWith); +size_t doSingleReplace(char* dest, size_t destLength, const char* source, + const char* stringToReplace, const char* replaceWith); diff --git a/test_conformance/workgroups/CMakeLists.txt b/test_conformance/workgroups/CMakeLists.txt index 0fc0c860..08886086 100644 --- a/test_conformance/workgroups/CMakeLists.txt +++ b/test_conformance/workgroups/CMakeLists.txt @@ -1,27 +1,19 @@ set(MODULE_NAME WORKGROUPS) set(${MODULE_NAME}_SOURCES - main.c - test_wg_all.c - test_wg_any.c - test_wg_broadcast.c - test_wg_reduce.c - test_wg_reduce_max.c - test_wg_reduce_min.c - test_wg_scan_exclusive_add.c - test_wg_scan_exclusive_min.c - test_wg_scan_exclusive_max.c - test_wg_scan_inclusive_add.c - test_wg_scan_inclusive_min.c - test_wg_scan_inclusive_max.c - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/mt19937.c - ../../test_common/harness/msvc9.c - ../../test_common/harness/conversions.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c + main.cpp + test_wg_all.cpp + test_wg_any.cpp + test_wg_broadcast.cpp + test_wg_reduce.cpp + test_wg_reduce_max.cpp + test_wg_reduce_min.cpp + test_wg_scan_exclusive_add.cpp + test_wg_scan_exclusive_min.cpp + test_wg_scan_exclusive_max.cpp + test_wg_scan_inclusive_add.cpp + test_wg_scan_inclusive_min.cpp + test_wg_scan_inclusive_max.cpp ) include(../CMakeCommon.txt) diff --git a/test_conformance/workgroups/main.c b/test_conformance/workgroups/main.c deleted file mode 100644 index 909137c6..00000000 --- a/test_conformance/workgroups/main.c +++ /dev/null @@ -1,49 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "../../test_common/harness/compat.h" - -#include -#include -#include "procs.h" -#include "../../test_common/harness/testHarness.h" -#if !defined(_WIN32) -#include -#endif - -test_definition test_list[] = { - ADD_TEST( work_group_all ), - ADD_TEST( work_group_any ), - ADD_TEST( work_group_reduce_add ), - ADD_TEST( work_group_reduce_min ), - ADD_TEST( work_group_reduce_max ), - ADD_TEST( work_group_scan_inclusive_add ), - ADD_TEST( work_group_scan_inclusive_min ), - ADD_TEST( work_group_scan_inclusive_max ), - ADD_TEST( work_group_scan_exclusive_add ), - ADD_TEST( work_group_scan_exclusive_min ), - ADD_TEST( work_group_scan_exclusive_max ), - ADD_TEST( work_group_broadcast_1D ), - ADD_TEST( work_group_broadcast_2D ), - ADD_TEST( work_group_broadcast_3D ), -}; - -const int test_num = ARRAY_SIZE( test_list ); - -int main(int argc, const char *argv[]) -{ - return runTestHarness( argc, argv, test_num, test_list, false, false, 0 ); -} - diff --git a/test_conformance/workgroups/main.cpp b/test_conformance/workgroups/main.cpp new file mode 100644 index 00000000..41ffa741 --- /dev/null +++ b/test_conformance/workgroups/main.cpp @@ -0,0 +1,82 @@ +// +// Copyright (c) 2017 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "harness/compat.h" + +#include "harness/testHarness.h" +#include "procs.h" +#include +#include +#if !defined(_WIN32) +#include +#endif + +test_definition test_list[] = { + ADD_TEST(work_group_all), + ADD_TEST(work_group_any), + ADD_TEST(work_group_reduce_add), + ADD_TEST(work_group_reduce_min), + ADD_TEST(work_group_reduce_max), + ADD_TEST(work_group_scan_inclusive_add), + ADD_TEST(work_group_scan_inclusive_min), + ADD_TEST(work_group_scan_inclusive_max), + ADD_TEST(work_group_scan_exclusive_add), + ADD_TEST(work_group_scan_exclusive_min), + ADD_TEST(work_group_scan_exclusive_max), + ADD_TEST(work_group_broadcast_1D), + ADD_TEST(work_group_broadcast_2D), + ADD_TEST(work_group_broadcast_3D), +}; + +const int test_num = ARRAY_SIZE(test_list); + +test_status InitCL(cl_device_id device) { + auto version = get_device_cl_version(device); + auto expected_min_version = Version(2, 0); + if (version < expected_min_version) + { + version_expected_info("Test", "OpenCL", + expected_min_version.to_string().c_str(), + version.to_string().c_str()); + return TEST_SKIP; + } + + if (version >= Version(3, 0)) + { + int error; + cl_bool isSupported; + error = clGetDeviceInfo( + device, CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT, + sizeof(isSupported), &isSupported, NULL); + if (error != CL_SUCCESS) + { + print_error(error, + "Unable to query support for collective functions"); + return TEST_FAIL; + } + + if (isSupported == CL_FALSE) + { + return TEST_SKIP; + } + } + + return TEST_PASS; +} + +int main(int argc, const char *argv[]) { + return runTestHarnessWithCheck(argc, argv, test_num, test_list, false, 0, InitCL); +} + diff --git a/test_conformance/workgroups/procs.h b/test_conformance/workgroups/procs.h index 0f919148..2e6e79e2 100644 --- a/test_conformance/workgroups/procs.h +++ b/test_conformance/workgroups/procs.h @@ -13,11 +13,11 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/testHarness.h" -#include "../../test_common/harness/kernelHelpers.h" -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/conversions.h" -#include "../../test_common/harness/mt19937.h" +#include "harness/testHarness.h" +#include "harness/kernelHelpers.h" +#include "harness/errorHelpers.h" +#include "harness/conversions.h" +#include "harness/mt19937.h" extern int create_program_and_kernel(const char *source, const char *kernel_name, cl_program *program_ret, cl_kernel *kernel_ret); diff --git a/test_conformance/workgroups/testBase.h b/test_conformance/workgroups/testBase.h index 5073b21f..5b49bfd7 100644 --- a/test_conformance/workgroups/testBase.h +++ b/test_conformance/workgroups/testBase.h @@ -16,7 +16,7 @@ #ifndef _testBase_h #define _testBase_h -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include diff --git a/test_conformance/workgroups/test_wg_all.c b/test_conformance/workgroups/test_wg_all.cpp similarity index 94% rename from test_conformance/workgroups/test_wg_all.c rename to test_conformance/workgroups/test_wg_all.cpp index da775d6b..33ebe993 100644 --- a/test_conformance/workgroups/test_wg_all.c +++ b/test_conformance/workgroups/test_wg_all.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -83,9 +83,9 @@ test_work_group_all(cl_device_id device, cl_context context, cl_command_queue qu if (err) return -1; - err = clGetKernelWorkGroupInfo( kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), wg_size, NULL); - if (err) - return -1; + // "wg_size" is limited to that of the first dimension as only a 1DRange is executed. + err = get_max_allowed_1d_work_group_size_on_device(device, kernel, wg_size); + test_error(err, "get_max_allowed_1d_work_group_size_on_device failed"); num_elements = n_elems; diff --git a/test_conformance/workgroups/test_wg_any.c b/test_conformance/workgroups/test_wg_any.cpp similarity index 94% rename from test_conformance/workgroups/test_wg_any.c rename to test_conformance/workgroups/test_wg_any.cpp index e843a5b3..cd1ebffc 100644 --- a/test_conformance/workgroups/test_wg_any.c +++ b/test_conformance/workgroups/test_wg_any.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -83,9 +83,9 @@ test_work_group_any(cl_device_id device, cl_context context, cl_command_queue qu if (err) return -1; - err = clGetKernelWorkGroupInfo( kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), wg_size, NULL); - if (err) - return -1; + // "wg_size" is limited to that of the first dimension as only a 1DRange is executed. + err = get_max_allowed_1d_work_group_size_on_device(device, kernel, wg_size); + test_error(err, "get_max_allowed_1d_work_group_size_on_device failed"); num_elements = n_elems; diff --git a/test_conformance/workgroups/test_wg_broadcast.c b/test_conformance/workgroups/test_wg_broadcast.cpp similarity index 98% rename from test_conformance/workgroups/test_wg_broadcast.c rename to test_conformance/workgroups/test_wg_broadcast.cpp index 6a49aa21..df4263b9 100644 --- a/test_conformance/workgroups/test_wg_broadcast.c +++ b/test_conformance/workgroups/test_wg_broadcast.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -178,9 +178,9 @@ test_work_group_broadcast_1D(cl_device_id device, cl_context context, cl_command if (err) return -1; - err = clGetKernelWorkGroupInfo( kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), wg_size, NULL); - if (err) - return -1; + // "wg_size" is limited to that of the first dimension as only a 1DRange is executed. + err = get_max_allowed_1d_work_group_size_on_device(device, kernel, wg_size); + test_error(err, "get_max_allowed_1d_work_group_size_on_device failed"); num_elements = n_elems; diff --git a/test_conformance/workgroups/test_wg_reduce.c b/test_conformance/workgroups/test_wg_reduce.cpp similarity index 94% rename from test_conformance/workgroups/test_wg_reduce.c rename to test_conformance/workgroups/test_wg_reduce.cpp index 5b7c0f85..92a5165e 100644 --- a/test_conformance/workgroups/test_wg_reduce.c +++ b/test_conformance/workgroups/test_wg_reduce.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -180,9 +180,9 @@ test_work_group_reduce_add_int(cl_device_id device, cl_context context, cl_comma if (err) return -1; - err = clGetKernelWorkGroupInfo( kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), wg_size, NULL); - if (err) - return -1; + // "wg_size" is limited to that of the first dimension as only a 1DRange is executed. + err = get_max_allowed_1d_work_group_size_on_device(device, kernel, wg_size); + test_error(err, "get_max_allowed_1d_work_group_size_on_device failed"); num_elements = n_elems; @@ -281,9 +281,9 @@ test_work_group_reduce_add_uint(cl_device_id device, cl_context context, cl_comm if (err) return -1; - err = clGetKernelWorkGroupInfo( kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), wg_size, NULL); - if (err) - return -1; + // "wg_size" is limited to that of the first dimension as only a 1DRange is executed. + err = get_max_allowed_1d_work_group_size_on_device(device, kernel, wg_size); + test_error(err, "get_max_allowed_1d_work_group_size_on_device failed"); num_elements = n_elems; @@ -381,9 +381,9 @@ test_work_group_reduce_add_long(cl_device_id device, cl_context context, cl_comm if (err) return -1; - err = clGetKernelWorkGroupInfo( kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), wg_size, NULL); - if (err) - return -1; + // "wg_size" is limited to that of the first dimension as only a 1DRange is executed. + err = get_max_allowed_1d_work_group_size_on_device(device, kernel, wg_size); + test_error(err, "get_max_allowed_1d_work_group_size_on_device failed"); num_elements = n_elems; @@ -482,9 +482,9 @@ test_work_group_reduce_add_ulong(cl_device_id device, cl_context context, cl_com if (err) return -1; - err = clGetKernelWorkGroupInfo( kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), wg_size, NULL); - if (err) - return -1; + // "wg_size" is limited to that of the first dimension as only a 1DRange is executed. + err = get_max_allowed_1d_work_group_size_on_device(device, kernel, wg_size); + test_error(err, "get_max_allowed_1d_work_group_size_on_device failed"); num_elements = n_elems; diff --git a/test_conformance/workgroups/test_wg_reduce_max.c b/test_conformance/workgroups/test_wg_reduce_max.cpp similarity index 93% rename from test_conformance/workgroups/test_wg_reduce_max.c rename to test_conformance/workgroups/test_wg_reduce_max.cpp index 2af86f85..7f37b5ad 100644 --- a/test_conformance/workgroups/test_wg_reduce_max.c +++ b/test_conformance/workgroups/test_wg_reduce_max.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -171,6 +171,7 @@ test_work_group_reduce_max_int(cl_device_id device, cl_context context, cl_comma void *values[2]; size_t threads[1]; size_t wg_size[1]; + size_t wg_sizes_per_dimension[3]; size_t num_elements; int err; int i; @@ -184,6 +185,14 @@ test_work_group_reduce_max_int(cl_device_id device, cl_context context, cl_comma if (err) return -1; + err = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(size_t) * 3, wg_sizes_per_dimension, NULL); + if (err) + return -1; + if(wg_sizes_per_dimension[0] < wg_size[0]) + { + wg_size[0] = wg_sizes_per_dimension[0]; + } + num_elements = n_elems; input_ptr[0] = (cl_int*)malloc(sizeof(cl_int) * num_elements); @@ -272,6 +281,7 @@ test_work_group_reduce_max_uint(cl_device_id device, cl_context context, cl_comm void *values[2]; size_t threads[1]; size_t wg_size[1]; + size_t wg_sizes_per_dimension[3]; size_t num_elements; int err; int i; @@ -285,6 +295,14 @@ test_work_group_reduce_max_uint(cl_device_id device, cl_context context, cl_comm if (err) return -1; + err = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(size_t) * 3, wg_sizes_per_dimension, NULL); + if (err) + return -1; + if(wg_sizes_per_dimension[0] < wg_size[0]) + { + wg_size[0] = wg_sizes_per_dimension[0]; + } + num_elements = n_elems; input_ptr[0] = (cl_uint*)malloc(sizeof(cl_uint) * num_elements); @@ -372,6 +390,7 @@ test_work_group_reduce_max_long(cl_device_id device, cl_context context, cl_comm void *values[2]; size_t threads[1]; size_t wg_size[1]; + size_t wg_sizes_per_dimension[3]; size_t num_elements; int err; int i; @@ -385,6 +404,14 @@ test_work_group_reduce_max_long(cl_device_id device, cl_context context, cl_comm if (err) return -1; + err = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(size_t) * 3, wg_sizes_per_dimension, NULL); + if (err) + return -1; + if(wg_sizes_per_dimension[0] < wg_size[0]) + { + wg_size[0] = wg_sizes_per_dimension[0]; + } + num_elements = n_elems; input_ptr[0] = (cl_long*)malloc(sizeof(cl_long) * num_elements); @@ -473,6 +500,7 @@ test_work_group_reduce_max_ulong(cl_device_id device, cl_context context, cl_com void *values[2]; size_t threads[1]; size_t wg_size[1]; + size_t wg_sizes_per_dimension[3]; size_t num_elements; int err; int i; @@ -486,6 +514,14 @@ test_work_group_reduce_max_ulong(cl_device_id device, cl_context context, cl_com if (err) return -1; + err = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(size_t) * 3, wg_sizes_per_dimension, NULL); + if (err) + return -1; + if(wg_sizes_per_dimension[0] < wg_size[0]) + { + wg_size[0] = wg_sizes_per_dimension[0]; + } + num_elements = n_elems; input_ptr[0] = (cl_ulong*)malloc(sizeof(cl_ulong) * num_elements); diff --git a/test_conformance/workgroups/test_wg_reduce_min.c b/test_conformance/workgroups/test_wg_reduce_min.cpp similarity index 93% rename from test_conformance/workgroups/test_wg_reduce_min.c rename to test_conformance/workgroups/test_wg_reduce_min.cpp index 7b302201..9d929c81 100644 --- a/test_conformance/workgroups/test_wg_reduce_min.c +++ b/test_conformance/workgroups/test_wg_reduce_min.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -171,6 +171,7 @@ test_work_group_reduce_min_int(cl_device_id device, cl_context context, cl_comma void *values[2]; size_t threads[1]; size_t wg_size[1]; + size_t wg_sizes_per_dimension[3]; size_t num_elements; int err; int i; @@ -184,6 +185,14 @@ test_work_group_reduce_min_int(cl_device_id device, cl_context context, cl_comma if (err) return -1; + err = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(size_t) * 3, wg_sizes_per_dimension, NULL); + if (err) + return -1; + if(wg_sizes_per_dimension[0] < wg_size[0]) + { + wg_size[0] = wg_sizes_per_dimension[0]; + } + num_elements = n_elems; input_ptr[0] = (cl_int*)malloc(sizeof(cl_int) * num_elements); @@ -272,6 +281,7 @@ test_work_group_reduce_min_uint(cl_device_id device, cl_context context, cl_comm void *values[2]; size_t threads[1]; size_t wg_size[1]; + size_t wg_sizes_per_dimension[3]; size_t num_elements; int err; int i; @@ -285,6 +295,14 @@ test_work_group_reduce_min_uint(cl_device_id device, cl_context context, cl_comm if (err) return -1; + err = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(size_t) * 3, wg_sizes_per_dimension, NULL); + if (err) + return -1; + if(wg_sizes_per_dimension[0] < wg_size[0]) + { + wg_size[0] = wg_sizes_per_dimension[0]; + } + num_elements = n_elems; input_ptr[0] = (cl_uint*)malloc(sizeof(cl_uint) * num_elements); @@ -372,6 +390,7 @@ test_work_group_reduce_min_long(cl_device_id device, cl_context context, cl_comm void *values[2]; size_t threads[1]; size_t wg_size[1]; + size_t wg_sizes_per_dimension[3]; size_t num_elements; int err; int i; @@ -385,6 +404,14 @@ test_work_group_reduce_min_long(cl_device_id device, cl_context context, cl_comm if (err) return -1; + err = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(size_t) * 3, wg_sizes_per_dimension, NULL); + if (err) + return -1; + if(wg_sizes_per_dimension[0] < wg_size[0]) + { + wg_size[0] = wg_sizes_per_dimension[0]; + } + num_elements = n_elems; input_ptr[0] = (cl_long*)malloc(sizeof(cl_long) * num_elements); @@ -473,6 +500,7 @@ test_work_group_reduce_min_ulong(cl_device_id device, cl_context context, cl_com void *values[2]; size_t threads[1]; size_t wg_size[1]; + size_t wg_sizes_per_dimension[3]; size_t num_elements; int err; int i; @@ -486,6 +514,14 @@ test_work_group_reduce_min_ulong(cl_device_id device, cl_context context, cl_com if (err) return -1; + err = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(size_t) * 3, wg_sizes_per_dimension, NULL); + if (err) + return -1; + if(wg_sizes_per_dimension[0] < wg_size[0]) + { + wg_size[0] = wg_sizes_per_dimension[0]; + } + num_elements = n_elems; input_ptr[0] = (cl_ulong*)malloc(sizeof(cl_ulong) * num_elements); diff --git a/test_conformance/workgroups/test_wg_scan_exclusive_add.c b/test_conformance/workgroups/test_wg_scan_exclusive_add.cpp similarity index 94% rename from test_conformance/workgroups/test_wg_scan_exclusive_add.c rename to test_conformance/workgroups/test_wg_scan_exclusive_add.cpp index 99d9273e..40c50c8c 100644 --- a/test_conformance/workgroups/test_wg_scan_exclusive_add.c +++ b/test_conformance/workgroups/test_wg_scan_exclusive_add.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -188,9 +188,9 @@ test_work_group_scan_exclusive_add_int(cl_device_id device, cl_context context, if (err) return -1; - err = clGetKernelWorkGroupInfo( kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), wg_size, NULL); - if (err) - return -1; + // "wg_size" is limited to that of the first dimension as only a 1DRange is executed. + err = get_max_allowed_1d_work_group_size_on_device(device, kernel, wg_size); + test_error(err, "get_max_allowed_1d_work_group_size_on_device failed"); num_elements = n_elems; @@ -289,9 +289,9 @@ test_work_group_scan_exclusive_add_uint(cl_device_id device, cl_context context, if (err) return -1; - err = clGetKernelWorkGroupInfo( kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), wg_size, NULL); - if (err) - return -1; + // "wg_size" is limited to that of the first dimension as only a 1DRange is executed. + err = get_max_allowed_1d_work_group_size_on_device(device, kernel, wg_size); + test_error(err, "get_max_allowed_1d_work_group_size_on_device failed"); num_elements = n_elems; @@ -389,9 +389,9 @@ test_work_group_scan_exclusive_add_long(cl_device_id device, cl_context context, if (err) return -1; - err = clGetKernelWorkGroupInfo( kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), wg_size, NULL); - if (err) - return -1; + // "wg_size" is limited to that of the first dimension as only a 1DRange is executed. + err = get_max_allowed_1d_work_group_size_on_device(device, kernel, wg_size); + test_error(err, "get_max_allowed_1d_work_group_size_on_device failed"); num_elements = n_elems; @@ -490,9 +490,9 @@ test_work_group_scan_exclusive_add_ulong(cl_device_id device, cl_context context if (err) return -1; - err = clGetKernelWorkGroupInfo( kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), wg_size, NULL); - if (err) - return -1; + // "wg_size" is limited to that of the first dimension as only a 1DRange is executed. + err = get_max_allowed_1d_work_group_size_on_device(device, kernel, wg_size); + test_error(err, "get_max_allowed_1d_work_group_size_on_device failed"); num_elements = n_elems; diff --git a/test_conformance/workgroups/test_wg_scan_exclusive_max.c b/test_conformance/workgroups/test_wg_scan_exclusive_max.cpp similarity index 93% rename from test_conformance/workgroups/test_wg_scan_exclusive_max.c rename to test_conformance/workgroups/test_wg_scan_exclusive_max.cpp index 87a870b9..7f37acd2 100644 --- a/test_conformance/workgroups/test_wg_scan_exclusive_max.c +++ b/test_conformance/workgroups/test_wg_scan_exclusive_max.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -170,6 +170,7 @@ test_work_group_scan_exclusive_max_int(cl_device_id device, cl_context context, void *values[2]; size_t threads[1]; size_t wg_size[1]; + size_t wg_sizes_per_dimension[3]; size_t num_elements; int err; int i; @@ -183,6 +184,14 @@ test_work_group_scan_exclusive_max_int(cl_device_id device, cl_context context, if (err) return -1; + err = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(size_t) * 3, wg_sizes_per_dimension, NULL); + if (err) + return -1; + if(wg_sizes_per_dimension[0] < wg_size[0]) + { + wg_size[0] = wg_sizes_per_dimension[0]; + } + num_elements = n_elems; input_ptr[0] = (cl_int*)malloc(sizeof(cl_int) * num_elements); @@ -271,6 +280,7 @@ test_work_group_scan_exclusive_max_uint(cl_device_id device, cl_context context, void *values[2]; size_t threads[1]; size_t wg_size[1]; + size_t wg_sizes_per_dimension[3]; size_t num_elements; int err; int i; @@ -284,6 +294,14 @@ test_work_group_scan_exclusive_max_uint(cl_device_id device, cl_context context, if (err) return -1; + err = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(size_t) * 3, wg_sizes_per_dimension, NULL); + if (err) + return -1; + if(wg_sizes_per_dimension[0] < wg_size[0]) + { + wg_size[0] = wg_sizes_per_dimension[0]; + } + num_elements = n_elems; input_ptr[0] = (cl_uint*)malloc(sizeof(cl_uint) * num_elements); @@ -371,6 +389,7 @@ test_work_group_scan_exclusive_max_long(cl_device_id device, cl_context context, void *values[2]; size_t threads[1]; size_t wg_size[1]; + size_t wg_sizes_per_dimension[3]; size_t num_elements; int err; int i; @@ -384,6 +403,14 @@ test_work_group_scan_exclusive_max_long(cl_device_id device, cl_context context, if (err) return -1; + err = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(size_t) * 3, wg_sizes_per_dimension, NULL); + if (err) + return -1; + if(wg_sizes_per_dimension[0] < wg_size[0]) + { + wg_size[0] = wg_sizes_per_dimension[0]; + } + num_elements = n_elems; input_ptr[0] = (cl_long*)malloc(sizeof(cl_long) * num_elements); @@ -472,6 +499,7 @@ test_work_group_scan_exclusive_max_ulong(cl_device_id device, cl_context context void *values[2]; size_t threads[1]; size_t wg_size[1]; + size_t wg_sizes_per_dimension[3]; size_t num_elements; int err; int i; @@ -485,6 +513,14 @@ test_work_group_scan_exclusive_max_ulong(cl_device_id device, cl_context context if (err) return -1; + err = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(size_t) * 3, wg_sizes_per_dimension, NULL); + if (err) + return -1; + if(wg_sizes_per_dimension[0] < wg_size[0]) + { + wg_size[0] = wg_sizes_per_dimension[0]; + } + num_elements = n_elems; input_ptr[0] = (cl_ulong*)malloc(sizeof(cl_ulong) * num_elements); diff --git a/test_conformance/workgroups/test_wg_scan_exclusive_min.c b/test_conformance/workgroups/test_wg_scan_exclusive_min.cpp similarity index 93% rename from test_conformance/workgroups/test_wg_scan_exclusive_min.c rename to test_conformance/workgroups/test_wg_scan_exclusive_min.cpp index 435a8704..61110533 100644 --- a/test_conformance/workgroups/test_wg_scan_exclusive_min.c +++ b/test_conformance/workgroups/test_wg_scan_exclusive_min.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -171,6 +171,7 @@ test_work_group_scan_exclusive_min_int(cl_device_id device, cl_context context, void *values[2]; size_t threads[1]; size_t wg_size[1]; + size_t wg_sizes_per_dimension[3]; size_t num_elements; int err; int i; @@ -184,6 +185,14 @@ test_work_group_scan_exclusive_min_int(cl_device_id device, cl_context context, if (err) return -1; + err = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(size_t) * 3, wg_sizes_per_dimension, NULL); + if (err) + return -1; + if(wg_sizes_per_dimension[0] < wg_size[0]) + { + wg_size[0] = wg_sizes_per_dimension[0]; + } + num_elements = n_elems; input_ptr[0] = (cl_int*)malloc(sizeof(cl_int) * num_elements); @@ -272,6 +281,7 @@ test_work_group_scan_exclusive_min_uint(cl_device_id device, cl_context context, void *values[2]; size_t threads[1]; size_t wg_size[1]; + size_t wg_sizes_per_dimension[3]; size_t num_elements; int err; int i; @@ -285,6 +295,14 @@ test_work_group_scan_exclusive_min_uint(cl_device_id device, cl_context context, if (err) return -1; + err = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(size_t) * 3, wg_sizes_per_dimension, NULL); + if (err) + return -1; + if(wg_sizes_per_dimension[0] < wg_size[0]) + { + wg_size[0] = wg_sizes_per_dimension[0]; + } + num_elements = n_elems; input_ptr[0] = (cl_uint*)malloc(sizeof(cl_uint) * num_elements); @@ -372,6 +390,7 @@ test_work_group_scan_exclusive_min_long(cl_device_id device, cl_context context, void *values[2]; size_t threads[1]; size_t wg_size[1]; + size_t wg_sizes_per_dimension[3]; size_t num_elements; int err; int i; @@ -385,6 +404,14 @@ test_work_group_scan_exclusive_min_long(cl_device_id device, cl_context context, if (err) return -1; + err = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(size_t) * 3, wg_sizes_per_dimension, NULL); + if (err) + return -1; + if(wg_sizes_per_dimension[0] < wg_size[0]) + { + wg_size[0] = wg_sizes_per_dimension[0]; + } + num_elements = n_elems; input_ptr[0] = (cl_long*)malloc(sizeof(cl_long) * num_elements); @@ -473,6 +500,7 @@ test_work_group_scan_exclusive_min_ulong(cl_device_id device, cl_context context void *values[2]; size_t threads[1]; size_t wg_size[1]; + size_t wg_sizes_per_dimension[3]; size_t num_elements; int err; int i; @@ -486,6 +514,14 @@ test_work_group_scan_exclusive_min_ulong(cl_device_id device, cl_context context if (err) return -1; + err = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(size_t) * 3, wg_sizes_per_dimension, NULL); + if (err) + return -1; + if(wg_sizes_per_dimension[0] < wg_size[0]) + { + wg_size[0] = wg_sizes_per_dimension[0]; + } + num_elements = n_elems; input_ptr[0] = (cl_ulong*)malloc(sizeof(cl_ulong) * num_elements); diff --git a/test_conformance/workgroups/test_wg_scan_inclusive_add.c b/test_conformance/workgroups/test_wg_scan_inclusive_add.cpp similarity index 94% rename from test_conformance/workgroups/test_wg_scan_inclusive_add.c rename to test_conformance/workgroups/test_wg_scan_inclusive_add.cpp index c64d8047..9546794b 100644 --- a/test_conformance/workgroups/test_wg_scan_inclusive_add.c +++ b/test_conformance/workgroups/test_wg_scan_inclusive_add.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -177,9 +177,9 @@ test_work_group_scan_inclusive_add_int(cl_device_id device, cl_context context, if (err) return -1; - err = clGetKernelWorkGroupInfo( kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), wg_size, NULL); - if (err) - return -1; + // "wg_size" is limited to that of the first dimension as only a 1DRange is executed. + err = get_max_allowed_1d_work_group_size_on_device(device, kernel, wg_size); + test_error(err, "get_max_allowed_1d_work_group_size_on_device failed"); num_elements = n_elems; @@ -278,9 +278,9 @@ test_work_group_scan_inclusive_add_uint(cl_device_id device, cl_context context, if (err) return -1; - err = clGetKernelWorkGroupInfo( kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), wg_size, NULL); - if (err) - return -1; + // "wg_size" is limited to that of the first dimension as only a 1DRange is executed. + err = get_max_allowed_1d_work_group_size_on_device(device, kernel, wg_size); + test_error(err, "get_max_allowed_1d_work_group_size_on_device failed"); num_elements = n_elems; @@ -378,9 +378,9 @@ test_work_group_scan_inclusive_add_long(cl_device_id device, cl_context context, if (err) return -1; - err = clGetKernelWorkGroupInfo( kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), wg_size, NULL); - if (err) - return -1; + // "wg_size" is limited to that of the first dimension as only a 1DRange is executed. + err = get_max_allowed_1d_work_group_size_on_device(device, kernel, wg_size); + test_error(err, "get_max_allowed_1d_work_group_size_on_device failed"); num_elements = n_elems; @@ -479,9 +479,9 @@ test_work_group_scan_inclusive_add_ulong(cl_device_id device, cl_context context if (err) return -1; - err = clGetKernelWorkGroupInfo( kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), wg_size, NULL); - if (err) - return -1; + // "wg_size" is limited to that of the first dimension as only a 1DRange is executed. + err = get_max_allowed_1d_work_group_size_on_device(device, kernel, wg_size); + test_error(err, "get_max_allowed_1d_work_group_size_on_device failed"); num_elements = n_elems; diff --git a/test_conformance/workgroups/test_wg_scan_inclusive_max.c b/test_conformance/workgroups/test_wg_scan_inclusive_max.cpp similarity index 94% rename from test_conformance/workgroups/test_wg_scan_inclusive_max.c rename to test_conformance/workgroups/test_wg_scan_inclusive_max.cpp index 2b209886..23d518c8 100644 --- a/test_conformance/workgroups/test_wg_scan_inclusive_max.c +++ b/test_conformance/workgroups/test_wg_scan_inclusive_max.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -179,9 +179,9 @@ test_work_group_scan_inclusive_max_int(cl_device_id device, cl_context context, if (err) return -1; - err = clGetKernelWorkGroupInfo( kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), wg_size, NULL); - if (err) - return -1; + // "wg_size" is limited to that of the first dimension as only a 1DRange is executed. + err = get_max_allowed_1d_work_group_size_on_device(device, kernel, wg_size); + test_error(err, "get_max_allowed_1d_work_group_size_on_device failed"); num_elements = n_elems; @@ -280,9 +280,9 @@ test_work_group_scan_inclusive_max_uint(cl_device_id device, cl_context context, if (err) return -1; - err = clGetKernelWorkGroupInfo( kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), wg_size, NULL); - if (err) - return -1; + // "wg_size" is limited to that of the first dimension as only a 1DRange is executed. + err = get_max_allowed_1d_work_group_size_on_device(device, kernel, wg_size); + test_error(err, "get_max_allowed_1d_work_group_size_on_device failed"); num_elements = n_elems; @@ -380,9 +380,9 @@ test_work_group_scan_inclusive_max_long(cl_device_id device, cl_context context, if (err) return -1; - err = clGetKernelWorkGroupInfo( kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), wg_size, NULL); - if (err) - return -1; + // "wg_size" is limited to that of the first dimension as only a 1DRange is executed. + err = get_max_allowed_1d_work_group_size_on_device(device, kernel, wg_size); + test_error(err, "get_max_allowed_1d_work_group_size_on_device failed"); num_elements = n_elems; @@ -481,9 +481,9 @@ test_work_group_scan_inclusive_max_ulong(cl_device_id device, cl_context context if (err) return -1; - err = clGetKernelWorkGroupInfo( kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), wg_size, NULL); - if (err) - return -1; + // "wg_size" is limited to that of the first dimension as only a 1DRange is executed. + err = get_max_allowed_1d_work_group_size_on_device(device, kernel, wg_size); + test_error(err, "get_max_allowed_1d_work_group_size_on_device failed"); num_elements = n_elems; diff --git a/test_conformance/workgroups/test_wg_scan_inclusive_min.c b/test_conformance/workgroups/test_wg_scan_inclusive_min.cpp similarity index 94% rename from test_conformance/workgroups/test_wg_scan_inclusive_min.c rename to test_conformance/workgroups/test_wg_scan_inclusive_min.cpp index 89012076..f4c788f5 100644 --- a/test_conformance/workgroups/test_wg_scan_inclusive_min.c +++ b/test_conformance/workgroups/test_wg_scan_inclusive_min.cpp @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "../../test_common/harness/compat.h" +#include "harness/compat.h" #include #include @@ -179,9 +179,9 @@ test_work_group_scan_inclusive_min_int(cl_device_id device, cl_context context, if (err) return -1; - err = clGetKernelWorkGroupInfo( kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), wg_size, NULL); - if (err) - return -1; + // "wg_size" is limited to that of the first dimension as only a 1DRange is executed. + err = get_max_allowed_1d_work_group_size_on_device(device, kernel, wg_size); + test_error(err, "get_max_allowed_1d_work_group_size_on_device failed"); num_elements = n_elems; @@ -280,9 +280,9 @@ test_work_group_scan_inclusive_min_uint(cl_device_id device, cl_context context, if (err) return -1; - err = clGetKernelWorkGroupInfo( kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), wg_size, NULL); - if (err) - return -1; + // "wg_size" is limited to that of the first dimension as only a 1DRange is executed. + err = get_max_allowed_1d_work_group_size_on_device(device, kernel, wg_size); + test_error(err, "get_max_allowed_1d_work_group_size_on_device failed"); num_elements = n_elems; @@ -380,9 +380,9 @@ test_work_group_scan_inclusive_min_long(cl_device_id device, cl_context context, if (err) return -1; - err = clGetKernelWorkGroupInfo( kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), wg_size, NULL); - if (err) - return -1; + // "wg_size" is limited to that of the first dimension as only a 1DRange is executed. + err = get_max_allowed_1d_work_group_size_on_device(device, kernel, wg_size); + test_error(err, "get_max_allowed_1d_work_group_size_on_device failed"); num_elements = n_elems; @@ -481,9 +481,9 @@ test_work_group_scan_inclusive_min_ulong(cl_device_id device, cl_context context if (err) return -1; - err = clGetKernelWorkGroupInfo( kernel, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), wg_size, NULL); - if (err) - return -1; + // "wg_size" is limited to that of the first dimension as only a 1DRange is executed. + err = get_max_allowed_1d_work_group_size_on_device(device, kernel, wg_size); + test_error(err, "get_max_allowed_1d_work_group_size_on_device failed"); num_elements = n_elems; diff --git a/test_extensions/CMakeLists.txt b/test_extensions/CMakeLists.txt new file mode 100644 index 00000000..3c48e186 --- /dev/null +++ b/test_extensions/CMakeLists.txt @@ -0,0 +1,2 @@ +set(HARNESS_LIB harness) +add_subdirectory( media_sharing ) diff --git a/test_extensions/media_sharing/CMakeLists.txt b/test_extensions/media_sharing/CMakeLists.txt index 957395a2..9fdde1c7 100644 --- a/test_extensions/media_sharing/CMakeLists.txt +++ b/test_extensions/media_sharing/CMakeLists.txt @@ -1,8 +1,8 @@ if(WIN32) list(APPEND CLConform_LIBRARIES d3d9.lib dxva2.lib ) -endif(WIN32) +set(MODULE_NAME MEDIA_SURFACE_SHARING) -set (MEDIA_SOURCES +set(${MODULE_NAME}_SOURCES main.cpp wrappers.cpp utils.cpp @@ -13,22 +13,13 @@ set (MEDIA_SOURCES test_interop_sync.cpp test_memory_access.cpp test_other_data_types.cpp - ../../test_common/harness/errorHelpers.c - ../../test_common/harness/kernelHelpers.c - ../../test_common/harness/testHarness.c - ../../test_common/harness/rounding_mode.c - ../../test_common/harness/typeWrappers.cpp - ../../test_common/harness/mt19937.c - ../../test_common/harness/parseParameters.cpp - ../../test_common/harness/crc32.c ) -add_executable(conformance_test_media_surface_sharing - ${MEDIA_SOURCES}) - set_source_files_properties( - ${MEDIA_SOURCES} + ${MODULE_NAME}_SOURCES PROPERTIES LANGUAGE CXX) -TARGET_LINK_LIBRARIES(conformance_test_media_surface_sharing - ${CLConform_LIBRARIES}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +include(../../test_conformance/CMakeCommon.txt) +endif(WIN32) diff --git a/test_extensions/media_sharing/main.cpp b/test_extensions/media_sharing/main.cpp index 75fa44b9..98b766ac 100644 --- a/test_extensions/media_sharing/main.cpp +++ b/test_extensions/media_sharing/main.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -16,40 +16,22 @@ #include #include -#include "../../test_common/harness/testHarness.h" +#include "harness/testHarness.h" #include "utils.h" +#include "procs.h" -extern int test_context_create(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_get_device_ids(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_api(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_kernel(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_other_data_types(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_memory_access(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_interop_user_sync(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -basefn basefn_list[] = { - test_context_create, - test_get_device_ids, - test_api, - test_kernel, - test_other_data_types, - test_memory_access, - test_interop_user_sync, +test_definition test_list[] = { +ADD_TEST( context_create ), +ADD_TEST( get_device_ids ), +ADD_TEST( api ), +ADD_TEST( kernel ), +ADD_TEST( other_data_types ), +ADD_TEST( memory_access ), +ADD_TEST( interop_user_sync ) }; -const char *basefn_names[] = { - "test_context_create", - "test_get_device_ids", - "test_api", - "test_kernel", - "test_other_data_types", - "test_memory_access", - "test_interop_user_sync", -}; - -ct_assert((sizeof(basefn_names) / sizeof(basefn_names[0])) == (sizeof(basefn_list) / sizeof(basefn_list[0]))); - -int num_fns = sizeof(basefn_names) / sizeof(char *); +const int test_num = ARRAY_SIZE(test_list); clGetDeviceIDsFromDX9MediaAdapterKHR_fn clGetDeviceIDsFromDX9MediaAdapterKHR = NULL; clCreateFromDX9MediaSurfaceKHR_fn clCreateFromDX9MediaSurfaceKHR = NULL; @@ -134,7 +116,7 @@ bool DetectPlatformAndDevice() for (size_t j = 0; j < devicesNum; ++j) { - if (ExtensionCheck("cl_khr_dx9_media_sharing", devices[j])) + if (is_extension_available(devices[j], "cl_khr_dx9_media_sharing")) { gPlatformIDdetected = platforms[i]; gDeviceIDdetected = devices[j]; @@ -207,16 +189,16 @@ bool CmdlineParse(int argc, const char *argv[]) int main(int argc, const char *argv[]) { if (!CmdlineParse(argc, argv)) - return 2; + return TEST_FAIL; if (!DetectPlatformAndDevice()) { log_info("Test was not run, because the media surface sharing extension is not supported\n"); - return TEST_NOT_SUPPORTED; + return TEST_SKIP; } if (!MediaSurfaceSharingExtensionInit()) - return 2; + return TEST_FAIL; - return runTestHarness( argc, argv, num_fns, basefn_list, basefn_names, false, true, 0 ); + return runTestHarness(argc, argv, test_num, test_list, false, true, 0); } diff --git a/test_extensions/media_sharing/procs.h b/test_extensions/media_sharing/procs.h new file mode 100644 index 00000000..6b577990 --- /dev/null +++ b/test_extensions/media_sharing/procs.h @@ -0,0 +1,31 @@ +// +// Copyright (c) 2019 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + + +#ifndef __MEDIA_SHARING_PROCS_H__ +#define __MEDIA_SHARING_PROCS_H__ + + +extern int test_context_create(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); +extern int test_get_device_ids(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); +extern int test_api(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); +extern int test_kernel(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); +extern int test_other_data_types(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); +extern int test_memory_access(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); +extern int test_interop_user_sync(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); + + +#endif // #ifndef __MEDIA_SHARING_PROCS_H__ \ No newline at end of file diff --git a/test_extensions/media_sharing/test_create_context.cpp b/test_extensions/media_sharing/test_create_context.cpp index 42deaa04..5637bc54 100644 --- a/test_extensions/media_sharing/test_create_context.cpp +++ b/test_extensions/media_sharing/test_create_context.cpp @@ -40,6 +40,13 @@ int context_create(cl_device_id deviceID, cl_context context, cl_command_queue q while (deviceWrapper->AdapterNext()) { + cl_int error; + //check if the test can be run on the adapter + if (CL_SUCCESS != (error = deviceExistForCLTest(gPlatformIDdetected, adapterType, deviceWrapper->Device(), result, sharedHandle))) + { + return result.Result(); + } + if (surfaceFormat != SURFACE_FORMAT_NV12 && !SurfaceFormatCheck(adapterType, *deviceWrapper, surfaceFormat)) { std::string sharedHandleStr = (sharedHandle == SHARED_HANDLE_ENABLED)? "yes": "no"; @@ -68,7 +75,6 @@ int context_create(cl_device_id deviceID, cl_context context, cl_command_queue q 0, }; - cl_int error; clContextWrapper ctx; switch(functionCreate) { @@ -230,13 +236,20 @@ int context_create(cl_device_id deviceID, cl_context context, cl_command_queue q } } - if (!deviceWrapper->Status()) + if (deviceWrapper->Status() != DEVICE_PASS) { std::string adapterName; AdapterToString(adapterType, adapterName); + if (deviceWrapper->Status() == DEVICE_FAIL) + { log_error("%s init failed\n", adapterName.c_str()); result.ResultSub(CResult::TEST_FAIL); - return result.Result(); + } + else + { + log_error("%s init incomplete due to unsupported device\n", adapterName.c_str()); + result.ResultSub(CResult::TEST_NOTSUPPORTED); + } } return result.Result(); diff --git a/test_extensions/media_sharing/test_functions_api.cpp b/test_extensions/media_sharing/test_functions_api.cpp index 21fe403d..cdc6ce86 100644 --- a/test_extensions/media_sharing/test_functions_api.cpp +++ b/test_extensions/media_sharing/test_functions_api.cpp @@ -51,6 +51,13 @@ int api_functions(cl_device_id deviceID, cl_context context, cl_command_queue qu //iterates through all devices while (deviceWrapper->AdapterNext()) { + cl_int error; + //check if the test can be run on the adapter + if (CL_SUCCESS != (error = deviceExistForCLTest(gPlatformIDdetected, adapterType, deviceWrapper->Device(), result, sharedHandle))) + { + return result.Result(); + } + if (surfaceFormat != SURFACE_FORMAT_NV12 && !SurfaceFormatCheck(adapterType, *deviceWrapper, surfaceFormat)) { std::string sharedHandleStr = (sharedHandle == SHARED_HANDLE_ENABLED)? "yes": "no"; @@ -81,7 +88,6 @@ int api_functions(cl_device_id deviceID, cl_context context, cl_command_queue qu 0, }; - cl_int error; clContextWrapper ctx = clCreateContext(&contextProperties[0], 1, &gDeviceIDdetected, NULL, NULL, &error); if (error != CL_SUCCESS) { @@ -506,13 +512,20 @@ int api_functions(cl_device_id deviceID, cl_context context, cl_command_queue qu } } - if (!deviceWrapper->Status()) + if (deviceWrapper->Status() != DEVICE_PASS) { std::string adapterName; AdapterToString(adapterType, adapterName); - log_error("%s init failed\n", adapterName.c_str()); - result.ResultSub(CResult::TEST_FAIL); - return result.Result(); + if (deviceWrapper->Status() == DEVICE_FAIL) + { + log_error("%s init failed\n", adapterName.c_str()); + result.ResultSub(CResult::TEST_FAIL); + } + else + { + log_error("%s init incomplete due to unsupported device\n", adapterName.c_str()); + result.ResultSub(CResult::TEST_NOTSUPPORTED); + } } return result.Result(); diff --git a/test_extensions/media_sharing/test_functions_kernel.cpp b/test_extensions/media_sharing/test_functions_kernel.cpp index eff297dc..f5c3e2da 100644 --- a/test_extensions/media_sharing/test_functions_kernel.cpp +++ b/test_extensions/media_sharing/test_functions_kernel.cpp @@ -16,8 +16,8 @@ #include #include -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" +#include "harness/errorHelpers.h" +#include "harness/kernelHelpers.h" #include "utils.h" @@ -71,6 +71,13 @@ int kernel_functions(cl_device_id deviceID, cl_context context, cl_command_queue while (deviceWrapper->AdapterNext()) { + cl_int error; + //check if the test can be run on the adapter + if (CL_SUCCESS != (error = deviceExistForCLTest(gPlatformIDdetected, adapterType, deviceWrapper->Device(), result, sharedHandle))) + { + return result.Result(); + } + if (surfaceFormat != SURFACE_FORMAT_NV12 && !SurfaceFormatCheck(adapterType, *deviceWrapper, surfaceFormat)) { std::string sharedHandleStr = (sharedHandle == SHARED_HANDLE_ENABLED)? "yes": "no"; @@ -109,7 +116,6 @@ int kernel_functions(cl_device_id deviceID, cl_context context, cl_command_queue 0, }; - cl_int error; clContextWrapper ctx = clCreateContext(&contextProperties[0], 1, &gDeviceIDdetected, NULL, NULL, &error); if (error != CL_SUCCESS) { @@ -335,13 +341,20 @@ int kernel_functions(cl_device_id deviceID, cl_context context, cl_command_queue } } - if (!deviceWrapper->Status()) + if (deviceWrapper->Status() != DEVICE_PASS) { - std::string adapter; - AdapterToString(adapterType, adapter); - log_error("%s init failed\n", adapter.c_str()); + std::string adapterName; + AdapterToString(adapterType, adapterName); + if (deviceWrapper->Status() == DEVICE_FAIL) + { + log_error("%s init failed\n", adapterName.c_str()); result.ResultSub(CResult::TEST_FAIL); - return result.Result(); + } + else + { + log_error("%s init incomplete due to unsupported device\n", adapterName.c_str()); + result.ResultSub(CResult::TEST_NOTSUPPORTED); + } } return result.Result(); diff --git a/test_extensions/media_sharing/test_get_device_ids.cpp b/test_extensions/media_sharing/test_get_device_ids.cpp index 68fdbf74..f8947ea6 100644 --- a/test_extensions/media_sharing/test_get_device_ids.cpp +++ b/test_extensions/media_sharing/test_get_device_ids.cpp @@ -53,6 +53,12 @@ int get_device_ids(cl_device_id deviceID, cl_context context, cl_command_queue q std::vector mediaDevices; mediaDevices.push_back(deviceWrapper->Device()); + //check if the test can be run on the adapter + if (CL_SUCCESS != (error = deviceExistForCLTest(gPlatformIDdetected, adapterType, deviceWrapper->Device(), result))) + { + return result.Result(); + } + cl_uint devicesAllNum = 0; error = clGetDeviceIDsFromDX9MediaAdapterKHR(gPlatformIDdetected, 1, &mediaAdapterTypes[0], &mediaDevices[0], CL_ALL_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR, 0, 0, &devicesAllNum); @@ -140,13 +146,20 @@ int get_device_ids(cl_device_id deviceID, cl_context context, cl_command_queue q } } - if (!deviceWrapper->Status()) + if (deviceWrapper->Status() != DEVICE_PASS) { - std::string adapter; - AdapterToString(adapterType, adapter); - log_error("%s init failed\n", adapter.c_str()); + std::string adapterName; + AdapterToString(adapterType, adapterName); + if (deviceWrapper->Status() == DEVICE_FAIL) + { + log_error("%s init failed\n", adapterName.c_str()); result.ResultSub(CResult::TEST_FAIL); - return result.Result(); + } + else + { + log_error("%s init incomplete due to unsupported device\n", adapterName.c_str()); + result.ResultSub(CResult::TEST_NOTSUPPORTED); + } } return result.Result(); diff --git a/test_extensions/media_sharing/test_interop_sync.cpp b/test_extensions/media_sharing/test_interop_sync.cpp index d15e4fbf..6831a14d 100644 --- a/test_extensions/media_sharing/test_interop_sync.cpp +++ b/test_extensions/media_sharing/test_interop_sync.cpp @@ -40,6 +40,13 @@ int interop_user_sync(cl_device_id deviceID, cl_context context, cl_command_queu while (deviceWrapper->AdapterNext()) { + cl_int error; + //check if the test can be run on the adapter + if (CL_SUCCESS != (error = deviceExistForCLTest(gPlatformIDdetected, adapterType, deviceWrapper->Device(), result, sharedHandle))) + { + return result.Result(); + } + if (surfaceFormat != SURFACE_FORMAT_NV12 && !SurfaceFormatCheck(adapterType, *deviceWrapper, surfaceFormat)) { @@ -71,7 +78,7 @@ int interop_user_sync(cl_device_id deviceID, cl_context context, cl_command_queu 0, }; - cl_int error; + clContextWrapper ctx; switch(functionCreate) { @@ -258,13 +265,21 @@ int interop_user_sync(cl_device_id deviceID, cl_context context, cl_command_queu } } - if (!deviceWrapper->Status()) + if (deviceWrapper->Status() != DEVICE_PASS) { std::string adapterName; AdapterToString(adapterType, adapterName); + + if (deviceWrapper->Status() == DEVICE_FAIL) + { log_error("%s init failed\n", adapterName.c_str()); result.ResultSub(CResult::TEST_FAIL); - return result.Result(); + } + else + { + log_error("%s init incomplete due to unsupported device\n", adapterName.c_str()); + result.ResultSub(CResult::TEST_NOTSUPPORTED); + } } return result.Result(); diff --git a/test_extensions/media_sharing/test_memory_access.cpp b/test_extensions/media_sharing/test_memory_access.cpp index 10fe7543..5aabaf6f 100644 --- a/test_extensions/media_sharing/test_memory_access.cpp +++ b/test_extensions/media_sharing/test_memory_access.cpp @@ -45,6 +45,13 @@ int memory_access(cl_device_id deviceID, cl_context context, cl_command_queue qu //iterates through all devices while (deviceWrapper->AdapterNext()) { + cl_int error; + //check if the test can be run on the adapter + if (CL_SUCCESS != (error = deviceExistForCLTest(gPlatformIDdetected, adapterType, deviceWrapper->Device(), result, sharedHandle))) + { + return result.Result(); + } + if (surfaceFormat != SURFACE_FORMAT_NV12 && !SurfaceFormatCheck(adapterType, *deviceWrapper, surfaceFormat)) { std::string sharedHandleStr = (sharedHandle == SHARED_HANDLE_ENABLED)? "yes": "no"; @@ -81,7 +88,6 @@ int memory_access(cl_device_id deviceID, cl_context context, cl_command_queue qu 0, }; - cl_int error; clContextWrapper ctx = clCreateContext(&contextProperties[0], 1, &gDeviceIDdetected, NULL, NULL, &error); if (error != CL_SUCCESS) { @@ -357,13 +363,20 @@ int memory_access(cl_device_id deviceID, cl_context context, cl_command_queue qu } } - if (!deviceWrapper->Status()) + if (deviceWrapper->Status() != DEVICE_PASS) { std::string adapterName; AdapterToString(adapterType, adapterName); + if (deviceWrapper->Status() == DEVICE_FAIL) + { log_error("%s init failed\n", adapterName.c_str()); result.ResultSub(CResult::TEST_FAIL); - return result.Result(); + } + else + { + log_error("%s init incomplete due to unsupported device\n", adapterName.c_str()); + result.ResultSub(CResult::TEST_NOTSUPPORTED); + } } return result.Result(); diff --git a/test_extensions/media_sharing/test_other_data_types.cpp b/test_extensions/media_sharing/test_other_data_types.cpp index 0e0bce35..8a73866e 100644 --- a/test_extensions/media_sharing/test_other_data_types.cpp +++ b/test_extensions/media_sharing/test_other_data_types.cpp @@ -16,8 +16,9 @@ #include #include -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/kernelHelpers.h" +#include "harness/errorHelpers.h" +#include "harness/imageHelpers.h" +#include "harness/kernelHelpers.h" #include "utils.h" @@ -65,13 +66,19 @@ int other_data_types(cl_device_id deviceID, cl_context context, cl_command_queue while (deviceWrapper->AdapterNext()) { + cl_int error; + //check if the test can be run on the adapter + if (CL_SUCCESS != (error = deviceExistForCLTest(gPlatformIDdetected, adapterType, deviceWrapper->Device(), result, sharedHandle))) + { + return result.Result(); + } + cl_context_properties contextProperties[] = { CL_CONTEXT_PLATFORM, (cl_context_properties)gPlatformIDdetected, AdapterTypeToContextInfo(adapterType), (cl_context_properties)deviceWrapper->Device(), 0, }; - cl_int error; clContextWrapper ctx = clCreateContext(&contextProperties[0], 1, &gDeviceIDdetected, NULL, NULL, &error); if (error != CL_SUCCESS) { @@ -419,13 +426,20 @@ int other_data_types(cl_device_id deviceID, cl_context context, cl_command_queue } } - if (!deviceWrapper->Status()) + if (deviceWrapper->Status() != DEVICE_PASS) { - std::string adapter; - AdapterToString(adapterType, adapter); - log_error("%s init failed\n", adapter.c_str()); + std::string adapterName; + AdapterToString(adapterType, adapterName); + if (deviceWrapper->Status() == DEVICE_FAIL) + { + log_error("%s init failed\n", adapterName.c_str()); result.ResultSub(CResult::TEST_FAIL); - return result.Result(); + } + else + { + log_error("%s init incomplete due to unsupported device\n", adapterName.c_str()); + result.ResultSub(CResult::TEST_NOTSUPPORTED); + } } return result.Result(); diff --git a/test_extensions/media_sharing/utils.cpp b/test_extensions/media_sharing/utils.cpp index b32e9556..31296432 100644 --- a/test_extensions/media_sharing/utils.cpp +++ b/test_extensions/media_sharing/utils.cpp @@ -15,11 +15,14 @@ // #include "utils.h" -#include "../../test_common/harness/errorHelpers.h" -#include "../../test_common/harness/rounding_mode.h" +#include "harness/errorHelpers.h" +#include "harness/imageHelpers.h" +#include "harness/rounding_mode.h" #include +#include + static RoundingMode gFloatToHalfRoundingMode = kDefaultRoundingMode; @@ -67,37 +70,6 @@ void CResult::ResultSub( TTestResult result ) _result = result; } -bool ExtensionCheck(const std::string &extension, cl_device_id deviceID) -{ - std::string extensions; - size_t size = 0; - cl_int error = clGetDeviceInfo(deviceID, CL_DEVICE_EXTENSIONS, 0, 0, &size); - if (error != CL_SUCCESS) - { - print_error(error, "clGetDeviceInfo failed\n"); - return false; - } - - if (size == 0) - { - print_error(error, "Invalid extension string size\n"); - return false; - } - - extensions.resize(size); - error = clGetDeviceInfo(deviceID, CL_DEVICE_EXTENSIONS, size, &extensions[0], 0); - if (error != CL_SUCCESS) - { - print_error(error, "clGetDeviceInfo failed\n"); - return false; - } - - if (extensions.find(extension) != std::string::npos) - return true; - - return false; -} - void FunctionContextCreateToString(TContextFuncType contextCreateFunction, std::string &contextFunction) { switch(contextCreateFunction) @@ -803,14 +775,18 @@ bool DataCompare( TSurfaceFormat surfaceFormat, cl_channel_type type, const std: { for(unsigned planeIdx = 0; planeIdx < channelNum; ++planeIdx) { - float test = convert_half_to_float(dataTest.at(offset + j * channelNum + planeIdx)); - float ref = convert_half_to_float(dataExp.at(offset + j * channelNum + planeIdx)); - if (abs(test - ref) > epsilon) - { - log_error("Tested image is different than reference (x,y,plane) = (%i,%i,%i), test value = %f, expected value = %f\n", - j, i, planeIdx, test, ref); - return false; - } + float test = cl_half_to_float( + dataTest.at(offset + j * channelNum + planeIdx)); + float ref = cl_half_to_float( + dataExp.at(offset + j * channelNum + planeIdx)); + if (abs(test - ref) > epsilon) + { + log_error( + "Tested image is different than reference (x,y,plane) = " + "(%i,%i,%i), test value = %f, expected value = %f\n", + j, i, planeIdx, test, ref); + return false; + } } } } @@ -1585,353 +1561,35 @@ bool MediaSurfaceCreate(cl_dx9_media_adapter_type_khr adapterType, unsigned int return true; } -int DetectFloatToHalfRoundingMode( cl_command_queue q ) // Returns CL_SUCCESS on success +cl_int deviceExistForCLTest(cl_platform_id platform, + cl_dx9_media_adapter_type_khr media_adapters_type, + void *media_adapters, + CResult &result, + TSharedHandleType sharedHandle /*default SHARED_HANDLE_ENABLED*/ + ) { - cl_int err = CL_SUCCESS; + cl_int _error; + cl_uint devicesAllNum = 0; + std::string sharedHandleStr = (sharedHandle == SHARED_HANDLE_ENABLED)? "yes": "no"; + std::string adapterStr; + AdapterToString(media_adapters_type, adapterStr); - if( gFloatToHalfRoundingMode == kDefaultRoundingMode ) - { - // Some numbers near 0.5f, that we look at to see how the values are rounded. - static const cl_uint inData[4*4] = { 0x3f000fffU, 0x3f001000U, 0x3f001001U, 0U, 0x3f001fffU, 0x3f002000U, 0x3f002001U, 0U, - 0x3f002fffU, 0x3f003000U, 0x3f003001U, 0U, 0x3f003fffU, 0x3f004000U, 0x3f004001U, 0U }; - static const size_t count = sizeof( inData ) / (4*sizeof( inData[0] )); - const float *inp = (const float*) inData; - cl_context context = NULL; + _error = clGetDeviceIDsFromDX9MediaAdapterKHR(platform, 1, + &media_adapters_type, &media_adapters, CL_PREFERRED_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR, 0, 0, &devicesAllNum); - // Create an input buffer - err = clGetCommandQueueInfo( q, CL_QUEUE_CONTEXT, sizeof(context), &context, NULL ); - if( err ) + if (_error != CL_SUCCESS) { - log_error( "Error: could not get context from command queue in DetectFloatToHalfRoundingMode (%d)", err ); - return err; + if(_error != CL_DEVICE_NOT_FOUND) + { + log_error("clGetDeviceIDsFromDX9MediaAdapterKHR failed: %s\n", IGetErrorString(_error)); + result.ResultSub(CResult::TEST_ERROR); + } + else + { + log_info("Skipping test case, device type is not supported by a device (adapter type: %s, shared handle: %s)\n", adapterStr.c_str(), sharedHandleStr.c_str()); + result.ResultSub(CResult::TEST_NOTSUPPORTED); + } } - cl_mem inBuf = clCreateBuffer( context, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR | CL_MEM_ALLOC_HOST_PTR, sizeof( inData ), (void*) inData, &err ); - if( NULL == inBuf || err ) - { - log_error( "Error: could not create input buffer in DetectFloatToHalfRoundingMode (err: %d)", err ); - return err; - } - - // Create a small output image - cl_image_format fmt = { CL_RGBA, CL_HALF_FLOAT }; - cl_image_desc imageDesc = { 0 }; - imageDesc.image_type = CL_MEM_OBJECT_IMAGE2D; - imageDesc.image_width = count; - imageDesc.image_height = 1; - - cl_mem outImage = clCreateImage(context, CL_MEM_READ_WRITE, &fmt, &imageDesc, 0, &err); - if( NULL == outImage || err ) - { - log_error( "Error: could not create half float out image in DetectFloatToHalfRoundingMode (err: %d)", err ); - clReleaseMemObject( inBuf ); - return err; - } - - // Create our program, and a kernel - const char *kernel[1] = { - "kernel void detect_round( global float4 *in, write_only image2d_t out )\n" - "{\n" - " write_imagef( out, (int2)(get_global_id(0),0), in[get_global_id(0)] );\n" - "}\n" }; - cl_program program = clCreateProgramWithSource( context, 1, kernel, NULL, &err ); - if( NULL == program || err ) - { - log_error( "Error: could not create program in DetectFloatToHalfRoundingMode (err: %d)", err ); - clReleaseMemObject( inBuf ); - clReleaseMemObject( outImage ); - return err; - } - - cl_device_id device = NULL; - err = clGetCommandQueueInfo( q, CL_QUEUE_DEVICE, sizeof(device), &device, NULL ); - if( err ) - { - log_error( "Error: could not get device from command queue in DetectFloatToHalfRoundingMode (%d)", err ); - clReleaseMemObject( inBuf ); - clReleaseMemObject( outImage ); - clReleaseProgram( program ); - return err; - } - - err = clBuildProgram( program, 1, &device, "", NULL, NULL ); - if( err ) - { - log_error( "Error: could not build program in DetectFloatToHalfRoundingMode (%d)", err ); - clReleaseMemObject( inBuf ); - clReleaseMemObject( outImage ); - clReleaseProgram( program ); - return err; - } - - cl_kernel k = clCreateKernel( program, "detect_round", &err ); - if( NULL == k || err ) - { - log_error( "Error: could not create kernel in DetectFloatToHalfRoundingMode (%d)", err ); - clReleaseMemObject( inBuf ); - clReleaseMemObject( outImage ); - clReleaseProgram( program ); - return err; - } - - err = clSetKernelArg( k, 0, sizeof( cl_mem ), &inBuf ); - if( err ) - { - log_error( "Error: could not set argument 0 of kernel in DetectFloatToHalfRoundingMode (%d)", err ); - clReleaseMemObject( inBuf ); - clReleaseMemObject( outImage ); - clReleaseProgram( program ); - clReleaseKernel( k ); - return err; - } - - err = clSetKernelArg( k, 1, sizeof( cl_mem ), &outImage ); - if( err ) - { - log_error( "Error: could not set argument 1 of kernel in DetectFloatToHalfRoundingMode (%d)", err ); - clReleaseMemObject( inBuf ); - clReleaseMemObject( outImage ); - clReleaseProgram( program ); - clReleaseKernel( k ); - return err; - } - - // Run the kernel - size_t global_work_size = count; - err = clEnqueueNDRangeKernel( q, k, 1, NULL, &global_work_size, NULL, 0, NULL, NULL ); - if( err ) - { - log_error( "Error: could not enqueue kernel in DetectFloatToHalfRoundingMode (%d)", err ); - clReleaseMemObject( inBuf ); - clReleaseMemObject( outImage ); - clReleaseProgram( program ); - clReleaseKernel( k ); - return err; - } - - // read the results - cl_ushort outBuf[count*4]; - memset( outBuf, -1, sizeof( outBuf ) ); - size_t origin[3] = {0,0,0}; - size_t region[3] = {count,1,1}; - err = clEnqueueReadImage( q, outImage, CL_TRUE, origin, region, 0, 0, outBuf, 0, NULL, NULL ); - if( err ) - { - log_error( "Error: could not read output image in DetectFloatToHalfRoundingMode (%d)", err ); - clReleaseMemObject( inBuf ); - clReleaseMemObject( outImage ); - clReleaseProgram( program ); - clReleaseKernel( k ); - return err; - } - - // Generate our list of reference results - cl_ushort rte_ref[count*4]; - cl_ushort rtz_ref[count*4]; - for( size_t i = 0; i < 4 * count; i++ ) - { - rte_ref[i] = float2half_rte( inp[i] ); - rtz_ref[i] = float2half_rtz( inp[i] ); - } - - // Verify that we got something in either rtz or rte mode - if( 0 == memcmp( rte_ref, outBuf, sizeof( rte_ref )) ) - { - log_info( "Autodetected float->half rounding mode to be rte\n" ); - gFloatToHalfRoundingMode = kRoundToNearestEven; - } - else if ( 0 == memcmp( rtz_ref, outBuf, sizeof( rtz_ref )) ) - { - log_info( "Autodetected float->half rounding mode to be rtz\n" ); - gFloatToHalfRoundingMode = kRoundTowardZero; - } - else - { - log_error( "ERROR: float to half conversions proceed with invalid rounding mode!\n" ); - log_info( "\nfor:" ); - for( size_t i = 0; i < count; i++ ) - log_info( " {%a, %a, %a, %a},", inp[4*i], inp[4*i+1], inp[4*i+2], inp[4*i+3] ); - log_info( "\ngot:" ); - for( size_t i = 0; i < count; i++ ) - log_info( " {0x%4.4x, 0x%4.4x, 0x%4.4x, 0x%4.4x},", outBuf[4*i], outBuf[4*i+1], outBuf[4*i+2], outBuf[4*i+3] ); - log_info( "\nrte:" ); - for( size_t i = 0; i < count; i++ ) - log_info( " {0x%4.4x, 0x%4.4x, 0x%4.4x, 0x%4.4x},", rte_ref[4*i], rte_ref[4*i+1], rte_ref[4*i+2], rte_ref[4*i+3] ); - log_info( "\nrtz:" ); - for( size_t i = 0; i < count; i++ ) - log_info( " {0x%4.4x, 0x%4.4x, 0x%4.4x, 0x%4.4x},", rtz_ref[4*i], rtz_ref[4*i+1], rtz_ref[4*i+2], rtz_ref[4*i+3] ); - log_info( "\n" ); - err = -1; - gFloatToHalfRoundingMode = kRoundingModeCount; // illegal value - } - - // clean up - clReleaseMemObject( inBuf ); - clReleaseMemObject( outImage ); - clReleaseProgram( program ); - clReleaseKernel( k ); - return err; - } - - // Make sure that the rounding mode was successfully detected, if we checked earlier - if( gFloatToHalfRoundingMode != kRoundToNearestEven && gFloatToHalfRoundingMode != kRoundTowardZero) - return -2; - - return err; -} - -cl_ushort convert_float_to_half( float f ) -{ - switch( gFloatToHalfRoundingMode ) - { - case kRoundToNearestEven: - return float2half_rte( f ); - case kRoundTowardZero: - return float2half_rtz( f ); - default: - log_error( "ERROR: Test internal error -- unhandled or unknown float->half rounding mode.\n" ); - exit(-1); - return 0xffff; - } - -} - -cl_ushort float2half_rte( float f ) -{ - union{ float f; cl_uint u; } u = {f}; - cl_uint sign = (u.u >> 16) & 0x8000; - float x = fabsf(f); - - //Nan - if( x != x ) - { - u.u >>= (24-11); - u.u &= 0x7fff; - u.u |= 0x0200; //silence the NaN - return u.u | sign; - } - - // overflow - if( x >= MAKE_HEX_FLOAT(0x1.ffep15f, 0x1ffeL, 3) ) - return 0x7c00 | sign; - - // underflow - if( x <= MAKE_HEX_FLOAT(0x1.0p-25f, 0x1L, -25) ) - return sign; // The halfway case can return 0x0001 or 0. 0 is even. - - // very small - if( x < MAKE_HEX_FLOAT(0x1.8p-24f, 0x18L, -28) ) - return sign | 1; - - // half denormal - if( x < MAKE_HEX_FLOAT(0x1.0p-14f, 0x1L, -14) ) - { - u.f = x * MAKE_HEX_FLOAT(0x1.0p-125f, 0x1L, -125); - return sign | u.u; - } - - u.f *= MAKE_HEX_FLOAT(0x1.0p13f, 0x1L, 13); - u.u &= 0x7f800000; - x += u.f; - u.f = x - u.f; - u.f *= MAKE_HEX_FLOAT(0x1.0p-112f, 0x1L, -112); - - return (u.u >> (24-11)) | sign; -} - -cl_ushort float2half_rtz( float f ) -{ - union{ float f; cl_uint u; } u = {f}; - cl_uint sign = (u.u >> 16) & 0x8000; - float x = fabsf(f); - - //Nan - if( x != x ) - { - u.u >>= (24-11); - u.u &= 0x7fff; - u.u |= 0x0200; //silence the NaN - return u.u | sign; - } - - // overflow - if( x >= MAKE_HEX_FLOAT(0x1.0p16f, 0x1L, 16) ) - { - if( x == INFINITY ) - return 0x7c00 | sign; - - return 0x7bff | sign; - } - - // underflow - if( x < MAKE_HEX_FLOAT(0x1.0p-24f, 0x1L, -24) ) - return sign; // The halfway case can return 0x0001 or 0. 0 is even. - - // half denormal - if( x < MAKE_HEX_FLOAT(0x1.0p-14f, 0x1L, -14) ) - { - x *= MAKE_HEX_FLOAT(0x1.0p24f, 0x1L, 24); - return (cl_ushort)((int) x | sign); - } - - u.u &= 0xFFFFE000U; - u.u -= 0x38000000U; - - return (u.u >> (24-11)) | sign; -} - -float convert_half_to_float( unsigned short halfValue ) -{ - // We have to take care of a few special cases, but in general, we just extract - // the same components from the half that exist in the float and re-stuff them - // For a description of the actual half format, see http://en.wikipedia.org/wiki/Half_precision - // Note: we store these in 32-bit ints to make the bit manipulations easier later - int sign = ( halfValue >> 15 ) & 0x0001; - int exponent = ( halfValue >> 10 ) & 0x001f; - int mantissa = ( halfValue ) & 0x03ff; - - // Note: we use a union here to be able to access the bits of a float directly - union - { - unsigned int bits; - float floatValue; - } outFloat; - - // Special cases first - if( exponent == 0 ) - { - if( mantissa == 0 ) - { - // If both exponent and mantissa are 0, the number is +/- 0 - outFloat.bits = sign << 31; - return outFloat.floatValue; // Already done! - } - - // If exponent is 0, it's a denormalized number, so we renormalize it - // Note: this is not terribly efficient, but oh well - while( ( mantissa & 0x00000400 ) == 0 ) - { - mantissa <<= 1; - exponent--; - } - - // The first bit is implicit, so we take it off and inc the exponent accordingly - exponent++; - mantissa &= ~(0x00000400); - } - else if( exponent == 31 ) // Special-case "numbers" - { - // If the exponent is 31, it's a special case number (+/- infinity or NAN). - // If the mantissa is 0, it's infinity, else it's NAN, but in either case, the packing - // method is the same - outFloat.bits = ( sign << 31 ) | 0x7f800000 | ( mantissa << 13 ); - return outFloat.floatValue; - } - - // Plain ol' normalized number, so adjust to the ranges a 32-bit float expects and repack - exponent += ( 127 - 15 ); - mantissa <<= 13; - - outFloat.bits = ( sign << 31 ) | ( exponent << 23 ) | mantissa; - return outFloat.floatValue; + return _error; } diff --git a/test_extensions/media_sharing/utils.h b/test_extensions/media_sharing/utils.h index 4731b268..f98090ca 100644 --- a/test_extensions/media_sharing/utils.h +++ b/test_extensions/media_sharing/utils.h @@ -16,15 +16,18 @@ #ifndef __UTILS_KHR_MEDIA_H #define __UTILS_KHR_MEDIA_H +#include +#include +#include +#include #include "wrappers.h" #include "CL/cl_dx9_media_sharing.h" -#include "../../test_common/harness/typeWrappers.h" +#include "harness/typeWrappers.h" + + + -#include -#include -#include -#include extern clGetDeviceIDsFromDX9MediaAdapterKHR_fn clGetDeviceIDsFromDX9MediaAdapterKHR; extern clCreateFromDX9MediaSurfaceKHR_fn clCreateFromDX9MediaSurfaceKHR; @@ -95,7 +98,6 @@ private: TTestResult _resultLast; }; -bool ExtensionCheck(const std::string &extension, cl_device_id deviceID); void FunctionContextCreateToString(TContextFuncType contextCreateFunction, std::string &contextFunction); void AdapterToString(cl_dx9_media_adapter_type_khr adapterType, std::string &adapter); cl_context_info AdapterTypeToContextInfo(cl_dx9_media_adapter_type_khr adapterType); @@ -161,11 +163,5 @@ void SurfaceFormatToString(TSurfaceFormat surfaceFormat, std::string &str ); bool MediaSurfaceCreate(cl_dx9_media_adapter_type_khr adapterType, unsigned int width, unsigned int height, TSurfaceFormat surfaceFormat, CDeviceWrapper &device, std::auto_ptr &surface, bool sharedHandle, void **objectSharedHandle); -//imported from image helpers -cl_ushort float2half_rte( float f ); -cl_ushort float2half_rtz( float f ); -cl_ushort convert_float_to_half( float f ); -float convert_half_to_float( unsigned short halfValue ); -int DetectFloatToHalfRoundingMode( cl_command_queue ); - +cl_int deviceExistForCLTest(cl_platform_id platform,cl_dx9_media_adapter_type_khr media_adapters_type,void *media_adapters,CResult &result,TSharedHandleType sharedHandle=SHARED_HANDLE_DISABLED); #endif // __UTILS_KHR_MEDIA_H diff --git a/test_extensions/media_sharing/wrappers.cpp b/test_extensions/media_sharing/wrappers.cpp index 27907ca3..e7eb5b2b 100644 --- a/test_extensions/media_sharing/wrappers.cpp +++ b/test_extensions/media_sharing/wrappers.cpp @@ -14,7 +14,7 @@ // limitations under the License. // #include "wrappers.h" -#include "../../test_common/harness/errorHelpers.h" +#include "harness/errorHelpers.h" LPCTSTR CDeviceWrapper::WINDOW_TITLE = _T( "cl_khr_dx9_media_sharing" ); const int CDeviceWrapper::WINDOW_WIDTH = 256; @@ -141,7 +141,7 @@ CDeviceWrapper::~CDeviceWrapper() #if defined(_WIN32) CD3D9Wrapper::CD3D9Wrapper(): -_d3d9(NULL), _d3dDevice(NULL), _status(true), _adapterIdx(0), _adapterFound(false) +_d3d9(NULL), _d3dDevice(NULL), _status(DEVICE_PASS), _adapterIdx(0), _adapterFound(false) { WindowInit(); @@ -149,7 +149,7 @@ _d3d9(NULL), _d3dDevice(NULL), _status(true), _adapterIdx(0), _adapterFound(fals if (!_d3d9) { log_error("Direct3DCreate9 failed\n"); - _status = false; + _status = DEVICE_FAIL; } } @@ -169,16 +169,16 @@ void CD3D9Wrapper::Destroy() _d3dDevice = 0; } -bool CD3D9Wrapper::Init() +cl_int CD3D9Wrapper::Init() { if (!WindowHandle()) { log_error("D3D9: Window is not created\n"); - _status = false; - return false; + _status = DEVICE_FAIL; + return DEVICE_FAIL; } - if(!_d3d9 || !_status || !_adapterFound) + if(!_d3d9 || DEVICE_PASS != _status || !_adapterFound) return false; _d3d9->GetAdapterDisplayMode(_adapterIdx - 1, &_d3ddm); @@ -201,8 +201,8 @@ bool CD3D9Wrapper::Init() processingType, &d3dParams, &_d3dDevice) ) ) { log_error("CreateDevice failed\n"); - _status = false; - return false; + _status = DEVICE_FAIL; + return DEVICE_FAIL; } _d3dDevice->BeginScene(); @@ -232,14 +232,14 @@ D3DADAPTER_IDENTIFIER9 CD3D9Wrapper::Adapter() return _adapter; } -bool CD3D9Wrapper::Status() const +TDeviceStatus CD3D9Wrapper::Status() const { return _status; } bool CD3D9Wrapper::AdapterNext() { - if (!_status) + if (DEVICE_PASS != _status) return false; _adapterFound = false; @@ -253,7 +253,7 @@ bool CD3D9Wrapper::AdapterNext() if(FAILED(_d3d9->GetAdapterIdentifier(_adapterIdx - 1, 0, &_adapter))) { log_error("D3D9: GetAdapterIdentifier failed\n"); - _status = false; + _status = DEVICE_FAIL; return false; } @@ -262,7 +262,7 @@ bool CD3D9Wrapper::AdapterNext() Destroy(); if(!Init()) { - _status = false; + _status = DEVICE_FAIL; _adapterFound = false; } break; @@ -278,7 +278,7 @@ unsigned int CD3D9Wrapper::AdapterIdx() const CD3D9ExWrapper::CD3D9ExWrapper(): -_d3d9Ex(NULL), _d3dDeviceEx(NULL), _status(true), _adapterIdx(0), _adapterFound(false) +_d3d9Ex(NULL), _d3dDeviceEx(NULL), _status(DEVICE_PASS), _adapterIdx(0), _adapterFound(false) { WindowInit(); @@ -286,7 +286,7 @@ _d3d9Ex(NULL), _d3dDeviceEx(NULL), _status(true), _adapterIdx(0), _adapterFound( if (FAILED(result) || !_d3d9Ex) { log_error("Direct3DCreate9Ex failed\n"); - _status = false; + _status = DEVICE_FAIL; } } @@ -319,17 +319,17 @@ D3DADAPTER_IDENTIFIER9 CD3D9ExWrapper::Adapter() return _adapter; } -bool CD3D9ExWrapper::Init() +cl_int CD3D9ExWrapper::Init() { if (!WindowHandle()) { log_error("D3D9EX: Window is not created\n"); - _status = false; - return false; + _status = DEVICE_FAIL; + return DEVICE_FAIL; } - if(!_d3d9Ex || !_status || !_adapterFound) - return false; + if(!_d3d9Ex || DEVICE_FAIL == _status || !_adapterFound) + return DEVICE_FAIL; RECT rect; GetClientRect(WindowHandle(),&rect); @@ -353,15 +353,15 @@ bool CD3D9ExWrapper::Init() processingType, &d3dParams, NULL, &_d3dDeviceEx) ) ) { log_error("CreateDeviceEx failed\n"); - _status = false; - return false; + _status = DEVICE_FAIL; + return DEVICE_FAIL; } _d3dDeviceEx->BeginScene(); _d3dDeviceEx->Clear(0, NULL, D3DCLEAR_TARGET, 0, 1.0f, 0); _d3dDeviceEx->EndScene(); - return true; + return DEVICE_PASS; } void CD3D9ExWrapper::Destroy() @@ -371,14 +371,14 @@ void CD3D9ExWrapper::Destroy() _d3dDeviceEx = 0; } -bool CD3D9ExWrapper::Status() const +TDeviceStatus CD3D9ExWrapper::Status() const { return _status; } bool CD3D9ExWrapper::AdapterNext() { - if (!_status) + if (DEVICE_FAIL == _status) return false; _adapterFound = false; @@ -392,7 +392,7 @@ bool CD3D9ExWrapper::AdapterNext() if(FAILED(_d3d9Ex->GetAdapterIdentifier(_adapterIdx - 1, 0, &_adapter))) { log_error("D3D9EX: GetAdapterIdentifier failed\n"); - _status = false; + _status = DEVICE_FAIL; return false; } @@ -400,8 +400,8 @@ bool CD3D9ExWrapper::AdapterNext() Destroy(); if(!Init()) { - _status = false; - _adapterFound = false; + _status = DEVICE_FAIL; + _adapterFound = _status; } break; @@ -416,7 +416,7 @@ unsigned int CD3D9ExWrapper::AdapterIdx() const } CDXVAWrapper::CDXVAWrapper(): -_dxvaDevice(NULL), _status(true), _adapterFound(false) +_dxvaDevice(NULL), _status(DEVICE_PASS), _adapterFound(false) { _status = _d3d9.Status(); } @@ -431,19 +431,24 @@ void * CDXVAWrapper::Device() const return _dxvaDevice; } -bool CDXVAWrapper::Status() const +TDeviceStatus CDXVAWrapper::Status() const { - return _status && _d3d9.Status(); + if(_status == DEVICE_FAIL || _d3d9.Status() == DEVICE_FAIL) + return DEVICE_FAIL; + else if(_status == DEVICE_NOTSUPPORTED || _d3d9.Status() == DEVICE_NOTSUPPORTED) + return DEVICE_NOTSUPPORTED; + else + return DEVICE_PASS; } bool CDXVAWrapper::AdapterNext() { - if (!_status) + if (DEVICE_PASS != _status) return false; _adapterFound = _d3d9.AdapterNext(); _status = _d3d9.Status(); - if (!_status) + if (DEVICE_PASS != _status) { _adapterFound = false; return false; @@ -454,7 +459,7 @@ bool CDXVAWrapper::AdapterNext() DXVAHDDestroy(); _status = DXVAHDInit(); - if (!_status) + if (DEVICE_PASS != _status) { _adapterFound = false; return false; @@ -463,10 +468,10 @@ bool CDXVAWrapper::AdapterNext() return true; } -bool CDXVAWrapper::DXVAHDInit() +TDeviceStatus CDXVAWrapper::DXVAHDInit() { - if (!_status || !_d3d9.Status() || !_adapterFound) - return false; + if ((_status == DEVICE_FAIL) || (_d3d9.Status() == DEVICE_FAIL) || !_adapterFound) + return DEVICE_FAIL; DXVAHD_RATIONAL fps = { VIDEO_FPS, 1 }; @@ -480,20 +485,27 @@ bool CDXVAWrapper::DXVAHDInit() desc.OutputHeight = WindowHeight(); #ifdef USE_SOFTWARE_PLUGIN - _status = false; - return false; + _status = DEVICE_FAIL; + return DEVICE_FAIL; #endif HRESULT hr = DXVAHD_CreateDevice(static_cast(_d3d9.Device()), &desc, DXVAHD_DEVICE_USAGE_PLAYBACK_NORMAL, NULL, &_dxvaDevice); if(FAILED(hr)) { + if (hr == E_NOINTERFACE) + { + log_error("DXVAHD_CreateDevice skipped due to no supported devices!\n"); + _status = DEVICE_NOTSUPPORTED; + } + else + { log_error("DXVAHD_CreateDevice failed\n"); - _status = false; - return false; + _status = DEVICE_FAIL; + } } - return true; + return _status; } void CDXVAWrapper::DXVAHDDestroy() diff --git a/test_extensions/media_sharing/wrappers.h b/test_extensions/media_sharing/wrappers.h index bafc8a0a..45b70326 100644 --- a/test_extensions/media_sharing/wrappers.h +++ b/test_extensions/media_sharing/wrappers.h @@ -18,10 +18,37 @@ #if defined(_WIN32) #include +#if defined (__MINGW32__) +#include +typedef unsigned char UINT8; +#define __out +#define __in +#define __inout +#define __out_bcount(size) +#define __out_bcount_opt(size) +#define __in_opt +#define __in_ecount(size) +#define __in_ecount_opt(size) +#define __out_opt +#define __out_ecount(size) +#define __out_ecount_opt(size) +#define __in_bcount_opt(size) +#define __inout_opt +#define __inout_bcount(size) +#define __in_bcount(size) +#define __deref_out +#endif #include #include #endif +enum TDeviceStatus +{ + DEVICE_NOTSUPPORTED, + DEVICE_PASS, + DEVICE_FAIL, +}; + class CDeviceWrapper { public: enum TAccelerationType @@ -36,7 +63,7 @@ public: virtual bool AdapterNext() = 0; virtual unsigned int AdapterIdx() const = 0; virtual void *Device() const = 0; - virtual bool Status() const = 0; + virtual TDeviceStatus Status() const = 0; virtual void *D3D() const = 0; #if defined(_WIN32) @@ -81,7 +108,7 @@ public: virtual bool AdapterNext(); virtual unsigned int AdapterIdx() const; virtual void *Device() const; - virtual bool Status() const; + virtual TDeviceStatus Status() const; virtual void *D3D() const; private: @@ -89,13 +116,13 @@ private: LPDIRECT3DDEVICE9 _d3dDevice; D3DDISPLAYMODE _d3ddm; D3DADAPTER_IDENTIFIER9 _adapter; - bool _status; + TDeviceStatus _status; unsigned int _adapterIdx; bool _adapterFound; D3DFORMAT Format(); D3DADAPTER_IDENTIFIER9 Adapter(); - bool Init(); + int Init(); void Destroy(); }; @@ -107,7 +134,7 @@ public: virtual bool AdapterNext(); virtual unsigned int AdapterIdx() const; virtual void *Device() const; - virtual bool Status() const; + virtual TDeviceStatus Status() const; virtual void *D3D() const; private: @@ -115,13 +142,13 @@ private: LPDIRECT3DDEVICE9EX _d3dDeviceEx; D3DDISPLAYMODEEX _d3ddmEx; D3DADAPTER_IDENTIFIER9 _adapter; - bool _status; + TDeviceStatus _status; unsigned int _adapterIdx; bool _adapterFound; D3DFORMAT Format(); D3DADAPTER_IDENTIFIER9 Adapter(); - bool Init(); + int Init(); void Destroy(); }; @@ -133,21 +160,21 @@ public: virtual bool AdapterNext(); virtual unsigned int AdapterIdx() const; virtual void *Device() const; - virtual bool Status() const; + virtual TDeviceStatus Status() const; virtual void *D3D() const; const CD3D9ExWrapper &D3D9() const; private: CD3D9ExWrapper _d3d9; IDXVAHD_Device *_dxvaDevice; - bool _status; + TDeviceStatus _status; bool _adapterFound; static const D3DFORMAT RENDER_TARGET_FORMAT; static const D3DFORMAT VIDEO_FORMAT; static const unsigned int VIDEO_FPS; - bool DXVAHDInit(); + TDeviceStatus DXVAHDInit(); void DXVAHDDestroy(); }; diff --git a/travis.sh b/travis.sh new file mode 100755 index 00000000..6b2b2dea --- /dev/null +++ b/travis.sh @@ -0,0 +1,81 @@ +#!/usr/bin/env bash + +set -e + +export TOP=$(pwd) + +if [ "${JOB_CHECK_FORMAT}" -eq 1 ]; then + ./check-format.sh + exit $? +fi + +TOOLCHAIN_URL_arm="https://releases.linaro.org/components/toolchain/binaries/7.5-2019.12/arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf.tar.xz" +TOOLCHAIN_URL_aarch64="https://releases.linaro.org/components/toolchain/binaries/7.5-2019.12/aarch64-linux-gnu/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz" + +TOOLCHAIN_PREFIX_arm=arm-linux-gnueabihf +TOOLCHAIN_PREFIX_aarch64=aarch64-linux-gnu + +TOOLCHAIN_FILE=${TOP}/toolchain.cmake +touch ${TOOLCHAIN_FILE} +BUILD_OPENGL_TEST="OFF" + +# Prepare toolchain if needed +if [[ ${JOB_ARCHITECTURE} != "" ]]; then + TOOLCHAIN_URL_VAR=TOOLCHAIN_URL_${JOB_ARCHITECTURE} + TOOLCHAIN_URL=${!TOOLCHAIN_URL_VAR} + wget ${TOOLCHAIN_URL} + TOOLCHAIN_ARCHIVE=${TOOLCHAIN_URL##*/} + tar xf ${TOOLCHAIN_ARCHIVE} + TOOLCHAIN_DIR=${TOP}/${TOOLCHAIN_ARCHIVE%.tar.xz} + export PATH=${TOOLCHAIN_DIR}/bin:${PATH} + + TOOLCHAIN_PREFIX_VAR=TOOLCHAIN_PREFIX_${JOB_ARCHITECTURE} + TOOLCHAIN_PREFIX=${!TOOLCHAIN_PREFIX_VAR} + + echo "SET(CMAKE_SYSTEM_NAME Linux)" >> ${TOOLCHAIN_FILE} + echo "SET(CMAKE_SYSTEM_PROCESSOR ${JOB_ARCHITECTURE})" >> ${TOOLCHAIN_FILE} + echo "SET(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)" >> ${TOOLCHAIN_FILE} + echo "SET(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)" >> ${TOOLCHAIN_FILE} + echo "SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)" >> ${TOOLCHAIN_FILE} + echo "SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)" >> ${TOOLCHAIN_FILE} + echo "SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)" >> ${TOOLCHAIN_FILE} +fi + +if [[ ( ${JOB_ARCHITECTURE} == "" && ${TRAVIS_OS_NAME} == "linux" ) ]]; then + BUILD_OPENGL_TEST="ON" + sudo apt-get update + sudo apt-get -y install libglu1-mesa-dev freeglut3-dev mesa-common-dev libglew-dev +fi +# Prepare headers +git clone https://github.com/KhronosGroup/OpenCL-Headers.git +cd OpenCL-Headers +ln -s CL OpenCL # For OSX builds +cd .. + +# Get and build loader +git clone https://github.com/KhronosGroup/OpenCL-ICD-Loader.git +cd ${TOP}/OpenCL-ICD-Loader +mkdir build +cd build +cmake -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} -DENABLE_OPENCL30_PROVISIONAL=1 -DOPENCL_ICD_LOADER_HEADERS_DIR=${TOP}/OpenCL-Headers/ .. +make + +# Get libclcxx +cd ${TOP} +git clone https://github.com/KhronosGroup/libclcxx.git + +# Build CTS +ls -l +mkdir build +cd build +cmake -DCL_INCLUDE_DIR=${TOP}/OpenCL-Headers \ + -DCL_LIB_DIR=${TOP}/OpenCL-ICD-Loader/build \ + -DCL_LIBCLCXX_DIR=${TOP}/libclcxx \ + -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} \ + -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=./bin \ + -DOPENCL_LIBRARIES="-lOpenCL -lpthread" \ + -DUSE_CL_EXPERIMENTAL=ON \ + -DGL_IS_SUPPORTED=${BUILD_OPENGL_TEST} \ + .. +make -j2 +