diff --git a/tests/hlsl/uav-rwbuffer.shader_test b/tests/hlsl/uav-rwbuffer.shader_test index ec8937b3..c813d0d1 100644 --- a/tests/hlsl/uav-rwbuffer.shader_test +++ b/tests/hlsl/uav-rwbuffer.shader_test @@ -164,6 +164,26 @@ float4 main() : sv_target1 return 0; } +[uav 1] +format r32g32b32a32 sint +size (buffer, 2) +1 2 3 4 5 6 7 8 + +[pixel shader] +RWBuffer u : register(u1); + +float4 main() : sv_target +{ + u[0] = int4(11, -12, 13, -14); + u[1] = int4(-15, 16, -17, 18); + return 0; +} + +[test] +todo(sm>=6) draw quad +probe uav 1 (0) rgbai (11, -12, 13, -14) +probe uav 1 (1) rgbai (-15, 16, -17, 18) + [uav 2] size (buffer, 1) 0.1 0.2 0.3 0.4 diff --git a/tests/shader_runner.c b/tests/shader_runner.c index c20932cc..d0d80650 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -336,6 +336,7 @@ static DXGI_FORMAT parse_format(const char *line, enum texture_data_type *data_t formats[] = { {"r32g32b32a32 float", TEXTURE_DATA_FLOAT, 16, DXGI_FORMAT_R32G32B32A32_FLOAT}, + {"r32g32b32a32 sint", TEXTURE_DATA_SINT, 16, DXGI_FORMAT_R32G32B32A32_SINT}, {"r32g32b32a32 uint", TEXTURE_DATA_UINT, 16, DXGI_FORMAT_R32G32B32A32_UINT}, {"r32g32 float", TEXTURE_DATA_FLOAT, 8, DXGI_FORMAT_R32G32_FLOAT}, {"r32g32 int", TEXTURE_DATA_SINT, 8, DXGI_FORMAT_R32G32_SINT}, @@ -622,12 +623,12 @@ static void read_uint(const char **line, unsigned int *u, bool is_uniform) *line = rest + (!is_uniform && *rest == ','); } -static void read_int4(const char **line, struct ivec4 *v) +static void read_int4(const char **line, struct ivec4 *v, bool is_uniform) { - read_int(line, &v->x, true); - read_int(line, &v->y, true); - read_int(line, &v->z, true); - read_int(line, &v->w, true); + read_int(line, &v->x, is_uniform); + read_int(line, &v->y, is_uniform); + read_int(line, &v->z, is_uniform); + read_int(line, &v->w, is_uniform); } static void read_uint4(const char **line, struct uvec4 *v, bool is_uniform) @@ -907,6 +908,17 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) line = close_parentheses(line); todo_if(runner->is_todo) check_readback_data_uvec4(rb, &rect, &v); } + else if (match_string(line, "rgbai", &line)) + { + struct ivec4 v; + + if (*line != '(') + fatal_error("Malformed probe arguments '%s'.\n", line); + ++line; + read_int4(&line, &v, false); + line = close_parentheses(line); + todo_if(runner->is_todo) check_readback_data_ivec4(rb, &rect, &v); + } else if (match_string(line, "rgba", &line)) { struct vec4 v; @@ -993,7 +1005,7 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) { struct ivec4 v; - read_int4(&line, &v); + read_int4(&line, &v, true); set_uniforms(runner, offset, 4, &v); } else if (match_string(line, "uint4", &line)) diff --git a/tests/shader_runner_gl.c b/tests/shader_runner_gl.c index 263d1ba7..6cec33a4 100644 --- a/tests/shader_runner_gl.c +++ b/tests/shader_runner_gl.c @@ -293,6 +293,7 @@ static const struct format_info *get_format_info(enum DXGI_FORMAT format) {DXGI_FORMAT_UNKNOWN, 1, true, GL_R32UI, GL_RED_INTEGER, GL_UNSIGNED_INT}, {DXGI_FORMAT_R32G32B32A32_FLOAT, 4, false, GL_RGBA32F, GL_RGBA, GL_FLOAT}, {DXGI_FORMAT_R32G32B32A32_UINT, 4, true, GL_RGBA32UI, GL_RGBA_INTEGER, GL_UNSIGNED_INT}, + {DXGI_FORMAT_R32G32B32A32_SINT, 4, true, GL_RGBA32I, GL_RGBA_INTEGER, GL_INT}, {DXGI_FORMAT_R32G32_FLOAT, 2, false, GL_RG32F, GL_RG, GL_FLOAT}, {DXGI_FORMAT_R32G32_UINT, 2, true, GL_RG32UI, GL_RG_INTEGER, GL_UNSIGNED_INT}, {DXGI_FORMAT_R32G32_SINT, 2, true, GL_RG32I, GL_RG_INTEGER, GL_INT}, diff --git a/tests/utils.h b/tests/utils.h index 98dceba8..cd5215fe 100644 --- a/tests/utils.h +++ b/tests/utils.h @@ -275,6 +275,7 @@ static inline void check_readback_data_vec4_(unsigned int line, const struct res got.x, got.y, got.z, got.w, expected->x, expected->y, expected->z, expected->w, x, y); } +#define check_readback_data_ivec4(a, b, c) check_readback_data_uvec4_(__LINE__, a, b, (const struct uvec4 *)(c)) #define check_readback_data_uvec4(a, b, c) check_readback_data_uvec4_(__LINE__, a, b, c) static inline void check_readback_data_uvec4_(unsigned int line, const struct resource_readback *rb, const RECT *rect, const struct uvec4 *expected)