code:
[MASTER]

# Specify a configuration file.
#rcfile=

# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=

# Add files or directories to the blacklist. They should be base names, not
# paths.
ignore=CVS

# Add files or directories matching the regex patterns to the blacklist. The
# regex matches against base names, not paths.
ignore-patterns=

# Pickle collected data for later comparisons.
persistent=yes

# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
load-plugins=

# Use multiple processes to speed up Pylint.
jobs=1

# Allow loading of arbitrary C extensions. Extensions are imported into the
# active Python interpreter and may run arbitrary code.
unsafe-load-any-extension=no

# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
extension-pkg-whitelist=

# Allow optimization of some AST trees. This will activate a peephole AST
# optimizer, which will apply various small optimizations. For instance, it can
# be used to obtain the result of joining multiple strings with the addition
# operator. Joining a lot of strings can lead to a maximum recursion error in
# Pylint and this flag can prevent that. It has one side effect, the resulting
# AST will be different than the one from reality. This option is deprecated
# and it will be removed in Pylint 2.0.
optimize-ast=no

[MESSAGES CONTROL]

# Only show warnings with the listed confidence levels. Leave empty to show
# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
confidence=

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once). See also the "--disable" option for examples.
#enable=

# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once).You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=invalid-name,missing-docstring,parameter-unpacking,oct-method,range-builtin-not-iterating,unicode-builtin,xrange-builtin,filter-builtin-not-iterating,reduce-builtin,coerce-method,unpacking-in-except,using-cmp-argument,intern-builtin,coerce-builtin,raising-string,old-raise-syntax,unichr-builtin,metaclass-assignment,dict-iter-method,zip-builtin-not-iterating,standarderror-builtin,print-statement,old-ne-operator,long-suffix,basestring-builtin,backtick,dict-view-method,suppressed-message,round-builtin,cmp-method,old-octal-literal,execfile-builtin,buffer-builtin,map-builtin-not-iterating,hex-method,raw_input-builtin,useless-suppression,file-builtin,next-method-called,reload-builtin,long-builtin,old-division,indexing-exception,getslice-method,no-absolute-import,setslice-method,import-star-module-level,input-builtin,delslice-method,nonzero-method,cmp-builtin,apply-builtin

[REPORTS]

# Set the output format. Available formats are text, parseable, colorized, msvs
# (visual studio) and html. You can also give a reporter class, eg
# mypackage.mymodule.MyReporterClass.
output-format=text

# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]". This option is deprecated
# and it will be removed in Pylint 2.0.
files-output=no

# Tells whether to display a full report or only the messages
reports=yes

# Python expression which should return a note less than 10 (10 is the highest
# note). You have access to the variables errors warning, statement which
# respectively contain the number of errors / warnings messages and the total
# number of statements analyzed. This is used by the global evaluation report
# (RP0004).
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)

# Template used to display messages. This is a python new-style format string
# used to format the message information. See doc for all details
#msg-template=

[LOGGING]

# Logging modules to check that the string format arguments are in logging
# function parameter format
logging-modules=logging

[TYPECHECK]

# Tells whether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
ignore-mixin-members=yes

# List of module names for which member attributes should not be checked
# (useful for modules/projects where namespaces are manipulated during runtime
# and thus existing member attributes cannot be deduced by static analysis. It
# supports qualified module names, as well as Unix pattern matching.
ignored-modules=

# List of class names for which member attributes should not be checked (useful
# for classes with dynamically set attributes). This supports the use of
# qualified names.
ignored-classes=optparse.Values,thread._local,_thread._local

# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E1101 when accessed. Python regular
# expressions are accepted.
generated-members=

# List of decorators that produce context managers, such as
# contextlib.contextmanager. Add to this list to register other decorators that
# produce valid context managers.
contextmanager-decorators=contextlib.contextmanager

[MISCELLANEOUS]

# List of note tags to take in consideration, separated by a comma.
notes=FIXME,XXX,TODO

[SPELLING]

# Spelling dictionary name. Available dictionaries: none. To make it working
# install python-enchant package.
spelling-dict=

# List of comma separated words that should not be checked.
spelling-ignore-words=

# A path to a file that contains private dictionary; one word per line.
spelling-private-dict-file=

# Tells whether to store unknown words to indicated private dictionary in
# --spelling-private-dict-file option instead of raising a message.
spelling-store-unknown-words=no

[BASIC]

# Good variable names which should always be accepted, separated by a comma
good-names=i,j,k,ex,Run,_

# Bad variable names which should always be refused, separated by a comma
bad-names=foo,bar,baz,toto,tutu,tata

# Colon-delimited sets of names that determine each other's naming style when
# the name regexes allow several styles.
name-group=

# Include a hint for the correct naming format with invalid-name
include-naming-hint=no

# List of decorators that produce properties, such as abc.abstractproperty. Add
# to this list to register other decorators that produce valid properties.
property-classes=abc.abstractproperty

# Regular expression matching correct inline iteration names
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$

# Naming hint for inline iteration names
inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$

# Regular expression matching correct class attribute names
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$

# Naming hint for class attribute names
class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$

# Regular expression matching correct method names
method-rgx=[a-z_][a-z0-9_]{2,30}$

# Naming hint for method names
method-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression matching correct attribute names
attr-rgx=[a-z_][a-z0-9_]{2,30}$

# Naming hint for attribute names
attr-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression matching correct function names
function-rgx=[a-z_][a-z0-9_]{2,30}$

# Naming hint for function names
function-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression matching correct constant names
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$

# Naming hint for constant names
const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$

# Regular expression matching correct module names
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$

# Naming hint for module names
module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$

# Regular expression matching correct argument names
argument-rgx=[a-z_][a-z0-9_]{2,30}$

# Naming hint for argument names
argument-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression matching correct class names
class-rgx=[A-Z_][a-zA-Z0-9]+$

