opengl-es - OpenGL ES / Vulkan:每个片段模板写入/测试(在 Qualcomm Snapdragon XR2 上)
问题描述
我想渲染两个网格,第一个写入模板缓冲区,第二个对其进行测试。我想在每个片段级别上执行此操作(第一个对象的片段着色器应该定义将哪个值写入模板缓冲区,第二个对象的片段着色器应该定义第二个对象的片段是否以及针对哪个模板值对象应该被剪裁)。
我的目标平台是具有 Qualcomm Snapdragon XR 的 Oculus Quest 2。
如果平台支持 GL_ARM_shader_framebuffer_fetch_depth_stencil,我可以使用它,但仅在某些 Mali GPU 上支持。
我想使用模板的原因是,出于性能原因,我想在单个前向渲染过程中渲染所有内容,并且由于我已经被迫在我的着色器中使用片段丢弃,所以早期的 z 拒绝无论如何都不在桌面上,所以这不是关注。
如何在 OpenGL ES 3.0 或 Vulkan 中在 Qualcomm Snapdragon XR2 上实现每个片段模板编写/测试?
任何指针表示赞赏。
解决方案
我最近必须为一个项目打印 Quest 2 上所有可用的扩展,并且可以确认它GL_ARM_shader_framebuffer_fetch_depth_stencil
是受支持的。
需要明确的是,这个扩展只允许读取模板值,而不是写入它。
如果有帮助,这些是受支持的扩展:
GL_OES_EGL_image_external
GL_OES_EGL_sync
GL_OES_vertex_half_float
GL_OES_framebuffer_object
GL_OES_rgb8_rgba8
GL_OES_compressed_ETC1_RGB8_texture
GL_AMD_compressed_ATC_texture
GL_KHR_texture_compression_astc_ldr
GL_KHR_texture_compression_astc_hdr
GL_OES_texture_compression_astc
GL_OES_texture_npot
GL_EXT_texture_filter_anisotropic
GL_EXT_texture_format_BGRA8888
GL_EXT_read_format_bgra
GL_OES_texture_3D
GL_EXT_color_buffer_float
GL_EXT_color_buffer_half_float
GL_QCOM_alpha_test
GL_OES_depth24
GL_OES_packed_depth_stencil
GL_OES_depth_texture
GL_OES_depth_texture_cube_map
GL_EXT_sRGB
GL_OES_texture_float
GL_OES_texture_float_linear
GL_OES_texture_half_float
GL_OES_texture_half_float_linear
GL_EXT_texture_type_2_10_10_10_REV
GL_EXT_texture_sRGB_decode
GL_EXT_texture_format_sRGB_override
GL_OES_element_index_uint
GL_EXT_copy_image
GL_EXT_geometry_shader
GL_EXT_tessellation_shader
GL_OES_texture_stencil8
GL_EXT_shader_io_blocks
GL_OES_shader_image_atomic
GL_OES_sample_variables
GL_EXT_texture_border_clamp
GL_EXT_EGL_image_external_wrap_modes
GL_EXT_multisampled_render_to_texture
GL_EXT_multisampled_render_to_texture2
GL_OES_shader_multisample_interpolation
GL_EXT_texture_cube_map_array
GL_EXT_draw_buffers_indexed
GL_EXT_gpu_shader5
GL_EXT_robustness
GL_EXT_texture_buffer
GL_EXT_shader_framebuffer_fetch
GL_ARM_shader_framebuffer_fetch_depth_stencil
GL_OES_texture_storage_multisample_2d_array
GL_OES_sample_shading
GL_OES_get_program_binary
GL_EXT_debug_label
GL_KHR_blend_equation_advanced
GL_KHR_blend_equation_advanced_coherent
GL_QCOM_tiled_rendering
GL_ANDROID_extension_pack_es31a
GL_EXT_primitive_bounding_box
GL_OES_standard_derivatives
GL_OES_vertex_array_object
GL_EXT_disjoint_timer_query
GL_KHR_debug
GL_EXT_YUV_target
GL_EXT_sRGB_write_control
GL_EXT_texture_norm16
GL_EXT_discard_framebuffer
GL_OES_surfaceless_context
GL_OVR_multiview
GL_OVR_multiview2
GL_EXT_texture_sRGB_R8
GL_KHR_no_error
GL_EXT_debug_marker
GL_OES_EGL_image_external_essl3
GL_OVR_multiview_multisampled_render_to_texture
GL_EXT_buffer_storage
GL_EXT_external_buffer
GL_EXT_blit_framebuffer_params
GL_EXT_clip_cull_distance
GL_EXT_protected_textures
GL_EXT_shader_non_constant_global_initializers
GL_QCOM_texture_foveated
GL_QCOM_texture_foveated2
GL_QCOM_texture_foveated_subsampled_layout
GL_QCOM_shader_framebuffer_fetch_noncoherent
GL_QCOM_shader_framebuffer_fetch_rate
GL_EXT_memory_object
GL_EXT_memory_object_fd
GL_EXT_EGL_image_array
GL_NV_shader_noperspective_interpolation
GL_KHR_robust_buffer_access_behavior
GL_EXT_EGL_image_storage
GL_EXT_blend_func_extended
GL_EXT_clip_control
GL_OES_texture_view
GL_EXT_fragment_invocation_density
GL_QCOM_motion_estimation
GL_QCOM_validate_shader_binary
GL_QCOM_YUV_texture_gather
GL_IMG_texture_filter_cubic```
推荐阅读
- eclipse - 我创建了一个插件项目,但是没有带有弹出菜单模板的插件,如何获取带有弹出菜单模板的插件
- swift - Realm Swift:禁用反向链接查询,但在反向关系中发现反向链接
- mysql - 加入三个计数查询并将结果放入三列
- assembly - 定义和调用接收不同数据类型的宏时指令操作数大小错误。使用 masm32
- java - 如何将具有数据列的pdf文件转换为可以使用java访问的数据库
- php - 未设置 PHP Curl 标头
- django - Django Rest Framework 的测试用例;努力得到正确的回应
- bootstrap-4 - Bootstrap 将图像放在中心文本上方
- javascript - 尝试使用上下文执行传递给组件的函数
- android - 如何一次处理多个异步调用?