tests: Use a macro to define the render target size.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2022-03-19 12:35:34 -05:00 committed by Alexandre Julliard
parent e5be178fe2
commit 099df706f0
4 changed files with 12 additions and 9 deletions

View File

@ -293,7 +293,7 @@ static void parse_test_directive(struct shader_runner *runner, const char *line)
} }
else if (match_string(line, "probe all rgba", &line)) else if (match_string(line, "probe all rgba", &line))
{ {
static const RECT rect = {0, 0, 640, 480}; static const RECT rect = {0, 0, RENDER_TARGET_WIDTH, RENDER_TARGET_HEIGHT};
unsigned int ulps; unsigned int ulps;
struct vec4 v; struct vec4 v;
int ret; int ret;

View File

@ -24,6 +24,9 @@
#include "vkd3d_common.h" #include "vkd3d_common.h"
#include "utils.h" #include "utils.h"
#define RENDER_TARGET_WIDTH 640
#define RENDER_TARGET_HEIGHT 480
enum shader_model enum shader_model
{ {
SHADER_MODEL_2_0, SHADER_MODEL_2_0,

View File

@ -241,8 +241,8 @@ static IDXGISwapChain *create_swapchain(ID3D11Device *device, HWND window)
ok(hr == S_OK, "Failed to get factory, hr %#lx.\n", hr); ok(hr == S_OK, "Failed to get factory, hr %#lx.\n", hr);
IDXGIAdapter_Release(adapter); IDXGIAdapter_Release(adapter);
dxgi_desc.BufferDesc.Width = 640; dxgi_desc.BufferDesc.Width = RENDER_TARGET_WIDTH;
dxgi_desc.BufferDesc.Height = 480; dxgi_desc.BufferDesc.Height = RENDER_TARGET_HEIGHT;
dxgi_desc.BufferDesc.RefreshRate.Numerator = 60; dxgi_desc.BufferDesc.RefreshRate.Numerator = 60;
dxgi_desc.BufferDesc.RefreshRate.Denominator = 1; dxgi_desc.BufferDesc.RefreshRate.Denominator = 1;
dxgi_desc.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; dxgi_desc.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
@ -268,8 +268,8 @@ static BOOL init_test_context(struct d3d11_shader_runner *runner)
{ {
const D3D11_TEXTURE2D_DESC texture_desc = const D3D11_TEXTURE2D_DESC texture_desc =
{ {
.Width = 640, .Width = RENDER_TARGET_WIDTH,
.Height = 480, .Height = RENDER_TARGET_HEIGHT,
.MipLevels = 1, .MipLevels = 1,
.ArraySize = 1, .ArraySize = 1,
.Format = DXGI_FORMAT_R32G32B32A32_FLOAT, .Format = DXGI_FORMAT_R32G32B32A32_FLOAT,
@ -290,8 +290,8 @@ static BOOL init_test_context(struct d3d11_shader_runner *runner)
return FALSE; return FALSE;
} }
rt_width = 640; rt_width = RENDER_TARGET_WIDTH;
rt_height = 480; rt_height = RENDER_TARGET_HEIGHT;
SetRect(&rect, 0, 0, rt_width, rt_height); SetRect(&rect, 0, 0, rt_width, rt_height);
AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW, FALSE); AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW, FALSE);
runner->window = CreateWindowA("static", "d3dcompiler_test", WS_OVERLAPPEDWINDOW, runner->window = CreateWindowA("static", "d3dcompiler_test", WS_OVERLAPPEDWINDOW,

View File

@ -269,8 +269,8 @@ void run_shader_tests_d3d12(int argc, char **argv)
{ {
static const struct test_context_desc desc = static const struct test_context_desc desc =
{ {
.rt_width = 640, .rt_width = RENDER_TARGET_WIDTH,
.rt_height = 480, .rt_height = RENDER_TARGET_HEIGHT,
.no_root_signature = true, .no_root_signature = true,
.rt_format = DXGI_FORMAT_R32G32B32A32_FLOAT, .rt_format = DXGI_FORMAT_R32G32B32A32_FLOAT,
}; };