# Naming hint for class names
class-name-hint=[A-Z_][a-zA-Z0-9]+$

# Regular expression matching correct variable names
variable-rgx=[a-z_][a-z0-9_]{2,30}$

# Naming hint for variable names
variable-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression which should only match function or class names that do
# not require a docstring.
no-docstring-rgx=^_

# Minimum line length for functions/classes that require docstrings, shorter
# ones are exempt.
docstring-min-length=-1

[ELIF]

# Maximum number of nested blocks for function / method body
max-nested-blocks=5

[VARIABLES]

# Tells whether we should check for unused import in __init__ files.
init-import=no

# A regular expression matching the name of dummy variables (i.e. expectedly
# not used).
dummy-variables-rgx=(_+[a-zA-Z0-9]*?$)|dummy

# List of additional names supposed to be defined in builtins. Remember that
# you should avoid to define new builtins when possible.
additional-builtins=

# List of strings which can identify a callback function by name. A callback
# name must start or end with one of those strings.
callbacks=cb_,_cb

# List of qualified module names which can have objects that can redefine
# builtins.
redefining-builtins-modules=six.moves,future.builtins

[SIMILARITIES]

# Minimum lines number of a similarity.
min-similarity-lines=4

# Ignore comments when computing similarities.
ignore-comments=yes

# Ignore docstrings when computing similarities.
ignore-docstrings=yes

# Ignore imports when computing similarities.
ignore-imports=no

[FORMAT]

# Maximum number of characters on a single line.
max-line-length=100

