case PIPE_CAP_TGSI_CAN_COMPACT_VARYINGS:
case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
case PIPE_CAP_VERTEX_COLOR_CLAMPED:
- case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY:
- case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY:
- case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY:
case PIPE_CAP_USER_INDEX_BUFFERS:
case PIPE_CAP_USER_CONSTANT_BUFFERS:
return 1;
case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
case PIPE_CAP_FRAGMENT_COLOR_CLAMPED:
case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
- case PIPE_CAP_USER_VERTEX_BUFFERS:
return 0;
/* SWTCL-only features. */
case PIPE_CAP_PRIMITIVE_RESTART:
+ case PIPE_CAP_USER_VERTEX_BUFFERS:
return !r300screen->caps.has_tcl;
+ /* HWTCL-only features / limitations. */
+ case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY:
+ case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY:
+ case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY:
+ return r300screen->caps.has_tcl;
+
/* Texturing. */
case PIPE_CAP_MAX_COMBINED_SAMPLERS:
return r300screen->caps.num_tex_units;
}
/* Check vertex buffer format support. */
- if (usage & PIPE_BIND_VERTEX_BUFFER &&
- /* Half float is supported on >= R400. */
- (is_r400 || is_r500 || !is_half_float) &&
- r300_translate_vertex_data_type(format) != R300_INVALID_FORMAT) {
- retval |= PIPE_BIND_VERTEX_BUFFER;
+ if (usage & PIPE_BIND_VERTEX_BUFFER) {
+ if (r300_screen(screen)->caps.has_tcl) {
+ /* Half float is supported on >= R400. */
+ if ((is_r400 || is_r500 || !is_half_float) &&
+ r300_translate_vertex_data_type(format) != R300_INVALID_FORMAT) {
+ retval |= PIPE_BIND_VERTEX_BUFFER;
+ }
+ } else {
+ /* SW TCL */
+ if (!util_format_is_pure_integer(format)) {
+ retval |= PIPE_BIND_VERTEX_BUFFER;
+ }
+ }
}
/* Transfers are always supported. */
struct pipe_constant_buffer *cb)
{
struct r300_context* r300 = r300_context(pipe);
- struct pipe_resource *buf = cb ? cb->buffer : NULL;
struct r300_constant_buffer *cbuf;
- struct r300_resource *rbuf = r300_resource(buf);
uint32_t *mapped;
+ if (!cb)
+ return;
+
switch (shader) {
case PIPE_SHADER_VERTEX:
cbuf = (struct r300_constant_buffer*)r300->vs_constants.state;
return;
}
- if (buf == NULL || buf->width0 == 0)
- return;
if (cb->user_buffer)
mapped = (uint32_t*)cb->user_buffer;
- else if (rbuf->constant_buffer)
- mapped = (uint32_t*)rbuf->constant_buffer;
- else
- return;
+ else {
+ struct r300_resource *rbuf = r300_resource(cb->buffer);
+
+ if (rbuf && rbuf->constant_buffer)
+ mapped = (uint32_t*)rbuf->constant_buffer;
+ else
+ return;
+ }
if (shader == PIPE_SHADER_FRAGMENT ||
(shader == PIPE_SHADER_VERTEX && r300->screen->caps.has_tcl)) {
r300_mark_atom_dirty(r300, &r300->vs_constants);
} else if (r300->draw) {
draw_set_mapped_constant_buffer(r300->draw, PIPE_SHADER_VERTEX,
- 0, mapped, buf->width0);
+ 0, mapped, cb->buffer_size);
}
} else if (shader == PIPE_SHADER_FRAGMENT) {
r300_mark_atom_dirty(r300, &r300->fs_constants);