mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-30 11:21:01 +00:00
Optimise/improve hookset.pl, return dummy function pointers
* Now instead of returning NULL for entry points that we don't support and hoping the application will handle that or error out, instead we return a function that will log an error if it is ever called, and then pass through to the real function. In most cases, the capture will probably be broken as whichever function isn't saved. * hookset.pl is much faster too, it outputs the whole gl_hookset_defs.h file and doesn't do multiple searches over the whole set of headers in official/ for each function.
This commit is contained in:
@@ -633,7 +633,9 @@ struct GLHookSet
|
||||
PFNGLGETNAMEDPROGRAMIVEXTPROC glGetNamedProgramivEXT;
|
||||
PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glGetNamedFramebufferAttachmentParameterivEXT; // aliases glGetNamedFramebufferAttachmentParameteriv
|
||||
PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC glGetNamedBufferParameterivEXT; // aliases glGetNamedBufferParameteriv
|
||||
PFNGLGETNAMEDBUFFERSUBDATAEXTPROC glGetNamedBufferSubDataEXT; // aliases glGetNamedBufferSubData
|
||||
// these functions are not aliases only by the size parameter being different types
|
||||
PFNGLGETNAMEDBUFFERSUBDATAEXTPROC glGetNamedBufferSubDataEXT;
|
||||
PFNGLGETNAMEDBUFFERSUBDATAPROC glGetNamedBufferSubData;
|
||||
PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC glGetNamedFramebufferParameterivEXT; // aliases glGetFramebufferParameterivEXT, glGetNamedFramebufferParameteriv
|
||||
PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC glGetNamedRenderbufferParameterivEXT; // aliases glGetNamedRenderbufferParameteriv
|
||||
PFNGLGETVERTEXARRAYINTEGERVEXTPROC glGetVertexArrayIntegervEXT;
|
||||
@@ -733,5 +735,3 @@ struct GLHookSet
|
||||
PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC glVertexArrayVertexAttribDivisorEXT;
|
||||
// --
|
||||
};
|
||||
|
||||
#include "gl_hookset_defs.h"
|
||||
|
||||
+4643
-1258
File diff suppressed because it is too large
Load Diff
+165
-31
@@ -1,20 +1,44 @@
|
||||
#!/bin/perl
|
||||
|
||||
use strict;
|
||||
use POSIX;
|
||||
|
||||
binmode(STDOUT, ":crlf") if $^O eq 'msys';
|
||||
|
||||
sub trim {
|
||||
(my $s = $_[0]) =~ s/^\s+|\s+$//g;
|
||||
return $s;
|
||||
}
|
||||
|
||||
sub uniq {
|
||||
my %seen;
|
||||
grep !$seen{$_}++, @_;
|
||||
}
|
||||
|
||||
sub uses_typedef
|
||||
{
|
||||
return 1 if $_[0]{'typedef'} eq $_[1];
|
||||
return 1 if ("PFN" . uc($_[0]{'name'}) . "PROC") eq $_[1];
|
||||
|
||||
foreach my $a (@{$_[0]{'aliases'}})
|
||||
{
|
||||
return 1 if ("PFN" . uc($a) . "PROC") eq $_[1];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
my $printdefs = $ARGV[$1] eq "defs";
|
||||
|
||||
open(HOOKSET, "<gl_hookset.h") || die "Couldn't open gl_hookset.h - run in driver/gl/";
|
||||
|
||||
my @unsupported = ();
|
||||
my @dllexport = ();
|
||||
my @glext = ();
|
||||
|
||||
my $mode = "";
|
||||
my $current = \@unsupported;
|
||||
|
||||
my @used = ();
|
||||
|
||||
while(<HOOKSET>)
|
||||
{
|
||||
@@ -22,12 +46,12 @@ while(<HOOKSET>)
|
||||
|
||||
if($line =~ /\/\/ --/)
|
||||
{
|
||||
$mode = "";
|
||||
$current = \@unsupported;
|
||||
}
|
||||
elsif($line =~ /\/\/ \+\+ ([a-z]*)/)
|
||||
{
|
||||
$mode = "dllexport" if $1 eq "dllexport";
|
||||
$mode = "glext" if $1 eq "glext";
|
||||
$current = \@dllexport if $1 eq "dllexport";
|
||||
$current = \@glext if $1 eq "glext";
|
||||
}
|
||||
elsif($line =~ /^\s*\/\/ .*/)
|
||||
{
|
||||
@@ -37,7 +61,7 @@ while(<HOOKSET>)
|
||||
{
|
||||
# skip blank lines
|
||||
}
|
||||
elsif($mode ne "")
|
||||
elsif($current != \@unsupported)
|
||||
{
|
||||
if($line =~ /(PFN.*PROC) (.*);( \/\/ aliases )?([a-zA-Z0-9_ ,]*)?/)
|
||||
{
|
||||
@@ -45,37 +69,94 @@ while(<HOOKSET>)
|
||||
my $name = $2;
|
||||
my $aliases = $4;
|
||||
|
||||
my $def = trim(`grep -h $typedef official/*`);
|
||||
my @alias_split = split(/, */, $aliases);
|
||||
|
||||
if($def =~ /^typedef (.*)\([A-Z *]* $typedef\) \((.*)\);/)
|
||||
my %hook = (name => $name, typedef => $typedef, aliases => \@alias_split, processed => 0);
|
||||
|
||||
push @{$current}, { %hook };
|
||||
|
||||
push @used, $typedef;
|
||||
push @used, "PFN" . uc($name) . "PROC";
|
||||
foreach my $a (@alias_split)
|
||||
{
|
||||
my $returnType = trim($1);
|
||||
my $args = $2;
|
||||
$args = "" if $args eq "void";
|
||||
my $origargs = $args;
|
||||
$args =~ s/ *([a-zA-Z_][a-zA-Z_0-9]*)(,|\Z)/, $1$2/g;
|
||||
push @used, "PFN" . uc($a) . "PROC";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print "MALFORMED LINE IN gl_hookset.h: '$line'\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
my $argcount = () = $args =~ /,/g;
|
||||
@used = uniq(@used);
|
||||
|
||||
$argcount = floor(($argcount + 1)/2);
|
||||
my @dllexportfuncs = ();
|
||||
my @glextfuncs = ();
|
||||
my @processed = ();
|
||||
|
||||
my $funcdefmacro = "HookWrapper$argcount($returnType, $name";
|
||||
$funcdefmacro .= ", $args" if $args ne "";
|
||||
$funcdefmacro .= ");";
|
||||
my $typedefs = `egrep -h PFN[0-9A-Z_-]+PROC official/glcorearb.h official/glext.h`;
|
||||
foreach my $typedef (split(/\n/, $typedefs))
|
||||
{
|
||||
if($typedef =~ /^typedef (.*)\([A-Z *]* (.*)\) \((.*)\);/)
|
||||
{
|
||||
my $returnType = trim($1);
|
||||
my $def = $2;
|
||||
my $args = $3;
|
||||
$args = "" if $args eq "void";
|
||||
|
||||
my %func = ('name', $name, 'typedef', $typedef, 'macro', $funcdefmacro, 'ret', $returnType, 'args', $origargs, 'aliases', $aliases);
|
||||
# glPathGlyphIndexRangeNV has an array parameter - GLuint baseAndCount[2]
|
||||
# just transform these to pointer parameters, it's equivalent.
|
||||
$args =~ s/([A-Za-z_][a-zA-Z_0-9]*) ([A-Za-z_][a-zA-Z_0-9]*)\[[0-9]*\]/$1 *$2/g;
|
||||
|
||||
push @dllexport, { %func } if $mode eq "dllexport";
|
||||
push @glext, { %func } if $mode eq "glext";
|
||||
my $origargs = $args;
|
||||
$args =~ s/ *([a-zA-Z_][a-zA-Z_0-9]*)(,|\Z)/, $1$2/g;
|
||||
|
||||
my $argcount = () = $args =~ /,/g;
|
||||
|
||||
$argcount = floor(($argcount + 1)/2);
|
||||
|
||||
my $isused = grep {$_ eq $def} @used;
|
||||
|
||||
$current = \@unsupported;
|
||||
my $name = $def;
|
||||
$name =~ s/^PFN(.*)PROC$/$1/g;
|
||||
$name = lc($name); # todo, fetch the proper name instead of using lowercase (and insensitive compare)
|
||||
my $aliases = "";
|
||||
|
||||
if($isused)
|
||||
{
|
||||
my @res = grep {uses_typedef($_, $def)} @dllexport;
|
||||
|
||||
if(scalar @res)
|
||||
{
|
||||
$name = $res[0]{'name'};
|
||||
$aliases = $res[0]{'aliases'};
|
||||
|
||||
$current = \@dllexportfuncs;
|
||||
}
|
||||
else
|
||||
{
|
||||
print "MALFORMED $mode DEFINITION OR NO DEFINITION FOUND FOR $typedef: '$def'\n";
|
||||
@res = grep {uses_typedef($_, $def)} @glext;
|
||||
print "SCRIPT ERROR: '$def' reported as used but can't find matching definition\n" if not scalar @res;
|
||||
|
||||
$name = $res[0]{'name'};
|
||||
$aliases = $res[0]{'aliases'};
|
||||
|
||||
$current = \@glextfuncs;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
my $funcdefmacro = "HookWrapper$argcount($returnType, $name";
|
||||
$funcdefmacro .= ", $args" if $args ne "";
|
||||
$funcdefmacro .= ");";
|
||||
|
||||
if(not grep {$_ eq $name} @processed)
|
||||
{
|
||||
print "MALFORMED $mode LINE IN gl_hookset.h: '$line'\n";
|
||||
my %func = ('name', $name, 'typedef', $def, 'macro', $funcdefmacro, 'ret', $returnType, 'args', $origargs, 'aliases', $aliases);
|
||||
|
||||
push @{$current}, { %func };
|
||||
push @processed, $name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,12 +165,12 @@ close(HOOKSET);
|
||||
|
||||
if($printdefs)
|
||||
{
|
||||
foreach my $el (@dllexport)
|
||||
foreach my $el (@dllexportfuncs)
|
||||
{
|
||||
print " IMPLEMENT_FUNCTION_SERIALISED($el->{ret}, $el->{name}($el->{args}));\n";
|
||||
}
|
||||
print "\n";
|
||||
foreach my $el (@glext)
|
||||
foreach my $el (@glextfuncs)
|
||||
{
|
||||
print " IMPLEMENT_FUNCTION_SERIALISED($el->{ret}, $el->{name}($el->{args}));\n";
|
||||
}
|
||||
@@ -97,11 +178,46 @@ if($printdefs)
|
||||
exit;
|
||||
}
|
||||
|
||||
print <<ENDOFHEADER;
|
||||
/******************************************************************************
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2014 Crytek
|
||||
*
|
||||
* 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 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
// This file is autogenerated with hookset.pl - any changes will be overwritten
|
||||
// next time that script is run.
|
||||
// \$ pwd
|
||||
// .../renderdoc/driver/gl
|
||||
// \$ ./hookset.pl > gl_hookset_defs.h
|
||||
ENDOFHEADER
|
||||
|
||||
print "////////////////////////////////////////////////////\n";
|
||||
print "\n";
|
||||
print "// dllexport functions\n";
|
||||
print "#define DLLExportHooks() \\\n";
|
||||
foreach my $el (@dllexport)
|
||||
foreach my $el (@dllexportfuncs)
|
||||
{
|
||||
print " HookInit($el->{name}); \\\n"
|
||||
}
|
||||
@@ -110,15 +226,15 @@ print "\n";
|
||||
print "\n";
|
||||
print "// gl extensions\n";
|
||||
print "#define HookCheckGLExtensions() \\\n";
|
||||
foreach my $el (@glext)
|
||||
foreach my $el (@glextfuncs)
|
||||
{
|
||||
print " HookExtension($el->{typedef}, $el->{name}); \\\n";
|
||||
foreach(split(/, */, $el->{aliases}))
|
||||
foreach(@{$el->{aliases}})
|
||||
{
|
||||
print " HookExtensionAlias($el->{typedef}, $el->{name}, $_); \\\n";
|
||||
}
|
||||
}
|
||||
foreach my $el (@dllexport)
|
||||
foreach my $el (@dllexportfuncs)
|
||||
{
|
||||
print " HookExtension($el->{typedef}, $el->{name}); \\\n"
|
||||
}
|
||||
@@ -127,7 +243,7 @@ print "\n";
|
||||
print "\n";
|
||||
print "// dllexport functions\n";
|
||||
print "#define DefineDLLExportHooks() \\\n";
|
||||
foreach my $el (@dllexport)
|
||||
foreach my $el (@dllexportfuncs)
|
||||
{
|
||||
print " $el->{macro} \\\n"
|
||||
}
|
||||
@@ -136,11 +252,29 @@ print "\n";
|
||||
print "\n";
|
||||
print "// gl extensions\n";
|
||||
print "#define DefineGLExtensionHooks() \\\n";
|
||||
foreach my $el (@glext)
|
||||
foreach my $el (@glextfuncs)
|
||||
{
|
||||
print " $el->{macro} \\\n"
|
||||
}
|
||||
print "\n";
|
||||
print "\n";
|
||||
print "\n";
|
||||
print "// unsupported entry points - used for dummy functions\n";
|
||||
print "#define DefineUnsupportedDummies() \\\n";
|
||||
foreach my $el (@unsupported)
|
||||
{
|
||||
print " $el->{macro} \\\n"
|
||||
}
|
||||
print "\n";
|
||||
print "\n";
|
||||
print "\n";
|
||||
print "#define CheckUnsupported() \\\n";
|
||||
foreach my $el (@unsupported)
|
||||
{
|
||||
print " HandleUnsupported($el->{typedef}, $el->{name}); \\\n"
|
||||
}
|
||||
print "\n";
|
||||
print "\n";
|
||||
print "\n";
|
||||
print "\n";
|
||||
|
||||
|
||||
@@ -781,6 +781,11 @@ void WrappedOpenGL::glGetNamedBufferSubDataEXT(GLuint buffer, GLintptr offset, G
|
||||
m_Real.glGetNamedBufferSubDataEXT(buffer, offset, size, data);
|
||||
}
|
||||
|
||||
void WrappedOpenGL::glGetNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizei size, void *data)
|
||||
{
|
||||
m_Real.glGetNamedBufferSubData(buffer, offset, size, data);
|
||||
}
|
||||
|
||||
void WrappedOpenGL::glGetTextureParameterivEXT(GLuint texture, GLenum target, GLenum pname, GLint *params)
|
||||
{
|
||||
m_Real.glGetTextureParameterivEXT(texture, target, pname, params);
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
#include "driver/gl/gl_hookset.h"
|
||||
#include "driver/gl/gl_driver.h"
|
||||
|
||||
#include "driver/gl/gl_hookset_defs.h"
|
||||
|
||||
#include "common/threading.h"
|
||||
#include "common/string_utils.h"
|
||||
|
||||
@@ -69,6 +71,23 @@ void *libGLdlsymHandle = RTLD_NEXT; // default to RTLD_NEXT, but overwritten if
|
||||
return (__GLXextFuncPtr)&CONCAT(function, _renderdoc_hooked); \
|
||||
}
|
||||
|
||||
#if 0 // debug print for each unsupported function requested (but not used)
|
||||
#define HandleUnsupported(funcPtrType, function) \
|
||||
if(lowername == STRINGIZE(function)) \
|
||||
{ \
|
||||
CONCAT(unsupported_real_,function) = (CONCAT(function, _hooktype))realFunc; \
|
||||
RDCDEBUG("Requesting function pointer for unsupported function " STRINGIZE(function)); \
|
||||
return (__GLXextFuncPtr)&CONCAT(function, _renderdoc_hooked); \
|
||||
}
|
||||
#else
|
||||
#define HandleUnsupported(funcPtrType, function) \
|
||||
if(lowername == STRINGIZE(function)) \
|
||||
{ \
|
||||
CONCAT(unsupported_real_,function) = (CONCAT(function, _hooktype))realFunc; \
|
||||
return (__GLXextFuncPtr)&CONCAT(function, _renderdoc_hooked); \
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
in bash:
|
||||
|
||||
@@ -102,7 +121,7 @@ void *libGLdlsymHandle = RTLD_NEXT; // default to RTLD_NEXT, but overwritten if
|
||||
echo -n "); }";
|
||||
}
|
||||
|
||||
for I in `seq 0 ...`; do HookWrapper $I; echo; done
|
||||
for I in `seq 0 15`; do HookWrapper $I; echo; done
|
||||
|
||||
*/
|
||||
|
||||
@@ -245,16 +264,6 @@ class OpenGLHook : LibraryHook
|
||||
|
||||
RDCEraseEl(GL);
|
||||
|
||||
// TODO: need to check against implementation to ensure we don't claim to support
|
||||
// an extension that it doesn't!
|
||||
|
||||
glXExts.push_back("GLX_ARB_extensions_string");
|
||||
//glXExts.push_back("GLX_ARB_multisample");
|
||||
glXExts.push_back("GLX_ARB_create_context");
|
||||
glXExts.push_back("GLX_ARB_create_context_profile");
|
||||
|
||||
merge(glXExts, glXExtsString, ' ');
|
||||
|
||||
m_GLDriver = NULL;
|
||||
|
||||
m_EnabledHooks = true;
|
||||
@@ -362,9 +371,6 @@ class OpenGLHook : LibraryHook
|
||||
WrappedOpenGL *m_GLDriver;
|
||||
|
||||
GLHookSet GL;
|
||||
|
||||
vector<string> glXExts;
|
||||
string glXExtsString;
|
||||
|
||||
set<GLXContext> m_Contexts;
|
||||
|
||||
@@ -379,6 +385,185 @@ class OpenGLHook : LibraryHook
|
||||
DefineDLLExportHooks();
|
||||
DefineGLExtensionHooks();
|
||||
|
||||
/*
|
||||
in bash:
|
||||
|
||||
function HookWrapper()
|
||||
{
|
||||
N=$1;
|
||||
echo "#undef HookWrapper$N";
|
||||
echo -n "#define HookWrapper$N(ret, function";
|
||||
for I in `seq 1 $N`; do echo -n ", t$I, p$I"; done;
|
||||
echo ") \\";
|
||||
|
||||
echo -en "\ttypedef ret (*CONCAT(function, _hooktype)) (";
|
||||
for I in `seq 1 $N`; do echo -n "t$I"; if [ $I -ne $N ]; then echo -n ", "; fi; done;
|
||||
echo "); \\";
|
||||
|
||||
echo -en "\tCONCAT(function, _hooktype) CONCAT(unsupported_real_,function);";
|
||||
|
||||
echo -en "\tret CONCAT(function,_renderdoc_hooked)(";
|
||||
for I in `seq 1 $N`; do echo -n "t$I p$I"; if [ $I -ne $N ]; then echo -n ", "; fi; done;
|
||||
echo ") \\";
|
||||
|
||||
echo -e "\t{ \\";
|
||||
echo -e "\tstatic bool hit = false; if(hit == false) { RDCERR(\"Function \" STRINGIZE(function) \" not supported - capture may be broken\"); hit = true; } \\";
|
||||
echo -en "\treturn CONCAT(unsupported_real_,function)(";
|
||||
for I in `seq 1 $N`; do echo -n "p$I"; if [ $I -ne $N ]; then echo -n ", "; fi; done;
|
||||
echo -e "); \\";
|
||||
echo -e "\t}";
|
||||
}
|
||||
|
||||
for I in `seq 0 15`; do HookWrapper $I; echo; done
|
||||
|
||||
*/
|
||||
|
||||
#undef HookWrapper0
|
||||
#define HookWrapper0(ret, function) \
|
||||
typedef ret (*CONCAT(function, _hooktype)) (); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); ret CONCAT(function,_renderdoc_hooked)() \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return CONCAT(unsupported_real_,function)(); \
|
||||
}
|
||||
|
||||
#undef HookWrapper1
|
||||
#define HookWrapper1(ret, function, t1, p1) \
|
||||
typedef ret (*CONCAT(function, _hooktype)) (t1); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); ret CONCAT(function,_renderdoc_hooked)(t1 p1) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return CONCAT(unsupported_real_,function)(p1); \
|
||||
}
|
||||
|
||||
#undef HookWrapper2
|
||||
#define HookWrapper2(ret, function, t1, p1, t2, p2) \
|
||||
typedef ret (*CONCAT(function, _hooktype)) (t1, t2); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); ret CONCAT(function,_renderdoc_hooked)(t1 p1, t2 p2) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return CONCAT(unsupported_real_,function)(p1, p2); \
|
||||
}
|
||||
|
||||
#undef HookWrapper3
|
||||
#define HookWrapper3(ret, function, t1, p1, t2, p2, t3, p3) \
|
||||
typedef ret (*CONCAT(function, _hooktype)) (t1, t2, t3); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); ret CONCAT(function,_renderdoc_hooked)(t1 p1, t2 p2, t3 p3) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return CONCAT(unsupported_real_,function)(p1, p2, p3); \
|
||||
}
|
||||
|
||||
#undef HookWrapper4
|
||||
#define HookWrapper4(ret, function, t1, p1, t2, p2, t3, p3, t4, p4) \
|
||||
typedef ret (*CONCAT(function, _hooktype)) (t1, t2, t3, t4); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); ret CONCAT(function,_renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return CONCAT(unsupported_real_,function)(p1, p2, p3, p4); \
|
||||
}
|
||||
|
||||
#undef HookWrapper5
|
||||
#define HookWrapper5(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5) \
|
||||
typedef ret (*CONCAT(function, _hooktype)) (t1, t2, t3, t4, t5); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); ret CONCAT(function,_renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return CONCAT(unsupported_real_,function)(p1, p2, p3, p4, p5); \
|
||||
}
|
||||
|
||||
#undef HookWrapper6
|
||||
#define HookWrapper6(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6) \
|
||||
typedef ret (*CONCAT(function, _hooktype)) (t1, t2, t3, t4, t5, t6); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); ret CONCAT(function,_renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return CONCAT(unsupported_real_,function)(p1, p2, p3, p4, p5, p6); \
|
||||
}
|
||||
|
||||
#undef HookWrapper7
|
||||
#define HookWrapper7(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7) \
|
||||
typedef ret (*CONCAT(function, _hooktype)) (t1, t2, t3, t4, t5, t6, t7); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); ret CONCAT(function,_renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return CONCAT(unsupported_real_,function)(p1, p2, p3, p4, p5, p6, p7); \
|
||||
}
|
||||
|
||||
#undef HookWrapper8
|
||||
#define HookWrapper8(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8) \
|
||||
typedef ret (*CONCAT(function, _hooktype)) (t1, t2, t3, t4, t5, t6, t7, t8); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); ret CONCAT(function,_renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return CONCAT(unsupported_real_,function)(p1, p2, p3, p4, p5, p6, p7, p8); \
|
||||
}
|
||||
|
||||
#undef HookWrapper9
|
||||
#define HookWrapper9(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9) \
|
||||
typedef ret (*CONCAT(function, _hooktype)) (t1, t2, t3, t4, t5, t6, t7, t8, t9); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); ret CONCAT(function,_renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return CONCAT(unsupported_real_,function)(p1, p2, p3, p4, p5, p6, p7, p8, p9); \
|
||||
}
|
||||
|
||||
#undef HookWrapper10
|
||||
#define HookWrapper10(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10) \
|
||||
typedef ret (*CONCAT(function, _hooktype)) (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); ret CONCAT(function,_renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return CONCAT(unsupported_real_,function)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); \
|
||||
}
|
||||
|
||||
#undef HookWrapper11
|
||||
#define HookWrapper11(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11) \
|
||||
typedef ret (*CONCAT(function, _hooktype)) (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); ret CONCAT(function,_renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return CONCAT(unsupported_real_,function)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); \
|
||||
}
|
||||
|
||||
#undef HookWrapper12
|
||||
#define HookWrapper12(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12) \
|
||||
typedef ret (*CONCAT(function, _hooktype)) (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); ret CONCAT(function,_renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return CONCAT(unsupported_real_,function)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12); \
|
||||
}
|
||||
|
||||
#undef HookWrapper13
|
||||
#define HookWrapper13(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13) \
|
||||
typedef ret (*CONCAT(function, _hooktype)) (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); ret CONCAT(function,_renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return CONCAT(unsupported_real_,function)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13); \
|
||||
}
|
||||
|
||||
#undef HookWrapper14
|
||||
#define HookWrapper14(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13, t14, p14) \
|
||||
typedef ret (*CONCAT(function, _hooktype)) (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); ret CONCAT(function,_renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return CONCAT(unsupported_real_,function)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14); \
|
||||
}
|
||||
|
||||
#undef HookWrapper15
|
||||
#define HookWrapper15(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13, t14, p14, t15, p15) \
|
||||
typedef ret (*CONCAT(function, _hooktype)) (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); ret CONCAT(function,_renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return CONCAT(unsupported_real_,function)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15); \
|
||||
}
|
||||
|
||||
DefineUnsupportedDummies();
|
||||
|
||||
__attribute__ ((visibility ("default")))
|
||||
GLXContext glXCreateContext(Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct)
|
||||
{
|
||||
@@ -552,18 +737,6 @@ Bool glXQueryExtension(Display *dpy, int *errorBase, int *eventBase)
|
||||
return OpenGLHook::glhooks.glXQueryExtension_real(dpy, errorBase, eventBase);
|
||||
}
|
||||
|
||||
__attribute__ ((visibility ("default")))
|
||||
const char *glXQueryExtensionsString(Display *dpy, int screen)
|
||||
{
|
||||
#if !defined(_RELEASE) && 0
|
||||
PFNGLXQUERYEXTENSIONSSTRING glXGetExtStr = (PFNGLXQUERYEXTENSIONSSTRING)dlsym(libGLdlsymHandle, "glXQueryExtensionsString");
|
||||
string realExtsString = glXGetExtStr(dpy, screen);
|
||||
vector<string> realExts;
|
||||
split(realExtsString, realExts, ' ');
|
||||
#endif
|
||||
return OpenGLHook::glhooks.glXExtsString.c_str();
|
||||
}
|
||||
|
||||
bool OpenGLHook::SetupHooks(GLHookSet &GL)
|
||||
{
|
||||
bool success = true;
|
||||
@@ -608,7 +781,7 @@ __GLXextFuncPtr glXGetProcAddress(const GLubyte *f)
|
||||
if(!strcmp(func, "glXMakeCurrent")) return (__GLXextFuncPtr)&glXMakeCurrent;
|
||||
if(!strcmp(func, "glXSwapBuffers")) return (__GLXextFuncPtr)&glXSwapBuffers;
|
||||
if(!strcmp(func, "glXQueryExtension")) return (__GLXextFuncPtr)&glXQueryExtension;
|
||||
if(!strcmp(func, "glXQueryExtensionsString")) return (__GLXextFuncPtr)&glXQueryExtensionsString;
|
||||
if(!strncmp(func, "glX", 3)) return realFunc;
|
||||
|
||||
// if the real RC doesn't support this function, don't bother hooking
|
||||
if(realFunc == NULL)
|
||||
@@ -617,10 +790,14 @@ __GLXextFuncPtr glXGetProcAddress(const GLubyte *f)
|
||||
DLLExportHooks();
|
||||
HookCheckGLExtensions();
|
||||
|
||||
#if 0
|
||||
// claim not to know this extension!
|
||||
RDCDEBUG("Claiming not to know extension that is available - %s", func);
|
||||
#endif
|
||||
// at the moment the unsupported functions are all lowercase (as their name is generated from the
|
||||
// typedef name).
|
||||
string lowername = strlower(string(func));
|
||||
|
||||
CheckUnsupported();
|
||||
|
||||
// for any other function, if it's not a core or extension function we know about,
|
||||
// just return NULL
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
#include "driver/gl/gl_hookset.h"
|
||||
#include "driver/gl/gl_driver.h"
|
||||
|
||||
#include "driver/gl/gl_hookset_defs.h"
|
||||
|
||||
#include "common/threading.h"
|
||||
#include "serialise/string_utils.h"
|
||||
|
||||
@@ -54,6 +56,23 @@
|
||||
return (PROC)&glhooks.CONCAT(function,_hooked); \
|
||||
}
|
||||
|
||||
#if 0 // debug print for each unsupported function requested (but not used)
|
||||
#define HandleUnsupported(funcPtrType, function) \
|
||||
if(lowername == STRINGIZE(function)) \
|
||||
{ \
|
||||
glhooks.CONCAT(unsupported_real_,function) = (CONCAT(function, _hooktype))realFunc; \
|
||||
RDCDEBUG("Requesting function pointer for unsupported function " STRINGIZE(function)); \
|
||||
return (PROC)&glhooks.CONCAT(function,_hooked); \
|
||||
}
|
||||
#else
|
||||
#define HandleUnsupported(funcPtrType, function) \
|
||||
if(lowername == STRINGIZE(function)) \
|
||||
{ \
|
||||
glhooks.CONCAT(unsupported_real_,function) = (CONCAT(function, _hooktype))realFunc; \
|
||||
return (PROC)&glhooks.CONCAT(function,_hooked); \
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
in bash:
|
||||
|
||||
@@ -81,7 +100,7 @@
|
||||
echo -n "); }";
|
||||
}
|
||||
|
||||
for I in `seq 0 ...`; do HookWrapper $I; echo; done
|
||||
for I in `seq 0 15`; do HookWrapper $I; echo; done
|
||||
|
||||
*/
|
||||
|
||||
@@ -623,11 +642,15 @@ class OpenGLHook : LibraryHook
|
||||
}
|
||||
|
||||
HookCheckGLExtensions();
|
||||
|
||||
#if 0
|
||||
// claim not to know this extension!
|
||||
RDCDEBUG("Claiming not to know extension that is available - %s", func);
|
||||
#endif
|
||||
|
||||
// at the moment the unsupported functions are all lowercase (as their name is generated from the
|
||||
// typedef name).
|
||||
string lowername = strlower(string(func));
|
||||
|
||||
CheckUnsupported();
|
||||
|
||||
// for any other function, if it's not a core or extension function we know about,
|
||||
// just return NULL
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -690,6 +713,187 @@ class OpenGLHook : LibraryHook
|
||||
|
||||
DefineDLLExportHooks();
|
||||
DefineGLExtensionHooks();
|
||||
|
||||
/*
|
||||
in bash:
|
||||
|
||||
function HookWrapper()
|
||||
{
|
||||
N=$1;
|
||||
echo "#undef HookWrapper$N";
|
||||
echo -n "#define HookWrapper$N(ret, function";
|
||||
for I in `seq 1 $N`; do echo -n ", t$I, p$I"; done;
|
||||
echo ") \\";
|
||||
|
||||
echo -en "\ttypedef ret (WINAPI *CONCAT(function, _hooktype)) (";
|
||||
for I in `seq 1 $N`; do echo -n "t$I"; if [ $I -ne $N ]; then echo -n ", "; fi; done;
|
||||
echo "); \\";
|
||||
|
||||
echo -en "\tCONCAT(function, _hooktype) CONCAT(unsupported_real_,function);";
|
||||
|
||||
|
||||
echo -en "\tstatic ret WINAPI CONCAT(function, _hooked)(";
|
||||
for I in `seq 1 $N`; do echo -n "t$I p$I"; if [ $I -ne $N ]; then echo -n ", "; fi; done;
|
||||
echo ") \\";
|
||||
|
||||
echo -e "\t{ \\";
|
||||
echo -e "\tstatic bool hit = false; if(hit == false) { RDCERR(\"Function \" STRINGIZE(function) \" not supported - capture may be broken\"); hit = true; } \\";
|
||||
echo -en "\treturn glhooks.CONCAT(unsupported_real_,function)(";
|
||||
for I in `seq 1 $N`; do echo -n "p$I"; if [ $I -ne $N ]; then echo -n ", "; fi; done;
|
||||
echo -e "); \\";
|
||||
echo -e "\t}";
|
||||
}
|
||||
|
||||
for I in `seq 0 15`; do HookWrapper $I; echo; done
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#undef HookWrapper0
|
||||
#define HookWrapper0(ret, function) \
|
||||
typedef ret (WINAPI *CONCAT(function, _hooktype)) (); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); static ret WINAPI CONCAT(function, _hooked)() \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return glhooks.CONCAT(unsupported_real_,function)(); \
|
||||
}
|
||||
|
||||
#undef HookWrapper1
|
||||
#define HookWrapper1(ret, function, t1, p1) \
|
||||
typedef ret (WINAPI *CONCAT(function, _hooktype)) (t1); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); static ret WINAPI CONCAT(function, _hooked)(t1 p1) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return glhooks.CONCAT(unsupported_real_,function)(p1); \
|
||||
}
|
||||
|
||||
#undef HookWrapper2
|
||||
#define HookWrapper2(ret, function, t1, p1, t2, p2) \
|
||||
typedef ret (WINAPI *CONCAT(function, _hooktype)) (t1, t2); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); static ret WINAPI CONCAT(function, _hooked)(t1 p1, t2 p2) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return glhooks.CONCAT(unsupported_real_,function)(p1, p2); \
|
||||
}
|
||||
|
||||
#undef HookWrapper3
|
||||
#define HookWrapper3(ret, function, t1, p1, t2, p2, t3, p3) \
|
||||
typedef ret (WINAPI *CONCAT(function, _hooktype)) (t1, t2, t3); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); static ret WINAPI CONCAT(function, _hooked)(t1 p1, t2 p2, t3 p3) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return glhooks.CONCAT(unsupported_real_,function)(p1, p2, p3); \
|
||||
}
|
||||
|
||||
#undef HookWrapper4
|
||||
#define HookWrapper4(ret, function, t1, p1, t2, p2, t3, p3, t4, p4) \
|
||||
typedef ret (WINAPI *CONCAT(function, _hooktype)) (t1, t2, t3, t4); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); static ret WINAPI CONCAT(function, _hooked)(t1 p1, t2 p2, t3 p3, t4 p4) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return glhooks.CONCAT(unsupported_real_,function)(p1, p2, p3, p4); \
|
||||
}
|
||||
|
||||
#undef HookWrapper5
|
||||
#define HookWrapper5(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5) \
|
||||
typedef ret (WINAPI *CONCAT(function, _hooktype)) (t1, t2, t3, t4, t5); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); static ret WINAPI CONCAT(function, _hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return glhooks.CONCAT(unsupported_real_,function)(p1, p2, p3, p4, p5); \
|
||||
}
|
||||
|
||||
#undef HookWrapper6
|
||||
#define HookWrapper6(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6) \
|
||||
typedef ret (WINAPI *CONCAT(function, _hooktype)) (t1, t2, t3, t4, t5, t6); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); static ret WINAPI CONCAT(function, _hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return glhooks.CONCAT(unsupported_real_,function)(p1, p2, p3, p4, p5, p6); \
|
||||
}
|
||||
|
||||
#undef HookWrapper7
|
||||
#define HookWrapper7(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7) \
|
||||
typedef ret (WINAPI *CONCAT(function, _hooktype)) (t1, t2, t3, t4, t5, t6, t7); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); static ret WINAPI CONCAT(function, _hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return glhooks.CONCAT(unsupported_real_,function)(p1, p2, p3, p4, p5, p6, p7); \
|
||||
}
|
||||
|
||||
#undef HookWrapper8
|
||||
#define HookWrapper8(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8) \
|
||||
typedef ret (WINAPI *CONCAT(function, _hooktype)) (t1, t2, t3, t4, t5, t6, t7, t8); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); static ret WINAPI CONCAT(function, _hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return glhooks.CONCAT(unsupported_real_,function)(p1, p2, p3, p4, p5, p6, p7, p8); \
|
||||
}
|
||||
|
||||
#undef HookWrapper9
|
||||
#define HookWrapper9(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9) \
|
||||
typedef ret (WINAPI *CONCAT(function, _hooktype)) (t1, t2, t3, t4, t5, t6, t7, t8, t9); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); static ret WINAPI CONCAT(function, _hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return glhooks.CONCAT(unsupported_real_,function)(p1, p2, p3, p4, p5, p6, p7, p8, p9); \
|
||||
}
|
||||
|
||||
#undef HookWrapper10
|
||||
#define HookWrapper10(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10) \
|
||||
typedef ret (WINAPI *CONCAT(function, _hooktype)) (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); static ret WINAPI CONCAT(function, _hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return glhooks.CONCAT(unsupported_real_,function)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); \
|
||||
}
|
||||
|
||||
#undef HookWrapper11
|
||||
#define HookWrapper11(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11) \
|
||||
typedef ret (WINAPI *CONCAT(function, _hooktype)) (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); static ret WINAPI CONCAT(function, _hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return glhooks.CONCAT(unsupported_real_,function)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); \
|
||||
}
|
||||
|
||||
#undef HookWrapper12
|
||||
#define HookWrapper12(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12) \
|
||||
typedef ret (WINAPI *CONCAT(function, _hooktype)) (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); static ret WINAPI CONCAT(function, _hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return glhooks.CONCAT(unsupported_real_,function)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12); \
|
||||
}
|
||||
|
||||
#undef HookWrapper13
|
||||
#define HookWrapper13(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13) \
|
||||
typedef ret (WINAPI *CONCAT(function, _hooktype)) (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); static ret WINAPI CONCAT(function, _hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return glhooks.CONCAT(unsupported_real_,function)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13); \
|
||||
}
|
||||
|
||||
#undef HookWrapper14
|
||||
#define HookWrapper14(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13, t14, p14) \
|
||||
typedef ret (WINAPI *CONCAT(function, _hooktype)) (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); static ret WINAPI CONCAT(function, _hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return glhooks.CONCAT(unsupported_real_,function)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14); \
|
||||
}
|
||||
|
||||
#undef HookWrapper15
|
||||
#define HookWrapper15(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13, t14, p14, t15, p15) \
|
||||
typedef ret (WINAPI *CONCAT(function, _hooktype)) (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15); \
|
||||
CONCAT(function, _hooktype) CONCAT(unsupported_real_,function); static ret WINAPI CONCAT(function, _hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15) \
|
||||
{ \
|
||||
static bool hit = false; if(hit == false) { RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); hit = true; } \
|
||||
return glhooks.CONCAT(unsupported_real_,function)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15); \
|
||||
}
|
||||
|
||||
DefineUnsupportedDummies();
|
||||
};
|
||||
|
||||
OpenGLHook OpenGLHook::glhooks;
|
||||
|
||||
Reference in New Issue
Block a user