return buffer;
}
+static int
+i915_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe_shader_cap cap)
+{
+ switch(shader) {
+ case PIPE_SHADER_VERTEX:
+ switch (cap) {
+ case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
+ if (debug_get_bool_option("DRAW_USE_LLVM", TRUE))
+ return PIPE_MAX_SAMPLERS;
+ else
+ return 0;
+ default:
+ return draw_get_shader_param(shader, cap);
+ }
+ case PIPE_SHADER_FRAGMENT:
+ /* XXX: some of these are just shader model 2.0 values, fix this! */
+ switch(cap) {
+ case PIPE_SHADER_CAP_MAX_INSTRUCTIONS:
+ return I915_MAX_ALU_INSN + I915_MAX_TEX_INSN;
+ case PIPE_SHADER_CAP_MAX_ALU_INSTRUCTIONS:
+ return I915_MAX_ALU_INSN;
+ case PIPE_SHADER_CAP_MAX_TEX_INSTRUCTIONS:
+ return I915_MAX_TEX_INSN;
+ case PIPE_SHADER_CAP_MAX_TEX_INDIRECTIONS:
+ return 8;
+ case PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH:
+ return 0;
+ case PIPE_SHADER_CAP_MAX_INPUTS:
+ return 10;
+ case PIPE_SHADER_CAP_MAX_CONSTS:
+ return 32;
+ case PIPE_SHADER_CAP_MAX_CONST_BUFFERS:
+ return 1;
+ case PIPE_SHADER_CAP_MAX_TEMPS:
+ return 12; /* XXX: 12 -> 32 ? */
+ case PIPE_SHADER_CAP_MAX_ADDRS:
+ return 0;
+ case PIPE_SHADER_CAP_MAX_PREDS:
+ return 0;
+ case PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED:
+ return 0;
+ case PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR:
+ case PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR:
+ case PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR:
+ case PIPE_SHADER_CAP_INDIRECT_CONST_ADDR:
+ return 1;
+ case PIPE_SHADER_CAP_SUBROUTINES:
+ return 0;
+ case PIPE_SHADER_CAP_INTEGERS:
+ return 0;
+ case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
+ return I915_TEX_UNITS;
+ default:
+ debug_printf("%s: Unknown cap %u.\n", __FUNCTION__, cap);
+ return 0;
+ }
+ break;
+ default:
+ return 0;
+ }
+
+}
+
static int
i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
{
case PIPE_CAP_NPOT_TEXTURES:
case PIPE_CAP_POINT_SPRITE:
case PIPE_CAP_PRIMITIVE_RESTART: /* draw module */
- case PIPE_CAP_TEXTURE_MIRROR_REPEAT:
case PIPE_CAP_TEXTURE_SHADOW_MAP:
case PIPE_CAP_TWO_SIDED_STENCIL:
case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
case PIPE_CAP_BLEND_EQUATION_SEPARATE:
+ case PIPE_CAP_TGSI_INSTANCEID:
+ case PIPE_CAP_VERTEX_COLOR_CLAMPED:
+ case PIPE_CAP_USER_VERTEX_BUFFERS:
+ case PIPE_CAP_USER_INDEX_BUFFERS:
+ case PIPE_CAP_USER_CONSTANT_BUFFERS:
return 1;
/* Unsupported features (boolean caps). */
case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
- case PIPE_CAP_DEPTH_CLAMP:
+ case PIPE_CAP_DEPTH_CLIP_DISABLE:
case PIPE_CAP_INDEP_BLEND_ENABLE:
case PIPE_CAP_INDEP_BLEND_FUNC:
- case PIPE_CAP_TGSI_INSTANCEID:
case PIPE_CAP_SHADER_STENCIL_EXPORT:
case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
case PIPE_CAP_TEXTURE_SWIZZLE:
case PIPE_CAP_SM3:
case PIPE_CAP_SEAMLESS_CUBE_MAP:
case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
- case PIPE_CAP_FRAGMENT_COLOR_CLAMP_CONTROL:
+ case PIPE_CAP_SCALED_RESOLVE:
+ case PIPE_CAP_FRAGMENT_COLOR_CLAMPED:
case PIPE_CAP_MIXED_COLORBUFFER_FORMATS:
+ case PIPE_CAP_CONDITIONAL_RENDER:
+ case PIPE_CAP_TEXTURE_BARRIER:
+ case PIPE_CAP_TGSI_CAN_COMPACT_VARYINGS:
+ case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
+ case PIPE_CAP_VERTEX_COLOR_UNCLAMPED:
+ case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
+ case PIPE_CAP_START_INSTANCE:
+ case PIPE_CAP_QUERY_TIMESTAMP:
+ case PIPE_CAP_TEXTURE_MULTISAMPLE:
+ case PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT:
return 0;
+ case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
+ return 16;
+
/* Features we can lie about (boolean caps). */
- case PIPE_CAP_GLSL:
case PIPE_CAP_OCCLUSION_QUERY:
return is->debug.lie ? 1 : 0;
/* Texturing. */
- case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
case PIPE_CAP_MAX_COMBINED_SAMPLERS:
- return 8;
- case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS:
- return 0;
+ return i915_get_shader_param(screen,
+ PIPE_SHADER_VERTEX,
+ PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS) +
+ i915_get_shader_param(screen,
+ PIPE_SHADER_FRAGMENT,
+ PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS);
case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
return I915_MAX_TEXTURE_2D_LEVELS;
case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
return I915_MAX_TEXTURE_3D_LEVELS;
case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
return I915_MAX_TEXTURE_2D_LEVELS;
+ case PIPE_CAP_MIN_TEXEL_OFFSET:
+ case PIPE_CAP_MAX_TEXEL_OFFSET:
+ case PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS:
+ case PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS:
+ case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
+ return 0;
/* Render targets. */
case PIPE_CAP_MAX_RENDER_TARGETS:
}
}
-static int
-i915_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe_shader_cap cap)
-{
- switch(shader) {
- case PIPE_SHADER_VERTEX:
- return draw_get_shader_param(shader, cap);
- case PIPE_SHADER_FRAGMENT:
- break;
- default:
- return 0;
- }
-
- /* XXX: these are just shader model 2.0 values, fix this! */
- switch(cap) {
- case PIPE_SHADER_CAP_MAX_INSTRUCTIONS:
- return 96;
- case PIPE_SHADER_CAP_MAX_ALU_INSTRUCTIONS:
- return 64;
- case PIPE_SHADER_CAP_MAX_TEX_INSTRUCTIONS:
- return 32;
- case PIPE_SHADER_CAP_MAX_TEX_INDIRECTIONS:
- return 8;
- case PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH:
- return 0;
- case PIPE_SHADER_CAP_MAX_INPUTS:
- return 10;
- case PIPE_SHADER_CAP_MAX_CONSTS:
- return 32;
- case PIPE_SHADER_CAP_MAX_CONST_BUFFERS:
- return 1;
- case PIPE_SHADER_CAP_MAX_TEMPS:
- return 12; /* XXX: 12 -> 32 ? */
- case PIPE_SHADER_CAP_MAX_ADDRS:
- return 0;
- case PIPE_SHADER_CAP_MAX_PREDS:
- return 0;
- case PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED:
- return 0;
- case PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR:
- case PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR:
- case PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR:
- case PIPE_SHADER_CAP_INDIRECT_CONST_ADDR:
- return 1;
- case PIPE_SHADER_CAP_SUBROUTINES:
- return 0;
- case PIPE_SHADER_CAP_INTEGERS:
- return 0;
- default:
- debug_printf("%s: Unknown cap %u.\n", __FUNCTION__, cap);
- return 0;
- }
-}
-
static float
-i915_get_paramf(struct pipe_screen *screen, enum pipe_cap cap)
+i915_get_paramf(struct pipe_screen *screen, enum pipe_capf cap)
{
switch(cap) {
- case PIPE_CAP_MAX_LINE_WIDTH:
+ case PIPE_CAPF_MAX_LINE_WIDTH:
/* fall-through */
- case PIPE_CAP_MAX_LINE_WIDTH_AA:
+ case PIPE_CAPF_MAX_LINE_WIDTH_AA:
return 7.5;
- case PIPE_CAP_MAX_POINT_WIDTH:
+ case PIPE_CAPF_MAX_POINT_WIDTH:
/* fall-through */
- case PIPE_CAP_MAX_POINT_WIDTH_AA:
+ case PIPE_CAPF_MAX_POINT_WIDTH_AA:
return 255.0;
- case PIPE_CAP_MAX_TEXTURE_ANISOTROPY:
+ case PIPE_CAPF_MAX_TEXTURE_ANISOTROPY:
return 4.0;
- case PIPE_CAP_MAX_TEXTURE_LOD_BIAS:
+ case PIPE_CAPF_MAX_TEXTURE_LOD_BIAS:
return 16.0;
default:
{
static const enum pipe_format tex_supported[] = {
PIPE_FORMAT_B8G8R8A8_UNORM,
+ PIPE_FORMAT_B8G8R8A8_SRGB,
PIPE_FORMAT_B8G8R8X8_UNORM,
PIPE_FORMAT_R8G8B8A8_UNORM,
PIPE_FORMAT_R8G8B8X8_UNORM,
PIPE_FORMAT_DXT3_RGBA,
PIPE_FORMAT_DXT5_RGBA,
PIPE_FORMAT_Z24X8_UNORM,
- PIPE_FORMAT_Z24_UNORM_S8_USCALED,
+ PIPE_FORMAT_Z24_UNORM_S8_UINT,
PIPE_FORMAT_NONE /* list terminator */
};
static const enum pipe_format render_supported[] = {
PIPE_FORMAT_B8G8R8A8_UNORM,
+ PIPE_FORMAT_B8G8R8X8_UNORM,
PIPE_FORMAT_R8G8B8A8_UNORM,
+ PIPE_FORMAT_R8G8B8X8_UNORM,
PIPE_FORMAT_B5G6R5_UNORM,
PIPE_FORMAT_B10G10R10A2_UNORM,
PIPE_FORMAT_L8_UNORM,
/* XXX why not?
PIPE_FORMAT_Z16_UNORM, */
PIPE_FORMAT_Z24X8_UNORM,
- PIPE_FORMAT_Z24_UNORM_S8_USCALED,
+ PIPE_FORMAT_Z24_UNORM_S8_UINT,
PIPE_FORMAT_NONE /* list terminator */
};
const enum pipe_format *list;
list = depth_supported;
else if (tex_usage & PIPE_BIND_RENDER_TARGET)
list = render_supported;
- else
+ else if (tex_usage & PIPE_BIND_SAMPLER_VIEW)
list = tex_supported;
+ else
+ return TRUE; /* PIPE_BIND_{VERTEX,INDEX}_BUFFER */
for (i = 0; list[i] != PIPE_FORMAT_NONE; i++) {
if (list[i] == format)
{
struct i915_screen *is = i915_screen(screen);
- return is->iws->fence_signalled(is->iws, fence) == 0;
+ return is->iws->fence_signalled(is->iws, fence) == 1;
}
static boolean
{
struct i915_screen *is = i915_screen(screen);
- return is->iws->fence_finish(is->iws, fence) == 0;
+ return is->iws->fence_finish(is->iws, fence) == 1;
}
is->iws = iws;
- is->base.winsys = NULL;
-
is->base.destroy = i915_destroy_screen;
is->base.flush_frontbuffer = i915_flush_frontbuffer;