Commit 8493a667 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Get rid of the wined3d_shader_byte_code_format enum.

It's been made redundant by the vkd3d_shader_source_type enum.
parent 06e6b164
......@@ -404,18 +404,18 @@ static void shader_signature_from_usage(struct wined3d_shader_signature_element
e->mask = write_mask;
}
static const struct wined3d_shader_frontend *shader_select_frontend(enum wined3d_shader_byte_code_format format)
static const struct wined3d_shader_frontend *shader_select_frontend(enum vkd3d_shader_source_type source_type)
{
switch (format)
switch (source_type)
{
case WINED3D_SHADER_BYTE_CODE_FORMAT_SM1:
case VKD3D_SHADER_SOURCE_D3D_BYTECODE:
return &sm1_shader_frontend;
case WINED3D_SHADER_BYTE_CODE_FORMAT_SM4:
case VKD3D_SHADER_SOURCE_DXBC_TPF:
return &sm4_shader_frontend;
default:
WARN("Invalid byte code format %#x specified.\n", format);
WARN("Invalid source type %#x specified.\n", source_type);
return NULL;
}
}
......@@ -3628,7 +3628,7 @@ static HRESULT shader_init(struct wined3d_shader *shader, struct wined3d_device
const DWORD *ptr;
void *fe_data;
if (!(shader->frontend = shader_select_frontend(WINED3D_SHADER_BYTE_CODE_FORMAT_SM1)))
if (!(shader->frontend = shader_select_frontend(VKD3D_SHADER_SOURCE_D3D_BYTECODE)))
{
FIXME("Unable to find frontend for shader.\n");
hr = WINED3DERR_INVALIDCALL;
......@@ -3663,7 +3663,7 @@ static HRESULT shader_init(struct wined3d_shader *shader, struct wined3d_device
}
else
{
enum wined3d_shader_byte_code_format format;
enum vkd3d_shader_source_type source_type;
unsigned int max_version;
if (!(shader->byte_code = heap_alloc(desc->byte_code_size)))
......@@ -3675,10 +3675,10 @@ static HRESULT shader_init(struct wined3d_shader *shader, struct wined3d_device
shader->byte_code_size = desc->byte_code_size;
max_version = shader_max_version_from_feature_level(device->cs->c.state->feature_level);
if (FAILED(hr = shader_extract_from_dxbc(shader, max_version, &format)))
if (FAILED(hr = shader_extract_from_dxbc(shader, max_version, &source_type)))
goto fail;
if (!(shader->frontend = shader_select_frontend(format)))
if (!(shader->frontend = shader_select_frontend(source_type)))
{
FIXME("Unable to find frontend for shader.\n");
hr = WINED3DERR_INVALIDCALL;
......
......@@ -1845,7 +1845,7 @@ struct aon9_header
struct shader_handler_context
{
struct wined3d_shader *shader;
enum wined3d_shader_byte_code_format *format;
enum vkd3d_shader_source_type *source_type;
unsigned int max_version;
};
......@@ -2094,7 +2094,7 @@ static HRESULT shader_dxbc_chunk_handler(const char *data, unsigned int data_siz
FIXME("Multiple shader code chunks.\n");
shader->function = (const DWORD *)data;
shader->functionLength = data_size;
*ctx->format = WINED3D_SHADER_BYTE_CODE_FORMAT_SM4;
*ctx->source_type = VKD3D_SHADER_SOURCE_DXBC_TPF;
break;
case TAG_AON9:
......@@ -2123,7 +2123,7 @@ static HRESULT shader_dxbc_chunk_handler(const char *data, unsigned int data_siz
FIXME("Multiple shader code chunks.\n");
shader->function = (const DWORD *)byte_code;
shader->functionLength = data_size - header->byte_code_offset;
*ctx->format = WINED3D_SHADER_BYTE_CODE_FORMAT_SM1;
*ctx->source_type = VKD3D_SHADER_SOURCE_D3D_BYTECODE;
TRACE("Feature level 9 shader version 0%08x, 0%08lx.\n",
header->shader_version, *shader->function);
}
......@@ -2142,13 +2142,13 @@ static HRESULT shader_dxbc_chunk_handler(const char *data, unsigned int data_siz
}
HRESULT shader_extract_from_dxbc(struct wined3d_shader *shader,
unsigned int max_shader_version, enum wined3d_shader_byte_code_format *format)
unsigned int max_shader_version, enum vkd3d_shader_source_type *source_type)
{
struct shader_handler_context ctx;
HRESULT hr;
ctx.shader = shader;
ctx.format = format;
ctx.source_type = source_type;
ctx.max_version = max_shader_version;
hr = parse_dxbc(shader->byte_code, shader->byte_code_size, shader_dxbc_chunk_handler, &ctx);
......
......@@ -18,8 +18,6 @@
*/
#include "wined3d_private.h"
#define LIBVKD3D_SHADER_SOURCE
#include <vkd3d_shader.h>
WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader);
......
......@@ -34,6 +34,8 @@
#include <math.h>
#include <limits.h>
#include <float.h>
#define LIBVKD3D_SHADER_SOURCE
#include <vkd3d_shader.h>
#include "ntstatus.h"
#define WIN32_NO_STATUS
#define NONAMELESSUNION
......@@ -560,12 +562,6 @@ struct wined3d_settings
extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN;
enum wined3d_shader_byte_code_format
{
WINED3D_SHADER_BYTE_CODE_FORMAT_SM1,
WINED3D_SHADER_BYTE_CODE_FORMAT_SM4,
};
enum wined3d_shader_resource_type
{
WINED3D_SHADER_RESOURCE_NONE,
......@@ -1470,7 +1466,7 @@ extern const struct wined3d_shader_frontend sm1_shader_frontend DECLSPEC_HIDDEN;
extern const struct wined3d_shader_frontend sm4_shader_frontend DECLSPEC_HIDDEN;
HRESULT shader_extract_from_dxbc(struct wined3d_shader *shader,
unsigned int max_shader_version, enum wined3d_shader_byte_code_format *format) DECLSPEC_HIDDEN;
unsigned int max_shader_version, enum vkd3d_shader_source_type *source_type) DECLSPEC_HIDDEN;
BOOL shader_get_stream_output_register_info(const struct wined3d_shader *shader,
const struct wined3d_stream_output_element *so_element, unsigned int *register_idx,
unsigned int *component_idx) DECLSPEC_HIDDEN;
......
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