From: Erik Faye-Lund Date: Tue, 28 May 2019 11:34:34 +0000 (+0200) Subject: docs: use code instead of tt-tag X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0ee366960c32067b528077c49362c468364d0206;p=mesa.git docs: use code instead of tt-tag The tt-tag has been removed from HTML5, so let's normalize this to code-tags intead. This just makes things a bit more consistent, as we've mixed these left and right so far anyway. Signed-off-by: Erik Faye-Lund Reviewed-by: Emil Velikov Reviewed-by: Eric Engestrom --- diff --git a/docs/codingstyle.html b/docs/codingstyle.html index 66ffc0c33bf..e8832e7967c 100644 --- a/docs/codingstyle.html +++ b/docs/codingstyle.html @@ -48,8 +48,8 @@ For example: } -
  • Put a space before/after operators. For example, a = b + c; -and not a=b+c; +
  • Put a space before/after operators. For example, a = b + c; +and not a=b+c;
  • This GNU indent command generally does the right thing for formatting:
    @@ -127,11 +127,11 @@ while gallium typically uses underscores (Ex: "local_var_name").
     
  • Global variables are almost never used because Mesa should be thread-safe.
  • Booleans. Places that are not directly visible to the GL API -should prefer the use of bool, true, and -false over GLboolean, GL_TRUE, and -GL_FALSE. In C code, this may mean that -#include <stdbool.h> needs to be added. The -try_emit_* methods in src/mesa/program/ir_to_mesa.cpp and +should prefer the use of bool, true, and +false over GLboolean, GL_TRUE, and +GL_FALSE. In C code, this may mean that +#include <stdbool.h> needs to be added. The +try_emit_* methods in src/mesa/program/ir_to_mesa.cpp and src/mesa/state_tracker/st_glsl_to_tgsi.cpp can serve as examples. diff --git a/docs/dispatch.html b/docs/dispatch.html index 19570bcf37a..7860f2833a8 100644 --- a/docs/dispatch.html +++ b/docs/dispatch.html @@ -30,28 +30,28 @@ of the GL related state for the application. Every texture, every buffer object, every enable, and much, much more is stored in the context. Since an application can have more than one context, the context to be used is selected by a window-system dependent function such as -glXMakeContextCurrent.

    +glXMakeContextCurrent.

    In environments that implement OpenGL with X-Windows using GLX, every GL -function, including the pointers returned by glXGetProcAddress, are +function, including the pointers returned by glXGetProcAddress, are context independent. This means that no matter what context is -currently active, the same glVertex3fv function is used.

    +currently active, the same glVertex3fv function is used.

    This creates the first bit of dispatch complexity. An application can have two GL contexts. One context is a direct rendering context where function calls are routed directly to a driver loaded within the application's address space. The other context is an indirect rendering context where function calls are converted to GLX protocol and sent to a -server. The same glVertex3fv has to do the right thing depending +server. The same glVertex3fv has to do the right thing depending on which context is current.

    Highly optimized drivers or GLX protocol implementations may want to change the behavior of GL functions depending on current state. For -example, glFogCoordf may operate differently depending on whether +example, glFogCoordf may operate differently depending on whether or not fog is enabled.

    In multi-threaded environments, it is possible for each thread to have a -different GL context current. This means that poor old glVertex3fv +different GL context current. This means that poor old glVertex3fv has to know which GL context is current in the thread where it is being called.

    @@ -64,18 +64,18 @@ dispatch table stores pointers to functions that actually implement specific GL functions. Each time a new context is made current in a thread, these pointers a updated.

    -

    The implementation of functions such as glVertex3fv becomes +

    The implementation of functions such as glVertex3fv becomes conceptually simple:

    • Fetch the current dispatch table pointer.
    • -
    • Fetch the pointer to the real glVertex3fv function from the +
    • Fetch the pointer to the real glVertex3fv function from the table.
    • Call the real function.

    This can be implemented in just a few lines of C code. The file -src/mesa/glapi/glapitemp.h contains code very similar to this.

    +src/mesa/glapi/glapitemp.h contains code very similar to this.

    @@ -93,9 +93,9 @@ void glVertex3f(GLfloat x, GLfloat y, GLfloat z) overhead that it adds to every GL function call.

    In a multithreaded environment, a naive implementation of -GET_DISPATCH involves a call to pthread_getspecific or a +GET_DISPATCH involves a call to pthread_getspecific or a similar function. Mesa provides a wrapper function called -_glapi_get_dispatch that is used by default.

    +_glapi_get_dispatch that is used by default.

    3. Optimizations

    @@ -109,7 +109,7 @@ each can or cannot be used are listed.

    The vast majority of OpenGL applications use the API in a single threaded manner. That is, the application has only one thread that makes calls into the GL. In these cases, not only do the calls to -pthread_getspecific hurt performance, but they are completely +pthread_getspecific hurt performance, but they are completely unnecessary! It is possible to detect this common case and avoid these calls.

    @@ -118,15 +118,15 @@ of the executing thread. If the same thread ID is always seen, Mesa knows that the application is, from OpenGL's point of view, single threaded.

    As long as an application is single threaded, Mesa stores a pointer to -the dispatch table in a global variable called _glapi_Dispatch. +the dispatch table in a global variable called _glapi_Dispatch. The pointer is also stored in a per-thread location via -pthread_setspecific. When Mesa detects that an application has -become multithreaded, NULL is stored in _glapi_Dispatch.

    +pthread_setspecific. When Mesa detects that an application has +become multithreaded, NULL is stored in _glapi_Dispatch.

    Using this simple mechanism the dispatch functions can detect the -multithreaded case by comparing _glapi_Dispatch to NULL. -The resulting implementation of GET_DISPATCH is slightly more -complex, but it avoids the expensive pthread_getspecific call in +multithreaded case by comparing _glapi_Dispatch to NULL. +The resulting implementation of GET_DISPATCH is slightly more +complex, but it avoids the expensive pthread_getspecific call in the common case.

    @@ -136,7 +136,7 @@ the common case.

    (_glapi_Dispatch != NULL) \ ? _glapi_Dispatch : pthread_getspecific(&_glapi_Dispatch_key) -
    Improved GET_DISPATCH Implementation
    +Improved GET_DISPATCH Implementation

    3.2. ELF TLS

    @@ -144,14 +144,14 @@ the common case.

    Starting with the 2.4.20 Linux kernel, each thread is allocated an area of per-thread, global storage. Variables can be put in this area using some extensions to GCC. By storing the dispatch table pointer in this area, the -expensive call to pthread_getspecific and the test of -_glapi_Dispatch can be avoided.

    +expensive call to pthread_getspecific and the test of +_glapi_Dispatch can be avoided.

    The dispatch table pointer is stored in a new variable called -_glapi_tls_Dispatch. A new variable name is used so that a single +_glapi_tls_Dispatch. A new variable name is used so that a single libGL can implement both interfaces. This allows the libGL to operate with direct rendering drivers that use either interface. Once the pointer is -properly declared, GET_DISPACH becomes a simple variable +properly declared, GET_DISPACH becomes a simple variable reference.

    @@ -162,11 +162,11 @@ extern __thread struct _glapi_table *_glapi_tls_Dispatch #define GET_DISPATCH() _glapi_tls_Dispatch
  • -TLS GET_DISPATCH Implementation +TLS GET_DISPATCH Implementation

    Use of this path is controlled by the preprocessor define -GLX_USE_TLS. Any platform capable of using TLS should use this as +GLX_USE_TLS. Any platform capable of using TLS should use this as the default dispatch method.

    3.3. Assembly Language Dispatch Stubs

    @@ -185,13 +185,13 @@ ways that the dispatch table pointer can be accessed. There are four different methods that can be used:

      -
    1. Using _glapi_Dispatch directly in builds for non-multithreaded +
    2. Using _glapi_Dispatch directly in builds for non-multithreaded environments.
    3. -
    4. Using _glapi_Dispatch and _glapi_get_dispatch in +
    5. Using _glapi_Dispatch and _glapi_get_dispatch in multithreaded environments.
    6. -
    7. Using _glapi_Dispatch and pthread_getspecific in +
    8. Using _glapi_Dispatch and pthread_getspecific in multithreaded environments.
    9. -
    10. Using _glapi_tls_Dispatch directly in TLS enabled +
    11. Using _glapi_tls_Dispatch directly in TLS enabled multithreaded environments.
    @@ -204,13 +204,13 @@ terribly relevant.

    few preprocessor defines.

      -
    • If GLX_USE_TLS is defined, method #3 is used.
    • -
    • If HAVE_PTHREAD is defined, method #2 is used.
    • +
    • If GLX_USE_TLS is defined, method #3 is used.
    • +
    • If HAVE_PTHREAD is defined, method #2 is used.
    • If none of the preceding are defined, method #1 is used.

    Two different techniques are used to handle the various different cases. -On x86 and SPARC, a macro called GL_STUB is used. In the preamble +On x86 and SPARC, a macro called GL_STUB is used. In the preamble of the assembly source file different implementations of the macro are selected based on the defined preprocessor variables. The assembly code then consists of a series of invocations of the macros such as: @@ -220,7 +220,7 @@ then consists of a series of invocations of the macros such as:

     GL_STUB(Color3fv, _gloffset_Color3fv)
     
    -SPARC Assembly Implementation of glColor3fv +SPARC Assembly Implementation of glColor3fv

    The benefit of this technique is that changes to the calling pattern @@ -231,32 +231,32 @@ changed lines in the assembly code.

    implementation does not change based on the parameters passed to the function. For example, since x86 passes all parameters on the stack, no additional code is needed to save and restore function parameters around a -call to pthread_getspecific. Since x86-64 passes parameters in +call to pthread_getspecific. Since x86-64 passes parameters in registers, varying amounts of code needs to be inserted around the call to -pthread_getspecific to save and restore the GL function's +pthread_getspecific to save and restore the GL function's parameters.

    The other technique, used by platforms like x86-64 that cannot use the -first technique, is to insert #ifdef within the assembly +first technique, is to insert #ifdef within the assembly implementation of each function. This makes the assembly file considerably -larger (e.g., 29,332 lines for glapi_x86-64.S versus 1,155 lines for -glapi_x86.S) and causes simple changes to the function +larger (e.g., 29,332 lines for glapi_x86-64.S versus 1,155 lines for +glapi_x86.S) and causes simple changes to the function implementation to generate many lines of diffs. Since the assembly files are typically generated by scripts (see below), this isn't a significant problem.

    Once a new assembly file is created, it must be inserted in the build system. There are two steps to this. The file must first be added to -src/mesa/sources. That gets the file built and linked. The second -step is to add the correct #ifdef magic to -src/mesa/glapi/glapi_dispatch.c to prevent the C version of the +src/mesa/sources. That gets the file built and linked. The second +step is to add the correct #ifdef magic to +src/mesa/glapi/glapi_dispatch.c to prevent the C version of the dispatch functions from being built.

    3.4. Fixed-Length Dispatch Stubs

    -

    To implement glXGetProcAddress, Mesa stores a table that +

    To implement glXGetProcAddress, Mesa stores a table that associates function names with pointers to those functions. This table is -stored in src/mesa/glapi/glprocs.h. For different reasons on +stored in src/mesa/glapi/glprocs.h. For different reasons on different platforms, storing all of those pointers is inefficient. On most platforms, including all known platforms that support TLS, we can avoid this added overhead.

    @@ -267,8 +267,8 @@ calculated by multiplying the size of the dispatch stub by the offset of the function in the table. This value is then added to the address of the first dispatch stub.

    -

    This path is activated by adding the correct #ifdef magic to -src/mesa/glapi/glapi.c just before glprocs.h is +

    This path is activated by adding the correct #ifdef magic to +src/mesa/glapi/glapi.c just before glprocs.h is included.

    4. Automatic Generation of Dispatch Stubs

    diff --git a/docs/download.html b/docs/download.html index 617aea4fb24..8fe7c295b42 100644 --- a/docs/download.html +++ b/docs/download.html @@ -27,23 +27,23 @@ or mesa.freedesktop.org

    Starting with the first release of 2017, Mesa's version scheme is -year-based. Filenames are in the form mesa-Y.N.P.tar.gz, where -Y is the year (two digits), N is an incremental number -(starting at 0) and P is the patch number (0 for the first +year-based. Filenames are in the form mesa-Y.N.P.tar.gz, where +Y is the year (two digits), N is an incremental number +(starting at 0) and P is the patch number (0 for the first release, 1 for the first patch after that).

    When a new release is coming, release candidates (betas) may be found in the same directory, and are recognisable by the -mesa-Y.N.P-rcX.tar.gz filename. +mesa-Y.N.P-rcX.tar.gz filename.

    Unpacking

    -Mesa releases are available in two formats: .tar.xz and .tar.gz. +Mesa releases are available in two formats: .tar.xz and .tar.gz.

    diff --git a/docs/relnotes/7.10.1.html b/docs/relnotes/7.10.1.html index 15eae10b807..ffd9b0537e3 100644 --- a/docs/relnotes/7.10.1.html +++ b/docs/relnotes/7.10.1.html @@ -48,8 +48,8 @@ bdbf3ffb2606d6aa8afabb6c6243b91b MesaGLUT-7.10.1.zip

    This list is likely incomplete.

    • Fix an off-by-one bug in a vsplit assertion.
    • -
    • Fix incorrect handling of layout qualifier -with in, out, attribute, and varying.
    • +
    • Fix incorrect handling of layout qualifier +with in, out, attribute, and varying.
    • Fix an i965 shader bug where the negative absolute value was generated instead of the absolute value of a negation.
    • diff --git a/docs/relnotes/7.9.2.html b/docs/relnotes/7.9.2.html index 9b9a095d3c9..f0df4abb6e1 100644 --- a/docs/relnotes/7.9.2.html +++ b/docs/relnotes/7.9.2.html @@ -48,10 +48,10 @@ aacb8f4db997e346db40c6066942140a MesaGLUT-7.9.2.tar.gz

      This list is likely incomplete.

      • Fix an off-by-one bug in a vsplit assertion.
      • -
      • Fix incorrect handling of layout qualifier -with in, out, attribute, and varying.
      • +
      • Fix incorrect handling of layout qualifier +with in, out, attribute, and varying.
      • -
      • Fix an i965 GPU hang in GLSL shaders that contain an unconditional discard statement.
      • +
      • Fix an i965 GPU hang in GLSL shaders that contain an unconditional discard statement.
      • Fix an i965 shader bug where the negative absolute value was generated instead of the absolute value of a negation.
      • diff --git a/docs/relnotes/8.0.html b/docs/relnotes/8.0.html index 1959a077651..37d6e6304ef 100644 --- a/docs/relnotes/8.0.html +++ b/docs/relnotes/8.0.html @@ -71,7 +71,7 @@ for DRI hardware acceleration. "ICD" drivers.
      • Removed the linux-fbdev software driver.
      • Removed all remnants of paletted texture support. As required by - desktop OpenGL, GL_COLOR_INDEX data can still be uploaded + desktop OpenGL, GL_COLOR_INDEX data can still be uploaded to a color (e.g., RGBA) texture. However, the data cannot be stored internally as color-index.
      • Removed support for GL_APPLE_client_storage extension.
      • diff --git a/docs/repository.html b/docs/repository.html index 9ee2d8822ed..c8e2c62fc5e 100644 --- a/docs/repository.html +++ b/docs/repository.html @@ -137,7 +137,7 @@ Unix users don't need to set this option.

        At any given time, there may be several active branches in Mesa's repository. -Generally, master contains the latest development (unstable) +Generally, master contains the latest development (unstable) code while a branch has the latest stable code.

        diff --git a/docs/shading.html b/docs/shading.html index ae7b8e6c5ea..839a61a0361 100644 --- a/docs/shading.html +++ b/docs/shading.html @@ -85,7 +85,7 @@ should match the filenames of the corresponding dumped shaders.

        Setting MESA_SHADER_CAPTURE_PATH to a directory will cause the compiler -to write .shader_test files for use with +to write .shader_test files for use with shader-db, a tool which compiler developers can use to gather statistics about shaders (instructions, cycles, memory accesses, and so on).