# Regexp for a line that is allowed to be longer than the limit.
ignore-long-lines=^\s*(# )?<?https?://\S+>?$

# Allow the body of an if to be on the same line as the test if there is no
# else.
single-line-if-stmt=no

# List of optional constructs for which whitespace checking is disabled. `dict-
# separator` is used to allow tabulation in dicts, etc.: {1  : 1,\n222: 2}.
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
# `empty-line` allows space-only lines.
no-space-check=trailing-comma,dict-separator

# Maximum number of lines in a module
max-module-lines=1000

# String used as indentation unit. This is usually "    " (4 spaces) or "\t" (1
# tab).
indent-string='    '

# Number of spaces of indent required inside a hanging  or continued line.
indent-after-paren=4

# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
expected-line-ending-format=

[IMPORTS]

# Deprecated modules which should not be used, separated by a comma
deprecated-modules=optparse

# Create a graph of every (i.e. internal and external) dependencies in the
# given file (report RP0402 must not be disabled)
import-graph=

# Create a graph of external dependencies in the given file (report RP0402 must
# not be disabled)
ext-import-graph=

# Create a graph of internal dependencies in the given file (report RP0402 must
# not be disabled)
int-import-graph=

# Force import order to recognize a module as part of the standard
# compatibility libraries.
known-standard-library=

# Force import order to recognize a module as part of a third party library.
known-third-party=enchant

# Analyse import fallback blocks. This can be used to support both Python 2 and
# 3 compatible code, which means that the block might have code that exists
# only in one or another interpreter, leading to false positives when analysed.
analyse-fallback-blocks=no

[CLASSES]

# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,__new__,setUp

# List of valid names for the first argument in a class method.
valid-classmethod-first-arg=cls

# List of valid names for the first argument in a metaclass class method.
valid-metaclass-classmethod-first-arg=mcs

# List of member names, which should be excluded from the protected access
# warning.
exclude-protected=_asdict,_fields,_replace,_source,_make

[DESIGN]

# Maximum number of arguments for function / method
max-args=5

# Argument names that match this expression will be ignored. Default to name
# with leading underscore
ignored-argument-names=_.*

# Maximum number of locals for function / method body
max-locals=15

# Maximum number of return / yield for function / method body
max-returns=6

# Maximum number of branch for function / method body
max-branches=12

# Maximum number of statements in function / method body
max-statements=50

# Maximum number of parents for a class (see R0901).
max-parents=7

# Maximum number of attributes for a class (see R0902).
max-attributes=7

# Minimum number of public methods for a class (see R0903).
min-public-methods=2

# Maximum number of public methods for a class (see R0904).
max-public-methods=20

# Maximum number of boolean expressions in a if statement
max-bool-expr=5

[EXCEPTIONS]

# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception


code:
LATEX=pdflatex --shell-escape
SOURCES=report.tex
TITLE=title.pdf
RESOURCES=dip.png results.png $(TITLE)
PDFS=$(SOURCES:.tex=.pdf)
TARGET=print-$(PDFS)

all: $(SOURCES) $(RESOURCES) $(TARGET)

$(PDFS): $(SOURCES) $(RESOURCES)
	$(LATEX) $< -o $@

$(TARGET): $(PDFS)
	pdfunite $(TITLE) $< $@

clean-build: $(SOURCES) $(RESOURCES)
	rm *.aux *.log

clean: $(SOURCES) $(RESOURCES) clean-build
	rm $(PDFS) $(TARGET)

remake: $(SOURCES) $(RESOURCES)
	make clean
	make all

repo_name: dtluna/modelling

license: mit


code:
#!/usr/bin/env python3
from math import factorial
import operator

def probability(n, m):
    temp = 1
    for i in range(n):
        temp += (n**i)/factorial(i)
    temp += (m*n**n)/factorial(n)
    return 1/temp

def failure_probability(n, m, omega, p):
    return (p*omega**(n+m))/(factorial(n)*n**m)

def avg_queue_length(omega, n, m, p):
    temp = 0
    for i in range(m):
        temp += ((omega/n)**(i))*(i+1)
    return (p*omega**(n+1)*temp)/(n*factorial(n))

def throughput(l, omega, n, m, p):
    return l*(1-failure_probability(n, m, omega, p))

def var1():
    lambd = 1
    t_serv = 2
    n = 2
    ms = range(3, 8)
    omega = lambd*t_serv
    print(('Вариант а): интенсивность: {}, время обслуживания: {}, количество колонок: {}' +
           ', длины очередей: {}').format(lambd, t_serv, n, list(ms)))
    print('w = {}'.format(omega))
    for m in ms:
        p = probability(n, m)
        print('Длина очереди:', m)
        print('\tp = {}'.format(p))
        print('\tСредняя длина очереди {}'.format(avg_queue_length(omega, n, m, p)))
        print('\tВероятность отказа: {}'.format(failure_probability(n, m, omega, p)))

def var2():
    lambd = 1
    n = 3
    t_serv = 3
    omega = lambd*t_serv
    c_rent = 20  # за час!
    c_serv = 5
    print('Вариант б): интенсивность: %d, время обслуживания: %d, количество колонок: %d' %
          (lambd, t_serv, n))
    revenues = {}
    for m in range(10):
        p = probability(n, m)
        a = throughput(lambd, omega, n, m, p)
        revenues[m] = a*60*c_serv - m * c_rent

    m_max, _ = max(revenues.items(), key=operator.itemgetter(1))
    print("Выгодное число мест ожидания:", m_max)

def main():
    var1()
    var2()

if __name__ == '__main__':
    main()


code:
#!/usr/bin/env python3
from math import log
from random import random, expovariate
import operator

def get_random(lambd):
    return (-(1/(lambd/60))) * log(random())

def get_random_exp(delt):
    return expovariate((1/delt)/60)

class Container:
    def __init__(self):
        self.client = False
        self.release = 0

def make_tanks(n):
    tanks = []
    for _ in range(n):
        tanks.append(Container())
    return tanks

def make_places(m):
    places = []
    for _ in range(m):
        places.append(Container())
    return places

def release_tanks(tanks, served, time):
    for t in tanks:
        if t.client and t.release <= time:
            served += 1
            t.client = False
    return served

def assign_tank_from_place(tanks, time, serve_time, place):
    for t in tanks:
        if not t.client:
            t.client = True
            place.client = False
            inc = get_random_exp(serve_time)
            t.release = time + inc
            return True
    return False

def assign_places_to_tanks(places, q_size, tanks, serve_time, time):
    for place in places:
        if place.client:
            q_size += 1
            assign_tank_from_place(tanks, time, serve_time, place)
    return q_size

def assign_place(places):
    for q in places:
        if not q.client:
            q.client = True
            return True
    return False

def assign_tank(tanks, serve_time, time):
    for t in tanks:
        if not t.client:
            t.client = True
            inc = get_random_exp(serve_time)
            t.release = time + inc
            return True
    return False

def assign_arrived(tanks, places, denies, serve_time, time):
    to_tank = assign_tank(tanks, serve_time, time)

    to_place = False
    if not to_tank:
        to_place = assign_place(places)

    if not to_place and not to_tank:
        denies += 1
    return denies

def imitate(n, m, dens, serve_time, target_time):
    arrive = 0
    denies = 0
    served = 0
    q_size = 0
    total_cars = 0

    tanks = make_tanks(n)
    places = make_places(m)

    for time in range(target_time * 60 * 60):
        served = release_tanks(tanks, served, time)

        q_size = assign_places_to_tanks(places, q_size, tanks, serve_time, time)

        if arrive <= time:
            inc = get_random(dens)
            arrive = time + inc
            total_cars += 1

            denies = assign_arrived(tanks, places, denies, serve_time, time)

    return {
        'denies': denies,
        'total_cars': total_cars,
        'q_size': q_size,
        'served': served
    }

def var1():
    for m in range(3, 8):
        n = 2
        serve_time = 2
        dens = 1
        target_time = 12

        results = imitate(n, m, dens, serve_time, target_time)

        denies = results['denies']
        total_cars = results['total_cars']
        q_size = results['q_size']

        print("Длина очереди", m)
        print("\tВероятность отказа:", denies/total_cars)
        print("\tСредняя длина очереди:", q_size/(target_time * 60 * 60))

def var2():
    revenues = {}
    for m in range(1, 21):
        n = 3
        serve_time = 2
        dens = 1
        target_time = 12

        results = imitate(n, m, dens, serve_time, target_time)
        served = results['served']
        revenues[m] = ((served * 5)/target_time - (20 * m))

    m_max, _ = max(revenues.items(), key=operator.itemgetter(1))
    print("Выгодное число мест ожидания:", m_max)

if __name__ == '__main__':
    var1()
    var2()


code:
\documentclass[a4paper,11pt]{article}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage[russian,english]{babel}
\usepackage{float}
\usepackage{minted}
\usepackage{longtable}
\usepackage{tabu}
\usepackage{mathtools}
\usepackage{amsmath}

\begin{document}

Вариант 12

Автозаправочная станция (АЗС) имеет n колонок; площадка возле нее
допускает одновременное ожидание не более m автомашин. Поток автомашин,
пребывающих на АЗС простейший с интенсивностью $\lambda$. Время обслуживания
показательное со средним значением $t_{s}$.

а) $\lambda = 1$ маш./мин., $t_{s} = 2$ мин.\\
Найти вероятности отказа и среднее значение длины очереди при $n = 2$ для
значений $m$ от 3 до 7;

б) $\lambda = 1 $ маш./мин., $t_s = 3$ мин., $n = 3$.\\
Определить экономически обоснованное
число мест ожидания, если заправка приносит доход $C_s = 5$ у.е./маш., а
аренда одного места ожидания $C_r$ стоит 20 у.е./час.

