本文整理汇总了Python中trace.Tracer.footer方法的典型用法代码示例。如果您正苦于以下问题:Python Tracer.footer方法的具体用法?Python Tracer.footer怎么用?Python Tracer.footer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类trace.Tracer
的用法示例。
在下文中一共展示了Tracer.footer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: footer
# 需要导入模块: from trace import Tracer [as 别名]
# 或者: from trace.Tracer import footer [as 别名]
def footer(self, api):
Tracer.footer(self, api)
# A simple state tracker to track the pointer values
# update the state
print 'static void __trace_user_arrays(GLuint maxindex)'
print '{'
for camelcase_name, uppercase_name in self.arrays:
function_name = 'gl%sPointer' % camelcase_name
enable_name = 'GL_%s_ARRAY' % uppercase_name
binding_name = 'GL_%s_ARRAY_BUFFER_BINDING' % uppercase_name
function = api.get_function_by_name(function_name)
print ' // %s' % function.name
self.array_trace_prolog(api, uppercase_name)
self.array_prolog(api, uppercase_name)
print ' if (__glIsEnabled(%s)) {' % enable_name
print ' GLint __binding = 0;'
print ' __glGetIntegerv(%s, &__binding);' % binding_name
print ' if (!__binding) {'
# Get the arguments via glGet*
for arg in function.args:
arg_get_enum = 'GL_%s_ARRAY_%s' % (uppercase_name, arg.name.upper())
arg_get_function, arg_type = TypeGetter().visit(arg.type)
print ' %s %s = 0;' % (arg_type, arg.name)
print ' __%s(%s, &%s);' % (arg_get_function, arg_get_enum, arg.name)
arg_names = ', '.join([arg.name for arg in function.args[:-1]])
print ' size_t __size = __%s_size(%s, maxindex);' % (function.name, arg_names)
# Emit a fake function
self.array_trace_intermezzo(api, uppercase_name)
print ' unsigned __call = Trace::BeginEnter(__%s_sig);' % (function.name,)
for arg in function.args:
assert not arg.output
print ' Trace::BeginArg(%u);' % (arg.index,)
if arg.name != 'pointer':
dump_instance(arg.type, arg.name)
else:
print ' Trace::LiteralBlob((const void *)%s, __size);' % (arg.name)
print ' Trace::EndArg();'
print ' Trace::EndEnter();'
print ' Trace::BeginLeave(__call);'
print ' Trace::EndLeave();'
print ' }'
print ' }'
self.array_epilog(api, uppercase_name)
self.array_trace_epilog(api, uppercase_name)
print
# Samething, but for glVertexAttribPointer
print ' // glVertexAttribPointer'
print ' GLint __max_vertex_attribs = 0;'
print ' __glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &__max_vertex_attribs);'
print ' for (GLint index = 0; index < __max_vertex_attribs; ++index) {'
print ' GLint __enabled = 0;'
print ' __glGetVertexAttribiv(index, GL_VERTEX_ATTRIB_ARRAY_ENABLED, &__enabled);'
print ' if (__enabled) {'
print ' GLint __binding = 0;'
print ' __glGetVertexAttribiv(index, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, &__binding);'
print ' if (!__binding) {'
function = api.get_function_by_name('glVertexAttribPointer')
# Get the arguments via glGet*
for arg in function.args[1:]:
arg_get_enum = 'GL_VERTEX_ATTRIB_ARRAY_%s' % (arg.name.upper(),)
arg_get_function, arg_type = TypeGetter('glGetVertexAttrib', False).visit(arg.type)
print ' %s %s = 0;' % (arg_type, arg.name)
print ' __%s(index, %s, &%s);' % (arg_get_function, arg_get_enum, arg.name)
arg_names = ', '.join([arg.name for arg in function.args[1:-1]])
print ' size_t __size = __%s_size(%s, maxindex);' % (function.name, arg_names)
# Emit a fake function
print ' unsigned __call = Trace::BeginEnter(__%s_sig);' % (function.name,)
for arg in function.args:
assert not arg.output
print ' Trace::BeginArg(%u);' % (arg.index,)
if arg.name != 'pointer':
dump_instance(arg.type, arg.name)
else:
print ' Trace::LiteralBlob((const void *)%s, __size);' % (arg.name)
print ' Trace::EndArg();'
print ' Trace::EndEnter();'
print ' Trace::BeginLeave(__call);'
print ' Trace::EndLeave();'
print ' }'
print ' }'
print ' }'
print
print '}'
print
示例2: footer
# 需要导入模块: from trace import Tracer [as 别名]
# 或者: from trace.Tracer import footer [as 别名]
def footer(self, api):
Tracer.footer(self, api)
# A simple state tracker to track the pointer values
# update the state
print 'static void __trace_user_arrays(GLuint maxindex)'
print '{'
print ' gltrace::Context *ctx = gltrace::getContext();'
for camelcase_name, uppercase_name in self.arrays:
# in which profile is the array available?
profile_check = 'ctx->profile == gltrace::PROFILE_COMPAT'
if camelcase_name in self.arrays_es1:
profile_check = '(' + profile_check + ' || ctx->profile == gltrace::PROFILE_ES1)';
function_name = 'gl%sPointer' % camelcase_name
enable_name = 'GL_%s_ARRAY' % uppercase_name
binding_name = 'GL_%s_ARRAY_BUFFER_BINDING' % uppercase_name
function = api.get_function_by_name(function_name)
print ' // %s' % function.prototype()
print ' if (%s) {' % profile_check
self.array_trace_prolog(api, uppercase_name)
self.array_prolog(api, uppercase_name)
print ' if (__glIsEnabled(%s)) {' % enable_name
print ' GLint __binding = 0;'
print ' __glGetIntegerv(%s, &__binding);' % binding_name
print ' if (!__binding) {'
# Get the arguments via glGet*
for arg in function.args:
arg_get_enum = 'GL_%s_ARRAY_%s' % (uppercase_name, arg.name.upper())
arg_get_function, arg_type = TypeGetter().visit(arg.type)
print ' %s %s = 0;' % (arg_type, arg.name)
print ' __%s(%s, &%s);' % (arg_get_function, arg_get_enum, arg.name)
arg_names = ', '.join([arg.name for arg in function.args[:-1]])
print ' size_t __size = __%s_size(%s, maxindex);' % (function.name, arg_names)
# Emit a fake function
self.array_trace_intermezzo(api, uppercase_name)
print ' unsigned __call = trace::localWriter.beginEnter(&__%s_sig);' % (function.name,)
for arg in function.args:
assert not arg.output
print ' trace::localWriter.beginArg(%u);' % (arg.index,)
if arg.name != 'pointer':
self.serializeValue(arg.type, arg.name)
else:
print ' trace::localWriter.writeBlob((const void *)%s, __size);' % (arg.name)
print ' trace::localWriter.endArg();'
print ' trace::localWriter.endEnter();'
print ' trace::localWriter.beginLeave(__call);'
print ' trace::localWriter.endLeave();'
print ' }'
print ' }'
self.array_epilog(api, uppercase_name)
self.array_trace_epilog(api, uppercase_name)
print ' }'
print
# Samething, but for glVertexAttribPointer*
#
# Some variants of glVertexAttribPointer alias conventional and generic attributes:
# - glVertexAttribPointer: no
# - glVertexAttribPointerARB: implementation dependent
# - glVertexAttribPointerNV: yes
#
# This means that the implementations of these functions do not always
# alias, and they need to be considered independently.
#
print ' // ES1 does not support generic vertex attributes'
print ' if (ctx->profile == gltrace::PROFILE_ES1)'
print ' return;'
print
print ' vertex_attrib __vertex_attrib = __get_vertex_attrib();'
print
for suffix in ['', 'ARB', 'NV']:
if suffix:
SUFFIX = '_' + suffix
else:
SUFFIX = suffix
function_name = 'glVertexAttribPointer' + suffix
function = api.get_function_by_name(function_name)
print ' // %s' % function.prototype()
print ' if (__vertex_attrib == VERTEX_ATTRIB%s) {' % SUFFIX
if suffix == 'NV':
print ' GLint __max_vertex_attribs = 16;'
else:
print ' GLint __max_vertex_attribs = 0;'
print ' __glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &__max_vertex_attribs);'
print ' for (GLint index = 0; index < __max_vertex_attribs; ++index) {'
print ' GLint __enabled = 0;'
if suffix == 'NV':
print ' __glGetIntegerv(GL_VERTEX_ATTRIB_ARRAY0_NV + index, &__enabled);'
else:
print ' __glGetVertexAttribiv%s(index, GL_VERTEX_ATTRIB_ARRAY_ENABLED%s, &__enabled);' % (suffix, SUFFIX)
print ' if (__enabled) {'
print ' GLint __binding = 0;'
#.........这里部分代码省略.........
示例3: footer
# 需要导入模块: from trace import Tracer [as 别名]
# 或者: from trace.Tracer import footer [as 别名]
def footer(self, api):
Tracer.footer(self, api)
self.state_tracker_impl(api)