whoimi

A geek blog

View on GitHub

ShaderModel与ES版本和GPU特性的关系

Opengl版本和功能的对应

Opengl网站

OpenGL 4.0 (2010)

Addition Core Extension
Shading language 4.00 ARB_texture_query_lod, ARB_gpu_shader5, ARB_gpu_shader_fp64, ARB_shader_subroutine, ARB_texture_gather
Indirect Drawing, without multidraw ARB_draw_indirect
Request minimum number of fragment inputs ARB_sample_shading
Tessellation, with shader stages ARB_tessellation_shader
Buffer Texture formats RGB32F, RGB32I, RGB32UI ARB_texture_buffer_object_rgb32
Cubemap Array Texture ARB_texture_cube_map_array
Transform Feedback objects and multiple feedback stream output. ARB_transform_feedback2, ARB_transform_feedback3
Addition Promoted from
Individual blend equations for each color output ARB_draw_buffers_blend

OpenGL 3.3 (2010)

Addition Core Extension
Shading language 3.30 ARB_shader_bit_encoding
Dual-source blending. ARB_blend_func_extended
Shader-defined locations for attributes and fragment shader outputs. ARB_explicit_attrib_location
Simple boolean Occlusion Query ARB_occlusion_query2
Sampler Objects ARB_sampler_objects
A new image format for unsigned 10.10.10.2 colors ARB_texture_rgb10_a2ui
Texture swizzle ARB_texture_swizzle
Timer queries ARB_timer_query
Instanced arrays ARB_instanced_arrays
Vertex attributes 2.10.10.10 ARB_vertex_type_2_10_10_10_rev

OpenGL 3.2 (2009)

Addition Core Extension
D3D compatible color vertex component ordering ARB_vertex_array_bgra
Drawing command allowing modification of the base vertex index ARB_draw_elements_base_vertex
Shader fragment coordinate convention control ARB_fragment_coord_conventions
Provoking vertex control ARB_provoking_vertex
Seamless cube map filtering ARB_seamless_cube_map
Multisampled textures and texture samplers for specific sample locations ARB_texture_multisample
Fragment Depth Clamping ARB_depth_clamp
Fence sync objects ARB_sync
Addition Promoted from
Geometry Shaders, as well as input/output Interface Blocks ARB_geometry_shader4, heavily modified.

OpenGL 3.1 (2009)

Addition Core Extension
Uniform Buffer Objects ARB_uniform_buffer_object
Addition Promoted from
Instanced rendering with a per instance counter accessible to vertex shaders ARB_draw_instanced
Data copying between buffer objects EXT_copy_buffer
Primitive restart NV_primitive_restart
Buffer Textures ARB_texture_buffer_object
Rectangle Textures ARB_texture_rectangle

Microsoft对ShaderModel的定义

HLSL的ShaderModel主要表示不同版本的Shader支持的语言、功能特性。(The HLSL shader model is a versioning approach indicating which new features are added to the language.

应用和游戏可以针对某个版本通用的功能进行开发,硬件和驱动工程师也可以针对这个版本的特性进行支持。

不同的ShaderModel版本:不同的处理阶段(Geometry etc)、约束、处理能力、向下兼容情况。

Differences between Direct3D 9 and Direct3D 10: Direct3D 9 introduced shader models 1, 2, and 3. Direct3D 10 introduced shader model 4. Direct3D 10.1 introduced shader model 4.1.

Unity对不同版本的定义

https://docs.unity3d.com/Manual/SL-ShaderCompileTargets.html

Here is the list of shader models supported, with roughly increasing set of capabilities (and in some cases higher platform/GPU requirements):

#pragma target 2.0

#pragma target 2.5 (default)

#pragma target 3.0

#pragma target 3.5 (or es3.0)

#pragma target 4.0

#pragma target 4.5 (or es3.1)

#pragma target 4.6 (or gl4.1)

#pragma target 5.0