Commit 73979e71 authored by Andrew Wesie's avatar Andrew Wesie Committed by Alexandre Julliard

wined3d: Add cube array sampler support.

parent 7ee01184
......@@ -162,6 +162,7 @@ static const struct wined3d_extension_map gl_extension_map[] =
{"GL_ARB_texture_compression_bptc", ARB_TEXTURE_COMPRESSION_BPTC },
{"GL_ARB_texture_compression_rgtc", ARB_TEXTURE_COMPRESSION_RGTC },
{"GL_ARB_texture_cube_map", ARB_TEXTURE_CUBE_MAP },
{"GL_ARB_texture_cube_map_array", ARB_TEXTURE_CUBE_MAP_ARRAY },
{"GL_ARB_texture_env_combine", ARB_TEXTURE_ENV_COMBINE },
{"GL_ARB_texture_env_dot3", ARB_TEXTURE_ENV_DOT3 },
{"GL_ARB_texture_float", ARB_TEXTURE_FLOAT },
......@@ -3674,6 +3675,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter, DWORD
{ARB_VERTEX_TYPE_2_10_10_10_REV, MAKEDWORD_VERSION(3, 3)},
{ARB_GPU_SHADER5, MAKEDWORD_VERSION(4, 0)},
{ARB_TEXTURE_CUBE_MAP_ARRAY, MAKEDWORD_VERSION(4, 0)},
{ARB_ES2_COMPATIBILITY, MAKEDWORD_VERSION(4, 1)},
{ARB_VIEWPORT_ARRAY, MAKEDWORD_VERSION(4, 1)},
......
......@@ -68,6 +68,7 @@ resource_type_info[] =
{2, 2, ""}, /* WINED3D_SHADER_RESOURCE_TEXTURE_1DARRAY */
{3, 3, "2DArray"}, /* WINED3D_SHADER_RESOURCE_TEXTURE_2DARRAY */
{3, 3, ""}, /* WINED3D_SHADER_RESOURCE_TEXTURE_2DMSARRAY */
{4, 3, ""}, /* WINED3D_SHADER_RESOURCE_TEXTURE_CUBEARRAY */
};
struct glsl_dst_param
......@@ -2150,6 +2151,12 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont
sampler_type = "sampler2DArray";
break;
case WINED3D_SHADER_RESOURCE_TEXTURE_CUBEARRAY:
if (shadow_sampler)
FIXME("Unsupported Cube array shadow sampler.\n");
sampler_type = "samplerCubeArray";
break;
default:
sampler_type = "unsupported_sampler";
FIXME("Unhandled resource type %#x.\n", reg_maps->resource_info[entry->resource_idx].type);
......@@ -6273,6 +6280,8 @@ static void shader_glsl_enable_extensions(struct wined3d_string_buffer *buffer,
shader_addline(buffer, "#extension GL_ARB_shader_image_size : enable\n");
if (gl_info->supported[ARB_SHADING_LANGUAGE_PACKING])
shader_addline(buffer, "#extension GL_ARB_shading_language_packing : enable\n");
if (gl_info->supported[ARB_TEXTURE_CUBE_MAP_ARRAY])
shader_addline(buffer, "#extension GL_ARB_texture_cube_map_array : enable\n");
if (gl_info->supported[ARB_TEXTURE_QUERY_LEVELS])
shader_addline(buffer, "#extension GL_ARB_texture_query_levels : enable\n");
if (gl_info->supported[ARB_UNIFORM_BUFFER_OBJECT])
......
......@@ -1668,6 +1668,10 @@ static void shader_dump_decl_usage(struct wined3d_string_buffer *buffer,
shader_addline(buffer, "texture2dmsarray");
break;
case WINED3D_SHADER_RESOURCE_TEXTURE_CUBEARRAY:
shader_addline(buffer, "texturecubearray");
break;
default:
shader_addline(buffer, "unknown");
break;
......
......@@ -361,6 +361,7 @@ enum wined3d_sm4_resource_type
WINED3D_SM4_RESOURCE_TEXTURE_1DARRAY = 0x7,
WINED3D_SM4_RESOURCE_TEXTURE_2DARRAY = 0x8,
WINED3D_SM4_RESOURCE_TEXTURE_2DMSARRAY = 0x9,
WINED3D_SM4_RESOURCE_TEXTURE_CUBEARRAY = 0xa,
};
enum wined3d_sm4_data_type
......@@ -449,6 +450,7 @@ static const enum wined3d_shader_resource_type resource_type_table[] =
/* WINED3D_SM4_RESOURCE_TEXTURE_1DARRAY */ WINED3D_SHADER_RESOURCE_TEXTURE_1DARRAY,
/* WINED3D_SM4_RESOURCE_TEXTURE_2DARRAY */ WINED3D_SHADER_RESOURCE_TEXTURE_2DARRAY,
/* WINED3D_SM4_RESOURCE_TEXTURE_2DMSARRAY */ WINED3D_SHADER_RESOURCE_TEXTURE_2DMSARRAY,
/* WINED3D_SM4_RESOURCE_TEXTURE_CUBEARRAY */ WINED3D_SHADER_RESOURCE_TEXTURE_CUBEARRAY,
};
static const enum wined3d_data_type data_type_table[] =
......
......@@ -95,6 +95,7 @@ enum wined3d_gl_extension
ARB_TEXTURE_COMPRESSION_BPTC,
ARB_TEXTURE_COMPRESSION_RGTC,
ARB_TEXTURE_CUBE_MAP,
ARB_TEXTURE_CUBE_MAP_ARRAY,
ARB_TEXTURE_ENV_COMBINE,
ARB_TEXTURE_ENV_DOT3,
ARB_TEXTURE_FLOAT,
......
......@@ -322,6 +322,7 @@ enum wined3d_shader_resource_type
WINED3D_SHADER_RESOURCE_TEXTURE_1DARRAY,
WINED3D_SHADER_RESOURCE_TEXTURE_2DARRAY,
WINED3D_SHADER_RESOURCE_TEXTURE_2DMSARRAY,
WINED3D_SHADER_RESOURCE_TEXTURE_CUBEARRAY,
};
#define WINED3D_SHADER_CONST_VS_F 0x00000001
......
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