ProgrammablePulling

所属分类:OpenGL
开发工具:C++
文件大小:0KB
下载次数:0
上传日期:2017-07-22 15:44:55
上 传 者sh-1993
说明:  可编程拉伸实验(基于Daniel Rakos的OpenGL Insights“可编程顶点拉伸”文章),
(Programmable pulling experiments (based on OpenGL Insights "Programmable Vertex Pulling" article by Daniel Rakos),)

文件列表:
ProgrammablePulling.sln (955, 2017-07-22)
ProgrammablePulling/ (0, 2017-07-22)
ProgrammablePulling/ProgrammablePulling.vcxproj (7352, 2017-07-22)
ProgrammablePulling/ProgrammablePulling.vcxproj.filters (4274, 2017-07-22)
ProgrammablePulling/buddha.cpp (55225, 2017-07-22)
ProgrammablePulling/buddha.h (2410, 2017-07-22)
ProgrammablePulling/glew32.dll (370176, 2017-07-22)
ProgrammablePulling/glfw3.dll (83456, 2017-07-22)
ProgrammablePulling/imgui/ (0, 2017-07-22)
ProgrammablePulling/imgui/imconfig.h (2519, 2017-07-22)
ProgrammablePulling/imgui/imgui.cpp (435158, 2017-07-22)
ProgrammablePulling/imgui/imgui.h (124256, 2017-07-22)
ProgrammablePulling/imgui/imgui_demo.cpp (125913, 2017-07-22)
ProgrammablePulling/imgui/imgui_draw.cpp (109316, 2017-07-22)
ProgrammablePulling/imgui/imgui_impl_glfw_gl3.cpp (17209, 2017-07-22)
ProgrammablePulling/imgui/imgui_impl_glfw_gl3.h (1652, 2017-07-22)
ProgrammablePulling/imgui/imgui_internal.h (47754, 2017-07-22)
ProgrammablePulling/imgui/stb_rect_pack.h (17384, 2017-07-22)
ProgrammablePulling/imgui/stb_textedit.h (49161, 2017-07-22)
ProgrammablePulling/imgui/stb_truetype.h (152430, 2017-07-22)
ProgrammablePulling/main.cpp (16849, 2017-07-22)
ProgrammablePulling/models/ (0, 2017-07-22)
ProgrammablePulling/models/buddha-optimized.obj (15936377, 2017-07-22)
ProgrammablePulling/models/buddha.obj (15128909, 2017-07-22)
ProgrammablePulling/models/sponza.obj (21109957, 2017-07-22)
ProgrammablePulling/shaders/ (0, 2017-07-22)
ProgrammablePulling/shaders/assembler.vert (976, 2017-07-22)
ProgrammablePulling/shaders/common.frag (276, 2017-07-22)
ProgrammablePulling/shaders/fetcher_aos_1fetch.vert (839, 2017-07-22)
ProgrammablePulling/shaders/fetcher_aos_3fetch.vert (1148, 2017-07-22)
ProgrammablePulling/shaders/fetcher_image_aos_1fetch.vert (889, 2017-07-22)
ProgrammablePulling/shaders/fetcher_image_aos_3fetch.vert (1214, 2017-07-22)
ProgrammablePulling/shaders/fetcher_image_soa.vert (1429, 2017-07-22)
ProgrammablePulling/shaders/fetcher_soa.vert (1305, 2017-07-22)
ProgrammablePulling/shaders/fetcher_ssbo_aos_1fetch.vert (904, 2017-07-22)
ProgrammablePulling/shaders/fetcher_ssbo_aos_3fetch.vert (1154, 2017-07-22)
ProgrammablePulling/shaders/fetcher_ssbo_soa.vert (1460, 2017-07-22)
ProgrammablePulling/shaders/fixed_aos.vert (589, 2017-07-22)
... ...

# ProgrammablePulling Programmable pulling experiments (based on OpenGL Insights "Programmable Vertex Pulling" article by Daniel Rakos) # Sample image ![Sample image](http://i.imgur.com/kTYIeje.jpg) # Explanation of parameters ## Programmability * None: Passes per-vertex inputs using built-in vertex array object and vertex shader "in" variables * Pull vertex: gl_VertexID comes from index buffer passed through VAO as usual. gl_VertexID is used to index the vertex data. * Pull index and vertex: Non-indexed draw is used, and gl_VertexID is used to manually read the VertexID from the index buffer. Presumably circumvents [post-transform cache](https://www.khronos.org/opengl/wiki/Post_Transform_Cache). * Pull with soft cache: See "Special Modes" below. * Assembly in GS: See "Special Modes" below. * Assembly in TS: See "Special Modes" below. ## Layout * AoS: Position data is stored as XYZ XYZ XYZ in memory (or sometimes XYZW for padding). VAO implementation passes a vec3 as usual. texture/image/SSBO implementations either load all four XYZW in one load (the W is padding), or they do three separate 1-float loads (to avoid needing padding.) * SoA: Position data is stored as XXX YYY ZZZ in memory. VAO implementation passes 3 separate single float attributes. texture/image/SSBO implementations do three loads of a single float, one load from each buffer. **Note**: Some people think I'm talking about PTN PTN PTN vs. PPP TTT NNN when I say AoS/SoA, but I'm actually talking about AoS/SoA at the next lower level, between the XYZ of individual vec3s. For specifics, the shaders used in each configuration are independent, and in the shaders/ folder of the project, so they can be consulted to see the exact syntax used. There is also a mode that measures PTN PTN PTN with VAOs (not programmable). In this benchmark, there are only positions and normals, as used in all tests. No texcoords. ## Special Modes Some modes of the program are a bit fancier. ### OBJ-Style multi-index Uses fully programmable pulling to read mesh data layed out in the same format as obj. This means there is a separate index buffer for positions and for normals. ### OBJ-Style + soft cache Implements a post-transform vertex cache in software. It was initially based on the code in "Deferred Attribute Interpolation Shading" (Listing 3.1) in GPU Pro 7 (authors: Christoph Schied and Carsten Dachsbacher.) However, it has been totally rewritten since then, but that article might be interesting to you anyways. The cache is implemented using a hash table that maps pairs of `` to the ID of a vertex in a big linearly allocated buffer. Separate chaining is used for entries within the same bucket. Access to the hash table is guarded by a per-bucket shared readers-writer lock. This mode can be configured using the GUI with the following options: #### Soft vertex cache bucket bits Decides the size of the hash table used for the cache. (= `2^n` buckets) #### Soft vertex cache read lock attempts Number of times the vertex shader should try to acquire the cache bucket's shared readers-writer lock **for read access** before giving up and recomputing the vertex. #### Soft vertex cache write lock attempts Number of times the vertex shader should try to acquire the cache bucket's shared readers-writer lock **for write access** before giving up and using the recomputed vertex without caching it for somebody else to reuse it. #### Soft vertex cache entries per bucket Number of entries per bucket in the hash map used for the cache. ### Assembly in GS Runs 6 vertex shader instances per triangle, and each instance outputs either a position or a normal. The 3 positions and 3 normals are assembled together into a primitve in a geometry shader. ### Assembly in TS Runs 6 vertex shader instances per triangle, and each instance outputs either a position or a normal. The 3 positions and 3 normals are assembled together into a primitve in a tessellation shader. *Currently bugged, don't know why.* # Installation Check the "Releases" section of the GitHub repo if you want to just download the exe and run it. Requires Windows 10. Alternatively, you can build it yourself from the Visual Studio solution (on Windows), or by running the build.sh script on Linux.

近期下载者

相关文件


收藏者