\section{Построение аналитической модели}

  $p = [1 + \dfrac{n}{1!}+\dfrac{n^2}{2!} + \cdots + \dfrac{n^n}{n!} + \dfrac{mn^n}{n!}]^{-1}$\\
  $\omega = t_s\lambda$\\
  $L_q = \dfrac{\omega^{n+1}}{nn!}p\displaystyle\sum_{i=1}^{m} i\left(\dfrac{\omega}{n}\right)^{i-1}$\\
  $P_r = \dfrac{\omega^{n+m}}{n^mn!}p$\\
  $A = \lambda\left(1-p\dfrac{\omega^{n+m}}{n^mn!}\right)$

\subsection{Диаграмма интенсивностей переходов}
\includegraphics[scale=0.3]{dip}

\subsection{а)}
$\lambda = 1$ маш./мин., $t_{s} = 2$ мин., $n = 2$\\
$\omega = 2$ маш.
\subsubsection{m = 3}
$p = 0.1$\\
$L_q = 1.2000000000000002$\\
$P_r = 0.2$\\
\subsubsection{m = 4}
$p = 0.08333333333333333$\\
$L_q = 1.6666666666666665$\\
$P_r = 0.16666666666666666$\\
\subsubsection{m = 5}
$p = 0.07142857142857142$\\
$L_q = 2.142857142857143$\\
$P_r = 0.14285714285714285$\\
\subsubsection{m = 6}
$p = 0.0625$\\
$L_q = 2.625$\\
$P_r = 0.125$\\
\subsubsection{m = 7}
$p = 0.05555555555555555$\\
$L_q = 3.1111111111111107$\\
$P_r = 0.1111111111111111$\\

\subsection{б)}
Определим среднюю прибыль за час $R_m$ как разность произведения абсолютной
пропускной способности и дохода за одну машину и произведения стоимости аренды
одного ожидания за час и числа мест ожидания:\\
$R_m = AC_s - C_rm$

Далеё найдём такое значение $R_m$, что значение $R_{m+1} < R_m$.
Соответсвующее значение $m$ и есть искомое количество мест.\linebreak
$R_1 = 223.57142857142858$\\
$R_2 = 238.02702702702706$\\
$R_3 = 230.30434782608694$\\

Таким образом, искомое количество мест $m = 2$.
\section{Построение имитационной модели}
\subsection{Результаты работы имитационной модели}
\includegraphics[scale=0.5]{results}

\subsection{Листинг программы имитационной модели}
\inputminted[linenos]{python}{imit.py}

\end{document}


code:
---
name: Bug report
about: Report crashes, rendering issues etc.
title: ''
labels: ''
assignees: ''

---

Please describe your issue as accurately as possible. If you run into a problem with a binary release, make sure to test with latest `master` as well.

