Comments (15)
It works!
from apitrace.
You did pretty much what I had in mind with #874 (comment)
Maybe there's a non obvious bug here or the crash mechanism is different.
Can you share the trace or dump of last couple dozen of calls ?
from apitrace.
trace here
from apitrace.
My hunch was actually right -- the issue is indeed the polymorphism of the indirect
parameter:
...
3975364 @0 glMultiDrawElementsIndirect(mode = GL_TRIANGLES, type = GL_UNSIGNED_INT, indirect = 0x55560c2ff470, drawcount = 1, stride = 20)
warning: passing high address 0x55560c2ff470 as uintptr_t
apitrace: warning: caught signal 11
indirect
should have been a blob here, instead of an offset pointer.
Was this trace recorded with your patch? Because I completely forgot to mention(!): that change zmike@5e9428d will not change the glretrace's behavior, but rather the tracing.
from apitrace.
BTW, this is a very odd/useless thing for an OpenGL app to do: do an indirect draw, with the indirect parameters in CPU memory...! 🤦
It was to avoid weird state combinations with legacy like that the core profiles were created. But in the end everybody yielded: compatibility profiles are widely expected and supported. The only way to avoid legacy is to avoid OpenGL altogether and use something like Vulkan.
from apitrace.
Yeah, I'm just trying to fix (possible) driver bugs that people report 🤕
I don't recall if this specific trace was recorded with or without the change, but I just did another capture locally to verify and it still crashes. I'm uploading it now...
from apitrace.
from apitrace.
Same problem:
...
4286026 @0 glMultiDrawElementsIndirect(mode = GL_TRIANGLES, type = GL_UNSIGNED_INT, indirect = 0x7fffd8037bf0, drawcount = 1, stride = 20)
spring: /home/jfonseca/projects/apitrace/retrace/retrace_swizzle.cpp:169: std::map<long long unsigned int, retrace::Region>::iterator retrace::lookupRegion(long long unsigned int): Assertion `contains(it, address)' failed.
indirect
is still not being recognised as a blob, despite there has never been a single glBindBuffer(GL_DRAW_INDIRECT_BUFFER)
call.
Either:
- zmike@5e9428d has a bug somewhere
- the wrong
glxtrace.so
is not being used glGetIntegerv(GL_DRAW_INDIRECT_BUFFER, ...)
is giving bogus results
Some carefully added printfs to glMultiDrawElementsIndirect
's body should tell which is happenin.
from apitrace.
I think I found the problem.
I believe this should fix it:
diff --git a/specs/glapi.py b/specs/glapi.py
index 89cf67db..6732ca3b 100644
--- a/specs/glapi.py
+++ b/specs/glapi.py
@@ -778,8 +778,8 @@ glapi.addFunctions([
# GL_VERSION_4_6
GlFunction(Void, "glSpecializeShader", [(GLshader, "shader"), (GLstringConst, "pEntryPoint"), (GLuint, "numSpecializationConstants"), (Array(Const(GLuint), "numSpecializationConstants"), "pConstantIndex"), (Array(Const(GLuint), "numSpecializationConstants"), "pConstantValue")]),
- GlFunction(Void, "glMultiDrawArraysIndirectCount", [(GLenum_mode, "mode"), (GLpointerConst, "indirect"), (GLintptr, "drawcount"), (GLsizei, "maxdrawcount"), (GLsizei, "stride")]),
- GlFunction(Void, "glMultiDrawElementsIndirectCount", [(GLenum_mode, "mode"), (GLenum, "type"), (GLpointerConst, "indirect"), (GLintptr, "drawcount"), (GLsizei, "maxdrawcount"), (GLsizei, "stride")]),
+ GlFunction(Void, "glMultiDrawArraysIndirectCount", [(GLenum_mode, "mode"), (GLdrawArraysIndirectBuffer(), "indirect"), (GLintptr, "drawcount"), (GLsizei, "maxdrawcount"), (GLsizei, "stride")]),
+ GlFunction(Void, "glMultiDrawElementsIndirectCount", [(GLenum_mode, "mode"), (GLenum, "type"), (GLdrawElementsIndirectBuffer(), "indirect"), (GLintptr, "drawcount"), (GLsizei, "maxdrawcount"), (GLsizei, "stride")]),
# GL_VERSION_ES_CM_1_0
GlFunction(Void, "glClipPlanef", [(GLenum, "plane"), (Array(Const(GLfloat), 4), "equation")]),
@@ -1189,8 +1189,8 @@ glapi.addFunctions([
GlFunction(Void, "glMultiDrawElementsBaseVertex", [(GLenum_mode, "mode"), (Array(Const(GLsizei), "drawcount"), "count"), (GLenum, "type"), (Array(Const(GLindexBuffer("count[{i}]", "type")), "drawcount"), "indices"), (GLsizei, "drawcount"), (Array(Const(GLint), "drawcount"), "basevertex")]),
# GL_ARB_draw_indirect
- GlFunction(Void, "glDrawArraysIndirect", [(GLenum_mode, "mode"), (GLdrawArraysIndirectBuffer())]),
- GlFunction(Void, "glDrawElementsIndirect", [(GLenum_mode, "mode"), (GLenum, "type"), (GLdrawElementsIndirectBuffer())]),
+ GlFunction(Void, "glDrawArraysIndirect", [(GLenum_mode, "mode"), (GLpointerConst, "indirect")]),
+ GlFunction(Void, "glDrawElementsIndirect", [(GLenum_mode, "mode"), (GLenum, "type"), (GLpointerConst, "indirect")]),
# GL_ARB_draw_instanced
GlFunction(Void, "glDrawArraysInstancedARB", [(GLenum_mode, "mode"), (GLint, "first"), (GLsizei, "count"), (GLsizei, "instancecount")]),
diff --git a/specs/gltypes.py b/specs/gltypes.py
index 2dbd6722..75c020e8 100644
--- a/specs/gltypes.py
+++ b/specs/gltypes.py
@@ -319,7 +319,7 @@ def GLdrawArraysIndirectBuffer():
# - offsets when element array buffer is bound
# - or a blob otherwise.
return Polymorphic('_draw_indirect_buffer_binding()', [
- ('0', Blob(Const(GLvoid), 16)),
+ ('0', Blob(Const(GLvoid), 'drawcount*16')),
],
IntPointer("const GLvoid *"),
contextLess=False,
@@ -330,7 +330,7 @@ def GLdrawElementsIndirectBuffer():
# - offsets when element array buffer is bound
# - or a blob otherwise.
return Polymorphic('_draw_indirect_buffer_binding()', [
- ('0', Blob(Const(GLvoid), 20)),
+ ('0', Blob(Const(GLvoid), 'drawcount*20')),
],
IntPointer("const GLvoid *"),
contextLess=False,
from apitrace.
https://github.com/apitrace/apitrace/tree/issue-903
from apitrace.
Tested your branch and captures still crash the same way on replay.
from apitrace.
Out of ideas then. Can you confirm whether the crashing glMultiDrawElementsIndirectCount
call has a blob or not?
from apitrace.
Doesn't appear to be recognized as a blob, no.
from apitrace.
I just realized that Khronos lacks the man page for glMultiDrawElementsIndirectCount
and google was redirecting me to glMultiDrawElementsIndirect
's man page which is different.
Per https://registry.khronos.org/OpenGL/extensions/ARB/ARB_indirect_parameters.txt ,
glMultiDrawElementsIndirectCount
's drawcount
is an int offset into the bound GL_PARAMETER_BUFFER
.
It still doesn't explain why though.
from apitrace.
I wrote a test case (apitrace/apitrace-tests@b0a8664) did a few more fixes (now catching all "glDrawIndirect*" calls which wasn't the case), and confirmed I'm getting blobs, both with NVIDIA and Mesa:
$ apitrace trace -o drawarraysindirect.trace apps/gl/varray drawarraysindirect && apitrace dump --grep 'Indirect' drawarraysindirect.trace
[...]
7579 glDrawArraysIndirect(mode = GL_TRIANGLE_STRIP, indirect = blob(16))
Please try one more time.
from apitrace.
Related Issues (20)
- trace capture issues with GL_HALF_FLOAT HOT 21
- WINE applications do not produce any trace HOT 2
- GL game "Beyond All Reason" window overestimated by glretrace HOT 11
- Unvanquished fonts issues
- If I want to upgrade apitrace's support for OpenGL to version 4.6 HOT 1
- Replacement of shader via glDetachShader + glAttachShader leads to link error HOT 2
- eglretrace crashes on rayman2_gl trace
- Can Apitrace support retrace through EGL on Windows HOT 2
- loop option doesn't work for specific trace HOT 1
- retrace --loop crashes when VAO is created in setup frame and deleted in loop frame HOT 1
- Tellusim Upscaler (Star Wars) 20230513 trace doesn't work properly
- Failed to capture trace of wgf11filter HOT 1
- Build system complains about uncloned submodules for bundled dependencies even when using dependencies from system HOT 4
- Bug recording instanced draw calls with user arrays HOT 18
- [enhancement] replace zlib HOT 1
- Feature Request: Attach apitrace to Already Running Processes HOT 4
- During tracing gl-500-texture-cube-arb.exe, missing cube map HOT 2
- Wolfenstein: The Old Blood tracing broken due to abuse of GL_MAP_PERSISTENT_BIT mappings HOT 19
- trimming broken for some traces HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apitrace.