Commit 37942913 authored by Marek Olšák's avatar Marek Olšák

gallium: add PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS

v2: remove PIPE_CAP_ARRAY_TEXTURES in favor of the new CAP.
parent 5a175127
...@@ -124,7 +124,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap) ...@@ -124,7 +124,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
return is->debug.lie ? 1 : 0; return is->debug.lie ? 1 : 0;
/* Unsupported features (boolean caps). */ /* Unsupported features (boolean caps). */
case PIPE_CAP_ARRAY_TEXTURES: case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
case PIPE_CAP_DEPTH_CLAMP: case PIPE_CAP_DEPTH_CLAMP:
case PIPE_CAP_INDEP_BLEND_ENABLE: case PIPE_CAP_INDEP_BLEND_ENABLE:
case PIPE_CAP_INDEP_BLEND_FUNC: case PIPE_CAP_INDEP_BLEND_FUNC:
......
...@@ -88,7 +88,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) ...@@ -88,7 +88,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
return 10; return 10;
case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS: case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
return 13; return 13;
case PIPE_CAP_ARRAY_TEXTURES: /* shader support missing */ case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS: /* shader support missing */
return 0; return 0;
case PIPE_CAP_TEXTURE_MIRROR_CLAMP: case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
case PIPE_CAP_TEXTURE_MIRROR_REPEAT: case PIPE_CAP_TEXTURE_MIRROR_REPEAT:
......
...@@ -79,8 +79,8 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) ...@@ -79,8 +79,8 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
return 10; return 10;
case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS: case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
return 13; return 13;
case PIPE_CAP_ARRAY_TEXTURES: case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
return 1; return 8192;
case PIPE_CAP_TEXTURE_MIRROR_CLAMP: case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
case PIPE_CAP_TEXTURE_MIRROR_REPEAT: case PIPE_CAP_TEXTURE_MIRROR_REPEAT:
case PIPE_CAP_TEXTURE_SWIZZLE: case PIPE_CAP_TEXTURE_SWIZZLE:
......
...@@ -85,7 +85,7 @@ nvfx_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) ...@@ -85,7 +85,7 @@ nvfx_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
return 0; // TODO: implement depth clamp return 0; // TODO: implement depth clamp
case PIPE_CAP_PRIMITIVE_RESTART: case PIPE_CAP_PRIMITIVE_RESTART:
return 0; // TODO: implement primitive restart return 0; // TODO: implement primitive restart
case PIPE_CAP_ARRAY_TEXTURES: case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
case PIPE_CAP_TGSI_INSTANCEID: case PIPE_CAP_TGSI_INSTANCEID:
case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR: case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
case PIPE_CAP_FRAGMENT_COLOR_CLAMP_CONTROL: case PIPE_CAP_FRAGMENT_COLOR_CLAMP_CONTROL:
......
...@@ -135,7 +135,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param) ...@@ -135,7 +135,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
case PIPE_CAP_DEPTH_CLAMP: case PIPE_CAP_DEPTH_CLAMP:
case PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE: case PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE:
case PIPE_CAP_SHADER_STENCIL_EXPORT: case PIPE_CAP_SHADER_STENCIL_EXPORT:
case PIPE_CAP_ARRAY_TEXTURES: case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
case PIPE_CAP_TGSI_INSTANCEID: case PIPE_CAP_TGSI_INSTANCEID:
case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT: case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT:
case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER: case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER:
......
...@@ -380,9 +380,8 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param) ...@@ -380,9 +380,8 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER: case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER:
return 0; return 0;
case PIPE_CAP_ARRAY_TEXTURES: case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
/* fix once the CS checker upstream is fixed */ return 0; /* will be re-enabled in the following commits. */
return debug_get_bool_option("R600_ARRAY_TEXTURE", FALSE);
/* Texturing. */ /* Texturing. */
case PIPE_CAP_MAX_TEXTURE_2D_LEVELS: case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
......
...@@ -129,8 +129,8 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param) ...@@ -129,8 +129,8 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
case PIPE_CAP_TGSI_INSTANCEID: case PIPE_CAP_TGSI_INSTANCEID:
case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR: case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
return 1; return 1;
case PIPE_CAP_ARRAY_TEXTURES: case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
return 1; return 64; /* matches core Mesa defaults */
case PIPE_CAP_MIN_TEXEL_OFFSET: case PIPE_CAP_MIN_TEXEL_OFFSET:
return -8; return -8;
case PIPE_CAP_MAX_TEXEL_OFFSET: case PIPE_CAP_MAX_TEXEL_OFFSET:
......
...@@ -458,7 +458,7 @@ enum pipe_cap { ...@@ -458,7 +458,7 @@ enum pipe_cap {
/** different blend funcs per rendertarget */ /** different blend funcs per rendertarget */
PIPE_CAP_INDEP_BLEND_FUNC = 34, PIPE_CAP_INDEP_BLEND_FUNC = 34,
PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE = 35, PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE = 35,
PIPE_CAP_ARRAY_TEXTURES = 36, PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS = 36,
PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT = 37, PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT = 37,
PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT = 38, PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT = 38,
PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER = 39, PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER = 39,
......
...@@ -85,6 +85,9 @@ void st_init_limits(struct st_context *st) ...@@ -85,6 +85,9 @@ void st_init_limits(struct st_context *st)
c->MaxTextureRectSize c->MaxTextureRectSize
= _min(1 << (c->MaxTextureLevels - 1), MAX_TEXTURE_RECT_SIZE); = _min(1 << (c->MaxTextureLevels - 1), MAX_TEXTURE_RECT_SIZE);
c->MaxArrayTextureLayers
= screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS);
c->MaxTextureImageUnits c->MaxTextureImageUnits
= _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS), = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS),
MAX_TEXTURE_IMAGE_UNITS); MAX_TEXTURE_IMAGE_UNITS);
...@@ -505,7 +508,7 @@ void st_init_extensions(struct st_context *st) ...@@ -505,7 +508,7 @@ void st_init_extensions(struct st_context *st)
} }
/* GL_EXT_texture_array */ /* GL_EXT_texture_array */
if (screen->get_param(screen, PIPE_CAP_ARRAY_TEXTURES)) { if (screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS) > 1) {
ctx->Extensions.EXT_texture_array = GL_TRUE; ctx->Extensions.EXT_texture_array = GL_TRUE;
ctx->Extensions.MESA_texture_array = GL_TRUE; ctx->Extensions.MESA_texture_array = GL_TRUE;
} }
......
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