Compare commits
94 Commits
mesa-19.2.
...
mesa-19.2.
Author | SHA1 | Date | |
---|---|---|---|
|
c5f5ce1e37 | ||
|
db2797251d | ||
|
56f0434232 | ||
|
ad56aaef4f | ||
|
35b900310b | ||
|
cb0215a6fb | ||
|
425fbe2902 | ||
|
62f9ba1bf2 | ||
|
306e82acb6 | ||
|
ef906b4636 | ||
|
e958b35a40 | ||
|
16af8e9772 | ||
|
01e31f8cab | ||
|
4d6fcddc65 | ||
|
5694c20188 | ||
|
9a929cfef2 | ||
|
ae4f569232 | ||
|
9d13289ad4 | ||
|
9b49a4ea12 | ||
|
55a04df479 | ||
|
45aa00da9f | ||
|
a1e6d1fb30 | ||
|
2380173433 | ||
|
45ebe99a88 | ||
|
c1ca1602dd | ||
|
91960ae890 | ||
|
59e56bf05d | ||
|
6f30614d73 | ||
|
b87edab8a2 | ||
|
8355658fa8 | ||
|
089aa74d57 | ||
|
7f0d0ab83d | ||
|
7b70f2ec47 | ||
|
f446e56d30 | ||
|
767965b6fa | ||
|
3deb4fa226 | ||
|
0056943e69 | ||
|
d14d70de2f | ||
|
0beee2f723 | ||
|
c48dc6ad5f | ||
|
03df69d6a1 | ||
|
47bc45ba1a | ||
|
aa89c0a2bd | ||
|
3e15620451 | ||
|
877417918f | ||
|
e19dc53aae | ||
|
a06f8341d8 | ||
|
4f38287970 | ||
|
a4348e9594 | ||
|
61b3371acc | ||
|
5a0361ce09 | ||
|
06b8b29a0a | ||
|
9052318565 | ||
|
85193e808a | ||
|
34d738ff2e | ||
|
c289ac9a22 | ||
|
bad5e64da8 | ||
|
52cf623955 | ||
|
78a05b8cbb | ||
|
676471a092 | ||
|
0b97377f58 | ||
|
33eecbcc9b | ||
|
2bbe4c69c8 | ||
|
db56bc2c52 | ||
|
4169d86913 | ||
|
680e18c159 | ||
|
d4dab05a09 | ||
|
f5cccfe0e6 | ||
|
0a2285b1d4 | ||
|
8f95245068 | ||
|
a413b55157 | ||
|
5a027b6201 | ||
|
769a18d1f3 | ||
|
cb2649768f | ||
|
e6edeebd15 | ||
|
2dbf10ba3d | ||
|
daeb959c91 | ||
|
db1ed17ac4 | ||
|
dc0995669d | ||
|
434ab094c0 | ||
|
e35a7a0238 | ||
|
95d87a897b | ||
|
c4b70fef71 | ||
|
bc6cc94d5a | ||
|
6273d4d4ed | ||
|
960ab3e465 | ||
|
41b57b8b73 | ||
|
109137ee7b | ||
|
f4faf5cbd7 | ||
|
b29682c290 | ||
|
1b67e47c0c | ||
|
0c56cb50c7 | ||
|
40d592473e | ||
|
2947b89369 |
@@ -16,3 +16,9 @@ dcc0e23438f3e5929c2ef74d57e8207be25ecb41
|
||||
# This doesn't apply cleanly, and no one really cares about this file on stable
|
||||
# branches anyway.
|
||||
bcd9224728dcb8d8fe4bcddc4bd9b2c36fcfe9dd
|
||||
|
||||
# De-nominated by its author due to alternate fix not being backported
|
||||
43041627445540afda1a05d11861935963660344
|
||||
|
||||
# This is immediately reverted, so just don't apply
|
||||
19546108d3dd5541a189e36df4ea83b3f519e48f
|
||||
|
0
bin/__init__.py
Normal file
0
bin/__init__.py
Normal file
@@ -1,35 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This script is used to generate the list of fixed bugs that
|
||||
# appears in the release notes files, with HTML formatting.
|
||||
#
|
||||
# Note: This script could take a while until all details have
|
||||
# been fetched from bugzilla.
|
||||
#
|
||||
# Usage examples:
|
||||
#
|
||||
# $ bin/bugzilla_mesa.sh mesa-9.0.2..mesa-9.0.3
|
||||
# $ bin/bugzilla_mesa.sh mesa-9.0.2..mesa-9.0.3 > bugfixes
|
||||
# $ bin/bugzilla_mesa.sh mesa-9.0.2..mesa-9.0.3 | tee bugfixes
|
||||
|
||||
|
||||
# regex pattern: trim before bug number
|
||||
trim_before='s/.*show_bug.cgi?id=\([0-9]*\).*/\1/'
|
||||
|
||||
# regex pattern: reconstruct the url
|
||||
use_after='s,^,https://bugs.freedesktop.org/show_bug.cgi?id=,'
|
||||
|
||||
echo "<ul>"
|
||||
echo ""
|
||||
|
||||
# extract fdo urls from commit log
|
||||
git log --pretty=medium $* | grep 'bugs.freedesktop.org/show_bug' | sed -e $trim_before | sort -n -u | sed -e $use_after |\
|
||||
while read url
|
||||
do
|
||||
id=$(echo $url | cut -d'=' -f2)
|
||||
summary=$(wget --quiet -O - $url | grep -e '<title>.*</title>' | sed -e 's/ *<title>[0-9]\+ – \(.*\)<\/title>/\1/')
|
||||
echo "<li><a href=\"$url\">Bug $id</a> - $summary</li>"
|
||||
echo ""
|
||||
done
|
||||
|
||||
echo "</ul>"
|
264
bin/gen_release_notes.py
Executable file
264
bin/gen_release_notes.py
Executable file
@@ -0,0 +1,264 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright © 2019 Intel Corporation
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
"""Generates release notes for a given version of mesa."""
|
||||
|
||||
import asyncio
|
||||
import datetime
|
||||
import os
|
||||
import pathlib
|
||||
import textwrap
|
||||
import typing
|
||||
import urllib.parse
|
||||
|
||||
import aiohttp
|
||||
from mako.template import Template
|
||||
from mako import exceptions
|
||||
|
||||
|
||||
CURRENT_GL_VERSION = '4.5'
|
||||
CURRENT_VK_VERSION = '1.1'
|
||||
|
||||
TEMPLATE = Template(textwrap.dedent("""\
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Mesa Release Notes</title>
|
||||
<link rel="stylesheet" type="text/css" href="../mesa.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="header">
|
||||
<h1>The Mesa 3D Graphics Library</h1>
|
||||
</div>
|
||||
|
||||
<iframe src="../contents.html"></iframe>
|
||||
<div class="content">
|
||||
|
||||
<h1>Mesa ${next_version} Release Notes / ${today}</h1>
|
||||
|
||||
<p>
|
||||
%if bugfix:
|
||||
Mesa ${next_version} is a new development release. People who are concerned
|
||||
with stability and reliability should stick with a previous release or
|
||||
wait for Mesa ${version[:-1]}1.
|
||||
%else:
|
||||
Mesa ${next_version} is a bug fix release which fixes bugs found since the ${version} release.
|
||||
%endif
|
||||
</p>
|
||||
<p>
|
||||
Mesa ${next_version} implements the OpenGL ${gl_version} API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL ${gl_version}. OpenGL
|
||||
${gl_version} is <strong>only</strong> available if requested at context creation.
|
||||
Compatibility contexts may report a lower version depending on each driver.
|
||||
</p>
|
||||
<p>
|
||||
Mesa ${next_version} implements the Vulkan ${vk_version} API, but the version reported by
|
||||
the apiVersion property of the VkPhysicalDeviceProperties struct
|
||||
depends on the particular driver being used.
|
||||
</p>
|
||||
|
||||
<h2>SHA256 checksum</h2>
|
||||
<pre>
|
||||
TBD.
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>New features</h2>
|
||||
|
||||
<ul>
|
||||
%for f in features:
|
||||
<li>${f}</li>
|
||||
%endfor
|
||||
</ul>
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
|
||||
<ul>
|
||||
%for b in bugs:
|
||||
<li>${b}</li>
|
||||
%endfor
|
||||
</ul>
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<ul>
|
||||
%for c, author in changes:
|
||||
%if author:
|
||||
<p>${c}</p>
|
||||
%else:
|
||||
<li>${c}</li>
|
||||
%endif
|
||||
%endfor
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
"""))
|
||||
|
||||
|
||||
async def gather_commits(version: str) -> str:
|
||||
p = await asyncio.create_subprocess_exec(
|
||||
'git', 'log', f'mesa-{version}..', '--grep', r'Closes: \(https\|#\).*',
|
||||
stdout=asyncio.subprocess.PIPE)
|
||||
out, _ = await p.communicate()
|
||||
assert p.returncode == 0, f"git log didn't work: {version}"
|
||||
return out.decode().strip()
|
||||
|
||||
|
||||
async def gather_bugs(version: str) -> typing.List[str]:
|
||||
commits = await gather_commits(version)
|
||||
|
||||
issues: typing.List[str] = []
|
||||
for commit in commits.split('\n'):
|
||||
sha, message = commit.split(maxsplit=1)
|
||||
p = await asyncio.create_subprocess_exec(
|
||||
'git', 'log', '--max-count', '1', r'--format=%b', sha,
|
||||
stdout=asyncio.subprocess.PIPE)
|
||||
_out, _ = await p.communicate()
|
||||
out = _out.decode().split('\n')
|
||||
for line in reversed(out):
|
||||
if line.startswith('Closes:'):
|
||||
bug = line.lstrip('Closes:').strip()
|
||||
break
|
||||
else:
|
||||
raise Exception('No closes found?')
|
||||
if bug.startswith('h'):
|
||||
# This means we have a bug in the form "Closes: https://..."
|
||||
issues.append(os.path.basename(urllib.parse.urlparse(bug).path))
|
||||
else:
|
||||
issues.append(bug)
|
||||
|
||||
loop = asyncio.get_event_loop()
|
||||
async with aiohttp.ClientSession(loop=loop) as session:
|
||||
results = await asyncio.gather(*[get_bug(session, i) for i in issues])
|
||||
typing.cast(typing.Tuple[str, ...], results)
|
||||
return list(results)
|
||||
|
||||
|
||||
async def get_bug(session: aiohttp.ClientSession, bug_id: str) -> str:
|
||||
"""Query gitlab to get the name of the issue that was closed."""
|
||||
# Mesa's gitlab id is 176,
|
||||
url = 'https://gitlab.freedesktop.org/api/v4/projects/176/issues'
|
||||
params = {'iids[]': bug_id}
|
||||
async with session.get(url, params=params) as response:
|
||||
content = await response.json()
|
||||
return content[0]['title']
|
||||
|
||||
|
||||
async def get_shortlog(version: str) -> str:
|
||||
"""Call git shortlog."""
|
||||
p = await asyncio.create_subprocess_exec('git', 'shortlog', f'mesa-{version}..',
|
||||
stdout=asyncio.subprocess.PIPE)
|
||||
out, _ = await p.communicate()
|
||||
assert p.returncode == 0, 'error getting shortlog'
|
||||
assert out is not None, 'just for mypy'
|
||||
return out.decode()
|
||||
|
||||
|
||||
def walk_shortlog(log: str) -> typing.Generator[typing.Tuple[str, bool], None, None]:
|
||||
for l in log.split('\n'):
|
||||
if l.startswith(' '): # this means we have a patch description
|
||||
yield l, False
|
||||
else:
|
||||
yield l, True
|
||||
|
||||
|
||||
def calculate_next_version(version: str, is_point: bool) -> str:
|
||||
"""Calculate the version about to be released."""
|
||||
if '-' in version:
|
||||
version = version.split('-')[0]
|
||||
if is_point:
|
||||
base = version.split('.')
|
||||
base[2] = str(int(base[2]) + 1)
|
||||
return '.'.join(base)
|
||||
return version
|
||||
|
||||
|
||||
def calculate_previous_version(version: str, is_point: bool) -> str:
|
||||
"""Calculate the previous version to compare to.
|
||||
|
||||
In the case of -rc to final that verison is the previous .0 release,
|
||||
(19.3.0 in the case of 20.0.0, for example). for point releases that is
|
||||
the last point release. This value will be the same as the input value
|
||||
for a point release, but different for a major release.
|
||||
"""
|
||||
if '-' in version:
|
||||
version = version.split('-')[0]
|
||||
if is_point:
|
||||
return version
|
||||
base = version.split('.')
|
||||
if base[1] == '0':
|
||||
base[0] = str(int(base[0]) - 1)
|
||||
base[1] = '3'
|
||||
else:
|
||||
base[1] = str(int(base[1]) - 1)
|
||||
return '.'.join(base)
|
||||
|
||||
|
||||
def get_features() -> typing.Generator[str, None, None]:
|
||||
p = pathlib.Path(__file__).parent.parent / 'docs' / 'relnotes' / 'new_features.txt'
|
||||
if p.exists():
|
||||
with p.open('rt') as f:
|
||||
for line in f:
|
||||
yield line
|
||||
|
||||
|
||||
async def main() -> None:
|
||||
v = pathlib.Path(__file__).parent.parent / 'VERSION'
|
||||
with v.open('rt') as f:
|
||||
raw_version = f.read().strip()
|
||||
is_point_release = '-rc' not in raw_version
|
||||
assert '-devel' not in raw_version, 'Do not run this script on -devel'
|
||||
version = raw_version.split('-')[0]
|
||||
previous_version = calculate_previous_version(version, is_point_release)
|
||||
next_version = calculate_next_version(version, is_point_release)
|
||||
|
||||
shortlog, bugs = await asyncio.gather(
|
||||
get_shortlog(previous_version),
|
||||
gather_bugs(previous_version),
|
||||
)
|
||||
|
||||
final = pathlib.Path(__file__).parent.parent / 'docs' / 'relnotes' / f'{next_version}.html'
|
||||
with final.open('wt') as f:
|
||||
try:
|
||||
f.write(TEMPLATE.render(
|
||||
bugfix=is_point_release,
|
||||
bugs=bugs,
|
||||
changes=walk_shortlog(shortlog),
|
||||
features=get_features(),
|
||||
gl_version=CURRENT_GL_VERSION,
|
||||
next_version=next_version,
|
||||
today=datetime.date.today(),
|
||||
version=previous_version,
|
||||
vk_version=CURRENT_VK_VERSION,
|
||||
))
|
||||
except:
|
||||
print(exceptions.text_error_template().render())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
loop = asyncio.get_event_loop()
|
||||
loop.run_until_complete(main())
|
62
bin/gen_release_notes_test.py
Normal file
62
bin/gen_release_notes_test.py
Normal file
@@ -0,0 +1,62 @@
|
||||
# Copyright © 2019 Intel Corporation
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
|
||||
from .gen_release_notes import *
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'current, is_point, expected',
|
||||
[
|
||||
('19.2.0', True, '19.2.1'),
|
||||
('19.3.6', True, '19.3.7'),
|
||||
('20.0.0-rc4', False, '20.0.0'),
|
||||
])
|
||||
def test_next_version(current: str, is_point: bool, expected: str) -> None:
|
||||
assert calculate_next_version(current, is_point) == expected
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'current, is_point, expected',
|
||||
[
|
||||
('19.3.6', True, '19.3.6'),
|
||||
('20.0.0-rc4', False, '19.3.0'),
|
||||
])
|
||||
def test_previous_version(current: str, is_point: bool, expected: str) -> None:
|
||||
assert calculate_previous_version(current, is_point) == expected
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_get_shortlog():
|
||||
# Certainly not perfect, but it's something
|
||||
version = '19.2.0'
|
||||
out = await get_shortlog(version)
|
||||
assert out
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_gather_commits():
|
||||
# Certainly not perfect, but it's something
|
||||
version = '19.2.0'
|
||||
out = await gather_commits(version)
|
||||
assert out
|
122
bin/post_version.py
Executable file
122
bin/post_version.py
Executable file
@@ -0,0 +1,122 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright © 2019 Intel Corporation
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
"""Update the main page, release notes, and calendar."""
|
||||
|
||||
import calendar
|
||||
import datetime
|
||||
import pathlib
|
||||
from lxml import (
|
||||
etree,
|
||||
html,
|
||||
)
|
||||
|
||||
|
||||
def calculate_previous_version(version: str, is_point: bool) -> str:
|
||||
"""Calculate the previous version to compare to.
|
||||
|
||||
In the case of -rc to final that verison is the previous .0 release,
|
||||
(19.3.0 in the case of 20.0.0, for example). for point releases that is
|
||||
the last point release. This value will be the same as the input value
|
||||
for a poiont release, but different for a major release.
|
||||
"""
|
||||
if '-' in version:
|
||||
version = version.split('-')[0]
|
||||
if is_point:
|
||||
return version
|
||||
base = version.split('.')
|
||||
if base[1] == '0':
|
||||
base[0] = str(int(base[0]) - 1)
|
||||
base[1] = '3'
|
||||
else:
|
||||
base[1] = str(int(base[1]) - 1)
|
||||
return '.'.join(base)
|
||||
|
||||
|
||||
def get_version() -> str:
|
||||
v = pathlib.Path(__file__).parent.parent / 'VERSION'
|
||||
with v.open('rt') as f:
|
||||
raw_version = f.read().strip()
|
||||
return raw_version.split('-')[0]
|
||||
|
||||
|
||||
def is_point_release() -> bool:
|
||||
v = pathlib.Path(__file__).parent.parent / 'VERSION'
|
||||
with v.open('rt') as f:
|
||||
raw_version = f.read().strip()
|
||||
return '-rc' not in raw_version
|
||||
|
||||
|
||||
def update_index(is_point: bool, version: str, previous_version: str) -> None:
|
||||
p = pathlib.Path(__file__).parent.parent / 'docs' / 'index.html'
|
||||
with p.open('rt') as f:
|
||||
tree = html.parse(f)
|
||||
|
||||
news = tree.xpath('.//h1')[0]
|
||||
|
||||
date = datetime.date.today()
|
||||
month = calendar.month_name[date.month]
|
||||
header = etree.Element('h2')
|
||||
header.text=f"{month} {date.day}, {date.year}"
|
||||
|
||||
body = etree.Element('p')
|
||||
a = etree.SubElement(body, 'a', attrib={'href': f'relnotes/{previous_version}'})
|
||||
a.text = f"Mesa {previous_version}"
|
||||
if is_point:
|
||||
a.tail = " is released. This is a bug fix release."
|
||||
else:
|
||||
a.tail = (" is released. This is a new development release. "
|
||||
"See the release notes for mor information about this release.")
|
||||
|
||||
root = news.getparent()
|
||||
index = root.index(news) + 1
|
||||
root.insert(index, body)
|
||||
root.insert(index, header)
|
||||
|
||||
tree.write(p.as_posix(), method='html')
|
||||
|
||||
|
||||
def update_release_notes(previous_version: str) -> None:
|
||||
p = pathlib.Path(__file__).parent.parent / 'docs' / 'relnotes.html'
|
||||
with p.open('rt') as f:
|
||||
tree = html.parse(f)
|
||||
|
||||
li = etree.Element('li')
|
||||
a = etree.SubElement(li, 'a', href=f'relnotes/{previous_version}')
|
||||
a.text = f'{previous_version} release notes'
|
||||
|
||||
ul = tree.xpath('.//ul')[0]
|
||||
ul.insert(0, li)
|
||||
|
||||
tree.write(p.as_posix(), method='html')
|
||||
|
||||
|
||||
def main() -> None:
|
||||
is_point = is_point_release()
|
||||
version = get_version()
|
||||
previous_version = calculate_previous_version(version, is_point)
|
||||
|
||||
update_index(is_point, version, previous_version)
|
||||
update_release_notes(previous_version)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
@@ -1,29 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This script is used to generate the list of changes that
|
||||
# appears in the release notes files, with HTML formatting.
|
||||
#
|
||||
# Usage examples:
|
||||
#
|
||||
# $ bin/shortlog_mesa.sh mesa-9.0.2..mesa-9.0.3
|
||||
# $ bin/shortlog_mesa.sh mesa-9.0.2..mesa-9.0.3 > changes
|
||||
# $ bin/shortlog_mesa.sh mesa-9.0.2..mesa-9.0.3 | tee changes
|
||||
|
||||
|
||||
in_log=0
|
||||
|
||||
git shortlog $* | while read l
|
||||
do
|
||||
if [ $in_log -eq 0 ]; then
|
||||
echo '<p>'$l'</p>'
|
||||
echo '<ul>'
|
||||
in_log=1
|
||||
elif echo "$l" | egrep -q '^$' ; then
|
||||
echo '</ul>'
|
||||
echo
|
||||
in_log=0
|
||||
else
|
||||
mesg=$(echo $l | sed 's/ (cherry picked from commit [0-9a-f]\+)//;s/\&/&/g;s/</\</g;s/>/\>/g')
|
||||
echo ' <li>'${mesg}'</li>'
|
||||
fi
|
||||
done
|
12
common.py
12
common.py
@@ -17,6 +17,9 @@ import SCons.Script.SConscript
|
||||
host_platform = _platform.system().lower()
|
||||
if host_platform.startswith('cygwin'):
|
||||
host_platform = 'cygwin'
|
||||
# MSYS2 default platform selection.
|
||||
if host_platform.startswith('mingw'):
|
||||
host_platform = 'windows'
|
||||
|
||||
# Search sys.argv[] for a "platform=foo" argument since we don't have
|
||||
# an 'env' variable at this point.
|
||||
@@ -49,9 +52,18 @@ if 'PROCESSOR_ARCHITECTURE' in os.environ:
|
||||
else:
|
||||
host_machine = _platform.machine()
|
||||
host_machine = _machine_map.get(host_machine, 'generic')
|
||||
# MSYS2 default machine selection.
|
||||
if _platform.system().lower().startswith('mingw') and 'MSYSTEM' in os.environ:
|
||||
if os.environ['MSYSTEM'] == 'MINGW32':
|
||||
host_machine = 'x86'
|
||||
if os.environ['MSYSTEM'] == 'MINGW64':
|
||||
host_machine = 'x86_64'
|
||||
|
||||
default_machine = host_machine
|
||||
default_toolchain = 'default'
|
||||
# MSYS2 default toolchain selection.
|
||||
if _platform.system().lower().startswith('mingw'):
|
||||
default_toolchain = 'mingw'
|
||||
|
||||
if target_platform == 'windows' and host_platform != 'windows':
|
||||
default_machine = 'x86'
|
||||
|
159
docs/relnotes/19.2.1.html
Normal file
159
docs/relnotes/19.2.1.html
Normal file
@@ -0,0 +1,159 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Mesa Release Notes</title>
|
||||
<link rel="stylesheet" type="text/css" href="../mesa.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="header">
|
||||
<h1>The Mesa 3D Graphics Library</h1>
|
||||
</div>
|
||||
|
||||
<iframe src="../contents.html"></iframe>
|
||||
<div class="content">
|
||||
|
||||
<h1>Mesa 19.2.1 Release Notes / 2019-10-09</h1>
|
||||
|
||||
<p>
|
||||
Mesa 19.2.1 is a bug fix release which fixes bugs found since the 19.2.0 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 19.2.1 implements the OpenGL 4.5 API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 4.5. OpenGL
|
||||
4.5 is <strong>only</strong> available if requested at context creation.
|
||||
Compatibility contexts may report a lower version depending on each driver.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 19.2.1 implements the Vulkan 1.1 API, but the version reported by
|
||||
the apiVersion property of the VkPhysicalDeviceProperties struct
|
||||
depends on the particular driver being used.
|
||||
</p>
|
||||
|
||||
<h2>SHA256 checksum</h2>
|
||||
<pre>
|
||||
4cc53ca1a8d12c6ff0e5ea44a5213c05c88447ab50d7e28bb350cd29199f01e9 mesa-19.2.1.tar.xz
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>New features</h2>
|
||||
|
||||
<ul>
|
||||
<li>None</li>
|
||||
</ul>
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
|
||||
<ul>
|
||||
<li>meson.build:1447:6: ERROR: Problem encountered: libdrm required for gallium video statetrackers when using x11</li>
|
||||
<li>Mesa doesn't build with current Scons version (3.1.0)</li>
|
||||
<li>libXvMC-1.0.12 breaks mesa build</li>
|
||||
<li>Meson can't find 32-bit libXvMCW in non-standard path</li>
|
||||
<li>Mesa installs gl.pc and egl.pc even with libglvnd >= 1.2.0</li>
|
||||
</ul>
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<ul>
|
||||
<p>Andreas Gottschling (1):</p>
|
||||
<li> drisw: Fix shared memory leak on drawable resize</li>
|
||||
<p></p>
|
||||
<p>Andres Gomez (1):</p>
|
||||
<li> egl: Remove the 565 pbuffer-only EGL config under X11.</li>
|
||||
<p></p>
|
||||
<p>Andrii Simiklit (1):</p>
|
||||
<li> glsl: disallow incompatible matrices multiplication</li>
|
||||
<p></p>
|
||||
<p>Bas Nieuwenhuizen (1):</p>
|
||||
<li> radv: Fix condition for skipping the continue CS.</li>
|
||||
<p></p>
|
||||
<p>Connor Abbott (1):</p>
|
||||
<li> nir/opt_large_constants: Handle store writemasks</li>
|
||||
<p></p>
|
||||
<p>Danylo Piliaiev (1):</p>
|
||||
<li> st/nine: Ignore D3DSIO_RET if it is the last instruction in a shader</li>
|
||||
<p></p>
|
||||
<p>Dylan Baker (9):</p>
|
||||
<li> meson: fix logic for generating .pc files with old glvnd</li>
|
||||
<li> meson: Try finding libxvmcw via pkg-config before using find_library</li>
|
||||
<li> meson: Link xvmc with libxv</li>
|
||||
<li> meson: gallium media state trackers require libdrm with x11</li>
|
||||
<li> .cherry-ignore: Update for 19.2.1 cycle</li>
|
||||
<li> meson: Only error building gallium video without libdrm when the platform is drm</li>
|
||||
<li> scripts: Add a gen_release_notes.py script</li>
|
||||
<li> release: Add an update_release_calendar.py script</li>
|
||||
<li> bin: delete unused releasing scripts</li>
|
||||
<p></p>
|
||||
<p>Eric Engestrom (3):</p>
|
||||
<li> radv: fix s/load/store/ copy-paste typo</li>
|
||||
<li> meson: drop -Wno-foo bug workaround for Meson < 0.46</li>
|
||||
<li> meson: add missing idep_nir_headers in iris_gen_libs</li>
|
||||
<p></p>
|
||||
<p>Erik Faye-Lund (1):</p>
|
||||
<li> glsl: correct bitcast-helpers</li>
|
||||
<p></p>
|
||||
<p>Ian Romanick (1):</p>
|
||||
<li> nir/range-analysis: Bail if the types don't match</li>
|
||||
<p></p>
|
||||
<p>Jason Ekstrand (1):</p>
|
||||
<li> intel/fs: Fix fs_inst::flags_read for ANY/ALL predicates</li>
|
||||
<p></p>
|
||||
<p>Ken Mays (1):</p>
|
||||
<li> haiku: fix Mesa build</li>
|
||||
<p></p>
|
||||
<p>Kenneth Graunke (2):</p>
|
||||
<li> iris: Disable CCS_E for 32-bit floating point textures.</li>
|
||||
<li> iris: Fix iris_rebind_buffer() for VBOs with non-zero offsets.</li>
|
||||
<p></p>
|
||||
<p>Lionel Landwerlin (6):</p>
|
||||
<li> anv: gem-stubs: return a valid fd got anv_gem_userptr()</li>
|
||||
<li> intel: use proper label for Comet Lake skus</li>
|
||||
<li> mesa: don't forget to clear _Layer field on texture unit</li>
|
||||
<li> intel: fix topology query</li>
|
||||
<li> intel: fix subslice computation from topology data</li>
|
||||
<li> intel/isl: Set null surface format to R32_UINT</li>
|
||||
<p></p>
|
||||
<p>Marek Olšák (7):</p>
|
||||
<li> gallium/vl: don't set PIPE_HANDLE_USAGE_EXPLICIT_FLUSH</li>
|
||||
<li> gallium: extend resource_get_param to be as capable as resource_get_handle</li>
|
||||
<li> radeonsi/gfx10: fix L2 cache rinse programming</li>
|
||||
<li> ac: fix incorrect vram_size reported by the kernel</li>
|
||||
<li> ac: fix num_good_cu_per_sh for harvested chips</li>
|
||||
<li> ac: add radeon_info::tcc_harvested</li>
|
||||
<li> radeonsi/gfx10: fix corruption for chips with harvested TCCs</li>
|
||||
<p></p>
|
||||
<p>Mauro Rossi (1):</p>
|
||||
<li> android: compiler/nir: build nir_divergence_analysis.c</li>
|
||||
<p></p>
|
||||
<p>Michel Dänzer (1):</p>
|
||||
<li> radeonsi: fix VAAPI segfault due to various bugs</li>
|
||||
<p></p>
|
||||
<p>Michel Zou (1):</p>
|
||||
<li> scons: add py3 support</li>
|
||||
<p></p>
|
||||
<p>Prodea Alexandru-Liviu (1):</p>
|
||||
<li> scons/MSYS2-MinGW-W64: Fix build options defaults</li>
|
||||
<p></p>
|
||||
<p>Rhys Perry (1):</p>
|
||||
<li> nir/opt_remove_phis: handle phis with no sources</li>
|
||||
<p></p>
|
||||
<p>Stephen Barber (1):</p>
|
||||
<li> nouveau: add idep_nir_headers as dep for libnouveau</li>
|
||||
<p></p>
|
||||
<p>Tapani Pälli (2):</p>
|
||||
<li> iris: disable aux on first get_param if not created with aux</li>
|
||||
<li> anv/android: fix images created with external format support</li>
|
||||
<p></p>
|
||||
<p>pal1000 (2):</p>
|
||||
<li> scons: Fix MSYS2 Mingw-w64 build.</li>
|
||||
<li> scons/windows: Support build with LLVM 9.</li>
|
||||
<p></p>
|
||||
<p></p>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
147
docs/relnotes/19.2.2.html
Normal file
147
docs/relnotes/19.2.2.html
Normal file
@@ -0,0 +1,147 @@
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Mesa Release Notes</title>
|
||||
<link rel="stylesheet" type="text/css" href="../mesa.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="header">
|
||||
<h1>The Mesa 3D Graphics Library</h1>
|
||||
</div>
|
||||
|
||||
<iframe src="../contents.html"></iframe>
|
||||
<div class="content">
|
||||
|
||||
<h1>Mesa 19.2.2 Release Notes / 2019-10-23</h1>
|
||||
|
||||
<p>
|
||||
Mesa 19.2.2 is a bug fix release which fixes bugs found since the 19.2.1 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 19.2.2 implements the OpenGL 4.5 API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 4.5. OpenGL
|
||||
4.5 is <strong>only</strong> available if requested at context creation.
|
||||
Compatibility contexts may report a lower version depending on each driver.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 19.2.2 implements the Vulkan 1.1 API, but the version reported by
|
||||
the apiVersion property of the VkPhysicalDeviceProperties struct
|
||||
depends on the particular driver being used.
|
||||
</p>
|
||||
|
||||
<h2>SHA256 checksum</h2>
|
||||
<pre>
|
||||
TBD.
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>New features</h2>
|
||||
|
||||
<ul>
|
||||
<li>None</li>
|
||||
</ul>
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
|
||||
<ul>
|
||||
<li>Vulkan version of "Middle-earth: Shadow of Mordor" has graphics glitches on RADV driver (part 2)</li>
|
||||
<li>Vulkan version of "Middle-earth: Shadow of Mordor" has graphics glitches on RADV driver</li>
|
||||
<li>[amdgpu][Navi][llvm] Minimap problem in Nier Automata</li>
|
||||
<li>Black ground in Dirt 4</li>
|
||||
<li>Superbibles examples crashing Mesa drivers (radeonsi) and causing gpu reset</li>
|
||||
<li>[CTS] dEQP-VK.graphicsfuzz.write-red-in-loop-nest crashes</li>
|
||||
<li>mesa and libglvnd install the same headers</li>
|
||||
<li>Regression: Doom (2016) crashes on Mesa 19.2 and above and Radeon 380 with Vulkan (worked on Mesa 19.1)</li>
|
||||
<li>Rocket League displays corruption when the game starts</li>
|
||||
</ul>
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<ul>
|
||||
<p>Alan Coopersmith (6):</p>
|
||||
<li> c99_compat.h: Don't try to use 'restrict' in C++ code</li>
|
||||
<li> util: Make Solaris implemention of p_atomic_add work with gcc</li>
|
||||
<li> util: Workaround lack of flock on Solaris</li>
|
||||
<li> util: Solaris has linux-style pthread_setname_np</li>
|
||||
<li> meson: recognize "sunos" as the system name for Solaris</li>
|
||||
<li> intel/common: include unistd.h for ioctl() prototype on Solaris</li>
|
||||
<p></p>
|
||||
<p>Alejandro Piñeiro (1):</p>
|
||||
<li> v3d: take into account prim_counts_offset</li>
|
||||
<p></p>
|
||||
<p>Bas Nieuwenhuizen (3):</p>
|
||||
<li> radv: Disallow sparse shared images.</li>
|
||||
<li> nir/dead_cf: Remove dead control flow after infinite loops.</li>
|
||||
<li> radv: Fix single stage constant flush with merged shaders.</li>
|
||||
<p></p>
|
||||
<p>Clément Guérin (1):</p>
|
||||
<li> radeonsi: enable zerovram for Rocket League</li>
|
||||
<p></p>
|
||||
<p>Connor Abbott (2):</p>
|
||||
<li> nir/sink: Rewrite loop handling logic</li>
|
||||
<li> nir/sink: Don't sink load_ubo to outside of its defining loop</li>
|
||||
<p></p>
|
||||
<p>Dylan Baker (1):</p>
|
||||
<li> docs: Add SHA256 sum for 19.2.1</li>
|
||||
<p></p>
|
||||
<p>Eric Engestrom (7):</p>
|
||||
<li> GL: drop symbols mangling support</li>
|
||||
<li> meson: rename `glvnd_missing_pc_files` to `not glvnd_has_headers_and_pc_files`</li>
|
||||
<li> meson: move a couple of include installs around</li>
|
||||
<li> meson: split headers one per line</li>
|
||||
<li> meson: split Mesa headers as a separate installation</li>
|
||||
<li> meson: skip installation of GLVND-provided headers</li>
|
||||
<li> util/u_atomic: fix return type of p_atomic_{inc,dec}_return() and p_atomic_{cmp,}xchg()</li>
|
||||
<p></p>
|
||||
<p>Ian Romanick (2):</p>
|
||||
<li> nir/search: Fix possible NULL dereference in is_fsign</li>
|
||||
<li> intel/vec4: Don't try both sources as immediates for DPH</li>
|
||||
<p></p>
|
||||
<p>James Xiong (1):</p>
|
||||
<li> iris: finish aux import on get_param</li>
|
||||
<p></p>
|
||||
<p>Kenneth Graunke (2):</p>
|
||||
<li> iris: Properly unreference extra VBOs for draw parameters</li>
|
||||
<li> iris: Implement the Gen < 9 tessellation quads workaround</li>
|
||||
<p></p>
|
||||
<p>Lepton Wu (1):</p>
|
||||
<li> egl/android: Remove our own reference to buffers.</li>
|
||||
<p></p>
|
||||
<p>Lionel Landwerlin (3):</p>
|
||||
<li> etnaviv: remove variable from global namespace</li>
|
||||
<li> anv: fix vkUpdateDescriptorSets with inline uniform blocks</li>
|
||||
<li> anv: fix memory leak on device destroy</li>
|
||||
<p></p>
|
||||
<p>Lucas Stach (3):</p>
|
||||
<li> etnaviv: fix vertex buffer state emission for single stream GPUs</li>
|
||||
<li> rbug: fix transmitted texture sizes</li>
|
||||
<li> rbug: unwrap index buffer resource</li>
|
||||
<p></p>
|
||||
<p>Pierre-Eric Pelloux-Prayer (1):</p>
|
||||
<li> mesa: fix invalid target error handling for teximage</li>
|
||||
<p></p>
|
||||
<p>Roland Scheidegger (1):</p>
|
||||
<li> gallivm: Fix saturated signed psub/padd intrinsics on llvm 8</li>
|
||||
<p></p>
|
||||
<p>Samuel Pitoiset (6):</p>
|
||||
<li> drirc: enable vk_x11_override_min_image_count for DOOM</li>
|
||||
<li> radv: bump minTexelBufferOffsetAlignment to 4</li>
|
||||
<li> radv: fix DCC fast clear code for intensity formats</li>
|
||||
<li> Revert "radv: do not emit PKT3_CONTEXT_CONTROL with AMDGPU 3.6.0+"</li>
|
||||
<li> radv: fix DCC fast clear code for intensity formats (correctly)</li>
|
||||
<li> radv: fix updating bound fast ds clear values with different aspects</li>
|
||||
<p></p>
|
||||
<p>Timothy Arceri (1):</p>
|
||||
<li> glsl: fix crash compiling bindless samplers inside unnamed UBOs</li>
|
||||
<p></p>
|
||||
<p></p>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@@ -27,11 +27,6 @@
|
||||
#ifndef __gl_h_
|
||||
#define __gl_h_
|
||||
|
||||
#if defined(USE_MGL_NAMESPACE)
|
||||
#include "gl_mangle.h"
|
||||
#endif
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Begin system-specific stuff.
|
||||
*/
|
||||
@@ -2101,13 +2096,6 @@ typedef void (APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum t
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
** NOTE!!!!! If you add new functions to this file, or update
|
||||
** glext.h be sure to regenerate the gl_mangle.h file. See comments
|
||||
** in that file for details.
|
||||
**/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -32,11 +32,6 @@
|
||||
#include <GL/gl.h>
|
||||
|
||||
|
||||
#if defined(USE_MGL_NAMESPACE)
|
||||
#include "glx_mangle.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@@ -1,82 +0,0 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
*
|
||||
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef GLX_MANGLE_H
|
||||
#define GLX_MANGLE_H
|
||||
|
||||
#define glXChooseVisual mglXChooseVisual
|
||||
#define glXCreateContext mglXCreateContext
|
||||
#define glXDestroyContext mglXDestroyContext
|
||||
#define glXMakeCurrent mglXMakeCurrent
|
||||
#define glXCopyContext mglXCopyContext
|
||||
#define glXSwapBuffers mglXSwapBuffers
|
||||
#define glXCreateGLXPixmap mglXCreateGLXPixmap
|
||||
#define glXDestroyGLXPixmap mglXDestroyGLXPixmap
|
||||
#define glXQueryExtension mglXQueryExtension
|
||||
#define glXQueryVersion mglXQueryVersion
|
||||
#define glXIsDirect mglXIsDirect
|
||||
#define glXGetConfig mglXGetConfig
|
||||
#define glXGetCurrentContext mglXGetCurrentContext
|
||||
#define glXGetCurrentDrawable mglXGetCurrentDrawable
|
||||
#define glXWaitGL mglXWaitGL
|
||||
#define glXWaitX mglXWaitX
|
||||
#define glXUseXFont mglXUseXFont
|
||||
#define glXQueryExtensionsString mglXQueryExtensionsString
|
||||
#define glXQueryServerString mglXQueryServerString
|
||||
#define glXGetClientString mglXGetClientString
|
||||
#define glXCreateGLXPixmapMESA mglXCreateGLXPixmapMESA
|
||||
#define glXReleaseBuffersMESA mglXReleaseBuffersMESA
|
||||
#define glXCopySubBufferMESA mglXCopySubBufferMESA
|
||||
#define glXGetVideoSyncSGI mglXGetVideoSyncSGI
|
||||
#define glXWaitVideoSyncSGI mglXWaitVideoSyncSGI
|
||||
|
||||
/* GLX 1.2 */
|
||||
#define glXGetCurrentDisplay mglXGetCurrentDisplay
|
||||
|
||||
/* GLX 1.3 */
|
||||
#define glXChooseFBConfig mglXChooseFBConfig
|
||||
#define glXGetFBConfigAttrib mglXGetFBConfigAttrib
|
||||
#define glXGetFBConfigs mglXGetFBConfigs
|
||||
#define glXGetVisualFromFBConfig mglXGetVisualFromFBConfig
|
||||
#define glXCreateWindow mglXCreateWindow
|
||||
#define glXDestroyWindow mglXDestroyWindow
|
||||
#define glXCreatePixmap mglXCreatePixmap
|
||||
#define glXDestroyPixmap mglXDestroyPixmap
|
||||
#define glXCreatePbuffer mglXCreatePbuffer
|
||||
#define glXDestroyPbuffer mglXDestroyPbuffer
|
||||
#define glXQueryDrawable mglXQueryDrawable
|
||||
#define glXCreateNewContext mglXCreateNewContext
|
||||
#define glXMakeContextCurrent mglXMakeContextCurrent
|
||||
#define glXGetCurrentReadDrawable mglXGetCurrentReadDrawable
|
||||
#define glXQueryContext mglXQueryContext
|
||||
#define glXSelectEvent mglXSelectEvent
|
||||
#define glXGetSelectedEvent mglXGetSelectedEvent
|
||||
|
||||
/* GLX 1.4 */
|
||||
#define glXGetProcAddress mglXGetProcAddress
|
||||
#define glXGetProcAddressARB mglXGetProcAddressARB
|
||||
|
||||
|
||||
#endif
|
@@ -12,7 +12,6 @@ Normal Haiku Op*enGL layout:
|
||||
* headers/os/opengl/GLView.h
|
||||
* headers/os/opengl/GLRenderer.h
|
||||
* headers/os/opengl/GL/gl.h
|
||||
* headers/os/opengl/GL/gl_mangle.h
|
||||
* headers/os/opengl/GL/glext.h
|
||||
* headers/os/opengl/GL/osmesa.h (needed?)
|
||||
|
||||
|
@@ -96,7 +96,7 @@
|
||||
* - http://cellperformance.beyond3d.com/articles/2006/05/demystifying-the-restrict-keyword.html
|
||||
*/
|
||||
#ifndef restrict
|
||||
# if (__STDC_VERSION__ >= 199901L)
|
||||
# if (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus)
|
||||
/* C99 */
|
||||
# elif defined(__GNUC__)
|
||||
# define restrict __restrict__
|
||||
|
@@ -22,52 +22,77 @@ inc_include = include_directories('.')
|
||||
inc_d3d9 = include_directories('D3D9')
|
||||
inc_haikugl = include_directories('HaikuGL')
|
||||
|
||||
if with_gles1
|
||||
install_headers(
|
||||
'GLES/egl.h', 'GLES/gl.h', 'GLES/glext.h', 'GLES/glplatform.h',
|
||||
subdir : 'GLES',
|
||||
)
|
||||
if not glvnd_has_headers_and_pc_files
|
||||
if with_gles1 or with_gles2 or with_opengl or with_egl
|
||||
install_headers('KHR/khrplatform.h', subdir : 'KHR')
|
||||
endif
|
||||
|
||||
if with_gles1
|
||||
install_headers(
|
||||
'GLES/egl.h',
|
||||
'GLES/gl.h',
|
||||
'GLES/glext.h',
|
||||
'GLES/glplatform.h',
|
||||
subdir : 'GLES',
|
||||
)
|
||||
endif
|
||||
|
||||
if with_gles2
|
||||
install_headers(
|
||||
'GLES2/gl2.h',
|
||||
'GLES2/gl2ext.h',
|
||||
'GLES2/gl2platform.h',
|
||||
subdir : 'GLES2',
|
||||
)
|
||||
install_headers(
|
||||
'GLES3/gl3.h',
|
||||
'GLES3/gl31.h',
|
||||
'GLES3/gl32.h',
|
||||
'GLES3/gl3ext.h',
|
||||
'GLES3/gl3platform.h',
|
||||
subdir : 'GLES3',
|
||||
)
|
||||
endif
|
||||
|
||||
if with_opengl
|
||||
install_headers(
|
||||
'GL/gl.h',
|
||||
'GL/glcorearb.h',
|
||||
'GL/glext.h',
|
||||
subdir : 'GL',
|
||||
)
|
||||
endif
|
||||
|
||||
if with_glx != 'disabled'
|
||||
install_headers(
|
||||
'GL/glx.h',
|
||||
'GL/glxext.h',
|
||||
subdir : 'GL')
|
||||
endif
|
||||
|
||||
if with_egl
|
||||
install_headers(
|
||||
'EGL/egl.h',
|
||||
'EGL/eglext.h',
|
||||
'EGL/eglplatform.h',
|
||||
subdir : 'EGL',
|
||||
)
|
||||
endif
|
||||
endif
|
||||
|
||||
if with_gles2
|
||||
# Non-upstream headers
|
||||
if with_egl
|
||||
install_headers(
|
||||
'GLES2/gl2.h', 'GLES2/gl2ext.h', 'GLES2/gl2platform.h',
|
||||
subdir : 'GLES2',
|
||||
'EGL/eglmesaext.h',
|
||||
'EGL/eglextchromium.h',
|
||||
subdir : 'EGL',
|
||||
)
|
||||
install_headers(
|
||||
'GLES3/gl3.h', 'GLES3/gl31.h', 'GLES3/gl32.h', 'GLES3/gl3ext.h',
|
||||
'GLES3/gl3platform.h',
|
||||
subdir : 'GLES3',
|
||||
)
|
||||
endif
|
||||
|
||||
if with_gles1 or with_gles2 or with_opengl or with_egl
|
||||
install_headers('KHR/khrplatform.h', subdir : 'KHR')
|
||||
endif
|
||||
|
||||
if with_opengl
|
||||
install_headers(
|
||||
'GL/gl.h', 'GL/glext.h', 'GL/glcorearb.h', 'GL/gl_mangle.h',
|
||||
subdir : 'GL',
|
||||
)
|
||||
endif
|
||||
|
||||
if with_glx != 'disabled'
|
||||
install_headers('GL/glx.h', 'GL/glxext.h', 'GL/glx_mangle.h', subdir : 'GL')
|
||||
endif
|
||||
|
||||
if with_osmesa != 'none'
|
||||
install_headers('GL/osmesa.h', subdir : 'GL')
|
||||
endif
|
||||
|
||||
if with_egl
|
||||
install_headers(
|
||||
'EGL/eglext.h', 'EGL/egl.h', 'EGL/eglextchromium.h', 'EGL/eglmesaext.h',
|
||||
'EGL/eglplatform.h',
|
||||
subdir : 'EGL',
|
||||
)
|
||||
endif
|
||||
|
||||
if with_dri
|
||||
install_headers('GL/internal/dri_interface.h', subdir : 'GL/internal')
|
||||
endif
|
||||
|
@@ -186,29 +186,29 @@ CHIPSET(0x3EA5, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)")
|
||||
CHIPSET(0x3EA6, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)")
|
||||
CHIPSET(0x3EA7, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)")
|
||||
CHIPSET(0x3EA8, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)")
|
||||
CHIPSET(0x3EA1, cfl_gt1, "Intel(R) HD Graphics (Whiskey Lake 2x6 GT1)")
|
||||
CHIPSET(0x3EA4, cfl_gt1, "Intel(R) HD Graphics (Whiskey Lake 3x8 GT1)")
|
||||
CHIPSET(0x3EA0, cfl_gt2, "Intel(R) HD Graphics (Whiskey Lake 3x8 GT2)")
|
||||
CHIPSET(0x3EA3, cfl_gt2, "Intel(R) HD Graphics (Whiskey Lake 3x8 GT2)")
|
||||
CHIPSET(0x3EA2, cfl_gt3, "Intel(R) HD Graphics (Whiskey Lake 3x8 GT3)")
|
||||
CHIPSET(0x9B21, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)")
|
||||
CHIPSET(0x9BA0, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)")
|
||||
CHIPSET(0x9BA2, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)")
|
||||
CHIPSET(0x9BA4, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)")
|
||||
CHIPSET(0x9BA5, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)")
|
||||
CHIPSET(0x9BA8, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)")
|
||||
CHIPSET(0x9BAA, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)")
|
||||
CHIPSET(0x9BAB, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)")
|
||||
CHIPSET(0x9BAC, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)")
|
||||
CHIPSET(0x9B41, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)")
|
||||
CHIPSET(0x9BC0, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)")
|
||||
CHIPSET(0x9BC2, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)")
|
||||
CHIPSET(0x9BC4, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)")
|
||||
CHIPSET(0x9BC5, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)")
|
||||
CHIPSET(0x9BC8, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)")
|
||||
CHIPSET(0x9BCA, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)")
|
||||
CHIPSET(0x9BCB, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)")
|
||||
CHIPSET(0x9BCC, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)")
|
||||
CHIPSET(0x3EA1, cfl_gt1, "Intel(R) UHD Graphics (Whiskey Lake 2x6 GT1)")
|
||||
CHIPSET(0x3EA4, cfl_gt1, "Intel(R) UHD Graphics (Whiskey Lake 3x8 GT1)")
|
||||
CHIPSET(0x3EA0, cfl_gt2, "Intel(R) UHD Graphics (Whiskey Lake 3x8 GT2)")
|
||||
CHIPSET(0x3EA3, cfl_gt2, "Intel(R) UHD Graphics (Whiskey Lake 3x8 GT2)")
|
||||
CHIPSET(0x3EA2, cfl_gt3, "Intel(R) UHD Graphics (Whiskey Lake 3x8 GT3)")
|
||||
CHIPSET(0x9B21, cfl_gt1, "Intel(R) UHD Graphics (Comet Lake 2x6 GT1)")
|
||||
CHIPSET(0x9BA0, cfl_gt1, "Intel(R) UHD Graphics (Comet Lake 2x6 GT1)")
|
||||
CHIPSET(0x9BA2, cfl_gt1, "Intel(R) UHD Graphics (Comet Lake 2x6 GT1)")
|
||||
CHIPSET(0x9BA4, cfl_gt1, "Intel(R) UHD Graphics (Comet Lake 2x6 GT1)")
|
||||
CHIPSET(0x9BA5, cfl_gt1, "Intel(R) UHD Graphics (Comet Lake 2x6 GT1)")
|
||||
CHIPSET(0x9BA8, cfl_gt1, "Intel(R) UHD Graphics (Comet Lake 2x6 GT1)")
|
||||
CHIPSET(0x9BAA, cfl_gt1, "Intel(R) UHD Graphics (Comet Lake 2x6 GT1)")
|
||||
CHIPSET(0x9BAB, cfl_gt1, "Intel(R) UHD Graphics (Comet Lake 2x6 GT1)")
|
||||
CHIPSET(0x9BAC, cfl_gt1, "Intel(R) UHD Graphics (Comet Lake 2x6 GT1)")
|
||||
CHIPSET(0x9B41, cfl_gt2, "Intel(R) UHD Graphics (Comet Lake 3x8 GT2)")
|
||||
CHIPSET(0x9BC0, cfl_gt2, "Intel(R) UHD Graphics (Comet Lake 3x8 GT2)")
|
||||
CHIPSET(0x9BC2, cfl_gt2, "Intel(R) UHD Graphics (Comet Lake 3x8 GT2)")
|
||||
CHIPSET(0x9BC4, cfl_gt2, "Intel(R) UHD Graphics (Comet Lake 3x8 GT2)")
|
||||
CHIPSET(0x9BC5, cfl_gt2, "Intel(R) UHD Graphics (Comet Lake 3x8 GT2)")
|
||||
CHIPSET(0x9BC8, cfl_gt2, "Intel(R) UHD Graphics (Comet Lake 3x8 GT2)")
|
||||
CHIPSET(0x9BCA, cfl_gt2, "Intel(R) UHD Graphics (Comet Lake 3x8 GT2)")
|
||||
CHIPSET(0x9BCB, cfl_gt2, "Intel(R) UHD Graphics (Comet Lake 3x8 GT2)")
|
||||
CHIPSET(0x9BCC, cfl_gt2, "Intel(R) UHD Graphics (Comet Lake 3x8 GT2)")
|
||||
CHIPSET(0x5A49, cnl_2x8, "Intel(R) HD Graphics (Cannonlake 2x8 GT0.5)")
|
||||
CHIPSET(0x5A4A, cnl_2x8, "Intel(R) HD Graphics (Cannonlake 2x8 GT0.5)")
|
||||
CHIPSET(0x5A41, cnl_3x8, "Intel(R) HD Graphics (Cannonlake 3x8 GT1)")
|
||||
|
56
meson.build
56
meson.build
@@ -93,7 +93,7 @@ with_shared_glapi = get_option('shared-glapi')
|
||||
|
||||
# shared-glapi is required if at least two OpenGL APIs are being built
|
||||
if not with_shared_glapi
|
||||
if ((with_gles1 == 'true' and with_gles2 == 'true') or
|
||||
if ((with_gles1 == 'true' and with_gles2 == 'true') or
|
||||
(with_gles1 == 'true' and with_opengl) or
|
||||
(with_gles2 == 'true' and with_opengl))
|
||||
error('shared-glapi required for building two or more of OpenGL, OpenGL ES 1.x, OpenGL ES 2.x')
|
||||
@@ -117,7 +117,7 @@ with_any_opengl = with_opengl or with_gles1 or with_gles2
|
||||
# Only build shared_glapi if at least one OpenGL API is enabled
|
||||
with_shared_glapi = get_option('shared-glapi') and with_any_opengl
|
||||
|
||||
system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux'].contains(host_machine.system())
|
||||
system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux', 'sunos'].contains(host_machine.system())
|
||||
|
||||
dri_drivers = get_option('dri-drivers')
|
||||
if dri_drivers.contains('auto')
|
||||
@@ -385,7 +385,7 @@ endif
|
||||
if with_glx != 'disabled'
|
||||
if not (with_platform_x11 and with_any_opengl)
|
||||
error('Cannot build GLX support without X11 platform support and at least one OpenGL API')
|
||||
elif with_glx == 'gallium-xlib'
|
||||
elif with_glx == 'gallium-xlib'
|
||||
if not with_gallium
|
||||
error('Gallium-xlib based GLX requires at least one gallium driver')
|
||||
elif not with_gallium_softpipe
|
||||
@@ -393,7 +393,7 @@ if with_glx != 'disabled'
|
||||
elif with_dri
|
||||
error('gallium-xlib conflicts with any dri driver')
|
||||
endif
|
||||
elif with_glx == 'xlib'
|
||||
elif with_glx == 'xlib'
|
||||
if with_dri
|
||||
error('xlib conflicts with any dri driver')
|
||||
endif
|
||||
@@ -502,10 +502,12 @@ elif not (with_gallium_r600 or with_gallium_nouveau)
|
||||
endif
|
||||
endif
|
||||
dep_xvmc = null_dep
|
||||
dep_xv = null_dep
|
||||
with_gallium_xvmc = false
|
||||
if _xvmc != 'false'
|
||||
dep_xvmc = dependency('xvmc', version : '>= 1.0.6', required : _xvmc == 'true')
|
||||
with_gallium_xvmc = dep_xvmc.found()
|
||||
dep_xv = dependency('xv', required : _xvmc == 'true')
|
||||
with_gallium_xvmc = dep_xvmc.found() and dep_xv.found()
|
||||
endif
|
||||
|
||||
xvmc_drivers_path = get_option('xvmc-libs-path')
|
||||
@@ -856,6 +858,8 @@ endif
|
||||
# TODO: this is very incomplete
|
||||
if ['linux', 'cygwin', 'gnu', 'gnu/kfreebsd'].contains(host_machine.system())
|
||||
pre_args += '-D_GNU_SOURCE'
|
||||
elif host_machine.system() == 'sunos'
|
||||
pre_args += '-D__EXTENSIONS__'
|
||||
endif
|
||||
|
||||
# Check for generic C arguments
|
||||
@@ -865,6 +869,8 @@ foreach a : ['-Werror=implicit-function-declaration',
|
||||
'-Werror=incompatible-pointer-types',
|
||||
'-Werror=format',
|
||||
'-Wformat-security',
|
||||
'-Wno-missing-field-initializers',
|
||||
'-Wno-format-truncation',
|
||||
'-fno-math-errno',
|
||||
'-fno-trapping-math', '-Qunused-arguments']
|
||||
if cc.has_argument(a)
|
||||
@@ -872,12 +878,6 @@ foreach a : ['-Werror=implicit-function-declaration',
|
||||
endif
|
||||
endforeach
|
||||
|
||||
foreach a : ['missing-field-initializers', 'format-truncation']
|
||||
if cc.has_argument('-W' + a)
|
||||
c_args += '-Wno-' + a
|
||||
endif
|
||||
endforeach
|
||||
|
||||
c_vis_args = []
|
||||
if cc.has_argument('-fvisibility=hidden')
|
||||
c_vis_args += '-fvisibility=hidden'
|
||||
@@ -888,6 +888,9 @@ cpp_args = []
|
||||
foreach a : ['-Werror=return-type',
|
||||
'-Werror=format',
|
||||
'-Wformat-security',
|
||||
'-Wno-non-virtual-dtor',
|
||||
'-Wno-missing-field-initializers',
|
||||
'-Wno-format-truncation',
|
||||
'-fno-math-errno', '-fno-trapping-math',
|
||||
'-Qunused-arguments']
|
||||
if cpp.has_argument(a)
|
||||
@@ -895,19 +898,11 @@ foreach a : ['-Werror=return-type',
|
||||
endif
|
||||
endforeach
|
||||
|
||||
# For some reason, the test for -Wno-foo always succeeds with gcc, even if the
|
||||
# option is not supported. Hence, check for -Wfoo instead.
|
||||
|
||||
foreach a : ['non-virtual-dtor', 'missing-field-initializers', 'format-truncation']
|
||||
if cpp.has_argument('-W' + a)
|
||||
cpp_args += '-Wno-' + a
|
||||
endif
|
||||
endforeach
|
||||
|
||||
no_override_init_args = []
|
||||
foreach a : ['override-init', 'initializer-overrides']
|
||||
if cc.has_argument('-W' + a)
|
||||
no_override_init_args += '-Wno-' + a
|
||||
foreach a : ['-Wno-override-init',
|
||||
'-Wno-initializer-overrides']
|
||||
if cc.has_argument(a)
|
||||
no_override_init_args += a
|
||||
endif
|
||||
endforeach
|
||||
|
||||
@@ -1041,7 +1036,7 @@ foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h', 'endian.h', 'dlfcn.h'
|
||||
endif
|
||||
endforeach
|
||||
|
||||
foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get', 'memfd_create', 'random_r']
|
||||
foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get', 'memfd_create', 'random_r', 'flock']
|
||||
if cc.has_function(f)
|
||||
pre_args += '-DHAVE_@0@'.format(f.to_upper())
|
||||
endif
|
||||
@@ -1307,12 +1302,12 @@ else
|
||||
endif
|
||||
|
||||
dep_glvnd = null_dep
|
||||
glvnd_has_headers_and_pc_files = false
|
||||
if with_glvnd
|
||||
dep_glvnd = dependency('libglvnd', version : '>= 0.2.0')
|
||||
# GLVND until commit 0dfaea2bcb7cdcc785f9 ("Add pkg-config files for EGL, GL,
|
||||
# GLES, and GLX.") was missing its pkg-config files, forcing every vendor to
|
||||
# provide them and the distro maintainers to resolve the conflict.
|
||||
glvnd_missing_pc_files = dep_glvnd.version().version_compare('< 1.2.0')
|
||||
# GLVND before 1.2 was missing its pkg-config and header files, forcing every
|
||||
# vendor to provide them and the distro maintainers to resolve the conflict.
|
||||
glvnd_has_headers_and_pc_files = dep_glvnd.version().version_compare('>= 1.2.0')
|
||||
pre_args += '-DUSE_LIBGLVND=1'
|
||||
endif
|
||||
|
||||
@@ -1423,6 +1418,9 @@ if with_platform_x11
|
||||
with_gallium_omx != 'disabled'))
|
||||
dep_xcb = dependency('xcb')
|
||||
dep_x11_xcb = dependency('x11-xcb')
|
||||
if with_dri_platform == 'drm' and not dep_libdrm.found()
|
||||
error('libdrm required for gallium video statetrackers when using x11')
|
||||
endif
|
||||
endif
|
||||
if with_any_vk or with_egl or (with_glx == 'dri' and with_dri_platform == 'drm')
|
||||
dep_xcb_dri2 = dependency('xcb-dri2', version : '>= 1.8')
|
||||
@@ -1443,7 +1441,7 @@ if with_platform_x11
|
||||
if with_glx == 'dri' or with_glx == 'gallium-xlib'
|
||||
dep_glproto = dependency('glproto', version : '>= 1.4.14')
|
||||
endif
|
||||
if with_glx == 'dri'
|
||||
if with_glx == 'dri'
|
||||
if with_dri_platform == 'drm'
|
||||
dep_dri2proto = dependency('dri2proto', version : '>= 2.8')
|
||||
dep_xxf86vm = dependency('xxf86vm')
|
||||
|
@@ -128,9 +128,9 @@ def generate(env):
|
||||
if not path:
|
||||
path = []
|
||||
if SCons.Util.is_String(path):
|
||||
path = string.split(path, os.pathsep)
|
||||
path = str.split(path, os.pathsep)
|
||||
|
||||
env['ENV']['PATH'] = string.join([dir] + path, os.pathsep)
|
||||
env['ENV']['PATH'] = str.join(os.pathsep, [dir] + path)
|
||||
|
||||
# Most of mingw is the same as gcc and friends...
|
||||
gnu_tools = ['gcc', 'g++', 'gnulink', 'ar', 'gas']
|
||||
|
@@ -262,8 +262,12 @@ def parse_source_list(env, filename, names=None):
|
||||
sym_table = parser.parse(src.abspath)
|
||||
|
||||
if names:
|
||||
if isinstance(names, basestring):
|
||||
names = [names]
|
||||
if sys.version_info[0] >= 3:
|
||||
if isinstance(names, str):
|
||||
names = [names]
|
||||
else:
|
||||
if isinstance(names, basestring):
|
||||
names = [names]
|
||||
|
||||
symbols = names
|
||||
else:
|
||||
|
@@ -132,7 +132,7 @@ def check_cc(env, cc, expr, cpp_opt = '-E'):
|
||||
sys.stdout.write('Checking for %s ... ' % cc)
|
||||
|
||||
source = tempfile.NamedTemporaryFile(suffix='.c', delete=False)
|
||||
source.write('#if !(%s)\n#error\n#endif\n' % expr)
|
||||
source.write(('#if !(%s)\n#error\n#endif\n' % expr).encode())
|
||||
source.close()
|
||||
|
||||
# sys.stderr.write('%r %s %s\n' % (env['CC'], cpp_opt, source.name));
|
||||
@@ -237,6 +237,9 @@ def generate(env):
|
||||
hosthost_platform = host_platform.system().lower()
|
||||
if hosthost_platform.startswith('cygwin'):
|
||||
hosthost_platform = 'cygwin'
|
||||
# Avoid spurious crosscompilation in MSYS2 environment.
|
||||
if hosthost_platform.startswith('mingw'):
|
||||
hosthost_platform = 'windows'
|
||||
host_machine = os.environ.get('PROCESSOR_ARCHITEW6432', os.environ.get('PROCESSOR_ARCHITECTURE', host_platform.machine()))
|
||||
host_machine = {
|
||||
'x86': 'x86',
|
||||
|
@@ -30,6 +30,7 @@ Tool-specific initialization for LLVM
|
||||
import os
|
||||
import os.path
|
||||
import re
|
||||
import platform as host_platform
|
||||
import sys
|
||||
import distutils.version
|
||||
|
||||
@@ -100,8 +101,36 @@ def generate(env):
|
||||
|
||||
env.Prepend(CPPPATH = [os.path.join(llvm_dir, 'include')])
|
||||
env.Prepend(LIBPATH = [os.path.join(llvm_dir, 'lib')])
|
||||
# LIBS should match the output of `llvm-config --libs engine mcjit bitwriter x86asmprinter irreader`
|
||||
if llvm_version >= distutils.version.LooseVersion('5.0'):
|
||||
|
||||
# LLVM 5.0 and newer requires MinGW w/ pthreads due to use of std::thread and friends.
|
||||
if llvm_version >= distutils.version.LooseVersion('5.0') and env['crosscompile']:
|
||||
assert env['gcc']
|
||||
env.AppendUnique(CXXFLAGS = ['-posix'])
|
||||
|
||||
# LIBS should match the output of `llvm-config --libs engine mcjit bitwriter x86asmprinter irreader` for LLVM<=7.0
|
||||
# and `llvm-config --libs engine irreader` for LLVM>=8.0
|
||||
# LLVMAggressiveInstCombine library part of engine component can be safely omitted as it's not used.
|
||||
if llvm_version >= distutils.version.LooseVersion('9.0'):
|
||||
env.Prepend(LIBS = [
|
||||
'LLVMX86Disassembler', 'LLVMX86AsmParser',
|
||||
'LLVMX86CodeGen', 'LLVMSelectionDAG', 'LLVMAsmPrinter',
|
||||
'LLVMDebugInfoCodeView', 'LLVMCodeGen',
|
||||
'LLVMScalarOpts', 'LLVMInstCombine',
|
||||
'LLVMTransformUtils',
|
||||
'LLVMBitWriter', 'LLVMX86Desc',
|
||||
'LLVMMCDisassembler', 'LLVMX86Info',
|
||||
'LLVMX86Utils',
|
||||
'LLVMMCJIT', 'LLVMExecutionEngine', 'LLVMTarget',
|
||||
'LLVMAnalysis', 'LLVMProfileData',
|
||||
'LLVMRuntimeDyld', 'LLVMObject', 'LLVMMCParser',
|
||||
'LLVMBitReader', 'LLVMMC', 'LLVMCore',
|
||||
'LLVMSupport',
|
||||
'LLVMIRReader', 'LLVMAsmParser',
|
||||
'LLVMDemangle', 'LLVMGlobalISel', 'LLVMDebugInfoMSF',
|
||||
'LLVMBinaryFormat',
|
||||
'LLVMRemarks', 'LLVMBitstreamReader', 'LLVMDebugInfoDWARF',
|
||||
])
|
||||
elif llvm_version >= distutils.version.LooseVersion('5.0'):
|
||||
env.Prepend(LIBS = [
|
||||
'LLVMX86Disassembler', 'LLVMX86AsmParser',
|
||||
'LLVMX86CodeGen', 'LLVMSelectionDAG', 'LLVMAsmPrinter',
|
||||
@@ -120,10 +149,6 @@ def generate(env):
|
||||
'LLVMDemangle', 'LLVMGlobalISel', 'LLVMDebugInfoMSF',
|
||||
'LLVMBinaryFormat',
|
||||
])
|
||||
if env['platform'] == 'windows' and env['crosscompile']:
|
||||
# LLVM 5.0 requires MinGW w/ pthreads due to use of std::thread and friends.
|
||||
assert env['gcc']
|
||||
env.AppendUnique(CXXFLAGS = ['-posix'])
|
||||
elif llvm_version >= distutils.version.LooseVersion('4.0'):
|
||||
env.Prepend(LIBS = [
|
||||
'LLVMX86Disassembler', 'LLVMX86AsmParser',
|
||||
@@ -217,6 +242,12 @@ def generate(env):
|
||||
'uuid',
|
||||
])
|
||||
|
||||
# Mingw-w64 zlib is required when building with LLVM support in MSYS2 environment
|
||||
if host_platform.system().lower().startswith('mingw'):
|
||||
env.Append(LIBS = [
|
||||
'z',
|
||||
])
|
||||
|
||||
if env['msvc']:
|
||||
# Some of the LLVM C headers use the inline keyword without
|
||||
# defining it.
|
||||
|
@@ -92,6 +92,14 @@ static bool has_syncobj(int fd)
|
||||
return value ? true : false;
|
||||
}
|
||||
|
||||
static uint64_t fix_vram_size(uint64_t size)
|
||||
{
|
||||
/* The VRAM size is underreported, so we need to fix it, because
|
||||
* it's used to compute the number of memory modules for harvesting.
|
||||
*/
|
||||
return align64(size, 256*1024*1024);
|
||||
}
|
||||
|
||||
bool ac_query_gpu_info(int fd, void *dev_p,
|
||||
struct radeon_info *info,
|
||||
struct amdgpu_gpu_info *amdinfo)
|
||||
@@ -265,7 +273,7 @@ bool ac_query_gpu_info(int fd, void *dev_p,
|
||||
|
||||
/* Note: usable_heap_size values can be random and can't be relied on. */
|
||||
info->gart_size = meminfo.gtt.total_heap_size;
|
||||
info->vram_size = meminfo.vram.total_heap_size;
|
||||
info->vram_size = fix_vram_size(meminfo.vram.total_heap_size);
|
||||
info->vram_vis_size = meminfo.cpu_accessible_vram.total_heap_size;
|
||||
} else {
|
||||
/* This is a deprecated interface, which reports usable sizes
|
||||
@@ -296,7 +304,7 @@ bool ac_query_gpu_info(int fd, void *dev_p,
|
||||
}
|
||||
|
||||
info->gart_size = gtt.heap_size;
|
||||
info->vram_size = vram.heap_size;
|
||||
info->vram_size = fix_vram_size(vram.heap_size);
|
||||
info->vram_vis_size = vram_vis.heap_size;
|
||||
}
|
||||
|
||||
@@ -419,6 +427,9 @@ bool ac_query_gpu_info(int fd, void *dev_p,
|
||||
}
|
||||
if (info->chip_class >= GFX10) {
|
||||
info->tcc_cache_line_size = 128;
|
||||
/* This is a hack, but it's all we can do without a kernel upgrade. */
|
||||
info->tcc_harvested =
|
||||
(info->vram_size / info->num_tcc_blocks) != 512*1024*1024;
|
||||
} else {
|
||||
info->tcc_cache_line_size = 64;
|
||||
}
|
||||
@@ -450,6 +461,12 @@ bool ac_query_gpu_info(int fd, void *dev_p,
|
||||
info->num_good_cu_per_sh = info->num_good_compute_units /
|
||||
(info->max_se * info->max_sh_per_se);
|
||||
|
||||
/* Round down to the nearest multiple of 2, because the hw can't
|
||||
* disable CUs. It can only disable whole WGPs (dual-CUs).
|
||||
*/
|
||||
if (info->chip_class >= GFX10)
|
||||
info->num_good_cu_per_sh -= info->num_good_cu_per_sh % 2;
|
||||
|
||||
memcpy(info->si_tile_mode_array, amdinfo->gb_tile_mode,
|
||||
sizeof(amdinfo->gb_tile_mode));
|
||||
info->enabled_rb_mask = amdinfo->enabled_rb_pipes_mask;
|
||||
@@ -534,6 +551,7 @@ void ac_print_gpu_info(struct radeon_info *info)
|
||||
printf(" num_sdma_rings = %i\n", info->num_sdma_rings);
|
||||
printf(" clock_crystal_freq = %i\n", info->clock_crystal_freq);
|
||||
printf(" tcc_cache_line_size = %u\n", info->tcc_cache_line_size);
|
||||
printf(" tcc_harvested = %u\n", info->tcc_harvested);
|
||||
|
||||
printf(" use_display_dcc_unaligned = %u\n", info->use_display_dcc_unaligned);
|
||||
printf(" use_display_dcc_with_retile_blit = %u\n", info->use_display_dcc_with_retile_blit);
|
||||
|
@@ -58,6 +58,7 @@ struct radeon_info {
|
||||
uint32_t num_sdma_rings;
|
||||
uint32_t clock_crystal_freq;
|
||||
uint32_t tcc_cache_line_size;
|
||||
bool tcc_harvested;
|
||||
|
||||
/* There are 2 display DCC codepaths, because display expects unaligned DCC. */
|
||||
/* Disable RB and pipe alignment to skip the retile blit. (1 RB chips only) */
|
||||
|
@@ -1546,9 +1546,19 @@ radv_update_bound_fast_clear_ds(struct radv_cmd_buffer *cmd_buffer,
|
||||
if (cmd_buffer->state.attachments[att_idx].iview->image != image)
|
||||
return;
|
||||
|
||||
radeon_set_context_reg_seq(cs, R_028028_DB_STENCIL_CLEAR, 2);
|
||||
radeon_emit(cs, ds_clear_value.stencil);
|
||||
radeon_emit(cs, fui(ds_clear_value.depth));
|
||||
if (aspects == (VK_IMAGE_ASPECT_DEPTH_BIT |
|
||||
VK_IMAGE_ASPECT_STENCIL_BIT)) {
|
||||
radeon_set_context_reg_seq(cs, R_028028_DB_STENCIL_CLEAR, 2);
|
||||
radeon_emit(cs, ds_clear_value.stencil);
|
||||
radeon_emit(cs, fui(ds_clear_value.depth));
|
||||
} else if (aspects == VK_IMAGE_ASPECT_DEPTH_BIT) {
|
||||
radeon_set_context_reg_seq(cs, R_02802C_DB_DEPTH_CLEAR, 1);
|
||||
radeon_emit(cs, fui(ds_clear_value.depth));
|
||||
} else {
|
||||
assert(aspects == VK_IMAGE_ASPECT_STENCIL_BIT);
|
||||
radeon_set_context_reg_seq(cs, R_028028_DB_STENCIL_CLEAR, 1);
|
||||
radeon_emit(cs, ds_clear_value.stencil);
|
||||
}
|
||||
|
||||
/* Update the ZRANGE_PRECISION value for the TC-compat bug. This is
|
||||
* only needed when clearing Z to 0.0.
|
||||
@@ -2268,14 +2278,15 @@ radv_flush_constants(struct radv_cmd_buffer *cmd_buffer,
|
||||
return;
|
||||
|
||||
radv_foreach_stage(stage, stages) {
|
||||
if (!pipeline->shaders[stage])
|
||||
shader = radv_get_shader(pipeline, stage);
|
||||
if (!shader)
|
||||
continue;
|
||||
|
||||
need_push_constants |= pipeline->shaders[stage]->info.info.loads_push_constants;
|
||||
need_push_constants |= pipeline->shaders[stage]->info.info.loads_dynamic_offsets;
|
||||
need_push_constants |= shader->info.info.loads_push_constants;
|
||||
need_push_constants |= shader->info.info.loads_dynamic_offsets;
|
||||
|
||||
uint8_t base = pipeline->shaders[stage]->info.info.base_inline_push_consts;
|
||||
uint8_t count = pipeline->shaders[stage]->info.info.num_inline_push_consts;
|
||||
uint8_t base = shader->info.info.base_inline_push_consts;
|
||||
uint8_t count = shader->info.info.num_inline_push_consts;
|
||||
|
||||
radv_emit_inline_push_consts(cmd_buffer, pipeline, stage,
|
||||
AC_UD_INLINE_PUSH_CONSTANTS,
|
||||
|
@@ -1170,7 +1170,7 @@ void radv_GetPhysicalDeviceProperties(
|
||||
.viewportBoundsRange = { INT16_MIN, INT16_MAX },
|
||||
.viewportSubPixelBits = 8,
|
||||
.minMemoryMapAlignment = 4096, /* A page */
|
||||
.minTexelBufferOffsetAlignment = 1,
|
||||
.minTexelBufferOffsetAlignment = 4,
|
||||
.minUniformBufferOffsetAlignment = 4,
|
||||
.minStorageBufferOffsetAlignment = 4,
|
||||
.minTexelOffset = -32,
|
||||
@@ -2057,12 +2057,9 @@ VkResult radv_CreateDevice(
|
||||
device->empty_cs[family] = device->ws->cs_create(device->ws, family);
|
||||
switch (family) {
|
||||
case RADV_QUEUE_GENERAL:
|
||||
/* Since amdgpu version 3.6.0, CONTEXT_CONTROL is emitted by the kernel */
|
||||
if (device->physical_device->rad_info.drm_minor < 6) {
|
||||
radeon_emit(device->empty_cs[family], PKT3(PKT3_CONTEXT_CONTROL, 1, 0));
|
||||
radeon_emit(device->empty_cs[family], CONTEXT_CONTROL_LOAD_ENABLE(1));
|
||||
radeon_emit(device->empty_cs[family], CONTEXT_CONTROL_SHADOW_ENABLE(1));
|
||||
}
|
||||
radeon_emit(device->empty_cs[family], PKT3(PKT3_CONTEXT_CONTROL, 1, 0));
|
||||
radeon_emit(device->empty_cs[family], CONTEXT_CONTROL_LOAD_ENABLE(1));
|
||||
radeon_emit(device->empty_cs[family], CONTEXT_CONTROL_SHADOW_ENABLE(1));
|
||||
break;
|
||||
case RADV_QUEUE_COMPUTE:
|
||||
radeon_emit(device->empty_cs[family], PKT3(PKT3_NOP, 0, 0));
|
||||
@@ -2673,7 +2670,8 @@ radv_get_preamble_cs(struct radv_queue *queue,
|
||||
*initial_full_flush_preamble_cs = queue->initial_full_flush_preamble_cs;
|
||||
*initial_preamble_cs = queue->initial_preamble_cs;
|
||||
*continue_preamble_cs = queue->continue_preamble_cs;
|
||||
if (!scratch_size && !compute_scratch_size && !esgs_ring_size && !gsvs_ring_size)
|
||||
if (!scratch_size && !compute_scratch_size && !esgs_ring_size && !gsvs_ring_size &&
|
||||
!needs_tess_rings && !needs_sample_positions)
|
||||
*continue_preamble_cs = NULL;
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
@@ -1305,6 +1305,10 @@ get_external_image_format_properties(const VkPhysicalDeviceImageFormatInfo2 *pIm
|
||||
VkExternalMemoryFeatureFlagBits flags = 0;
|
||||
VkExternalMemoryHandleTypeFlags export_flags = 0;
|
||||
VkExternalMemoryHandleTypeFlags compat_flags = 0;
|
||||
|
||||
if (pImageFormatInfo->flags & VK_IMAGE_CREATE_SPARSE_BINDING_BIT)
|
||||
return;
|
||||
|
||||
switch (handleType) {
|
||||
case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT:
|
||||
case VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT:
|
||||
@@ -1381,14 +1385,9 @@ VkResult radv_GetPhysicalDeviceImageFormatProperties2(
|
||||
* present and VkExternalImageFormatProperties will be ignored.
|
||||
*/
|
||||
if (external_info && external_info->handleType != 0) {
|
||||
switch (external_info->handleType) {
|
||||
case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT:
|
||||
case VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT:
|
||||
case VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT:
|
||||
get_external_image_format_properties(base_info, external_info->handleType,
|
||||
&external_props->externalMemoryProperties);
|
||||
break;
|
||||
default:
|
||||
get_external_image_format_properties(base_info, external_info->handleType,
|
||||
&external_props->externalMemoryProperties);
|
||||
if (!external_props->externalMemoryProperties.externalMemoryFeatures) {
|
||||
/* From the Vulkan 1.0.97 spec:
|
||||
*
|
||||
* If handleType is not compatible with the [parameters] specified
|
||||
|
@@ -620,7 +620,7 @@ static unsigned gfx9_border_color_swizzle(const enum vk_swizzle swizzle[4])
|
||||
return bc_swizzle;
|
||||
}
|
||||
|
||||
static bool vi_alpha_is_on_msb(struct radv_device *device, VkFormat format)
|
||||
bool vi_alpha_is_on_msb(struct radv_device *device, VkFormat format)
|
||||
{
|
||||
const struct vk_format_description *desc = vk_format_description(format);
|
||||
|
||||
|
@@ -1444,7 +1444,9 @@ enum {
|
||||
RADV_DCC_CLEAR_SECONDARY_1 = 0x40404040U
|
||||
};
|
||||
|
||||
static void vi_get_fast_clear_parameters(VkFormat format,
|
||||
static void vi_get_fast_clear_parameters(struct radv_device *device,
|
||||
VkFormat image_format,
|
||||
VkFormat view_format,
|
||||
const VkClearColorValue *clear_value,
|
||||
uint32_t* reset_value,
|
||||
bool *can_avoid_fast_clear_elim)
|
||||
@@ -1453,18 +1455,20 @@ static void vi_get_fast_clear_parameters(VkFormat format,
|
||||
int extra_channel;
|
||||
bool main_value = false;
|
||||
bool extra_value = false;
|
||||
bool has_color = false;
|
||||
bool has_alpha = false;
|
||||
int i;
|
||||
*can_avoid_fast_clear_elim = false;
|
||||
|
||||
*reset_value = RADV_DCC_CLEAR_REG;
|
||||
|
||||
const struct vk_format_description *desc = vk_format_description(format);
|
||||
if (format == VK_FORMAT_B10G11R11_UFLOAT_PACK32 ||
|
||||
format == VK_FORMAT_R5G6B5_UNORM_PACK16 ||
|
||||
format == VK_FORMAT_B5G6R5_UNORM_PACK16)
|
||||
const struct vk_format_description *desc = vk_format_description(view_format);
|
||||
if (view_format == VK_FORMAT_B10G11R11_UFLOAT_PACK32 ||
|
||||
view_format == VK_FORMAT_R5G6B5_UNORM_PACK16 ||
|
||||
view_format == VK_FORMAT_B5G6R5_UNORM_PACK16)
|
||||
extra_channel = -1;
|
||||
else if (desc->layout == VK_FORMAT_LAYOUT_PLAIN) {
|
||||
if (radv_translate_colorswap(format, false) <= 1)
|
||||
if (vi_alpha_is_on_msb(device, view_format))
|
||||
extra_channel = desc->nr_channels - 1;
|
||||
else
|
||||
extra_channel = 0;
|
||||
@@ -1499,12 +1503,21 @@ static void vi_get_fast_clear_parameters(VkFormat format,
|
||||
return;
|
||||
}
|
||||
|
||||
if (index == extra_channel)
|
||||
if (index == extra_channel) {
|
||||
extra_value = values[i];
|
||||
else
|
||||
has_alpha = true;
|
||||
} else {
|
||||
main_value = values[i];
|
||||
has_color = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* If alpha isn't present, make it the same as color, and vice versa. */
|
||||
if (!has_alpha)
|
||||
extra_value = main_value;
|
||||
else if (!has_color)
|
||||
main_value = extra_value;
|
||||
|
||||
for (int i = 0; i < 4; ++i)
|
||||
if (values[i] != main_value &&
|
||||
desc->swizzle[i] - VK_SWIZZLE_X != extra_channel &&
|
||||
@@ -1564,7 +1577,9 @@ radv_can_fast_clear_color(struct radv_cmd_buffer *cmd_buffer,
|
||||
bool can_avoid_fast_clear_elim;
|
||||
uint32_t reset_value;
|
||||
|
||||
vi_get_fast_clear_parameters(iview->vk_format,
|
||||
vi_get_fast_clear_parameters(cmd_buffer->device,
|
||||
iview->image->vk_format,
|
||||
iview->vk_format,
|
||||
&clear_value, &reset_value,
|
||||
&can_avoid_fast_clear_elim);
|
||||
|
||||
@@ -1636,7 +1651,9 @@ radv_fast_clear_color(struct radv_cmd_buffer *cmd_buffer,
|
||||
bool can_avoid_fast_clear_elim;
|
||||
bool need_decompress_pass = false;
|
||||
|
||||
vi_get_fast_clear_parameters(iview->vk_format,
|
||||
vi_get_fast_clear_parameters(cmd_buffer->device,
|
||||
iview->image->vk_format,
|
||||
iview->vk_format,
|
||||
&clear_value, &reset_value,
|
||||
&can_avoid_fast_clear_elim);
|
||||
|
||||
|
@@ -535,7 +535,7 @@ create_depth_stencil_resolve_pipeline(struct radv_device *device,
|
||||
.pAttachments = &(VkAttachmentDescription) {
|
||||
.format = src_format,
|
||||
.loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE,
|
||||
.storeOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE,
|
||||
.storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE,
|
||||
.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_LOAD,
|
||||
.stencilStoreOp = VK_ATTACHMENT_STORE_OP_STORE,
|
||||
.initialLayout = VK_IMAGE_LAYOUT_GENERAL,
|
||||
|
@@ -1882,6 +1882,8 @@ VkResult radv_image_create(VkDevice _device,
|
||||
const VkAllocationCallbacks* alloc,
|
||||
VkImage *pImage);
|
||||
|
||||
bool vi_alpha_is_on_msb(struct radv_device *device, VkFormat format);
|
||||
|
||||
VkResult
|
||||
radv_image_from_gralloc(VkDevice device_h,
|
||||
const VkImageCreateInfo *base_info,
|
||||
|
@@ -161,12 +161,9 @@ si_emit_graphics(struct radv_physical_device *physical_device,
|
||||
{
|
||||
int i;
|
||||
|
||||
/* Since amdgpu version 3.6.0, CONTEXT_CONTROL is emitted by the kernel */
|
||||
if (physical_device->rad_info.drm_minor < 6) {
|
||||
radeon_emit(cs, PKT3(PKT3_CONTEXT_CONTROL, 1, 0));
|
||||
radeon_emit(cs, CONTEXT_CONTROL_LOAD_ENABLE(1));
|
||||
radeon_emit(cs, CONTEXT_CONTROL_SHADOW_ENABLE(1));
|
||||
}
|
||||
radeon_emit(cs, PKT3(PKT3_CONTEXT_CONTROL, 1, 0));
|
||||
radeon_emit(cs, CONTEXT_CONTROL_LOAD_ENABLE(1));
|
||||
radeon_emit(cs, CONTEXT_CONTROL_SHADOW_ENABLE(1));
|
||||
|
||||
if (physical_device->has_clear_state) {
|
||||
radeon_emit(cs, PKT3(PKT3_CLEAR_STATE, 0, 0));
|
||||
|
@@ -217,6 +217,7 @@ NIR_FILES = \
|
||||
nir/nir_control_flow_private.h \
|
||||
nir/nir_deref.c \
|
||||
nir/nir_deref.h \
|
||||
nir/nir_divergence_analysis.c \
|
||||
nir/nir_dominance.c \
|
||||
nir/nir_format_convert.h \
|
||||
nir/nir_from_ssa.c \
|
||||
|
@@ -106,7 +106,7 @@ bitcast_i642d(int64_t i)
|
||||
return d;
|
||||
}
|
||||
|
||||
static double
|
||||
static uint64_t
|
||||
bitcast_d2u64(double d)
|
||||
{
|
||||
assert(sizeof(double) == sizeof(uint64_t));
|
||||
@@ -115,7 +115,7 @@ bitcast_d2u64(double d)
|
||||
return u;
|
||||
}
|
||||
|
||||
static double
|
||||
static int64_t
|
||||
bitcast_d2i64(double d)
|
||||
{
|
||||
assert(sizeof(double) == sizeof(int64_t));
|
||||
|
@@ -283,15 +283,15 @@ link_set_uniform_initializers(struct gl_shader_program *prog,
|
||||
if (var->data.explicit_binding) {
|
||||
const glsl_type *const type = var->type;
|
||||
|
||||
if (type->without_array()->is_sampler() ||
|
||||
if (var->is_in_buffer_block()) {
|
||||
/* This case is handled by link_uniform_blocks (at
|
||||
* process_block_array_leaf)
|
||||
*/
|
||||
} else if (type->without_array()->is_sampler() ||
|
||||
type->without_array()->is_image()) {
|
||||
int binding = var->data.binding;
|
||||
linker::set_opaque_binding(mem_ctx, prog, var, var->type,
|
||||
var->name, &binding);
|
||||
} else if (var->is_in_buffer_block()) {
|
||||
/* This case is handled by link_uniform_blocks (at
|
||||
* process_block_array_leaf)
|
||||
*/
|
||||
} else if (type->contains_atomic()) {
|
||||
/* we don't actually need to do anything. */
|
||||
} else {
|
||||
|
@@ -1349,9 +1349,7 @@ glsl_type::get_function_instance(const glsl_type *return_type,
|
||||
const glsl_type *
|
||||
glsl_type::get_mul_type(const glsl_type *type_a, const glsl_type *type_b)
|
||||
{
|
||||
if (type_a == type_b) {
|
||||
return type_a;
|
||||
} else if (type_a->is_matrix() && type_b->is_matrix()) {
|
||||
if (type_a->is_matrix() && type_b->is_matrix()) {
|
||||
/* Matrix multiply. The columns of A must match the rows of B. Given
|
||||
* the other previously tested constraints, this means the vector type
|
||||
* of a row from A must be the same as the vector type of a column from
|
||||
@@ -1371,6 +1369,8 @@ glsl_type::get_mul_type(const glsl_type *type_a, const glsl_type *type_b)
|
||||
|
||||
return type;
|
||||
}
|
||||
} else if (type_a == type_b) {
|
||||
return type_a;
|
||||
} else if (type_a->is_matrix()) {
|
||||
/* A is a matrix and B is a column vector. Columns of A must match
|
||||
* rows of B. Given the other previously tested constraints, this
|
||||
|
@@ -334,6 +334,13 @@ dead_cf_list(struct exec_list *list, bool *list_ends_in_jump)
|
||||
bool dummy;
|
||||
progress |= dead_cf_list(&loop->body, &dummy);
|
||||
|
||||
nir_block *next = nir_cf_node_as_block(nir_cf_node_next(cur));
|
||||
if (next->predecessors->entries == 0 &&
|
||||
(!exec_list_is_empty(&next->instr_list) ||
|
||||
!exec_node_is_tail_sentinel(next->cf_node.node.next))) {
|
||||
remove_after_cf_node(cur);
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
@@ -107,6 +107,7 @@ build_constant_load(nir_builder *b, nir_deref_instr *deref,
|
||||
static void
|
||||
handle_constant_store(void *mem_ctx, struct var_info *info,
|
||||
nir_deref_instr *deref, nir_const_value *val,
|
||||
unsigned writemask,
|
||||
glsl_type_size_align_func size_align)
|
||||
{
|
||||
assert(!nir_deref_instr_has_indirect(deref));
|
||||
@@ -123,35 +124,35 @@ handle_constant_store(void *mem_ctx, struct var_info *info,
|
||||
char *dst = (char *)info->constant_data +
|
||||
nir_deref_instr_get_const_offset(deref, size_align);
|
||||
|
||||
switch (bit_size) {
|
||||
case 1:
|
||||
/* Booleans are special-cased to be 32-bit */
|
||||
for (unsigned i = 0; i < num_components; i++)
|
||||
for (unsigned i = 0; i < num_components; i++) {
|
||||
if (!(writemask & (1 << i)))
|
||||
continue;
|
||||
|
||||
switch (bit_size) {
|
||||
case 1:
|
||||
/* Booleans are special-cased to be 32-bit */
|
||||
((int32_t *)dst)[i] = -(int)val[i].b;
|
||||
break;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
for (unsigned i = 0; i < num_components; i++)
|
||||
case 8:
|
||||
((uint8_t *)dst)[i] = val[i].u8;
|
||||
break;
|
||||
break;
|
||||
|
||||
case 16:
|
||||
for (unsigned i = 0; i < num_components; i++)
|
||||
case 16:
|
||||
((uint16_t *)dst)[i] = val[i].u16;
|
||||
break;
|
||||
break;
|
||||
|
||||
case 32:
|
||||
for (unsigned i = 0; i < num_components; i++)
|
||||
case 32:
|
||||
((uint32_t *)dst)[i] = val[i].u32;
|
||||
break;
|
||||
break;
|
||||
|
||||
case 64:
|
||||
for (unsigned i = 0; i < num_components; i++)
|
||||
case 64:
|
||||
((uint64_t *)dst)[i] = val[i].u64;
|
||||
break;
|
||||
break;
|
||||
|
||||
default:
|
||||
unreachable("Invalid bit size");
|
||||
default:
|
||||
unreachable("Invalid bit size");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,10 +212,12 @@ nir_opt_large_constants(nir_shader *shader,
|
||||
|
||||
bool src_is_const = false;
|
||||
nir_deref_instr *src_deref = NULL, *dst_deref = NULL;
|
||||
unsigned writemask = 0;
|
||||
switch (intrin->intrinsic) {
|
||||
case nir_intrinsic_store_deref:
|
||||
dst_deref = nir_src_as_deref(intrin->src[0]);
|
||||
src_is_const = nir_src_is_const(intrin->src[1]);
|
||||
writemask = nir_intrinsic_write_mask(intrin);
|
||||
break;
|
||||
|
||||
case nir_intrinsic_load_deref:
|
||||
@@ -255,7 +258,8 @@ nir_opt_large_constants(nir_shader *shader,
|
||||
info->is_constant = false;
|
||||
} else {
|
||||
nir_const_value *val = nir_src_as_const_value(intrin->src[1]);
|
||||
handle_constant_store(var_infos, info, dst_deref, val, size_align);
|
||||
handle_constant_store(var_infos, info, dst_deref, val, writemask,
|
||||
size_align);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -109,12 +109,13 @@ remove_phis_block(nir_block *block, nir_builder *b)
|
||||
if (!srcs_same)
|
||||
continue;
|
||||
|
||||
/* We must have found at least one definition, since there must be at
|
||||
* least one forward edge.
|
||||
*/
|
||||
assert(def != NULL);
|
||||
if (!def) {
|
||||
/* In this case, the phi had no sources. So turn it into an undef. */
|
||||
|
||||
if (mov) {
|
||||
b->cursor = nir_after_phis(block);
|
||||
def = nir_ssa_undef(b, phi->dest.ssa.num_components,
|
||||
phi->dest.ssa.bit_size);
|
||||
} else if (mov) {
|
||||
/* If the sources were all movs from the same source with the same
|
||||
* swizzle, then we can't just pick a random move because it may not
|
||||
* dominate the phi node. Instead, we need to emit our own move after
|
||||
|
@@ -76,23 +76,48 @@ get_innermost_loop(nir_cf_node *node)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* return last block not after use_block with def_loop as it's innermost loop */
|
||||
static nir_block *
|
||||
adjust_block_for_loops(nir_block *use_block, nir_loop *def_loop)
|
||||
static bool
|
||||
loop_contains_block(nir_loop *loop, nir_block *block)
|
||||
{
|
||||
nir_loop *use_loop = NULL;
|
||||
nir_block *before = nir_cf_node_as_block(nir_cf_node_prev(&loop->cf_node));
|
||||
nir_block *after = nir_cf_node_as_block(nir_cf_node_next(&loop->cf_node));
|
||||
|
||||
for (nir_cf_node *node = &use_block->cf_node; node != NULL; node = node->parent) {
|
||||
if (def_loop && node == &def_loop->cf_node)
|
||||
break;
|
||||
if (node->type == nir_cf_node_loop)
|
||||
use_loop = nir_cf_node_as_loop(node);
|
||||
}
|
||||
if (use_loop) {
|
||||
return nir_block_cf_tree_prev(nir_loop_first_block(use_loop));
|
||||
} else {
|
||||
return use_block;
|
||||
return block->index > before->index && block->index < after->index;
|
||||
}
|
||||
|
||||
/* Given the LCA of all uses and the definition, find a block on the path
|
||||
* between them in the dominance tree that is outside of as many loops as
|
||||
* possible. If "sink_out_of_loops" is false, then we disallow sinking the
|
||||
* definition outside of the loop it's defined in (if any).
|
||||
*/
|
||||
|
||||
static nir_block *
|
||||
adjust_block_for_loops(nir_block *use_block, nir_block *def_block,
|
||||
bool sink_out_of_loops)
|
||||
{
|
||||
nir_loop *def_loop = NULL;
|
||||
if (!sink_out_of_loops)
|
||||
def_loop = get_innermost_loop(&def_block->cf_node);
|
||||
|
||||
for (nir_block *cur_block = use_block; cur_block != def_block->imm_dom;
|
||||
cur_block = cur_block->imm_dom) {
|
||||
if (!sink_out_of_loops && def_loop &&
|
||||
!loop_contains_block(def_loop, use_block)) {
|
||||
use_block = cur_block;
|
||||
continue;
|
||||
}
|
||||
|
||||
nir_cf_node *next = nir_cf_node_next(&cur_block->cf_node);
|
||||
if (next && next->type == nir_cf_node_loop) {
|
||||
nir_loop *following_loop = nir_cf_node_as_loop(next);
|
||||
if (loop_contains_block(following_loop, use_block)) {
|
||||
use_block = cur_block;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return use_block;
|
||||
}
|
||||
|
||||
/* iterate a ssa def's use's and try to find a more optimal block to
|
||||
@@ -102,14 +127,10 @@ adjust_block_for_loops(nir_block *use_block, nir_loop *def_loop)
|
||||
* the uses
|
||||
*/
|
||||
static nir_block *
|
||||
get_preferred_block(nir_ssa_def *def, bool sink_into_loops)
|
||||
get_preferred_block(nir_ssa_def *def, bool sink_into_loops, bool sink_out_of_loops)
|
||||
{
|
||||
nir_block *lca = NULL;
|
||||
|
||||
nir_loop *def_loop = NULL;
|
||||
if (!sink_into_loops)
|
||||
def_loop = get_innermost_loop(&def->parent_instr->block->cf_node);
|
||||
|
||||
nir_foreach_use(use, def) {
|
||||
nir_instr *instr = use->parent_instr;
|
||||
nir_block *use_block = instr->block;
|
||||
@@ -131,18 +152,6 @@ get_preferred_block(nir_ssa_def *def, bool sink_into_loops)
|
||||
use_block = phi_lca;
|
||||
}
|
||||
|
||||
/* If we're moving a load_ubo or load_interpolated_input, we don't want to
|
||||
* sink it down into loops, which may result in accessing memory or shared
|
||||
* functions multiple times. Sink it just above the start of the loop
|
||||
* where it's used. For load_consts, undefs, and comparisons, we expect
|
||||
* the driver to be able to emit them as simple ALU ops, so sinking as far
|
||||
* in as we can go is probably worth it for register pressure.
|
||||
*/
|
||||
if (!sink_into_loops) {
|
||||
use_block = adjust_block_for_loops(use_block, def_loop);
|
||||
assert(nir_block_dominates(def->parent_instr->block, use_block));
|
||||
}
|
||||
|
||||
lca = nir_dominance_lca(lca, use_block);
|
||||
}
|
||||
|
||||
@@ -150,14 +159,28 @@ get_preferred_block(nir_ssa_def *def, bool sink_into_loops)
|
||||
nir_block *use_block =
|
||||
nir_cf_node_as_block(nir_cf_node_prev(&use->parent_if->cf_node));
|
||||
|
||||
if (!sink_into_loops) {
|
||||
use_block = adjust_block_for_loops(use_block, def_loop);
|
||||
assert(nir_block_dominates(def->parent_instr->block, use_block));
|
||||
}
|
||||
|
||||
lca = nir_dominance_lca(lca, use_block);
|
||||
}
|
||||
|
||||
/* If we're moving a load_ubo or load_interpolated_input, we don't want to
|
||||
* sink it down into loops, which may result in accessing memory or shared
|
||||
* functions multiple times. Sink it just above the start of the loop
|
||||
* where it's used. For load_consts, undefs, and comparisons, we expect
|
||||
* the driver to be able to emit them as simple ALU ops, so sinking as far
|
||||
* in as we can go is probably worth it for register pressure.
|
||||
*/
|
||||
if (!sink_into_loops) {
|
||||
lca = adjust_block_for_loops(lca, def->parent_instr->block,
|
||||
sink_out_of_loops);
|
||||
assert(nir_block_dominates(def->parent_instr->block, lca));
|
||||
} else {
|
||||
/* sink_into_loops = true and sink_out_of_loops = false isn't
|
||||
* implemented yet because it's not used.
|
||||
*/
|
||||
assert(sink_out_of_loops);
|
||||
}
|
||||
|
||||
|
||||
return lca;
|
||||
}
|
||||
|
||||
@@ -199,8 +222,17 @@ nir_opt_sink(nir_shader *shader, nir_move_options options)
|
||||
continue;
|
||||
|
||||
nir_ssa_def *def = nir_instr_ssa_def(instr);
|
||||
|
||||
bool sink_into_loops = instr->type != nir_instr_type_intrinsic;
|
||||
/* Don't sink load_ubo out of loops because that can make its
|
||||
* resource divergent and break code like that which is generated
|
||||
* by nir_lower_non_uniform_access.
|
||||
*/
|
||||
bool sink_out_of_loops =
|
||||
instr->type != nir_instr_type_intrinsic ||
|
||||
nir_instr_as_intrinsic(instr)->intrinsic != nir_intrinsic_load_ubo;
|
||||
nir_block *use_block =
|
||||
get_preferred_block(def, instr->type != nir_instr_type_intrinsic);
|
||||
get_preferred_block(def, sink_into_loops, sink_out_of_loops);
|
||||
|
||||
if (!use_block || use_block == instr->block)
|
||||
continue;
|
||||
|
@@ -229,6 +229,26 @@ analyze_expression(const nir_alu_instr *instr, unsigned src,
|
||||
const struct nir_alu_instr *const alu =
|
||||
nir_instr_as_alu(instr->src[src].src.ssa->parent_instr);
|
||||
|
||||
const nir_alu_type use_type = nir_op_infos[instr->op].input_types[src];
|
||||
|
||||
/* Bail if the type of the instruction generating the value does not match
|
||||
* the type the value will be interpreted as. int/uint/bool can be
|
||||
* reinterpreted trivially. The most important cases are between float and
|
||||
* non-float.
|
||||
*/
|
||||
if (alu->op != nir_op_mov && alu->op != nir_op_bcsel) {
|
||||
const nir_alu_type use_base_type =
|
||||
nir_alu_type_get_base_type(use_type);
|
||||
const nir_alu_type src_base_type =
|
||||
nir_alu_type_get_base_type(nir_op_infos[alu->op].output_type);
|
||||
|
||||
if (use_base_type != src_base_type &&
|
||||
(use_base_type == nir_type_float ||
|
||||
src_base_type == nir_type_float)) {
|
||||
return (struct ssa_result_range){unknown, false};
|
||||
}
|
||||
}
|
||||
|
||||
struct hash_entry *he = _mesa_hash_table_search(ht, alu);
|
||||
if (he != NULL)
|
||||
return unpack_data(he->data);
|
||||
|
@@ -203,7 +203,7 @@ is_fsign(nir_alu_instr *instr, unsigned src,
|
||||
if (src_alu->op == nir_op_fneg)
|
||||
src_alu = nir_src_as_alu_instr(src_alu->src[0].src);
|
||||
|
||||
return src_alu->op == nir_op_fsign;
|
||||
return src_alu != NULL && src_alu->op == nir_op_fsign;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
|
@@ -231,8 +231,6 @@ droid_window_dequeue_buffer(struct dri2_egl_surface *dri2_surf)
|
||||
close(fence_fd);
|
||||
}
|
||||
|
||||
dri2_surf->buffer->common.incRef(&dri2_surf->buffer->common);
|
||||
|
||||
/* Record all the buffers created by ANativeWindow and update back buffer
|
||||
* for updating buffer's age in swap_buffers.
|
||||
*/
|
||||
@@ -289,7 +287,6 @@ droid_window_enqueue_buffer(_EGLDisplay *disp, struct dri2_egl_surface *dri2_sur
|
||||
dri2_surf->window->queueBuffer(dri2_surf->window, dri2_surf->buffer,
|
||||
fence_fd);
|
||||
|
||||
dri2_surf->buffer->common.decRef(&dri2_surf->buffer->common);
|
||||
dri2_surf->buffer = NULL;
|
||||
dri2_surf->back = NULL;
|
||||
|
||||
@@ -312,6 +309,7 @@ droid_window_cancel_buffer(struct dri2_egl_surface *dri2_surf)
|
||||
dri2_surf->out_fence_fd = -1;
|
||||
ret = dri2_surf->window->cancelBuffer(dri2_surf->window,
|
||||
dri2_surf->buffer, fence_fd);
|
||||
dri2_surf->buffer = NULL;
|
||||
if (ret < 0) {
|
||||
_eglLog(_EGL_WARNING, "ANativeWindow::cancelBuffer failed");
|
||||
dri2_surf->base.Lost = EGL_TRUE;
|
||||
|
@@ -754,61 +754,9 @@ dri2_x11_authenticate(_EGLDisplay *disp, uint32_t id)
|
||||
return dri2_x11_do_authenticate(dri2_dpy, id);
|
||||
}
|
||||
|
||||
static bool
|
||||
dri2_x11_config_match_attrib(struct dri2_egl_display *dri2_dpy,
|
||||
const __DRIconfig *config,
|
||||
unsigned int attrib,
|
||||
unsigned int value)
|
||||
{
|
||||
uint32_t config_val;
|
||||
if (!dri2_dpy->core->getConfigAttrib(config, attrib, &config_val))
|
||||
return false;
|
||||
return config_val == value;
|
||||
}
|
||||
|
||||
/**
|
||||
* See if the X server can export a pixmap with the given color depth.
|
||||
*
|
||||
* Glamor in xorg-server 1.20 can't export pixmaps which have a different
|
||||
* color depth than the root window as a DRI image. This makes it impossible
|
||||
* to expose pbuffer-only visuals with, say, 16bpp on a 24bpp X display.
|
||||
*/
|
||||
static bool
|
||||
x11_can_export_pixmap_with_bpp(struct dri2_egl_display *dri2_dpy, int bpp)
|
||||
{
|
||||
bool supported = false;
|
||||
|
||||
#ifdef HAVE_DRI3
|
||||
xcb_dri3_buffer_from_pixmap_cookie_t cookie;
|
||||
xcb_dri3_buffer_from_pixmap_reply_t *reply;
|
||||
|
||||
xcb_pixmap_t pixmap = xcb_generate_id(dri2_dpy->conn);
|
||||
xcb_create_pixmap(dri2_dpy->conn, bpp, pixmap, dri2_dpy->screen->root, 1, 1);
|
||||
cookie = xcb_dri3_buffer_from_pixmap(dri2_dpy->conn, pixmap);
|
||||
reply = xcb_dri3_buffer_from_pixmap_reply(dri2_dpy->conn, cookie, NULL);
|
||||
|
||||
if (reply) {
|
||||
int *fds = xcb_dri3_buffer_from_pixmap_reply_fds(dri2_dpy->conn, reply);
|
||||
|
||||
for (int i = 0; i < reply->nfd; i++) {
|
||||
close(fds[i]);
|
||||
}
|
||||
|
||||
supported = true;
|
||||
|
||||
free(reply);
|
||||
}
|
||||
|
||||
xcb_free_pixmap(dri2_dpy->conn, pixmap);
|
||||
#endif
|
||||
|
||||
return supported;
|
||||
}
|
||||
|
||||
static EGLBoolean
|
||||
dri2_x11_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
|
||||
_EGLDisplay *disp, bool supports_preserved,
|
||||
bool add_pbuffer_configs)
|
||||
_EGLDisplay *disp, bool supports_preserved)
|
||||
{
|
||||
xcb_depth_iterator_t d;
|
||||
xcb_visualtype_t *visuals;
|
||||
@@ -884,47 +832,6 @@ dri2_x11_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
|
||||
xcb_depth_next(&d);
|
||||
}
|
||||
|
||||
/* Add a 565-no-depth-no-stencil pbuffer-only config. If X11 is depth 24,
|
||||
* we wouldn't have 565 available, which the CTS demands.
|
||||
*/
|
||||
if (add_pbuffer_configs && x11_can_export_pixmap_with_bpp(dri2_dpy, 16)) {
|
||||
for (int j = 0; dri2_dpy->driver_configs[j]; j++) {
|
||||
const __DRIconfig *config = dri2_dpy->driver_configs[j];
|
||||
const EGLint config_attrs[] = {
|
||||
EGL_NATIVE_VISUAL_ID, 0,
|
||||
EGL_NATIVE_VISUAL_TYPE, EGL_NONE,
|
||||
EGL_NONE
|
||||
};
|
||||
EGLint surface_type = EGL_PBUFFER_BIT;
|
||||
unsigned int rgba_masks[4] = {
|
||||
0x1f << 11,
|
||||
0x3f << 5,
|
||||
0x1f << 0,
|
||||
0,
|
||||
};
|
||||
|
||||
/* Check that we've found single-sample, no depth, no stencil,
|
||||
* and single-buffered.
|
||||
*/
|
||||
if (!dri2_x11_config_match_attrib(dri2_dpy, config,
|
||||
__DRI_ATTRIB_DEPTH_SIZE, 0) ||
|
||||
!dri2_x11_config_match_attrib(dri2_dpy, config,
|
||||
__DRI_ATTRIB_STENCIL_SIZE, 0) ||
|
||||
!dri2_x11_config_match_attrib(dri2_dpy, config,
|
||||
__DRI_ATTRIB_SAMPLES, 0) ||
|
||||
!dri2_x11_config_match_attrib(dri2_dpy, config,
|
||||
__DRI_ATTRIB_DOUBLE_BUFFER, 0)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (dri2_add_config(disp, config, config_count + 1, surface_type,
|
||||
config_attrs, rgba_masks)) {
|
||||
config_count++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!config_count) {
|
||||
_eglLog(_EGL_WARNING, "DRI2: failed to create any config");
|
||||
return EGL_FALSE;
|
||||
@@ -1400,7 +1307,7 @@ dri2_initialize_x11_swrast(_EGLDriver *drv, _EGLDisplay *disp)
|
||||
|
||||
dri2_setup_screen(disp);
|
||||
|
||||
if (!dri2_x11_add_configs_for_visuals(dri2_dpy, disp, true, false))
|
||||
if (!dri2_x11_add_configs_for_visuals(dri2_dpy, disp, true))
|
||||
goto cleanup;
|
||||
|
||||
/* Fill vtbl last to prevent accidentally calling virtual function during
|
||||
@@ -1498,7 +1405,7 @@ dri2_initialize_x11_dri3(_EGLDriver *drv, _EGLDisplay *disp)
|
||||
|
||||
dri2_set_WL_bind_wayland_display(drv, disp);
|
||||
|
||||
if (!dri2_x11_add_configs_for_visuals(dri2_dpy, disp, false, true))
|
||||
if (!dri2_x11_add_configs_for_visuals(dri2_dpy, disp, false))
|
||||
goto cleanup;
|
||||
|
||||
dri2_dpy->loader_dri3_ext.core = dri2_dpy->core;
|
||||
@@ -1608,7 +1515,7 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
|
||||
|
||||
dri2_set_WL_bind_wayland_display(drv, disp);
|
||||
|
||||
if (!dri2_x11_add_configs_for_visuals(dri2_dpy, disp, true, false))
|
||||
if (!dri2_x11_add_configs_for_visuals(dri2_dpy, disp, true))
|
||||
goto cleanup;
|
||||
|
||||
/* Fill vtbl last to prevent accidentally calling virtual function during
|
||||
|
@@ -176,21 +176,23 @@ libegl = shared_library(
|
||||
# If using glvnd the pkg-config header should not point to EGL_mesa, it should
|
||||
# point to EGL. glvnd is only available on unix like platforms so adding -l
|
||||
# should be safe here
|
||||
if with_glvnd and glvnd_missing_pc_files
|
||||
_egl = '-L${libdir} -lEGL'
|
||||
else
|
||||
_egl = libegl
|
||||
endif
|
||||
if not with_glvnd or not glvnd_has_headers_and_pc_files
|
||||
if not glvnd_has_headers_and_pc_files
|
||||
_egl = '-L${libdir} -lEGL'
|
||||
else
|
||||
_egl = libegl
|
||||
endif
|
||||
|
||||
pkg.generate(
|
||||
name : 'egl',
|
||||
description : 'Mesa EGL Library',
|
||||
version : meson.project_version(),
|
||||
libraries : _egl,
|
||||
libraries_private: gl_priv_libs,
|
||||
requires_private : gl_priv_reqs,
|
||||
extra_cflags : gl_pkgconfig_c_flags,
|
||||
)
|
||||
pkg.generate(
|
||||
name : 'egl',
|
||||
description : 'Mesa EGL Library',
|
||||
version : meson.project_version(),
|
||||
libraries : _egl,
|
||||
libraries_private: gl_priv_libs,
|
||||
requires_private : gl_priv_reqs,
|
||||
extra_cflags : gl_pkgconfig_c_flags,
|
||||
)
|
||||
endif
|
||||
|
||||
if with_tests and prog_nm.found()
|
||||
if with_glvnd
|
||||
|
@@ -313,14 +313,19 @@ dd_screen_resource_get_handle(struct pipe_screen *_screen,
|
||||
|
||||
static bool
|
||||
dd_screen_resource_get_param(struct pipe_screen *_screen,
|
||||
struct pipe_context *_pipe,
|
||||
struct pipe_resource *resource,
|
||||
unsigned int plane,
|
||||
unsigned plane,
|
||||
unsigned layer,
|
||||
enum pipe_resource_param param,
|
||||
unsigned handle_usage,
|
||||
uint64_t *value)
|
||||
{
|
||||
struct pipe_screen *screen = dd_screen(_screen)->screen;
|
||||
struct pipe_context *pipe = _pipe ? dd_context(_pipe)->pipe : NULL;
|
||||
|
||||
return screen->resource_get_param(screen, resource, plane, param, value);
|
||||
return screen->resource_get_param(screen, pipe, resource, plane, layer,
|
||||
param, handle_usage, value);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -157,9 +157,12 @@ static bool noop_resource_get_handle(struct pipe_screen *pscreen,
|
||||
}
|
||||
|
||||
static bool noop_resource_get_param(struct pipe_screen *pscreen,
|
||||
struct pipe_context *ctx,
|
||||
struct pipe_resource *resource,
|
||||
unsigned int plane,
|
||||
unsigned plane,
|
||||
unsigned layer,
|
||||
enum pipe_resource_param param,
|
||||
unsigned handle_usage,
|
||||
uint64_t *value)
|
||||
{
|
||||
struct noop_pipe_screen *noop_screen = (struct noop_pipe_screen*)pscreen;
|
||||
@@ -172,7 +175,8 @@ static bool noop_resource_get_param(struct pipe_screen *pscreen,
|
||||
if (!tex)
|
||||
return false;
|
||||
|
||||
result = screen->resource_get_param(screen, tex, 0, param, value);
|
||||
result = screen->resource_get_param(screen, NULL, tex, 0, 0, param,
|
||||
handle_usage, value);
|
||||
pipe_resource_reference(&tex, NULL);
|
||||
return result;
|
||||
}
|
||||
|
@@ -114,10 +114,15 @@ rbug_draw_block_locked(struct rbug_context *rb_pipe, int flag)
|
||||
}
|
||||
|
||||
static void
|
||||
rbug_draw_vbo(struct pipe_context *_pipe, const struct pipe_draw_info *info)
|
||||
rbug_draw_vbo(struct pipe_context *_pipe, const struct pipe_draw_info *_info)
|
||||
{
|
||||
struct rbug_context *rb_pipe = rbug_context(_pipe);
|
||||
struct pipe_context *pipe = rb_pipe->pipe;
|
||||
struct pipe_draw_info info;
|
||||
|
||||
info = *_info;
|
||||
if(_info->index_size && !_info->has_user_indices)
|
||||
info.index.resource = rbug_resource_unwrap(_info->index.resource);
|
||||
|
||||
mtx_lock(&rb_pipe->draw_mutex);
|
||||
rbug_draw_block_locked(rb_pipe, RBUG_BLOCK_BEFORE);
|
||||
@@ -127,7 +132,7 @@ rbug_draw_vbo(struct pipe_context *_pipe, const struct pipe_draw_info *info)
|
||||
if (!(rb_pipe->curr.shader[PIPE_SHADER_FRAGMENT] && rb_pipe->curr.shader[PIPE_SHADER_FRAGMENT]->disabled) &&
|
||||
!(rb_pipe->curr.shader[PIPE_SHADER_GEOMETRY] && rb_pipe->curr.shader[PIPE_SHADER_GEOMETRY]->disabled) &&
|
||||
!(rb_pipe->curr.shader[PIPE_SHADER_VERTEX] && rb_pipe->curr.shader[PIPE_SHADER_VERTEX]->disabled))
|
||||
pipe->draw_vbo(pipe, info);
|
||||
pipe->draw_vbo(pipe, &info);
|
||||
mtx_unlock(&rb_pipe->call_mutex);
|
||||
|
||||
rbug_draw_block_locked(rb_pipe, RBUG_BLOCK_AFTER);
|
||||
|
@@ -217,17 +217,23 @@ rbug_screen_resource_get_handle(struct pipe_screen *_screen,
|
||||
|
||||
static bool
|
||||
rbug_screen_resource_get_param(struct pipe_screen *_screen,
|
||||
struct pipe_context *_pipe,
|
||||
struct pipe_resource *_resource,
|
||||
unsigned int plane,
|
||||
unsigned plane,
|
||||
unsigned layer,
|
||||
enum pipe_resource_param param,
|
||||
unsigned handle_usage,
|
||||
uint64_t *value)
|
||||
{
|
||||
struct rbug_screen *rb_screen = rbug_screen(_screen);
|
||||
struct rbug_context *rb_pipe = rbug_context(_pipe);
|
||||
struct rbug_resource *rb_resource = rbug_resource(_resource);
|
||||
struct pipe_screen *screen = rb_screen->screen;
|
||||
struct pipe_resource *resource = rb_resource->resource;
|
||||
|
||||
return screen->resource_get_param(screen, resource, plane, param, value);
|
||||
return screen->resource_get_param(screen, rb_pipe ? rb_pipe->pipe : NULL,
|
||||
resource, plane, layer, param,
|
||||
handle_usage, value);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -409,17 +409,23 @@ trace_screen_resource_get_handle(struct pipe_screen *_screen,
|
||||
|
||||
static bool
|
||||
trace_screen_resource_get_param(struct pipe_screen *_screen,
|
||||
struct pipe_context *_pipe,
|
||||
struct pipe_resource *resource,
|
||||
unsigned int plane,
|
||||
unsigned plane,
|
||||
unsigned layer,
|
||||
enum pipe_resource_param param,
|
||||
unsigned handle_usage,
|
||||
uint64_t *value)
|
||||
{
|
||||
struct trace_screen *tr_screen = trace_screen(_screen);
|
||||
struct trace_context *tr_pipe = _pipe ? trace_context(_pipe) : NULL;
|
||||
struct pipe_screen *screen = tr_screen->screen;
|
||||
|
||||
/* TODO trace call */
|
||||
|
||||
return screen->resource_get_param(screen, resource, plane, param, value);
|
||||
return screen->resource_get_param(screen, tr_pipe ? tr_pipe->pipe : NULL,
|
||||
resource, plane, layer, param,
|
||||
handle_usage, value);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -555,7 +555,7 @@ lp_build_add(struct lp_build_context *bld,
|
||||
return bld->one;
|
||||
|
||||
if (!type.floating && !type.fixed) {
|
||||
if (HAVE_LLVM >= 0x0900) {
|
||||
if (HAVE_LLVM >= 0x0800) {
|
||||
char intrin[32];
|
||||
intrinsic = type.sign ? "llvm.sadd.sat" : "llvm.uadd.sat";
|
||||
lp_format_intrinsic(intrin, sizeof intrin, intrinsic, bld->vec_type);
|
||||
@@ -564,11 +564,9 @@ lp_build_add(struct lp_build_context *bld,
|
||||
if (type.width * type.length == 128) {
|
||||
if (util_cpu_caps.has_sse2) {
|
||||
if (type.width == 8)
|
||||
intrinsic = type.sign ? "llvm.x86.sse2.padds.b" :
|
||||
HAVE_LLVM < 0x0800 ? "llvm.x86.sse2.paddus.b" : NULL;
|
||||
intrinsic = type.sign ? "llvm.x86.sse2.padds.b" : "llvm.x86.sse2.paddus.b";
|
||||
if (type.width == 16)
|
||||
intrinsic = type.sign ? "llvm.x86.sse2.padds.w" :
|
||||
HAVE_LLVM < 0x0800 ? "llvm.x86.sse2.paddus.w" : NULL;
|
||||
intrinsic = type.sign ? "llvm.x86.sse2.padds.w" : "llvm.x86.sse2.paddus.w";
|
||||
} else if (util_cpu_caps.has_altivec) {
|
||||
if (type.width == 8)
|
||||
intrinsic = type.sign ? "llvm.ppc.altivec.vaddsbs" : "llvm.ppc.altivec.vaddubs";
|
||||
@@ -579,11 +577,9 @@ lp_build_add(struct lp_build_context *bld,
|
||||
if (type.width * type.length == 256) {
|
||||
if (util_cpu_caps.has_avx2) {
|
||||
if (type.width == 8)
|
||||
intrinsic = type.sign ? "llvm.x86.avx2.padds.b" :
|
||||
HAVE_LLVM < 0x0800 ? "llvm.x86.avx2.paddus.b" : NULL;
|
||||
intrinsic = type.sign ? "llvm.x86.avx2.padds.b" : "llvm.x86.avx2.paddus.b";
|
||||
if (type.width == 16)
|
||||
intrinsic = type.sign ? "llvm.x86.avx2.padds.w" :
|
||||
HAVE_LLVM < 0x0800 ? "llvm.x86.avx2.paddus.w" : NULL;
|
||||
intrinsic = type.sign ? "llvm.x86.avx2.padds.w" : "llvm.x86.avx2.paddus.w";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -883,7 +879,7 @@ lp_build_sub(struct lp_build_context *bld,
|
||||
return bld->zero;
|
||||
|
||||
if (!type.floating && !type.fixed) {
|
||||
if (HAVE_LLVM >= 0x0900) {
|
||||
if (HAVE_LLVM >= 0x0800) {
|
||||
char intrin[32];
|
||||
intrinsic = type.sign ? "llvm.ssub.sat" : "llvm.usub.sat";
|
||||
lp_format_intrinsic(intrin, sizeof intrin, intrinsic, bld->vec_type);
|
||||
@@ -892,11 +888,9 @@ lp_build_sub(struct lp_build_context *bld,
|
||||
if (type.width * type.length == 128) {
|
||||
if (util_cpu_caps.has_sse2) {
|
||||
if (type.width == 8)
|
||||
intrinsic = type.sign ? "llvm.x86.sse2.psubs.b" :
|
||||
HAVE_LLVM < 0x0800 ? "llvm.x86.sse2.psubus.b" : NULL;
|
||||
intrinsic = type.sign ? "llvm.x86.sse2.psubs.b" : "llvm.x86.sse2.psubus.b";
|
||||
if (type.width == 16)
|
||||
intrinsic = type.sign ? "llvm.x86.sse2.psubs.w" :
|
||||
HAVE_LLVM < 0x0800 ? "llvm.x86.sse2.psubus.w" : NULL;
|
||||
intrinsic = type.sign ? "llvm.x86.sse2.psubs.w" : "llvm.x86.sse2.psubus.w";
|
||||
} else if (util_cpu_caps.has_altivec) {
|
||||
if (type.width == 8)
|
||||
intrinsic = type.sign ? "llvm.ppc.altivec.vsubsbs" : "llvm.ppc.altivec.vsububs";
|
||||
@@ -907,11 +901,9 @@ lp_build_sub(struct lp_build_context *bld,
|
||||
if (type.width * type.length == 256) {
|
||||
if (util_cpu_caps.has_avx2) {
|
||||
if (type.width == 8)
|
||||
intrinsic = type.sign ? "llvm.x86.avx2.psubs.b" :
|
||||
HAVE_LLVM < 0x0800 ? "llvm.x86.avx2.psubus.b" : NULL;
|
||||
intrinsic = type.sign ? "llvm.x86.avx2.psubs.b" : "llvm.x86.avx2.psubus.b";
|
||||
if (type.width == 16)
|
||||
intrinsic = type.sign ? "llvm.x86.avx2.psubs.w" :
|
||||
HAVE_LLVM < 0x0800 ? "llvm.x86.avx2.psubus.w" : NULL;
|
||||
intrinsic = type.sign ? "llvm.x86.avx2.psubs.w" : "llvm.x86.avx2.psubus.w";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -283,9 +283,9 @@ int rbug_send_texture_info_reply(struct rbug_connection *__con,
|
||||
uint32_t format,
|
||||
uint32_t *width,
|
||||
uint32_t width_len,
|
||||
uint16_t *height,
|
||||
uint16_t *h16,
|
||||
uint32_t height_len,
|
||||
uint16_t *depth,
|
||||
uint16_t *d16,
|
||||
uint32_t depth_len,
|
||||
uint32_t blockw,
|
||||
uint32_t blockh,
|
||||
@@ -299,6 +299,8 @@ int rbug_send_texture_info_reply(struct rbug_connection *__con,
|
||||
uint32_t __pos = 0;
|
||||
uint8_t *__data = NULL;
|
||||
int __ret = 0;
|
||||
uint32_t *height = alloca(sizeof(uint32_t) * height_len);
|
||||
uint32_t *depth = alloca(sizeof(uint32_t) * height_len);
|
||||
|
||||
LEN(8); /* header */
|
||||
LEN(4); /* serial */
|
||||
@@ -321,6 +323,11 @@ int rbug_send_texture_info_reply(struct rbug_connection *__con,
|
||||
if (!__data)
|
||||
return -ENOMEM;
|
||||
|
||||
for (int i = 0; i < height_len; i++)
|
||||
height[i] = h16[i];
|
||||
for (int i = 0; i < depth_len; i++)
|
||||
depth[i] = d16[i];
|
||||
|
||||
WRITE(4, int32_t, ((int32_t)RBUG_OP_TEXTURE_INFO_REPLY));
|
||||
WRITE(4, uint32_t, ((uint32_t)(__len / 4)));
|
||||
WRITE(4, uint32_t, serial); /* serial */
|
||||
|
@@ -221,7 +221,6 @@ dri3_alloc_back_buffer(struct vl_dri3_screen *scrn)
|
||||
int buffer_fd, fence_fd;
|
||||
struct pipe_resource templ, *pixmap_buffer_texture;
|
||||
struct winsys_handle whandle;
|
||||
unsigned usage;
|
||||
|
||||
buffer = CALLOC_STRUCT(vl_dri3_buffer);
|
||||
if (!buffer)
|
||||
@@ -271,10 +270,8 @@ dri3_alloc_back_buffer(struct vl_dri3_screen *scrn)
|
||||
}
|
||||
memset(&whandle, 0, sizeof(whandle));
|
||||
whandle.type= WINSYS_HANDLE_TYPE_FD;
|
||||
usage = PIPE_HANDLE_USAGE_EXPLICIT_FLUSH;
|
||||
scrn->base.pscreen->resource_get_handle(scrn->base.pscreen, NULL,
|
||||
pixmap_buffer_texture, &whandle,
|
||||
usage);
|
||||
pixmap_buffer_texture, &whandle, 0);
|
||||
buffer_fd = whandle.handle;
|
||||
buffer->pitch = whandle.stride;
|
||||
buffer->width = templ.width0;
|
||||
|
@@ -330,7 +330,7 @@ etna_emit_state(struct etna_context *ctx)
|
||||
/*14680*/ EMIT_STATE(NFE_VERTEX_STREAMS_VERTEX_DIVISOR(x), ctx->vertex_buffer.cvb[x].FE_VERTEX_STREAM_UNK14680);
|
||||
}
|
||||
}
|
||||
} else if(ctx->specs.stream_count >= 1) { /* hw w/ multiple vertex streams */
|
||||
} else if(ctx->specs.stream_count > 1) { /* hw w/ multiple vertex streams */
|
||||
for (int x = 0; x < ctx->vertex_buffer.count; ++x) {
|
||||
/*00680*/ EMIT_STATE_RELOC(FE_VERTEX_STREAMS_BASE_ADDR(x), &ctx->vertex_buffer.cvb[x].FE_VERTEX_STREAM_BASE_ADDR);
|
||||
}
|
||||
|
@@ -402,7 +402,7 @@ enum modifier_priority {
|
||||
MODIFIER_PRIORITY_SUPER_TILED,
|
||||
};
|
||||
|
||||
const uint64_t priority_to_modifier[] = {
|
||||
static const uint64_t priority_to_modifier[] = {
|
||||
[MODIFIER_PRIORITY_INVALID] = DRM_FORMAT_MOD_INVALID,
|
||||
[MODIFIER_PRIORITY_LINEAR] = DRM_FORMAT_MOD_LINEAR,
|
||||
[MODIFIER_PRIORITY_SPLIT_TILED] = DRM_FORMAT_MOD_VIVANTE_SPLIT_TILED,
|
||||
|
@@ -1227,6 +1227,9 @@ iris_update_compiled_tcs(struct iris_context *ice)
|
||||
.tes_primitive_mode = tes_info->tess.primitive_mode,
|
||||
.input_vertices =
|
||||
!tcs || compiler->use_tcs_8_patch ? ice->state.vertices_per_patch : 0,
|
||||
.quads_workaround = devinfo->gen < 9 &&
|
||||
tes_info->tess.primitive_mode == GL_QUADS &&
|
||||
tes_info->tess.spacing == TESS_SPACING_EQUAL,
|
||||
};
|
||||
get_unified_tess_slots(ice, &key.outputs_written,
|
||||
&key.patch_outputs_written);
|
||||
|
@@ -628,6 +628,28 @@ supports_ccs(const struct gen_device_info *devinfo,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
want_ccs_e_for_format(const struct gen_device_info *devinfo,
|
||||
enum isl_format format)
|
||||
{
|
||||
if (!isl_format_supports_ccs_e(devinfo, format))
|
||||
return false;
|
||||
|
||||
const struct isl_format_layout *fmtl = isl_format_get_layout(format);
|
||||
|
||||
/* CCS_E seems to significantly hurt performance with 32-bit floating
|
||||
* point formats. For example, Paraview's "Wavelet Volume" case uses
|
||||
* both R32_FLOAT and R32G32B32A32_FLOAT, and enabling CCS_E for those
|
||||
* formats causes a 62% FPS drop.
|
||||
*
|
||||
* However, many benchmarks seem to use 16-bit float with no issues.
|
||||
*/
|
||||
if (fmtl->channels.r.bits == 32 && fmtl->channels.r.type == ISL_SFLOAT)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static struct pipe_resource *
|
||||
iris_resource_create_for_buffer(struct pipe_screen *pscreen,
|
||||
const struct pipe_resource *templ)
|
||||
@@ -765,7 +787,7 @@ iris_resource_create_with_modifiers(struct pipe_screen *pscreen,
|
||||
res->aux.possible_usages |= 1 << ISL_AUX_USAGE_HIZ;
|
||||
} else if (likely(!(INTEL_DEBUG & DEBUG_NO_RBC)) &&
|
||||
supports_ccs(devinfo, &res->surf)) {
|
||||
if (isl_format_supports_ccs_e(devinfo, res->surf.format))
|
||||
if (want_ccs_e_for_format(devinfo, res->surf.format))
|
||||
res->aux.possible_usages |= 1 << ISL_AUX_USAGE_CCS_E;
|
||||
|
||||
if (isl_format_supports_ccs_d(devinfo, res->surf.format))
|
||||
@@ -1023,21 +1045,49 @@ iris_flush_resource(struct pipe_context *ctx, struct pipe_resource *resource)
|
||||
mod ? mod->supports_clear_color : false);
|
||||
}
|
||||
|
||||
static void
|
||||
iris_resource_disable_aux_on_first_query(struct pipe_resource *resource,
|
||||
unsigned usage)
|
||||
{
|
||||
struct iris_resource *res = (struct iris_resource *)resource;
|
||||
bool mod_with_aux =
|
||||
res->mod_info && res->mod_info->aux_usage != ISL_AUX_USAGE_NONE;
|
||||
|
||||
/* Disable aux usage if explicit flush not set and this is the first time
|
||||
* we are dealing with this resource and the resource was not created with
|
||||
* a modifier with aux.
|
||||
*/
|
||||
if (!mod_with_aux &&
|
||||
(!(usage & PIPE_HANDLE_USAGE_EXPLICIT_FLUSH) && res->aux.usage != 0) &&
|
||||
p_atomic_read(&resource->reference.count) == 1) {
|
||||
iris_resource_disable_aux(res);
|
||||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
iris_resource_get_param(struct pipe_screen *screen,
|
||||
struct pipe_context *context,
|
||||
struct pipe_resource *resource,
|
||||
unsigned int plane,
|
||||
unsigned plane,
|
||||
unsigned layer,
|
||||
enum pipe_resource_param param,
|
||||
unsigned handle_usage,
|
||||
uint64_t *value)
|
||||
{
|
||||
struct iris_resource *res = (struct iris_resource *)resource;
|
||||
bool mod_with_aux =
|
||||
res->mod_info && res->mod_info->aux_usage != ISL_AUX_USAGE_NONE;
|
||||
bool wants_aux = mod_with_aux && plane > 0;
|
||||
struct iris_bo *bo = wants_aux ? res->aux.bo : res->bo;
|
||||
bool result;
|
||||
unsigned handle;
|
||||
|
||||
if (iris_resource_unfinished_aux_import(res))
|
||||
iris_resource_finish_aux_import(screen, res);
|
||||
|
||||
struct iris_bo *bo = wants_aux ? res->aux.bo : res->bo;
|
||||
|
||||
iris_resource_disable_aux_on_first_query(resource, handle_usage);
|
||||
|
||||
switch (param) {
|
||||
case PIPE_RESOURCE_PARAM_NPLANES:
|
||||
if (mod_with_aux) {
|
||||
@@ -1088,15 +1138,7 @@ iris_resource_get_handle(struct pipe_screen *pscreen,
|
||||
bool mod_with_aux =
|
||||
res->mod_info && res->mod_info->aux_usage != ISL_AUX_USAGE_NONE;
|
||||
|
||||
/* Disable aux usage if explicit flush not set and this is the first time
|
||||
* we are dealing with this resource and the resource was not created with
|
||||
* a modifier with aux.
|
||||
*/
|
||||
if (!mod_with_aux &&
|
||||
(!(usage & PIPE_HANDLE_USAGE_EXPLICIT_FLUSH) && res->aux.usage != 0) &&
|
||||
p_atomic_read(&resource->reference.count) == 1) {
|
||||
iris_resource_disable_aux(res);
|
||||
}
|
||||
iris_resource_disable_aux_on_first_query(resource, usage);
|
||||
|
||||
struct iris_bo *bo;
|
||||
if (mod_with_aux && whandle->plane > 0) {
|
||||
|
@@ -845,6 +845,8 @@ struct iris_vertex_buffer_state {
|
||||
|
||||
/** The resource to source vertex data from. */
|
||||
struct pipe_resource *resource;
|
||||
|
||||
int offset;
|
||||
};
|
||||
|
||||
struct iris_depth_buffer_state {
|
||||
@@ -2866,6 +2868,8 @@ iris_set_vertex_buffers(struct pipe_context *ctx,
|
||||
pipe_resource_reference(&state->resource, buffer->buffer.resource);
|
||||
struct iris_resource *res = (void *) state->resource;
|
||||
|
||||
state->offset = (int) buffer->buffer_offset;
|
||||
|
||||
if (res) {
|
||||
ice->state.bound_vertex_buffers |= 1ull << (start_slot + i);
|
||||
res->bind_history |= PIPE_BIND_VERTEX_BUFFER;
|
||||
@@ -5841,11 +5845,11 @@ iris_destroy_state(struct iris_context *ice)
|
||||
pipe_resource_reference(&ice->draw.draw_params_res, NULL);
|
||||
pipe_resource_reference(&ice->draw.derived_draw_params_res, NULL);
|
||||
|
||||
uint64_t bound_vbs = ice->state.bound_vertex_buffers;
|
||||
while (bound_vbs) {
|
||||
const int i = u_bit_scan64(&bound_vbs);
|
||||
/* Loop over all VBOs, including ones for draw parameters */
|
||||
for (unsigned i = 0; i < ARRAY_SIZE(genx->vertex_buffers); i++) {
|
||||
pipe_resource_reference(&genx->vertex_buffers[i].resource, NULL);
|
||||
}
|
||||
|
||||
free(ice->state.genx);
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
@@ -5929,8 +5933,8 @@ iris_rebind_buffer(struct iris_context *ice,
|
||||
STATIC_ASSERT(GENX(VERTEX_BUFFER_STATE_BufferStartingAddress_bits) == 64);
|
||||
uint64_t *addr = (uint64_t *) &state->state[1];
|
||||
|
||||
if (*addr == old_address) {
|
||||
*addr = res->bo->gtt_offset;
|
||||
if (*addr == old_address + state->offset) {
|
||||
*addr = res->bo->gtt_offset + state->offset;
|
||||
ice->state.dirty |= IRIS_DIRTY_VERTEX_BUFFERS;
|
||||
}
|
||||
}
|
||||
|
@@ -66,12 +66,12 @@ foreach v : ['80', '90', '100', '110']
|
||||
iris_gen_libs += static_library(
|
||||
'libiris_gen@0@'.format(v),
|
||||
['iris_blorp.c', 'iris_query.c', 'iris_state.c', gen_xml_pack],
|
||||
include_directories : [inc_common, inc_intel, inc_nir],
|
||||
include_directories : [inc_common, inc_intel],
|
||||
c_args : [
|
||||
c_vis_args, no_override_init_args, c_sse2_args,
|
||||
'-DGEN_VERSIONx10=@0@'.format(v),
|
||||
],
|
||||
dependencies : [dep_libdrm, dep_valgrind],
|
||||
dependencies : [dep_libdrm, dep_valgrind, idep_nir_headers],
|
||||
)
|
||||
endforeach
|
||||
|
||||
|
@@ -210,13 +210,13 @@ files_libnouveau = files(
|
||||
|
||||
libnouveau = static_library(
|
||||
'nouveau',
|
||||
[files_libnouveau, nir_opcodes_h],
|
||||
files_libnouveau,
|
||||
include_directories : [
|
||||
inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_common,
|
||||
],
|
||||
c_args : [c_vis_args],
|
||||
cpp_args : [cpp_vis_args],
|
||||
dependencies : [dep_libdrm, dep_libdrm_nouveau],
|
||||
dependencies : [dep_libdrm, dep_libdrm_nouveau, idep_nir_headers],
|
||||
)
|
||||
|
||||
nouveau_compiler = executable(
|
||||
|
@@ -178,6 +178,7 @@ void si_vid_join_surfaces(struct si_context *sctx,
|
||||
surfaces[i]->u.gfx9.offset[j] += off;
|
||||
}
|
||||
|
||||
surfaces[i]->flags |= RADEON_SURF_IMPORTED;
|
||||
off += surfaces[i]->surf_size;
|
||||
}
|
||||
|
||||
|
@@ -1700,7 +1700,9 @@ si_make_CB_shader_coherent(struct si_context *sctx, unsigned num_samples,
|
||||
SI_CONTEXT_INV_VCACHE;
|
||||
|
||||
if (sctx->chip_class >= GFX10) {
|
||||
if (shaders_read_metadata)
|
||||
if (sctx->screen->info.tcc_harvested)
|
||||
sctx->flags |= SI_CONTEXT_INV_L2;
|
||||
else if (shaders_read_metadata)
|
||||
sctx->flags |= SI_CONTEXT_INV_L2_METADATA;
|
||||
} else if (sctx->chip_class == GFX9) {
|
||||
/* Single-sample color is coherent with shaders on GFX9, but
|
||||
@@ -1726,7 +1728,9 @@ si_make_DB_shader_coherent(struct si_context *sctx, unsigned num_samples,
|
||||
SI_CONTEXT_INV_VCACHE;
|
||||
|
||||
if (sctx->chip_class >= GFX10) {
|
||||
if (shaders_read_metadata)
|
||||
if (sctx->screen->info.tcc_harvested)
|
||||
sctx->flags |= SI_CONTEXT_INV_L2;
|
||||
else if (shaders_read_metadata)
|
||||
sctx->flags |= SI_CONTEXT_INV_L2_METADATA;
|
||||
} else if (sctx->chip_class == GFX9) {
|
||||
/* Single-sample depth (not stencil) is coherent with shaders
|
||||
|
@@ -1130,16 +1130,28 @@ void gfx10_emit_cache_flush(struct si_context *ctx)
|
||||
}
|
||||
if (flags & SI_CONTEXT_INV_VCACHE)
|
||||
gcr_cntl |= S_586_GL1_INV(1) | S_586_GLV_INV(1);
|
||||
|
||||
/* The L2 cache ops are:
|
||||
* - INV: - invalidate lines that reflect memory (were loaded from memory)
|
||||
* - don't touch lines that were overwritten (were stored by gfx clients)
|
||||
* - WB: - don't touch lines that reflect memory
|
||||
* - write back lines that were overwritten
|
||||
* - WB | INV: - invalidate lines that reflect memory
|
||||
* - write back lines that were overwritten
|
||||
*
|
||||
* GLM doesn't support WB alone. If WB is set, INV must be set too.
|
||||
*/
|
||||
if (flags & SI_CONTEXT_INV_L2) {
|
||||
/* Writeback and invalidate everything in L2. */
|
||||
gcr_cntl |= S_586_GL2_INV(1) | S_586_GLM_INV(1);
|
||||
gcr_cntl |= S_586_GL2_INV(1) | S_586_GL2_WB(1) |
|
||||
S_586_GLM_INV(1) | S_586_GLM_WB(1);
|
||||
ctx->num_L2_invalidates++;
|
||||
} else if (flags & SI_CONTEXT_WB_L2) {
|
||||
/* Writeback but do not invalidate. */
|
||||
gcr_cntl |= S_586_GL2_WB(1);
|
||||
gcr_cntl |= S_586_GL2_WB(1) |
|
||||
S_586_GLM_WB(1) | S_586_GLM_INV(1);
|
||||
} else if (flags & SI_CONTEXT_INV_L2_METADATA) {
|
||||
gcr_cntl |= S_586_GLM_INV(1) | S_586_GLM_WB(1);
|
||||
}
|
||||
if (flags & SI_CONTEXT_INV_L2_METADATA)
|
||||
gcr_cntl |= S_586_GLM_INV(1);
|
||||
|
||||
if (flags & (SI_CONTEXT_FLUSH_AND_INV_CB | SI_CONTEXT_FLUSH_AND_INV_DB)) {
|
||||
if (flags & SI_CONTEXT_FLUSH_AND_INV_CB) {
|
||||
|
@@ -1913,6 +1913,7 @@ static bool si_can_invalidate_texture(struct si_screen *sscreen,
|
||||
const struct pipe_box *box)
|
||||
{
|
||||
return !tex->buffer.b.is_shared &&
|
||||
!(tex->surface.flags & RADEON_SURF_IMPORTED) &&
|
||||
!(transfer_usage & PIPE_TRANSFER_READ) &&
|
||||
tex->buffer.b.b.last_level == 0 &&
|
||||
util_texrange_covers_whole_level(&tex->buffer.b.b, 0,
|
||||
|
@@ -96,6 +96,7 @@ struct pipe_video_buffer *si_video_buffer_create(struct pipe_context *pipe,
|
||||
/* reset the address */
|
||||
resources[i]->buffer.gpu_address = ctx->ws->buffer_get_virtual_address(
|
||||
resources[i]->buffer.buf);
|
||||
resources[i]->buffer.bo_size = resources[i]->buffer.buf->size;
|
||||
}
|
||||
|
||||
vidtemplate.height *= array_size;
|
||||
|
@@ -214,7 +214,7 @@ env.Prepend(CPPPATH = [
|
||||
envavx = env.Clone()
|
||||
|
||||
envavx.Append(CPPDEFINES = ['KNOB_ARCH=KNOB_ARCH_AVX'])
|
||||
if env['platform'] == 'windows':
|
||||
if env['msvc']:
|
||||
envavx.Append(CCFLAGS = ['/arch:AVX'])
|
||||
else:
|
||||
envavx.Append(CCFLAGS = ['-mavx'])
|
||||
@@ -230,7 +230,7 @@ env.Alias('swrAVX', swrAVX)
|
||||
envavx2 = env.Clone()
|
||||
|
||||
envavx2.Append(CPPDEFINES = ['KNOB_ARCH=KNOB_ARCH_AVX2'])
|
||||
if env['platform'] == 'windows':
|
||||
if env['msvc']:
|
||||
envavx2.Append(CCFLAGS = ['/arch:AVX2'])
|
||||
else:
|
||||
envavx2.Append(CCFLAGS = ['-mavx2', '-mfma', '-mbmi2', '-mf16c'])
|
||||
|
@@ -457,7 +457,7 @@ v3d_read_and_accumulate_primitive_counters(struct v3d_context *v3d)
|
||||
perf_debug("stalling on TF counts readback");
|
||||
struct v3d_resource *rsc = v3d_resource(v3d->prim_counts);
|
||||
if (v3d_bo_wait(rsc->bo, PIPE_TIMEOUT_INFINITE, "prim-counts")) {
|
||||
uint32_t *map = v3d_bo_map(rsc->bo);
|
||||
uint32_t *map = v3d_bo_map(rsc->bo) + v3d->prim_counts_offset;
|
||||
v3d->tf_prims_generated += map[V3D_PRIM_COUNTS_TF_WRITTEN];
|
||||
}
|
||||
}
|
||||
|
@@ -265,11 +265,20 @@ struct pipe_screen {
|
||||
/**
|
||||
* Get info for the given pipe resource without the need to get a
|
||||
* winsys_handle.
|
||||
*
|
||||
* The context parameter can optionally be used to flush the resource and
|
||||
* the context to make sure the resource is coherent with whatever user
|
||||
* will use it. Some drivers may also use the context to convert
|
||||
* the resource into a format compatible for sharing. The context parameter
|
||||
* is allowed to be NULL.
|
||||
*/
|
||||
bool (*resource_get_param)(struct pipe_screen *screen,
|
||||
struct pipe_context *context,
|
||||
struct pipe_resource *resource,
|
||||
unsigned int plane,
|
||||
unsigned plane,
|
||||
unsigned layer,
|
||||
enum pipe_resource_param param,
|
||||
unsigned handle_usage,
|
||||
uint64_t *value);
|
||||
|
||||
/**
|
||||
|
@@ -1128,14 +1128,15 @@ dri2_query_image_by_resource_handle(__DRIimage *image, int attrib, int *value)
|
||||
|
||||
static bool
|
||||
dri2_resource_get_param(__DRIimage *image, enum pipe_resource_param param,
|
||||
uint64_t *value)
|
||||
unsigned handle_usage, uint64_t *value)
|
||||
{
|
||||
struct pipe_screen *pscreen = image->texture->screen;
|
||||
if (!pscreen->resource_get_param)
|
||||
return false;
|
||||
|
||||
return pscreen->resource_get_param(pscreen, image->texture, image->plane,
|
||||
param, value);
|
||||
return pscreen->resource_get_param(pscreen, NULL, image->texture,
|
||||
image->plane, 0, param, handle_usage,
|
||||
value);
|
||||
}
|
||||
|
||||
static bool
|
||||
@@ -1143,6 +1144,7 @@ dri2_query_image_by_resource_param(__DRIimage *image, int attrib, int *value)
|
||||
{
|
||||
enum pipe_resource_param param;
|
||||
uint64_t res_param;
|
||||
unsigned handle_usage;
|
||||
|
||||
if (!image->texture->screen->resource_get_param)
|
||||
return false;
|
||||
@@ -1174,7 +1176,12 @@ dri2_query_image_by_resource_param(__DRIimage *image, int attrib, int *value)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!dri2_resource_get_param(image, param, &res_param))
|
||||
if (image->use & __DRI_IMAGE_USE_BACKBUFFER)
|
||||
handle_usage = PIPE_HANDLE_USAGE_EXPLICIT_FLUSH;
|
||||
else
|
||||
handle_usage = PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE;
|
||||
|
||||
if (!dri2_resource_get_param(image, param, handle_usage, &res_param))
|
||||
return false;
|
||||
|
||||
switch (attrib) {
|
||||
@@ -1312,7 +1319,7 @@ dri2_from_planar(__DRIimage *image, int plane, void *loaderPrivate)
|
||||
return NULL;
|
||||
} else if (plane > 0) {
|
||||
uint64_t planes;
|
||||
if (!dri2_resource_get_param(image, PIPE_RESOURCE_PARAM_NPLANES,
|
||||
if (!dri2_resource_get_param(image, PIPE_RESOURCE_PARAM_NPLANES, 0,
|
||||
&planes) ||
|
||||
plane >= planes) {
|
||||
return NULL;
|
||||
@@ -1321,7 +1328,7 @@ dri2_from_planar(__DRIimage *image, int plane, void *loaderPrivate)
|
||||
|
||||
if (image->dri_components == 0) {
|
||||
uint64_t modifier;
|
||||
if (!dri2_resource_get_param(image, PIPE_RESOURCE_PARAM_MODIFIER,
|
||||
if (!dri2_resource_get_param(image, PIPE_RESOURCE_PARAM_MODIFIER, 0,
|
||||
&modifier) ||
|
||||
modifier == DRM_FORMAT_MOD_INVALID) {
|
||||
return NULL;
|
||||
|
@@ -44,7 +44,8 @@ hgl_st_context(struct st_context_iface *stctxi)
|
||||
|
||||
|
||||
// Perform a safe void to hgl_buffer cast
|
||||
static inline struct hgl_buffer*
|
||||
//static inline struct hgl_buffer*
|
||||
struct hgl_buffer*
|
||||
hgl_st_framebuffer(struct st_framebuffer_iface *stfbi)
|
||||
{
|
||||
struct hgl_buffer* buffer;
|
||||
@@ -62,7 +63,9 @@ hgl_st_framebuffer_flush_front(struct st_context_iface *stctxi,
|
||||
CALLED();
|
||||
|
||||
//struct hgl_context* context = hgl_st_context(stctxi);
|
||||
//struct hgl_buffer* buffer = hgl_st_context(stfbi);
|
||||
// struct hgl_buffer* buffer = hgl_st_context(stfbi);
|
||||
struct hgl_buffer* buffer = hgl_st_framebuffer(stfbi);
|
||||
//buffer->surface
|
||||
|
||||
#if 0
|
||||
struct stw_st_framebuffer *stwfb = stw_st_framebuffer(stfb);
|
||||
@@ -281,7 +284,8 @@ hgl_create_st_manager(struct hgl_context* context)
|
||||
//manager->display = dpy;
|
||||
manager->screen = context->screen;
|
||||
manager->get_param = hgl_st_manager_get_param;
|
||||
|
||||
manager->st_manager_private = (void *)context;
|
||||
|
||||
return manager;
|
||||
}
|
||||
|
||||
|
@@ -39,6 +39,8 @@ struct hgl_buffer
|
||||
unsigned mask;
|
||||
|
||||
struct pipe_screen* screen;
|
||||
struct pipe_surface* surface;
|
||||
|
||||
enum pipe_texture_target target;
|
||||
struct pipe_resource* textures[ST_ATTACHMENT_COUNT];
|
||||
|
||||
@@ -80,6 +82,8 @@ struct hgl_context
|
||||
struct hgl_buffer* read;
|
||||
};
|
||||
|
||||
// hgl_buffer from statetracker interface
|
||||
struct hgl_buffer* hgl_st_framebuffer(struct st_framebuffer_iface *stfbi);
|
||||
|
||||
// hgl state_tracker api
|
||||
struct st_api* hgl_create_st_api(void);
|
||||
|
@@ -1803,7 +1803,13 @@ DECL_SPECIAL(LOOP)
|
||||
|
||||
DECL_SPECIAL(RET)
|
||||
{
|
||||
ureg_RET(tx->ureg);
|
||||
/* RET as a last instruction could be safely ignored.
|
||||
* Remove it to prevent crashes/warnings in case underlying
|
||||
* driver doesn't implement arbitrary returns.
|
||||
*/
|
||||
if (*(tx->parse_next) != NINED3DSP_END) {
|
||||
ureg_RET(tx->ureg);
|
||||
}
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# Copyright © 2017 Intel Corporation
|
||||
# Copyright © 2017, 2019 Intel Corporation
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -19,7 +19,9 @@
|
||||
# SOFTWARE.
|
||||
|
||||
inc_st_omx = [inc_common]
|
||||
dep_st_omx = [dep_omx, dep_x11_xcb, dep_xcb, dep_xcb_dri2, dep_xcb_dri3]
|
||||
dep_st_omx = [
|
||||
dep_omx, dep_x11_xcb, dep_xcb, dep_xcb_dri2, dep_xcb_dri3, dep_libdrm,
|
||||
]
|
||||
|
||||
files_omx = files(
|
||||
'vid_dec_common.c',
|
||||
@@ -57,7 +59,7 @@ elif with_gallium_omx == 'tizonia'
|
||||
inc_egl,
|
||||
inc_egl_dri2,
|
||||
]
|
||||
dep_st_omx = [dep_st_omx, dep_omx_other, dep_libdrm]
|
||||
dep_st_omx = [dep_st_omx, dep_omx_other]
|
||||
endif
|
||||
|
||||
libomx_st = static_library(
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# Copyright © 2017-2018 Intel Corporation
|
||||
# Copyright © 2017-2019 Intel Corporation
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -35,5 +35,8 @@ libva_st = static_library(
|
||||
),
|
||||
],
|
||||
include_directories : [inc_common],
|
||||
dependencies : [dep_va_headers, dep_x11_xcb, dep_xcb, dep_xcb_dri2, dep_xcb_dri3],
|
||||
dependencies : [
|
||||
dep_va_headers, dep_x11_xcb, dep_xcb, dep_xcb_dri2, dep_xcb_dri3,
|
||||
dep_libdrm,
|
||||
],
|
||||
)
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# Copyright © 2017 Intel Corproration
|
||||
# Copyright © 2017, 2019 Intel Corproration
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -35,5 +35,5 @@ libvdpau_st = static_library(
|
||||
include_directories : [
|
||||
inc_include, inc_src, inc_util, inc_gallium, inc_gallium_aux,
|
||||
],
|
||||
dependencies : [dep_vdpau, dep_xcb, dep_x11_xcb, dep_xcb_dri2],
|
||||
dependencies : [dep_vdpau, dep_xcb, dep_x11_xcb, dep_xcb_dri2, dep_libdrm],
|
||||
)
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# Copyright © 2017 Intel Corporation
|
||||
# Copyright © 2017, 2019 Intel Corporation
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -23,20 +23,29 @@ libxvmc_st = static_library(
|
||||
files('attributes.c', 'block.c', 'context.c', 'surface.c', 'subpicture.c'),
|
||||
c_args : [c_vis_args],
|
||||
include_directories : [inc_common],
|
||||
dependencies : [dep_xvmc, dep_x11_xcb, dep_xcb, dep_xcb_dri2, dep_xcb_dri3],
|
||||
dependencies : [
|
||||
dep_xvmc, dep_x11_xcb, dep_xcb, dep_xcb_dri2, dep_xcb_dri3, dep_xv,
|
||||
dep_libdrm,
|
||||
],
|
||||
)
|
||||
|
||||
# These tests will not work without a working xvmc configuration.
|
||||
# These tests will not work without a working xvmc configuration.
|
||||
if with_tools.contains('xvmc')
|
||||
dep_xvmcw = cc.find_library('XvMCW')
|
||||
# pkg-config was added in 1.0.12, so allow fallback
|
||||
dep_xvmcw = dependency('xvmc-wrapper', required : false)
|
||||
if not dep_xvmcw.found()
|
||||
dep_xvmcw = cc.find_library('XvMCW')
|
||||
endif
|
||||
dep_real_xvmc = dependency('xvmc')
|
||||
|
||||
foreach x : ['context', 'surface', 'subpicture', 'blocks', 'rendering']
|
||||
_name = 'xvmc_@0@'.format(x)
|
||||
executable(
|
||||
_name,
|
||||
files('tests/test_@0@.c'.format(x), 'tests/testlib.c'),
|
||||
dependencies : [
|
||||
dep_real_xvmc, dep_x11_xcb, dep_xcb, dep_xcb_dri2, dep_xcb_dri3, dep_xvmcw,
|
||||
dep_real_xvmc, dep_x11_xcb, dep_xcb, dep_xcb_dri2, dep_xcb_dri3,
|
||||
dep_xvmcw, dep_xv,
|
||||
],
|
||||
install: true,
|
||||
)
|
||||
@@ -46,7 +55,8 @@ if with_tools.contains('xvmc')
|
||||
'xvmc_bench',
|
||||
files('tests/xvmc_bench.c', 'tests/testlib.c'),
|
||||
dependencies : [
|
||||
dep_real_xvmc, dep_x11_xcb, dep_xcb, dep_xcb_dri2, dep_xcb_dri3, dep_xvmcw,
|
||||
dep_real_xvmc, dep_x11_xcb, dep_xcb, dep_xcb_dri2, dep_xcb_dri3,
|
||||
dep_xvmcw, dep_xv,
|
||||
],
|
||||
install: true,
|
||||
)
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#include "sw/hgl/hgl_sw_winsys.h"
|
||||
#include "util/u_atomic.h"
|
||||
#include "util/u_memory.h"
|
||||
#include "util/u_framebuffer.h"
|
||||
|
||||
#include "target-helpers/inline_sw_helper.h"
|
||||
#include "target-helpers/inline_debug_helper.h"
|
||||
@@ -332,36 +333,17 @@ GalliumContext::SwapBuffers(context_id contextID)
|
||||
ERROR("%s: context not found\n", __func__);
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
// TODO: Where did st_notify_swapbuffers go?
|
||||
//st_notify_swapbuffers(context->draw->stfbi);
|
||||
|
||||
context->st->flush(context->st, ST_FLUSH_FRONT, NULL);
|
||||
|
||||
struct st_context *stContext = (struct st_context*)context->st;
|
||||
|
||||
unsigned nColorBuffers = stContext->state.framebuffer.nr_cbufs;
|
||||
for (unsigned i = 0; i < nColorBuffers; i++) {
|
||||
pipe_surface* surface = stContext->state.framebuffer.cbufs[i];
|
||||
if (!surface) {
|
||||
ERROR("%s: Color buffer %d invalid!\n", __func__, i);
|
||||
continue;
|
||||
}
|
||||
|
||||
TRACE("%s: Flushing color buffer #%d\n", __func__, i);
|
||||
|
||||
// We pass our destination bitmap to flush_fronbuffer which passes it
|
||||
// to the private winsys display call.
|
||||
fScreen->flush_frontbuffer(fScreen, surface->texture, 0, 0,
|
||||
context->bitmap, NULL);
|
||||
struct hgl_buffer* buffer = hgl_st_framebuffer(context->draw->stfbi);
|
||||
pipe_surface* surface = buffer->surface;
|
||||
if (!surface) {
|
||||
ERROR("%s: Invalid drawable surface!\n", __func__);
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// TODO... should we flush the z stencil buffer?
|
||||
pipe_surface* zSurface = stContext->state.framebuffer.zsbuf;
|
||||
fScreen->flush_frontbuffer(fScreen, zSurface->texture, 0, 0,
|
||||
fScreen->flush_frontbuffer(fScreen, surface->texture, 0, 0,
|
||||
context->bitmap, NULL);
|
||||
#endif
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
@@ -118,11 +118,7 @@ extern void (*linker_foo(const unsigned char *procName))()
|
||||
#include "glapi/glapi.h"
|
||||
#include "glapi/glapitable.h"
|
||||
|
||||
#if defined(USE_MGL_NAMESPACE)
|
||||
#define NAME(func) mgl##func
|
||||
#else
|
||||
#define NAME(func) gl##func
|
||||
#endif
|
||||
|
||||
#define DISPATCH(FUNC, ARGS, MESSAGE) \
|
||||
GET_DISPATCH()->FUNC ARGS
|
||||
|
@@ -86,6 +86,8 @@ XCreateDrawable(struct drisw_drawable * pdp, int shmid, Display * dpy)
|
||||
if (pdp->ximage) {
|
||||
XDestroyImage(pdp->ximage);
|
||||
pdp->ximage = NULL;
|
||||
if ((pdp->shminfo.shmid > 0) && (shmid != pdp->shminfo.shmid))
|
||||
XShmDetach(dpy, &pdp->shminfo);
|
||||
}
|
||||
|
||||
if (!xshm_error && shmid >= 0) {
|
||||
|
@@ -51,6 +51,7 @@ BGLView::BGLView(BRect rect, const char* name, ulong resizingMode, ulong mode,
|
||||
fDitherMap(NULL)
|
||||
{
|
||||
fRoster = new GLRendererRoster(this, options);
|
||||
fRenderer = fRoster->GetRenderer();
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +69,7 @@ BGLView::LockGL()
|
||||
// TODO: acquire the OpenGL API lock it on this glview
|
||||
|
||||
fDisplayLock.Lock();
|
||||
if (fRenderer)
|
||||
if (fRenderer != NULL && fDisplayLock.CountLocks() == 1)
|
||||
fRenderer->LockGL();
|
||||
}
|
||||
|
||||
@@ -76,7 +77,7 @@ BGLView::LockGL()
|
||||
void
|
||||
BGLView::UnlockGL()
|
||||
{
|
||||
if (fRenderer)
|
||||
if (fRenderer != NULL && fDisplayLock.CountLocks() == 1)
|
||||
fRenderer->UnlockGL();
|
||||
fDisplayLock.Unlock();
|
||||
|
||||
@@ -189,7 +190,6 @@ BGLView::AttachedToWindow()
|
||||
for (BView* view = this; view != NULL; view = view->Parent())
|
||||
view->ConvertToParent(&fBounds);
|
||||
|
||||
fRenderer = fRoster->GetRenderer();
|
||||
if (fRenderer != NULL) {
|
||||
// Jackburton: The following code was commented because it doesn't look
|
||||
// good in "direct" mode:
|
||||
|
@@ -26,6 +26,7 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
static inline uint64_t
|
||||
|
@@ -1011,15 +1011,37 @@ fs_inst::size_read(int arg) const
|
||||
}
|
||||
|
||||
namespace {
|
||||
unsigned
|
||||
predicate_width(brw_predicate predicate)
|
||||
{
|
||||
switch (predicate) {
|
||||
case BRW_PREDICATE_NONE: return 1;
|
||||
case BRW_PREDICATE_NORMAL: return 1;
|
||||
case BRW_PREDICATE_ALIGN1_ANY2H: return 2;
|
||||
case BRW_PREDICATE_ALIGN1_ALL2H: return 2;
|
||||
case BRW_PREDICATE_ALIGN1_ANY4H: return 4;
|
||||
case BRW_PREDICATE_ALIGN1_ALL4H: return 4;
|
||||
case BRW_PREDICATE_ALIGN1_ANY8H: return 8;
|
||||
case BRW_PREDICATE_ALIGN1_ALL8H: return 8;
|
||||
case BRW_PREDICATE_ALIGN1_ANY16H: return 16;
|
||||
case BRW_PREDICATE_ALIGN1_ALL16H: return 16;
|
||||
case BRW_PREDICATE_ALIGN1_ANY32H: return 32;
|
||||
case BRW_PREDICATE_ALIGN1_ALL32H: return 32;
|
||||
default: unreachable("Unsupported predicate");
|
||||
}
|
||||
}
|
||||
|
||||
/* Return the subset of flag registers that an instruction could
|
||||
* potentially read or write based on the execution controls and flag
|
||||
* subregister number of the instruction.
|
||||
*/
|
||||
unsigned
|
||||
flag_mask(const fs_inst *inst)
|
||||
flag_mask(const fs_inst *inst, unsigned width)
|
||||
{
|
||||
const unsigned start = inst->flag_subreg * 16 + inst->group;
|
||||
const unsigned end = start + inst->exec_size;
|
||||
assert(util_is_power_of_two_nonzero(width));
|
||||
const unsigned start = (inst->flag_subreg * 16 + inst->group) &
|
||||
~(width - 1);
|
||||
const unsigned end = start + ALIGN(inst->exec_size, width);
|
||||
return ((1 << DIV_ROUND_UP(end, 8)) - 1) & ~((1 << (start / 8)) - 1);
|
||||
}
|
||||
|
||||
@@ -1051,9 +1073,9 @@ fs_inst::flags_read(const gen_device_info *devinfo) const
|
||||
* f0.0 and f1.0 on Gen7+, and f0.0 and f0.1 on older hardware.
|
||||
*/
|
||||
const unsigned shift = devinfo->gen >= 7 ? 4 : 2;
|
||||
return flag_mask(this) << shift | flag_mask(this);
|
||||
return flag_mask(this, 1) << shift | flag_mask(this, 1);
|
||||
} else if (predicate) {
|
||||
return flag_mask(this);
|
||||
return flag_mask(this, predicate_width(predicate));
|
||||
} else {
|
||||
unsigned mask = 0;
|
||||
for (int i = 0; i < sources; i++) {
|
||||
@@ -1072,7 +1094,7 @@ fs_inst::flags_written() const
|
||||
opcode != BRW_OPCODE_WHILE)) ||
|
||||
opcode == SHADER_OPCODE_FIND_LIVE_CHANNEL ||
|
||||
opcode == FS_OPCODE_FB_WRITE) {
|
||||
return flag_mask(this);
|
||||
return flag_mask(this, 1);
|
||||
} else {
|
||||
return flag_mask(dst, size_written);
|
||||
}
|
||||
|
@@ -1978,7 +1978,7 @@ vec4_visitor::nir_emit_alu(nir_alu_instr *instr)
|
||||
break;
|
||||
|
||||
case nir_op_fdph_replicated:
|
||||
try_immediate_source(instr, op, true, devinfo);
|
||||
try_immediate_source(instr, op, false, devinfo);
|
||||
inst = emit(BRW_OPCODE_DPH, dst, op[0], op[1]);
|
||||
inst->saturate = instr->dest.saturate;
|
||||
break;
|
||||
|
@@ -1104,7 +1104,7 @@ update_from_topology(struct gen_device_info *devinfo,
|
||||
|
||||
for (int b = 0; b < devinfo->subslice_slice_stride; b++) {
|
||||
devinfo->num_subslices[s] +=
|
||||
__builtin_popcount(devinfo->subslice_masks[b]);
|
||||
__builtin_popcount(devinfo->subslice_masks[s * devinfo->subslice_slice_stride + b]);
|
||||
}
|
||||
n_subslices += devinfo->num_subslices[s];
|
||||
}
|
||||
@@ -1320,6 +1320,9 @@ query_topology(struct gen_device_info *devinfo, int fd)
|
||||
if (gen_ioctl(fd, DRM_IOCTL_I915_QUERY, &query))
|
||||
return false;
|
||||
|
||||
if (item.length < 0)
|
||||
return false;
|
||||
|
||||
struct drm_i915_query_topology_info *topo_info =
|
||||
(struct drm_i915_query_topology_info *) calloc(1, item.length);
|
||||
item.data_ptr = (uintptr_t) topo_info;
|
||||
|
@@ -789,7 +789,12 @@ isl_genX(null_fill_state)(void *state, struct isl_extent3d size)
|
||||
{
|
||||
struct GENX(RENDER_SURFACE_STATE) s = {
|
||||
.SurfaceType = SURFTYPE_NULL,
|
||||
.SurfaceFormat = ISL_FORMAT_B8G8R8A8_UNORM,
|
||||
/* We previously had this format set to B8G8R8A8_UNORM but ran into
|
||||
* hangs on IVB. R32_UINT seems to work for everybody.
|
||||
*
|
||||
* https://gitlab.freedesktop.org/mesa/mesa/issues/1872
|
||||
*/
|
||||
.SurfaceFormat = ISL_FORMAT_R32_UINT,
|
||||
#if GEN_GEN >= 7
|
||||
.SurfaceArray = size.depth > 0,
|
||||
#endif
|
||||
|
@@ -1470,9 +1470,6 @@ void anv_UpdateDescriptorSets(
|
||||
&dst->descriptors[dst_layout->descriptor_index];
|
||||
dst_desc += copy->dstArrayElement;
|
||||
|
||||
for (uint32_t j = 0; j < copy->descriptorCount; j++)
|
||||
dst_desc[j] = src_desc[j];
|
||||
|
||||
if (src_layout->data & ANV_DESCRIPTOR_INLINE_UNIFORM) {
|
||||
assert(src_layout->data == ANV_DESCRIPTOR_INLINE_UNIFORM);
|
||||
memcpy(dst->desc_mem.map + dst_layout->descriptor_offset +
|
||||
@@ -1481,6 +1478,9 @@ void anv_UpdateDescriptorSets(
|
||||
copy->srcArrayElement,
|
||||
copy->descriptorCount);
|
||||
} else {
|
||||
for (uint32_t j = 0; j < copy->descriptorCount; j++)
|
||||
dst_desc[j] = src_desc[j];
|
||||
|
||||
unsigned desc_size = anv_descriptor_size(src_layout);
|
||||
if (desc_size > 0) {
|
||||
assert(desc_size == anv_descriptor_size(dst_layout));
|
||||
|
@@ -2421,7 +2421,7 @@ VkResult anv_CreateDevice(
|
||||
vk_priority_to_gen(priority));
|
||||
if (err != 0 && priority > VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT) {
|
||||
result = vk_error(VK_ERROR_NOT_PERMITTED_EXT);
|
||||
goto fail_fd;
|
||||
goto fail_vmas;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2587,6 +2587,11 @@ VkResult anv_CreateDevice(
|
||||
pthread_mutex_destroy(&device->mutex);
|
||||
fail_context_id:
|
||||
anv_gem_destroy_context(device, device->context_id);
|
||||
fail_vmas:
|
||||
if (physical_device->use_softpin) {
|
||||
util_vma_heap_finish(&device->vma_hi);
|
||||
util_vma_heap_finish(&device->vma_lo);
|
||||
}
|
||||
fail_fd:
|
||||
close(device->fd);
|
||||
fail_device:
|
||||
@@ -2642,6 +2647,11 @@ void anv_DestroyDevice(
|
||||
|
||||
anv_bo_pool_finish(&device->batch_bo_pool);
|
||||
|
||||
if (physical_device->use_softpin) {
|
||||
util_vma_heap_finish(&device->vma_hi);
|
||||
util_vma_heap_finish(&device->vma_lo);
|
||||
}
|
||||
|
||||
pthread_cond_destroy(&device->queue_submit);
|
||||
pthread_mutex_destroy(&device->mutex);
|
||||
|
||||
|
@@ -68,7 +68,13 @@ anv_gem_munmap(void *p, uint64_t size)
|
||||
uint32_t
|
||||
anv_gem_userptr(struct anv_device *device, void *mem, size_t size)
|
||||
{
|
||||
return -1;
|
||||
int fd = os_create_anonymous_file(size, "fake bo");
|
||||
if (fd == -1)
|
||||
return 0;
|
||||
|
||||
assert(fd != 0);
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
int
|
||||
|
@@ -735,6 +735,17 @@ anv_CreateImage(VkDevice device,
|
||||
return anv_image_from_external(device, pCreateInfo, create_info,
|
||||
pAllocator, pImage);
|
||||
|
||||
bool use_external_format = false;
|
||||
const struct VkExternalFormatANDROID *ext_format =
|
||||
vk_find_struct_const(pCreateInfo->pNext, EXTERNAL_FORMAT_ANDROID);
|
||||
|
||||
/* "If externalFormat is zero, the effect is as if the
|
||||
* VkExternalFormatANDROID structure was not present. Otherwise, the image
|
||||
* will have the specified external format."
|
||||
*/
|
||||
if (ext_format && ext_format->externalFormat != 0)
|
||||
use_external_format = true;
|
||||
|
||||
const VkNativeBufferANDROID *gralloc_info =
|
||||
vk_find_struct_const(pCreateInfo->pNext, NATIVE_BUFFER_ANDROID);
|
||||
if (gralloc_info)
|
||||
@@ -750,6 +761,7 @@ anv_CreateImage(VkDevice device,
|
||||
return anv_image_create(device,
|
||||
&(struct anv_image_create_info) {
|
||||
.vk_info = pCreateInfo,
|
||||
.external_format = use_external_format,
|
||||
},
|
||||
pAllocator,
|
||||
pImage);
|
||||
|
@@ -113,15 +113,6 @@ typedef struct {
|
||||
print(' ;')
|
||||
print('')
|
||||
print('')
|
||||
print("#ifdef USE_MGL_NAMESPACE")
|
||||
for func in api.functionIterateByOffset():
|
||||
for n in func.entry_points:
|
||||
if (not func.is_static_entry_point(func.name)) or (func.has_different_protocol(n) and not func.is_static_entry_point(n)):
|
||||
print('#define gl_dispatch_stub_%u mgl_dispatch_stub_%u' % (func.offset, func.offset))
|
||||
break
|
||||
print("#endif /* USE_MGL_NAMESPACE */")
|
||||
print('')
|
||||
print('')
|
||||
print('#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING)')
|
||||
for func in api.functionIterateByOffset():
|
||||
for n in func.entry_points:
|
||||
|
@@ -134,12 +134,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
|
||||
print('# define HIDDEN(x)')
|
||||
print('#endif')
|
||||
print('')
|
||||
print('# if defined(USE_MGL_NAMESPACE)')
|
||||
print('# define GL_PREFIX(n) GLNAME(CONCAT(mgl,n))')
|
||||
print('# define _glapi_Dispatch _mglapi_Dispatch')
|
||||
print('# else')
|
||||
print('# define GL_PREFIX(n) GLNAME(CONCAT(gl,n))')
|
||||
print('# endif')
|
||||
print('')
|
||||
print('\t.text')
|
||||
print('')
|
||||
|
@@ -58,18 +58,9 @@ class PrintGenericStubs(gl_XML.gl_print_base):
|
||||
print('#include "x86/assyntax.h"')
|
||||
print('')
|
||||
print('#if defined(STDCALL_API)')
|
||||
print('# if defined(USE_MGL_NAMESPACE)')
|
||||
print('# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n2))')
|
||||
print('# else')
|
||||
print('# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n2))')
|
||||
print('# endif')
|
||||
print('#else')
|
||||
print('# if defined(USE_MGL_NAMESPACE)')
|
||||
print('# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n))')
|
||||
print('# define _glapi_Dispatch _mglapi_Dispatch')
|
||||
print('# else')
|
||||
print('# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n))')
|
||||
print('# endif')
|
||||
print('#endif')
|
||||
print('')
|
||||
print('#define GL_OFFSET(x) CODEPTR(REGOFF(4 * x, EAX))')
|
||||
|
@@ -69,16 +69,6 @@ extern "C" {
|
||||
#endif /* _GLAPI_NO_EXPORTS */
|
||||
|
||||
|
||||
/* Is this needed? It is incomplete anyway. */
|
||||
#ifdef USE_MGL_NAMESPACE
|
||||
#define _glapi_set_dispatch _mglapi_set_dispatch
|
||||
#define _glapi_get_dispatch _mglapi_get_dispatch
|
||||
#define _glapi_set_context _mglapi_set_context
|
||||
#define _glapi_get_context _mglapi_get_context
|
||||
#define _glapi_Dispatch _mglapi_Dispatch
|
||||
#define _glapi_Context _mglapi_Context
|
||||
#endif
|
||||
|
||||
typedef void (*_glapi_proc)(void);
|
||||
|
||||
typedef void (*_glapi_nop_handler_proc)(const char *name);
|
||||
|
@@ -51,11 +51,7 @@
|
||||
|
||||
#define KEYWORD2 GLAPIENTRY
|
||||
|
||||
#if defined(USE_MGL_NAMESPACE)
|
||||
#define NAME(func) mgl##func
|
||||
#else
|
||||
#define NAME(func) gl##func
|
||||
#endif
|
||||
|
||||
#if 0 /* Use this to log GL calls to stdout (for DEBUG only!) */
|
||||
|
||||
|
@@ -511,11 +511,6 @@ _glapi_get_proc_address(const char *funcName)
|
||||
|
||||
init_glapi_relocs_once();
|
||||
|
||||
#ifdef USE_MGL_NAMESPACE
|
||||
if (funcName && funcName[0] == 'm')
|
||||
funcName++;
|
||||
#endif
|
||||
|
||||
if (!funcName || funcName[0] != 'g' || funcName[1] != 'l')
|
||||
return NULL;
|
||||
|
||||
|
@@ -603,13 +603,8 @@ class GLAPIPrinter(ABIPrinter):
|
||||
def _get_c_header(self):
|
||||
header = """#ifndef _GLAPI_TMP_H_
|
||||
#define _GLAPI_TMP_H_
|
||||
#ifdef USE_MGL_NAMESPACE
|
||||
#define GLAPI_PREFIX(func) mgl##func
|
||||
#define GLAPI_PREFIX_STR(func) "mgl"#func
|
||||
#else
|
||||
#define GLAPI_PREFIX(func) gl##func
|
||||
#define GLAPI_PREFIX_STR(func) "gl"#func
|
||||
#endif /* USE_MGL_NAMESPACE */
|
||||
|
||||
typedef int GLclampx;
|
||||
#endif /* _GLAPI_TMP_H_ */"""
|
||||
|
@@ -174,11 +174,6 @@ _glapi_get_stub(const char *name, int generate)
|
||||
{
|
||||
const struct mapi_stub *stub;
|
||||
|
||||
#ifdef USE_MGL_NAMESPACE
|
||||
if (name && name[0] == 'm')
|
||||
name++;
|
||||
#endif
|
||||
|
||||
if (!name || name[0] != 'g' || name[1] != 'l')
|
||||
return NULL;
|
||||
name += 2;
|
||||
|
@@ -35,7 +35,7 @@ if with_shared_glapi
|
||||
else
|
||||
libglapi = []
|
||||
endif
|
||||
if not with_glvnd or glvnd_missing_pc_files
|
||||
if not with_glvnd
|
||||
if with_gles1
|
||||
subdir('es1api')
|
||||
endif
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user