**Important:** When reporting an issue with a specific game or application, such as crashes or rendering issues, please include log files and, if possible, a D3D11/D3D9 Apitrace (see https://github.com/apitrace/apitrace) so that the issue can be reproduced.
In order to create a trace for **D3D11/D3D10**: Run `wine apitrace.exe trace -a dxgi YOURGAME.exe`.
In order to create a trace for **D3D9**: Follow https://github.com/doitsujin/dxvk/wiki/Making-a-Trace.
Preferably record the trace on Windows, or wined3d if possible.

**Reports with no log files will be ignored.**

### Software information
Name of the game, settings used etc.

### System information
- GPU:
- Driver:
- Wine version:
- DXVK version:

### Apitrace file(s)
- Put a link here

### Log files
- d3d9.log:
- d3d11.log:
- dxgi.log:

repo_name: orochi/dxvk


code:
name: Artifacts (Package)

on: [push, pull_request, workflow_dispatch]

jobs:
  build-artifacts:
    runs-on: ubuntu-20.04

    steps:
    - name: Checkout code
      id: checkout-code
      uses: actions/checkout@v2
      with:
        submodules: recursive
        fetch-depth: 0

    - name: Setup problem matcher
      uses: Joshua-Ashton/gcc-problem-matcher@v1

    - name: Build release
      id: build-release
      uses: Joshua-Ashton/arch-mingw-github-action@v8
      with:
        command: |
          export VERSION_NAME="${GITHUB_REF##*/}-${GITHUB_SHA##*/}"
          ./package-release.sh ${VERSION_NAME} build --no-package
          echo "VERSION_NAME=${VERSION_NAME}" >> $GITHUB_ENV

    - name: Upload artifacts
      id: upload-artifacts
      uses: actions/upload-artifact@v2
      with:
        name: dxvk-${{ env.VERSION_NAME }}
        path: build/dxvk-${{ env.VERSION_NAME }}
        if-no-files-found: error


code:
name: Test Builds on Windows

on: [push, pull_request, workflow_dispatch]

jobs:
  build-set-windows:
    runs-on: windows-2022

    steps:
    - name: Checkout code
      id: checkout-code
      uses: actions/checkout@v2
      with:
        submodules: recursive

    - name: Setup glslangValidator
      shell: pwsh
      run: |
        choco install vulkan-sdk -y
        Write-Output "$([System.Environment]::GetEnvironmentVariable('VULKAN_SDK', 'Machine'))\Bin" `
          | Out-File -FilePath "${Env:GITHUB_PATH}" -Append

    - name: Setup Meson
      shell: pwsh
      run: pip install meson

    - name: Find Visual Studio
      shell: pwsh
      run: |
        $installationPath = Get-VSSetupInstance `
          | Select-VSSetupInstance -Require Microsoft.VisualStudio.Workload.NativeDesktop -Latest `
          | Select-Object -ExpandProperty InstallationPath
        Write-Output "VSDEVCMD=${installationPath}\Common7\Tools\VsDevCmd.bat" `
          | Out-File -FilePath "${Env:GITHUB_ENV}" -Append

    - name: Build MSVC x86
      shell: pwsh
      run: |
        & "${Env:COMSPEC}" /s /c "`"${Env:VSDEVCMD}`" -arch=x86 -host_arch=x64 -no_logo && set" `
          | % { , ($_ -Split '=', 2) } `
          | % { [System.Environment]::SetEnvironmentVariable($_[0], $_[1]) }
        meson --buildtype release --backend vs2022 build-msvc-x86
        msbuild -m build-msvc-x86/dxvk.sln

    - name: Build MSVC x64
      shell: pwsh
      run: |
        & "${Env:COMSPEC}" /s /c "`"${Env:VSDEVCMD}`" -arch=x64 -host_arch=x64 -no_logo && set" `
          | % { , ($_ -Split '=', 2) } `
          | % { [System.Environment]::SetEnvironmentVariable($_[0], $_[1]) }
        meson --buildtype release --backend vs2022 build-msvc-x64
        msbuild -m build-msvc-x64/dxvk.sln


code:
# DXVK

A Vulkan-based translation layer for Direct3D 9/10/11 which allows running 3D applications on Linux using Wine.

For the current status of the project, please refer to the [project wiki](https://github.com/doitsujin/dxvk/wiki).

The most recent development builds can be found [here](https://github.com/doitsujin/dxvk/actions/workflows/artifacts.yml?query=branch%3Amaster).

Release builds can be found [here](https://github.com/doitsujin/dxvk/releases).

## How to use
In order to install a DXVK package obtained from the [release](https://github.com/doitsujin/dxvk/releases) page into a given wine prefix, run the following commands from within the DXVK directory:

```
export WINEPREFIX=/path/to/.wine-prefix
./setup_dxvk.sh install
```

This will **copy** the DLLs into the `system32` and `syswow64` directories of your wine prefix and set up the required DLL overrides. Pure 32-bit prefixes are also supported.

The setup script optionally takes the following arguments:
- `--symlink`: Create symbolic links to the DLL files instead of copying them. This is especially useful for development.
- `--with-d3d10`: Install the `d3d10{_1}.dll` helper libraries.
- `--without-dxgi`: Do not install DXVK's DXGI implementation and use the one provided by wine instead.

Verify that your application uses DXVK instead of wined3d by checking for the presence of the log file `d3d9.log` or `d3d11.log` in the application's directory, or by enabling the HUD (see notes below).

In order to remove DXVK from a prefix, run the following command:
```
export WINEPREFIX=/path/to/.wine-prefix
./setup_dxvk.sh uninstall
```

## Build instructions

### Requirements:
- [wine 3.10](https://www.winehq.org/) or newer
- [Meson](https://mesonbuild.com/) build system (at least version 0.49)
- [Mingw-w64](https://www.mingw-w64.org) compiler and headers (at least version 8.0)
- [glslang](https://github.com/KhronosGroup/glslang) compiler

### Building DLLs

#### The simple way
Inside the DXVK directory, run:
```
./package-release.sh master /your/target/directory --no-package
```

This will create a folder `dxvk-master` in `/your/target/directory`, which contains both 32-bit and 64-bit versions of DXVK, which can be set up in the same way as the release versions as noted above.

In order to preserve the build directories for development, pass `--dev-build` to the script. This option implies `--no-package`. After making changes to the source code, you can then do the following to rebuild DXVK:
```
# change to build.32 for 32-bit
cd /your/target/directory/build.64
ninja install
```

#### Compiling manually
```
# 64-bit build. For 32-bit builds, replace
# build-win64.txt with build-win32.txt
meson --cross-file build-win64.txt --buildtype release --prefix /your/dxvk/directory build.w64
cd build.w64
ninja install
```

The D3D9, D3D10, D3D11 and DXGI DLLs will be located in `/your/dxvk/directory/bin`. Setup has to be done manually in this case.

### Notes on Vulkan drivers
Before reporting an issue, please check the [Wiki](https://github.com/doitsujin/dxvk/wiki/Driver-support) page on the current driver status and make sure you run a recent enough driver version for your hardware.

### Online multi-player games
Manipulation of Direct3D libraries in multi-player games may be considered cheating and can get your account **banned**. This may also apply to single-player games with an embedded or dedicated multiplayer portion. **Use at your own risk.**

### HUD
The `DXVK_HUD` environment variable controls a HUD which can display the framerate and some stat counters. It accepts a comma-separated list of the following options:
- `devinfo`: Displays the name of the GPU and the driver version.
- `fps`: Shows the current frame rate.
- `frametimes`: Shows a frame time graph.
- `submissions`: Shows the number of command buffers submitted per frame.
- `drawcalls`: Shows the number of draw calls and render passes per frame.
- `pipelines`: Shows the total number of graphics and compute pipelines.
- `memory`: Shows the amount of device memory allocated and used.
- `gpuload`: Shows estimated GPU load. May be inaccurate.
- `version`: Shows DXVK version.
- `api`: Shows the D3D feature level used by the application.
- `cs`: Shows worker thread statistics.
- `compiler`: Shows shader compiler activity
- `samplers`: Shows the current number of sampler pairs used *[D3D9 Only]*
- `scale=x`: Scales the HUD by a factor of `x` (e.g. `1.5`)

Additionally, `DXVK_HUD=1` has the same effect as `DXVK_HUD=devinfo,fps`, and `DXVK_HUD=full` enables all available HUD elements.

### Frame rate limit
The `DXVK_FRAME_RATE` environment variable can be used to limit the frame rate. A value of `0` uncaps the frame rate, while any positive value will limit rendering to the given number of frames per second. Alternatively, the configuration file can be used.

### Device filter
Some applications do not provide a method to select a different GPU. In that case, DXVK can be forced to use a given device:
- `DXVK_FILTER_DEVICE_NAME="Device Name"` Selects devices with a matching Vulkan device name, which can be retrieved with tools such as `vulkaninfo`. Matches on substrings, so "VEGA" or "AMD RADV VEGA10" is supported if the full device name is "AMD RADV VEGA10 (LLVM 9.0.0)", for example. If the substring matches more than one device, the first device matched will be used.

**Note:** If the device filter is configured incorrectly, it may filter out all devices and applications will be unable to create a D3D device.

### State cache
DXVK caches pipeline state by default, so that shaders can be recompiled ahead of time on subsequent runs of an application, even if the driver's own shader cache got invalidated in the meantime. This cache is enabled by default, and generally reduces stuttering.

The following environment variables can be used to control the cache:
- `DXVK_STATE_CACHE=0` Disables the state cache.
- `DXVK_STATE_CACHE_PATH=/some/directory` Specifies a directory where to put the cache files. Defaults to the current working directory of the application.

### Debugging
The following environment variables can be used for **debugging** purposes.
- `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` Enables Vulkan debug layers. Highly recommended for troubleshooting rendering issues and driver crashes. Requires the Vulkan SDK to be installed on the host system.
- `DXVK_LOG_LEVEL=none|error|warn|info|debug` Controls message logging.
- `DXVK_LOG_PATH=/some/directory` Changes path where log files are stored. Set to `none` to disable log file creation entirely, without disabling logging.
- `DXVK_CONFIG_FILE=/xxx/dxvk.conf` Sets path to the configuration file.
- `DXVK_PERF_EVENTS=1` Enables use of the VK_EXT_debug_utils extension for translating performance event markers.

## Troubleshooting
DXVK requires threading support from your mingw-w64 build environment. If you
are missing this, you may see "error: ‘std::cv_status’ has not been declared"
or similar threading related errors.

On Debian and Ubuntu, this can be resolved by using the posix alternate, which
supports threading. For example, choose the posix alternate from these
commands:
```
update-alternatives --config x86_64-w64-mingw32-gcc
update-alternatives --config x86_64-w64-mingw32-g++
update-alternatives --config i686-w64-mingw32-gcc
update-alternatives --config i686-w64-mingw32-g++
```
For non debian based distros, make sure that your mingw-w64-gcc cross compiler
does have `--enable-threads=posix` enabled during configure. If your distro does
ship its mingw-w64-gcc binary with `--enable-threads=win32` you might have to
recompile locally or open a bug at your distro's bugtracker to ask for it.


code:
[binaries]
c = 'i686-w64-mingw32-gcc'
cpp = 'i686-w64-mingw32-g++'
ar = 'i686-w64-mingw32-ar'
strip = 'i686-w64-mingw32-strip'
windres = 'i686-w64-mingw32-windres'

[properties]
needs_exe_wrapper = true

[host_machine]
system = 'windows'
cpu_family = 'x86'
cpu = 'x86'
endian = 'little'


code:
[binaries]
c = 'x86_64-w64-mingw32-gcc'
cpp = 'x86_64-w64-mingw32-g++'
ar = 'x86_64-w64-mingw32-ar'
strip = 'x86_64-w64-mingw32-strip'
windres = 'x86_64-w64-mingw32-windres'

[properties]
needs_exe_wrapper = true

[host_machine]
system = 'windows'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'


code:
# Create the VkSurface on the first call to IDXGISwapChain::Present,
# rather than when creating the swap chain. Some games that start
# rendering with a different graphics API may require this option,
# or otherwise the window may stay black.
#
# Supported values: True, False

# dxgi.deferSurfaceCreation = False
# d3d9.deferSurfaceCreation = False

# Enforce a stricter maximum frame latency. Overrides the application
# setting specified by calling IDXGIDevice::SetMaximumFrameLatency.
# Setting this to 0 will have no effect.
#
# Supported values : 0 - 16

# dxgi.maxFrameLatency = 0
# d3d9.maxFrameLatency = 0

# Enables frame rate limiter. The main purpose of this is to work around
# bugs in games that have physics or other simulation tied to their frame
# rate, but do not provide their own limiter.
#
# Supported values : Any non-negative integer

# dxgi.maxFrameRate = 0
# d3d9.maxFrameRate = 0

# Override PCI vendor and device IDs reported to the application. Can
# cause the app to adjust behaviour depending on the selected values.
#
# Supported values: Any four-digit hex number.

# dxgi.customDeviceId = 0000
# dxgi.customVendorId = 0000

# d3d9.customDeviceId = 0000
# d3d9.customVendorId = 0000

# Override the reported device description
#
# Supported values: Any string.

# dxgi.customDeviceDesc = ""
# d3d9.customDeviceDesc = ""

# Report Nvidia GPUs as AMD GPUs by default. This is enabled by default
# to work around issues with NVAPI, but may cause issues in some games.
#
# Supported values: True, False

# dxgi.nvapiHack = True

# Override maximum amount of device memory and shared system memory
# reported to the application. This may fix texture streaming issues
# in games that do not support cards with large amounts of VRAM.
#
# Supported values: Any number in Megabytes.

# dxgi.maxDeviceMemory = 0
# dxgi.maxSharedMemory = 0

# Some games think we are on Intel given a lack of NVAPI or
# AGS/atiadlxx support. Report our device memory as shared memory,
# and some small amount for a "carveout".

# Supported values: True, False

# dxgi.emulateUMA = False

# Override back buffer count for the Vulkan swap chain.
# Setting this to 0 or less will have no effect.
#
# Supported values: Any number greater than or equal to 2.

# dxgi.numBackBuffers = 0
# d3d9.numBackBuffers = 0

# Overrides synchronization interval (Vsync) for presentation.
# Setting this to 0 disables vertical synchronization entirely.
# A positive value 'n' will enable Vsync and repeat the same
# image n times, and a negative value will have no effect.
#
# Supported values: Any non-negative number

# dxgi.syncInterval = -1
# d3d9.presentInterval = -1

# True enables the mailbox present mode in case regular Vsync is disabled.
# This should avoid tearing, but may be unsupported on some systems
# or require setting dxgi.numBackBuffers to a higher value in order
# to work properly.
#
# False enables the relaxed fifo present mode in case regular Vsync is enabled.
# This should result in tearing but reduce stutter if FPS are too low,
# but may be unsupported on some systems.
#
# Please do not report issues with this option.
#
# Supported values: Auto, True, False

# dxgi.tearFree = Auto
# d3d9.tearFree = Auto

# Performs range check on dynamically indexed constant buffers in shaders.
# This may be needed to work around a certain type of game bug, but may
# also introduce incorrect behaviour.
#
# Supported values: True, False

# d3d11.constantBufferRangeCheck = False

# Assume single-use mode for command lists created on deferred contexts.
# This may need to be disabled for some applications to avoid rendering
# issues, which may come at a significant performance cost.
#
# Supported values: True, False

# d3d11.dcSingleUseMode = True

# Override the maximum feature level that a D3D11 device can be created
# with. Setting this to a higher value may allow some applications to run
# that would otherwise fail to create a D3D11 device.
#
# Supported values: 9_1, 9_2, 9_3, 10_0, 10_1, 11_0, 11_1

# d3d11.maxFeatureLevel = 11_1

# Overrides the maximum allowed tessellation factor. This can be used to
# improve performance in titles which overuse tessellation.
#
# Supported values: Any number between 8 and 64

# d3d11.maxTessFactor = 0

# Enables relaxed pipeline barriers around UAV writes.
#
# This may improve performance in some games, but may also introduce
# rendering issues. Please don't report bugs with the option enabled.
#
# Supported values: True, False

# d3d11.relaxedBarriers = False

# Ignores barriers around UAV writes from fragment shaders.
#
# This may improve performance in some games, but may also introduce
# rendering issues. Please don't report bugs with the option enabled.
#
# Supported values: True, False

# d3d11.ignoreGraphicsBarriers = False

# Overrides anisotropic filtering for all samplers. Set this to a positive
# value to enable AF for all samplers in the game, or to 0 in order to
# disable AF entirely. Negative values will have no effect.
#
# Supported values: Any number between 0 and 16

# d3d11.samplerAnisotropy = -1
# d3d9.samplerAnisotropy = -1

# Declares vertex positions as invariant in order to solve
# potential Z-fighting issues at a small performance cost.
#
# Supported values: True, False

# d3d11.invariantPosition = True
# d3d9.invariantPosition = True

# Forces the sample count of all textures to 1, and performs
# the needed fixups in resolve operations and shaders.
#
# Supported values: True, False

# d3d11.disableMsaa = False

# Clears workgroup memory in compute shaders to zero. Some games don't do
# this and rely on undefined behaviour. Enabling may reduce performance.
#
# Supported values: True, False

# d3d11.zeroWorkgroupMemory = False

# Resource size limit for implicit discards, in kilobytes. For small staging
# resources mapped with MAP_WRITE, DXVK will sometimes allocate new backing
# storage in order to avoid GPU synchronization, so setting this too high
# may cause memory issues, setting it to -1 disables the feature.

# d3d11.maxImplicitDiscardSize = 256

# Resource size limit for buffer-mapped dynamic images, in kilobytes.
# A higher threshold may reduce memory usage and PCI-E bandwidth in
# some games, but may also increase GPU synchronizations. Setting it
# to -1 disables the feature.

# d3d11.maxDynamicImageBufferSize = -1

# Allocates dynamic resources with the given set of bind flags in
# cached system memory rather than uncached memory or host-visible
# VRAM, in order to allow fast readback from the CPU. This is only
# useful for buggy applications, and may reduce GPU-bound performance.
#
# Supported values: Any combination of the following:
# - v: Vertex buffers
# - i: Index buffers
# - c: Constant buffers
# - r: Shader resources
# - a: All dynamic resources

# d3d11.cachedDynamicResources = ""

# Sets number of pipeline compiler threads.
#
# Supported values:
# - 0 to automatically determine the number of threads to use
# - any positive number to enforce the thread count

# dxvk.numCompilerThreads = 0

# Toggles raw SSBO usage.
#
# Uses storage buffers to implement raw and structured buffer
# views. Enabled by default on hardware which has a storage
# buffer offset alignment requirement of 4 Bytes (e.g. AMD).
# Enabling this may improve performance, but is not safe on
# hardware with higher alignment requirements.
#
# Supported values:
# - Auto: Don't change the default
# - True, False: Always enable / disable

# dxvk.useRawSsbo = Auto

# Controls Nvidia HVV behaviour.
#
# Disables the host-visible, device-local heap on Nvidia drivers. This
# is used to avoid NVIDIA driver bug 3114283 on affected drivers, as
# well as in specific games on newer drivers.being enabled on all
# affected drivers.
#
# Supported values:
# - Auto: Don't change the default
# - True, False: Always enable / disable

# dxvk.shrinkNvidiaHvvHeap = Auto

# Sets enabled HUD elements
#
# Behaves like the DXVK_HUD environment variable if the
# environment variable is not set, otherwise it will be
# ignored. The syntax is identical.

# dxvk.hud =

# Reported shader model
#
# The shader model to state that we support in the device
# capabilities that the applicatation queries.
#
# Supported values:
# - 1: Shader Model 1
# - 2: Shader Model 2
# - 3: Shader Model 3

# d3d9.shaderModel = 3

# Evict Managed on Unlock
#
# Decides whether we should evict managed resources from
# system memory when they are unlocked entirely.
#
# Supported values:
# - True, False: Always enable / disable

# d3d9.evictManagedOnUnlock = False

# DPI Awareness
#
# Decides whether we should call SetProcessDPIAware on device
# creation. Helps avoid upscaling blur in modern Windows on
# Hi-DPI screens/devices.
#
# Supported values:
# - True, False: Always enable / disable

# d3d9.dpiAware = True

# Strict Constant Copies
#
# Decides whether we should always copy defined constants to
# the UBO when relative addressing is used, or only when the
# relative addressing starts a defined constant.
#
# Supported values:
# - True, False: Always enable / disable

# d3d9.strictConstantCopies = False

# Strict Pow
#
# Decides whether we have an opSelect for handling pow(0,0) = 0
# otherwise it becomes undefined.
#
# Supported values:
# - True, False: Always enable / disable

# d3d9.strictPow = True

# Lenient Clear
#
# Decides whether or not we fastpath clear anyway if we are close enough to
# clearing a full render target.
#
# Supported values:
# - True, False: Always enable / disable

# d3d9.lenientClear = False

# Max available memory
#
# Changes the max initial value used in tracking and GetAvailableTextureMem
# Value in Megabytes
#
# Supported values:
# - Max Available Memory: Any int32_t
# - Memory Tracking Testing: True, False

# d3d9.maxAvailableMemory = 4096
# d3d9.memoryTrackTest = False

# Force enable/disable floating point quirk emulation
#
# Force toggle anything * 0 emulation
# Setting it to True will use a faster but less accurate approach that works for most games.
# Supported values:
# - True: Use a faster but less accurate approach. Good enough for most games
# - False: Disable float emulation completely
# - Strict: Use a slower but more correct approach. Necessary for some games
# - Auto: DXVK will pick automatically

# d3d9.floatEmulation = Auto

# Enable dialog box mode
#
# Changes the default state of dialog box mode.
# *Disables* exclusive fullscreen when enabled.
#
# Supported values:
# - True, False: Always enable / disable

# d3d9.enableDialogMode = False

# Overrides the application's MSAA level on the swapchain
#
# Supported values: -1 (application) and 0 to 16 (user override)

# d3d9.forceSwapchainMSAA = -1

# Long Mad
#
# Should we make our Mads a FFma or do it the long way with an FMul and an FAdd?
# This solves some rendering bugs in games that have z-pass shaders which
# don't match entirely to the regular vertex shader in this way.
#
# Supported values:
# - True/False

# d3d9.longMad = False

# Alpha Test Wiggle Room
#
# Workaround for games using alpha test == 1.0, etc due to wonky interpolation or
# misc. imprecision on some vendors
#
# Supported values:
# - True/False

# d3d9.alphaTestWiggleRoom = False

# Device Local Constant Buffers
#
# Enables using device local, host accessible memory for constant buffers in D3D9.
# This tends to actually be slower for some reason on AMD,
# and the exact same performance on NVIDIA.
#
# Supported values:
# - True/False

# d3d9.deviceLocalConstantBuffers = False

# No Explicit Front Buffer
#
# Disables the front buffer
#
# Supported values:
# - True/False

# d3d9.noExplicitFrontBuffer = False

# Support DF formats
#
# Support the vendor extension DF floating point depth formats
#
# Supported values:
# - True/False

# d3d9.supportDFFormats = True

# Support X4R4G4B4
#
# Support the X4R4G4B4 format.
# The Sims 2 is a horrible game made by complete morons.
#
# Supported values:
# - True/False

# d3d9.supportX4R4G4B4 = True

# Support D32
#
# Support the D32 format.
#
# Supported values:
# - True/False

# d3d9.supportD32 = True

# Disable A8 as a Render Target
#
# Disable support for A8 format render targets
# Once again, The Sims 2 is a horrible game made by complete morons.
#
# Supported values:
# - True/False

# d3d9.disableA8RT = False

# Support for VCache Query
#
# Support for the vcache query
# Not very important as a user config.
# Used internally.
#
# Supported values:
# - True/False

# Defaults to True if vendorId == 0x10de
# d3d9.supportVCache = True

# Force Sampler Type Spec Constants
#
# Useful if games use the wrong image and sampler
# type combo like Halo: CE or Spellforce.
# Can fix rendering in older, broken games in some instances.
#
# Supported values:
# - True/False

# d3d9.forceSamplerTypeSpecConstants = False

# Force Aspect Ratio
#
# Only exposes modes with a given aspect ratio.
# Useful for titles that break if they see ultra-wide.
#
# Supported values:
# - Any ratio, ie. "16:9", "4:3"

# d3d9.forceAspectRatio = ""

# Allow Do Not Wait
#
# Allow the do not wait lock flag to be used
# Useful if some apps use this incorrectly.
#
# Supported values:
# - True/False

# d3d9.allowDoNotWait = True

# Allow Discard
#
# Allow the discard lock flag to be used
# Useful if some apps use this incorrectly.
#
# Supported values:
# - True/False

# d3d9.allowDiscard = True

# Enumerate by Displays
#
# Whether we should enumerate D3D9 adapters by display (windows behaviour)
# or by physical adapter.
# May be useful in PRIME setups.
#
# Supported values:
# - True/False

# d3d9.enumerateByDisplays = True

# APITrace Mode
#
# Makes all host visible buffers cached and coherent
# Improves performance when apitracing, but also can impact
# some dumb games.
#
# Supported values:
# - True/False

# d3d9.apitraceMode = False

# Seamless Cubes
#
# Don't use non seamless cube maps even if they are supported.
# Non seamless cubes are correct d3d9 behavior, but can produce worse looking edges.
#
# Supported values:
# - True/False

# d3d9.seamlessCubes = False

# Debug Utils
#
# Enables debug utils as this is off by default, this enables user annotations like BeginEvent()/EndEvent().
# Alternatively could be enabled with DXVK_PERF_EVENTS=1 environment variable.
#
# Supported values:
# - True/False

# dxvk.enableDebugUtils = False