Lines Matching refs:patch
775 /* Tesselates a high order rectangular patch into single triangles using gl evaluators
786 * To overcome clipping find the biggest x, y and z values of the vertices in the patch and scale
798 struct WineD3DRectPatch *patch) {
805 const WINED3DRECTPATCH_INFO *info = &patch->RectPatchInfo;
812 * patch (as opposed to normal draws) will most likely need different changes anyway. */
862 patch->has_normals = TRUE;
863 patch->has_texcoords = FALSE;
883 if(patch->has_normals) {
938 num_quads = ceilf(patch->numSegs[0]) * ceilf(patch->numSegs[1]);
942 if(patch->has_normals && patch->has_texcoords) {
949 } else if(patch->has_texcoords) {
955 } else if(patch->has_normals) {
974 if(patch->has_texcoords) {
981 glMapGrid2f(ceilf(patch->numSegs[0]), 0.0f, 1.0f, ceilf(patch->numSegs[1]), 0.0f, 1.0f);
988 glEvalMesh2(GL_FILL, 0, ceilf(patch->numSegs[0]), 0, ceilf(patch->numSegs[1]));
1008 HeapFree(GetProcessHeap(), 0, patch->mem);
1009 patch->mem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, num_quads * 6 * d3d_out_vertex_size * sizeof(float) * 8);
1023 patch->mem[i + 0] = feedbuffer[j + out_vertex_size * 2 + 2]; /* x, triangle 2 */
1024 patch->mem[i + 1] = feedbuffer[j + out_vertex_size * 2 + 3]; /* y, triangle 2 */
1025 patch->mem[i + 2] = (feedbuffer[j + out_vertex_size * 2 + 4] - 0.5f) * 4.0f * max_z; /* z, triangle 3 */
1026 if(patch->has_normals) {
1027 patch->mem[i + 3] = feedbuffer[j + out_vertex_size * 2 + 5];
1028 patch->mem[i + 4] = feedbuffer[j + out_vertex_size * 2 + 6];
1029 patch->mem[i + 5] = feedbuffer[j + out_vertex_size * 2 + 7];
1033 patch->mem[i + 0] = feedbuffer[j + out_vertex_size * 1 + 2]; /* x, triangle 2 */
1034 patch->mem[i + 1] = feedbuffer[j + out_vertex_size * 1 + 3]; /* y, triangle 2 */
1035 patch->mem[i + 2] = (feedbuffer[j + out_vertex_size * 1 + 4] - 0.5f) * 4.0f * max_z; /* z, triangle 2 */
1036 if(patch->has_normals) {
1037 patch->mem[i + 3] = feedbuffer[j + out_vertex_size * 1 + 5];
1038 patch->mem[i + 4] = feedbuffer[j + out_vertex_size * 1 + 6];
1039 patch->mem[i + 5] = feedbuffer[j + out_vertex_size * 1 + 7];
1043 patch->mem[i + 0] = feedbuffer[j + out_vertex_size * 0 + 2]; /* x, triangle 1 */
1044 patch->mem[i + 1] = feedbuffer[j + out_vertex_size * 0 + 3]; /* y, triangle 1 */
1045 patch->mem[i + 2] = (feedbuffer[j + out_vertex_size * 0 + 4] - 0.5f) * 4.0f * max_z; /* z, triangle 1 */
1046 if(patch->has_normals) {
1047 patch->mem[i + 3] = feedbuffer[j + out_vertex_size * 0 + 5];
1048 patch->mem[i + 4] = feedbuffer[j + out_vertex_size * 0 + 6];
1049 patch->mem[i + 5] = feedbuffer[j + out_vertex_size * 0 + 7];
1054 if(patch->has_normals) {
1066 glEvalMesh2(GL_FILL, 0, ceilf(patch->numSegs[0]), 0, ceilf(patch->numSegs[1]));
1081 if(patch->mem[i + 3] == 0.0f)
1082 patch->mem[i + 3] = -feedbuffer[j + out_vertex_size * 2 + 5];
1083 if(patch->mem[i + 4] == 0.0f)
1084 patch->mem[i + 4] = -feedbuffer[j + out_vertex_size * 2 + 6];
1085 if(patch->mem[i + 5] == 0.0f)
1086 patch->mem[i + 5] = -feedbuffer[j + out_vertex_size * 2 + 7];
1087 normalize_normal(patch->mem + i + 3);
1090 if(patch->mem[i + 3] == 0.0f)
1091 patch->mem[i + 3] = -feedbuffer[j + out_vertex_size * 1 + 5];
1092 if(patch->mem[i + 4] == 0.0f)
1093 patch->mem[i + 4] = -feedbuffer[j + out_vertex_size * 1 + 6];
1094 if(patch->mem[i + 5] == 0.0f)
1095 patch->mem[i + 5] = -feedbuffer[j + out_vertex_size * 1 + 7];
1096 normalize_normal(patch->mem + i + 3);
1099 if(patch->mem[i + 3] == 0.0f)
1100 patch->mem[i + 3] = -feedbuffer[j + out_vertex_size * 0 + 5];
1101 if(patch->mem[i + 4] == 0.0f)
1102 patch->mem[i + 4] = -feedbuffer[j + out_vertex_size * 0 + 6];
1103 if(patch->mem[i + 5] == 0.0f)
1104 patch->mem[i + 5] = -feedbuffer[j + out_vertex_size * 0 + 7];
1105 normalize_normal(patch->mem + i + 3);
1122 if(patch->has_normals) {
1125 if(patch->has_texcoords) {
1128 memset(&patch->strided, 0, sizeof(patch->strided));
1129 patch->strided.position.format = WINED3DFMT_R32G32B32_FLOAT;
1130 patch->strided.position.lpData = (BYTE *) patch->mem;
1131 patch->strided.position.dwStride = vtxStride;
1133 if(patch->has_normals) {
1134 patch->strided.normal.format = WINED3DFMT_R32G32B32_FLOAT;
1135 patch->strided.normal.lpData = (BYTE *) patch->mem + 3 * sizeof(float) /* pos */;
1136 patch->strided.normal.dwStride = vtxStride;
1138 if(patch->has_texcoords) {
1139 patch->strided.texCoords[0].format = WINED3DFMT_R32G32B32A32_FLOAT;
1140 patch->strided.texCoords[0].lpData = (BYTE *) patch->mem + 3 * sizeof(float) /* pos */;
1141 if(patch->has_normals) {
1142 patch->strided.texCoords[0].lpData += 3 * sizeof(float);
1144 patch->strided.texCoords[0].dwStride = vtxStride;