mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
tests: Move the drawing and readback implementation to the d3d12 shader runner.
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:
committed by
Alexandre Julliard
parent
85d61f0c64
commit
09e3018b6d
@@ -18,6 +18,9 @@
|
||||
|
||||
#include "vkd3d_windows.h"
|
||||
#include "vkd3d_d3dcommon.h"
|
||||
#include "vkd3d_d3d12.h"
|
||||
#include "vkd3d_dxgiformat.h"
|
||||
#include "utils.h"
|
||||
|
||||
enum shader_model
|
||||
{
|
||||
@@ -27,11 +30,62 @@ enum shader_model
|
||||
SHADER_MODEL_5_1,
|
||||
};
|
||||
|
||||
struct shader_runner_ops
|
||||
enum texture_data_type
|
||||
{
|
||||
ID3D10Blob *(*compile_shader)(const char *source, enum shader_model minimum_shader_model);
|
||||
TEXTURE_DATA_FLOAT,
|
||||
TEXTURE_DATA_SINT,
|
||||
TEXTURE_DATA_UINT,
|
||||
};
|
||||
|
||||
void run_shader_tests(int argc, char **argv, const struct shader_runner_ops *ops);
|
||||
struct sampler
|
||||
{
|
||||
unsigned int slot;
|
||||
|
||||
D3D12_FILTER filter;
|
||||
D3D12_TEXTURE_ADDRESS_MODE u_address, v_address, w_address;
|
||||
};
|
||||
|
||||
struct texture
|
||||
{
|
||||
unsigned int slot;
|
||||
|
||||
DXGI_FORMAT format;
|
||||
enum texture_data_type data_type;
|
||||
unsigned int texel_size;
|
||||
unsigned int width, height;
|
||||
uint8_t *data;
|
||||
size_t data_size, data_capacity;
|
||||
|
||||
D3D12_DESCRIPTOR_RANGE descriptor_range;
|
||||
ID3D12DescriptorHeap *heap;
|
||||
ID3D12Resource *resource;
|
||||
unsigned int root_index;
|
||||
};
|
||||
|
||||
struct shader_context
|
||||
{
|
||||
const struct shader_runner_ops *ops;
|
||||
|
||||
ID3D10Blob *ps_code;
|
||||
enum shader_model minimum_shader_model;
|
||||
|
||||
uint32_t *uniforms;
|
||||
size_t uniform_count;
|
||||
|
||||
struct texture *textures;
|
||||
size_t texture_count;
|
||||
|
||||
struct sampler *samplers;
|
||||
size_t sampler_count;
|
||||
};
|
||||
|
||||
struct shader_runner_ops
|
||||
{
|
||||
ID3D10Blob *(*compile_shader)(struct shader_context *context, const char *source, enum shader_model minimum_shader_model);
|
||||
void (*draw_quad)(struct shader_context *context);
|
||||
void (*probe_vec4)(struct shader_context *context, const RECT *rect, const struct vec4 *v, unsigned int ulps);
|
||||
};
|
||||
|
||||
void run_shader_tests(struct shader_context *context, int argc, char **argv, const struct shader_runner_ops *ops);
|
||||
|
||||
void run_shader_tests_d3d12(int argc, char **argv);
|
||||
|
Reference in New Issue
Block a user