tests/shader_runner: Use resource->width instead of resource->size for buffer width.

This commit is contained in:
Elizabeth Figura 2024-06-17 15:39:38 -05:00 committed by Henri Verbeet
parent 76ae871f5b
commit fa570ee1f3
Notes: Henri Verbeet 2024-07-11 00:41:24 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/924
3 changed files with 5 additions and 3 deletions

View File

@ -622,7 +622,6 @@ void init_resource(struct resource *resource, const struct resource_params *para
resource->dimension = params->dimension; resource->dimension = params->dimension;
resource->slot = params->slot; resource->slot = params->slot;
resource->format = params->format; resource->format = params->format;
resource->size = params->data_size;
resource->texel_size = params->texel_size; resource->texel_size = params->texel_size;
resource->width = params->width; resource->width = params->width;
resource->height = params->height; resource->height = params->height;
@ -934,6 +933,7 @@ static void parse_test_directive(struct shader_runner *runner, const char *line)
params.slot = 0; params.slot = 0;
params.type = RESOURCE_TYPE_VERTEX_BUFFER; params.type = RESOURCE_TYPE_VERTEX_BUFFER;
params.dimension = RESOURCE_DIMENSION_BUFFER; params.dimension = RESOURCE_DIMENSION_BUFFER;
params.width = sizeof(quad);
params.data = malloc(sizeof(quad)); params.data = malloc(sizeof(quad));
memcpy(params.data, quad, sizeof(quad)); memcpy(params.data, quad, sizeof(quad));
params.data_size = sizeof(quad); params.data_size = sizeof(quad);
@ -1671,6 +1671,9 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_c
break; break;
case STATE_RESOURCE: case STATE_RESOURCE:
if (current_resource.type == RESOURCE_TYPE_VERTEX_BUFFER)
current_resource.width = current_resource.data_size;
/* Not every backend supports every resource type /* Not every backend supports every resource type
* (specifically, D3D9 doesn't support UAVs and * (specifically, D3D9 doesn't support UAVs and
* textures with data type other than float). */ * textures with data type other than float). */

View File

@ -111,7 +111,6 @@ struct resource
enum resource_dimension dimension; enum resource_dimension dimension;
DXGI_FORMAT format; DXGI_FORMAT format;
unsigned int size;
unsigned int texel_size; unsigned int texel_size;
unsigned int width, height; unsigned int width, height;
unsigned int sample_count; unsigned int sample_count;

View File

@ -701,7 +701,7 @@ static bool d3d12_runner_draw(struct shader_runner *r,
case RESOURCE_TYPE_VERTEX_BUFFER: case RESOURCE_TYPE_VERTEX_BUFFER:
vbv.BufferLocation = ID3D12Resource_GetGPUVirtualAddress(resource->resource); vbv.BufferLocation = ID3D12Resource_GetGPUVirtualAddress(resource->resource);
vbv.StrideInBytes = get_vb_stride(&runner->r, resource->r.slot); vbv.StrideInBytes = get_vb_stride(&runner->r, resource->r.slot);
vbv.SizeInBytes = resource->r.size; vbv.SizeInBytes = resource->r.width;
ID3D12GraphicsCommandList_IASetVertexBuffers(command_list, resource->r.slot, 1, &vbv); ID3D12GraphicsCommandList_IASetVertexBuffers(command_list, resource->r.slot, 1, &vbv);
break; break;