Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
3432901b
Commit
3432901b
authored
Jul 08, 2012
by
Ilkka Ollakka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opengl: restore npot check for really old cards
parent
d7f66967
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
modules/video_output/opengl.c
modules/video_output/opengl.c
+19
-2
No files found.
modules/video_output/opengl.c
View file @
3432901b
...
...
@@ -174,6 +174,9 @@ struct vout_display_opengl_t {
PFNGLACTIVETEXTUREPROC
ActiveTexture
;
PFNGLCLIENTACTIVETEXTUREPROC
ClientActiveTexture
;
bool
use_multitexture
;
/* Non-power-of-2 texture size support */
bool
supports_npot
;
};
static
inline
int
GetAlignedSize
(
unsigned
size
)
...
...
@@ -240,6 +243,7 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
return
NULL
;
}
const
char
*
extensions
=
(
const
char
*
)
glGetString
(
GL_EXTENSIONS
);
#if !USE_OPENGL_ES
const
unsigned
char
*
ogl_version
=
glGetString
(
GL_VERSION
);
bool
supports_shaders
=
strverscmp
((
const
char
*
)
ogl_version
,
"2.0"
)
>=
0
;
...
...
@@ -349,6 +353,8 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
vgl
->
chroma
=
vlc_fourcc_GetChromaDescription
(
vgl
->
fmt
.
i_chroma
);
vgl
->
use_multitexture
=
vgl
->
chroma
->
plane_count
>
1
;
vgl
->
supports_npot
=
HasExtension
(
extensions
,
"GL_ARB_texture_non_power_of_two"
)
||
HasExtension
(
extensions
,
"GL_APPLE_texture_2D_limited_npot"
);
if
(
!
vgl
->
CreateShader
||
!
vgl
->
ShaderSource
||
!
vgl
->
CreateProgram
)
{
...
...
@@ -362,8 +368,14 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
for
(
unsigned
j
=
0
;
j
<
vgl
->
chroma
->
plane_count
;
j
++
)
{
int
w
=
vgl
->
fmt
.
i_width
*
vgl
->
chroma
->
p
[
j
].
w
.
num
/
vgl
->
chroma
->
p
[
j
].
w
.
den
;
int
h
=
vgl
->
fmt
.
i_height
*
vgl
->
chroma
->
p
[
j
].
h
.
num
/
vgl
->
chroma
->
p
[
j
].
h
.
den
;
vgl
->
tex_width
[
j
]
=
w
;
vgl
->
tex_height
[
j
]
=
h
;
if
(
vgl
->
supports_npot
)
{
vgl
->
tex_width
[
j
]
=
w
;
vgl
->
tex_height
[
j
]
=
h
;
}
else
{
vgl
->
tex_width
[
j
]
=
GetAlignedSize
(
w
);
vgl
->
tex_height
[
j
]
=
GetAlignedSize
(
h
);
}
}
/* Build fragment program if needed */
...
...
@@ -705,6 +717,11 @@ int vout_display_opengl_Prepare(vout_display_opengl_t *vgl,
glr
->
type
=
GL_UNSIGNED_BYTE
;
glr
->
width
=
r
->
fmt
.
i_visible_width
;
glr
->
height
=
r
->
fmt
.
i_visible_height
;
if
(
!
vgl
->
supports_npot
)
{
glr
->
width
=
GetAlignedSize
(
glr
->
width
);
glr
->
height
=
GetAlignedSize
(
glr
->
height
);
}
glr
->
alpha
=
(
float
)
subpicture
->
i_alpha
*
r
->
i_alpha
/
255
/
255
;
glr
->
left
=
2
.
0
*
(
r
->
i_x
)
/
subpicture
->
i_original_picture_width
-
1
.
0
;
glr
->
top
=
-
2
.
0
*
(
r
->
i_y
)
/
subpicture
->
i_original_picture_height
+
1
.
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment