Giter Site home page Giter Site logo

Comments (2)

jrfonseca avatar jrfonseca commented on May 28, 2024

I can reproduce this on Linux too.

This has something to do with the memory shadowing apitrace does to track writes to coherent memory
#623 from @werman

Because if I disable the shadowing like this the sample renders fine while tracing (of course this still produces broken traces, so not a fix):

diff --git a/wrappers/gltrace.py b/wrappers/gltrace.py
index a7ff39f3..6e58e81a 100644
--- a/wrappers/gltrace.py
+++ b/wrappers/gltrace.py
@@ -557,7 +557,7 @@ class GlTracer(Tracer):
             print('        _glGetBufferParameteriv%s(target, GL_BUFFER_ACCESS, &access);' % suffix)
             print('        flush = access != GL_READ_ONLY;')
             print('    }')
-            print('    if ((access_flags & GL_MAP_COHERENT_BIT) && (access_flags & GL_MAP_WRITE_BIT)) {')
+            print('    if ((access_flags & 0x40000000) && (access_flags & GL_MAP_WRITE_BIT)) {')
             print('        gltrace::Context *_ctx = gltrace::getContext();')
             print('        GLint buffer = getBufferName(target);')
             print('        auto it = _ctx->sharedRes->bufferToShadowMemory.find(buffer);')
@@ -630,7 +630,7 @@ class GlTracer(Tracer):
         if function.name == 'glUnmapNamedBuffer':
             print('    GLint access_flags = 0;')
             print('    _glGetNamedBufferParameteriv(buffer, GL_BUFFER_ACCESS_FLAGS, &access_flags);')
-            print('    if ((access_flags & GL_MAP_COHERENT_BIT) && (access_flags & GL_MAP_WRITE_BIT)) {')
+            print('    if ((access_flags & 0x40000000) && (access_flags & GL_MAP_WRITE_BIT)) {')
             print('        gltrace::Context *_ctx = gltrace::getContext();')
             print('        auto it = _ctx->sharedRes->bufferToShadowMemory.find(buffer);')
             print('        if (it != _ctx->sharedRes->bufferToShadowMemory.end()) {')
@@ -651,7 +651,7 @@ class GlTracer(Tracer):
         if function.name == 'glUnmapNamedBufferEXT':
             print('    GLint access_flags = 0;')
             print('    _glGetNamedBufferParameterivEXT(buffer, GL_BUFFER_ACCESS_FLAGS, &access_flags);')
-            print('    if ((access_flags & GL_MAP_COHERENT_BIT) && (access_flags & GL_MAP_WRITE_BIT)) {')
+            print('    if ((access_flags & 0x40000000) && (access_flags & GL_MAP_WRITE_BIT)) {')
             print('        gltrace::Context *_ctx = gltrace::getContext();')
             print('        auto it = _ctx->sharedRes->bufferToShadowMemory.find(buffer);')
             print('        if (it != _ctx->sharedRes->bufferToShadowMemory.end()) {')
@@ -712,7 +712,7 @@ class GlTracer(Tracer):
             print(r'        flags &= ~GL_MAP_NOTIFY_EXPLICIT_BIT_VMWX;')
             print(r'    }')
             print(r'')
-            print(r'    if ((flags & GL_MAP_COHERENT_BIT) && (flags & GL_MAP_WRITE_BIT)) {')
+            print(r'    if ((flags & 0x40000000) && (flags & GL_MAP_WRITE_BIT)) {')
             print(r'        gltrace::Context *_ctx = gltrace::getContext();')
             if function.name in ('glBufferStorage', 'glBufferStorageEXT'):
                 print(r'        GLint buffer = getBufferName(target);')
@@ -913,7 +913,7 @@ class GlTracer(Tracer):
         Tracer.doInvokeFunction(self, function)
 
         if function.name in ('glMapBufferRange', 'glMapBufferRangeEXT', 'glMapNamedBufferRange', 'glMapNamedBufferRangeEXT'):
-            print(r'    if ((access & GL_MAP_COHERENT_BIT) && (access & GL_MAP_WRITE_BIT)) {')
+            print(r'    if ((access & 0x40000000) && (access & GL_MAP_WRITE_BIT)) {')
             print(r'        gltrace::Context *_ctx = gltrace::getContext();')
             if function.name in ('glMapBufferRange', 'glMapBufferRangeEXT'):
                 print(r'        GLint buffer = getBufferName(target);')

from apitrace.

jirongjiao avatar jirongjiao commented on May 28, 2024

Not sure what's special about this sample. shadow memory works fine for persistent maps for other samples/apps.

from apitrace.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.