Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
尘离序散
obs-studio
提交
bb329b92
O
obs-studio
项目概览
尘离序散
/
obs-studio
与 Fork 源项目一致
从无法访问的项目Fork
通知
30
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
obs-studio
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bb329b92
编写于
10月 24, 2013
作者:
J
jp9000
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avoid using 'default' for enum switches
上级
8421690c
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
71 addition
and
41 deletion
+71
-41
libobs-d3d11/d3d11-samplerstate.cpp
libobs-d3d11/d3d11-samplerstate.cpp
+4
-2
libobs-d3d11/d3d11-subsystem.hpp
libobs-d3d11/d3d11-subsystem.hpp
+14
-7
libobs-opengl/gl-shader.c
libobs-opengl/gl-shader.c
+1
-1
libobs-opengl/gl-subsystem.h
libobs-opengl/gl-subsystem.h
+38
-21
libobs-opengl/gl-windows.c
libobs-opengl/gl-windows.c
+3
-3
libobs-opengl/gl-zstencil.c
libobs-opengl/gl-zstencil.c
+3
-1
libobs/graphics/effect-parser.c
libobs/graphics/effect-parser.c
+2
-2
libobs/graphics/graphics.h
libobs/graphics/graphics.h
+2
-2
libobs/media-io/audio-io.h
libobs/media-io/audio-io.h
+4
-2
未找到文件。
libobs-d3d11/d3d11-samplerstate.cpp
浏览文件 @
bb329b92
...
@@ -22,19 +22,19 @@ static inline D3D11_TEXTURE_ADDRESS_MODE ConvertGSAddressMode(
...
@@ -22,19 +22,19 @@ static inline D3D11_TEXTURE_ADDRESS_MODE ConvertGSAddressMode(
gs_address_mode
mode
)
gs_address_mode
mode
)
{
{
switch
(
mode
)
{
switch
(
mode
)
{
default:
case
GS_ADDRESS_WRAP
:
return
D3D11_TEXTURE_ADDRESS_WRAP
;
case
GS_ADDRESS_WRAP
:
return
D3D11_TEXTURE_ADDRESS_WRAP
;
case
GS_ADDRESS_CLAMP
:
return
D3D11_TEXTURE_ADDRESS_CLAMP
;
case
GS_ADDRESS_CLAMP
:
return
D3D11_TEXTURE_ADDRESS_CLAMP
;
case
GS_ADDRESS_MIRROR
:
return
D3D11_TEXTURE_ADDRESS_MIRROR
;
case
GS_ADDRESS_MIRROR
:
return
D3D11_TEXTURE_ADDRESS_MIRROR
;
case
GS_ADDRESS_BORDER
:
return
D3D11_TEXTURE_ADDRESS_BORDER
;
case
GS_ADDRESS_BORDER
:
return
D3D11_TEXTURE_ADDRESS_BORDER
;
case
GS_ADDRESS_MIRRORONCE
:
return
D3D11_TEXTURE_ADDRESS_MIRROR_ONCE
;
case
GS_ADDRESS_MIRRORONCE
:
return
D3D11_TEXTURE_ADDRESS_MIRROR_ONCE
;
}
}
return
D3D11_TEXTURE_ADDRESS_WRAP
;
}
}
static
inline
D3D11_FILTER
ConvertGSFilter
(
gs_sample_filter
filter
)
static
inline
D3D11_FILTER
ConvertGSFilter
(
gs_sample_filter
filter
)
{
{
switch
(
filter
)
{
switch
(
filter
)
{
default:
case
GS_FILTER_POINT
:
case
GS_FILTER_POINT
:
return
D3D11_FILTER_MIN_MAG_MIP_POINT
;
return
D3D11_FILTER_MIN_MAG_MIP_POINT
;
case
GS_FILTER_LINEAR
:
case
GS_FILTER_LINEAR
:
...
@@ -54,6 +54,8 @@ static inline D3D11_FILTER ConvertGSFilter( gs_sample_filter filter)
...
@@ -54,6 +54,8 @@ static inline D3D11_FILTER ConvertGSFilter( gs_sample_filter filter)
case
GS_FILTER_ANISOTROPIC
:
case
GS_FILTER_ANISOTROPIC
:
return
D3D11_FILTER_ANISOTROPIC
;
return
D3D11_FILTER_ANISOTROPIC
;
}
}
return
D3D11_FILTER_MIN_MAG_MIP_POINT
;
}
}
gs_sampler_state
::
gs_sampler_state
(
device_t
device
,
gs_sampler_info
*
info
)
gs_sampler_state
::
gs_sampler_state
(
device_t
device
,
gs_sampler_info
*
info
)
...
...
libobs-d3d11/d3d11-subsystem.hpp
浏览文件 @
bb329b92
...
@@ -76,8 +76,9 @@ static inline DXGI_FORMAT ConvertGSTextureFormat(gs_color_format format)
...
@@ -76,8 +76,9 @@ static inline DXGI_FORMAT ConvertGSTextureFormat(gs_color_format format)
case
GS_DXT1
:
return
DXGI_FORMAT_BC1_UNORM
;
case
GS_DXT1
:
return
DXGI_FORMAT_BC1_UNORM
;
case
GS_DXT3
:
return
DXGI_FORMAT_BC2_UNORM
;
case
GS_DXT3
:
return
DXGI_FORMAT_BC2_UNORM
;
case
GS_DXT5
:
return
DXGI_FORMAT_BC3_UNORM
;
case
GS_DXT5
:
return
DXGI_FORMAT_BC3_UNORM
;
default:
return
DXGI_FORMAT_UNKNOWN
;
}
}
return
DXGI_FORMAT_UNKNOWN
;
}
}
static
inline
DXGI_FORMAT
ConvertGSZStencilFormat
(
gs_zstencil_format
format
)
static
inline
DXGI_FORMAT
ConvertGSZStencilFormat
(
gs_zstencil_format
format
)
...
@@ -87,14 +88,14 @@ static inline DXGI_FORMAT ConvertGSZStencilFormat(gs_zstencil_format format)
...
@@ -87,14 +88,14 @@ static inline DXGI_FORMAT ConvertGSZStencilFormat(gs_zstencil_format format)
case
GS_Z24_S8
:
return
DXGI_FORMAT_D24_UNORM_S8_UINT
;
case
GS_Z24_S8
:
return
DXGI_FORMAT_D24_UNORM_S8_UINT
;
case
GS_Z32F
:
return
DXGI_FORMAT_D32_FLOAT
;
case
GS_Z32F
:
return
DXGI_FORMAT_D32_FLOAT
;
case
GS_Z32F_S8X24
:
return
DXGI_FORMAT_D32_FLOAT_S8X24_UINT
;
case
GS_Z32F_S8X24
:
return
DXGI_FORMAT_D32_FLOAT_S8X24_UINT
;
default:
return
DXGI_FORMAT_UNKNOWN
;
}
}
return
DXGI_FORMAT_UNKNOWN
;
}
}
static
inline
D3D11_COMPARISON_FUNC
ConvertGSDepthTest
(
gs_depth_test
test
)
static
inline
D3D11_COMPARISON_FUNC
ConvertGSDepthTest
(
gs_depth_test
test
)
{
{
switch
(
test
)
{
switch
(
test
)
{
default:
case
GS_NEVER
:
return
D3D11_COMPARISON_NEVER
;
case
GS_NEVER
:
return
D3D11_COMPARISON_NEVER
;
case
GS_LESS
:
return
D3D11_COMPARISON_LESS
;
case
GS_LESS
:
return
D3D11_COMPARISON_LESS
;
case
GS_LEQUAL
:
return
D3D11_COMPARISON_LESS_EQUAL
;
case
GS_LEQUAL
:
return
D3D11_COMPARISON_LESS_EQUAL
;
...
@@ -104,12 +105,13 @@ static inline D3D11_COMPARISON_FUNC ConvertGSDepthTest(gs_depth_test test)
...
@@ -104,12 +105,13 @@ static inline D3D11_COMPARISON_FUNC ConvertGSDepthTest(gs_depth_test test)
case
GS_NOTEQUAL
:
return
D3D11_COMPARISON_NOT_EQUAL
;
case
GS_NOTEQUAL
:
return
D3D11_COMPARISON_NOT_EQUAL
;
case
GS_ALWAYS
:
return
D3D11_COMPARISON_ALWAYS
;
case
GS_ALWAYS
:
return
D3D11_COMPARISON_ALWAYS
;
}
}
return
D3D11_COMPARISON_NEVER
;
}
}
static
inline
D3D11_STENCIL_OP
ConvertGSStencilOp
(
gs_stencil_op
op
)
static
inline
D3D11_STENCIL_OP
ConvertGSStencilOp
(
gs_stencil_op
op
)
{
{
switch
(
op
)
{
switch
(
op
)
{
default:
case
GS_KEEP
:
return
D3D11_STENCIL_OP_KEEP
;
case
GS_KEEP
:
return
D3D11_STENCIL_OP_KEEP
;
case
GS_ZERO
:
return
D3D11_STENCIL_OP_ZERO
;
case
GS_ZERO
:
return
D3D11_STENCIL_OP_ZERO
;
case
GS_REPLACE
:
return
D3D11_STENCIL_OP_REPLACE
;
case
GS_REPLACE
:
return
D3D11_STENCIL_OP_REPLACE
;
...
@@ -117,12 +119,13 @@ static inline D3D11_STENCIL_OP ConvertGSStencilOp(gs_stencil_op op)
...
@@ -117,12 +119,13 @@ static inline D3D11_STENCIL_OP ConvertGSStencilOp(gs_stencil_op op)
case
GS_DECR
:
return
D3D11_STENCIL_OP_DECR
;
case
GS_DECR
:
return
D3D11_STENCIL_OP_DECR
;
case
GS_INVERT
:
return
D3D11_STENCIL_OP_INVERT
;
case
GS_INVERT
:
return
D3D11_STENCIL_OP_INVERT
;
}
}
return
D3D11_STENCIL_OP_KEEP
;
}
}
static
inline
D3D11_BLEND
ConvertGSBlendType
(
gs_blend_type
type
)
static
inline
D3D11_BLEND
ConvertGSBlendType
(
gs_blend_type
type
)
{
{
switch
(
type
)
{
switch
(
type
)
{
default:
case
GS_BLEND_ZERO
:
return
D3D11_BLEND_ZERO
;
case
GS_BLEND_ZERO
:
return
D3D11_BLEND_ZERO
;
case
GS_BLEND_ONE
:
return
D3D11_BLEND_ONE
;
case
GS_BLEND_ONE
:
return
D3D11_BLEND_ONE
;
case
GS_BLEND_SRCCOLOR
:
return
D3D11_BLEND_SRC_COLOR
;
case
GS_BLEND_SRCCOLOR
:
return
D3D11_BLEND_SRC_COLOR
;
...
@@ -135,28 +138,32 @@ static inline D3D11_BLEND ConvertGSBlendType(gs_blend_type type)
...
@@ -135,28 +138,32 @@ static inline D3D11_BLEND ConvertGSBlendType(gs_blend_type type)
case
GS_BLEND_INVDSTALPHA
:
return
D3D11_BLEND_INV_DEST_ALPHA
;
case
GS_BLEND_INVDSTALPHA
:
return
D3D11_BLEND_INV_DEST_ALPHA
;
case
GS_BLEND_SRCALPHASAT
:
return
D3D11_BLEND_SRC_ALPHA_SAT
;
case
GS_BLEND_SRCALPHASAT
:
return
D3D11_BLEND_SRC_ALPHA_SAT
;
}
}
return
D3D11_BLEND_ONE
;
}
}
static
inline
D3D11_CULL_MODE
ConvertGSCullMode
(
gs_cull_mode
mode
)
static
inline
D3D11_CULL_MODE
ConvertGSCullMode
(
gs_cull_mode
mode
)
{
{
switch
(
mode
)
{
switch
(
mode
)
{
default:
case
GS_BACK
:
return
D3D11_CULL_BACK
;
case
GS_BACK
:
return
D3D11_CULL_BACK
;
case
GS_FRONT
:
return
D3D11_CULL_FRONT
;
case
GS_FRONT
:
return
D3D11_CULL_FRONT
;
case
GS_NEITHER
:
return
D3D11_CULL_NONE
;
case
GS_NEITHER
:
return
D3D11_CULL_NONE
;
}
}
return
D3D11_CULL_BACK
;
}
}
static
inline
D3D11_PRIMITIVE_TOPOLOGY
ConvertGSTopology
(
gs_draw_mode
mode
)
static
inline
D3D11_PRIMITIVE_TOPOLOGY
ConvertGSTopology
(
gs_draw_mode
mode
)
{
{
switch
(
mode
)
{
switch
(
mode
)
{
default:
case
GS_POINTS
:
return
D3D11_PRIMITIVE_TOPOLOGY_POINTLIST
;
case
GS_POINTS
:
return
D3D11_PRIMITIVE_TOPOLOGY_POINTLIST
;
case
GS_LINES
:
return
D3D11_PRIMITIVE_TOPOLOGY_LINELIST
;
case
GS_LINES
:
return
D3D11_PRIMITIVE_TOPOLOGY_LINELIST
;
case
GS_LINESTRIP
:
return
D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP
;
case
GS_LINESTRIP
:
return
D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP
;
case
GS_TRIS
:
return
D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST
;
case
GS_TRIS
:
return
D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST
;
case
GS_TRISTRIP
:
return
D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP
;
case
GS_TRISTRIP
:
return
D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP
;
}
}
return
D3D11_PRIMITIVE_TOPOLOGY_POINTLIST
;
}
}
/* exception-safe RAII wrapper for vertex buffer data (NOTE: not copy-safe) */
/* exception-safe RAII wrapper for vertex buffer data (NOTE: not copy-safe) */
...
...
libobs-opengl/gl-shader.c
浏览文件 @
bb329b92
...
@@ -497,7 +497,7 @@ void shader_setval(shader_t shader, sparam_t param, const void *val,
...
@@ -497,7 +497,7 @@ void shader_setval(shader_t shader, sparam_t param, const void *val,
if
(
!
matching_shader
(
shader
,
param
))
if
(
!
matching_shader
(
shader
,
param
))
return
;
return
;
switch
(
param
->
type
)
{
switch
(
(
uint32_t
)
param
->
type
)
{
case
SHADER_PARAM_FLOAT
:
expected_size
=
sizeof
(
float
);
break
;
case
SHADER_PARAM_FLOAT
:
expected_size
=
sizeof
(
float
);
break
;
case
SHADER_PARAM_BOOL
:
case
SHADER_PARAM_BOOL
:
case
SHADER_PARAM_INT
:
expected_size
=
sizeof
(
int
);
break
;
case
SHADER_PARAM_INT
:
expected_size
=
sizeof
(
int
);
break
;
...
...
libobs-opengl/gl-subsystem.h
浏览文件 @
bb329b92
...
@@ -53,8 +53,10 @@ static inline GLint convert_gs_format(enum gs_color_format format)
...
@@ -53,8 +53,10 @@ static inline GLint convert_gs_format(enum gs_color_format format)
case
GS_DXT1
:
return
GL_RGB
;
case
GS_DXT1
:
return
GL_RGB
;
case
GS_DXT3
:
return
GL_RGBA
;
case
GS_DXT3
:
return
GL_RGBA
;
case
GS_DXT5
:
return
GL_RGBA
;
case
GS_DXT5
:
return
GL_RGBA
;
default:
return
0
;
case
GS_UNKNOWN
:
return
0
;
}
}
return
0
;
}
}
static
inline
GLint
convert_gs_internal_format
(
enum
gs_color_format
format
)
static
inline
GLint
convert_gs_internal_format
(
enum
gs_color_format
format
)
...
@@ -77,8 +79,10 @@ static inline GLint convert_gs_internal_format(enum gs_color_format format)
...
@@ -77,8 +79,10 @@ static inline GLint convert_gs_internal_format(enum gs_color_format format)
case
GS_DXT1
:
return
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
;
case
GS_DXT1
:
return
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
;
case
GS_DXT3
:
return
GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
;
case
GS_DXT3
:
return
GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
;
case
GS_DXT5
:
return
GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
;
case
GS_DXT5
:
return
GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
;
default:
return
0
;
case
GS_UNKNOWN
:
return
0
;
}
}
return
0
;
}
}
static
inline
GLenum
get_gl_format_type
(
enum
gs_color_format
format
)
static
inline
GLenum
get_gl_format_type
(
enum
gs_color_format
format
)
...
@@ -101,8 +105,10 @@ static inline GLenum get_gl_format_type(enum gs_color_format format)
...
@@ -101,8 +105,10 @@ static inline GLenum get_gl_format_type(enum gs_color_format format)
case
GS_DXT1
:
return
GL_UNSIGNED_BYTE
;
case
GS_DXT1
:
return
GL_UNSIGNED_BYTE
;
case
GS_DXT3
:
return
GL_UNSIGNED_BYTE
;
case
GS_DXT3
:
return
GL_UNSIGNED_BYTE
;
case
GS_DXT5
:
return
GL_UNSIGNED_BYTE
;
case
GS_DXT5
:
return
GL_UNSIGNED_BYTE
;
default:
return
0
;
case
GS_UNKNOWN
:
return
0
;
}
}
return
GL_UNSIGNED_BYTE
;
}
}
static
inline
GLenum
convert_zstencil_format
(
enum
gs_zstencil_format
format
)
static
inline
GLenum
convert_zstencil_format
(
enum
gs_zstencil_format
format
)
...
@@ -112,14 +118,15 @@ static inline GLenum convert_zstencil_format(enum gs_zstencil_format format)
...
@@ -112,14 +118,15 @@ static inline GLenum convert_zstencil_format(enum gs_zstencil_format format)
case
GS_Z24_S8
:
return
GL_DEPTH24_STENCIL8
;
case
GS_Z24_S8
:
return
GL_DEPTH24_STENCIL8
;
case
GS_Z32F
:
return
GL_DEPTH_COMPONENT32F
;
case
GS_Z32F
:
return
GL_DEPTH_COMPONENT32F
;
case
GS_Z32F_S8X24
:
return
GL_DEPTH32F_STENCIL8
;
case
GS_Z32F_S8X24
:
return
GL_DEPTH32F_STENCIL8
;
default:
return
0
;
case
GS_ZS_NONE
:
return
0
;
}
}
return
0
;
}
}
static
inline
GLenum
convert_gs_depth_test
(
enum
gs_depth_test
test
)
static
inline
GLenum
convert_gs_depth_test
(
enum
gs_depth_test
test
)
{
{
switch
(
test
)
{
switch
(
test
)
{
default:
case
GS_NEVER
:
return
GL_NEVER
;
case
GS_NEVER
:
return
GL_NEVER
;
case
GS_LESS
:
return
GL_LESS
;
case
GS_LESS
:
return
GL_LESS
;
case
GS_LEQUAL
:
return
GL_LEQUAL
;
case
GS_LEQUAL
:
return
GL_LEQUAL
;
...
@@ -129,12 +136,13 @@ static inline GLenum convert_gs_depth_test(enum gs_depth_test test)
...
@@ -129,12 +136,13 @@ static inline GLenum convert_gs_depth_test(enum gs_depth_test test)
case
GS_NOTEQUAL
:
return
GL_NOTEQUAL
;
case
GS_NOTEQUAL
:
return
GL_NOTEQUAL
;
case
GS_ALWAYS
:
return
GL_ALWAYS
;
case
GS_ALWAYS
:
return
GL_ALWAYS
;
}
}
return
GL_NEVER
;
}
}
static
inline
GLenum
convert_gs_stencil_op
(
enum
gs_stencil_op
op
)
static
inline
GLenum
convert_gs_stencil_op
(
enum
gs_stencil_op
op
)
{
{
switch
(
op
)
{
switch
(
op
)
{
default:
case
GS_KEEP
:
return
GL_KEEP
;
case
GS_KEEP
:
return
GL_KEEP
;
case
GS_ZERO
:
return
GL_ZERO
;
case
GS_ZERO
:
return
GL_ZERO
;
case
GS_REPLACE
:
return
GL_REPLACE
;
case
GS_REPLACE
:
return
GL_REPLACE
;
...
@@ -142,22 +150,24 @@ static inline GLenum convert_gs_stencil_op(enum gs_stencil_op op)
...
@@ -142,22 +150,24 @@ static inline GLenum convert_gs_stencil_op(enum gs_stencil_op op)
case
GS_DECR
:
return
GL_DECR
;
case
GS_DECR
:
return
GL_DECR
;
case
GS_INVERT
:
return
GL_INVERT
;
case
GS_INVERT
:
return
GL_INVERT
;
}
}
return
GL_KEEP
;
}
}
static
inline
GLenum
convert_gs_stencil_side
(
enum
gs_stencil_side
side
)
static
inline
GLenum
convert_gs_stencil_side
(
enum
gs_stencil_side
side
)
{
{
switch
(
side
)
{
switch
(
side
)
{
default:
case
GS_STENCIL_FRONT
:
return
GL_FRONT
;
case
GS_STENCIL_FRONT
:
return
GL_FRONT
;
case
GS_STENCIL_BACK
:
return
GL_BACK
;
case
GS_STENCIL_BACK
:
return
GL_BACK
;
case
GS_STENCIL_BOTH
:
return
GL_FRONT_AND_BACK
;
case
GS_STENCIL_BOTH
:
return
GL_FRONT_AND_BACK
;
}
}
return
GL_FRONT
;
}
}
static
inline
GLenum
convert_gs_blend_type
(
enum
gs_blend_type
type
)
static
inline
GLenum
convert_gs_blend_type
(
enum
gs_blend_type
type
)
{
{
switch
(
type
)
{
switch
(
type
)
{
default:
case
GS_BLEND_ZERO
:
return
GL_ZERO
;
case
GS_BLEND_ZERO
:
return
GL_ZERO
;
case
GS_BLEND_ONE
:
return
GL_ONE
;
case
GS_BLEND_ONE
:
return
GL_ONE
;
case
GS_BLEND_SRCCOLOR
:
return
GL_SRC_COLOR
;
case
GS_BLEND_SRCCOLOR
:
return
GL_SRC_COLOR
;
...
@@ -170,83 +180,90 @@ static inline GLenum convert_gs_blend_type(enum gs_blend_type type)
...
@@ -170,83 +180,90 @@ static inline GLenum convert_gs_blend_type(enum gs_blend_type type)
case
GS_BLEND_INVDSTALPHA
:
return
GL_ONE_MINUS_DST_ALPHA
;
case
GS_BLEND_INVDSTALPHA
:
return
GL_ONE_MINUS_DST_ALPHA
;
case
GS_BLEND_SRCALPHASAT
:
return
GL_SRC_ALPHA_SATURATE
;
case
GS_BLEND_SRCALPHASAT
:
return
GL_SRC_ALPHA_SATURATE
;
}
}
return
GL_ONE
;
}
}
static
inline
GLenum
convert_shader_type
(
enum
shader_type
type
)
static
inline
GLenum
convert_shader_type
(
enum
shader_type
type
)
{
{
switch
(
type
)
{
switch
(
type
)
{
default:
case
SHADER_VERTEX
:
return
GL_VERTEX_SHADER
;
case
SHADER_VERTEX
:
return
GL_VERTEX_SHADER
;
case
SHADER_PIXEL
:
return
GL_FRAGMENT_SHADER
;
case
SHADER_PIXEL
:
return
GL_FRAGMENT_SHADER
;
}
}
return
GL_VERTEX_SHADER
;
}
}
static
inline
void
convert_filter
(
enum
gs_sample_filter
filter
,
static
inline
void
convert_filter
(
enum
gs_sample_filter
filter
,
GLint
*
min_filter
,
GLint
*
mag_filter
)
GLint
*
min_filter
,
GLint
*
mag_filter
)
{
{
switch
(
filter
)
{
switch
(
filter
)
{
default:
case
GS_FILTER_POINT
:
case
GS_FILTER_POINT
:
*
min_filter
=
GL_NEAREST_MIPMAP_NEAREST
;
*
min_filter
=
GL_NEAREST_MIPMAP_NEAREST
;
*
mag_filter
=
GL_NEAREST
;
*
mag_filter
=
GL_NEAREST
;
break
;
return
;
case
GS_FILTER_LINEAR
:
case
GS_FILTER_LINEAR
:
*
min_filter
=
GL_LINEAR_MIPMAP_LINEAR
;
*
min_filter
=
GL_LINEAR_MIPMAP_LINEAR
;
*
mag_filter
=
GL_LINEAR
;
*
mag_filter
=
GL_LINEAR
;
break
;
return
;
case
GS_FILTER_MIN_MAG_POINT_MIP_LINEAR
:
case
GS_FILTER_MIN_MAG_POINT_MIP_LINEAR
:
*
min_filter
=
GL_NEAREST_MIPMAP_LINEAR
;
*
min_filter
=
GL_NEAREST_MIPMAP_LINEAR
;
*
mag_filter
=
GL_NEAREST
;
*
mag_filter
=
GL_NEAREST
;
break
;
return
;
case
GS_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT
:
case
GS_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT
:
*
min_filter
=
GL_NEAREST_MIPMAP_NEAREST
;
*
min_filter
=
GL_NEAREST_MIPMAP_NEAREST
;
*
mag_filter
=
GL_LINEAR
;
*
mag_filter
=
GL_LINEAR
;
break
;
return
;
case
GS_FILTER_MIN_POINT_MAG_MIP_LINEAR
:
case
GS_FILTER_MIN_POINT_MAG_MIP_LINEAR
:
*
min_filter
=
GL_NEAREST_MIPMAP_LINEAR
;
*
min_filter
=
GL_NEAREST_MIPMAP_LINEAR
;
*
mag_filter
=
GL_LINEAR
;
*
mag_filter
=
GL_LINEAR
;
break
;
return
;
case
GS_FILTER_MIN_LINEAR_MAG_MIP_POINT
:
case
GS_FILTER_MIN_LINEAR_MAG_MIP_POINT
:
*
min_filter
=
GL_LINEAR_MIPMAP_NEAREST
;
*
min_filter
=
GL_LINEAR_MIPMAP_NEAREST
;
*
mag_filter
=
GL_NEAREST
;
*
mag_filter
=
GL_NEAREST
;
break
;
return
;
case
GS_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR
:
case
GS_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR
:
*
min_filter
=
GL_LINEAR_MIPMAP_LINEAR
;
*
min_filter
=
GL_LINEAR_MIPMAP_LINEAR
;
*
mag_filter
=
GL_NEAREST
;
*
mag_filter
=
GL_NEAREST
;
break
;
return
;
case
GS_FILTER_MIN_MAG_LINEAR_MIP_POINT
:
case
GS_FILTER_MIN_MAG_LINEAR_MIP_POINT
:
*
min_filter
=
GL_LINEAR_MIPMAP_NEAREST
;
*
min_filter
=
GL_LINEAR_MIPMAP_NEAREST
;
*
mag_filter
=
GL_LINEAR
;
*
mag_filter
=
GL_LINEAR
;
break
;
return
;
case
GS_FILTER_ANISOTROPIC
:
case
GS_FILTER_ANISOTROPIC
:
*
min_filter
=
GL_LINEAR_MIPMAP_LINEAR
;
*
min_filter
=
GL_LINEAR_MIPMAP_LINEAR
;
*
mag_filter
=
GL_LINEAR
;
*
mag_filter
=
GL_LINEAR
;
break
;
return
;
}
}
*
min_filter
=
GL_NEAREST_MIPMAP_NEAREST
;
*
mag_filter
=
GL_NEAREST
;
}
}
static
inline
GLint
convert_address_mode
(
enum
gs_address_mode
mode
)
static
inline
GLint
convert_address_mode
(
enum
gs_address_mode
mode
)
{
{
switch
(
mode
)
{
switch
(
mode
)
{
default:
case
GS_ADDRESS_WRAP
:
return
GL_REPEAT
;
case
GS_ADDRESS_WRAP
:
return
GL_REPEAT
;
case
GS_ADDRESS_CLAMP
:
return
GL_CLAMP_TO_EDGE
;
case
GS_ADDRESS_CLAMP
:
return
GL_CLAMP_TO_EDGE
;
case
GS_ADDRESS_MIRROR
:
return
GL_MIRRORED_REPEAT
;
case
GS_ADDRESS_MIRROR
:
return
GL_MIRRORED_REPEAT
;
case
GS_ADDRESS_BORDER
:
return
GL_CLAMP_TO_BORDER
;
case
GS_ADDRESS_BORDER
:
return
GL_CLAMP_TO_BORDER
;
case
GS_ADDRESS_MIRRORONCE
:
return
GL_MIRROR_CLAMP_EXT
;
case
GS_ADDRESS_MIRRORONCE
:
return
GL_MIRROR_CLAMP_EXT
;
}
}
return
GL_REPEAT
;
}
}
static
inline
GLenum
convert_gs_topology
(
enum
gs_draw_mode
mode
)
static
inline
GLenum
convert_gs_topology
(
enum
gs_draw_mode
mode
)
{
{
switch
(
mode
)
{
switch
(
mode
)
{
default:
case
GS_POINTS
:
return
GL_POINTS
;
case
GS_POINTS
:
return
GL_POINTS
;
case
GS_LINES
:
return
GL_LINES
;
case
GS_LINES
:
return
GL_LINES
;
case
GS_LINESTRIP
:
return
GL_LINE_STRIP
;
case
GS_LINESTRIP
:
return
GL_LINE_STRIP
;
case
GS_TRIS
:
return
GL_TRIANGLES
;
case
GS_TRIS
:
return
GL_TRIANGLES
;
case
GS_TRISTRIP
:
return
GL_TRIANGLE_STRIP
;
case
GS_TRISTRIP
:
return
GL_TRIANGLE_STRIP
;
}
}
return
GL_POINTS
;
}
}
extern
void
convert_sampler_info
(
struct
gs_sampler_state
*
sampler
,
extern
void
convert_sampler_info
(
struct
gs_sampler_state
*
sampler
,
...
...
libobs-opengl/gl-windows.c
浏览文件 @
bb329b92
...
@@ -39,7 +39,7 @@ struct gl_platform {
...
@@ -39,7 +39,7 @@ struct gl_platform {
/* For now, only support basic 32bit formats for graphics output. */
/* For now, only support basic 32bit formats for graphics output. */
static
inline
int
get_color_format_bits
(
enum
gs_color_format
format
)
static
inline
int
get_color_format_bits
(
enum
gs_color_format
format
)
{
{
switch
(
format
)
{
switch
(
(
uint32_t
)
format
)
{
case
GS_RGBA
:
case
GS_RGBA
:
return
32
;
return
32
;
default:
default:
...
@@ -49,7 +49,7 @@ static inline int get_color_format_bits(enum gs_color_format format)
...
@@ -49,7 +49,7 @@ static inline int get_color_format_bits(enum gs_color_format format)
static
inline
int
get_depth_format_bits
(
enum
gs_zstencil_format
zsformat
)
static
inline
int
get_depth_format_bits
(
enum
gs_zstencil_format
zsformat
)
{
{
switch
(
zsformat
)
{
switch
(
(
uint32_t
)
zsformat
)
{
case
GS_Z16
:
case
GS_Z16
:
return
16
;
return
16
;
case
GS_Z24_S8
:
case
GS_Z24_S8
:
...
@@ -61,7 +61,7 @@ static inline int get_depth_format_bits(enum gs_zstencil_format zsformat)
...
@@ -61,7 +61,7 @@ static inline int get_depth_format_bits(enum gs_zstencil_format zsformat)
static
inline
int
get_stencil_format_bits
(
enum
gs_zstencil_format
zsformat
)
static
inline
int
get_stencil_format_bits
(
enum
gs_zstencil_format
zsformat
)
{
{
switch
(
zsformat
)
{
switch
(
(
uint32_t
)
zsformat
)
{
case
GS_Z24_S8
:
case
GS_Z24_S8
:
return
8
;
return
8
;
default:
default:
...
...
libobs-opengl/gl-zstencil.c
浏览文件 @
bb329b92
...
@@ -42,8 +42,10 @@ static inline GLenum get_attachment(enum gs_zstencil_format format)
...
@@ -42,8 +42,10 @@ static inline GLenum get_attachment(enum gs_zstencil_format format)
case
GS_Z24_S8
:
return
GL_DEPTH_STENCIL_ATTACHMENT
;
case
GS_Z24_S8
:
return
GL_DEPTH_STENCIL_ATTACHMENT
;
case
GS_Z32F
:
return
GL_DEPTH_ATTACHMENT
;
case
GS_Z32F
:
return
GL_DEPTH_ATTACHMENT
;
case
GS_Z32F_S8X24
:
return
GL_DEPTH_STENCIL_ATTACHMENT
;
case
GS_Z32F_S8X24
:
return
GL_DEPTH_STENCIL_ATTACHMENT
;
default:
return
0
;
case
GS_ZS_NONE
:
return
0
;
}
}
return
0
;
}
}
zstencil_t
device_create_zstencil
(
device_t
device
,
uint32_t
width
,
zstencil_t
device_create_zstencil
(
device_t
device
,
uint32_t
width
,
...
...
libobs/graphics/effect-parser.c
浏览文件 @
bb329b92
...
@@ -1351,8 +1351,8 @@ static inline bool ep_compile_pass_shader(struct effect_parser *ep,
...
@@ -1351,8 +1351,8 @@ static inline bool ep_compile_pass_shader(struct effect_parser *ep,
dstr_cat
(
&
location
,
" (Vertex "
);
dstr_cat
(
&
location
,
" (Vertex "
);
else
if
(
type
==
SHADER_PIXEL
)
else
if
(
type
==
SHADER_PIXEL
)
dstr_cat
(
&
location
,
" (Pixel "
);
dstr_cat
(
&
location
,
" (Pixel "
);
else
if
(
type
==
SHADER_GEOMETRY
)
/*
else if (type == SHADER_GEOMETRY)
dstr_cat
(
&
location
,
" (Geometry "
);
dstr_cat(&location, " (Geometry ");
*/
dstr_catf
(
&
location
,
"shader, technique %s, pass %u)"
,
tech
->
name
,
dstr_catf
(
&
location
,
"shader, technique %s, pass %u)"
,
tech
->
name
,
pass_idx
);
pass_idx
);
...
...
libobs/graphics/graphics.h
浏览文件 @
bb329b92
...
@@ -287,7 +287,6 @@ struct shader_param_info {
...
@@ -287,7 +287,6 @@ struct shader_param_info {
enum
shader_type
{
enum
shader_type
{
SHADER_VERTEX
,
SHADER_VERTEX
,
SHADER_PIXEL
,
SHADER_PIXEL
,
SHADER_GEOMETRY
};
};
EXPORT
void
shader_destroy
(
shader_t
shader
);
EXPORT
void
shader_destroy
(
shader_t
shader
);
...
@@ -681,9 +680,10 @@ static inline uint32_t gs_get_format_bpp(enum gs_color_format format)
...
@@ -681,9 +680,10 @@ static inline uint32_t gs_get_format_bpp(enum gs_color_format format)
case
GS_DXT1
:
return
4
;
case
GS_DXT1
:
return
4
;
case
GS_DXT3
:
return
8
;
case
GS_DXT3
:
return
8
;
case
GS_DXT5
:
return
8
;
case
GS_DXT5
:
return
8
;
default:
case
GS_UNKNOWN
:
return
0
;
case
GS_UNKNOWN
:
return
0
;
}
}
return
0
;
}
}
static
inline
bool
gs_is_compressed_format
(
enum
gs_color_format
format
)
static
inline
bool
gs_is_compressed_format
(
enum
gs_color_format
format
)
...
...
libobs/media-io/audio-io.h
浏览文件 @
bb329b92
...
@@ -86,9 +86,10 @@ static inline uint32_t get_audio_channels(enum speaker_setup speakers)
...
@@ -86,9 +86,10 @@ static inline uint32_t get_audio_channels(enum speaker_setup speakers)
case
SPEAKERS_5POINT1_SURROUND
:
return
6
;
case
SPEAKERS_5POINT1_SURROUND
:
return
6
;
case
SPEAKERS_7POINT1
:
return
8
;
case
SPEAKERS_7POINT1
:
return
8
;
case
SPEAKERS_7POINT1_SURROUND
:
return
8
;
case
SPEAKERS_7POINT1_SURROUND
:
return
8
;
default:
case
SPEAKERS_UNKNOWN
:
return
0
;
case
SPEAKERS_UNKNOWN
:
return
0
;
}
}
return
0
;
}
}
static
inline
size_t
get_audio_bytes_per_channel
(
enum
audio_type
type
)
static
inline
size_t
get_audio_bytes_per_channel
(
enum
audio_type
type
)
...
@@ -99,9 +100,10 @@ static inline size_t get_audio_bytes_per_channel(enum audio_type type)
...
@@ -99,9 +100,10 @@ static inline size_t get_audio_bytes_per_channel(enum audio_type type)
case
AUDIO_FORMAT_24BIT
:
return
3
;
case
AUDIO_FORMAT_24BIT
:
return
3
;
case
AUDIO_FORMAT_FLOAT
:
case
AUDIO_FORMAT_FLOAT
:
case
AUDIO_FORMAT_32BIT
:
return
4
;
case
AUDIO_FORMAT_32BIT
:
return
4
;
default:
case
AUDIO_FORMAT_UNKNOWN
:
return
0
;
case
AUDIO_FORMAT_UNKNOWN
:
return
0
;
}
}
return
0
;
}
}
static
inline
size_t
get_audio_size
(
enum
audio_type
type
,
static
inline
size_t
get_audio_size
(
enum
audio_type
type
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录