Commit 2ee22020 authored by Laszlo Agocs's avatar Laszlo Agocs
Browse files

Remove some leftovers from repo merge

parent 9018aa1a
load(qt_parts)
requires(qtHaveModule(gui))
TEMPLATE = subdirs
SUBDIRS += \
plainqwindow_gles2
qtConfig(vulkan) {
SUBDIRS += \
vulkanwindow \
plainqwindow_vulkan
}
win32 {
SUBDIRS += \
plainqwindow_d3d11
}
mac {
SUBDIRS += \
plainqwindow_metal
}
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QGuiApplication>
#include <QRhiD3D11InitParams>
#include "examplewindow.h"
class D3D11Window : public ExampleWindow
{
public:
D3D11Window() { setSurfaceType(OpenGLSurface); }
~D3D11Window() { releaseResources(); }
private:
void init() override;
};
void D3D11Window::init()
{
QRhiD3D11InitParams params;
params.enableDebugLayer = true;
params.importExistingDevice = false;
m_r = QRhi::create(QRhi::D3D11, &params);
ExampleWindow::init();
}
int main(int argc, char **argv)
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
D3D11Window w;
w.resize(1280, 720);
w.setTitle(QLatin1String("D3D11"));
w.show();
return app.exec();
}
TEMPLATE = app
QT += shadertools rhi
SOURCES = \
main.cpp \
../shared/examplewindow.cpp \
../shared/trianglerenderer.cpp \
../shared/quadrenderer.cpp \
../shared/texturedcuberenderer.cpp \
../shared/triangleoncuberenderer.cpp
HEADERS = \
../shared/examplewindow.h \
../shared/trianglerenderer.h \
../shared/quadrenderer.h \
../shared/texturedcuberenderer.h \
../shared/triangleoncuberenderer.h
INCLUDEPATH += ../shared
RESOURCES = plainqwindow_d3d11.qrc
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file alias="color.vert.qsb">../shared/color.vert.qsb</file>
<file alias="color.frag.qsb">../shared/color.frag.qsb</file>
<file alias="texture.vert.qsb">../shared/texture.vert.qsb</file>
<file alias="texture.frag.qsb">../shared/texture.frag.qsb</file>
<file alias="qt256.png">../shared/qt256.png</file>
</qresource>
</RCC>
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QGuiApplication>
#include <QRhiGles2InitParams>
#include <QOpenGLContext>
#include <QOffscreenSurface>
#include "examplewindow.h"
class GlWindow : public ExampleWindow
{
public:
GlWindow() { setSurfaceType(OpenGLSurface); }
~GlWindow() { releaseResources(); }
private:
void init() override;
void releaseResources() override;
QOpenGLContext *ctx = nullptr;
};
void GlWindow::init()
{
ctx = new QOpenGLContext;
if (!ctx->create())
qFatal("Failed to get OpenGL context");
QRhiGles2InitParams params;
params.context = ctx;
params.window = this;
params.fallbackSurface = new QOffscreenSurface;
params.fallbackSurface->setFormat(ctx->format());
params.fallbackSurface->create();
m_r = QRhi::create(QRhi::OpenGLES2, &params);
ExampleWindow::init();
}
void GlWindow::releaseResources()
{
ExampleWindow::releaseResources();
delete ctx;
ctx = nullptr;
}
int main(int argc, char **argv)
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
QSurfaceFormat fmt;
fmt.setDepthBufferSize(24);
fmt.setStencilBufferSize(8);
QSurfaceFormat::setDefaultFormat(fmt);
GlWindow w;
w.resize(1280, 720);
w.setTitle(QLatin1String("OpenGL"));
w.show();
return app.exec();
}
TEMPLATE = app
QT += shadertools rhi
SOURCES = \
main.cpp \
../shared/examplewindow.cpp \
../shared/trianglerenderer.cpp \
../shared/quadrenderer.cpp \
../shared/texturedcuberenderer.cpp \
../shared/triangleoncuberenderer.cpp
HEADERS = \
../shared/examplewindow.h \
../shared/trianglerenderer.h \
../shared/quadrenderer.h \
../shared/texturedcuberenderer.h \
../shared/triangleoncuberenderer.h
INCLUDEPATH += ../shared
RESOURCES = plainqwindow_gles2.qrc
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file alias="color.vert.qsb">../shared/color.vert.qsb</file>
<file alias="color.frag.qsb">../shared/color.frag.qsb</file>
<file alias="texture.vert.qsb">../shared/texture.vert.qsb</file>
<file alias="texture.frag.qsb">../shared/texture.frag.qsb</file>
<file alias="qt256.png">../shared/qt256.png</file>
</qresource>
</RCC>
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QGuiApplication>
#include <QRhiMetalInitParams>
#include "examplewindow.h"
class MetalWindow : public ExampleWindow
{
public:
MetalWindow() { setSurfaceType(MetalSurface); }
~MetalWindow() { releaseResources(); }
private:
void init() override;
};
void MetalWindow::init()
{
QRhiMetalInitParams params;
m_r = QRhi::create(QRhi::Metal, &params);
setOnScreenOnly(true);
setTriangleOnly(true);
ExampleWindow::init();
}
int main(int argc, char **argv)
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
MetalWindow w;
w.resize(1280, 720);
w.setTitle(QLatin1String("Metal"));
w.show();
return app.exec();
}
TEMPLATE = app
QT += shadertools rhi
SOURCES = \
main.cpp \
../shared/examplewindow.cpp \
../shared/trianglerenderer.cpp \
../shared/quadrenderer.cpp \
../shared/texturedcuberenderer.cpp \
../shared/triangleoncuberenderer.cpp
HEADERS = \
../shared/examplewindow.h \
../shared/trianglerenderer.h \
../shared/quadrenderer.h \
../shared/texturedcuberenderer.h \
../shared/triangleoncuberenderer.h
INCLUDEPATH += ../shared
RESOURCES = plainqwindow_metal.qrc
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file alias="color.vert.qsb">../shared/color.vert.qsb</file>
<file alias="color.frag.qsb">../shared/color.frag.qsb</file>
<file alias="texture.vert.qsb">../shared/texture.vert.qsb</file>
<file alias="texture.frag.qsb">../shared/texture.frag.qsb</file>
<file alias="qt256.png">../shared/qt256.png</file>
</qresource>
</RCC>
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QGuiApplication>
#include <QLoggingCategory>
#include <QRhiVulkanInitParams>
#include "examplewindow.h"
class VWindow : public ExampleWindow
{
public:
VWindow() { setSurfaceType(VulkanSurface); }
~VWindow() { releaseResources(); }
private:
void init() override;
};
void VWindow::init()
{
QRhiVulkanInitParams params;
params.inst = vulkanInstance();
params.importExistingDevice = false;
params.window = this;
m_r = QRhi::create(QRhi::Vulkan, &params);
//setSampleCount(4); // enable 4x MSAA (except for the render-to-texture pass)
ExampleWindow::init();
}
int main(int argc, char **argv)
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
QLoggingCategory::setFilterRules(QStringLiteral("qt.vulkan=true"));
QVulkanInstance inst;
#ifndef Q_OS_ANDROID
inst.setLayers(QByteArrayList() << "VK_LAYER_LUNARG_standard_validation");
#else
inst.setLayers(QByteArrayList()
<< "VK_LAYER_GOOGLE_threading"
<< "VK_LAYER_LUNARG_parameter_validation"
<< "VK_LAYER_LUNARG_object_tracker"
<< "VK_LAYER_LUNARG_core_validation"
<< "VK_LAYER_LUNARG_image"
<< "VK_LAYER_LUNARG_swapchain"
<< "VK_LAYER_GOOGLE_unique_objects");
#endif
VWindow w;
if (inst.create()) {
w.setVulkanInstance(&inst);
w.resize(1280, 720);
w.setTitle(QLatin1String("Vulkan"));
w.show();
} else {
qWarning("Vulkan not supported");
return 1;
}
return app.exec();
}
TEMPLATE = app
QT += shadertools rhi
SOURCES = \
main.cpp \
../shared/examplewindow.cpp \
../shared/trianglerenderer.cpp \
../shared/quadrenderer.cpp \
../shared/texturedcuberenderer.cpp \
../shared/triangleoncuberenderer.cpp
HEADERS = \
../shared/examplewindow.h \
../shared/trianglerenderer.h \
../shared/quadrenderer.h \
../shared/texturedcuberenderer.h \
../shared/triangleoncuberenderer.h
INCLUDEPATH += ../shared
RESOURCES = plainqwindow_vulkan.qrc
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file alias="color.vert.qsb">../shared/color.vert.qsb</file>
<file alias="color.frag.qsb">../shared/color.frag.qsb</file>
<file alias="texture.vert.qsb">../shared/texture.vert.qsb</file>
<file alias="texture.frag.qsb">../shared/texture.frag.qsb</file>
<file alias="qt256.png">../shared/qt256.png</file>
</qresource>
</RCC>
qsb -n "100 es,120" -l -m color.vert -o color.vert.qsb
qsb -n "100 es,120" -l -m color.frag -o color.frag.qsb
qsb -n "100 es,120" -l -m texture.vert -o texture.vert.qsb
qsb -n "100 es,120" -l -m texture.frag -o texture.frag.qsb
qsb -n "100 es,120" -l -m color.vert -o color.vert.qsb
qsb -n "100 es,120" -l -m color.frag -o color.frag.qsb
qsb -n "100 es,120" -l -m texture.vert -o texture.vert.qsb
qsb -n "100 es,120" -l -m texture.frag -o texture.frag.qsb
#version 440
layout(location = 0) in vec3 v_color;
layout(location = 0) out vec4 fragColor;
layout(std140, binding = 0) uniform buf {
mat4 mvp;
float opacity;
} ubuf;
void main()
{
fragColor = vec4(v_color * ubuf.opacity, ubuf.opacity);
}
#version 440
layout(location = 0) in vec4 position;
layout(location = 1) in vec3 color;
layout(location = 0) out vec3 v_color;
layout(std140, binding = 0) uniform buf {
mat4 mvp;
float opacity;
} ubuf;
out gl_PerVertex { vec4 gl_Position; };
void main()
{
v_color = color;
gl_Position = ubuf.mvp * position;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment