Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'unstable' of ssh://loggianero.com/home/abetts/git/rsxgl…

… into unstable
  • Loading branch information...
commit fedb15dfe7e8d740652439fdc6247a30847e5aee 2 parents cfebcdb + 10ac256
Alex Betts authored

Showing 2 changed files with 34 additions and 31 deletions. Show diff stats Hide diff stats

  1. +11 11 src/library/draw.cc
  2. +23 20 src/library/program.cc
22 src/library/draw.cc
@@ -1096,7 +1096,7 @@ glDrawArrays (GLenum mode, GLint first, GLsizei count)
1096 1096 RSXGL_ERROR_(GL_INVALID_VALUE);
1097 1097 }
1098 1098
1099   - if(ctx -> state.enable.conditional_render_status != RSXGL_CONDITIONAL_RENDER_ACTIVE_WAIT_FAIL) {
  1099 + if(rsx_primitive_type != ~0 && ctx -> state.enable.conditional_render_status != RSXGL_CONDITIONAL_RENDER_ACTIVE_WAIT_FAIL) {
1100 1100 rsxgl_draw(ctx,arrays_element_range_policy(first,count),single_iteration_policy(),draw_arrays_policy(rsx_primitive_type,first,count));
1101 1101 }
1102 1102
@@ -1116,7 +1116,7 @@ glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, const
1116 1116 RSXGL_ERROR_(GL_INVALID_VALUE);
1117 1117 }
1118 1118
1119   - if(ctx -> state.enable.conditional_render_status != RSXGL_CONDITIONAL_RENDER_ACTIVE_WAIT_FAIL) {
  1119 + if(rsx_primitive_type != ~0 && ctx -> state.enable.conditional_render_status != RSXGL_CONDITIONAL_RENDER_ACTIVE_WAIT_FAIL) {
1120 1120 struct element_range_policy {
1121 1121 const GLint * first;
1122 1122 const GLsizei * count;
@@ -1205,7 +1205,7 @@ glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices)
1205 1205 RSXGL_ERROR_(GL_INVALID_OPERATION);
1206 1206 }
1207 1207
1208   - if(ctx -> state.enable.conditional_render_status != RSXGL_CONDITIONAL_RENDER_ACTIVE_WAIT_FAIL) {
  1208 + if(rsx_primitive_type != ~0 && rsx_element_type != RSXGL_MAX_ELEMENT_TYPES && ctx -> state.enable.conditional_render_status != RSXGL_CONDITIONAL_RENDER_ACTIVE_WAIT_FAIL) {
1209 1209 rsxgl_draw(ctx,ignore_element_range_policy(),single_iteration_policy(),draw_elements_policy(ctx,rsx_primitive_type,rsx_element_type,count,indices));
1210 1210 }
1211 1211
@@ -1234,7 +1234,7 @@ glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenu
1234 1234 RSXGL_ERROR_(GL_INVALID_OPERATION);
1235 1235 }
1236 1236
1237   - if(ctx -> state.enable.conditional_render_status != RSXGL_CONDITIONAL_RENDER_ACTIVE_WAIT_FAIL) {
  1237 + if(rsx_primitive_type != ~0 && rsx_element_type != RSXGL_MAX_ELEMENT_TYPES && ctx -> state.enable.conditional_render_status != RSXGL_CONDITIONAL_RENDER_ACTIVE_WAIT_FAIL) {
1238 1238 rsxgl_draw(ctx,start_end_element_range_policy(start,end),single_iteration_policy(),draw_elements_policy(ctx,rsx_primitive_type,rsx_element_type,count,indices));
1239 1239 }
1240 1240
@@ -1286,7 +1286,7 @@ glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid
1286 1286 RSXGL_ERROR_(GL_INVALID_OPERATION);
1287 1287 }
1288 1288
1289   - if(ctx -> state.enable.conditional_render_status != RSXGL_CONDITIONAL_RENDER_ACTIVE_WAIT_FAIL) {
  1289 + if(rsx_primitive_type != ~0 && rsx_element_type != RSXGL_MAX_ELEMENT_TYPES && ctx -> state.enable.conditional_render_status != RSXGL_CONDITIONAL_RENDER_ACTIVE_WAIT_FAIL) {
1290 1290 rsxgl_draw(ctx,ignore_element_range_policy(),single_iteration_policy(),draw_elements_base_policy(ctx,rsx_primitive_type,rsx_element_type,count,indices,basevertex));
1291 1291 }
1292 1292
@@ -1315,7 +1315,7 @@ glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei co
1315 1315 RSXGL_ERROR_(GL_INVALID_OPERATION);
1316 1316 }
1317 1317
1318   - if(ctx -> state.enable.conditional_render_status != RSXGL_CONDITIONAL_RENDER_ACTIVE_WAIT_FAIL) {
  1318 + if(rsx_primitive_type != ~0 && rsx_element_type != RSXGL_MAX_ELEMENT_TYPES && ctx -> state.enable.conditional_render_status != RSXGL_CONDITIONAL_RENDER_ACTIVE_WAIT_FAIL) {
1319 1319 rsxgl_draw(ctx,start_end_element_range_policy(start,end),single_iteration_policy(),draw_elements_base_policy(ctx,rsx_primitive_type,rsx_element_type,count,indices,basevertex));
1320 1320 }
1321 1321
@@ -1340,7 +1340,7 @@ glMultiDrawElements (const GLenum mode, const GLsizei *count, GLenum type, const
1340 1340 RSXGL_ERROR_(GL_INVALID_OPERATION);
1341 1341 }
1342 1342
1343   - if(ctx -> state.enable.conditional_render_status != RSXGL_CONDITIONAL_RENDER_ACTIVE_WAIT_FAIL) {
  1343 + if(rsx_primitive_type != ~0 && rsx_element_type != RSXGL_MAX_ELEMENT_TYPES && ctx -> state.enable.conditional_render_status != RSXGL_CONDITIONAL_RENDER_ACTIVE_WAIT_FAIL) {
1344 1344 struct draw_policy : public element_draw_policy, public multi_draw_policy {
1345 1345 const GLsizei * count;
1346 1346 const GLvoid * const * indices;
@@ -1390,7 +1390,7 @@ glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, c
1390 1390 RSXGL_ERROR_(GL_INVALID_OPERATION);
1391 1391 }
1392 1392
1393   - if(ctx -> state.enable.conditional_render_status != RSXGL_CONDITIONAL_RENDER_ACTIVE_WAIT_FAIL) {
  1393 + if(rsx_primitive_type != ~0 && rsx_element_type != RSXGL_MAX_ELEMENT_TYPES && ctx -> state.enable.conditional_render_status != RSXGL_CONDITIONAL_RENDER_ACTIVE_WAIT_FAIL) {
1394 1394 struct draw_policy : public element_draw_policy, public base_element_draw_policy, public multi_draw_policy {
1395 1395 const GLsizei * count;
1396 1396 const GLvoid * const * indices;
@@ -1442,7 +1442,7 @@ glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei primcoun
1442 1442 RSXGL_ERROR_(GL_INVALID_VALUE);
1443 1443 }
1444 1444
1445   - if(ctx -> state.enable.conditional_render_status != RSXGL_CONDITIONAL_RENDER_ACTIVE_WAIT_FAIL) {
  1445 + if(rsx_primitive_type != ~0 && ctx -> state.enable.conditional_render_status != RSXGL_CONDITIONAL_RENDER_ACTIVE_WAIT_FAIL) {
1446 1446 struct draw_policy : public array_draw_policy, public instanced_draw_policy {
1447 1447 const GLint first;
1448 1448 const GLsizei count;
@@ -1492,7 +1492,7 @@ glDrawElementsInstanced (const GLenum mode, const GLsizei count, const GLenum ty
1492 1492 RSXGL_ERROR_(GL_INVALID_VALUE);
1493 1493 }
1494 1494
1495   - if(ctx -> state.enable.conditional_render_status != RSXGL_CONDITIONAL_RENDER_ACTIVE_WAIT_FAIL) {
  1495 + if(rsx_primitive_type != ~0 && rsx_element_type != RSXGL_MAX_ELEMENT_TYPES && ctx -> state.enable.conditional_render_status != RSXGL_CONDITIONAL_RENDER_ACTIVE_WAIT_FAIL) {
1496 1496 struct draw_policy : public element_draw_policy, public instanced_draw_policy {
1497 1497 const GLsizei count;
1498 1498 const GLvoid * indices;
@@ -1549,7 +1549,7 @@ glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, cons
1549 1549 RSXGL_ERROR_(GL_INVALID_VALUE);
1550 1550 }
1551 1551
1552   - if(ctx -> state.enable.conditional_render_status != RSXGL_CONDITIONAL_RENDER_ACTIVE_WAIT_FAIL) {
  1552 + if(rsx_primitive_type != ~0 && rsx_element_type != RSXGL_MAX_ELEMENT_TYPES && ctx -> state.enable.conditional_render_status != RSXGL_CONDITIONAL_RENDER_ACTIVE_WAIT_FAIL) {
1553 1553 struct draw_policy : public element_draw_policy, public base_element_draw_policy, public instanced_draw_policy {
1554 1554 const GLsizei count;
1555 1555 const GLvoid * indices;
43 src/library/program.cc
@@ -1348,27 +1348,30 @@ glUseProgram (GLuint program_name)
1348 1348
1349 1349 ctx -> program_binding.bind(RSXGL_ACTIVE_PROGRAM,program_name);
1350 1350 ctx -> invalid.parts.program = 1;
1351   - ctx -> state.enable.transform_feedback_program = (program_t::storage().at(program_name).streamvp_num_insn > 0 && program_t::storage().at(program_name).streamfp_num_insn > 0);
1352   -
1353   - if(prev_program_name != 0) {
1354   - const program_t::texture_assignments_bitfield_type
1355   - textures_enabled = program_t::storage().at(prev_program_name).textures_enabled;
1356   - const program_t::texture_assignments_type
1357   - prev_assignments = program_t::storage().at(prev_program_name).texture_assignments,
1358   - assignments = program_t::storage().at(program_name).texture_assignments;
1359   -
1360   - program_t::texture_assignments_bitfield_type::const_iterator
1361   - enabled_it = textures_enabled.begin();
1362   - program_t::texture_assignments_type::const_iterator
1363   - prev_it = prev_assignments.begin(),
1364   - it = assignments.begin();
1365   -
1366   - for(program_t::texture_size_type i = 0;i < program_t::texture_assignments_bitfield_type::size;++i,enabled_it.next(textures_enabled),prev_it.next(prev_assignments),it.next(assignments)) {
1367   - ctx -> invalid_texture_assignments.set(enabled_it.test() && (prev_it.value() != it.value()));
  1351 +
  1352 + if(program_name != 0) {
  1353 + ctx -> state.enable.transform_feedback_program = (program_t::storage().at(program_name).streamvp_num_insn > 0 && program_t::storage().at(program_name).streamfp_num_insn > 0);
  1354 +
  1355 + if(prev_program_name != 0) {
  1356 + const program_t::texture_assignments_bitfield_type
  1357 + textures_enabled = program_t::storage().at(prev_program_name).textures_enabled;
  1358 + const program_t::texture_assignments_type
  1359 + prev_assignments = program_t::storage().at(prev_program_name).texture_assignments,
  1360 + assignments = program_t::storage().at(program_name).texture_assignments;
  1361 +
  1362 + program_t::texture_assignments_bitfield_type::const_iterator
  1363 + enabled_it = textures_enabled.begin();
  1364 + program_t::texture_assignments_type::const_iterator
  1365 + prev_it = prev_assignments.begin(),
  1366 + it = assignments.begin();
  1367 +
  1368 + for(program_t::texture_size_type i = 0;i < program_t::texture_assignments_bitfield_type::size;++i,enabled_it.next(textures_enabled),prev_it.next(prev_assignments),it.next(assignments)) {
  1369 + ctx -> invalid_texture_assignments.set(enabled_it.test() && (prev_it.value() != it.value()));
  1370 + }
  1371 + }
  1372 + else {
  1373 + ctx -> invalid_texture_assignments = ctx -> program_binding[RSXGL_ACTIVE_PROGRAM].textures_enabled;
1368 1374 }
1369   - }
1370   - else {
1371   - ctx -> invalid_texture_assignments = ctx -> program_binding[RSXGL_ACTIVE_PROGRAM].textures_enabled;
1372 1375 }
1373 1376 }
1374 1377

0 comments on commit fedb15d

Please sign in to comment.
Something went wrong with that request. Please try again.